diff --git a/README.md b/README.md index 5131cb4..2a2a1aa 100755 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ Start Turf.js easily. - [Turf.js v6.5.0](http://turfjs.org/) -- [MapLibre GL JS v2.1.9](https://maplibre.org) -- [TypeScript v4.5.4](https://www.typescriptlang.org) -- [Vite v2.9.9](https://vitejs.dev) +- [MapLibre GL JS v3.1.0](https://maplibre.org) +- [TypeScript v5.1.6](https://www.typescriptlang.org) +- [Vite v4.3.9](https://vitejs.dev) - node v18.1.0 - npm v8.8.0 @@ -49,7 +49,7 @@ npm run dev ## License MIT -Copyright (c) 2019-2022 Yasunori Kirimoto +Copyright (c) 2019-2023 Yasunori Kirimoto
@@ -67,8 +67,9 @@ Copyright (c) 2019-2022 Yasunori Kirimoto Turf.jsを手軽に始める - [Turf.js v6.5.0](http://turfjs.org/) -- [TypeScript v4.5.4](https://www.typescriptlang.org) -- [Vite v2.9.9](https://vitejs.dev) +- [MapLibre GL JS v3.1.0](https://maplibre.org) +- [TypeScript v5.1.6](https://www.typescriptlang.org) +- [Vite v4.3.9](https://vitejs.dev) - node v18.1.0 - npm v8.8.0 @@ -112,6 +113,6 @@ npm run dev ## ライセンス MIT -Copyright (c) 2019-2022 Yasunori Kirimoto +Copyright (c) 2019-2023 Yasunori Kirimoto
diff --git a/dist/index.html b/dist/index.html index 337da93..a54f0e0 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,10 +5,11 @@ Turf.js Starter - - + +
+ diff --git a/docs/assets/index-83eeea77.js b/docs/assets/index-83eeea77.js new file mode 100644 index 0000000..55c4151 --- /dev/null +++ b/docs/assets/index-83eeea77.js @@ -0,0 +1,580 @@ +(function(){const Ke=document.createElement("link").relList;if(Ke&&Ke.supports&&Ke.supports("modulepreload"))return;for(const ht of document.querySelectorAll('link[rel="modulepreload"]'))Ye(ht);new MutationObserver(ht=>{for(const jt of ht)if(jt.type==="childList")for(const Qi of jt.addedNodes)Qi.tagName==="LINK"&&Qi.rel==="modulepreload"&&Ye(Qi)}).observe(document,{childList:!0,subtree:!0});function Xe(ht){const jt={};return ht.integrity&&(jt.integrity=ht.integrity),ht.referrerPolicy&&(jt.referrerPolicy=ht.referrerPolicy),ht.crossOrigin==="use-credentials"?jt.credentials="include":ht.crossOrigin==="anonymous"?jt.credentials="omit":jt.credentials="same-origin",jt}function Ye(ht){if(ht.ep)return;ht.ep=!0;const jt=Xe(ht);fetch(ht.href,jt)}})();var Np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $p(Je){return Je&&Je.__esModule&&Object.prototype.hasOwnProperty.call(Je,"default")?Je.default:Je}var eu={exports:{}};(function(Je,Ke){(function(Xe,Ye){Je.exports=Ye()})(Np,function(){var Xe,Ye,ht;function jt(h,vt){if(!Xe)Xe=vt;else if(!Ye)Ye=vt;else{var te="var sharedChunk = {}; ("+Xe+")(sharedChunk); ("+Ye+")(sharedChunk);",Kt={};Xe(Kt),ht=vt(Kt),typeof window<"u"&&(ht.workerUrl=window.URL.createObjectURL(new Blob([te],{type:"text/javascript"})))}}jt(["exports"],function(h){function vt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var te=Kt;function Kt(i,e){this.x=i,this.y=e}Kt.prototype={clone:function(){return new Kt(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),s=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,e){var r=Math.cos(i),s=Math.sin(i),l=e.y+s*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-s*(this.y-e.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Kt.convert=function(i){return i instanceof Kt?i:Array.isArray(i)?new Kt(i[0],i[1]):i};var Ae=vt(te),Li=er;function er(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}er.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?p=r:f=r,r=.5*(f-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Cr=vt(Li);function Mr(i,e,r,s){const l=new Cr(i,e,r,s);return function(u){return l.solve(u)}}const pr=Mr(.25,.1,.25,1);function ot(i,e,r){return Math.min(r,Math.max(e,i))}function mi(i,e,r){const s=r-e,l=((i-e)%s+s)%s+e;return l===e?r:l}function _t(i,...e){for(const r of e)for(const s in r)i[s]=r[s];return i}let ji=1;function gi(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Pr(i,e,r){const s={};for(const l in i)s[l]=e.call(r||this,i[l],l,i);return s}function cn(i,e,r){const s={};for(const l in i)e.call(r||this,i[l],l,i)&&(s[l]=i[l]);return s}function _i(i){return Array.isArray(i)?i.map(_i):typeof i=="object"&&i?Pr(i,_i):i}const jr={};function ti(i){jr[i]||(typeof console<"u"&&console.warn(i),jr[i]=!0)}function ct(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function na(i){let e=0;for(let r,s,l=0,u=i.length,p=u-1;lcancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(hn||(hn=document.createElement("a")),hn.href=i,hn.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Gr==null&&(Gr=matchMedia("(prefers-reduced-motion: reduce)")),Gr.matches)}},Bn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class kr extends Error{constructor(e,r,s,l){super(`AJAXError: ${r} (${e}): ${s}`),this.status=e,this.statusText=r,this.url=s,this.body=l}}const ci=Bi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Ri=i=>Bn.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function Yt(i,e){const r=new AbortController,s=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:ci(),signal:r.signal});let l=!1,u=!1;return i.type==="json"&&s.headers.set("Accept","application/json"),u||fetch(s).then(p=>p.ok?(f=>{(i.type==="arrayBuffer"||i.type==="image"?f.arrayBuffer():i.type==="json"?f.json():f.text()).then(g=>{u||(l=!0,e(null,g,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(g=>{u||e(new Error(g.message))})})(p):p.blob().then(f=>e(new kr(p.status,p.statusText,i.url,f)))).catch(p=>{p.code!==20&&e(new Error(p.message))}),{cancel:()=>{u=!0,l||r.abort()}}}const pn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Bi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Bi())return(Ri(i.url)||Yt)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(ci())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Yt(i,e);if(Bi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(s,l){const u=new XMLHttpRequest;u.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(u.responseType="arraybuffer");for(const p in s.headers)u.setRequestHeader(p,s.headers[p]);return s.type==="json"&&(u.responseType="text",u.setRequestHeader("Accept","application/json")),u.withCredentials=s.credentials==="include",u.onerror=()=>{l(new Error(u.statusText))},u.onload=()=>{if((u.status>=200&&u.status<300||u.status===0)&&u.response!==null){let p=u.response;if(s.type==="json")try{p=JSON.parse(u.response)}catch(f){return l(f)}l(null,p,u.getResponseHeader("Cache-Control"),u.getResponseHeader("Expires"))}else{const p=new Blob([u.response],{type:u.getResponseHeader("Content-Type")});l(new kr(u.status,u.statusText,s.url,p))}},u.send(s.body),{cancel:()=>u.abort()}}(i,e)},dn=function(i,e){return pn(_t(i,{type:"arrayBuffer"}),e)};function Xr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Dr(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function mr(i,e,r){if(r&&r[i]){const s=r[i].indexOf(e);s!==-1&&r[i].splice(s,1)}}class gr{constructor(e,r={}){_t(this,r),this.type=e}}class Fi extends gr{constructor(e,r={}){super("error",_t({error:e},r))}}class fn{on(e,r){return this._listeners=this._listeners||{},Dr(e,r,this._listeners),this}off(e,r){return mr(e,r,this._listeners),mr(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Dr(e,r,this._oneTimeListeners),this):new Promise(s=>this.once(e,s))}fire(e,r){typeof e=="string"&&(e=new gr(e,r||{}));const s=e.type;if(this.listens(s)){e.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const f of l)f.call(this,e);const u=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of u)mr(s,f,this._oneTimeListeners),f.call(this,e);const p=this._eventedParent;p&&(_t(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof Fi&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},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},"*":{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:{}},default:"mapbox"},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:"*"},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:{},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_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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","property-type":"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","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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-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"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},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:"*",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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","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-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],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-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"]},"property-type":"cross-faded"},"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"},"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:"number",default:335,minimum:0,maximum:359,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:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",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"}},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"}}};const Lr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Rn(i,e){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return Lr.forEach(s=>{s in e&&(r[s]=e[s])}),r}function pt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const On=[Br,pe,qe,Ne,yi,yr,Vt,Jt(Ue),Zi,xr];function ir(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ir(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of On)if(!ir(r,e))return null}}return`Expected ${mt(i)} but found ${mt(e)} instead.`}function F(i,e){return e.some(r=>r.kind===i.kind)}function S(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function A(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const z=.96422,V=.82521,N=4/29,X=6/29,j=3*X*X,$=X*X*X,H=Math.PI/180,ne=180/Math.PI;function ae(i){return(i%=360)<0&&(i+=360),i}function se([i,e,r,s]){let l,u;const p=Oe((.2225045*(i=De(i))+.7168786*(e=De(e))+.0606169*(r=De(r)))/1);i===e&&e===r?l=u=p:(l=Oe((.4360747*i+.3850649*e+.1430804*r)/z),u=Oe((.0139322*i+.0971045*e+.7141733*r)/V));const f=116*p-16;return[f<0?0:f,500*(l-p),200*(p-u),s]}function De(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Oe(i){return i>$?Math.pow(i,1/3):i/j+N}function Se([i,e,r,s]){let l=(i+16)/116,u=isNaN(e)?l:l+e/500,p=isNaN(r)?l:l-r/200;return l=1*Fe(l),u=z*Fe(u),p=V*Fe(p),[Pe(3.1338561*u-1.6168667*l-.4906146*p),Pe(-.9787684*u+1.9161415*l+.033454*p),Pe(.0719453*u-.2289914*l+1.4052427*p),s]}function Pe(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Fe(i){return i>X?i*i*i:j*(i-N)}function He(i){return parseInt(i.padEnd(2,i),16)/255}function je(i,e){return et(e?i/100:i,0,1)}function et(i,e,r){return Math.min(Math.max(e,i),r)}function dt(i){return!i.some(Number.isNaN)}const Lt={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],olive:[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]};class Re{constructor(e,r,s,l=1,u=!0){this.r=e,this.g=r,this.b=s,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[e,r,s,l]))}static parse(e){if(e instanceof Re)return e;if(typeof e!="string")return;const r=function(s){if((s=s.toLowerCase())==="transparent")return[0,0,0,0];const l=Lt[s];if(l){const[p,f,g]=l;return[p/255,f/255,g/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const p=s.length<6?1:2;let f=1;return[He(s.slice(f,f+=p)),He(s.slice(f,f+=p)),He(s.slice(f,f+=p)),He(s.slice(f,f+p)||"ff")]}if(s.startsWith("rgb")){const p=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[f,g,v,b,E,I,C,P,R,L,G,W]=p,q=[b||" ",C||" ",L].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const Y=[v,I,R].join(""),Q=Y==="%%%"?100:Y===""?255:0;if(Q){const re=[et(+g/Q,0,1),et(+E/Q,0,1),et(+P/Q,0,1),G?je(+G,W):1];if(dt(re))return re}}return}}const u=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[p,f,g,v,b,E,I,C,P]=u,R=[g||" ",b||" ",I].join("");if(R===" "||R===" /"||R===",,"||R===",,,"){const L=[+f,et(+v,0,100),et(+E,0,100),C?je(+C,P):1];if(dt(L))return function([G,W,q,Y]){function Q(re){const Te=(re+G/30)%12,Ie=W*Math.min(q,1-q);return q-Ie*Math.max(-1,Math.min(Te-3,9-Te,1))}return G=ae(G),W/=100,q/=100,[Q(0),Q(8),Q(4),Y]}(L)}}}(e);return r?new Re(...r,!1):void 0}get rgb(){const{r:e,g:r,b:s,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[e/u,r/u,s/u,l])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,s,l,u]=se(e),p=Math.sqrt(s*s+l*l);return[Math.round(1e4*p)?ae(Math.atan2(l,s)*ne):NaN,p,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",se(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,s,l]=this.rgb;return`rgba(${[e,r,s].map(u=>Math.round(255*u)).join(",")},${l})`}}Re.black=new Re(0,0,0,1),Re.white=new Re(1,1,1,1),Re.transparent=new Re(0,0,0,0),Re.red=new Re(1,0,0,1);class Et{constructor(e,r,s){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Rr{constructor(e,r,s,l,u){this.text=e,this.image=r,this.scale=s,this.fontStack=l,this.textColor=u}}class Qt{constructor(e){this.sections=e}static fromString(e){return new Qt([new Rr(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Qt?e:Qt.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Ti{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ti)return e;if(typeof e=="number")return new Ti([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Ti(e)}}toString(){return JSON.stringify(this.values)}}class Oi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Oi({name:e,available:!1}):null}}function _n(i,e,r,s){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,e,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,e,r,s]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ls(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Re||i instanceof Et||i instanceof Qt||i instanceof Ti||i instanceof Oi)return!0;if(Array.isArray(i)){for(const e of i)if(!ls(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!ls(i[e]))return!1;return!0}return!1}function Bt(i){if(i===null)return Br;if(typeof i=="string")return qe;if(typeof i=="boolean")return Ne;if(typeof i=="number")return pe;if(i instanceof Re)return yi;if(i instanceof Et)return _r;if(i instanceof Qt)return yr;if(i instanceof Ti)return Zi;if(i instanceof Oi)return xr;if(Array.isArray(i)){const e=i.length;let r;for(const s of i){const l=Bt(s);if(r){if(r===l)continue;r=Ue;break}r=l}return Jt(r||Ue,e)}return Vt}function Un(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof Re||i instanceof Qt||i instanceof Ti||i instanceof Oi?i.toString():JSON.stringify(i)}class Fr{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ls(e[1]))return r.error("invalid value");const s=e[1];let l=Bt(s);const u=r.expectedType;return l.kind!=="array"||l.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(l=u),new Fr(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ct{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const cs={string:qe,number:pe,boolean:Ne,object:Vt};class Gi{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let s,l=1;const u=e[0];if(u==="array"){let f,g;if(e.length>2){const v=e[1];if(typeof v!="string"||!(v in cs)||v==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=cs[v],l++}else f=Ue;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=e[2],l++}s=Jt(f,g)}else{if(!cs[u])throw new Error(`Types doesn't contain name = ${u}`);s=cs[u]}const p=[];for(;le.outputDefined())}}const oo={"to-boolean":Ne,"to-color":yi,"to-number":pe,"to-string":qe};class ei{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[0];if(!oo[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return r.error("Expected one argument.");const l=oo[s],u=[];for(let p=1;p4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:_n(r[0],r[1],r[2],r[3]),!s))return new Re(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Ct(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="padding"){let r;for(const s of this.args){r=s.evaluate(e);const l=Ti.parse(r);if(l)return l}throw new Ct(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="number"){let r=null;for(const s of this.args){if(r=s.evaluate(e),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new Ct(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?Qt.fromString(Un(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Oi.fromString(Un(this.args[0].evaluate(e))):Un(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const sa=["Unknown","Point","LineString","Polygon"];class hs{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?sa[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 r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Re.parse(e)),r}}class Or{constructor(e,r,s=[],l,u=new gn,p=[]){this.registry=e,this.path=s,this.key=s.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=p,this.expectedType=l,this._isConstant=r}parse(e,r,s,l,u={}){return r?this.concat(r,s,l)._parse(e,u):this._parse(e,u)}_parse(e,r){function s(l,u,p){return p==="assert"?new Gi(u,[l]):p==="coerce"?new ei(u,[l]):l}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=e[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const u=this.registry[l];if(u){let p=u.parse(e,this);if(!p)return null;if(this.expectedType){const f=this.expectedType,g=p.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||g.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(f.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array"){if(this.checkSubtype(f,g))return null}else p=s(p,f,r.typeAnnotation||"coerce");else p=s(p,f,r.typeAnnotation||"coerce");else p=s(p,f,r.typeAnnotation||"assert")}if(!(p instanceof Fr)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const f=new hs;try{p=new Fr(p.type,p.evaluate(f))}catch(g){return this.error(g.message),null}}return p}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,s){const l=typeof e=="number"?this.path.concat(e):this.path,u=s?this.scope.concat(s):this.scope;return new Or(this.registry,this._isConstant,l,r||null,u,this.errors)}error(e,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new ii(s,e))}checkSubtype(e,r){const s=ir(e,r);return s&&this.error(s),s}}class st{constructor(e,r,s){this.type=_r,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,Ne);if(!l)return null;const u=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Ne);if(!u)return null;let p=null;return s.locale&&(p=r.parse(s.locale,1,qe),!p)?null:new st(l,u,p)}evaluate(e){return new Et(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}}const Ur=8192;function Vn(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function us(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function lo(i,e){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,e.z);return[Math.round(r*l*Ur),Math.round(s*l*Ur)]}function co(i,e,r){const s=i[0]-e[0],l=i[1]-e[1],u=i[0]-r[0],p=i[1]-r[1];return s*p-u*l==0&&s*u<=0&&l*p<=0}function aa(i,e){let r=!1;for(let p=0,f=e.length;p(s=i)[1]!=(u=g[v+1])[1]>s[1]&&s[0]<(u[0]-l[0])*(s[1]-l[1])/(u[1]-l[1])+l[0]&&(r=!r)}}var s,l,u;return r}function ho(i,e){for(let r=0;r0&&f<0||p<0&&f>0}function dl(i,e,r){for(const v of r)for(let b=0;br[2]){const l=.5*s;let u=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;u===0&&(u=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=u}Vn(e,i)}function po(i,e,r,s){const l=Math.pow(2,s.z)*Ur,u=[s.x*Ur,s.y*Ur],p=[];for(const f of i)for(const g of f){const v=[g.x+u[0],g.y+u[1]];ha(v,e,r,l),p.push(v)}return p}function fo(i,e,r,s){const l=Math.pow(2,s.z)*Ur,u=[s.x*Ur,s.y*Ur],p=[];for(const g of i){const v=[];for(const b of g){const E=[b.x+u[0],b.y+u[1]];Vn(e,E),v.push(E)}p.push(v)}if(e[2]-e[0]<=l/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const g of p)for(const v of g)ha(v,e,r,l)}var f;return p}class vr{constructor(e,r){this.type=Ne,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ls(e[1])){const s=e[1];if(s.type==="FeatureCollection")for(let l=0;l!Array.isArray(v)||v.length===e.length-1);let g=null;for(const[v,b]of f){g=new Or(r.registry,ds,r.path,null,r.scope);const E=[];let I=!1;for(let C=1;C{return I=E,Array.isArray(I)?`(${I.map(mt).join(", ")})`:`(${mt(I.type)}...)`;var I}).join(" | "),b=[];for(let E=1;E{r=e?r&&ds(s):r&&s instanceof Fr}),!!r&&Nn(i)&&fs(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Nn(i){if(i instanceof Ui&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof vr)return!1;let e=!0;return i.eachChild(r=>{e&&!Nn(r)&&(e=!1)}),e}function yn(i){if(i instanceof Ui&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!yn(r)&&(e=!1)}),e}function fs(i,e){if(i instanceof Ui&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!fs(s,e)&&(r=!1)}),r}function ms(i,e){const r=i.length-1;let s,l,u=0,p=r,f=0;for(;u<=p;)if(f=Math.floor((u+p)/2),s=i[f],l=i[f+1],s<=e){if(f===r||ee))throw new Ct("Input is not a number.");p=f-1}return 0}class xn{constructor(e,r,s){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[l,u]of s)this.labels.push(l),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(e[1],1,pe);if(!s)return null;const l=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let p=1;p=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',v);const E=r.parse(g,b,u);if(!E)return null;u=u||E.type,l.push([f,E])}return new xn(u,s,l)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const u=r.length;return l>=r[u-1]?s[u-1].evaluate(e):s[ms(r,l)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function vn(i,e,r){return i+r*(e-i)}function gs(i,e,r){return i.map((s,l)=>vn(s,e[l],r))}const Ei={number:vn,color:function(i,e,r,s="rgb"){switch(s){case"rgb":{const[l,u,p,f]=gs(i.rgb,e.rgb,r);return new Re(l,u,p,f,!1)}case"hcl":{const[l,u,p,f]=i.hcl,[g,v,b,E]=e.hcl;let I,C;if(isNaN(l)||isNaN(g))isNaN(l)?isNaN(g)?I=NaN:(I=g,p!==1&&p!==0||(C=v)):(I=l,b!==1&&b!==0||(C=u));else{let W=g-l;g>l&&W>180?W-=360:g180&&(W+=360),I=l+r*W}const[P,R,L,G]=function([W,q,Y,Q]){return W=isNaN(W)?0:W*H,Se([Y,Math.cos(W)*q,Math.sin(W)*q,Q])}([I,C??vn(u,v,r),vn(p,b,r),vn(f,E,r)]);return new Re(P,R,L,G,!1)}case"lab":{const[l,u,p,f]=Se(gs(i.lab,e.lab,r));return new Re(l,u,p,f,!1)}}},array:gs,padding:function(i,e,r){return new Ti(gs(i.values,e.values,r))}};class Si{constructor(e,r,s,l,u){this.type=e,this.operator=r,this.interpolation=s,this.input=l,this.labels=[],this.outputs=[];for(const[p,f]of u)this.labels.push(p),this.outputs.push(f)}static interpolationFactor(e,r,s,l){let u=0;if(e.name==="exponential")u=ua(r,e.base,s,l);else if(e.name==="linear")u=ua(r,1,s,l);else if(e.name==="cubic-bezier"){const p=e.controlPoints;u=new Cr(p[0],p[1],p[2],p[3]).solve(ua(r,1,s,l))}return u}static parse(e,r){let[s,l,u,...p]=e;if(!Array.isArray(l)||l.length===0)return r.error("Expected an interpolation type expression.",1);if(l[0]==="linear")l={name:"linear"};else if(l[0]==="exponential"){const v=l[1];if(typeof v!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);l={name:"exponential",base:v}}else{if(l[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(l[0])}`,1,0);{const v=l.slice(1);if(v.length!==4||v.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:v}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,pe),!u)return null;const f=[];let g=null;s==="interpolate-hcl"||s==="interpolate-lab"?g=yi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let v=0;v=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);const P=r.parse(E,C,g);if(!P)return null;g=g||P.type,f.push([b,P])}return A(g,pe)||A(g,yi)||A(g,Zi)||A(g,Jt(pe))?new Si(g,s,l,u,f):r.error(`Type ${mt(g)} is not interpolatable.`)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const u=r.length;if(l>=r[u-1])return s[u-1].evaluate(e);const p=ms(r,l),f=Si.interpolationFactor(this.interpolation,l,r[p],r[p+1]),g=s[p].evaluate(e),v=s[p+1].evaluate(e);switch(this.operator){case"interpolate":return Ei[this.type.kind](g,v,f);case"interpolate-hcl":return Ei.color(g,v,f,"hcl");case"interpolate-lab":return Ei.color(g,v,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function ua(i,e,r,s){const l=s-r,u=i-r;return l===0?0:e===1?u/l:(Math.pow(e,u)-1)/(Math.pow(e,l)-1)}class _s{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const u=[];for(const f of e.slice(1)){const g=r.parse(f,1+u.length,s,void 0,{typeAnnotation:"omit"});if(!g)return null;s=s||g.type,u.push(g)}if(!s)throw new Error("No output type");const p=l&&u.some(f=>ir(l,f.type));return new _s(p?Ue:s,u)}evaluate(e){let r,s=null,l=0;for(const u of this.args)if(l++,s=u.evaluate(e),s&&s instanceof Oi&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class ys{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let u=1;u=s.length)throw new Ct(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new Ct(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class $n{constructor(e,r){this.type=Ne,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,Ue),l=r.parse(e[2],2,Ue);return s&&l?F(s.type,[Ne,qe,pe,Br,Ue])?new $n(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(s.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!S(r,["boolean","string","number","null"]))throw new Ct(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Bt(r))} instead.`);if(!S(s,["string","array"]))throw new Ct(`Expected second argument to be of type array or string, but found ${mt(Bt(s))} instead.`);return s.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Yr{constructor(e,r,s){this.type=pe,this.needle=e,this.haystack=r,this.fromIndex=s}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,Ue),l=r.parse(e[2],2,Ue);if(!s||!l)return null;if(!F(s.type,[Ne,qe,pe,Br,Ue]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(s.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,pe);return u?new Yr(s,l,u):null}return new Yr(s,l)}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!S(r,["boolean","string","number","null"]))throw new Ct(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Bt(r))} instead.`);if(!S(s,["string","array"]))throw new Ct(`Expected second argument to be of type array or string, but found ${mt(Bt(s))} instead.`);if(this.fromIndex){const l=this.fromIndex.evaluate(e);return s.indexOf(r,l)}return s.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class tt{constructor(e,r,s,l,u,p){this.inputType=e,this.type=r,this.input=s,this.cases=l,this.outputs=u,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const u={},p=[];for(let v=2;vNumber.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof P=="number"&&Math.floor(P)!==P)return I.error("Numeric branch labels must be integer values.");if(s){if(I.checkSubtype(s,Bt(P)))return null}else s=Bt(P);if(u[String(P)]!==void 0)return I.error("Branch labels must be unique.");u[String(P)]=p.length}const C=r.parse(E,v,l);if(!C)return null;l=l||C.type,p.push(C)}const f=r.parse(e[1],1,Ue);if(!f)return null;const g=r.parse(e[e.length-1],e.length-1,l);return g?f.type.kind!=="value"&&r.concat(1).checkSubtype(s,f.type)?null:new tt(s,l,f,u,p,g):null}evaluate(e){const r=this.input.evaluate(e);return(Bt(r)===this.inputType&&this.outputs[this.cases[r]]||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()}}class da{constructor(e,r,s){this.type=e,this.branches=r,this.otherwise=s}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let p=1;pr.outputDefined())&&this.otherwise.outputDefined()}}class xs{constructor(e,r,s,l){this.type=e,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,Ue),l=r.parse(e[2],2,pe);if(!s||!l)return null;if(!F(s.type,[Jt(Ue),qe,Ue]))return r.error(`Expected first argument to be of type array or string, but found ${mt(s.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,pe);return u?new xs(s.type,s,l,u):null}return new xs(s.type,s,l)}evaluate(e){const r=this.input.evaluate(e),s=this.beginIndex.evaluate(e);if(!S(r,["string","array"]))throw new Ct(`Expected first argument to be of type array or string, but found ${mt(Bt(r))} instead.`);if(this.endIndex){const l=this.endIndex.evaluate(e);return r.slice(s,l)}return r.slice(s)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function mo(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function go(i,e,r,s){return s.compare(e,r)===0}function bn(i,e,r){const s=i!=="=="&&i!=="!=";return class tu{constructor(u,p,f){this.type=Ne,this.lhs=u,this.rhs=p,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||p.type.kind==="value"}static parse(u,p){if(u.length!==3&&u.length!==4)return p.error("Expected two or three arguments.");const f=u[0];let g=p.parse(u[1],1,Ue);if(!g)return null;if(!mo(f,g.type))return p.concat(1).error(`"${f}" comparisons are not supported for type '${mt(g.type)}'.`);let v=p.parse(u[2],2,Ue);if(!v)return null;if(!mo(f,v.type))return p.concat(2).error(`"${f}" comparisons are not supported for type '${mt(v.type)}'.`);if(g.type.kind!==v.type.kind&&g.type.kind!=="value"&&v.type.kind!=="value")return p.error(`Cannot compare types '${mt(g.type)}' and '${mt(v.type)}'.`);s&&(g.type.kind==="value"&&v.type.kind!=="value"?g=new Gi(v.type,[g]):g.type.kind!=="value"&&v.type.kind==="value"&&(v=new Gi(g.type,[v])));let b=null;if(u.length===4){if(g.type.kind!=="string"&&v.type.kind!=="string"&&g.type.kind!=="value"&&v.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(b=p.parse(u[3],3,_r),!b)return null}return new tu(g,v,b)}evaluate(u){const p=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(s&&this.hasUntypedArgument){const g=Bt(p),v=Bt(f);if(g.kind!==v.kind||g.kind!=="string"&&g.kind!=="number")throw new Ct(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${v.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const g=Bt(p),v=Bt(f);if(g.kind!=="string"||v.kind!=="string")return e(u,p,f)}return this.collator?r(u,p,f,this.collator.evaluate(u)):e(u,p,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const ml=bn("==",function(i,e,r){return e===r},go),gl=bn("!=",function(i,e,r){return e!==r},function(i,e,r,s){return!go(0,e,r,s)}),_l=bn("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,s){return s.compare(e,r)>0}),xl=bn("<=",function(i,e,r){return e<=r},function(i,e,r,s){return s.compare(e,r)<=0}),vl=bn(">=",function(i,e,r){return e>=r},function(i,e,r,s){return s.compare(e,r)>=0});class fa{constructor(e,r,s,l,u){this.type=qe,this.number=e,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const s=r.parse(e[1],1,pe);if(!s)return null;const l=e[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let u=null;if(l.locale&&(u=r.parse(l.locale,1,qe),!u))return null;let p=null;if(l.currency&&(p=r.parse(l.currency,1,qe),!p))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,pe),!f))return null;let g=null;return l["max-fraction-digits"]&&(g=r.parse(l["max-fraction-digits"],1,pe),!g)?null:new fa(s,u,p,f,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class vs{constructor(e){this.type=yr,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let u=!1;for(let p=1;p<=e.length-1;++p){const f=e[p];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let g=null;if(f["font-scale"]&&(g=r.parse(f["font-scale"],1,pe),!g))return null;let v=null;if(f["text-font"]&&(v=r.parse(f["text-font"],1,Jt(qe)),!v))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,yi),!b))return null;const E=l[l.length-1];E.scale=g,E.font=v,E.textColor=b}else{const g=r.parse(e[p],1,Ue);if(!g)return null;const v=g.type.kind;if(v!=="string"&&v!=="value"&&v!=="null"&&v!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,l.push({content:g,scale:null,font:null,textColor:null})}}return new vs(l)}evaluate(e){return new Qt(this.sections.map(r=>{const s=r.content.evaluate(e);return Bt(s)===xr?new Rr("",s,null,null,null):new Rr(Un(s),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class ma{constructor(e){this.type=xr,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const s=r.parse(e[1],1,qe);return s?new ma(s):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),s=Oi.fromString(r);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(r)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class ga{constructor(e){this.type=pe,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=r.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${mt(s.type)} instead.`):new ga(s):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Ct(`Expected value to be of type string or array, but found ${mt(Bt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const wn={"==":ml,"!=":gl,">":yl,"<":_l,">=":vl,"<=":xl,array:Gi,at:pa,boolean:Gi,case:da,coalesce:_s,collator:st,format:vs,image:ma,in:$n,"index-of":Yr,interpolate:Si,"interpolate-hcl":Si,"interpolate-lab":Si,length:ga,let:ys,literal:Fr,match:tt,number:Gi,"number-format":fa,object:Gi,slice:xs,step:xn,string:Gi,"to-boolean":ei,"to-color":ei,"to-number":ei,"to-string":ei,var:ps,within:vr};function _o(i,[e,r,s,l]){e=e.evaluate(i),r=r.evaluate(i),s=s.evaluate(i);const u=l?l.evaluate(i):1,p=_n(e,r,s,u);if(p)throw new Ct(p);return new Re(e/255,r/255,s/255,u,!1)}function yo(i,e){return i in e}function _a(i,e){const r=e[i];return r===void 0?null:r}function Jr(i){return{type:i}}function xo(i){return{result:"success",value:i}}function Tn(i){return{result:"error",value:i}}function En(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function vo(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function ya(i){return!!i.expression&&i.expression.interpolated}function lt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function bs(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function bl(i){return i}function bo(i,e){const r=e.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),u=i.type||(ya(e)?"exponential":"interval");if(r||e.type==="padding"){const b=r?Re.parse:Ti.parse;(i=tr({},i)).stops&&(i.stops=i.stops.map(E=>[E[0],b(E[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(p=i.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var p;let f,g,v;if(u==="exponential")f=wo;else if(u==="interval")f=xa;else if(u==="categorical"){f=wl,g=Object.create(null);for(const b of i.stops)g[b[0]]=b[1];v=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=Tl}if(s){const b={},E=[];for(let P=0;PP[0]),evaluate:({zoom:P},R)=>wo({stops:I,base:i.base},e,P).evaluate(P,R)}}if(l){const b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Si.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(E=>E[0]),evaluate:({zoom:E})=>f(i,e,E,g,v)}}return{kind:"source",evaluate(b,E){const I=E&&E.properties?E.properties[i.property]:void 0;return I===void 0?qn(i.default,e.default):f(i,e,I,g,v)}}}function qn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function wl(i,e,r,s,l){return qn(typeof r===l?s[r]:void 0,i.default,e.default)}function xa(i,e,r){if(lt(r)!=="number")return qn(i.default,e.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const l=ms(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function wo(i,e,r){const s=i.base!==void 0?i.base:1;if(lt(r)!=="number")return qn(i.default,e.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const u=ms(i.stops.map(b=>b[0]),r),p=function(b,E,I,C){const P=C-I,R=b-I;return P===0?0:E===1?R/P:(Math.pow(E,R)-1)/(Math.pow(E,P)-1)}(r,s,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],g=i.stops[u+1][1],v=Ei[e.type]||bl;return typeof f.evaluate=="function"?{evaluate(...b){const E=f.evaluate.apply(void 0,b),I=g.evaluate.apply(void 0,b);if(E!==void 0&&I!==void 0)return v(E,I,p,i.colorSpace)}}:v(f,g,p,i.colorSpace)}function Tl(i,e,r){switch(e.type){case"color":r=Re.parse(r);break;case"formatted":r=Qt.fromString(r.toString());break;case"resolvedImage":r=Oi.fromString(r.toString());break;case"padding":r=Ti.parse(r);break;default:lt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return qn(r,i.default,e.default)}Ui.register(wn,{error:[{kind:"error"},[qe],(i,[e])=>{throw new Ct(e.evaluate(i))}],typeof:[qe,[Ue],(i,[e])=>mt(Bt(e.evaluate(i)))],"to-rgba":[Jt(pe,4),[yi],(i,[e])=>{const[r,s,l,u]=e.evaluate(i).rgb;return[255*r,255*s,255*l,u]}],rgb:[yi,[pe,pe,pe],_o],rgba:[yi,[pe,pe,pe,pe],_o],has:{type:Ne,overloads:[[[qe],(i,[e])=>yo(e.evaluate(i),i.properties())],[[qe,Vt],(i,[e,r])=>yo(e.evaluate(i),r.evaluate(i))]]},get:{type:Ue,overloads:[[[qe],(i,[e])=>_a(e.evaluate(i),i.properties())],[[qe,Vt],(i,[e,r])=>_a(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Ue,[qe],(i,[e])=>_a(e.evaluate(i),i.featureState||{})],properties:[Vt,[],i=>i.properties()],"geometry-type":[qe,[],i=>i.geometryType()],id:[Ue,[],i=>i.id()],zoom:[pe,[],i=>i.globals.zoom],"heatmap-density":[pe,[],i=>i.globals.heatmapDensity||0],"line-progress":[pe,[],i=>i.globals.lineProgress||0],accumulated:[Ue,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[pe,Jr(pe),(i,e)=>{let r=0;for(const s of e)r+=s.evaluate(i);return r}],"*":[pe,Jr(pe),(i,e)=>{let r=1;for(const s of e)r*=s.evaluate(i);return r}],"-":{type:pe,overloads:[[[pe,pe],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[pe],(i,[e])=>-e.evaluate(i)]]},"/":[pe,[pe,pe],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[pe,[pe,pe],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[pe,[],()=>Math.LN2],pi:[pe,[],()=>Math.PI],e:[pe,[],()=>Math.E],"^":[pe,[pe,pe],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[pe,[pe],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[pe,[pe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[pe,[pe],(i,[e])=>Math.log(e.evaluate(i))],log2:[pe,[pe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[pe,[pe],(i,[e])=>Math.sin(e.evaluate(i))],cos:[pe,[pe],(i,[e])=>Math.cos(e.evaluate(i))],tan:[pe,[pe],(i,[e])=>Math.tan(e.evaluate(i))],asin:[pe,[pe],(i,[e])=>Math.asin(e.evaluate(i))],acos:[pe,[pe],(i,[e])=>Math.acos(e.evaluate(i))],atan:[pe,[pe],(i,[e])=>Math.atan(e.evaluate(i))],min:[pe,Jr(pe),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[pe,Jr(pe),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[pe,[pe],(i,[e])=>Math.abs(e.evaluate(i))],round:[pe,[pe],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[pe,[pe],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[pe,[pe],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ne,[qe,Ue],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ne,[Ue],(i,[e])=>i.id()===e.value],"filter-type-==":[Ne,[qe],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ne,[qe,Ue],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s{const r=i.id(),s=e.value;return typeof r==typeof s&&r":[Ne,[qe,Ue],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[Ne,[Ue],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>s}],"filter-<=":[Ne,[qe,Ue],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[Ne,[Ue],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r<=s}],"filter->=":[Ne,[qe,Ue],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[Ne,[Ue],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>=s}],"filter-has":[Ne,[Ue],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ne,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ne,[Jt(qe)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ne,[Jt(Ue)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ne,[qe,Jt(Ue)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ne,[qe,Jt(Ue)],(i,[e,r])=>function(s,l,u,p){for(;u<=p;){const f=u+p>>1;if(l[f]===s)return!0;l[f]>s?p=f-1:u=f+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ne,overloads:[[[Ne,Ne],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Jr(Ne),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ne,overloads:[[[Ne,Ne],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Jr(Ne),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ne,[Ne],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ne,[qe],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[qe,[qe],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[qe,[qe],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[qe,Jr(Ue),(i,e)=>e.map(r=>Un(r.evaluate(i))).join("")],"resolved-locale":[qe,[_r],(i,[e])=>e.evaluate(i).resolvedLocale()]});class va{constructor(e,r){var s;this.expression=e,this._warningHistory={},this._evaluator=new hs,this._defaultValue=r?(s=r).type==="color"&&bs(s.default)?new Re(0,0,0,0):s.type==="color"?Re.parse(s.default)||null:s.type==="padding"?Ti.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,s,l,u,p){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,s,l,u,p){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new Ct(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function ws(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in wn}function Tt(i,e){const r=new Or(wn,ds,[],e?function(l){const u={color:yi,string:qe,number:pe,enum:qe,boolean:Ne,formatted:yr,padding:Zi,resolvedImage:xr};return l.type==="array"?Jt(u[l.value]||Ue,l.length):u[l.type]}(e):void 0),s=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?xo(new va(s,e)):Tn(r.errors)}class ba{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!yn(r.expression)}evaluateWithoutErrorHandling(e,r,s,l,u,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,u,p)}evaluate(e,r,s,l,u,p){return this._styleExpression.evaluate(e,r,s,l,u,p)}}class We{constructor(e,r,s,l){this.kind=e,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!yn(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(e,r,s,l,u,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,u,p)}evaluate(e,r,s,l,u,p){return this._styleExpression.evaluate(e,r,s,l,u,p)}interpolationFactor(e,r,s){return this.interpolationType?Si.interpolationFactor(this.interpolationType,e,r,s):0}}function Ts(i,e){const r=Tt(i,e);if(r.result==="error")return r;const s=r.value.expression,l=Nn(s);if(!l&&!En(e))return Tn([new ii("","data expressions not supported")]);const u=fs(s,["zoom"]);if(!u&&!vo(e))return Tn([new ii("","zoom expressions not supported")]);const p=ft(s);return p||u?p instanceof ii?Tn([p]):p instanceof Si&&!ya(e)?Tn([new ii("",'"interpolate" expressions cannot be used with this property')]):xo(p?new We(l?"camera":"composite",r.value,p.labels,p instanceof Si?p.interpolation:void 0):new ba(l?"constant":"source",r.value)):Tn([new ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class gt{constructor(e,r){this._parameters=e,this._specification=r,tr(this,bo(this._parameters,this._specification))}static deserialize(e){return new gt(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ft(i){let e=null;if(i instanceof ys)e=ft(i.result);else if(i instanceof _s){for(const r of i.args)if(e=ft(r),e)break}else(i instanceof xn||i instanceof Si)&&i.input instanceof Ui&&i.input.name==="zoom"&&(e=i);return e instanceof ii||i.eachChild(r=>{const s=ft(r);s instanceof ii?e=s:!e&&s?e=new ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new ii("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Sn(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Sn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const To={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function wa(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Sn(i)||(i=Es(i));const e=Tt(i,To);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>e.value.evaluate(r,s,{},l),needGeometry:Eo(i)}}function El(i,e){return ie?1:0}function Eo(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Ss(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Es))):e==="all"?["all"].concat(i.slice(1).map(Es)):e==="none"?["all"].concat(i.slice(1).map(Es).map(jn)):e==="in"?Ta(i[1],i.slice(2)):e==="!in"?jn(Ta(i[1],i.slice(2))):e==="has"?Ea(i[1]):e==="!has"?jn(Ea(i[1])):e!=="within"||i;var r}function Ss(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Ta(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(El)]]:["filter-in-small",i,["literal",e]]}}function Ea(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function jn(i){return["!",i]}function Zn(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const u of i)l+=`${Zn(u)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new de(e,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function Ao(i){const e=i.valueSpec,r=Mt(i.value.type);let s,l,u,p={};const f=r!=="categorical"&&i.value.property===void 0,g=!f,v=lt(i.value.stops)==="array"&<(i.value.stops[0])==="array"&<(i.value.stops[0][0])==="object",b=Vi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new de(C.key,C.value,'identity function may not have a "stops" property')];let P=[];const R=C.value;return P=P.concat(Io({key:C.key,value:R,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:E})),lt(R)==="array"&&R.length===0&&P.push(new de(C.key,R,"array must have at least one stop")),P},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new de(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new de(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!ya(i.valueSpec)&&b.push(new de(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!En(i.valueSpec)?b.push(new de(i.key,i.value,"property functions not supported")):f&&!vo(i.valueSpec)&&b.push(new de(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!v||i.value.property!==void 0||b.push(new de(i.key,i.value,'"property" property is required')),b;function E(C){let P=[];const R=C.value,L=C.key;if(lt(R)!=="array")return[new de(L,R,`array expected, ${lt(R)} found`)];if(R.length!==2)return[new de(L,R,`array length 2 expected, length ${R.length} found`)];if(v){if(lt(R[0])!=="object")return[new de(L,R,`object expected, ${lt(R[0])} found`)];if(R[0].zoom===void 0)return[new de(L,R,"object stop key must have zoom")];if(R[0].value===void 0)return[new de(L,R,"object stop key must have value")];if(u&&u>Mt(R[0].zoom))return[new de(L,R[0].zoom,"stop zoom values must appear in ascending order")];Mt(R[0].zoom)!==u&&(u=Mt(R[0].zoom),l=void 0,p={}),P=P.concat(Vi({key:`${L}[0]`,value:R[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Sa,value:I}}))}else P=P.concat(I({key:`${L}[0]`,value:R[0],valueSpec:{},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},R));return ws(Qr(R[1]))?P.concat([new de(`${L}[1]`,R[1],"expressions are not allowed in function stops.")]):P.concat(C.validateSpec({key:`${L}[1]`,value:R[1],valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function I(C,P){const R=lt(C.value),L=Mt(C.value),G=C.value!==null?C.value:P;if(s){if(R!==s)return[new de(C.key,G,`${R} stop domain type must match previous stop domain type ${s}`)]}else s=R;if(R!=="number"&&R!=="string"&&R!=="boolean")return[new de(C.key,G,"stop domain value must be a number, string, or boolean")];if(R!=="number"&&r!=="categorical"){let W=`number expected, ${R} found`;return En(e)&&r===void 0&&(W+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new de(C.key,G,W)]}return r!=="categorical"||R!=="number"||isFinite(L)&&Math.floor(L)===L?r!=="categorical"&&R==="number"&&l!==void 0&&Lnew de(`${i.key}${s.key}`,i.value,s.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new de(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!yn(r))return[new de(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!yn(r))return[new de(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!fs(r,["zoom","feature-state"]))return[new de(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Nn(r))return[new de(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Gn(i){const e=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf(Mt(r))===-1&&l.push(new de(e,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(Mt(r))===-1&&l.push(new de(e,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function In(i){return Sn(Qr(i.value))?en(tr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Co(i)}function Co(i){const e=i.value,r=i.key;if(lt(e)!=="array")return[new de(r,e,`array expected, ${lt(e)} found`)];const s=i.styleSpec;let l,u=[];if(e.length<1)return[new de(r,e,"filter array must have at least 1 element")];switch(u=u.concat(Gn({key:`${r}[0]`,value:e[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),Mt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Mt(e[1])==="$type"&&u.push(new de(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new de(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(l=lt(e[1]),l!=="string"&&u.push(new de(`${r}[1]`,e[1],`string expected, ${l} found`)));for(let p=2;p{v in r&&e.push(new de(s,r[v],`"${v}" is prohibited for ref layers`))}),l.layers.forEach(v=>{Mt(v.id)===f&&(g=v)}),g?g.ref?e.push(new de(s,r.ref,"ref cannot reference another ref layer")):p=Mt(g.type):e.push(new de(s,r.ref,`ref layer "${f}" not found`))}else if(p!=="background")if(r.source){const g=l.sources&&l.sources[r.source],v=g&&Mt(g.type);g?v==="vector"&&p==="raster"?e.push(new de(s,r.source,`layer "${r.id}" requires a raster source`)):v==="raster"&&p!=="raster"?e.push(new de(s,r.source,`layer "${r.id}" requires a vector source`)):v!=="vector"||r["source-layer"]?v==="raster-dem"&&p!=="hillshade"?e.push(new de(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):p!=="line"||!r.paint||!r.paint["line-gradient"]||v==="geojson"&&g.lineMetrics||e.push(new de(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new de(s,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new de(s,r.source,`source "${r.source}" not found`))}else e.push(new de(s,r,'missing required property "source"'));return e=e.concat(Vi({key:s,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:In,layout:g=>Vi({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":v=>Mo(tr({layerType:p},v))}}),paint:g=>Vi({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":v=>Aa(tr({layerType:p},v))}})}})),e}function rr(i){const e=i.value,r=i.key,s=lt(e);return s!=="string"?[new de(r,e,`string expected, ${s} found`)]:[]}const As={promoteId:function({key:i,value:e}){if(lt(e)==="string")return rr({key:i,value:e});{const r=[];for(const s in e)r.push(...rr({key:`${i}.${s}`,value:e[s]}));return r}}};function Cs(i){const e=i.value,r=i.key,s=i.styleSpec,l=i.style,u=i.validateSpec;if(!e.type)return[new de(r,e,'"type" is required')];const p=Mt(e.type);let f;switch(p){case"vector":case"raster":case"raster-dem":return f=Vi({key:r,value:e,valueSpec:s[`source_${p.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:As,validateSpec:u}),f;case"geojson":if(f=Vi({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s,validateSpec:u,objectElementValidators:As}),e.cluster)for(const g in e.clusterProperties){const[v,b]=e.clusterProperties[g],E=typeof v=="string"?[v,["accumulated"],["get",g]]:v;f.push(...en({key:`${r}.${g}.map`,value:b,validateSpec:u,expressionContext:"cluster-map"})),f.push(...en({key:`${r}.${g}.reduce`,value:E,validateSpec:u,expressionContext:"cluster-reduce"}))}return f;case"video":return Vi({key:r,value:e,valueSpec:s.source_video,style:l,validateSpec:u,styleSpec:s});case"image":return Vi({key:r,value:e,valueSpec:s.source_image,style:l,validateSpec:u,styleSpec:s});case"canvas":return[new de(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Gn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:u,styleSpec:s})}}function Po(i){const e=i.value,r=i.styleSpec,s=r.light,l=i.style;let u=[];const p=lt(e);if(e===void 0)return u;if(p!=="object")return u=u.concat([new de("light",e,`object expected, ${p} found`)]),u;for(const f in e){const g=f.match(/^(.*)-transition$/);u=u.concat(g&&s[g[1]]&&s[g[1]].transition?i.validateSpec({key:f,value:e[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):s[f]?i.validateSpec({key:f,value:e[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new de(f,e[f],`unknown property "${f}"`)])}return u}function Xn(i){const e=i.value,r=i.styleSpec,s=r.terrain,l=i.style;let u=[];const p=lt(e);if(e===void 0)return u;if(p!=="object")return u=u.concat([new de("terrain",e,`object expected, ${p} found`)]),u;for(const f in e)u=u.concat(s[f]?i.validateSpec({key:f,value:e[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new de(f,e[f],`unknown property "${f}"`)]);return u}function zo(i){let e=[];const r=i.value,s=i.key;if(Array.isArray(r)){const l=[],u=[];for(const p in r)r[p].id&&l.includes(r[p].id)&&e.push(new de(s,r,`all the sprites' ids must be unique, but ${r[p].id} is duplicated`)),l.push(r[p].id),r[p].url&&u.includes(r[p].url)&&e.push(new de(s,r,`all the sprites' URLs must be unique, but ${r[p].url} is duplicated`)),u.push(r[p].url),e=e.concat(Vi({key:`${s}[${p}]`,value:r[p],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return rr({key:s,value:r})}const ko={"*":()=>[],array:Io,boolean:function(i){const e=i.value,r=i.key,s=lt(e);return s!=="boolean"?[new de(r,e,`boolean expected, ${s} found`)]:[]},number:Sa,color:function(i){const e=i.key,r=i.value,s=lt(r);return s!=="string"?[new de(e,r,`color expected, ${s} found`)]:Re.parse(String(r))?[]:[new de(e,r,`color expected, "${r}" found`)]},constants:So,enum:Gn,filter:In,function:Ao,layer:Is,object:Vi,source:Cs,light:Po,terrain:Xn,string:rr,formatted:function(i){return rr(i).length===0?[]:en(i)},resolvedImage:function(i){return rr(i).length===0?[]:en(i)},padding:function(i){const e=i.key,r=i.value;if(lt(r)==="array"){if(r.length<1||r.length>4)return[new de(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let l=[];for(let u=0;u[]}})),i.constants&&(r=r.concat(So({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:Wn}))),Hn(r)}function Ni(i){return function(e){return i({...e,validateSpec:Wn})}}function Hn(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Rt(i){return function(...e){return Hn(i.apply(this,e))}}nr.source=Rt(Ni(Cs)),nr.sprite=Rt(Ni(zo)),nr.glyphs=Rt(Ni(Do)),nr.light=Rt(Ni(Po)),nr.terrain=Rt(Ni(Xn)),nr.layer=Rt(Ni(Is)),nr.filter=Rt(Ni(In)),nr.paintProperty=Rt(Ni(Aa)),nr.layoutProperty=Rt(Ni(Mo));const Vr=nr,Il=Vr.light,Al=Vr.paintProperty,Cl=Vr.layoutProperty;function An(i,e){let r=!1;if(e&&e.length)for(const s of e)i.fire(new Fi(new Error(s.message))),r=!0;return r}class Kn{constructor(e,r,s){const l=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const p=new Int32Array(this.arrayBuffer);e=p[0],this.d=(r=p[1])+2*(s=p[2]);for(let g=0;g=E[P+0]&&l>=E[P+1])?(f[C]=!0,p.push(b[C])):f[C]=!1}}}}_forEachCell(e,r,s,l,u,p,f,g){const v=this._convertToCellCoord(e),b=this._convertToCellCoord(r),E=this._convertToCellCoord(s),I=this._convertToCellCoord(l);for(let C=v;C<=E;C++)for(let P=b;P<=I;P++){const R=this.d*P+C;if((!g||g(this._convertFromCellCoord(C),this._convertFromCellCoord(P),this._convertFromCellCoord(C+1),this._convertFromCellCoord(P+1)))&&u.call(this,e,r,s,l,R,p,f,g))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;const e=this.cells,r=3+this.cells.length+1+1;let s=0;for(let p=0;p=0)continue;const p=i[u];l[u]=sr[s].shallow.indexOf(u)>=0?p:Yn(p,e)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof i)}function br(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Ms(i)||Zr(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(br);if(typeof i=="object"){const e=i.$name||"Object";if(!sr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=sr[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const u=i[l];s[l]=sr[e].shallow.indexOf(l)>=0?u:br(u)}return s}throw new Error("can't deserialize object of type "+typeof i)}class Lo{constructor(){this.first=!0}update(e,r){const s=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Ps(i){for(const e of i)if(zs(e.charCodeAt(0)))return!0;return!1}function Ca(i){for(const e of i)if(!Bo(e.charCodeAt(0)))return!1;return!0}function Bo(i){return!(ye.Arabic(i)||ye["Arabic Supplement"](i)||ye["Arabic Extended-A"](i)||ye["Arabic Presentation Forms-A"](i)||ye["Arabic Presentation Forms-B"](i))}function zs(i){return!(i!==746&&i!==747&&(i<4352||!(ye["Bopomofo Extended"](i)||ye.Bopomofo(i)||ye["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||ye["CJK Compatibility Ideographs"](i)||ye["CJK Compatibility"](i)||ye["CJK Radicals Supplement"](i)||ye["CJK Strokes"](i)||!(!ye["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||ye["CJK Unified Ideographs Extension A"](i)||ye["CJK Unified Ideographs"](i)||ye["Enclosed CJK Letters and Months"](i)||ye["Hangul Compatibility Jamo"](i)||ye["Hangul Jamo Extended-A"](i)||ye["Hangul Jamo Extended-B"](i)||ye["Hangul Jamo"](i)||ye["Hangul Syllables"](i)||ye.Hiragana(i)||ye["Ideographic Description Characters"](i)||ye.Kanbun(i)||ye["Kangxi Radicals"](i)||ye["Katakana Phonetic Extensions"](i)||ye.Katakana(i)&&i!==12540||!(!ye["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!ye["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||ye["Unified Canadian Aboriginal Syllabics"](i)||ye["Unified Canadian Aboriginal Syllabics Extended"](i)||ye["Vertical Forms"](i)||ye["Yijing Hexagram Symbols"](i)||ye["Yi Syllables"](i)||ye["Yi Radicals"](i))))}function Ro(i){return!(zs(i)||function(e){return!!(ye["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||ye["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||ye["Letterlike Symbols"](e)||ye["Number Forms"](e)||ye["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||ye["Control Pictures"](e)&&e!==9251||ye["Optical Character Recognition"](e)||ye["Enclosed Alphanumerics"](e)||ye["Geometric Shapes"](e)||ye["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ye["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ye["CJK Symbols and Punctuation"](e)||ye.Katakana(e)||ye["Private Use Area"](e)||ye["CJK Compatibility Forms"](e)||ye["Small Form Variants"](e)||ye["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function ks(i){return i>=1424&&i<=2303||ye["Arabic Presentation Forms-A"](i)||ye["Arabic Presentation Forms-B"](i)}function Ds(i,e){return!(!e&&ks(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||ye.Khmer(i))}function Fo(i){for(const e of i)if(ks(e.charCodeAt(0)))return!0;return!1}const Ma="deferred",Ls="loading",Pa="loaded";let Jn=null,xi="unavailable",Nr=null;const Oo=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(xi="error"),Jn&&Jn(i)};function za(){Bs.fire(new gr("pluginStateChange",{pluginStatus:xi,pluginURL:Nr}))}const Bs=new fn,ka=function(){return xi},Uo=function(){if(xi!==Ma||!Nr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");xi=Ls,za(),Nr&&dn({url:Nr},i=>{i?Oo(i):(xi=Pa,za())})},$i={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>xi===Pa||$i.applyArabicShaping!=null,isLoading:()=>xi===Ls,setState(i){if(!Bi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");xi=i.pluginStatus,Nr=i.pluginURL},isParsed(){if(!Bi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return $i.applyArabicShaping!=null&&$i.processBidirectionalText!=null&&$i.processStyledBidirectionalText!=null},getPluginURL(){if(!Bi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Nr}};class bt{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Lo,this.transition={})}isSupportedScript(e){return function(r,s){for(const l of r)if(!Ds(l.charCodeAt(0),s))return!1;return!0}(e,$i.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),s=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class Rs{constructor(e,r){this.property=e,this.value=r,this.expression=function(s,l){if(bs(s))return new gt(s,l);if(ws(s)){const u=Ts(s,l);if(u.result==="error")throw new Error(u.value.map(p=>`${p.key}: ${p.message}`).join(", "));return u.value}{let u=s;return l.type==="color"&&typeof s=="string"?u=Re.parse(s):l.type!=="padding"||typeof s!="number"&&!Array.isArray(s)||(u=Ti.parse(s)),{kind:"constant",evaluate:()=>u}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,s){return this.property.possiblyEvaluate(this,e,r,s)}}class Da{constructor(e){this.property=e,this.value=new Rs(e,void 0)}transitioned(e,r){return new Qn(this.property,this.value,r,_t({},e.transition,this.transition),e.now)}untransitioned(){return new Qn(this.property,this.value,null,{},0)}}class Vo{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return _i(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Da(this._values[e].property)),this._values[e].value=new Rs(this._values[e].property,r===null?void 0:_i(r))}getTransition(e){return _i(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Da(this._values[e].property)),this._values[e].transition=_i(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s);const l=this.getTransition(r);l!==void 0&&(e[`${r}-transition`]=l)}return e}transitioned(e,r){const s=new No(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].transitioned(e,r._values[l]);return s}untransitioned(){const e=new No(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Qn{constructor(e,r,s,l,u){this.property=e,this.value=r,this.begin=u+l.delay||0,this.end=this.begin+l.duration||0,e.specification.transition&&(l.delay||l.duration)&&(this.prior=s)}possiblyEvaluate(e,r,s){const l=e.now||0,u=this.value.possiblyEvaluate(e,r,s),p=this.prior;if(p){if(l>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(l=1)return 1;const v=g*g,b=v*g;return 4*(g<.5?b:3*(g-v)+b-.75)}(f))}}return u}}class No{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,s){const l=new Fs(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,s);return l}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class La{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return _i(this._values[e].value)}setValue(e,r){this._values[e]=new Rs(this._values[e].property,r===null?void 0:_i(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s)}return e}possiblyEvaluate(e,r,s){const l=new Fs(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,s);return l}}class ar{constructor(e,r,s){this.property=e,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,s,l){return this.property.evaluate(this.value,this.parameters,e,r,s,l)}}class Fs{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Me{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,s){const l=Ei[this.specification.type];return l?l(e,r,s):e}}class Le{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,s,l){return new ar(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},s,l)}:e.expression,r)}interpolate(e,r,s){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new ar(this,{kind:"constant",value:void 0},e.parameters);const l=Ei[this.specification.type];if(l){const u=l(e.value.value,r.value.value,s);return new ar(this,{kind:"constant",value:u},e.parameters)}return e}evaluate(e,r,s,l,u,p){return e.kind==="constant"?e.value:e.evaluate(r,s,l,u,p)}}class es extends Le{possiblyEvaluate(e,r,s,l){if(e.value===void 0)return new ar(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},s,l),p=e.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,f=this._calculate(p,p,p,r);return new ar(this,{kind:"constant",value:f},r)}if(e.expression.kind==="camera"){const u=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new ar(this,{kind:"constant",value:u},r)}return new ar(this,e.expression,r)}evaluate(e,r,s,l,u,p){if(e.kind==="source"){const f=e.evaluate(r,s,l,u,p);return this._calculate(f,f,f,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},s,l),e.evaluate({zoom:Math.floor(r.zoom)},s,l),e.evaluate({zoom:Math.floor(r.zoom)+1},s,l),r):e.value}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Ba{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){if(e.value!==void 0){if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},s,l);return this._calculate(u,u,u,r)}return this._calculate(e.expression.evaluate(new bt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new bt(Math.floor(r.zoom),r)),e.expression.evaluate(new bt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Ra{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){return!!e.expression.evaluate(r,null,{},s,l)}interpolate(){return!1}}class vi{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const s=e[r];s.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new Rs(s,void 0),u=this.defaultTransitionablePropertyValues[r]=new Da(s);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}Ee("DataDrivenProperty",Le),Ee("DataConstantProperty",Me),Ee("CrossFadedDataDrivenProperty",es),Ee("CrossFadedProperty",Ba),Ee("ColorRampProperty",Ra);const $o="-transition";class or extends fn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new La(r.layout)),r.paint)){this._transitionablePaint=new Vo(r.paint);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Fs(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,s={}){r!=null&&this._validate(Cl,`layers.${this.id}.layout.${e}`,e,r,s)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith($o)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,s={}){if(r!=null&&this._validate(Al,`layers.${this.id}.paint.${e}`,e,r,s))return!1;if(e.endsWith($o))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[e],u=l.property.specification["property-type"]==="cross-faded-data-driven",p=l.value.isDataDriven(),f=l.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const g=this._transitionablePaint._values[e].value;return g.isDataDriven()||p||u||this._handleOverridablePaintPropertyUpdate(e,f,g)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,s){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const 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&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),cn(e,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(e,r,s,l,u={}){return(!u||u.validate!==!1)&&An(this,e.call(Vr,{key:r,layerType:this.type,objectKey:s,value:l,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof ar&&En(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Ml={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class wr{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class St{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ft(i,e=1){let r=0,s=0;return{members:i.map(l=>{const u=Ml[l.type].BYTES_PER_ELEMENT,p=r=qo(r,Math.max(e,u)),f=l.components||1;return s=Math.max(s,u),r+=u*f,{name:l.name,type:l.type,components:f,offset:p}}),size:qo(r,Math.max(s,e)),alignment:e}}function qo(i,e){return Math.ceil(i/e)*e}class Cn extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.int16[l+0]=r,this.int16[l+1]=s,e}}Cn.prototype.bytesPerElement=4,Ee("StructArrayLayout2i4",Cn);class Os extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.int16[u+0]=r,this.int16[u+1]=s,this.int16[u+2]=l,e}}Os.prototype.bytesPerElement=6,Ee("StructArrayLayout3i6",Os);class Fa extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const p=4*e;return this.int16[p+0]=r,this.int16[p+1]=s,this.int16[p+2]=l,this.int16[p+3]=u,e}}Fa.prototype.bytesPerElement=8,Ee("StructArrayLayout4i8",Fa);class lr extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,p)}emplace(e,r,s,l,u,p,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=p,this.int16[g+5]=f,e}}lr.prototype.bytesPerElement=12,Ee("StructArrayLayout2i4i12",lr);class Us extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,p)}emplace(e,r,s,l,u,p,f){const g=4*e,v=8*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.uint8[v+4]=l,this.uint8[v+5]=u,this.uint8[v+6]=p,this.uint8[v+7]=f,e}}Us.prototype.bytesPerElement=8,Ee("StructArrayLayout2i4ub8",Us);class tn extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.float32[l+0]=r,this.float32[l+1]=s,e}}tn.prototype.bytesPerElement=8,Ee("StructArrayLayout2f8",tn);class Vs extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,p,f,g,v,b){const E=this.length;return this.resize(E+1),this.emplace(E,e,r,s,l,u,p,f,g,v,b)}emplace(e,r,s,l,u,p,f,g,v,b,E){const I=10*e;return this.uint16[I+0]=r,this.uint16[I+1]=s,this.uint16[I+2]=l,this.uint16[I+3]=u,this.uint16[I+4]=p,this.uint16[I+5]=f,this.uint16[I+6]=g,this.uint16[I+7]=v,this.uint16[I+8]=b,this.uint16[I+9]=E,e}}Vs.prototype.bytesPerElement=20,Ee("StructArrayLayout10ui20",Vs);class ts extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,p,f,g,v,b,E,I){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,s,l,u,p,f,g,v,b,E,I)}emplace(e,r,s,l,u,p,f,g,v,b,E,I,C){const P=12*e;return this.int16[P+0]=r,this.int16[P+1]=s,this.int16[P+2]=l,this.int16[P+3]=u,this.uint16[P+4]=p,this.uint16[P+5]=f,this.uint16[P+6]=g,this.uint16[P+7]=v,this.int16[P+8]=b,this.int16[P+9]=E,this.int16[P+10]=I,this.int16[P+11]=C,e}}ts.prototype.bytesPerElement=24,Ee("StructArrayLayout4i4ui4i24",ts);class Oa extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.float32[u+0]=r,this.float32[u+1]=s,this.float32[u+2]=l,e}}Oa.prototype.bytesPerElement=12,Ee("StructArrayLayout3f12",Oa);class Mn extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}Mn.prototype.bytesPerElement=4,Ee("StructArrayLayout1ul4",Mn);class rn extends St{_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,r,s,l,u,p,f,g,v){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,s,l,u,p,f,g,v)}emplace(e,r,s,l,u,p,f,g,v,b){const E=10*e,I=5*e;return this.int16[E+0]=r,this.int16[E+1]=s,this.int16[E+2]=l,this.int16[E+3]=u,this.int16[E+4]=p,this.int16[E+5]=f,this.uint32[I+3]=g,this.uint16[E+8]=v,this.uint16[E+9]=b,e}}rn.prototype.bytesPerElement=20,Ee("StructArrayLayout6i1ul2ui20",rn);class Ua extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,p)}emplace(e,r,s,l,u,p,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=p,this.int16[g+5]=f,e}}Ua.prototype.bytesPerElement=12,Ee("StructArrayLayout2i2i2i12",Ua);class Ns extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,s,l,u)}emplace(e,r,s,l,u,p){const f=4*e,g=8*e;return this.float32[f+0]=r,this.float32[f+1]=s,this.float32[f+2]=l,this.int16[g+6]=u,this.int16[g+7]=p,e}}Ns.prototype.bytesPerElement=16,Ee("StructArrayLayout2f1f2i16",Ns);class nn extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const p=12*e,f=3*e;return this.uint8[p+0]=r,this.uint8[p+1]=s,this.float32[f+1]=l,this.float32[f+2]=u,e}}nn.prototype.bytesPerElement=12,Ee("StructArrayLayout2ub2f12",nn);class $s extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.uint16[u+0]=r,this.uint16[u+1]=s,this.uint16[u+2]=l,e}}$s.prototype.bytesPerElement=6,Ee("StructArrayLayout3ui6",$s);class Va extends St{_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,r,s,l,u,p,f,g,v,b,E,I,C,P,R,L,G){const W=this.length;return this.resize(W+1),this.emplace(W,e,r,s,l,u,p,f,g,v,b,E,I,C,P,R,L,G)}emplace(e,r,s,l,u,p,f,g,v,b,E,I,C,P,R,L,G,W){const q=24*e,Y=12*e,Q=48*e;return this.int16[q+0]=r,this.int16[q+1]=s,this.uint16[q+2]=l,this.uint16[q+3]=u,this.uint32[Y+2]=p,this.uint32[Y+3]=f,this.uint32[Y+4]=g,this.uint16[q+10]=v,this.uint16[q+11]=b,this.uint16[q+12]=E,this.float32[Y+7]=I,this.float32[Y+8]=C,this.uint8[Q+36]=P,this.uint8[Q+37]=R,this.uint8[Q+38]=L,this.uint32[Y+10]=G,this.int16[q+22]=W,e}}Va.prototype.bytesPerElement=48,Ee("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Va);class qs extends St{_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,r,s,l,u,p,f,g,v,b,E,I,C,P,R,L,G,W,q,Y,Q,re,Te,Ie,xe,ge,fe,ve){const _e=this.length;return this.resize(_e+1),this.emplace(_e,e,r,s,l,u,p,f,g,v,b,E,I,C,P,R,L,G,W,q,Y,Q,re,Te,Ie,xe,ge,fe,ve)}emplace(e,r,s,l,u,p,f,g,v,b,E,I,C,P,R,L,G,W,q,Y,Q,re,Te,Ie,xe,ge,fe,ve,_e){const he=34*e,ke=17*e;return this.int16[he+0]=r,this.int16[he+1]=s,this.int16[he+2]=l,this.int16[he+3]=u,this.int16[he+4]=p,this.int16[he+5]=f,this.int16[he+6]=g,this.int16[he+7]=v,this.uint16[he+8]=b,this.uint16[he+9]=E,this.uint16[he+10]=I,this.uint16[he+11]=C,this.uint16[he+12]=P,this.uint16[he+13]=R,this.uint16[he+14]=L,this.uint16[he+15]=G,this.uint16[he+16]=W,this.uint16[he+17]=q,this.uint16[he+18]=Y,this.uint16[he+19]=Q,this.uint16[he+20]=re,this.uint16[he+21]=Te,this.uint16[he+22]=Ie,this.uint32[ke+12]=xe,this.float32[ke+13]=ge,this.float32[ke+14]=fe,this.float32[ke+15]=ve,this.float32[ke+16]=_e,e}}qs.prototype.bytesPerElement=68,Ee("StructArrayLayout8i15ui1ul4f68",qs);class js extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}js.prototype.bytesPerElement=4,Ee("StructArrayLayout1f4",js);class Zs extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=4*e;return this.uint32[2*e+0]=r,this.uint16[u+2]=s,this.uint16[u+3]=l,e}}Zs.prototype.bytesPerElement=8,Ee("StructArrayLayout1ul2ui8",Zs);class o extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.uint16[l+0]=r,this.uint16[l+1]=s,e}}o.prototype.bytesPerElement=4,Ee("StructArrayLayout2ui4",o);class t extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}t.prototype.bytesPerElement=2,Ee("StructArrayLayout1ui2",t);class n extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const p=4*e;return this.float32[p+0]=r,this.float32[p+1]=s,this.float32[p+2]=l,this.float32[p+3]=u,e}}n.prototype.bytesPerElement=16,Ee("StructArrayLayout4f16",n);class a extends wr{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 Ae(this.anchorPointX,this.anchorPointY)}}a.prototype.size=20;class c extends rn{get(e){return new a(this,e)}}Ee("CollisionBoxArray",c);class d extends wr{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]}}d.prototype.size=48;class m extends Va{get(e){return new d(this,e)}}Ee("PlacedSymbolArray",m);class y extends wr{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]}get 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 textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}y.prototype.size=68;class _ extends qs{get(e){return new y(this,e)}}Ee("SymbolInstanceArray",_);class x extends js{getoffsetX(e){return this.float32[1*e+0]}}Ee("GlyphOffsetArray",x);class T extends Os{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ee("SymbolLineVertexArray",T);class w extends wr{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]}}w.prototype.size=8;class M extends Zs{get(e){return new w(this,e)}}Ee("FeatureIndexArray",M);class B extends Cn{}class k extends Cn{}class D extends Cn{}class U extends lr{}class Z extends Us{}class J extends tn{}class O extends Vs{}class K extends ts{}class ee extends Oa{}class oe extends Mn{}class ce extends Ua{}class ue extends nn{}class le extends $s{}class be extends o{}const ze=Ft([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ve}=ze;class me{constructor(e=[]){this.segments=e}prepareSegment(e,r,s,l){let u=this.segments[this.segments.length-1];return e>me.MAX_VERTEX_ARRAY_LENGTH&&ti(`Max vertices per segment is ${me.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!u||u.vertexLength+e>me.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==l)&&(u={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},l!==void 0&&(u.sortKey=l),this.segments.push(u)),u}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,s,l){return new me([{vertexOffset:e,primitiveOffset:r,vertexLength:s,primitiveLength:l,vaos:{},sortKey:0}])}}function Be(i,e){return 256*(i=ot(Math.floor(i),0,255))+ot(Math.floor(e),0,255)}me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ee("SegmentVector",me);const we=Ft([{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"}]);var it={exports:{}},Pt={exports:{}};Pt.exports=function(i,e){var r,s,l,u,p,f,g,v;for(s=i.length-(r=3&i.length),l=e,p=3432918353,f=461845907,v=0;v>>16)*p&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>16)*f&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(g=0,r){case 3:g^=(255&i.charCodeAt(v+2))<<16;case 2:g^=(255&i.charCodeAt(v+1))<<8;case 1:l^=g=(65535&(g=(g=(65535&(g^=255&i.charCodeAt(v)))*p+(((g>>>16)*p&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>16)*f&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var rt=Pt.exports,$e={exports:{}};$e.exports=function(i,e){for(var r,s=i.length,l=e^s,u=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++u;switch(s){case 3:l^=(255&i.charCodeAt(u+2))<<16;case 2:l^=(255&i.charCodeAt(u+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(u)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var It=rt,hi=$e.exports;it.exports=It,it.exports.murmur3=It,it.exports.murmur2=hi;var zt=vt(it.exports);class Zt{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,s,l){this.ids.push(Ii(e)),this.positions.push(r,s,l)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Ii(e);let s=0,l=this.ids.length-1;for(;s>1;this.ids[p]>=r?l=p:s=p+1}const u=[];for(;this.ids[s]===r;)u.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return u}static serialize(e,r){const s=new Float64Array(e.ids),l=new Uint32Array(e.positions);return Xi(s,l,0,s.length-1),r&&r.push(s.buffer,l.buffer),{ids:s,positions:l}}static deserialize(e){const r=new Zt;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Ii(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:zt(String(i))}function Xi(i,e,r,s){for(;r>1];let u=r-1,p=s+1;for(;;){do u++;while(i[u]l);if(u>=p)break;Wi(i,u,p),Wi(e,3*u,3*p),Wi(e,3*u+1,3*p+1),Wi(e,3*u+2,3*p+2)}p-r`u_${l}`),this.type=s}setUniform(e,r,s){e.set(s.constantOr(this.value))}getBinding(e,r,s){return this.type==="color"?new ri(e,r):new cr(e,r)}}class Xt{constructor(e,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,s,l){const u=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)}getBinding(e,r,s){return s.substr(0,9)==="u_pattern"?new is(e,r):new cr(e,r)}}class at{constructor(e,r,s,l){this.expression=e,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(e,r,s,l,u){const p=this.paintVertexArray.length,f=this.expression.evaluate(new bt(0),r,{},l,[],u);this.paintVertexArray.resize(e),this._setPaintValue(p,e,f)}updatePaintArray(e,r,s,l){const u=this.expression.evaluate({zoom:0},s,l);this._setPaintValue(e,r,u)}_setPaintValue(e,r,s){if(this.type==="color"){const l=nt(s);for(let u=e;u`u_${f}_t`),this.type=s,this.useIntegerZoom=l,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new p}populatePaintArray(e,r,s,l,u){const p=this.expression.evaluate(new bt(this.zoom),r,{},l,[],u),f=this.expression.evaluate(new bt(this.zoom+1),r,{},l,[],u),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,p,f)}updatePaintArray(e,r,s,l){const u=this.expression.evaluate({zoom:this.zoom},s,l),p=this.expression.evaluate({zoom:this.zoom+1},s,l);this._setPaintValue(e,r,u,p)}_setPaintValue(e,r,s,l){if(this.type==="color"){const u=nt(s),p=nt(l);for(let f=e;f`#define HAS_UNIFORM_${l}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof at||s instanceof $t)for(let l=0;l!0){this.programConfigurations={};for(const l of e)this.programConfigurations[l.id]=new Gs(l,r,s);this.needsUpload=!1,this._featureMap=new Zt,this._bufferOffset=0}populatePaintArrays(e,r,s,l,u,p){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,l,u,p);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,s,l){for(const u of s)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,l)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Pl(i,e){return{"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-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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function jo(i,e,r){const s={color:{source:tn,composite:n},number:{source:js,composite:tn}},l=function(u){return{"line-pattern":{source:O,composite:O},"fill-pattern":{source:O,composite:O},"fill-extrusion-pattern":{source:O,composite:O}}[u]}(i);return l&&l[r]||s[e][r]}Ee("ConstantBinder",Nt),Ee("CrossFadedConstantBinder",Xt),Ee("SourceExpressionBinder",at),Ee("CrossFadedCompositeBinder",Ai),Ee("CompositeExpressionBinder",$t),Ee("ProgramConfiguration",Gs,{omit:["_buffers"]}),Ee("ProgramConfigurationSet",Tr);var yt=8192;const Na=Math.pow(2,14)-1,rs=-Na-1;function Er(i){const e=yt/i.extent,r=i.loadGeometry();for(let s=0;sp.x+1||gp.y+1)&&ti("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ns(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Er(i):[]}}function Zo(i,e,r,s,l){i.emplaceBack(2*e+(s+1)/2,2*r+(l+1)/2)}class zl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new k,this.indexArray=new le,this.segments=new me,this.programConfigurations=new Tr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){const l=this.layers[0],u=[];let p=null,f=!1;l.type==="circle"&&(p=l.layout.get("circle-sort-key"),f=!p.isConstant());for(const{feature:g,id:v,index:b,sourceLayerIndex:E}of e){const I=this.layers[0]._featureFilter.needGeometry,C=ns(g,I);if(!this.layers[0]._featureFilter.filter(new bt(this.zoom),C,s))continue;const P=f?p.evaluate(C,{},s):void 0,R={id:v,properties:g.properties,type:g.type,sourceLayerIndex:E,index:b,geometry:I?C.geometry:Er(g),patterns:{},sortKey:P};u.push(R)}f&&u.sort((g,v)=>g.sortKey-v.sortKey);for(const g of u){const{geometry:v,index:b,sourceLayerIndex:E}=g,I=e[b].feature;this.addFeature(g,v,b,s),r.featureIndex.insert(I,v,b,E,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ve),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,r,s,l){for(const u of r)for(const p of u){const f=p.x,g=p.y;if(f<0||f>=yt||g<0||g>=yt)continue;const v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=v.vertexLength;Zo(this.layoutVertexArray,f,g,-1,-1),Zo(this.layoutVertexArray,f,g,1,-1),Zo(this.layoutVertexArray,f,g,1,1),Zo(this.layoutVertexArray,f,g,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),v.vertexLength+=4,v.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,{},l)}}function wc(i,e){for(let r=0;r1){if(kl(i,e))return!0;for(let s=0;s1?r:r.sub(e)._mult(l)._add(e))}function Sc(i,e){let r,s,l,u=!1;for(let p=0;pe.y!=l.y>e.y&&e.x<(l.x-s.x)*(e.y-s.y)/(l.y-s.y)+s.x&&(u=!u)}return u}function Xs(i,e){let r=!1;for(let s=0,l=i.length-1;se.y!=p.y>e.y&&e.x<(p.x-u.x)*(e.y-u.y)/(p.y-u.y)+u.x&&(r=!r)}return r}function ou(i,e,r){const s=r[0],l=r[2];if(i.xl.x&&e.x>l.x||i.yl.y&&e.y>l.y)return!1;const u=ct(i,e,r[0]);return u!==ct(i,e,r[1])||u!==ct(i,e,r[2])||u!==ct(i,e,r[3])}function $a(i,e,r){const s=e.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Go(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Xo(i,e,r,s,l){if(!e[0]&&!e[1])return i;const u=Ae.convert(e)._mult(l);r==="viewport"&&u._rotate(-s);const p=[];for(let f=0;fi.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>e.width||l.height>e.height||s.x>e.width-l.width||s.y>e.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const p=i.data,f=e.data;if(p===f)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g{e[i.evaluationKey]=g;const v=i.expression.evaluate(e);l.data[p+f+0]=Math.floor(255*v.r/v.a),l.data[p+f+1]=Math.floor(255*v.g/v.a),l.data[p+f+2]=Math.floor(255*v.b/v.a),l.data[p+f+3]=Math.floor(255*v.a)};if(i.clips)for(let p=0,f=0;p80*r){s=u=i[0],l=p=i[1];for(var P=r;Pu&&(u=f),g>p&&(p=g);v=(v=Math.max(u-s,p-l))!==0?32767/v:0}return Za(I,C,r,s,l,v,0),C}function Bc(i,e,r,s,l){var u,p;if(l===Vl(i,e,r,s)>0)for(u=e;u=e;u-=s)p=Oc(u,i[u],i[u+1],p);return p&&Ko(p,p.next)&&(Xa(p),p=p.next),p}function ss(i,e){if(!i)return i;e||(e=i);var r,s=i;do if(r=!1,s.steiner||!Ko(s,s.next)&&kt(s.prev,s,s.next)!==0)s=s.next;else{if(Xa(s),(s=e=s.prev)===s.next)break;r=!0}while(r||s!==e);return e}function Za(i,e,r,s,l,u,p){if(i){!p&&u&&function(b,E,I,C){var P=b;do P.z===0&&(P.z=Ol(P.x,P.y,E,I,C)),P.prevZ=P.prev,P.nextZ=P.next,P=P.next;while(P!==b);P.prevZ.nextZ=null,P.prevZ=null,function(R){var L,G,W,q,Y,Q,re,Te,Ie=1;do{for(G=R,R=null,Y=null,Q=0;G;){for(Q++,W=G,re=0,L=0;L0||Te>0&&W;)re!==0&&(Te===0||!W||G.z<=W.z)?(q=G,G=G.nextZ,re--):(q=W,W=W.nextZ,Te--),Y?Y.nextZ=q:R=q,q.prevZ=Y,Y=q;G=W}Y.nextZ=null,Ie*=2}while(Q>1)}(P)}(i,s,l,u);for(var f,g,v=i;i.prev!==i.next;)if(f=i.prev,g=i.next,u?mu(i,s,l,u):fu(i))e.push(f.i/r|0),e.push(i.i/r|0),e.push(g.i/r|0),Xa(i),i=g.next,v=g.next;else if((i=g)===v){p?p===1?Za(i=gu(ss(i),e,r),e,r,s,l,u,2):p===2&&_u(i,e,r,s,l,u):Za(ss(i),e,r,s,l,u,1);break}}}function fu(i){var e=i.prev,r=i,s=i.next;if(kt(e,r,s)>=0)return!1;for(var l=e.x,u=r.x,p=s.x,f=e.y,g=r.y,v=s.y,b=lu?l>p?l:p:u>p?u:p,C=f>g?f>v?f:v:g>v?g:v,P=s.next;P!==e;){if(P.x>=b&&P.x<=I&&P.y>=E&&P.y<=C&&Hs(l,f,u,g,p,v,P.x,P.y)&&kt(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function mu(i,e,r,s){var l=i.prev,u=i,p=i.next;if(kt(l,u,p)>=0)return!1;for(var f=l.x,g=u.x,v=p.x,b=l.y,E=u.y,I=p.y,C=fg?f>v?f:v:g>v?g:v,L=b>E?b>I?b:I:E>I?E:I,G=Ol(C,P,e,r,s),W=Ol(R,L,e,r,s),q=i.prevZ,Y=i.nextZ;q&&q.z>=G&&Y&&Y.z<=W;){if(q.x>=C&&q.x<=R&&q.y>=P&&q.y<=L&&q!==l&&q!==p&&Hs(f,b,g,E,v,I,q.x,q.y)&&kt(q.prev,q,q.next)>=0||(q=q.prevZ,Y.x>=C&&Y.x<=R&&Y.y>=P&&Y.y<=L&&Y!==l&&Y!==p&&Hs(f,b,g,E,v,I,Y.x,Y.y)&&kt(Y.prev,Y,Y.next)>=0))return!1;Y=Y.nextZ}for(;q&&q.z>=G;){if(q.x>=C&&q.x<=R&&q.y>=P&&q.y<=L&&q!==l&&q!==p&&Hs(f,b,g,E,v,I,q.x,q.y)&&kt(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;Y&&Y.z<=W;){if(Y.x>=C&&Y.x<=R&&Y.y>=P&&Y.y<=L&&Y!==l&&Y!==p&&Hs(f,b,g,E,v,I,Y.x,Y.y)&&kt(Y.prev,Y,Y.next)>=0)return!1;Y=Y.nextZ}return!0}function gu(i,e,r){var s=i;do{var l=s.prev,u=s.next.next;!Ko(l,u)&&Rc(l,s,s.next,u)&&Ga(l,u)&&Ga(u,l)&&(e.push(l.i/r|0),e.push(s.i/r|0),e.push(u.i/r|0),Xa(s),Xa(s.next),s=i=u),s=s.next}while(s!==i);return ss(s)}function _u(i,e,r,s,l,u){var p=i;do{for(var f=p.next.next;f!==p.prev;){if(p.i!==f.i&&wu(p,f)){var g=Fc(p,f);return p=ss(p,p.next),g=ss(g,g.next),Za(p,e,r,s,l,u,0),void Za(g,e,r,s,l,u,0)}f=f.next}p=p.next}while(p!==i)}function yu(i,e){return i.x-e.x}function xu(i,e){var r=function(l,u){var p,f=u,g=l.x,v=l.y,b=-1/0;do{if(v<=f.y&&v>=f.next.y&&f.next.y!==f.y){var E=f.x+(v-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(E<=g&&E>b&&(b=E,p=f.x=f.x&&f.x>=P&&g!==f.x&&Hs(vp.x||f.x===p.x&&vu(p,f)))&&(p=f,L=I)),f=f.next;while(f!==C);return p}(i,e);if(!r)return e;var s=Fc(r,i);return ss(s,s.next),ss(r,r.next)}function vu(i,e){return kt(i.prev,i,e.prev)<0&&kt(e.next,i,i.next)<0}function Ol(i,e,r,s,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*l|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function bu(i){var e=i,r=i;do(e.x=(i-p)*(u-f)&&(i-p)*(s-f)>=(r-p)*(e-f)&&(r-p)*(u-f)>=(l-p)*(s-f)}function wu(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,s){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==s.i&&l.next.i!==s.i&&Rc(l,l.next,r,s))return!0;l=l.next}while(l!==r);return!1}(i,e)&&(Ga(i,e)&&Ga(e,i)&&function(r,s){var l=r,u=!1,p=(r.x+s.x)/2,f=(r.y+s.y)/2;do l.y>f!=l.next.y>f&&l.next.y!==l.y&&p<(l.next.x-l.x)*(f-l.y)/(l.next.y-l.y)+l.x&&(u=!u),l=l.next;while(l!==r);return u}(i,e)&&(kt(i.prev,i,e.prev)||kt(i,e.prev,e))||Ko(i,e)&&kt(i.prev,i,i.next)>0&&kt(e.prev,e,e.next)>0)}function kt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function Ko(i,e){return i.x===e.x&&i.y===e.y}function Rc(i,e,r,s){var l=Jo(kt(i,e,r)),u=Jo(kt(i,e,s)),p=Jo(kt(r,s,i)),f=Jo(kt(r,s,e));return l!==u&&p!==f||!(l!==0||!Yo(i,r,e))||!(u!==0||!Yo(i,s,e))||!(p!==0||!Yo(r,i,s))||!(f!==0||!Yo(r,e,s))}function Yo(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function Jo(i){return i>0?1:i<0?-1:0}function Ga(i,e){return kt(i.prev,i,i.next)<0?kt(i,e,i.next)>=0&&kt(i,i.prev,e)>=0:kt(i,e,i.prev)<0||kt(i,i.next,e)<0}function Fc(i,e){var r=new Ul(i.i,i.x,i.y),s=new Ul(e.i,e.x,e.y),l=i.next,u=e.prev;return i.next=e,e.prev=i,r.next=l,l.prev=r,s.next=r,r.prev=s,u.next=s,s.prev=u,s}function Oc(i,e,r,s){var l=new Ul(i,e,r);return s?(l.next=s.next,l.prev=s,s.next.prev=l,s.next=l):(l.prev=l,l.next=l),l}function Xa(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Ul(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Vl(i,e,r,s){for(var l=0,u=e,p=r-s;u0&&r.holes.push(s+=i[l-1].length)}return r};var Uc=vt(Fl.exports);function Tu(i,e,r,s,l){Vc(i,e,r||0,s||i.length-1,l||Eu)}function Vc(i,e,r,s,l){for(;s>r;){if(s-r>600){var u=s-r+1,p=e-r+1,f=Math.log(u),g=.5*Math.exp(2*f/3),v=.5*Math.sqrt(f*g*(u-g)/u)*(p-u/2<0?-1:1);Vc(i,e,Math.max(r,Math.floor(e-p*g/u+v)),Math.min(s,Math.floor(e+(u-p)*g/u+v)),l)}var b=i[e],E=r,I=s;for(Wa(i,r,e),l(i[s],b)>0&&Wa(i,r,s);E0;)I--}l(i[r],b)===0?Wa(i,r,I):Wa(i,++I,s),I<=e&&(r=I+1),e<=I&&(s=I-1)}}function Wa(i,e,r){var s=i[e];i[e]=i[r],i[r]=s}function Eu(i,e){return ie?1:0}function Nl(i,e){const r=i.length;if(r<=1)return[i];const s=[];let l,u;for(let p=0;p1)for(let p=0;pr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new D,this.indexArray=new le,this.indexArray2=new be,this.programConfigurations=new Tr(e.layers,e.zoom),this.segments=new me,this.segments2=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=$l("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),u=!l.isConstant(),p=[];for(const{feature:f,id:g,index:v,sourceLayerIndex:b}of e){const E=this.layers[0]._featureFilter.needGeometry,I=ns(f,E);if(!this.layers[0]._featureFilter.filter(new bt(this.zoom),I,s))continue;const C=u?l.evaluate(I,{},s,r.availableImages):void 0,P={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:v,geometry:E?I.geometry:Er(f),patterns:{},sortKey:C};p.push(P)}u&&p.sort((f,g)=>f.sortKey-g.sortKey);for(const f of p){const{geometry:g,index:v,sourceLayerIndex:b}=f;if(this.hasPattern){const E=ql("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(E)}else this.addFeature(f,g,v,s,{});r.featureIndex.insert(e[v].feature,g,v,b,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,du),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())}addFeature(e,r,s,l,u){for(const p of Nl(r,500)){let f=0;for(const C of p)f+=C.length;const g=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),v=g.vertexLength,b=[],E=[];for(const C of p){if(C.length===0)continue;C!==p[0]&&E.push(b.length/2);const P=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),R=P.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(R+C.length-1,R),b.push(C[0].x),b.push(C[0].y);for(let L=1;L>3}if(l--,s===1||s===2)u+=i.readSVarint(),p+=i.readSVarint(),s===1&&(e&&f.push(e),e=[]),e.push(new Pu(u,p));else{if(s!==7)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&f.push(e),f},Ks.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,s=0,l=0,u=0,p=1/0,f=-1/0,g=1/0,v=-1/0;i.pos>3}if(s--,r===1||r===2)(l+=i.readSVarint())f&&(f=l),(u+=i.readSVarint())v&&(v=u);else if(r!==7)throw new Error("unknown command "+r)}return[p,g,f,v]},Ks.prototype.toGeoJSON=function(i,e,r){var s,l,u=this.extent*Math.pow(2,r),p=this.extent*i,f=this.extent*e,g=this.loadGeometry(),v=Ks.types[this.type];function b(C){for(var P=0;P>3;l=p===1?s.readString():p===2?s.readFloat():p===3?s.readDouble():p===4?s.readVarint64():p===5?s.readVarint():p===6?s.readSVarint():p===7?s.readBoolean():null}return l}(r))}Zc.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Du(this._pbf,e,this.extent,this._keys,this._values)};var Bu=jc;function Ru(i,e,r){if(i===3){var s=new Bu(r,r.readVarint()+r.pos);s.length&&(e[s.name]=s)}}Pn.VectorTile=function(i,e){this.layers=i.readFields(Ru,{},e)},Pn.VectorTileFeature=qc,Pn.VectorTileLayer=jc;const Fu=Pn.VectorTileFeature.types,Zl=Math.pow(2,13);function Ha(i,e,r,s,l,u,p,f){i.emplaceBack(e,r,2*Math.floor(s*Zl)+p,l*Zl*2,u*Zl*2,Math.round(f))}class Gl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new U,this.centroidVertexArray=new B,this.indexArray=new le,this.programConfigurations=new Tr(e.layers,e.zoom),this.segments=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.features=[],this.hasPattern=$l("fill-extrusion",this.layers,r);for(const{feature:l,id:u,index:p,sourceLayerIndex:f}of e){const g=this.layers[0]._featureFilter.needGeometry,v=ns(l,g);if(!this.layers[0]._featureFilter.filter(new bt(this.zoom),v,s))continue;const b={id:u,sourceLayerIndex:f,index:p,geometry:g?v.geometry:Er(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(ql("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,p,s,{}),r.featureIndex.insert(l,b.geometry,p,f,this.index,!0)}}addFeatures(e,r,s){for(const l of this.features){const{geometry:u}=l;this.addFeature(l,u,l.index,r,s)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Mu),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Cu.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,r,s,l,u){const p={x:0,y:0,vertexCount:0};for(const f of Nl(r,500)){let g=0;for(const P of f)g+=P.length;let v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const P of f){if(P.length===0||Uu(P))continue;let R=0;for(let L=0;L=1){const W=P[L-1];if(!Ou(G,W)){v.vertexLength+4>me.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const q=G.sub(W)._perp()._unit(),Y=W.dist(G);R+Y>32768&&(R=0),Ha(this.layoutVertexArray,G.x,G.y,q.x,q.y,0,0,R),Ha(this.layoutVertexArray,G.x,G.y,q.x,q.y,0,1,R),p.x+=2*G.x,p.y+=2*G.y,p.vertexCount+=2,R+=Y,Ha(this.layoutVertexArray,W.x,W.y,q.x,q.y,0,0,R),Ha(this.layoutVertexArray,W.x,W.y,q.x,q.y,0,1,R),p.x+=2*W.x,p.y+=2*W.y,p.vertexCount+=2;const Q=v.vertexLength;this.indexArray.emplaceBack(Q,Q+2,Q+1),this.indexArray.emplaceBack(Q+1,Q+2,Q+3),v.vertexLength+=4,v.primitiveLength+=2}}}}if(v.vertexLength+g>me.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),Fu[e.type]!=="Polygon")continue;const b=[],E=[],I=v.vertexLength;for(const P of f)if(P.length!==0){P!==f[0]&&E.push(b.length/2);for(let R=0;Ryt)||i.y===e.y&&(i.y<0||i.y>yt)}function Uu(i){return i.every(e=>e.x<0)||i.every(e=>e.x>yt)||i.every(e=>e.y<0)||i.every(e=>e.y>yt)}let Gc;Ee("FillExtrusionBucket",Gl,{omit:["layers","features"]});var Vu={get paint(){return Gc=Gc||new vi({"fill-extrusion-opacity":new Me(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Le(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Me(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Me(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new es(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Le(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Le(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Me(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};function Ka(i,e){return i.x*e.x+i.y*e.y}function Xc(i,e){if(i.length===1){let r=0;const s=e[r++];let l;for(;!l||s.equals(l);)if(l=e[r++],!l)return 1/0;for(;rr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Z,this.layoutVertexArray2=new J,this.indexArray=new le,this.programConfigurations=new Tr(e.layers,e.zoom),this.segments=new me,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=$l("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),u=!l.isConstant(),p=[];for(const{feature:f,id:g,index:v,sourceLayerIndex:b}of e){const E=this.layers[0]._featureFilter.needGeometry,I=ns(f,E);if(!this.layers[0]._featureFilter.filter(new bt(this.zoom),I,s))continue;const C=u?l.evaluate(I,{},s):void 0,P={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:v,geometry:E?I.geometry:Er(f),patterns:{},sortKey:C};p.push(P)}u&&p.sort((f,g)=>f.sortKey-g.sortKey);for(const f of p){const{geometry:g,index:v,sourceLayerIndex:b}=f;if(this.hasPattern){const E=ql("line",this.layers,f,this.zoom,r);this.patternFeatures.push(E)}else this.addFeature(f,g,v,s,{});r.featureIndex.insert(e[v].feature,g,v,b,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,ju)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$u),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.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,s,l,u){const p=this.layers[0].layout,f=p.get("line-join").evaluate(e,{}),g=p.get("line-cap"),v=p.get("line-miter-limit"),b=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const E of r)this.addLine(E,e,f,g,v,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,u,l)}addLine(e,r,s,l,u,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let G=0;G=2&&e[g-1].equals(e[g-2]);)g--;let v=0;for(;v0;if(Te&&G>v){const fe=I.dist(C);if(fe>2*b){const ve=I.sub(I.sub(C)._mult(b/fe)._round());this.updateDistance(C,ve),this.addCurrentVertex(ve,R,0,0,E),C=ve}}const xe=C&&P;let ge=xe?s:f?"butt":l;if(xe&&ge==="round"&&(Qu&&(ge="bevel"),ge==="bevel"&&(Q>2&&(ge="flipbevel"),Q100)W=L.mult(-1);else{const fe=Q*R.add(L).mag()/R.sub(L).mag();W._perp()._mult(fe*(Ie?-1:1))}this.addCurrentVertex(I,W,0,0,E),this.addCurrentVertex(I,W.mult(-1),0,0,E)}else if(ge==="bevel"||ge==="fakeround"){const fe=-Math.sqrt(Q*Q-1),ve=Ie?fe:0,_e=Ie?0:fe;if(C&&this.addCurrentVertex(I,R,ve,_e,E),ge==="fakeround"){const he=Math.round(180*re/Math.PI/20);for(let ke=1;ke2*b){const ve=I.add(P.sub(I)._mult(b/fe)._round());this.updateDistance(I,ve),this.addCurrentVertex(ve,L,0,0,E),I=ve}}}}addCurrentVertex(e,r,s,l,u,p=!1){const f=r.y*l-r.x,g=-r.y-r.x*l;this.addHalfVertex(e,r.x+r.y*s,r.y-r.x*s,p,!1,s,u),this.addHalfVertex(e,f,g,p,!0,-l,u),this.distance>Wc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,s,l,u,p))}addHalfVertex({x:e,y:r},s,l,u,p,f,g){const v=.5*(this.lineClips?this.scaledDistance*(Wc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(u?1:0),(r<<1)+(p?1:0),Math.round(63*s)+128,Math.round(63*l)+128,1+(f===0?0:f<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),g.primitiveLength++),p?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let Hc,Kc;Ee("LineBucket",Xl,{omit:["layers","patternFeatures"]});var Yc={get paint(){return Kc=Kc||new vi({"line-opacity":new Le(ie.paint_line["line-opacity"]),"line-color":new Le(ie.paint_line["line-color"]),"line-translate":new Me(ie.paint_line["line-translate"]),"line-translate-anchor":new Me(ie.paint_line["line-translate-anchor"]),"line-width":new Le(ie.paint_line["line-width"]),"line-gap-width":new Le(ie.paint_line["line-gap-width"]),"line-offset":new Le(ie.paint_line["line-offset"]),"line-blur":new Le(ie.paint_line["line-blur"]),"line-dasharray":new Ba(ie.paint_line["line-dasharray"]),"line-pattern":new es(ie.paint_line["line-pattern"]),"line-gradient":new Ra(ie.paint_line["line-gradient"])})},get layout(){return Hc=Hc||new vi({"line-cap":new Me(ie.layout_line["line-cap"]),"line-join":new Le(ie.layout_line["line-join"]),"line-miter-limit":new Me(ie.layout_line["line-miter-limit"]),"line-round-limit":new Me(ie.layout_line["line-round-limit"]),"line-sort-key":new Le(ie.layout_line["line-sort-key"])})}};class Xu extends Le{possiblyEvaluate(e,r){return r=new bt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,s,l){return r=_t({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,s,l)}}let Qo;function Jc(i,e){return e>0?e+2*i:i}const Wu=Ft([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Hu=Ft([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ft([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ku=Ft([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Ft([{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"}]);const Qc=Ft([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Yu=Ft([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ju(i,e,r){return i.sections.forEach(s=>{s.text=function(l,u,p){const f=u.layout.get("text-transform").evaluate(p,{});return f==="uppercase"?l=l.toLocaleUpperCase():f==="lowercase"&&(l=l.toLocaleLowerCase()),$i.applyArabicShaping&&(l=$i.applyArabicShaping(l)),l}(s.text,e,r)}),i}Ft([{name:"triangle",components:3,type:"Uint16"}]),Ft([{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"}]),Ft([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ft([{type:"Float32",name:"offsetX"}]),Ft([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const Ya={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Wt=24,eh=ut,th=function(i,e,r,s,l){var u,p,f=8*l-s-1,g=(1<>1,b=-7,E=r?l-1:0,I=r?-1:1,C=i[e+E];for(E+=I,u=C&(1<<-b)-1,C>>=-b,b+=f;b>0;u=256*u+i[e+E],E+=I,b-=8);for(p=u&(1<<-b)-1,u>>=-b,b+=s;b>0;p=256*p+i[e+E],E+=I,b-=8);if(u===0)u=1-v;else{if(u===g)return p?NaN:1/0*(C?-1:1);p+=Math.pow(2,s),u-=v}return(C?-1:1)*p*Math.pow(2,u-s)},ih=function(i,e,r,s,l,u){var p,f,g,v=8*u-l-1,b=(1<>1,I=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=s?0:u-1,P=s?1:-1,R=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,p=b):(p=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-p))<1&&(p--,g*=2),(e+=p+E>=1?I/g:I*Math.pow(2,1-E))*g>=2&&(p++,g/=2),p+E>=b?(f=0,p=b):p+E>=1?(f=(e*g-1)*Math.pow(2,l),p+=E):(f=e*Math.pow(2,E-1)*Math.pow(2,l),p=0));l>=8;i[r+C]=255&f,C+=P,f/=256,l-=8);for(p=p<0;i[r+C]=255&p,C+=P,p/=256,v-=8);i[r+C-P]|=128*R};function ut(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}ut.Varint=0,ut.Fixed64=1,ut.Bytes=2,ut.Fixed32=5;var Wl=4294967296,rh=1/Wl,nh=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function sn(i){return i.type===ut.Bytes?i.readVarint()+i.pos:i.pos+1}function Ys(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function sh(i,e,r){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(s);for(var l=r.pos-1;l>=i;l--)r.buf[l+s]=r.buf[l]}function Qu(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function ah(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}ut.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&s,i(l,e,this),this.pos===u&&this.skip(s)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=el(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=ah(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=el(this.buf,this.pos)+el(this.buf,this.pos+4)*Wl;return this.pos+=8,i},readSFixed64:function(){var i=el(this.buf,this.pos)+ah(this.buf,this.pos+4)*Wl;return this.pos+=8,i},readFloat:function(){var i=th(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=th(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,s=this.buf;return e=127&(r=s[this.pos++]),r<128?e:(e|=(127&(r=s[this.pos++]))<<7,r<128?e:(e|=(127&(r=s[this.pos++]))<<14,r<128?e:(e|=(127&(r=s[this.pos++]))<<21,r<128?e:function(l,u,p){var f,g,v=p.buf;if(f=(112&(g=v[p.pos++]))>>4,g<128||(f|=(127&(g=v[p.pos++]))<<3,g<128)||(f|=(127&(g=v[p.pos++]))<<10,g<128)||(f|=(127&(g=v[p.pos++]))<<17,g<128)||(f|=(127&(g=v[p.pos++]))<<24,g<128)||(f|=(1&(g=v[p.pos++]))<<31,g<128))return Ys(l,f,u);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&nh?function(r,s,l){return nh.decode(r.subarray(s,l))}(this.buf,e,i):function(r,s,l){for(var u="",p=s;p239?4:b>223?3:b>191?2:1;if(p+I>l)break;I===1?b<128&&(E=b):I===2?(192&(f=r[p+1]))==128&&(E=(31&b)<<6|63&f)<=127&&(E=null):I===3?(g=r[p+2],(192&(f=r[p+1]))==128&&(192&g)==128&&((E=(15&b)<<12|(63&f)<<6|63&g)<=2047||E>=55296&&E<=57343)&&(E=null)):I===4&&(g=r[p+2],v=r[p+3],(192&(f=r[p+1]))==128&&(192&g)==128&&(192&v)==128&&((E=(15&b)<<18|(63&f)<<12|(63&g)<<6|63&v)<=65535||E>=1114112)&&(E=null)),E===null?(E=65533,I=1):E>65535&&(E-=65536,u+=String.fromCharCode(E>>>10&1023|55296),E=56320|1023&E),u+=String.fromCharCode(E),p+=I}return u}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==ut.Bytes)return i.push(this.readVarint(e));var r=sn(this);for(i=i||[];this.pos127;);else if(e===ut.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ut.Fixed32)this.pos+=4;else{if(e!==ut.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var s,l;if(e>=0?(s=e%4294967296|0,l=e/4294967296|0):(l=~(-e/4294967296),4294967295^(s=~(-e%4294967296))?s=s+1|0:(s=0,l=l+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,p,f){f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,f.buf[f.pos]=127&(u>>>=7)}(s,0,r),function(u,p){var f=(7&u)<<4;p.buf[p.pos++]|=f|((u>>>=3)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u)))))}(l,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(s,l,u){for(var p,f,g=0;g55295&&p<57344){if(!f){p>56319||g+1===l.length?(s[u++]=239,s[u++]=191,s[u++]=189):f=p;continue}if(p<56320){s[u++]=239,s[u++]=191,s[u++]=189,f=p;continue}p=f-55296<<10|p-56320|65536,f=null}else f&&(s[u++]=239,s[u++]=191,s[u++]=189,f=null);p<128?s[u++]=p:(p<2048?s[u++]=p>>6|192:(p<65536?s[u++]=p>>12|224:(s[u++]=p>>18|240,s[u++]=p>>12&63|128),s[u++]=p>>6&63|128),s[u++]=63&p|128)}return u}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&sh(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),ih(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),ih(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&sh(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,e,r){this.writeTag(i,ut.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Qu,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,ep,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,rp,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,tp,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,ip,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,np,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,sp,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,ap,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,op,e)},writeBytesField:function(i,e){this.writeTag(i,ut.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,ut.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,ut.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,ut.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,ut.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,ut.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,ut.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,ut.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,ut.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,ut.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Hl=vt(eh);const Kl=3;function lp(i,e,r){i===1&&r.readMessage(cp,e)}function cp(i,e,r){if(i===3){const{id:s,bitmap:l,width:u,height:p,left:f,top:g,advance:v}=r.readMessage(hp,{});e.push({id:s,bitmap:new ja({width:u+2*Kl,height:p+2*Kl},l),metrics:{width:u,height:p,left:f,top:g,advance:v}})}}function hp(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const oh=Kl;function lh(i){let e=0,r=0;for(const p of i)e+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,f)=>f.h-p.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let l=0,u=0;for(const p of i)for(let f=s.length-1;f>=0;f--){const g=s[f];if(!(p.w>g.w||p.h>g.h)){if(p.x=g.x,p.y=g.y,u=Math.max(u,p.y+p.h),l=Math.max(l,p.x+p.w),p.w===g.w&&p.h===g.h){const v=s.pop();f=0&&s>=e&&il[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const s=new Qs;return s.text=this.text.substring(e,r),s.sectionIndex=this.sectionIndex.slice(e,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(Qa.forText(e.scale,e.fontStack||r));const s=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function tl(i,e,r,s,l,u,p,f,g,v,b,E,I,C,P,R){const L=Qs.fromFeature(i,l);let G;E===h.WritingMode.vertical&&L.verticalizePunctuation();const{processBidirectionalText:W,processStyledBidirectionalText:q}=$i;if(W&&L.sections.length===1){G=[];const re=W(L.toString(),Jl(L,v,u,e,s,C,P));for(const Te of re){const Ie=new Qs;Ie.text=Te,Ie.sections=L.sections;for(let xe=0;xe0&&on>zi&&(zi=on)}else{const Ji=Ie[Ge.fontStack],ki=Ji&&Ji[li];if(ki&&ki.rect)Sr=ki.rect,hr=ki.metrics;else{const on=Te[Ge.fontStack],no=on&&on[li];if(!no)continue;hr=no.metrics}fi=(ai-Ge.scale)*Wt}ur?(re.verticalizable=!0,Pi.push({glyph:li,imageName:Ir,x:xt,y:wt+fi,vertical:ur,scale:Ge.scale,fontStack:Ge.fontStack,sectionIndex:qi,metrics:hr,rect:Sr}),xt+=an*Ge.scale+ke):(Pi.push({glyph:li,imageName:Ir,x:xt,y:wt+fi,vertical:ur,scale:Ge.scale,fontStack:Ge.fontStack,sectionIndex:qi,metrics:hr,rect:Sr}),xt+=hr.advance*Ge.scale+ke)}Pi.length!==0&&(qt=Math.max(xt-ke,qt),dp(Pi,0,Pi.length-1,ni,zi)),xt=0;const At=fe*ai+zi;wi.lineOffset=Math.max(zi,di),wt+=At,Yi=Math.max(At,Yi),++Ot}var Ht;const si=wt-Ja,{horizontalAlign:pi,verticalAlign:Mi}=Ql(ve);(function(Ut,ai,di,wi,Pi,zi,At,oi,Ge){const qi=(ai-di)*Pi;let li=0;li=zi!==At?-oi*wi-Ja:(-wi*Ge+.5)*At;for(const fi of Ut)for(const hr of fi.positionedGlyphs)hr.x+=qi,hr.y+=li})(re.positionedLines,ni,pi,Mi,qt,Yi,fe,si,ge.length),re.top+=-Mi*si,re.bottom=re.top+si,re.left+=-pi*qt,re.right=re.left+qt}(Q,e,r,s,G,p,f,g,E,v,I,R),!function(re){for(const Te of re)if(Te.positionedGlyphs.length!==0)return!1;return!0}(Y)&&Q}const il={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},up={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function hh(i,e,r,s,l,u){if(e.imageName){const p=s[e.imageName];return p?p.displaySize[0]*e.scale*Wt/u+l:0}{const p=r[e.fontStack],f=p&&p[i];return f?f.metrics.advance*e.scale+l:0}}function uh(i,e,r,s){const l=Math.pow(i-e,2);return s?i=0;let b=0;for(let I=0;Ip.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ll([]),this.placementViewportMatrix=Ll([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=mh(this.zoom,r["text-size"]),this.iconSizeData=mh(this.zoom,r["icon-size"]);const s=this.layers[0].layout,l=s.get("symbol-sort-key"),u=s.get("symbol-z-order");this.canOverlap=ec(s,"text-overlap","text-allow-overlap")!=="never"||ec(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(p=>h.WritingMode[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=e.sourceID}createArrays(){this.text=new ic(new Tr(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new ic(new Tr(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new x,this.lineVertexArray=new T,this.symbolInstances=new _}calculateGlyphDependencies(e,r,s,l,u){for(let p=0;p0)&&(p.value.kind!=="constant"||p.value.value.length>0),b=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,E=u.get("symbol-sort-key");if(this.features=[],!v&&!b)return;const I=r.iconDependencies,C=r.glyphDependencies,P=r.availableImages,R=new bt(this.zoom);for(const{feature:L,id:G,index:W,sourceLayerIndex:q}of e){const Y=l._featureFilter.needGeometry,Q=ns(L,Y);if(!l._featureFilter.filter(R,Q,s))continue;let re,Te;if(Y||(Q.geometry=Er(L)),v){const xe=l.getValueAndResolveTokens("text-field",Q,s,P),ge=Qt.factory(xe);_p(ge)&&(this.hasRTLText=!0),(!this.hasRTLText||ka()==="unavailable"||this.hasRTLText&&$i.isParsed())&&(re=Ju(ge,l,Q))}if(b){const xe=l.getValueAndResolveTokens("icon-image",Q,s,P);Te=xe instanceof Oi?xe:Oi.fromString(xe)}if(!re&&!Te)continue;const Ie=this.sortFeaturesByKey?E.evaluate(Q,{},s):void 0;if(this.features.push({id:G,text:re,icon:Te,index:W,sourceLayerIndex:q,geometry:Q.geometry,properties:L.properties,type:mp[L.type],sortKey:Ie}),Te&&(I[Te.name]=!0),re){const xe=p.evaluate(Q,{},s).join(","),ge=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(h.WritingMode.vertical)>=0;for(const fe of re.sections)if(fe.image)I[fe.image.name]=!0;else{const ve=Ps(re.toString()),_e=fe.fontStack||xe,he=C[_e]=C[_e]||{};this.calculateGlyphDependencies(fe.text,he,ge,this.allowVerticalPlacement,ve)}}}u.get("symbol-placement")==="line"&&(this.features=function(L){const G={},W={},q=[];let Y=0;function Q(xe){q.push(L[xe]),Y++}function re(xe,ge,fe){const ve=W[xe];return delete W[xe],W[ge]=ve,q[ve].geometry[0].pop(),q[ve].geometry[0]=q[ve].geometry[0].concat(fe[0]),ve}function Te(xe,ge,fe){const ve=G[ge];return delete G[ge],G[xe]=ve,q[ve].geometry[0].shift(),q[ve].geometry[0]=fe[0].concat(q[ve].geometry[0]),ve}function Ie(xe,ge,fe){const ve=fe?ge[0][ge[0].length-1]:ge[0][0];return`${xe}:${ve.x}:${ve.y}`}for(let xe=0;xexe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((L,G)=>L.sortKey-G.sortKey)}update(e,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,s))}isEmpty(){return this.symbolInstances.length===0&&!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,r){const s=this.lineVertexArray.length;if(e.segment!==void 0){let l=e.dist(r[e.segment+1]),u=e.dist(r[e.segment]);const p={};for(let f=e.segment+1;f=0;f--)p[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:u},f>0&&(u+=r[f-1].dist(r[f]));for(let f=0;f0}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,r){const s=e.placedSymbolArray.get(r),l=s.vertexStartIndex+4*s.numGlyphs;for(let u=s.vertexStartIndex;ul[f]-l[g]||u[g]-u[f]),p}addToSortKeyRanges(e,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((l,u,p)=>{l>=0&&p.indexOf(l)===u&&this.addIndicesForPlacedSymbol(this.text,l)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let gh,_h;Ee("SymbolBucket",ea,{omit:["layers","collisionBoxArray","features","compareText"]}),ea.MAX_GLYPHS=65535,ea.addDynamicAttributes=tc;var nc={get paint(){return _h=_h||new vi({"icon-opacity":new Le(ie.paint_symbol["icon-opacity"]),"icon-color":new Le(ie.paint_symbol["icon-color"]),"icon-halo-color":new Le(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new Le(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Le(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Me(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Me(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new Le(ie.paint_symbol["text-opacity"]),"text-color":new Le(ie.paint_symbol["text-color"],{runtimeType:yi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Le(ie.paint_symbol["text-halo-color"]),"text-halo-width":new Le(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new Le(ie.paint_symbol["text-halo-blur"]),"text-translate":new Me(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Me(ie.paint_symbol["text-translate-anchor"])})},get layout(){return gh=gh||new vi({"symbol-placement":new Me(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Me(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Me(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Le(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Me(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Me(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Me(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Me(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Me(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Me(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new Le(ie.layout_symbol["icon-size"]),"icon-text-fit":new Me(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Me(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new Le(ie.layout_symbol["icon-image"]),"icon-rotate":new Le(ie.layout_symbol["icon-rotate"]),"icon-padding":new Le(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Me(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new Le(ie.layout_symbol["icon-offset"]),"icon-anchor":new Le(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Me(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Me(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Me(ie.layout_symbol["text-rotation-alignment"]),"text-field":new Le(ie.layout_symbol["text-field"]),"text-font":new Le(ie.layout_symbol["text-font"]),"text-size":new Le(ie.layout_symbol["text-size"]),"text-max-width":new Le(ie.layout_symbol["text-max-width"]),"text-line-height":new Me(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new Le(ie.layout_symbol["text-letter-spacing"]),"text-justify":new Le(ie.layout_symbol["text-justify"]),"text-radial-offset":new Le(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Me(ie.layout_symbol["text-variable-anchor"]),"text-anchor":new Le(ie.layout_symbol["text-anchor"]),"text-max-angle":new Me(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Me(ie.layout_symbol["text-writing-mode"]),"text-rotate":new Le(ie.layout_symbol["text-rotate"]),"text-padding":new Me(ie.layout_symbol["text-padding"]),"text-keep-upright":new Me(ie.layout_symbol["text-keep-upright"]),"text-transform":new Le(ie.layout_symbol["text-transform"]),"text-offset":new Le(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Me(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Me(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Me(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Me(ie.layout_symbol["text-optional"])})}};class yh{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Br,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}Ee("FormatSectionOverride",yh,{omit:["defaultValue"]});class nl extends or{constructor(e){super(e,nc)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const l=[];for(const u of s)l.indexOf(u)<0&&l.push(u);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,s,l){const u=this.layout.get(e).evaluate(r,{},s,l),p=this._unevaluatedLayout._values[e];return p.isDataDriven()||ws(p.value)||!u?u:function(f,g){return g.replace(/{([^{}]+)}/g,(v,b)=>b in f?String(f[b]):"")}(r.properties,u)}createBucket(e){return new ea(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of nc.paint.overridableProperties){if(!nl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),s=new yh(r),l=new va(s,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new ba("source",l):new We("composite",l,r.value.zoomStops),this.paint._values[e]=new ar(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&nl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const s=e.get("text-field"),l=nc.paint.properties[r];let u=!1;const p=f=>{for(const g of f)if(l.overrides&&l.overrides.hasOverride(g))return void(u=!0)};if(s.value.kind==="constant"&&s.value.value instanceof Qt)p(s.value.value.sections);else if(s.value.kind==="source"){const f=v=>{u||(v instanceof Fr&&Bt(v.value)===yr?p(v.value.sections):v instanceof vs?p(v.sections):v.eachChild(f))},g=s.value;g._styleExpression&&f(g._styleExpression.expression)}return u}}let xh;var yp={get paint(){return xh=xh||new vi({"background-color":new Me(ie.paint_background["background-color"]),"background-pattern":new Ba(ie.paint_background["background-pattern"]),"background-opacity":new Me(ie.paint_background["background-opacity"])})}};let vh;var xp={get paint(){return vh=vh||new vi({"raster-opacity":new Me(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Me(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Me(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Me(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Me(ie.paint_raster["raster-saturation"]),"raster-contrast":new Me(ie.paint_raster["raster-contrast"]),"raster-resampling":new Me(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Me(ie.paint_raster["raster-fade-duration"])})}};class vp extends or{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const bp={circle:class extends or{constructor(i){super(i,lu)}createBucket(i){return new zl(i)}queryRadius(i){const e=i;return $a("circle-radius",this,e)+$a("circle-stroke-width",this,e)+Go(this.paint.get("circle-translate"))}queryIntersectsFeature(i,e,r,s,l,u,p,f){const g=Xo(i,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),u.angle,p),v=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),b=this.paint.get("circle-pitch-alignment")==="map",E=b?g:function(C,P){return C.map(R=>Mc(R,P))}(g,f),I=b?v*p:v;for(const C of s)for(const P of C){const R=b?P:Mc(P,f);let L=I;const G=Wo([],[P.x,P.y,0,1],f);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?L*=G[3]/u.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(L*=u.cameraToCenterDistance/G[3]),nu(E,R,L))return!0}return!1}},heatmap:class extends or{createBucket(i){return new Pc(i)}constructor(i){super(i,hu),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(i){i==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Dc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends or{constructor(i){super(i,uu)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends or{constructor(i){super(i,Iu)}recalculate(i,e){super.recalculate(i,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(i){return new jl(i)}queryRadius(){return Go(this.paint.get("fill-translate"))}queryIntersectsFeature(i,e,r,s,l,u,p){return Tc(Xo(i,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),u.angle,p),s)}isTileClipped(){return!0}},"fill-extrusion":class extends or{constructor(i){super(i,Vu)}createBucket(i){return new Gl(i)}queryRadius(){return Go(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,e,r,s,l,u,p,f){const g=Xo(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),u.angle,p),v=this.paint.get("fill-extrusion-height").evaluate(e,r),b=this.paint.get("fill-extrusion-base").evaluate(e,r),E=function(C,P,R,L){const G=[];for(const W of C){const q=[W.x,W.y,0,1];Wo(q,q,P),G.push(new Ae(q[0]/q[3],q[1]/q[3]))}return G}(g,f),I=function(C,P,R,L){const G=[],W=[],q=L[8]*P,Y=L[9]*P,Q=L[10]*P,re=L[11]*P,Te=L[8]*R,Ie=L[9]*R,xe=L[10]*R,ge=L[11]*R;for(const fe of C){const ve=[],_e=[];for(const he of fe){const ke=he.x,Ce=he.y,Ze=L[0]*ke+L[4]*Ce+L[12],xt=L[1]*ke+L[5]*Ce+L[13],wt=L[2]*ke+L[6]*Ce+L[14],qt=L[3]*ke+L[7]*Ce+L[15],Yi=wt+Q,ni=qt+re,Ot=Ze+Te,Ht=xt+Ie,si=wt+xe,pi=qt+ge,Mi=new Ae((Ze+q)/ni,(xt+Y)/ni);Mi.z=Yi/ni,ve.push(Mi);const Ut=new Ae(Ot/pi,Ht/pi);Ut.z=si/pi,_e.push(Ut)}G.push(ve),W.push(_e)}return[G,W]}(s,b,v,f);return function(C,P,R){let L=1/0;Tc(R,P)&&(L=Xc(R,P[0]));for(let G=0;G=3){for(let R=0;R{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const sc=63710088e-1;class Dn{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Dn(mi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,s=this.lat*r,l=e.lat*r,u=Math.sin(s)*Math.sin(l)+Math.cos(s)*Math.cos(l)*Math.cos((e.lng-this.lng)*r);return sc*Math.acos(Math.min(u,1))}static convert(e){if(e instanceof Dn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Dn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Dn(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const bh=2*Math.PI*sc;function wh(i){return bh*Math.cos(i*Math.PI/180)}function Th(i){return(180+i)/360}function Eh(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Sh(i,e){return i/wh(e)}function ac(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class sl{constructor(e,r,s=0){this.x=+e,this.y=+r,this.z=+s}static fromLngLat(e,r=0){const s=Dn.convert(e);return new sl(Th(s.lng),Eh(s.lat),Sh(r,s.lat))}toLngLat(){return new Dn(360*this.x-180,ac(this.y))}toAltitude(){return this.z*wh(ac(this.y))}meterInMercatorCoordinateUnits(){return 1/bh*(e=ac(this.y),1/Math.cos(e*Math.PI/180));var e}}function Ih(i,e,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,e*s-2*Math.PI*6378137/2]}class oc{constructor(e,r,s){if(e<0||e>25||s<0||s>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${s}, 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=r,this.y=s,this.key=to(0,e,e,r,s)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,s){const l=(p=this.y,f=this.z,g=Ih(256*(u=this.x),256*(p=Math.pow(2,f)-p-1),f),v=Ih(256*(u+1),256*(p+1),f),g[0]+","+g[1]+","+v[0]+","+v[1]);var u,p,f,g,v;const b=function(E,I,C){let P,R="";for(let L=E;L>0;L--)P=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new Ae((e.x*r-this.x)*yt,(e.y*r-this.y)*yt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Ah{constructor(e,r){this.wrap=e,this.canonical=r,this.key=to(e,r.z,r.z,r.x,r.y)}}class Ki{constructor(e,r,s,l,u){if(e= z; overscaledZ = ${e}; z = ${s}`);this.overscaledZ=e,this.wrap=r,this.canonical=new oc(s,+l,+u),this.key=to(r,e,s,l,u)}clone(){return new Ki(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(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new Ki(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ki(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?to(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):to(this.wrap*+r,e,e,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new Ki(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,l=2*this.canonical.y;return[new Ki(r,this.wrap,r,s,l),new Ki(r,this.wrap,r,s+1,l),new Ki(r,this.wrap,r,s,l+1),new Ki(r,this.wrap,r,s+1,l+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=f),f=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}_unpackMapbox(e,r,s){return(256*e*256+256*r+s)/10-1e4}_unpackTerrarium(e,r,s){return 256*e+r+s/256-32768}getPixels(){return new Hi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,s){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,u=r*this.dim+this.dim,p=s*this.dim,f=s*this.dim+this.dim;switch(r){case-1:l=u-1;break;case 1:u=l+1}switch(s){case-1:p=f-1;break;case 1:f=p+1}const g=-r*this.dim,v=-s*this.dim;for(let b=p;b=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Ph{constructor(e,r,s,l,u){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=s,e._y=l,this.properties=e.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class zh{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Kn(yt,16,0),this.grid3D=new Kn(yt,16,0),this.featureIndexArray=new M,this.promoteId=r}insert(e,r,s,l,u,p){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,l,u);const g=p?this.grid3D:this.grid;for(let v=0;v=0&&E[3]>=0&&g.insert(f,E[0],E[1],E[2],E[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Pn.VectorTile(new Hl(this.rawTileData)).layers,this.sourceLayerCoder=new Mh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,s,l){this.loadVTLayers();const u=e.params||{},p=yt/e.tileSize/e.scale,f=wa(u.filter),g=e.queryGeometry,v=e.queryPadding*p,b=Dh(g),E=this.grid.query(b.minX-v,b.minY-v,b.maxX+v,b.maxY+v),I=Dh(e.cameraQueryGeometry),C=this.grid3D.query(I.minX-v,I.minY-v,I.maxX+v,I.maxY+v,(L,G,W,q)=>function(Y,Q,re,Te,Ie){for(const ge of Y)if(Q<=ge.x&&re<=ge.y&&Te>=ge.x&&Ie>=ge.y)return!0;const xe=[new Ae(Q,re),new Ae(Q,Ie),new Ae(Te,Ie),new Ae(Te,re)];if(Y.length>2){for(const ge of xe)if(Xs(Y,ge))return!0}for(let ge=0;ge(q||(q=Er(Y)),Q.queryIntersectsFeature(g,Y,re,q,this.z,e.transform,p,e.pixelPosMatrix)))}return P}loadMatchingFeature(e,r,s,l,u,p,f,g,v,b,E){const I=this.bucketLayerIDs[r];if(p&&!function(L,G){for(let W=0;W=0)return!0;return!1}(p,I))return;const C=this.sourceLayerCoder.decode(s),P=this.vtLayers[C].feature(l);if(u.needGeometry){const L=ns(P,!0);if(!u.filter(new bt(this.tileID.overscaledZ),L,this.tileID.canonical))return}else if(!u.filter(new bt(this.tileID.overscaledZ),P))return;const R=this.getId(P,C);for(let L=0;L{const f=e instanceof Fs?e.get(p):null;return f&&f.evaluate?f.evaluate(r,s,l):f})}function Dh(i){let e=1/0,r=1/0,s=-1/0,l=-1/0;for(const u of i)e=Math.min(e,u.x),r=Math.min(r,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return{minX:e,minY:r,maxX:s,maxY:l}}function Tp(i,e){return e-i}function Lh(i,e,r,s,l){const u=[];for(let p=0;p=s&&E.x>=s||(b.x>=s?b=new Ae(s,b.y+(s-b.x)/(E.x-b.x)*(E.y-b.y))._round():E.x>=s&&(E=new Ae(s,b.y+(s-b.x)/(E.x-b.x)*(E.y-b.y))._round()),b.y>=l&&E.y>=l||(b.y>=l?b=new Ae(b.x+(l-b.y)/(E.y-b.y)*(E.x-b.x),l)._round():E.y>=l&&(E=new Ae(b.x+(l-b.y)/(E.y-b.y)*(E.x-b.x),l)._round()),g&&b.equals(g[g.length-1])||(g=[b],u.push(g)),g.push(E)))))}}return u}Ee("FeatureIndex",zh,{omit:["rawTileData","sourceLayerCoder"]});class Ln extends Ae{constructor(e,r,s,l){super(e,r),this.angle=s,l!==void 0&&(this.segment=l)}clone(){return new Ln(this.x,this.y,this.angle,this.segment)}}function Bh(i,e,r,s,l){if(e.segment===void 0)return!0;let u=e,p=e.segment+1,f=0;for(;f>-r/2;){if(p--,p<0)return!1;f-=i[p].dist(u),u=i[p]}f+=i[p].dist(i[p+1]),p++;const g=[];let v=0;for(;fs;)v-=g.shift().angleDelta;if(v>l)return!1;p++,f+=b.dist(E)}return!0}function Rh(i){let e=0;for(let r=0;rv){const P=(v-g)/C,R=Ei.number(E.x,I.x,P),L=Ei.number(E.y,I.y,P),G=new Ln(R,L,I.angleTo(E),b);return G._round(),!p||Bh(i,G,f,p,e)?G:void 0}g+=C}}function Sp(i,e,r,s,l,u,p,f,g){const v=Fh(s,u,p),b=Oh(s,l),E=b*p,I=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return e-E=0&&Y=0&&Q=0&&I+v<=b){const re=new Ln(Y,Q,W,P);re._round(),s&&!Bh(i,re,u,s,l)||C.push(re)}}E+=G}return f||C.length||p||(C=Uh(i,E/2,r,s,l,u,p,!0,g)),C}Ee("Anchor",Ln);const ta=Ci;function Vh(i,e,r,s){const l=[],u=i.image,p=u.pixelRatio,f=u.paddedRect.w-2*ta,g=u.paddedRect.h-2*ta,v=i.right-i.left,b=i.bottom-i.top,E=u.stretchX||[[0,f]],I=u.stretchY||[[0,g]],C=(fe,ve)=>fe+ve[1]-ve[0],P=E.reduce(C,0),R=I.reduce(C,0),L=f-P,G=g-R;let W=0,q=P,Y=0,Q=R,re=0,Te=L,Ie=0,xe=G;if(u.content&&s){const fe=u.content;W=al(E,0,fe[0]),Y=al(I,0,fe[1]),q=al(E,fe[0],fe[2]),Q=al(I,fe[1],fe[3]),re=fe[0]-W,Ie=fe[1]-Y,Te=fe[2]-fe[0]-q,xe=fe[3]-fe[1]-Q}const ge=(fe,ve,_e,he)=>{const ke=ol(fe.stretch-W,q,v,i.left),Ce=ll(fe.fixed-re,Te,fe.stretch,P),Ze=ol(ve.stretch-Y,Q,b,i.top),xt=ll(ve.fixed-Ie,xe,ve.stretch,R),wt=ol(_e.stretch-W,q,v,i.left),qt=ll(_e.fixed-re,Te,_e.stretch,P),Yi=ol(he.stretch-Y,Q,b,i.top),ni=ll(he.fixed-Ie,xe,he.stretch,R),Ot=new Ae(ke,Ze),Ht=new Ae(wt,Ze),si=new Ae(wt,Yi),pi=new Ae(ke,Yi),Mi=new Ae(Ce/p,xt/p),Ut=new Ae(qt/p,ni/p),ai=e*Math.PI/180;if(ai){const Pi=Math.sin(ai),zi=Math.cos(ai),At=[zi,-Pi,Pi,zi];Ot._matMult(At),Ht._matMult(At),pi._matMult(At),si._matMult(At)}const di=fe.stretch+fe.fixed,wi=ve.stretch+ve.fixed;return{tl:Ot,tr:Ht,bl:pi,br:si,tex:{x:u.paddedRect.x+ta+di,y:u.paddedRect.y+ta+wi,w:_e.stretch+_e.fixed-di,h:he.stretch+he.fixed-wi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Mi,pixelOffsetBR:Ut,minFontScaleX:Te/p/v,minFontScaleY:xe/p/b,isSDF:r}};if(s&&(u.stretchX||u.stretchY)){const fe=Nh(E,L,P),ve=Nh(I,G,R);for(let _e=0;_e0&&(P=Math.max(10,P),this.circleDiameter=P)}else{let E=p.top*f-g[0],I=p.bottom*f+g[2],C=p.left*f-g[3],P=p.right*f+g[1];const R=p.collisionPadding;if(R&&(C-=R[0]*f,E-=R[1]*f,P+=R[2]*f,I+=R[3]*f),b){const L=new Ae(C,E),G=new Ae(P,E),W=new Ae(C,I),q=new Ae(P,I),Y=b*Math.PI/180;L._rotate(Y),G._rotate(Y),W._rotate(Y),q._rotate(Y),C=Math.min(L.x,G.x,W.x,q.x),P=Math.max(L.x,G.x,W.x,q.x),E=Math.min(L.y,G.y,W.y,q.y),I=Math.max(L.y,G.y,W.y,q.y)}e.emplaceBack(r.x,r.y,C,E,P,I,s,l,u)}this.boxEndIndex=e.length}}class Ip{constructor(e=[],r=Ap){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:s}=this,l=r[e];for(;e>0;){const u=e-1>>1,p=r[u];if(s(l,p)>=0)break;r[e]=p,e=u}r[e]=l}_down(e){const{data:r,compare:s}=this,l=this.length>>1,u=r[e];for(;e=0)break;r[e]=f,e=p}r[e]=u}}function Ap(i,e){return ie?1:0}function Cp(i,e=1,r=!1){let s=1/0,l=1/0,u=-1/0,p=-1/0;const f=i[0];for(let C=0;Cu)&&(u=P.x),(!C||P.y>p)&&(p=P.y)}const g=Math.min(u-s,p-l);let v=g/2;const b=new Ip([],Mp);if(g===0)return new Ae(s,l);for(let C=s;CE.d||!E.d)&&(E=C,r&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,I)),C.max-E.d<=e||(v=C.h/2,b.push(new ia(C.p.x-v,C.p.y-v,v,i)),b.push(new ia(C.p.x+v,C.p.y-v,v,i)),b.push(new ia(C.p.x-v,C.p.y+v,v,i)),b.push(new ia(C.p.x+v,C.p.y+v,v,i)),I+=4)}return r&&(console.log(`num probes: ${I}`),console.log(`best distance: ${E.d}`)),E.p}function Mp(i,e){return e.max-i.max}function ia(i,e,r,s){this.p=new Ae(i,e),this.h=r,this.d=function(l,u){let p=!1,f=1/0;for(let g=0;gl.y!=P.y>l.y&&l.x<(P.x-C.x)*(l.y-C.y)/(P.y-C.y)+C.x&&(p=!p),f=Math.min(f,Ec(l,C,P))}}return(p?1:-1)*Math.sqrt(f)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}const lc=Number.POSITIVE_INFINITY;function $h(i,e){return e[1]!==lc?function(r,s,l){let u=0,p=0;switch(s=Math.abs(s),l=Math.abs(l),r){case"top-right":case"top-left":case"top":p=l-7;break;case"bottom-right":case"bottom-left":case"bottom":p=7-l}switch(r){case"top-right":case"bottom-right":case"right":u=-s;break;case"top-left":case"bottom-left":case"left":u=s}return[u,p]}(i,e[0],e[1]):function(r,s){let l=0,u=0;s<0&&(s=0);const p=s/Math.sqrt(2);switch(r){case"top-right":case"top-left":u=p-7;break;case"bottom-right":case"bottom-left":u=7-p;break;case"bottom":u=7-s;break;case"top":u=s-7}switch(r){case"top-right":case"bottom-right":l=-p;break;case"top-left":case"bottom-left":l=p;break;case"left":l=s;break;case"right":l=-s}return[l,u]}(i,e[0])}function cc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Pp(i,e,r,s,l,u,p,f,g,v,b){let E=u.textMaxSize.evaluate(e,{});E===void 0&&(E=p);const I=i.layers[0].layout,C=I.get("icon-offset").evaluate(e,{},b),P=jh(r.horizontal),R=p/24,L=i.tilePixelRatio*R,G=i.tilePixelRatio*E/24,W=i.tilePixelRatio*f,q=i.tilePixelRatio*I.get("symbol-spacing"),Y=I.get("text-padding")*i.tilePixelRatio,Q=function(he,ke,Ce,Ze=1){const xt=he.get("icon-padding").evaluate(ke,{},Ce),wt=xt&&xt.values;return[wt[0]*Ze,wt[1]*Ze,wt[2]*Ze,wt[3]*Ze]}(I,e,b,i.tilePixelRatio),re=I.get("text-max-angle")/180*Math.PI,Te=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point",Ie=I.get("icon-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",xe=I.get("symbol-placement"),ge=q/2,fe=I.get("icon-text-fit");let ve;s&&fe!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(ve=fh(s,r.vertical,fe,I.get("icon-text-fit-padding"),C,R)),P&&(s=fh(s,P,fe,I.get("icon-text-fit-padding"),C,R)));const _e=(he,ke)=>{ke.x<0||ke.x>=yt||ke.y<0||ke.y>=yt||function(Ce,Ze,xt,wt,qt,Yi,ni,Ot,Ht,si,pi,Mi,Ut,ai,di,wi,Pi,zi,At,oi,Ge,qi,li,fi,hr){const Sr=Ce.addToLineVertexArray(Ze,xt);let Ir,an,ur,Ji,ki=0,on=0,no=0,Wh=0,_c=-1,yc=-1;const ln={};let Hh=zt(""),xc=0,vc=0;if(Ot._unevaluatedLayout.getValue("text-radial-offset")===void 0?[xc,vc]=Ot.layout.get("text-offset").evaluate(Ge,{},fi).map(Di=>Di*Wt):(xc=Ot.layout.get("text-radial-offset").evaluate(Ge,{},fi)*Wt,vc=lc),Ce.allowVerticalPlacement&&wt.vertical){const Di=Ot.layout.get("text-rotate").evaluate(Ge,{},fi)+90;ur=new cl(Ht,Ze,si,pi,Mi,wt.vertical,Ut,ai,di,Di),ni&&(Ji=new cl(Ht,Ze,si,pi,Mi,ni,Pi,zi,di,Di))}if(qt){const Di=Ot.layout.get("icon-rotate").evaluate(Ge,{}),qr=Ot.layout.get("icon-text-fit")!=="none",so=Vh(qt,Di,li,qr),ao=ni?Vh(ni,Di,li,qr):void 0;an=new cl(Ht,Ze,si,pi,Mi,qt,Pi,zi,!1,Di),ki=4*so.length;const Jh=Ce.iconSizeData;let as=null;Jh.kind==="source"?(as=[$r*Ot.layout.get("icon-size").evaluate(Ge,{})],as[0]>kn&&ti(`${Ce.layerIds[0]}: Value for "icon-size" is >= ${eo}. Reduce your "icon-size".`)):Jh.kind==="composite"&&(as=[$r*qi.compositeIconSizes[0].evaluate(Ge,{},fi),$r*qi.compositeIconSizes[1].evaluate(Ge,{},fi)],(as[0]>kn||as[1]>kn)&&ti(`${Ce.layerIds[0]}: Value for "icon-size" is >= ${eo}. Reduce your "icon-size".`)),Ce.addSymbols(Ce.icon,so,as,oi,At,Ge,h.WritingMode.none,Ze,Sr.lineStartIndex,Sr.lineLength,-1,fi),_c=Ce.icon.placedSymbolArray.length-1,ao&&(on=4*ao.length,Ce.addSymbols(Ce.icon,ao,as,oi,At,Ge,h.WritingMode.vertical,Ze,Sr.lineStartIndex,Sr.lineLength,-1,fi),yc=Ce.icon.placedSymbolArray.length-1)}const Kh=Object.keys(wt.horizontal);for(const Di of Kh){const qr=wt.horizontal[Di];if(!Ir){Hh=zt(qr.text);const ao=Ot.layout.get("text-rotate").evaluate(Ge,{},fi);Ir=new cl(Ht,Ze,si,pi,Mi,qr,Ut,ai,di,ao)}const so=qr.positionedLines.length===1;if(no+=qh(Ce,Ze,qr,Yi,Ot,di,Ge,wi,Sr,wt.vertical?h.WritingMode.horizontal:h.WritingMode.horizontalOnly,so?Kh:[Di],ln,_c,qi,fi),so)break}wt.vertical&&(Wh+=qh(Ce,Ze,wt.vertical,Yi,Ot,di,Ge,wi,Sr,h.WritingMode.vertical,["vertical"],ln,yc,qi,fi));const Dp=Ir?Ir.boxStartIndex:Ce.collisionBoxArray.length,Lp=Ir?Ir.boxEndIndex:Ce.collisionBoxArray.length,Bp=ur?ur.boxStartIndex:Ce.collisionBoxArray.length,Rp=ur?ur.boxEndIndex:Ce.collisionBoxArray.length,Fp=an?an.boxStartIndex:Ce.collisionBoxArray.length,Op=an?an.boxEndIndex:Ce.collisionBoxArray.length,Up=Ji?Ji.boxStartIndex:Ce.collisionBoxArray.length,Vp=Ji?Ji.boxEndIndex:Ce.collisionBoxArray.length;let Ar=-1;const ul=(Di,qr)=>Di&&Di.circleDiameter?Math.max(Di.circleDiameter,qr):qr;Ar=ul(Ir,Ar),Ar=ul(ur,Ar),Ar=ul(an,Ar),Ar=ul(Ji,Ar);const Yh=Ar>-1?1:0;Yh&&(Ar*=hr/Wt),Ce.glyphOffsetArray.length>=ea.MAX_GLYPHS&&ti("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ge.sortKey!==void 0&&Ce.addToSortKeyRanges(Ce.symbolInstances.length,Ge.sortKey),Ce.symbolInstances.emplaceBack(Ze.x,Ze.y,ln.right>=0?ln.right:-1,ln.center>=0?ln.center:-1,ln.left>=0?ln.left:-1,ln.vertical||-1,_c,yc,Hh,Dp,Lp,Bp,Rp,Fp,Op,Up,Vp,si,no,Wh,ki,on,Yh,0,Ut,xc,vc,Ar)}(i,ke,he,r,s,l,ve,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,L,[Y,Y,Y,Y],Te,g,W,Q,Ie,C,e,u,v,b,p)};if(xe==="line")for(const he of Lh(e.geometry,0,0,yt,yt)){const ke=Sp(he,q,re,r.vertical||P,s,24,G,i.overscaling,yt);for(const Ce of ke)P&&zp(i,P.text,ge,Ce)||_e(he,Ce)}else if(xe==="line-center"){for(const he of e.geometry)if(he.length>1){const ke=Ep(he,re,r.vertical||P,s,24,G);ke&&_e(he,ke)}}else if(e.type==="Polygon")for(const he of Nl(e.geometry,0)){const ke=Cp(he,16);_e(he[0],new Ln(ke.x,ke.y,0))}else if(e.type==="LineString")for(const he of e.geometry)_e(he,new Ln(he[0].x,he[0].y,0));else if(e.type==="Point")for(const he of e.geometry)for(const ke of he)_e([ke],new Ln(ke.x,ke.y,0))}function qh(i,e,r,s,l,u,p,f,g,v,b,E,I,C,P){const R=function(W,q,Y,Q,re,Te,Ie,xe){const ge=Q.layout.get("text-rotate").evaluate(Te,{})*Math.PI/180,fe=[];for(const ve of q.positionedLines)for(const _e of ve.positionedGlyphs){if(!_e.rect)continue;const he=_e.rect||{};let ke=oh+1,Ce=!0,Ze=1,xt=0;const wt=(re||xe)&&_e.vertical,qt=_e.metrics.advance*_e.scale/2;if(xe&&q.verticalizable&&(xt=ve.lineOffset/2-(_e.imageName?-(Wt-_e.metrics.width*_e.scale)/2:(_e.scale-1)*Wt)),_e.imageName){const At=Ie[_e.imageName];Ce=At.sdf,Ze=At.pixelRatio,ke=Ci/Ze}const Yi=re?[_e.x+qt,_e.y]:[0,0];let ni=re?[0,0]:[_e.x+qt+Y[0],_e.y+Y[1]-xt],Ot=[0,0];wt&&(Ot=ni,ni=[0,0]);const Ht=(_e.metrics.left-ke)*_e.scale-qt+ni[0],si=(-_e.metrics.top-ke)*_e.scale+ni[1],pi=Ht+he.w*_e.scale/Ze,Mi=si+he.h*_e.scale/Ze,Ut=new Ae(Ht,si),ai=new Ae(pi,si),di=new Ae(Ht,Mi),wi=new Ae(pi,Mi);if(wt){const At=new Ae(-qt,qt-Ja),oi=-Math.PI/2,Ge=Wt/2-qt,qi=new Ae(5-Ja-Ge,-(_e.imageName?Ge:0)),li=new Ae(...Ot);Ut._rotateAround(oi,At)._add(qi)._add(li),ai._rotateAround(oi,At)._add(qi)._add(li),di._rotateAround(oi,At)._add(qi)._add(li),wi._rotateAround(oi,At)._add(qi)._add(li)}if(ge){const At=Math.sin(ge),oi=Math.cos(ge),Ge=[oi,-At,At,oi];Ut._matMult(Ge),ai._matMult(Ge),di._matMult(Ge),wi._matMult(Ge)}const Pi=new Ae(0,0),zi=new Ae(0,0);fe.push({tl:Ut,tr:ai,bl:di,br:wi,tex:he,writingMode:q.writingMode,glyphOffset:Yi,sectionIndex:_e.sectionIndex,isSDF:Ce,pixelOffsetTL:Pi,pixelOffsetBR:zi,minFontScaleX:0,minFontScaleY:0})}return fe}(0,r,f,l,u,p,s,i.allowVerticalPlacement),L=i.textSizeData;let G=null;L.kind==="source"?(G=[$r*l.layout.get("text-size").evaluate(p,{})],G[0]>kn&&ti(`${i.layerIds[0]}: Value for "text-size" is >= ${eo}. Reduce your "text-size".`)):L.kind==="composite"&&(G=[$r*C.compositeTextSizes[0].evaluate(p,{},P),$r*C.compositeTextSizes[1].evaluate(p,{},P)],(G[0]>kn||G[1]>kn)&&ti(`${i.layerIds[0]}: Value for "text-size" is >= ${eo}. Reduce your "text-size".`)),i.addSymbols(i.text,R,G,f,u,p,v,e,g.lineStartIndex,g.lineLength,I,P);for(const W of b)E[W]=i.text.placedSymbolArray.length-1;return 4*R.length}function jh(i){for(const e in i)return i[e];return null}function zp(i,e,r,s){const l=i.compareText;if(e in l){const u=l[e];for(let p=u.length-1;p>=0;p--)if(s.dist(u[p])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const u=Zh[15&s];if(!u)throw new Error("Unrecognized array type.");const[p]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new hc(f,p,u,e)}constructor(e,r=64,s=Float64Array,l){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const u=Zh.indexOf(this.ArrayType),p=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-f%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${s}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+p+f+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=r,s}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return uc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,s,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:f}=this,g=[0,u.length-1,0],v=[];for(;g.length;){const b=g.pop()||0,E=g.pop()||0,I=g.pop()||0;if(E-I<=f){for(let L=I;L<=E;L++){const G=p[2*L],W=p[2*L+1];G>=e&&G<=s&&W>=r&&W<=l&&v.push(u[L])}continue}const C=I+E>>1,P=p[2*C],R=p[2*C+1];P>=e&&P<=s&&R>=r&&R<=l&&v.push(u[C]),(b===0?e<=P:r<=R)&&(g.push(I),g.push(C-1),g.push(1-b)),(b===0?s>=P:l>=R)&&(g.push(C+1),g.push(E),g.push(1-b))}return v}within(e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:u,nodeSize:p}=this,f=[0,l.length-1,0],g=[],v=s*s;for(;f.length;){const b=f.pop()||0,E=f.pop()||0,I=f.pop()||0;if(E-I<=p){for(let L=I;L<=E;L++)Xh(u[2*L],u[2*L+1],e,r)<=v&&g.push(l[L]);continue}const C=I+E>>1,P=u[2*C],R=u[2*C+1];Xh(P,R,e,r)<=v&&g.push(l[C]),(b===0?e-s<=P:r-s<=R)&&(f.push(I),f.push(C-1),f.push(1-b)),(b===0?e+s>=P:r+s>=R)&&(f.push(C+1),f.push(E),f.push(1-b))}return g}}function uc(i,e,r,s,l,u){if(l-s<=r)return;const p=s+l>>1;Gh(i,e,p,s,l,u),uc(i,e,r,s,p-1,1-u),uc(i,e,r,p+1,l,1-u)}function Gh(i,e,r,s,l,u){for(;l>s;){if(l-s>600){const v=l-s+1,b=r-s+1,E=Math.log(v),I=.5*Math.exp(2*E/3),C=.5*Math.sqrt(E*I*(v-I)/v)*(b-v/2<0?-1:1);Gh(i,e,r,Math.max(s,Math.floor(r-b*I/v+C)),Math.min(l,Math.floor(r+(v-b)*I/v+C)),u)}const p=e[2*r+u];let f=s,g=l;for(io(i,e,s,r),e[2*l+u]>p&&io(i,e,s,l);fp;)g--}e[2*s+u]===p?io(i,e,s,g):(g++,io(i,e,g,l)),g<=r&&(s=g+1),r<=g&&(l=g-1)}}function io(i,e,r,s){pc(i,r,s),pc(e,2*r,2*s),pc(e,2*r+1,2*s+1)}function pc(i,e,r){const s=i[e];i[e]=i[r],i[r]=s}function Xh(i,e,r,s){const l=i-r,u=e-s;return l*l+u*u}var dc;h.PerformanceMarkers=void 0,(dc=h.PerformanceMarkers||(h.PerformanceMarkers={})).create="create",dc.load="load",dc.fullLoad="fullLoad";let hl=null,ro=[];const fc=1e3/60,mc="loadTime",gc="fullLoadTime",kp={mark(i){performance.mark(i)},frame(i){const e=i;hl!=null&&ro.push(e-hl),hl=e},clearMetrics(){hl=null,ro=[],performance.clearMeasures(mc),performance.clearMeasures(gc);for(const i in h.PerformanceMarkers)performance.clearMarks(h.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure(mc,h.PerformanceMarkers.create,h.PerformanceMarkers.load),performance.measure(gc,h.PerformanceMarkers.create,h.PerformanceMarkers.fullLoad);const i=performance.getEntriesByName(mc)[0].duration,e=performance.getEntriesByName(gc)[0].duration,r=ro.length,s=1/(ro.reduce((u,p)=>u+p,0)/r/1e3),l=ro.filter(u=>u>fc).reduce((u,p)=>u+(p-fc)/fc,0);return{loadTime:i,fullLoadTime:e,fps:s,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};h.AJAXError=kr,h.ARRAY_TYPE=Ws,h.Actor=class{constructor(i,e,r){this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},gi(["receive","process"],this),this.invoker=new wp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Bi()?i:window}send(i,e,r,s,l=!1){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[u]=r);const p=zr(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:i,hasCallback:!!r,targetMapId:s,mustQueue:l,sourceMapId:this.mapId,data:Yn(e,p)},p),{cancel:()=>{r&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:s,sourceMapId:this.mapId})}}}receive(i){const e=i.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type===""){delete this.tasks[r];const s=this.cancelCallbacks[r];delete this.cancelCallbacks[r],s&&s()}else Bi()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(!this.taskQueue.length)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){if(e.type===""){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(br(e.error)):r(null,br(e.data)))}else{let r=!1;const s=zr(this.globalScope)?void 0:[],l=e.hasCallback?(f,g)=>{r=!0,delete this.cancelCallbacks[i],this.target.postMessage({id:i,type:"",sourceMapId:this.mapId,error:f?Yn(f):null,data:Yn(g,s)},s)}:f=>{r=!0};let u=null;const p=br(e.data);if(this.parent[e.type])u=this.parent[e.type](e.sourceMapId,p,l);else if(this.parent.getWorkerSource){const f=e.type.split(".");u=this.parent.getWorkerSource(e.sourceMapId,f[0],p.source)[f[1]](p,l)}else l(new Error(`Could not find function ${e.type}`));!r&&u&&u.cancel&&(this.cancelCallbacks[i]=u.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},h.AlphaImage=ja,h.CanonicalTileID=oc,h.CollisionBoxArray=c,h.CollisionCircleLayoutArray=class extends Ns{},h.Color=Re,h.DEMData=Ch,h.DataConstantProperty=Me,h.DictionaryCoder=Mh,h.EXTENT=yt,h.ErrorEvent=Fi,h.EvaluationParameters=bt,h.Event=gr,h.Evented=fn,h.FeatureIndex=zh,h.FillBucket=jl,h.FillExtrusionBucket=Gl,h.GeoJSONFeature=Ph,h.ImageAtlas=ch,h.ImagePosition=Yl,h.KDBush=hc,h.LineBucket=Xl,h.LineStripIndexArray=class extends t{},h.LngLat=Dn,h.MercatorCoordinate=sl,h.ONE_EM=Wt,h.OverscaledTileID=Ki,h.PerformanceUtils=kp,h.Point=Ae,h.Pos3dArray=class extends Os{},h.PosArray=B,h.Properties=vi,h.Protobuf=Hl,h.QuadTriangleArray=class extends $s{},h.RGBAImage=Hi,h.RasterBoundsArray=class extends Fa{},h.RequestPerformance=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},h.SegmentVector=me,h.SymbolBucket=ea,h.Transitionable=Vo,h.TriangleIndexArray=le,h.Uniform1f=cr,h.Uniform1i=class extends ui{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},h.Uniform2f=class extends ui{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},h.Uniform3f=class extends ui{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},h.Uniform4f=is,h.UniformColor=ri,h.UniformMatrix4f=class extends ui{constructor(i,e){super(i,e),this.current=Gt}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},h.UnwrappedTileID=Ah,h.ValidationError=de,h.ZoomHistory=Lo,h.addDynamicAttributes=tc,h.arrayBufferToImage=function(i,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=fr})},r.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const s=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(s):fr},h.arrayBufferToImageBitmap=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(s=>{e(null,s)}).catch(s=>{e(new Error(`Could not load image because of ${s.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},h.asyncAll=function(i,e,r){if(!i.length)return r(null,[]);let s=i.length;const l=new Array(i.length);let u=null;i.forEach((p,f)=>{e(p,(g,v)=>{g&&(u=g),l[f]=v,--s==0&&r(u,l)})})},h.bezier=Mr,h.bindAll=gi,h.clamp=ot,h.clipLine=Lh,h.clone=function(i){var e=new Ws(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},h.clone$1=_i,h.collisionCircleLayout=Yu,h.config=Bn,h.copy=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},h.create=function(){var i=new Ws(16);return Ws!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},h.createExpression=Tt,h.createFilter=wa,h.createLayout=Ft,h.createStyleLayer=function(i){return i.type==="custom"?new vp(i):new bp[i.type](i)},h.deepEqual=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let s=0;s{s[p.source]?r.push({command:Qe.removeLayer,args:[p.id]}):u.push(p)}),r=r.concat(l),function(p,f,g){f=f||[];const v=(p=p||[]).map(mn),b=f.map(mn),E=p.reduce(Kr,{}),I=f.reduce(Kr,{}),C=v.slice(),P=Object.create(null);let R,L,G,W,q,Y,Q;for(R=0,L=0;R{}}},h.groupByLayout=function(i,e){const r={};for(let l=0;l@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,l,u)=>{const p=l||u;return e[s]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},h.parseGlyphPbf=function(i){return new Hl(i).readFields(lp,[])},h.pbf=eh,h.performSymbolLayout=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=yt/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0].layout,r=i.bucket.layers[0]._unevaluatedLayout._values,s={layoutIconSize:r["icon-size"].possiblyEvaluate(new bt(i.bucket.zoom+1),i.canonical),layoutTextSize:r["text-size"].possiblyEvaluate(new bt(i.bucket.zoom+1),i.canonical),textMaxSize:r["text-size"].possiblyEvaluate(new bt(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:g,maxZoom:v}=i.bucket.textSizeData;s.compositeTextSizes=[r["text-size"].possiblyEvaluate(new bt(g),i.canonical),r["text-size"].possiblyEvaluate(new bt(v),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:g,maxZoom:v}=i.bucket.iconSizeData;s.compositeIconSizes=[r["icon-size"].possiblyEvaluate(new bt(g),i.canonical),r["icon-size"].possiblyEvaluate(new bt(v),i.canonical)]}const l=e.get("text-line-height")*Wt,u=e.get("text-rotation-alignment")!=="viewport"&&e.get("symbol-placement")!=="point",p=e.get("text-keep-upright"),f=e.get("text-size");for(const g of i.bucket.features){const v=e.get("text-font").evaluate(g,{},i.canonical).join(","),b=f.evaluate(g,{},i.canonical),E=s.layoutTextSize.evaluate(g,{},i.canonical),I=s.layoutIconSize.evaluate(g,{},i.canonical),C={horizontal:{},vertical:void 0},P=g.text;let R,L=[0,0];if(P){const q=P.toString(),Y=e.get("text-letter-spacing").evaluate(g,{},i.canonical)*Wt,Q=Ca(q)?Y:0,re=e.get("text-anchor").evaluate(g,{},i.canonical),Te=e.get("text-variable-anchor");if(!Te){const ve=e.get("text-radial-offset").evaluate(g,{},i.canonical);L=ve?$h(re,[ve*Wt,lc]):e.get("text-offset").evaluate(g,{},i.canonical).map(_e=>_e*Wt)}let Ie=u?"center":e.get("text-justify").evaluate(g,{},i.canonical);const xe=e.get("symbol-placement"),ge=xe==="point"?e.get("text-max-width").evaluate(g,{},i.canonical)*Wt:0,fe=()=>{i.bucket.allowVerticalPlacement&&Ps(q)&&(C.vertical=tl(P,i.glyphMap,i.glyphPositions,i.imagePositions,v,ge,l,re,"left",Q,L,h.WritingMode.vertical,!0,xe,E,b))};if(!u&&Te){const ve=Ie==="auto"?Te.map(he=>cc(he)):[Ie];let _e=!1;for(let he=0;hethis._layers[ae.id]),X=N[0];if(X.visibility==="none")continue;const j=X.source||"";let $=this.familiesBySource[j];$||($=this.familiesBySource[j]={});const H=X.sourceLayer||"_geojsonTileLayer";let ne=$[H];ne||(ne=$[H]=[]),ne.push(N)}}}class te{constructor(S){const A={},z=[];for(const j in S){const $=S[j],H=A[j]={};for(const ne in $){const ae=$[+ne];if(!ae||ae.bitmap.width===0||ae.bitmap.height===0)continue;const se={x:0,y:0,w:ae.bitmap.width+2,h:ae.bitmap.height+2};z.push(se),H[ne]={rect:se,metrics:ae.metrics}}}const{w:V,h:N}=h.potpack(z),X=new h.AlphaImage({width:V||1,height:N||1});for(const j in S){const $=S[j];for(const H in $){const ne=$[+H];if(!ne||ne.bitmap.width===0||ne.bitmap.height===0)continue;const ae=A[j][H].rect;h.AlphaImage.copy(ne.bitmap,X,{x:0,y:0},{x:ae.x+1,y:ae.y+1},ne.bitmap)}}this.image=X,this.positions=A}}h.register("GlyphAtlas",te);class Kt{constructor(S){this.tileID=new h.OverscaledTileID(S.tileID.overscaledZ,S.tileID.wrap,S.tileID.canonical.z,S.tileID.canonical.x,S.tileID.canonical.y),this.uid=S.uid,this.zoom=S.zoom,this.pixelRatio=S.pixelRatio,this.tileSize=S.tileSize,this.source=S.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=S.showCollisionBoxes,this.collectResourceTiming=!!S.collectResourceTiming,this.returnDependencies=!!S.returnDependencies,this.promoteId=S.promoteId}parse(S,A,z,V,N){this.status="parsing",this.data=S,this.collisionBoxArray=new h.CollisionBoxArray;const X=new h.DictionaryCoder(Object.keys(S.layers).sort()),j=new h.FeatureIndex(this.tileID,this.promoteId);j.bucketLayerIDs=[];const $={},H={featureIndex:j,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:z},ne=A.familiesBySource[this.source];for(const je in ne){const et=S.layers[je];if(!et)continue;et.version===1&&h.warnOnce(`Vector tile source "${this.source}" layer "${je}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const dt=X.encode(je),Lt=[];for(let Re=0;Re=Et.maxzoom||Et.visibility!=="none"&&(Ae(Re,this.zoom,z),($[Et.id]=Et.createBucket({index:j.bucketLayerIDs.length,layers:Re,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:dt,sourceID:this.source})).populate(Lt,H,this.tileID.canonical),j.bucketLayerIDs.push(Re.map(Rr=>Rr.id)))}}let ae,se,De,Oe;const Se=h.mapObject(H.glyphDependencies,je=>Object.keys(je).map(Number));Object.keys(Se).length?V.send("getGlyphs",{uid:this.uid,stacks:Se,source:this.source,tileID:this.tileID,type:"glyphs"},(je,et)=>{ae||(ae=je,se=et,He.call(this))}):se={};const Pe=Object.keys(H.iconDependencies);Pe.length?V.send("getImages",{icons:Pe,source:this.source,tileID:this.tileID,type:"icons"},(je,et)=>{ae||(ae=je,De=et,He.call(this))}):De={};const Fe=Object.keys(H.patternDependencies);function He(){if(ae)return N(ae);if(se&&De&&Oe){const je=new te(se),et=new h.ImageAtlas(De,Oe);for(const dt in $){const Lt=$[dt];Lt instanceof h.SymbolBucket?(Ae(Lt.layers,this.zoom,z),h.performSymbolLayout({bucket:Lt,glyphMap:se,glyphPositions:je.positions,imageMap:De,imagePositions:et.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Lt.hasPattern&&(Lt instanceof h.LineBucket||Lt instanceof h.FillBucket||Lt instanceof h.FillExtrusionBucket)&&(Ae(Lt.layers,this.zoom,z),Lt.addFeatures(H,this.tileID.canonical,et.patternPositions))}this.status="done",N(null,{buckets:Object.values($).filter(dt=>!dt.isEmpty()),featureIndex:j,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:je.image,imageAtlas:et,glyphMap:this.returnDependencies?se:null,iconMap:this.returnDependencies?De:null,glyphPositions:this.returnDependencies?je.positions:null})}}Fe.length?V.send("getImages",{icons:Fe,source:this.source,tileID:this.tileID,type:"patterns"},(je,et)=>{ae||(ae=je,Oe=et,He.call(this))}):Oe={},He.call(this)}}function Ae(F,S,A){const z=new h.EvaluationParameters(S);for(const V of F)V.recalculate(z,A)}function Li(F,S){const A=h.getArrayBuffer(F.request,(z,V,N,X)=>{z?S(z):V&&S(null,{vectorTile:new h.vectorTile.VectorTile(new h.Protobuf(V)),rawData:V,cacheControl:N,expires:X})});return()=>{A.cancel(),S()}}class er{constructor(S,A,z,V){this.actor=S,this.layerIndex=A,this.availableImages=z,this.loadVectorData=V||Li,this.loading={},this.loaded={}}loadTile(S,A){const z=S.uid;this.loading||(this.loading={});const V=!!(S&&S.request&&S.request.collectResourceTiming)&&new h.RequestPerformance(S.request),N=this.loading[z]=new Kt(S);N.abort=this.loadVectorData(S,(X,j)=>{if(delete this.loading[z],X||!j)return N.status="done",this.loaded[z]=N,A(X);const $=j.rawData,H={};j.expires&&(H.expires=j.expires),j.cacheControl&&(H.cacheControl=j.cacheControl);const ne={};if(V){const ae=V.finish();ae&&(ne.resourceTiming=JSON.parse(JSON.stringify(ae)))}N.vectorTile=j.vectorTile,N.parse(j.vectorTile,this.layerIndex,this.availableImages,this.actor,(ae,se)=>{if(ae||!se)return A(ae);A(null,h.extend({rawTileData:$.slice(0)},se,H,ne))}),this.loaded=this.loaded||{},this.loaded[z]=N})}reloadTile(S,A){const z=this.loaded,V=S.uid,N=this;if(z&&z[V]){const X=z[V];X.showCollisionBoxes=S.showCollisionBoxes;const j=($,H)=>{const ne=X.reloadCallback;ne&&(delete X.reloadCallback,X.parse(X.vectorTile,N.layerIndex,this.availableImages,N.actor,ne)),A($,H)};X.status==="parsing"?X.reloadCallback=j:X.status==="done"&&(X.vectorTile?X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor,j):j())}}abortTile(S,A){const z=this.loading,V=S.uid;z&&z[V]&&z[V].abort&&(z[V].abort(),delete z[V]),A()}removeTile(S,A){const z=this.loaded,V=S.uid;z&&z[V]&&delete z[V],A()}}class Cr{constructor(){this.loaded={}}loadTile(S,A){const{uid:z,encoding:V,rawImageData:N}=S,X=h.isImageBitmap(N)?this.getImageData(N):N,j=new h.DEMData(z,X,V);this.loaded=this.loaded||{},this.loaded[z]=j,A(null,j)}getImageData(S){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(S.width,S.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=S.width,this.offscreenCanvas.height=S.height,this.offscreenCanvasContext.drawImage(S,0,0,S.width,S.height);const A=this.offscreenCanvasContext.getImageData(-1,-1,S.width+2,S.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new h.RGBAImage({width:A.width,height:A.height},A.data)}removeTile(S){const A=this.loaded,z=S.uid;A&&A[z]&&delete A[z]}}function Mr(F,S){if(F.length!==0){pr(F[0],S);for(var A=1;A=Math.abs(j)?A-$+j:j-$+A,A=$}A+z>=0!=!!S&&F.reverse()}var ot=h.getDefaultExportFromCjs(function F(S,A){var z,V=S&&S.type;if(V==="FeatureCollection")for(z=0;z>31}function fr(F,S){for(var A=F.loadGeometry(),z=F.type,V=0,N=0,X=A.length,j=0;jF},Bn=Math.fround||(kr=new Float32Array(1),F=>(kr[0]=+F,kr[0]));var kr;const ci=3,Ri=5,Yt=6;class pn{constructor(S){this.options=Object.assign(Object.create(un),S),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(S){const{log:A,minZoom:z,maxZoom:V}=this.options;A&&console.time("total time");const N=`prepare ${S.length} points`;A&&console.time(N),this.points=S;const X=[];for(let $=0;$=z;$--){const H=+Date.now();j=this.trees[$]=this._createTree(this._cluster(j,$)),A&&console.log("z%d: %d clusters in %dms",$,j.numItems,+Date.now()-H)}return A&&console.timeEnd("total time"),this}getClusters(S,A){let z=((S[0]+180)%360+360)%360-180;const V=Math.max(-90,Math.min(90,S[1]));let N=S[2]===180?180:((S[2]+180)%360+360)%360-180;const X=Math.max(-90,Math.min(90,S[3]));if(S[2]-S[0]>=360)z=-180,N=180;else if(z>N){const ae=this.getClusters([z,V,180,X],A),se=this.getClusters([-180,V,N,X],A);return ae.concat(se)}const j=this.trees[this._limitZoom(A)],$=j.range(Dr(z),mr(X),Dr(N),mr(V)),H=j.data,ne=[];for(const ae of $){const se=this.stride*ae;ne.push(H[se+Ri]>1?dn(H,se,this.clusterProps):this.points[H[se+ci]])}return ne}getChildren(S){const A=this._getOriginId(S),z=this._getOriginZoom(S),V="No cluster with the specified id.",N=this.trees[z];if(!N)throw new Error(V);const X=N.data;if(A*this.stride>=X.length)throw new Error(V);const j=this.options.radius/(this.options.extent*Math.pow(2,z-1)),$=N.within(X[A*this.stride],X[A*this.stride+1],j),H=[];for(const ne of $){const ae=ne*this.stride;X[ae+4]===S&&H.push(X[ae+Ri]>1?dn(X,ae,this.clusterProps):this.points[X[ae+ci]])}if(H.length===0)throw new Error(V);return H}getLeaves(S,A,z){const V=[];return this._appendLeaves(V,S,A=A||10,z=z||0,0),V}getTile(S,A,z){const V=this.trees[this._limitZoom(S)],N=Math.pow(2,S),{extent:X,radius:j}=this.options,$=j/X,H=(z-$)/N,ne=(z+1+$)/N,ae={features:[]};return this._addTileFeatures(V.range((A-$)/N,H,(A+1+$)/N,ne),V.data,A,z,N,ae),A===0&&this._addTileFeatures(V.range(1-$/N,H,1,ne),V.data,N,z,N,ae),A===N-1&&this._addTileFeatures(V.range(0,H,$/N,ne),V.data,-1,z,N,ae),ae.features.length?ae:null}getClusterExpansionZoom(S){let A=this._getOriginZoom(S)-1;for(;A<=this.options.maxZoom;){const z=this.getChildren(S);if(A++,z.length!==1)break;S=z[0].properties.cluster_id}return A}_appendLeaves(S,A,z,V,N){const X=this.getChildren(A);for(const j of X){const $=j.properties;if($&&$.cluster?N+$.point_count<=V?N+=$.point_count:N=this._appendLeaves(S,$.cluster_id,z,V,N):N1;let ne,ae,se;if(H)ne=Xr(A,$,this.clusterProps),ae=A[$],se=A[$+1];else{const Se=this.points[A[$+ci]];ne=Se.properties;const[Pe,Fe]=Se.geometry.coordinates;ae=Dr(Pe),se=mr(Fe)}const De={type:1,geometry:[[Math.round(this.options.extent*(ae*N-z)),Math.round(this.options.extent*(se*N-V))]],tags:ne};let Oe;Oe=H||this.options.generateId?A[$+ci]:this.points[A[$+ci]].id,Oe!==void 0&&(De.id=Oe),X.features.push(De)}}_limitZoom(S){return Math.max(this.options.minZoom,Math.min(Math.floor(+S),this.options.maxZoom+1))}_cluster(S,A){const{radius:z,extent:V,reduce:N,minPoints:X}=this.options,j=z/(V*Math.pow(2,A)),$=S.data,H=[],ne=this.stride;for(let ae=0;ae<$.length;ae+=ne){if($[ae+2]<=A)continue;$[ae+2]=A;const se=$[ae],De=$[ae+1],Oe=S.within($[ae],$[ae+1],j),Se=$[ae+Ri];let Pe=Se;for(const Fe of Oe){const He=Fe*ne;$[He+2]>A&&(Pe+=$[He+Ri])}if(Pe>Se&&Pe>=X){let Fe,He=se*Se,je=De*Se,et=-1;const dt=((ae/ne|0)<<5)+(A+1)+this.points.length;for(const Lt of Oe){const Re=Lt*ne;if($[Re+2]<=A)continue;$[Re+2]=A;const Et=$[Re+Ri];He+=$[Re]*Et,je+=$[Re+1]*Et,$[Re+4]=dt,N&&(Fe||(Fe=this._map($,ae,!0),et=this.clusterProps.length,this.clusterProps.push(Fe)),N(Fe,this._map($,Re)))}$[ae+4]=dt,H.push(He/Pe,je/Pe,1/0,dt,-1,Pe),N&&H.push(et)}else{for(let Fe=0;Fe1)for(const Fe of Oe){const He=Fe*ne;if(!($[He+2]<=A)){$[He+2]=A;for(let je=0;je>5}_getOriginZoom(S){return(S-this.points.length)%32}_map(S,A,z){if(S[A+Ri]>1){const X=this.clusterProps[S[A+Yt]];return z?Object.assign({},X):X}const V=this.points[S[A+ci]].properties,N=this.options.map(V);return z&&N===V?Object.assign({},N):N}}function dn(F,S,A){return{type:"Feature",id:F[S+ci],properties:Xr(F,S,A),geometry:{type:"Point",coordinates:[(z=F[S],360*(z-.5)),gr(F[S+1])]}};var z}function Xr(F,S,A){const z=F[S+Ri],V=z>=1e4?`${Math.round(z/1e3)}k`:z>=1e3?Math.round(z/100)/10+"k":z,N=F[S+Yt],X=N===-1?{}:Object.assign({},A[N]);return Object.assign(X,{cluster:!0,cluster_id:F[S+ci],point_count:z,point_count_abbreviated:V})}function Dr(F){return F/360+.5}function mr(F){const S=Math.sin(F*Math.PI/180),A=.5-.25*Math.log((1+S)/(1-S))/Math.PI;return A<0?0:A>1?1:A}function gr(F){const S=(180-360*F)*Math.PI/180;return 360*Math.atan(Math.exp(S))/Math.PI-90}function Fi(F,S,A,z){for(var V,N=z,X=A-S>>1,j=A-S,$=F[S],H=F[S+1],ne=F[A],ae=F[A+1],se=S+3;seN)V=se,N=De;else if(De===N){var Oe=Math.abs(se-X);Oez&&(V-S>3&&Fi(F,S,V,z),F[V+2]=N,A-V>3&&Fi(F,V,A,z))}function fn(F,S,A,z,V,N){var X=V-A,j=N-z;if(X!==0||j!==0){var $=((F-A)*X+(S-z)*j)/(X*X+j*j);$>1?(A=V,z=N):$>0&&(A+=X*$,z+=j*$)}return(X=F-A)*X+(j=S-z)*j}function ie(F,S,A,z){var V={id:F===void 0?null:F,type:S,geometry:A,tags:z,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(N){var X=N.geometry,j=N.type;if(j==="Point"||j==="MultiPoint"||j==="LineString")Lr(N,X);else if(j==="Polygon"||j==="MultiLineString")for(var $=0;$0&&(X+=z?(V*H-$*N)/2:Math.sqrt(Math.pow($-V,2)+Math.pow(H-N,2))),V=$,N=H}var ne=S.length-3;S[2]=1,Fi(S,0,ne,A),S[ne+2]=1,S.size=Math.abs(X),S.start=0,S.end=S.size}function Wr(F,S,A,z){for(var V=0;V1?1:A}function Dt(F,S,A,z,V,N,X,j){if(z/=S,N>=(A/=S)&&X=z)return null;for(var $=[],H=0;H=A&&Oe=z)){var Se=[];if(se==="Point"||se==="MultiPoint")Hr(ae,Se,A,z,V);else if(se==="LineString")mn(ae,Se,A,z,V,!1,j.lineMetrics);else if(se==="MultiLineString")de(ae,Se,A,z,V,!1);else if(se==="Polygon")de(ae,Se,A,z,V,!0);else if(se==="MultiPolygon")for(var Pe=0;Pe=A&&X<=z&&(S.push(F[N]),S.push(F[N+1]),S.push(F[N+2]))}}function mn(F,S,A,z,V,N,X){for(var j,$,H=Kr(F),ne=V===0?ii:gn,ae=F.start,se=0;seA&&($=ne(H,De,Oe,Pe,Fe,A),X&&(H.start=ae+j*$)):He>z?je=A&&($=ne(H,De,Oe,Pe,Fe,A),et=!0),je>z&&He<=z&&($=ne(H,De,Oe,Pe,Fe,z),et=!0),!N&&et&&(X&&(H.end=ae+j*$),S.push(H),H=Kr(F)),X&&(ae+=j)}var dt=F.length-3;De=F[dt],Oe=F[dt+1],Se=F[dt+2],(He=V===0?De:Oe)>=A&&He<=z&&tr(H,De,Oe,Se),dt=H.length-3,N&&dt>=3&&(H[dt]!==H[0]||H[dt+1]!==H[1])&&tr(H,H[0],H[1],H[2]),H.length&&S.push(H)}function Kr(F){var S=[];return S.size=F.size,S.start=F.start,S.end=F.end,S}function de(F,S,A,z,V,N){for(var X=0;XX.maxX&&(X.maxX=ne),ae>X.maxY&&(X.maxY=ae)}return X}function Vt(F,S,A,z){var V=S.geometry,N=S.type,X=[];if(N==="Point"||N==="MultiPoint")for(var j=0;j0&&S.size<(V?X:z))A.numPoints+=S.length/3;else{for(var j=[],$=0;$X)&&(A.numSimplified++,j.push(S[$]),j.push(S[$+1])),A.numPoints++;V&&function(H,ne){for(var ae=0,se=0,De=H.length,Oe=De-2;se0===ne)for(se=0,De=H.length;se24)throw new Error("maxZoom should be in the 0-24 range");if(S.promoteId&&S.generateId)throw new Error("promoteId and generateId cannot be used together.");var z=function(V,N){var X=[];if(V.type==="FeatureCollection")for(var j=0;j1&&console.time("creation"),se=this.tiles[ae]=yi(F,S,A,z,$),this.tileCoords.push({z:S,x:A,y:z}),H)){H>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",S,A,z,se.numFeatures,se.numPoints,se.numSimplified),console.timeEnd("creation"));var De="z"+S;this.stats[De]=(this.stats[De]||0)+1,this.total++}if(se.source=F,V){if(S===$.maxZoom||S===V)continue;var Oe=1<1&&console.time("clipping");var Se,Pe,Fe,He,je,et,dt=.5*$.buffer/$.extent,Lt=.5-dt,Re=.5+dt,Et=1+dt;Se=Pe=Fe=He=null,je=Dt(F,ne,A-dt,A+Re,0,se.minX,se.maxX,$),et=Dt(F,ne,A+Lt,A+Et,0,se.minX,se.maxX,$),F=null,je&&(Se=Dt(je,ne,z-dt,z+Re,1,se.minY,se.maxY,$),Pe=Dt(je,ne,z+Lt,z+Et,1,se.minY,se.maxY,$),je=null),et&&(Fe=Dt(et,ne,z-dt,z+Re,1,se.minY,se.maxY,$),He=Dt(et,ne,z+Lt,z+Et,1,se.minY,se.maxY,$),et=null),H>1&&console.timeEnd("clipping"),j.push(Se||[],S+1,2*A,2*z),j.push(Pe||[],S+1,2*A,2*z+1),j.push(Fe||[],S+1,2*A+1,2*z),j.push(He||[],S+1,2*A+1,2*z+1)}}},_r.prototype.getTile=function(F,S,A){var z=this.options,V=z.extent,N=z.debug;if(F<0||F>24)return null;var X=1<1&&console.log("drilling down to z%d-%d-%d",F,S,A);for(var $,H=F,ne=S,ae=A;!$&&H>0;)H--,ne=Math.floor(ne/2),ae=Math.floor(ae/2),$=this.tiles[yr(H,ne,ae)];return $&&$.source?(N>1&&console.log("found parent tile z%d-%d-%d",H,ne,ae),N>1&&console.time("drilling down"),this.splitTile($.source,H,ne,ae,F,S,A),N>1&&console.timeEnd("drilling down"),this.tiles[j]?qe(this.tiles[j],V):null):null};class On extends er{constructor(S,A,z,V){super(S,A,z,mt),this._dataUpdateable=new Map,this.loadGeoJSON=(N,X)=>{const{promoteId:j}=N;if(N.request)return h.getJSON(N.request,($,H,ne,ae)=>{this._dataUpdateable=xr(H,j)?Jt(H,j):void 0,X($,H,ne,ae)});if(typeof N.data=="string")try{const $=JSON.parse(N.data);this._dataUpdateable=xr($,j)?Jt($,j):void 0,X(null,$)}catch{X(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}else N.dataDiff?this._dataUpdateable?(function($,H,ne){var ae,se,De,Oe;if(H.removeAll&&$.clear(),H.remove)for(const Se of H.remove)$.delete(Se);if(H.add)for(const Se of H.add){const Pe=Zi(Se,ne);Pe!=null&&$.set(Pe,Se)}if(H.update)for(const Se of H.update){let Pe=$.get(Se.id);if(Pe==null)continue;const Fe=!Se.removeAllProperties&&(((ae=Se.removeProperties)===null||ae===void 0?void 0:ae.length)>0||((se=Se.addOrUpdateProperties)===null||se===void 0?void 0:se.length)>0);if((Se.newGeometry||Se.removeAllProperties||Fe)&&(Pe={...Pe},$.set(Se.id,Pe),Fe&&(Pe.properties={...Pe.properties})),Se.newGeometry&&(Pe.geometry=Se.newGeometry),Se.removeAllProperties)Pe.properties={};else if(((De=Se.removeProperties)===null||De===void 0?void 0:De.length)>0)for(const He of Se.removeProperties)Object.prototype.hasOwnProperty.call(Pe.properties,He)&&delete Pe.properties[He];if(((Oe=Se.addOrUpdateProperties)===null||Oe===void 0?void 0:Oe.length)>0)for(const{key:He,value:je}of Se.addOrUpdateProperties)Pe.properties[He]=je}}(this._dataUpdateable,N.dataDiff,j),X(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):X(new Error(`Cannot update existing geojson data in ${N.source}`)):X(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},V&&(this.loadGeoJSON=V)}loadData(S,A){var z;(z=this._pendingRequest)===null||z===void 0||z.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const V=!!(S&&S.request&&S.request.collectResourceTiming)&&new h.RequestPerformance(S.request);this._pendingCallback=A,this._pendingRequest=this.loadGeoJSON(S,(N,X)=>{if(delete this._pendingCallback,delete this._pendingRequest,N||!X)return A(N);if(typeof X!="object")return A(new Error(`Input data given to '${S.source}' is not a valid GeoJSON object.`));{ot(X,!0);try{if(S.filter){const $=h.createExpression(S.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if($.result==="error")throw new Error($.value.map(ne=>`${ne.key}: ${ne.message}`).join(", "));X={type:"FeatureCollection",features:X.features.filter(ne=>$.value.evaluate({zoom:0},ne))}}this._geoJSONIndex=S.cluster?new pn(function({superclusterOptions:$,clusterProperties:H}){if(!H||!$)return $;const ne={},ae={},se={accumulated:null,zoom:0},De={properties:null},Oe=Object.keys(H);for(const Se of Oe){const[Pe,Fe]=H[Se],He=h.createExpression(Fe),je=h.createExpression(typeof Pe=="string"?[Pe,["accumulated"],["get",Se]]:Pe);ne[Se]=He.value,ae[Se]=je.value}return $.map=Se=>{De.properties=Se;const Pe={};for(const Fe of Oe)Pe[Fe]=ne[Fe].evaluate(se,De);return Pe},$.reduce=(Se,Pe)=>{De.properties=Pe;for(const Fe of Oe)se.accumulated=Se[Fe],Se[Fe]=ae[Fe].evaluate(se,De)},$}(S)).load(X.features):function($,H){return new _r($,H)}(X,S.geojsonVtOptions)}catch($){return A($)}this.loaded={};const j={};if(V){const $=V.finish();$&&(j.resourceTiming={},j.resourceTiming[S.source]=JSON.parse(JSON.stringify($)))}A(null,j)}})}reloadTile(S,A){const z=this.loaded;return z&&z[S.uid]?super.reloadTile(S,A):this.loadTile(S,A)}removeSource(S,A){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),A()}getClusterExpansionZoom(S,A){try{A(null,this._geoJSONIndex.getClusterExpansionZoom(S.clusterId))}catch(z){A(z)}}getClusterChildren(S,A){try{A(null,this._geoJSONIndex.getChildren(S.clusterId))}catch(z){A(z)}}getClusterLeaves(S,A){try{A(null,this._geoJSONIndex.getLeaves(S.clusterId,S.limit,S.offset))}catch(z){A(z)}}}class ir{constructor(S){this.self=S,this.actor=new h.Actor(S,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:er,geojson:On},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(A,z)=>{if(this.workerSourceTypes[A])throw new Error(`Worker source with name "${A}" already registered.`);this.workerSourceTypes[A]=z},this.self.registerRTLTextPlugin=A=>{if(h.plugin.isParsed())throw new Error("RTL text plugin already registered.");h.plugin.applyArabicShaping=A.applyArabicShaping,h.plugin.processBidirectionalText=A.processBidirectionalText,h.plugin.processStyledBidirectionalText=A.processStyledBidirectionalText}}setReferrer(S,A){this.referrer=A}setImages(S,A,z){this.availableImages[S]=A;for(const V in this.workerSources[S]){const N=this.workerSources[S][V];for(const X in N)N[X].availableImages=A}z()}setLayers(S,A,z){this.getLayerIndex(S).replace(A),z()}updateLayers(S,A,z){this.getLayerIndex(S).update(A.layers,A.removedIds),z()}loadTile(S,A,z){this.getWorkerSource(S,A.type,A.source).loadTile(A,z)}loadDEMTile(S,A,z){this.getDEMWorkerSource(S,A.source).loadTile(A,z)}reloadTile(S,A,z){this.getWorkerSource(S,A.type,A.source).reloadTile(A,z)}abortTile(S,A,z){this.getWorkerSource(S,A.type,A.source).abortTile(A,z)}removeTile(S,A,z){this.getWorkerSource(S,A.type,A.source).removeTile(A,z)}removeDEMTile(S,A){this.getDEMWorkerSource(S,A.source).removeTile(A)}removeSource(S,A,z){if(!this.workerSources[S]||!this.workerSources[S][A.type]||!this.workerSources[S][A.type][A.source])return;const V=this.workerSources[S][A.type][A.source];delete this.workerSources[S][A.type][A.source],V.removeSource!==void 0?V.removeSource(A,z):z()}loadWorkerSource(S,A,z){try{this.self.importScripts(A.url),z()}catch(V){z(V.toString())}}syncRTLPluginState(S,A,z){try{h.plugin.setState(A);const V=h.plugin.getPluginURL();if(h.plugin.isLoaded()&&!h.plugin.isParsed()&&V!=null){this.self.importScripts(V);const N=h.plugin.isParsed();z(N?void 0:new Error(`RTL Text Plugin failed to import scripts from ${V}`),N)}}catch(V){z(V.toString())}}getAvailableImages(S){let A=this.availableImages[S];return A||(A=[]),A}getLayerIndex(S){let A=this.layerIndexes[S];return A||(A=this.layerIndexes[S]=new vt),A}getWorkerSource(S,A,z){if(this.workerSources[S]||(this.workerSources[S]={}),this.workerSources[S][A]||(this.workerSources[S][A]={}),!this.workerSources[S][A][z]){const V={send:(N,X,j)=>{this.actor.send(N,X,j,S)}};this.workerSources[S][A][z]=new this.workerSourceTypes[A](V,this.getLayerIndex(S),this.getAvailableImages(S))}return this.workerSources[S][A][z]}getDEMWorkerSource(S,A){return this.demWorkerSources[S]||(this.demWorkerSources[S]={}),this.demWorkerSources[S][A]||(this.demWorkerSources[S][A]=new Cr),this.demWorkerSources[S][A]}}return h.isWorker()&&(self.worker=new ir(self)),ir}),jt(["./shared"],function(h){var vt="3.1.0";class te{static testProp(t){if(!te.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",te.suppressClickInternal,!0)},0)}static mousePos(t,n){const a=t.getBoundingClientRect();return new h.Point(n.clientX-a.left-t.clientLeft,n.clientY-a.top-t.clientTop)}static touchPos(t,n){const a=t.getBoundingClientRect(),c=[];for(let d=0;d{t=[],n=0,a=0,c={}},o.addThrottleControl=x=>{const T=a++;return c[T]=x,T},o.removeThrottleControl=x=>{delete c[x],y()},o.getImage=(x,T,w=!0)=>{Kt.supported&&(x.headers||(x.headers={}),x.headers.accept="image/webp,*/*");const M={requestParameters:x,supportImageRefresh:w,callback:T,cancelled:!1,completed:!1,cancel:()=>{M.completed||M.cancelled||(M.cancelled=!0,M.innerRequest&&(M.innerRequest.cancel(),n--),y())}};return t.push(M),y(),M};const d=x=>{const{requestParameters:T,supportImageRefresh:w,callback:M}=x;return h.extend(T,{type:"image"}),(w!==!1||h.isWorker()||h.getProtocolAction(T.url)||T.headers&&!Object.keys(T.headers).reduce((B,k)=>B&&k==="accept",!0)?h.makeRequest:_)(T,(B,k,D,U)=>{m(x,M,B,k,D,U)})},m=(x,T,w,M,B,k)=>{w?T(w):M instanceof HTMLImageElement||M instanceof ImageBitmap?T(null,M):M&&((D,U)=>{typeof createImageBitmap=="function"?h.arrayBufferToImageBitmap(D,U):h.arrayBufferToImage(D,U)})(M,(D,U)=>{D!=null?T(D):U!=null&&T(null,U,{cacheControl:B,expires:k})}),x.cancelled||(x.completed=!0,n--,y())},y=()=>{const x=(()=>{const T=Object.keys(c);let w=!1;if(T.length>0){for(const M of T)if(w=c[M](),w)break}return w})()?h.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:h.config.MAX_PARALLEL_IMAGE_REQUESTS;for(let T=n;T0;T++){const w=t.shift();if(w.cancelled){T--;continue}const M=d(w);n++,w.innerRequest=M}},_=(x,T)=>{const w=new Image,M=x.url;let B=!1;const k=x.credentials;return k&&k==="include"?w.crossOrigin="use-credentials":(k&&k==="same-origin"||!h.sameOrigin(M))&&(w.crossOrigin="anonymous"),w.fetchPriority="high",w.onload=()=>{T(null,w),w.onerror=w.onload=null},w.onerror=()=>{B||T(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),w.onerror=w.onload=null},w.src=M,{cancel:()=>{B=!0,w.src=""}}}}(pr||(pr={})),pr.resetRequestQueue();var ot,mi=pr;(function(o){o.Glyphs="Glyphs",o.Image="Image",o.Source="Source",o.SpriteImage="SpriteImage",o.SpriteJSON="SpriteJSON",o.Style="Style",o.Tile="Tile",o.Unknown="Unknown"})(ot||(ot={}));class _t{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,a){const c=function(d){const m=d.match(ji);if(!m)throw new Error(`Unable to parse URL "${d}"`);return{protocol:m[1],authority:m[2],path:m[3]||"/",params:m[4]?m[4].split("&"):[]}}(t);return c.path+=`${n}${a}`,function(d){const m=d.params.length?`?${d.params.join("&")}`:"";return`${d.protocol}://${d.authority}${d.path}${m}`}(c)}setTransformRequest(t){this._transformRequestFn=t}}const ji=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function gi(o){var t=new h.ARRAY_TYPE(3);return t[0]=o[0],t[1]=o[1],t[2]=o[2],t}var Pr,cn=function(o,t,n){return o[0]=t[0]-n[0],o[1]=t[1]-n[1],o[2]=t[2]-n[2],o};Pr=new h.ARRAY_TYPE(3),h.ARRAY_TYPE!=Float32Array&&(Pr[0]=0,Pr[1]=0,Pr[2]=0);var _i=function(o){var t=o[0],n=o[1];return t*t+n*n};function jr(o){const t=[];if(typeof o=="string")t.push({id:"default",url:o});else if(o&&o.length>0){const n=[];for(const{id:a,url:c}of o){const d=`${a}${c}`;n.indexOf(d)===-1&&(n.push(d),t.push({id:a,url:c}))}}return t}function ti(o,t,n,a,c){if(a)return void o(a);if(c!==Object.values(t).length||c!==Object.values(n).length)return;const d={};for(const m in t){d[m]={};const y=h.exported.getImageCanvasContext(n[m]),_=t[m];for(const x in _){const{width:T,height:w,x:M,y:B,sdf:k,pixelRatio:D,stretchX:U,stretchY:Z,content:J}=_[x];d[m][x]={data:null,pixelRatio:D,sdf:k,stretchX:U,stretchY:Z,content:J,spriteData:{width:T,height:w,x:M,y:B,context:y}}}}o(null,d)}(function(){var o=new h.ARRAY_TYPE(2);h.ARRAY_TYPE!=Float32Array&&(o[0]=0,o[1]=0)})();class ct{constructor(t,n,a,c){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(n,c)}update(t,n,a){const{width:c,height:d}=t,m=!(this.size&&this.size[0]===c&&this.size[1]===d||a),{context:y}=this,{gl:_}=y;if(this.useMipmap=!!(n&&n.useMipmap),_.bindTexture(_.TEXTURE_2D,this.texture),y.pixelStoreUnpackFlipY.set(!1),y.pixelStoreUnpack.set(1),y.pixelStoreUnpackPremultiplyAlpha.set(this.format===_.RGBA&&(!n||n.premultiply!==!1)),m)this.size=[c,d],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||h.isImageBitmap(t)?_.texImage2D(_.TEXTURE_2D,0,this.format,this.format,_.UNSIGNED_BYTE,t):_.texImage2D(_.TEXTURE_2D,0,this.format,c,d,0,this.format,_.UNSIGNED_BYTE,t.data);else{const{x,y:T}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||h.isImageBitmap(t)?_.texSubImage2D(_.TEXTURE_2D,0,x,T,_.RGBA,_.UNSIGNED_BYTE,t):_.texSubImage2D(_.TEXTURE_2D,0,x,T,c,d,_.RGBA,_.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&_.generateMipmap(_.TEXTURE_2D)}bind(t,n,a){const{context:c}=this,{gl:d}=c;d.bindTexture(d.TEXTURE_2D,this.texture),a!==d.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=d.LINEAR),t!==this.filter&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,a||t),this.filter=t),n!==this.wrap&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,n),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function na(o){const{userImage:t}=o;return!!(t&&t.render&&t.render())&&(o.data.replace(new Uint8Array(t.data.buffer)),!0)}class Bi extends h.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new h.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,callback:a}of this.requestors)this._notify(n,a);this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const a=n.spriteData;n.data=new h.RGBAImage({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let a=!0;const c=n.data||n.spriteData;return this._validateStretch(n.stretchX,c&&c.width)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,c&&c.height)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),a=!1),a}_validateStretch(t,n){if(!t)return!0;let a=0;for(const c of t){if(c[0]-1);_++,d[_]=y,m[_]=x,m[_+1]=dr}for(let y=0,_=0;y{let y=this.entries[c];y||(y=this.entries[c]={glyphs:{},requests:{},ranges:{}});let _=y.glyphs[d];if(_!==void 0)return void m(null,{stack:c,id:d,glyph:_});if(_=this._tinySDF(y,c,d),_)return y.glyphs[d]=_,void m(null,{stack:c,id:d,glyph:_});const x=Math.floor(d/256);if(256*x>65535)return void m(new Error("glyphs > 65535 not supported"));if(y.ranges[x])return void m(null,{stack:c,id:d,glyph:_});if(!this.url)return void m(new Error("glyphsUrl is not set"));let T=y.requests[x];T||(T=y.requests[x]=[],fr.loadGlyphRange(c,x,this.url,this.requestManager,(w,M)=>{if(M){for(const B in M)this._doesCharSupportLocalGlyph(+B)||(y.glyphs[+B]=M[+B]);y.ranges[x]=!0}for(const B of T)B(w,M);delete y.requests[x]})),T.push((w,M)=>{w?m(w):M&&m(null,{stack:c,id:d,glyph:M[d]||null})})},(c,d)=>{if(c)n(c);else if(d){const m={};for(const{stack:y,id:_,glyph:x}of d)(m[y]||(m[y]={}))[_]=x&&{id:x.id,bitmap:x.bitmap.clone(),metrics:x.metrics};n(null,m)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(h.unicodeBlockLookup["CJK Unified Ideographs"](t)||h.unicodeBlockLookup["Hangul Syllables"](t)||h.unicodeBlockLookup.Hiragana(t)||h.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,a){const c=this.localIdeographFontFamily;if(!c||!this._doesCharSupportLocalGlyph(a))return;let d=t.tinySDF;if(!d){let y="400";/bold/i.test(n)?y="900":/medium/i.test(n)?y="500":/light/i.test(n)&&(y="200"),d=t.tinySDF=new fr.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:c,fontWeight:y})}const m=d.draw(String.fromCharCode(a));return{id:a,bitmap:new h.AlphaImage({width:m.width||30,height:m.height||30},m.data),metrics:{width:m.glyphWidth||24,height:m.glyphHeight||24,left:m.glyphLeft||0,top:m.glyphTop-27||-8,advance:m.glyphAdvance||24}}}}fr.loadGlyphRange=function(o,t,n,a,c){const d=256*t,m=d+255,y=a.transformRequest(n.replace("{fontstack}",o).replace("{range}",`${d}-${m}`),ot.Glyphs);h.getArrayBuffer(y,(_,x)=>{if(_)c(_);else if(x){const T={};for(const w of h.parseGlyphPbf(x))T[w.id]=w;c(null,T)}})},fr.TinySDF=class{constructor({fontSize:o=24,buffer:t=3,radius:n=8,cutoff:a=.25,fontFamily:c="sans-serif",fontWeight:d="normal",fontStyle:m="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=n;const y=this.size=o+4*t,_=this._createCanvas(y),x=this.ctx=_.getContext("2d",{willReadFrequently:!0});x.font=`${m} ${d} ${o}px ${c}`,x.textBaseline="alphabetic",x.textAlign="left",x.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(o){const t=document.createElement("canvas");return t.width=t.height=o,t}draw(o){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:c,actualBoundingBoxRight:d}=this.ctx.measureText(o),m=Math.ceil(n),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(d-c))),_=Math.min(this.size-this.buffer,m+Math.ceil(a)),x=y+2*this.buffer,T=_+2*this.buffer,w=Math.max(x*T,0),M=new Uint8ClampedArray(w),B={data:M,width:x,height:T,glyphWidth:y,glyphHeight:_,glyphTop:m,glyphLeft:0,glyphAdvance:t};if(y===0||_===0)return B;const{ctx:k,buffer:D,gridInner:U,gridOuter:Z}=this;k.clearRect(D,D,y,_),k.fillText(o,D,D+m);const J=k.getImageData(D,D,y,_);Z.fill(dr,0,w),U.fill(0,0,w);for(let O=0;O<_;O++)for(let K=0;K0?ce*ce:0,U[oe]=ce<0?ce*ce:0}}zr(Z,0,0,x,T,x,this.f,this.v,this.z),zr(U,D,D,y,_,x,this.f,this.v,this.z);for(let O=0;O1&&(_=t[++y]);const T=Math.abs(x-_.left),w=Math.abs(x-_.right),M=Math.min(T,w);let B;const k=d/a*(c+1);if(_.isDash){const D=c-Math.abs(k);B=Math.sqrt(M*M+D*D)}else B=c-Math.sqrt(M*M+k*k);this.data[m+x]=Math.max(0,Math.min(255,B+128))}}}addRegularDash(t){for(let y=t.length-1;y>=0;--y){const _=t[y],x=t[y+1];_.zeroLength?t.splice(y,1):x&&x.isDash===_.isDash&&(x.left=_.left,t.splice(y,1))}const n=t[0],a=t[t.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);const c=this.width*this.nextRow;let d=0,m=t[d];for(let y=0;y1&&(m=t[++d]);const _=Math.abs(y-m.left),x=Math.abs(y-m.right),T=Math.min(_,x);this.data[c+y]=Math.max(0,Math.min(255,(m.isDash?T:-T)+128))}}addDash(t,n){const a=n?7:0,c=2*a+1;if(this.nextRow+c>this.height)return h.warnOnce("LineAtlas out of space"),null;let d=0;for(let y=0;y{c.send(t,n,d)},a=a||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function Ri(o,t,n){const a=function(c,d){if(c)return n(c);if(d){const m=h.pick(h.extend(d,o),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);d.vector_layers&&(m.vectorLayers=d.vector_layers,m.vectorLayerIds=m.vectorLayers.map(y=>y.id)),n(null,m)}};return o.url?h.getJSON(t.transformRequest(o.url,ot.Source),a):h.exported.frame(()=>a(null,o))}ci.Actor=h.Actor;class Yt{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof h.LngLat?new h.LngLat(t.lng,t.lat):h.LngLat.convert(t),this}setSouthWest(t){return this._sw=t instanceof h.LngLat?new h.LngLat(t.lng,t.lat):h.LngLat.convert(t),this}extend(t){const n=this._sw,a=this._ne;let c,d;if(t instanceof h.LngLat)c=t,d=t;else{if(!(t instanceof Yt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Yt.convert(t)):this.extend(h.LngLat.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(h.LngLat.convert(t)):this;if(c=t._sw,d=t._ne,!c||!d)return this}return n||a?(n.lng=Math.min(c.lng,n.lng),n.lat=Math.min(c.lat,n.lat),a.lng=Math.max(d.lng,a.lng),a.lat=Math.max(d.lat,a.lat)):(this._sw=new h.LngLat(c.lng,c.lat),this._ne=new h.LngLat(d.lng,d.lat)),this}getCenter(){return new h.LngLat((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new h.LngLat(this.getWest(),this.getNorth())}getSouthEast(){return new h.LngLat(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:n,lat:a}=h.LngLat.convert(t);let c=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&c}static convert(t){return t instanceof Yt?t:t&&new Yt(t)}static fromLngLat(t,n=0){const a=360*n/40075017,c=a/Math.cos(Math.PI/180*t.lat);return new Yt(new h.LngLat(t.lng-c,t.lat-a),new h.LngLat(t.lng+c,t.lat+a))}}class pn{constructor(t,n,a){this.bounds=Yt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=a||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),a=Math.floor(h.mercatorXfromLng(this.bounds.getWest())*n),c=Math.floor(h.mercatorYfromLat(this.bounds.getNorth())*n),d=Math.ceil(h.mercatorXfromLng(this.bounds.getEast())*n),m=Math.ceil(h.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=a&&t.x=c&&t.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new pn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(a,ot.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(m,y){return delete t.request,t.aborted?n(null):m&&m.status!==404?n(m):(y&&y.resourceTiming&&(t.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&t.setExpiryData(y),t.loadVectorData(y,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}c.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",c,d.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",c,d.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Xr extends h.Evented{constructor(t,n,a,c){super(),this.id=t,this.dispatcher=a,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h.extend({type:"raster"},n),h.extend(this,h.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Ri(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new pn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=mi.getImage(this.map._requestManager.transformRequest(a,ot.Tile),(c,d,m)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(c)t.state="errored",n(c);else if(d){this.map._refreshExpiredTiles&&m&&t.setExpiryData(m);const y=this.map.painter.context,_=y.gl;t.texture=this.map.painter.getTileTexture(d.width),t.texture?t.texture.update(d,{useMipmap:!0}):(t.texture=new ct(y,d,_.RGBA,{useMipmap:!0}),t.texture.bind(_.LINEAR,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST),y.extTextureFilterAnisotropic&&_.texParameterf(_.TEXTURE_2D,y.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,y.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}},this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Dr extends Xr{constructor(t,n,a,c){super(t,n,a,c),this.type="raster-dem",this.maxzoom=22,this._options=h.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function c(d,m){d&&(t.state="errored",n(d)),m&&(t.dem=m,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.request=mi.getImage(this.map._requestManager.transformRequest(a,ot.Tile),function(d,m){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(d)t.state="errored",n(d);else if(m){this.map._refreshExpiredTiles&&t.setExpiryData(m),delete m.cacheControl,delete m.expires;const y=h.isImageBitmap(m)&&(un==null&&(un=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),un)?m:h.exported.getImageData(m,1),_={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:y,encoding:this.encoding};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",_,c.bind(this)))}}.bind(this),this.map._refreshExpiredTiles),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}_getNeighboringTiles(t){const n=t.canonical,a=Math.pow(2,n.z),c=(n.x-1+a)%a,d=n.x===0?t.wrap-1:t.wrap,m=(n.x+1+a)%a,y=n.x+1===a?t.wrap+1:t.wrap,_={};return _[new h.OverscaledTileID(t.overscaledZ,d,n.z,c,n.y).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,y,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(_[new h.OverscaledTileID(t.overscaledZ,d,n.z,c,n.y-1).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,y,n.z,m,n.y-1).key]={backfilled:!1}),n.y+1{if(this._pendingLoads--,this._removed||c&&c.abandoned)return void this.fire(new h.Event("dataabort",{dataType:"source"}));let d=null;if(c&&c.resourceTiming&&c.resourceTiming[this.id]&&(d=c.resourceTiming[this.id].slice(0)),a)return void this.fire(new h.ErrorEvent(a));const m={dataType:"source"};this._collectResourceTiming&&d&&d.length>0&&h.extend(m,{resourceTiming:d}),this.fire(new h.Event("data",{...m,sourceDataType:"metadata"})),this.fire(new h.Event("data",{...m,sourceDataType:"content"}))})}loaded(){return this._pendingLoads===0}loadTile(t,n){const a=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const c={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(a,c,(d,m)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):d?n(d):(t.loadVectorData(m,this.map.painter,a==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return h.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var gr=h.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Fi extends h.Evented{constructor(t,n,a,c){super(),this.id=t,this.dispatcher=a,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}load(t,n){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=mi.getImage(this.map._requestManager.transformRequest(this.url,ot.Image),(a,c)=>{this._request=null,this._loaded=!0,a?this.fire(new h.ErrorEvent(a)):c&&(this.image=c,t&&(this.coordinates=t),n&&n(),this._finishLoading())})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(h.MercatorCoordinate.fromLngLat);this.tileID=function(c){let d=1/0,m=1/0,y=-1/0,_=-1/0;for(const M of c)d=Math.min(d,M.x),m=Math.min(m,M.y),y=Math.max(y,M.x),_=Math.max(_,M.y);const x=Math.max(y-d,_-m),T=Math.max(0,Math.floor(-Math.log(x)/Math.LN2)),w=Math.pow(2,T);return new h.CanonicalTileID(T,Math.floor((d+y)/2*w),Math.floor((m+_)/2*w))}(n),this.minzoom=this.maxzoom=this.tileID.z;const a=n.map(c=>this.tileID.getTilePoint(c)._round());return this._boundsArray=new h.RasterBoundsArray,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,h.EXTENT,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,h.EXTENT),this._boundsArray.emplaceBack(a[2].x,a[2].y,h.EXTENT,h.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,gr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ct(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const c in this.tiles){const d=this.tiles[c];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture,a=!0)}a&&this.fire(new h.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class fn extends Fi{constructor(t,n,a,c){super(t,n,a,c),this.roundZoom=!0,this.type="video",this.options=n}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,ot.Source).url);h.getVideo(this.urls,(n,a)=>{this._loaded=!0,n?this.fire(new h.ErrorEvent(n)):a&&(this.video=a,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,gr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new ct(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const c in this.tiles){const d=this.tiles[c];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture,a=!0)}a&&this.fire(new h.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class ie extends Fi{constructor(t,n,a,c){super(t,n,a,c),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(m=>typeof m!="number"))||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new h.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,a=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,gr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ct(n,this.canvas,a.RGBA,{premultiply:!0});let c=!1;for(const d in this.tiles){const m=this.tiles[d];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,c=!0)}c&&this.fire(new h.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Lr={vector:dn,raster:Xr,"raster-dem":Dr,geojson:mr,video:fn,image:Fi,canvas:ie};function Rn(o,t){const n=h.create();return h.translate(n,n,[1,1,0]),h.scale(n,n,[.5*o.width,.5*o.height,1]),h.multiply(n,n,o.calculatePosMatrix(t.toUnwrapped()))}function pt(o,t,n,a,c,d){const m=function(w,M,B){if(w)for(const k of w){const D=M[k];if(D&&D.source===B&&D.type==="fill-extrusion")return!0}else for(const k in M){const D=M[k];if(D.source===B&&D.type==="fill-extrusion")return!0}return!1}(c&&c.layers,t,o.id),y=d.maxPitchScaleFactor(),_=o.tilesIn(a,y,m);_.sort(Qe);const x=[];for(const w of _)x.push({wrappedTileID:w.tileID.wrapped().key,queryResults:w.tile.queryRenderedFeatures(t,n,o._state,w.queryGeometry,w.cameraQueryGeometry,w.scale,c,d,y,Rn(o.transform,w.tileID))});const T=function(w){const M={},B={};for(const k of w){const D=k.queryResults,U=k.wrappedTileID,Z=B[U]=B[U]||{};for(const J in D){const O=D[J],K=Z[J]=Z[J]||{},ee=M[J]=M[J]||[];for(const oe of O)K[oe.featureIndex]||(K[oe.featureIndex]=!0,ee.push(oe))}}return M}(x);for(const w in T)T[w].forEach(M=>{const B=M.feature,k=o.getFeatureState(B.layer["source-layer"],B.id);B.source=B.layer.source,B.layer["source-layer"]&&(B.sourceLayer=B.layer["source-layer"]),B.state=k});return T}function Qe(o,t){const n=o.tileID,a=t.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}class Wr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=h.uniqueId(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const n=t+this.timeAdded;nd.getLayer(x)).filter(Boolean);if(_.length!==0){y.layers=_,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(x=>_.filter(T=>T.id===x)[0]));for(const x of _)m[x.id]=y}}return m}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const d=this.buckets[c];if(d instanceof h.SymbolBucket){if(this.hasSymbolBuckets=!0,!a)break;d.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const d=this.buckets[c];if(d instanceof h.SymbolBucket&&d.hasRTLText){this.hasRTLText=!0,h.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const c in this.buckets){const d=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(d))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new h.CollisionBoxArray}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const c=this.buckets[a];c.uploadPending()&&c.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ct(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ct(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,a,c,d,m,y,_,x,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:d,scale:m,tileSize:this.tileSize,pixelPosMatrix:T,transform:_,params:y,queryPadding:this.queryPadding*x},t,n,a):{}}querySourceFeatures(t,n){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const c=a.loadVTLayers(),d=n&&n.sourceLayer?n.sourceLayer:"",m=c._geojsonTileLayer||c[d];if(!m)return;const y=h.createFilter(n&&n.filter),{z:_,x,y:T}=this.tileID.canonical,w={z:_,x,y:T};for(let M=0;Ma)c=!1;else if(n)if(this.expirationTime{this.remove(t,d)},a)),this.data[c].push(d),this.order.push(c),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const a=t.wrapped().key,c=n===void 0?0:this.data[a].indexOf(n),d=this.data[a][c];return this.data[a].splice(c,1),d.timeout&&clearTimeout(d.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(d.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const a in this.data)for(const c of this.data[a])t(c.value)||n.push(c);for(const a of n)this.remove(a.value.tileID,a)}}class os{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,a){const c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},h.extend(this.stateChanges[t][c],a),this.deletedStates[t]===null){this.deletedStates[t]={};for(const d in this.state[t])d!==c&&(this.deletedStates[t][d]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(const d in this.state[t][c])a[d]||(this.deletedStates[t][c][d]=null)}else for(const d in a)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][d]===null&&delete this.deletedStates[t][c][d]}removeFeatureState(t,n,a){if(this.deletedStates[t]===null)return;const c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},a&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][a]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(a in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][a]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){const a=String(n),c=h.extend({},(this.state[t]||{})[a],(this.stateChanges[t]||{})[a]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const d=this.deletedStates[t][n];if(d===null)return{};for(const m in d)delete c[m]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const a={};for(const c in this.stateChanges){this.state[c]=this.state[c]||{};const d={};for(const m in this.stateChanges[c])this.state[c][m]||(this.state[c][m]={}),h.extend(this.state[c][m],this.stateChanges[c][m]),d[m]=this.state[c][m];a[c]=d}for(const c in this.deletedStates){this.state[c]=this.state[c]||{};const d={};if(this.deletedStates[c]===null)for(const m in this.state[c])d[m]={},this.state[c][m]={};else for(const m in this.deletedStates[c]){if(this.deletedStates[c][m]===null)this.state[c][m]={};else for(const y of Object.keys(this.deletedStates[c][m]))delete this.state[c][m][y];d[m]=this.state[c][m]}a[c]=a[c]||{},h.extend(a[c],d)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const c in t)t[c].setFeatureState(a,n)}}class Dt extends h.Evented{constructor(t,n,a){super(),this.id=t,this.dispatcher=a,this.on("data",c=>{c.dataType==="source"&&c.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&c.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(c,d,m,y){const _=new Lr[d.type](c,d,m,y);if(_.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${_.id}`);return h.bindAll(["load","abort","unload","serialize","prepare"],_),_}(t,n,a,this),this._tiles={},this._cache=new Fn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new os,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new h.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const a=this._tiles[n];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Hr).map(t=>t.key)}getRenderableIds(t){const n=[];for(const a in this._tiles)this._isIdRenderable(a,t)&&n.push(this._tiles[a]);return t?n.sort((a,c)=>{const d=a.tileID,m=c.tileID,y=new h.Point(d.canonical.x,d.canonical.y)._rotate(this.transform.angle),_=new h.Point(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return d.overscaledZ-m.overscaledZ||_.y-y.y||_.x-y.x}).map(a=>a.tileID.key):n.map(a=>a.tileID).sort(Hr).map(a=>a.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=n),this._loadTile(a,this._tileLoaded.bind(this,a,t,n)))}_tileLoaded(t,n,a,c){if(c)return t.state="errored",void(c.status!==404?this._source.fire(new h.ErrorEvent(c,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=h.exported.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new h.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let c=0;c1||(Math.abs(m)>1&&(Math.abs(m+_)===1?m+=_:Math.abs(m-_)===1&&(m-=_)),d.dem&&c.dem&&(c.dem.backfillBorder(d.dem,m,y),c.neighboringTiles&&c.neighboringTiles[x]&&(c.neighboringTiles[x].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,a,c){for(const d in this._tiles){let m=this._tiles[d];if(c[d]||!m.hasData()||m.tileID.overscaledZ<=n||m.tileID.overscaledZ>a)continue;let y=m.tileID;for(;m&&m.tileID.overscaledZ>n+1;){const x=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[x.key],m&&m.hasData()&&(y=x)}let _=y;for(;_.overscaledZ>n;)if(_=_.scaledTo(_.overscaledZ-1),t[_.key]){c[y.key]=y;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=n?a:null}for(let a=t.overscaledZ-1;a>=n;a--){const c=t.scaledTo(a),d=this._getLoadedTile(c);if(d)return d}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,a=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*a*(this._maxTileCacheZoomLevels===null?h.config.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._cache.setMaxSize(d)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const a={};for(const c in this._tiles){const d=this._tiles[c];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+n),a[d.tileID.key]=d}this._tiles=a;for(const c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(const c in this._tiles)this._setTileReloadTimer(c,this._tiles[c])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(T=>new h.OverscaledTileID(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y)):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(a=a.filter(T=>this._source.hasTile(T)))):a=[];const c=t.coveringZoomLevel(this._source),d=Math.max(c-Dt.maxOverzooming,this._source.minzoom),m=Math.max(c+Dt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const T={};for(const w of a)if(w.canonical.z>this._source.minzoom){const M=w.scaledTo(w.canonical.z-1);T[M.key]=M;const B=w.scaledTo(Math.max(this._source.minzoom,Math.min(w.canonical.z,5)));T[B.key]=B}a=a.concat(Object.values(T))}const y=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,y&&this.fire(new h.Event("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const _=this._updateRetainedTiles(a,c);if(mn(this._source.type)){const T={},w={},M=Object.keys(_),B=h.exported.now();for(const k of M){const D=_[k],U=this._tiles[k];if(!U||U.fadeEndTime!==0&&U.fadeEndTime<=B)continue;const Z=this.findLoadedParent(D,d);Z&&(this._addTile(Z.tileID),T[Z.tileID.key]=Z.tileID),w[k]=D}this._retainLoadedChildren(w,c,m,_);for(const k in T)_[k]||(this._coveredTiles[k]=!0,_[k]=T[k]);if(n){const k={},D={};for(const U of a)this._tiles[U.key].hasData()?k[U.key]=U:D[U.key]=U;for(const U in D){const Z=D[U].children(this._source.maxzoom);this._tiles[Z[0].key]&&this._tiles[Z[1].key]&&this._tiles[Z[2].key]&&this._tiles[Z[3].key]&&(k[Z[0].key]=_[Z[0].key]=Z[0],k[Z[1].key]=_[Z[1].key]=Z[1],k[Z[2].key]=_[Z[2].key]=Z[2],k[Z[3].key]=_[Z[3].key]=Z[3],delete D[U])}for(const U in D){const Z=this.findLoadedParent(D[U],this._source.minzoom);if(Z){k[Z.tileID.key]=_[Z.tileID.key]=Z.tileID;for(const J in k)k[J].isChildOf(Z.tileID)&&delete k[J]}}for(const U in this._tiles)k[U]||(this._coveredTiles[U]=!0)}}for(const T in _)this._tiles[T].clearFadeHold();const x=h.keysDifference(this._tiles,_);for(const T of x){const w=this._tiles[T];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const a={},c={},d=Math.max(n-Dt.maxOverzooming,this._source.minzoom),m=Math.max(n+Dt.maxUnderzooming,this._source.minzoom),y={};for(const _ of t){const x=this._addTile(_);a[_.key]=_,x.hasData()||nthis._source.maxzoom){const w=_.children(this._source.maxzoom)[0],M=this.getTile(w);if(M&&M.hasData()){a[w.key]=w;continue}}else{const w=_.children(this._source.maxzoom);if(a[w[0].key]&&a[w[1].key]&&a[w[2].key]&&a[w[3].key])continue}let T=x.wasRequested();for(let w=_.overscaledZ-1;w>=d;--w){const M=_.scaledTo(w);if(c[M.key])break;if(c[M.key]=!0,x=this.getTile(M),!x&&T&&(x=this._addTile(M)),x){const B=x.hasData();if((T||B)&&(a[M.key]=M),T=x.wasRequested(),B)break}}}return a}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let a,c=this._tiles[t].tileID;for(;c.overscaledZ>0;){if(c.key in this._loadedParentTiles){a=this._loadedParentTiles[c.key];break}n.push(c.key);const d=c.scaledTo(c.overscaledZ-1);if(a=this._getLoadedTile(d),a)break;c=d}for(const d of n)this._loadedParentTiles[d]=a}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const a=n;return n||(n=new Wr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,a||this._source.fire(new h.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=n.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,a){const c=[],d=this.transform;if(!d)return c;const m=a?d.getCameraQueryGeometry(t):t,y=t.map(k=>d.pointCoordinate(k,this.terrain)),_=m.map(k=>d.pointCoordinate(k,this.terrain)),x=this.getIds();let T=1/0,w=1/0,M=-1/0,B=-1/0;for(const k of _)T=Math.min(T,k.x),w=Math.min(w,k.y),M=Math.max(M,k.x),B=Math.max(B,k.y);for(let k=0;k=0&&O[1].y+J>=0){const K=y.map(oe=>U.getTilePoint(oe)),ee=_.map(oe=>U.getTilePoint(oe));c.push({tile:D,tileID:U,queryGeometry:K,cameraQueryGeometry:ee,scale:Z})}}return c}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of n)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(mn(this._source.type)){const t=h.exported.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,a){this._state.updateState(t=t||"_geojsonTileLayer",n,a)}removeFeatureState(t,n,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,a)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,a){const c=this._tiles[t];c&&c.setDependencies(n,a)}reloadTilesForDependencies(t,n){for(const a in this._tiles)this._tiles[a].hasDependency(t,n)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(t,n))}}function Hr(o,t){const n=Math.abs(2*o.wrap)-+(o.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return o.overscaledZ-t.overscaledZ||a-n||t.canonical.y-o.canonical.y||t.canonical.x-o.canonical.x}function mn(o){return o==="raster"||o==="image"||o==="video"}Dt.maxOverzooming=10,Dt.maxUnderzooming=3;const Kr="mapboxgl_preloaded_worker_pool";class de{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Kr]}numActive(){return Object.keys(this.active).length}}const tr=Math.floor(h.exported.hardwareConcurrency/2);let ii;function gn(){return ii||(ii=new de),ii}de.workerCount=h.isSafari(globalThis)?Math.max(Math.min(tr,3),1):1;class Br{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let a=1;a0?(c-m)/y:0;return this.points[d].mult(1-_).add(this.points[n].mult(_))}}function pe(o,t){let n=!0;return o==="always"||o!=="never"&&t!=="never"||(n=!1),n}class qe{constructor(t,n,a){const c=this.boxCells=[],d=this.circleCells=[];this.xCellCount=Math.ceil(t/a),this.yCellCount=Math.ceil(n/a);for(let m=0;mthis.width||c<0||n>this.height)return[];const _=[];if(t<=0&&n<=0&&this.width<=a&&this.height<=c){if(d)return[{key:null,x1:t,y1:n,x2:a,y2:c}];for(let x=0;x0}hitTestCircle(t,n,a,c,d){const m=t-a,y=t+a,_=n-a,x=n+a;if(y<0||m>this.width||x<0||_>this.height)return!1;const T=[];return this._forEachCell(m,_,y,x,this._queryCellCircle,T,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:a},seenUids:{box:{},circle:{}}},d),T.length>0}_queryCell(t,n,a,c,d,m,y,_){const{seenUids:x,hitTest:T,overlapMode:w}=y,M=this.boxCells[d];if(M!==null){const k=this.bboxes;for(const D of M)if(!x.box[D]){x.box[D]=!0;const U=4*D,Z=this.boxKeys[D];if(t<=k[U+2]&&n<=k[U+3]&&a>=k[U+0]&&c>=k[U+1]&&(!_||_(Z))&&(!T||!pe(w,Z.overlapMode))&&(m.push({key:Z,x1:k[U],y1:k[U+1],x2:k[U+2],y2:k[U+3]}),T))return!0}}const B=this.circleCells[d];if(B!==null){const k=this.circles;for(const D of B)if(!x.circle[D]){x.circle[D]=!0;const U=3*D,Z=this.circleKeys[D];if(this._circleAndRectCollide(k[U],k[U+1],k[U+2],t,n,a,c)&&(!_||_(Z))&&(!T||!pe(w,Z.overlapMode))){const J=k[U],O=k[U+1],K=k[U+2];if(m.push({key:Z,x1:J-K,y1:O-K,x2:J+K,y2:O+K}),T)return!0}}}return!1}_queryCellCircle(t,n,a,c,d,m,y,_){const{circle:x,seenUids:T,overlapMode:w}=y,M=this.boxCells[d];if(M!==null){const k=this.bboxes;for(const D of M)if(!T.box[D]){T.box[D]=!0;const U=4*D,Z=this.boxKeys[D];if(this._circleAndRectCollide(x.x,x.y,x.radius,k[U+0],k[U+1],k[U+2],k[U+3])&&(!_||_(Z))&&!pe(w,Z.overlapMode))return m.push(!0),!0}}const B=this.circleCells[d];if(B!==null){const k=this.circles;for(const D of B)if(!T.circle[D]){T.circle[D]=!0;const U=3*D,Z=this.circleKeys[D];if(this._circlesCollide(k[U],k[U+1],k[U+2],x.x,x.y,x.radius)&&(!_||_(Z))&&!pe(w,Z.overlapMode))return m.push(!0),!0}}}_forEachCell(t,n,a,c,d,m,y,_){const x=this._convertToXCellCoord(t),T=this._convertToYCellCoord(n),w=this._convertToXCellCoord(a),M=this._convertToYCellCoord(c);for(let B=x;B<=w;B++)for(let k=T;k<=M;k++)if(d.call(this,t,n,a,c,this.xCellCount*k+B,m,y,_))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,a,c,d,m){const y=c-t,_=d-n,x=a+m;return x*x>y*y+_*_}_circleAndRectCollide(t,n,a,c,d,m,y){const _=(m-c)/2,x=Math.abs(t-(c+_));if(x>_+a)return!1;const T=(y-d)/2,w=Math.abs(n-(d+T));if(w>T+a)return!1;if(x<=_||w<=T)return!0;const M=x-_,B=w-T;return M*M+B*B<=a*a}}function Ne(o,t,n,a,c){const d=h.create();return t?(h.scale(d,d,[1/c,1/c,1]),n||h.rotateZ(d,d,a.angle)):h.multiply(d,a.labelPlaneMatrix,o),d}function yi(o,t,n,a,c){if(t){const d=h.clone(o);return h.scale(d,d,[c,c,1]),n||h.rotateZ(d,d,-a.angle),d}return a.glCoordMatrix}function Vt(o,t,n){let a;n?(a=[o.x,o.y,n(o.x,o.y),1],h.transformMat4(a,a,t)):(a=[o.x,o.y,0,1],V(a,a,t));const c=a[3];return{point:new h.Point(a[0]/c,a[1]/c),signedDistanceFromCamera:c}}function Ue(o,t){return .5+o/t*.5}function _r(o,t){const n=o[0]/o[3],a=o[1]/o[3];return n>=-t[0]&&n<=t[0]&&a>=-t[1]&&a<=t[1]}function yr(o,t,n,a,c,d,m,y,_,x){const T=a?o.textSizeData:o.iconSizeData,w=h.evaluateSizeForZoom(T,n.transform.zoom),M=[256/n.width*2+1,256/n.height*2+1],B=a?o.text.dynamicLayoutVertexArray:o.icon.dynamicLayoutVertexArray;B.clear();const k=o.lineVertexArray,D=a?o.text.placedSymbolArray:o.icon.placedSymbolArray,U=n.transform.width/n.transform.height;let Z=!1;for(let J=0;JMath.abs(n.x-t.x)*a?{useVertical:!0}:(o===h.WritingMode.vertical?t.yn.x)?{needsFlipping:!0}:null}function Jt(o,t,n,a,c,d,m,y,_,x,T,w,M,B,k,D){const U=t/24,Z=o.lineOffsetX*U,J=o.lineOffsetY*U;let O;if(o.numGlyphs>1){const K=o.glyphStartIndex+o.numGlyphs,ee=o.lineStartIndex,oe=o.lineStartIndex+o.lineLength,ce=Zi(U,y,Z,J,n,T,w,o,_,d,M,k,D);if(!ce)return{notEnoughRoom:!0};const ue=Vt(ce.first.point,m,D).point,le=Vt(ce.last.point,m,D).point;if(a&&!n){const be=xr(o.writingMode,ue,le,B);if(be)return be}O=[ce.first];for(let be=o.glyphStartIndex+1;be0?ue.point:mt(w,ce,ee,1,c,D),be=xr(o.writingMode,ee,le,B);if(be)return be}const K=S(U*y.getoffsetX(o.glyphStartIndex),Z,J,n,T,w,o.segment,o.lineStartIndex,o.lineStartIndex+o.lineLength,_,d,M,k,D);if(!K)return{notEnoughRoom:!0};O=[K]}for(const K of O)h.addDynamicAttributes(x,K.point,K.angle);return{}}function mt(o,t,n,a,c,d){const m=Vt(o.add(o.sub(t)._unit()),c,d).point,y=n.sub(m);return n.add(y._mult(a/y.mag()))}function On(o,t){const{projectionCache:n,lineVertexArray:a,labelPlaneMatrix:c,tileAnchorPoint:d,distanceFromAnchor:m,getElevation:y,previousVertex:_,direction:x,absOffsetX:T}=t;if(n.projections[o])return n.projections[o];const w=new h.Point(a.getx(o),a.gety(o)),M=Vt(w,c,y);if(M.signedDistanceFromCamera>0)return n.projections[o]=M.point,M.point;const B=o-x;return mt(m===0?d:new h.Point(a.getx(B),a.gety(B)),w,_,T-m+1,c,y)}function ir(o,t,n){return o._unit()._perp()._mult(t*n)}function F(o,t,n,a,c,d,m,y){const{projectionCache:_,direction:x}=y;if(_.offsets[o])return _.offsets[o];const T=n.add(t);if(o+x=c)return _.offsets[o]=T,T;const w=On(o+x,y),M=ir(w.sub(n),m,x),B=n.add(M),k=w.add(M);return _.offsets[o]=h.findLineIntersection(d,T,B,k)||T,_.offsets[o]}function S(o,t,n,a,c,d,m,y,_,x,T,w,M,B){const k=a?o-t:o+t;let D=k>0?1:-1,U=0;a&&(D*=-1,U=Math.PI),D<0&&(U+=Math.PI);let Z,J,O=D>0?y+m:y+m+1,K=c,ee=c,oe=0,ce=0;const ue=Math.abs(k),le=[];let be;for(;oe+ce<=ue;){if(O+=D,O=_)return null;oe+=ce,ee=K,J=Z;const me={projectionCache:w,lineVertexArray:x,labelPlaneMatrix:T,tileAnchorPoint:d,distanceFromAnchor:oe,getElevation:B,previousVertex:ee,direction:D,absOffsetX:ue};if(K=On(O,me),n===0)le.push(ee),be=K.sub(ee);else{let Be;const we=K.sub(ee);Be=we.mag()===0?ir(On(O+D,me).sub(K),n,D):ir(we,n,D),J||(J=ee.add(Be)),Z=F(O,Be,K,y,_,J,n,me),le.push(J),be=Z.sub(J)}ce=be.mag()}const ze=be._mult((ue-oe)/ce)._add(J||ee),Ve=U+Math.atan2(K.y-ee.y,K.x-ee.x);return le.push(ze),{point:ze,angle:M?Ve:0,path:le}}const A=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function z(o,t){for(let n=0;n=1;rt--)we.push(me.path[rt]);for(let rt=1;rtVt($e,_,k));we=rt.some($e=>$e.signedDistanceFromCamera<=0)?[]:rt.map($e=>$e.point)}let Pt=[];if(we.length>0){const rt=we[0].clone(),$e=we[0].clone();for(let It=1;It=be.x&&$e.x<=ze.x&&rt.y>=be.y&&$e.y<=ze.y?[we]:$e.xze.x||$e.yze.y?[]:h.clipLine([we],be.x,be.y,ze.x,ze.y)}for(const rt of Pt){Ve.reset(rt,.25*le);let $e=0;$e=Ve.length<=.5*le?1:Math.ceil(Ve.paddedLength/it)+1;for(let It=0;It<$e;It++){const hi=It/Math.max($e-1,1),zt=Ve.lerp(hi),Zt=zt.x+N,Ii=zt.y+N;D.push(Zt,Ii,le,0);const Xi=Zt-le,Wi=Ii-le,ui=Zt+le,cr=Ii+le;if(ue=ue&&this.isOffscreen(Xi,Wi,ui,cr),ce=ce||this.isInsideGrid(Xi,Wi,ui,cr),t!=="always"&&this.grid.hitTestCircle(Zt,Ii,le,t,w)&&(oe=!0,!x))return{circles:[],offscreen:!1,collisionDetected:oe}}}}return{circles:!x&&oe||!ce||J=this.screenRightBoundary||cthis.screenBottomBoundary}isInsideGrid(t,n,a,c){return a>=0&&t=0&&na.collisionGroupID===n}}return this.collisionGroups[t]}}function Oe(o,t,n,a,c){const{horizontalAlign:d,verticalAlign:m}=h.getAnchorAlignment(o),y=-(d-.5)*t,_=-(m-.5)*n,x=h.evaluateVariableOffset(o,a);return new h.Point(y+x[0]*c,_+x[1]*c)}function Se(o,t,n,a,c,d){const{x1:m,x2:y,y1:_,y2:x,anchorPointX:T,anchorPointY:w}=o,M=new h.Point(t,n);return a&&M._rotate(c?d:-d),{x1:m+M.x,y1:_+M.y,x2:y+M.x,y2:x+M.y,anchorPointX:T,anchorPointY:w}}class Pe{constructor(t,n,a,c,d){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new X(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=a,this.retainedQueryData={},this.collisionGroups=new De(c),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,a,c){const d=a.getBucket(n),m=a.latestFeatureIndex;if(!d||!m||n.id!==d.layerIds[0])return;const y=a.collisionBoxArray,_=d.layers[0].layout,x=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),T=a.tileSize/h.EXTENT,w=this.transform.calculatePosMatrix(a.tileID.toUnwrapped()),M=_.get("text-pitch-alignment")==="map",B=_.get("text-rotation-alignment")==="map",k=j(a,1,this.transform.zoom),D=Ne(w,M,B,this.transform,k);let U=null;if(M){const J=yi(w,M,B,this.transform,k);U=h.multiply([],this.transform.labelPlaneMatrix,J)}this.retainedQueryData[d.bucketInstanceId]=new se(d.bucketInstanceId,m,d.sourceLayerIndex,d.index,a.tileID);const Z={bucket:d,layout:_,posMatrix:w,textLabelPlaneMatrix:D,labelToScreenMatrix:U,scale:x,textPixelRatio:T,holdingForFade:a.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:h.evaluateSizeForZoom(d.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(d.sourceID)};if(c)for(const J of d.sortKeyRanges){const{sortKey:O,symbolInstanceStart:K,symbolInstanceEnd:ee}=J;t.push({sortKey:O,symbolInstanceStart:K,symbolInstanceEnd:ee,parameters:Z})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:d.symbolInstances.length,parameters:Z})}attemptAnchorPlacement(t,n,a,c,d,m,y,_,x,T,w,M,B,k,D,U){const Z=[M.textOffset0,M.textOffset1],J=Oe(t,a,c,Z,d),O=this.collisionIndex.placeCollisionBox(Se(n,J.x,J.y,m,y,this.transform.angle),w,_,x,T.predicate,U);if((!D||this.collisionIndex.placeCollisionBox(Se(D,J.x,J.y,m,y,this.transform.angle),w,_,x,T.predicate,U).box.length!==0)&&O.box.length>0){let K;if(this.prevPlacement&&this.prevPlacement.variableOffsets[M.crossTileID]&&this.prevPlacement.placements[M.crossTileID]&&this.prevPlacement.placements[M.crossTileID].text&&(K=this.prevPlacement.variableOffsets[M.crossTileID].anchor),M.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[M.crossTileID]={textOffset:Z,width:a,height:c,anchor:t,textBoxScale:d,prevAnchor:K},this.markUsedJustification(B,t,M,k),B.allowVerticalPlacement&&(this.markUsedOrientation(B,k,M),this.placedOrientations[M.crossTileID]=k),{shift:J,placedGlyphBoxes:O}}}placeLayerBucketPart(t,n,a){const{bucket:c,layout:d,posMatrix:m,textLabelPlaneMatrix:y,labelToScreenMatrix:_,textPixelRatio:x,holdingForFade:T,collisionBoxArray:w,partiallyEvaluatedTextSize:M,collisionGroup:B}=t.parameters,k=d.get("text-optional"),D=d.get("icon-optional"),U=h.getOverlapMode(d,"text-overlap","text-allow-overlap"),Z=U==="always",J=h.getOverlapMode(d,"icon-overlap","icon-allow-overlap"),O=J==="always",K=d.get("text-rotation-alignment")==="map",ee=d.get("text-pitch-alignment")==="map",oe=d.get("icon-text-fit")!=="none",ce=d.get("symbol-z-order")==="viewport-y",ue=Z&&(O||!c.hasIconData()||D),le=O&&(Z||!c.hasTextData()||k);!c.collisionArrays&&w&&c.deserializeCollisionBoxes(w);const be=this.retainedQueryData[c.bucketInstanceId].tileID,ze=this.terrain?(me,Be)=>this.terrain.getElevation(be,me,Be):null,Ve=(me,Be)=>{if(n[me.crossTileID])return;if(T)return void(this.placements[me.crossTileID]=new ne(!1,!1,!1));let we=!1,it=!1,Pt=!0,rt=null,$e={box:null,offscreen:null},It={box:null,offscreen:null},hi=null,zt=null,Zt=null,Ii=0,Xi=0,Wi=0;Be.textFeatureIndex?Ii=Be.textFeatureIndex:me.useRuntimeCollisionCircles&&(Ii=me.featureIndex),Be.verticalTextFeatureIndex&&(Xi=Be.verticalTextFeatureIndex);const ui=Be.textBox;if(ui){const ri=nt=>{let Nt=h.WritingMode.horizontal;if(c.allowVerticalPlacement&&!nt&&this.prevPlacement){const Xt=this.prevPlacement.placedOrientations[me.crossTileID];Xt&&(this.placedOrientations[me.crossTileID]=Xt,Nt=Xt,this.markUsedOrientation(c,Nt,me))}return Nt},Gt=(nt,Nt)=>{if(c.allowVerticalPlacement&&me.numVerticalGlyphVertices>0&&Be.verticalTextBox){for(const Xt of c.writingModes)if(Xt===h.WritingMode.vertical?($e=Nt(),It=$e):$e=nt(),$e&&$e.box&&$e.box.length)break}else $e=nt()};if(d.get("text-variable-anchor")){let nt=d.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[me.crossTileID]){const at=this.prevPlacement.variableOffsets[me.crossTileID];nt.indexOf(at.anchor)>0&&(nt=nt.filter($t=>$t!==at.anchor),nt.unshift(at.anchor))}const Nt=(at,$t,Ai)=>{const Gs=at.x2-at.x1,Tr=at.y2-at.y1,Pl=me.textBoxScale,jo=oe&&J==="never"?$t:null;let yt={box:[],offscreen:!1};const Na=U!=="never"?2*nt.length:nt.length;for(let rs=0;rs=nt.length?U:"never",me,c,Ai,jo,ze);if(Er&&(yt=Er.placedGlyphBoxes,yt&&yt.box&&yt.box.length)){we=!0,rt=Er.shift;break}}return yt};Gt(()=>Nt(ui,Be.iconBox,h.WritingMode.horizontal),()=>{const at=Be.verticalTextBox;return c.allowVerticalPlacement&&!($e&&$e.box&&$e.box.length)&&me.numVerticalGlyphVertices>0&&at?Nt(at,Be.verticalIconBox,h.WritingMode.vertical):{box:null,offscreen:null}}),$e&&(we=$e.box,Pt=$e.offscreen);const Xt=ri($e&&$e.box);if(!we&&this.prevPlacement){const at=this.prevPlacement.variableOffsets[me.crossTileID];at&&(this.variableOffsets[me.crossTileID]=at,this.markUsedJustification(c,at.anchor,me,Xt))}}else{const nt=(Nt,Xt)=>{const at=this.collisionIndex.placeCollisionBox(Nt,U,x,m,B.predicate,ze);return at&&at.box&&at.box.length&&(this.markUsedOrientation(c,Xt,me),this.placedOrientations[me.crossTileID]=Xt),at};Gt(()=>nt(ui,h.WritingMode.horizontal),()=>{const Nt=Be.verticalTextBox;return c.allowVerticalPlacement&&me.numVerticalGlyphVertices>0&&Nt?nt(Nt,h.WritingMode.vertical):{box:null,offscreen:null}}),ri($e&&$e.box&&$e.box.length)}}if(hi=$e,we=hi&&hi.box&&hi.box.length>0,Pt=hi&&hi.offscreen,me.useRuntimeCollisionCircles){const ri=c.text.placedSymbolArray.get(me.centerJustifiedTextSymbolIndex),Gt=h.evaluateSizeForFeature(c.textSizeData,M,ri),nt=d.get("text-padding");zt=this.collisionIndex.placeCollisionCircles(U,ri,c.lineVertexArray,c.glyphOffsetArray,Gt,m,y,_,a,ee,B.predicate,me.collisionCircleDiameter,nt,ze),zt.circles.length&&zt.collisionDetected&&!a&&h.warnOnce("Collisions detected, but collision boxes are not shown"),we=Z||zt.circles.length>0&&!zt.collisionDetected,Pt=Pt&&zt.offscreen}if(Be.iconFeatureIndex&&(Wi=Be.iconFeatureIndex),Be.iconBox){const ri=Gt=>{const nt=oe&&rt?Se(Gt,rt.x,rt.y,K,ee,this.transform.angle):Gt;return this.collisionIndex.placeCollisionBox(nt,J,x,m,B.predicate,ze)};It&&It.box&&It.box.length&&Be.verticalIconBox?(Zt=ri(Be.verticalIconBox),it=Zt.box.length>0):(Zt=ri(Be.iconBox),it=Zt.box.length>0),Pt=Pt&&Zt.offscreen}const cr=k||me.numHorizontalGlyphVertices===0&&me.numVerticalGlyphVertices===0,is=D||me.numIconVertices===0;if(cr||is?is?cr||(it=it&&we):we=it&&we:it=we=it&&we,we&&hi&&hi.box&&this.collisionIndex.insertCollisionBox(hi.box,U,d.get("text-ignore-placement"),c.bucketInstanceId,It&&It.box&&Xi?Xi:Ii,B.ID),it&&Zt&&this.collisionIndex.insertCollisionBox(Zt.box,J,d.get("icon-ignore-placement"),c.bucketInstanceId,Wi,B.ID),zt&&(we&&this.collisionIndex.insertCollisionCircles(zt.circles,U,d.get("text-ignore-placement"),c.bucketInstanceId,Ii,B.ID),a)){const ri=c.bucketInstanceId;let Gt=this.collisionCircleArrays[ri];Gt===void 0&&(Gt=this.collisionCircleArrays[ri]=new ae);for(let nt=0;nt=0;--Be){const we=me[Be];Ve(c.symbolInstances.get(we),c.collisionArrays[we])}}else for(let me=t.symbolInstanceStart;me=0&&(t.text.placedSymbolArray.get(y).crossTileID=d>=0&&y!==d?0:a.crossTileID)}markUsedOrientation(t,n,a){const c=n===h.WritingMode.horizontal||n===h.WritingMode.horizontalOnly?n:0,d=n===h.WritingMode.vertical?n:0,m=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const y of m)t.text.placedSymbolArray.get(y).placedOrientation=c;a.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=d)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let a=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const c=n?n.symbolFadeChange(t):1,d=n?n.opacities:{},m=n?n.variableOffsets:{},y=n?n.placedOrientations:{};for(const _ in this.placements){const x=this.placements[_],T=d[_];T?(this.opacities[_]=new H(T,c,x.text,x.icon),a=a||x.text!==T.text.placed||x.icon!==T.icon.placed):(this.opacities[_]=new H(null,c,x.text,x.icon,x.skipFade),a=a||x.text||x.icon)}for(const _ in d){const x=d[_];if(!this.opacities[_]){const T=new H(x,c,!1,!1);T.isHidden()||(this.opacities[_]=T,a=a||x.text.placed||x.icon.placed)}}for(const _ in m)this.variableOffsets[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.variableOffsets[_]=m[_]);for(const _ in y)this.placedOrientations[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.placedOrientations[_]=y[_]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const a={};for(const c of n){const d=c.getBucket(t);d&&c.latestFeatureIndex&&t.id===d.layerIds[0]&&this.updateBucketOpacities(d,a,c.collisionBoxArray)}}updateBucketOpacities(t,n,a){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,d=new H(null,0,!1,!1,!0),m=c.get("text-allow-overlap"),y=c.get("icon-allow-overlap"),_=c.get("text-variable-anchor"),x=c.get("text-rotation-alignment")==="map",T=c.get("text-pitch-alignment")==="map",w=c.get("icon-text-fit")!=="none",M=new H(null,0,m&&(y||!t.hasIconData()||c.get("icon-optional")),y&&(m||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&a&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(a);const B=(k,D,U)=>{for(let Z=0;Z0,ee=this.placedOrientations[D.crossTileID],oe=ee===h.WritingMode.vertical,ce=ee===h.WritingMode.horizontal||ee===h.WritingMode.horizontalOnly;if(U>0||Z>0){const ue=Rr(O.text);B(t.text,U,oe?Qt:ue),B(t.text,Z,ce?Qt:ue);const le=O.text.isHidden();[D.rightJustifiedTextSymbolIndex,D.centerJustifiedTextSymbolIndex,D.leftJustifiedTextSymbolIndex].forEach(Ve=>{Ve>=0&&(t.text.placedSymbolArray.get(Ve).hidden=le||oe?1:0)}),D.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(D.verticalPlacedTextSymbolIndex).hidden=le||ce?1:0);const be=this.variableOffsets[D.crossTileID];be&&this.markUsedJustification(t,be.anchor,D,ee);const ze=this.placedOrientations[D.crossTileID];ze&&(this.markUsedJustification(t,"left",D,ze),this.markUsedOrientation(t,ze,D))}if(K){const ue=Rr(O.icon),le=!(w&&D.verticalPlacedIconSymbolIndex&&oe);D.placedIconSymbolIndex>=0&&(B(t.icon,D.numIconVertices,le?ue:Qt),t.icon.placedSymbolArray.get(D.placedIconSymbolIndex).hidden=O.icon.isHidden()),D.verticalPlacedIconSymbolIndex>=0&&(B(t.icon,D.numVerticalIconVertices,le?Qt:ue),t.icon.placedSymbolArray.get(D.verticalPlacedIconSymbolIndex).hidden=O.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ue=t.collisionArrays[k];if(ue){let le=new h.Point(0,0);if(ue.textBox||ue.verticalTextBox){let ze=!0;if(_){const Ve=this.variableOffsets[J];Ve?(le=Oe(Ve.anchor,Ve.width,Ve.height,Ve.textOffset,Ve.textBoxScale),x&&le._rotate(T?this.transform.angle:-this.transform.angle)):ze=!1}ue.textBox&&Fe(t.textCollisionBox.collisionVertexArray,O.text.placed,!ze||oe,le.x,le.y),ue.verticalTextBox&&Fe(t.textCollisionBox.collisionVertexArray,O.text.placed,!ze||ce,le.x,le.y)}const be=!!(!ce&&ue.verticalIconBox);ue.iconBox&&Fe(t.iconCollisionBox.collisionVertexArray,O.icon.placed,be,w?le.x:0,w?le.y:0),ue.verticalIconBox&&Fe(t.iconCollisionBox.collisionVertexArray,O.icon.placed,!be,w?le.x:0,w?le.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const k=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=k.invProjMatrix,t.placementViewportMatrix=k.viewportMatrix,t.collisionCircleArray=k.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function Fe(o,t,n,a,c){o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0)}const He=Math.pow(2,25),je=Math.pow(2,24),et=Math.pow(2,17),dt=Math.pow(2,16),Lt=Math.pow(2,9),Re=Math.pow(2,8),Et=Math.pow(2,1);function Rr(o){if(o.opacity===0&&!o.placed)return 0;if(o.opacity===1&&o.placed)return 4294967295;const t=o.placed?1:0,n=Math.floor(127*o.opacity);return n*He+t*je+n*et+t*dt+n*Lt+t*Re+n*Et+t}const Qt=0;class Ti{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,a,c,d){const m=this._bucketParts;for(;this._currentTileIndexy.sortKey-_.sortKey));this._currentPartIndex!this._forceFullPlacement&&h.exported.now()-c>2;for(;this._currentPlacementIndex>=0;){const m=n[t[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=y)&&(!m.maxzoom||m.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Ti(m)),this._inProgressLayer.continuePlacement(a[m.source],this.placement,this._showCollisionBoxes,m,d))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const _n=512/h.EXTENT/2;class ls{constructor(t,n,a){this.tileID=t,this.bucketInstanceId=a,this._symbolsByKey={};const c=new Map;for(let d=0;d({x:Math.floor(_.anchorX*_n),y:Math.floor(_.anchorY*_n)})),crossTileIDs:m.map(_=>_.crossTileID)};if(y.positions.length>128){const _=new h.KDBush(y.positions.length,16,Uint16Array);for(const{x,y:T}of y.positions)_.add(x,T);_.finish(),delete y.positions,y.index=_}this._symbolsByKey[d]=y}}getScaledCoordinates(t,n){const{x:a,y:c,z:d}=this.tileID.canonical,{x:m,y,z:_}=n.canonical,x=_n/Math.pow(2,_-d),T=(y*h.EXTENT+t.anchorY)*x,w=c*h.EXTENT*_n;return{x:Math.floor((m*h.EXTENT+t.anchorX)*x-a*h.EXTENT*_n),y:Math.floor(T-w)}}findMatches(t,n,a){const c=this.tileID.canonical.zt)}}class Bt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Un{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const a in this.indexes){const c=this.indexes[a],d={};for(const m in c){const y=c[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+n),d[y.tileID.key]=y}this.indexes[a]=d}this.lng=t}addBucket(t,n,a){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let d=0;dt.overscaledZ)for(const y in m){const _=m[y];_.tileID.isChildOf(t)&&_.findMatches(n.symbolInstances,t,c)}else{const y=m[t.scaledTo(Number(d)).key];y&&y.findMatches(n.symbolInstances,t,c)}}for(let d=0;d{n[a]=!0});for(const a in this.layerIndexes)n[a]||delete this.layerIndexes[a]}}const Ct=(o,t)=>h.emitValidationErrors(o,t&&t.filter(n=>n.identifier!=="source.canvas")),cs=h.pick(h.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Gi=h.pick(h.operations,["setCenter","setZoom","setBearing","setPitch"]),oo=h.emptyStyle();class ei extends h.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new ci(gn(),this,t._getMapId()),this.imageManager=new Bi,this.imageManager.setEventedParent(this),this.glyphManager=new fr(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new kr(256,512),this.crossTileSymbolIndex=new Fr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new h.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",h.getReferrer());const a=this;this._rtlTextPluginCallback=ei.registerForPluginStateChange(c=>{a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:c.pluginStatus,pluginURL:c.pluginURL},(d,m)=>{if(h.triggerPluginCompletionEvent(d),m&&m.every(y=>y))for(const y in a.sourceCaches){const _=a.sourceCaches[y].getSource().type;_!=="vector"&&_!=="geojson"||a.sourceCaches[y].reload()}})}),this.on("data",c=>{if(c.dataType!=="source"||c.sourceDataType!=="metadata")return;const d=this.sourceCaches[c.sourceId];if(!d)return;const m=d.getSource();if(m&&m.vectorLayerIds)for(const y in this._layers){const _=this._layers[y];_.source===m.id&&this._validateLayer(_)}})}loadURL(t,n={},a){this.fire(new h.Event("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const c=this.map._requestManager.transformRequest(t,ot.Style);this._request=h.getJSON(c,(d,m)=>{this._request=null,d?this.fire(new h.ErrorEvent(d)):m&&this._load(m,n,a)})}loadJSON(t,n={},a){this.fire(new h.Event("dataloading",{dataType:"style"})),this._request=h.exported.frame(()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,a)})}loadEmpty(){this.fire(new h.Event("dataloading",{dataType:"style"})),this._load(oo,{validate:!1})}_load(t,n,a){const c=n.transformStyle?n.transformStyle(a,t):t;if(!n.validate||!Ct(this,h.validateStyle(c))){this._loaded=!0,this.stylesheet=c;for(const d in c.sources)this.addSource(d,c.sources[d],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs),this._createLayers(),this.light=new Bn(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new h.Event("data",{dataType:"style"})),this.fire(new h.Event("style.load"))}}_createLayers(){const t=h.derefLayers(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const a=h.createStyleLayer(n);a.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=a}}_loadSprite(t,n=!1,a=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(c,d,m,y){const _=jr(c),x=_.length,T=m>1?"@2x":"",w={},M={},B={};for(const{id:k,url:D}of _){const U=d.transformRequest(d.normalizeSpriteURL(D,T,".json"),ot.SpriteJSON),Z=`${k}_${U.url}`;w[Z]=h.getJSON(U,(K,ee)=>{delete w[Z],M[k]=ee,ti(y,M,B,K,x)});const J=d.transformRequest(d.normalizeSpriteURL(D,T,".png"),ot.SpriteImage),O=`${k}_${J.url}`;w[O]=mi.getImage(J,(K,ee)=>{delete w[O],B[k]=ee,ti(y,M,B,K,x)})}return{cancel(){for(const k of Object.values(w))k.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(c,d)=>{if(this._spriteRequest=null,c)this.fire(new h.ErrorEvent(c));else if(d)for(const m in d){this._spritesImagesIds[m]=[];const y=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(_=>!(_ in d)):[];for(const _ of y)this.imageManager.removeImage(_),this._changedImages[_]=!0;for(const _ in d[m]){const x=m==="default"?_:`${m}:${_}`;this._spritesImagesIds[m].push(x),x in this.imageManager.images?this.imageManager.updateImage(x,d[m][_],!1):this.imageManager.addImage(x,d[m][_]),n&&(this._changedImages[x]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"})),a&&a(c)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const a=t.sourceLayer;if(!a)return;const c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(a)===-1)&&this.fire(new h.ErrorEvent(new Error(`Source layer "${a}" does not exist on source "${c.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const a=[];for(const c of t)n[c]&&a.push(n[c]);return a}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const a of n){const c=this._layers[a];c.type!=="custom"&&(t[a]=c.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const c=Object.keys(this._updatedLayers),d=Object.keys(this._removedLayers);(c.length||d.length)&&this._updateWorkerLayers(c,d);for(const m in this._updatedSources){const y=this._updatedSources[m];if(y==="reload")this._reloadSource(m);else{if(y!=="clear")throw new Error(`Invalid action ${y}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const a={};for(const c in this.sourceCaches){const d=this.sourceCaches[c];a[c]=d.used,d.used=!1}for(const c of this._order){const d=this._layers[c];d.recalculate(t,this._availableImages),!d.isHidden(t.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(const c in a){const d=this.sourceCaches[c];a[c]!==d.used&&d.fire(new h.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new h.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const a=this.serialize();if(t=n.transformStyle?n.transformStyle(a,t):t,Ct(this,h.validateStyle(t)))return!1;(t=h.clone$1(t)).layers=h.derefLayers(t.layers);const c=h.diffStyles(a,t).filter(m=>!(m.command in Gi));if(c.length===0)return!1;const d=c.filter(m=>!(m.command in cs));if(d.length>0)throw new Error(`Unimplemented: ${d.map(m=>m.command).join(", ")}.`);for(const m of c)m.command!=="setTransition"&&this[m.command].apply(this,m.args);return this.stylesheet=t,!0}addImage(t,n){if(this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,a={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(h.validateStyle.source,`sources.${t}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const c=this.sourceCaches[t]=new Dt(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,()=>({isSourceLoaded:c.loaded(),source:c.serialize(),sourceId:t})),c.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===t)return this.fire(new h.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${a}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new h.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const a=this.sourceCaches[t].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,a={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new h.ErrorEvent(new Error(`Layer "${c}" already exists on this map.`)));let d;if(t.type==="custom"){if(Ct(this,h.validateCustomStyleLayer(t)))return;d=h.createStyleLayer(t)}else{if(typeof t.source=="object"&&(this.addSource(c,t.source),t=h.clone$1(t),t=h.extend(t,{source:c})),this._validate(h.validateStyle.layer,`layers.${c}`,t,{arrayIndex:-1},a))return;d=h.createStyleLayer(t),this._validateLayer(d),d.setEventedParent(this,{layer:{id:c}})}const m=n?this._order.indexOf(n):this._order.length;if(n&&m===-1)this.fire(new h.ErrorEvent(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(m,0,c),this._layerOrderChanged=!0,this._layers[c]=d,this._removedLayers[c]&&d.source&&d.type!=="custom"){const y=this._removedLayers[c];delete this._removedLayers[c],y.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new h.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const a=this._order.indexOf(t);this._order.splice(a,1);const c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new h.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new h.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const a=this._order.indexOf(t);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,a){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===a||(n!=null&&(c.minzoom=n),a!=null&&(c.maxzoom=a),this._updateLayer(c)):this.fire(new h.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,a={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!h.deepEqual(c.filter,n))return n==null?(c.filter=void 0,void this._updateLayer(c)):void(this._validate(h.validateStyle.filter,`layers.${c.id}.filter`,n,null,a)||(c.filter=h.clone$1(n),this._updateLayer(c)))}else this.fire(new h.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return h.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,a,c={}){this._checkLoaded();const d=this.getLayer(t);d?h.deepEqual(d.getLayoutProperty(n),a)||(d.setLayoutProperty(n,a,c),this._updateLayer(d)):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const a=this.getLayer(t);if(a)return a.getLayoutProperty(n);this.fire(new h.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,a,c={}){this._checkLoaded();const d=this.getLayer(t);d?h.deepEqual(d.getPaintProperty(n),a)||(d.setPaintProperty(n,a,c)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const a=t.source,c=t.sourceLayer,d=this.sourceCaches[a];if(d===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${a}' does not exist in the map's style.`)));const m=d.getSource().type;m==="geojson"&&c?this.fire(new h.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||c?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(c,t.id,n)):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const a=t.source,c=this.sourceCaches[a];if(c===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${a}' does not exist in the map's style.`)));const d=c.getSource().type,m=d==="vector"?t.sourceLayer:void 0;d!=="vector"||m?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new h.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(m,t.id,n):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,a=t.sourceLayer,c=this.sourceCaches[n];if(c!==void 0)return c.getSource().type!=="vector"||a?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),c.getFeatureState(a,t.id)):void this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new h.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return h.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const t=h.mapObject(this.sourceCaches,c=>c.serialize()),n=this._serializeByIds(this._order),a=this.stylesheet;return h.filterObject({version:a.version,name:a.name,metadata:a.metadata,light:a.light,center:a.center,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,sprite:a.sprite,glyphs:a.glyphs,transition:a.transition,sources:t,layers:n},c=>c!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=m=>this._layers[m].type==="fill-extrusion",a={},c=[];for(let m=this._order.length-1;m>=0;m--){const y=this._order[m];if(n(y)){a[y]=m;for(const _ of t){const x=_[y];if(x)for(const T of x)c.push(T)}}}c.sort((m,y)=>y.intersectionZ-m.intersectionZ);const d=[];for(let m=this._order.length-1;m>=0;m--){const y=this._order[m];if(n(y))for(let _=c.length-1;_>=0;_--){const x=c[_].feature;if(a[x.layer.id]{const ue=Z.featureSortOrder;if(ue){const le=ue.indexOf(oe.featureIndex);return ue.indexOf(ce.featureIndex)-le}return ce.featureIndex-oe.featureIndex});for(const oe of ee)K.push(oe)}}for(const Z in k)k[Z].forEach(J=>{const O=J.feature,K=x[y[Z].source].getFeatureState(O.layer["source-layer"],O.id);O.source=O.layer.source,O.layer["source-layer"]&&(O.sourceLayer=O.layer["source-layer"]),O.state=K});return k}(this._layers,m,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(d)}querySourceFeatures(t,n){n&&n.filter&&this._validate(h.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);const a=this.sourceCaches[t];return a?function(c,d){const m=c.getRenderableIds().map(x=>c.getTileByID(x)),y=[],_={};for(let x=0;xM.getTileByID(B)).sort((B,k)=>k.tileID.overscaledZ-B.tileID.overscaledZ||(B.tileID.isLessThan(k.tileID)?-1:1))}const w=this.crossTileSymbolIndex.addLayer(T,_[T.source],t.center.lng);m=m||w}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(h.exported.now(),t.zoom))&&(this.pauseablePlacement=new Oi(t,this.map.terrain,this._order,d,n,a,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,_),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(h.exported.now()),y=!0),m&&this.pauseablePlacement.placement.setStale()),y||m)for(const x of this._order){const T=this._layers[x];T.type==="symbol"&&this.placement.updateLayerOpacities(T,_[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(h.exported.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,a){this.imageManager.getImages(n.icons,a),this._updateTilesForChangedImages();const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,a){this.glyphManager.getGlyphs(n.stacks,a);const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,a){return h.makeRequest(n,a)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(h.validateStyle.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,a={},c){this._checkLoaded();const d=[{id:t,url:n}],m=[...jr(this.stylesheet.sprite),...d];this._validate(h.validateStyle.sprite,"sprite",m,null,a)||(this.stylesheet.sprite=m,this._loadSprite(d,!0,c))}removeSprite(t){this._checkLoaded();const n=jr(this.stylesheet.sprite);if(n.find(a=>a.id===t)){if(this._spritesImagesIds[t])for(const a of this._spritesImagesIds[t])this.imageManager.removeImage(a),this._changedImages[a]=!0;n.splice(n.findIndex(a=>a.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}else this.fire(new h.ErrorEvent(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return jr(this.stylesheet.sprite)}setSprite(t,n={},a){this._checkLoaded(),t&&this._validate(h.validateStyle.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,a):(this._unloadSprite(),a&&a(null)))}}ei.getSourceType=function(o){return Lr[o]},ei.setSourceType=function(o,t){Lr[o]=t},ei.registerForPluginStateChange=h.registerForPluginStateChange;var sa=h.createLayout([{name:"a_pos",type:"Int16",components:2}]),hs="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Or={prelude:st(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:st(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:st(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:st(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:st("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:st(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:st(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:st("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:st("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:st("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:st(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:st(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:st(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:st(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:st(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:st(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 +? a_pos +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:st(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:st(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +#define PI 3.141592653589793 +void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:st(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:st(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),linePattern:st(`#ifdef GL_ES +precision highp float; +#endif +uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:st(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:st(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:st(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:st(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:st(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:st("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",hs),terrainDepth:st("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",hs),terrainCoords:st("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",hs)};function st(o,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=t.match(/attribute ([\w]+) ([\w]+)/g),c=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=d?d.concat(c):c,y={};return{fragmentSource:o=o.replace(n,(_,x,T,w,M)=>(y[M]=!0,x==="define"?` +#ifndef HAS_UNIFORM_u_${M} +varying ${T} ${w} ${M}; +#else +uniform ${T} ${w} u_${M}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${M} + ${T} ${w} ${M} = u_${M}; +#endif +`)),vertexSource:t=t.replace(n,(_,x,T,w,M)=>{const B=w==="float"?"vec2":"vec4",k=M.match(/color/)?"color":B;return y[M]?x==="define"?` +#ifndef HAS_UNIFORM_u_${M} +uniform lowp float u_${M}_t; +attribute ${T} ${B} a_${M}; +varying ${T} ${w} ${M}; +#else +uniform ${T} ${w} u_${M}; +#endif +`:k==="vec4"?` +#ifndef HAS_UNIFORM_u_${M} + ${M} = a_${M}; +#else + ${T} ${w} ${M} = u_${M}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${M} + ${M} = unpack_mix_${k}(a_${M}, u_${M}_t); +#else + ${T} ${w} ${M} = u_${M}; +#endif +`:x==="define"?` +#ifndef HAS_UNIFORM_u_${M} +uniform lowp float u_${M}_t; +attribute ${T} ${B} a_${M}; +#else +uniform ${T} ${w} u_${M}; +#endif +`:k==="vec4"?` +#ifndef HAS_UNIFORM_u_${M} + ${T} ${w} ${M} = a_${M}; +#else + ${T} ${w} ${M} = u_${M}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${M} + ${T} ${w} ${M} = unpack_mix_${k}(a_${M}, u_${M}_t); +#else + ${T} ${w} ${M} = u_${M}; +#endif +`}),staticAttributes:a,staticUniforms:m}}class Ur{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,a,c,d,m,y,_,x){this.context=t;let T=this.boundPaintVertexBuffers.length!==c.length;for(let w=0;!T&&w({u_depth:new h.Uniform1i(ce,ue.u_depth),u_terrain:new h.Uniform1i(ce,ue.u_terrain),u_terrain_dim:new h.Uniform1f(ce,ue.u_terrain_dim),u_terrain_matrix:new h.UniformMatrix4f(ce,ue.u_terrain_matrix),u_terrain_unpack:new h.Uniform4f(ce,ue.u_terrain_unpack),u_terrain_exaggeration:new h.Uniform1f(ce,ue.u_terrain_exaggeration)}))(t,oe),this.binderUniforms=c?c.getUniforms(t,oe):[]}draw(t,n,a,c,d,m,y,_,x,T,w,M,B,k,D,U,Z,J){const O=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(a),t.setStencilMode(c),t.setColorMode(d),t.setCullFace(m),_){t.activeTexture.set(O.TEXTURE2),O.bindTexture(O.TEXTURE_2D,_.depthTexture),t.activeTexture.set(O.TEXTURE3),O.bindTexture(O.TEXTURE_2D,_.texture);for(const ee in this.terrainUniforms)this.terrainUniforms[ee].set(_[ee])}for(const ee in this.fixedUniforms)this.fixedUniforms[ee].set(y[ee]);D&&D.setUniforms(t,this.binderUniforms,B,{zoom:k});let K=0;switch(n){case O.LINES:K=2;break;case O.TRIANGLES:K=3;break;case O.LINE_STRIP:K=1}for(const ee of M.get()){const oe=ee.vaos||(ee.vaos={});(oe[x]||(oe[x]=new Ur)).bind(t,this,T,D?D.getPaintVertexBuffers():[],w,ee.vertexOffset,U,Z,J),O.drawElements(n,ee.primitiveLength*K,O.UNSIGNED_SHORT,ee.primitiveOffset*K*2)}}}function lo(o,t,n){const a=1/j(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),d=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,m=d*(n.tileID.canonical.x+n.tileID.wrap*c),y=d*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[a,o.fromScale,o.toScale],u_fade:o.t,u_pixel_coord_upper:[m>>16,y>>16],u_pixel_coord_lower:[65535&m,65535&y]}}const co=(o,t,n,a)=>{const c=t.style.light,d=c.properties.get("position"),m=[d.x,d.y,d.z],y=function(){var x=new h.ARRAY_TYPE(9);return h.ARRAY_TYPE!=Float32Array&&(x[1]=0,x[2]=0,x[3]=0,x[5]=0,x[6]=0,x[7]=0),x[0]=1,x[4]=1,x[8]=1,x}();c.properties.get("anchor")==="viewport"&&function(x,T){var w=Math.sin(T),M=Math.cos(T);x[0]=M,x[1]=w,x[2]=0,x[3]=-w,x[4]=M,x[5]=0,x[6]=0,x[7]=0,x[8]=1}(y,-t.transform.angle),function(x,T,w){var M=T[0],B=T[1],k=T[2];x[0]=M*w[0]+B*w[3]+k*w[6],x[1]=M*w[1]+B*w[4]+k*w[7],x[2]=M*w[2]+B*w[5]+k*w[8]}(m,m,y);const _=c.properties.get("color");return{u_matrix:o,u_lightpos:m,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[_.r,_.g,_.b],u_vertical_gradient:+n,u_opacity:a}},aa=(o,t,n,a,c,d,m)=>h.extend(co(o,t,n,a),lo(d,t,m),{u_height_factor:-Math.pow(2,c.overscaledZ)/m.tileSize/8}),ho=o=>({u_matrix:o}),oa=(o,t,n,a)=>h.extend(ho(o),lo(n,t,a)),dl=(o,t)=>({u_matrix:o,u_world:t}),uo=(o,t,n,a,c)=>h.extend(oa(o,t,n,a),{u_world:c}),fl=(o,t,n,a)=>{const c=o.transform;let d,m;if(a.paint.get("circle-pitch-alignment")==="map"){const y=j(n,1,c.zoom);d=!0,m=[y,y]}else d=!1,m=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:o.translatePosMatrix(t.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+d,u_device_pixel_ratio:o.pixelRatio,u_extrude_scale:m}},la=(o,t,n)=>{const a=j(n,1,t.zoom),c=Math.pow(2,t.zoom-n.tileID.overscaledZ),d=n.tileID.overscaleFactor();return{u_matrix:o,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:a,u_extrude_scale:[t.pixelsToGLUnits[0]/(a*c),t.pixelsToGLUnits[1]/(a*c)],u_overscale_factor:d}},ca=(o,t,n=1)=>({u_matrix:o,u_color:t,u_overlay:0,u_overlay_scale:n}),ha=o=>({u_matrix:o}),po=(o,t,n,a)=>({u_matrix:o,u_extrude_scale:j(t,1,n),u_intensity:a});function fo(o,t){const n=Math.pow(2,t.canonical.z),a=t.canonical.y;return[new h.MercatorCoordinate(0,a/n).toLngLat().lat,new h.MercatorCoordinate(0,(a+1)/n).toLngLat().lat]}const vr=(o,t,n,a)=>{const c=o.transform;return{u_matrix:yn(o,t,n,a),u_ratio:1/j(t,1,c.zoom),u_device_pixel_ratio:o.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},ps=(o,t,n,a,c)=>h.extend(vr(o,t,n,c),{u_image:0,u_image_height:a}),Ui=(o,t,n,a,c)=>{const d=o.transform,m=Nn(t,d);return{u_matrix:yn(o,t,n,c),u_texsize:t.imageAtlasTexture.size,u_ratio:1/j(t,1,d.zoom),u_device_pixel_ratio:o.pixelRatio,u_image:0,u_scale:[m,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},ds=(o,t,n,a,c,d)=>{const m=o.lineAtlas,y=Nn(t,o.transform),_=n.layout.get("line-cap")==="round",x=m.getDash(a.from,_),T=m.getDash(a.to,_),w=x.width*c.fromScale,M=T.width*c.toScale;return h.extend(vr(o,t,n,d),{u_patternscale_a:[y/w,-x.height/2],u_patternscale_b:[y/M,-T.height/2],u_sdfgamma:m.width/(256*Math.min(w,M)*o.pixelRatio)/2,u_image:0,u_tex_y_a:x.y,u_tex_y_b:T.y,u_mix:c.t})};function Nn(o,t){return 1/j(o,1,t.tileZoom)}function yn(o,t,n,a){return o.translatePosMatrix(a?a.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const fs=(o,t,n,a,c)=>{return{u_matrix:o,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(m=c.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(d=c.paint.get("raster-contrast"),d>0?1/(1-d):1+d),u_spin_weights:ms(c.paint.get("raster-hue-rotate"))};var d,m};function ms(o){o*=Math.PI/180;const t=Math.sin(o),n=Math.cos(o);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const xn=(o,t,n,a,c,d,m,y,_,x)=>{const T=c.transform;return{u_is_size_zoom_constant:+(o==="constant"||o==="source"),u_is_size_feature_constant:+(o==="constant"||o==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:T.cameraToCenterDistance,u_pitch:T.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:T.width/T.height,u_fade_change:c.options.fadeDuration?c.symbolFadeChange:1,u_matrix:d,u_label_plane_matrix:m,u_coord_matrix:y,u_is_text:+_,u_pitch_with_map:+a,u_texsize:x,u_texture:0}},vn=(o,t,n,a,c,d,m,y,_,x,T)=>{const w=c.transform;return h.extend(xn(o,t,n,a,c,d,m,y,_,x),{u_gamma_scale:a?Math.cos(w._pitch)*w.cameraToCenterDistance:1,u_device_pixel_ratio:c.pixelRatio,u_is_halo:+T})},gs=(o,t,n,a,c,d,m,y,_,x)=>h.extend(vn(o,t,n,a,c,d,m,y,!0,_,!0),{u_texsize_icon:x,u_texture_icon:1}),Ei=(o,t,n)=>({u_matrix:o,u_opacity:t,u_color:n}),Si=(o,t,n,a,c,d)=>h.extend(function(m,y,_,x){const T=_.imageManager.getPattern(m.from.toString()),w=_.imageManager.getPattern(m.to.toString()),{width:M,height:B}=_.imageManager.getPixelSize(),k=Math.pow(2,x.tileID.overscaledZ),D=x.tileSize*Math.pow(2,_.transform.tileZoom)/k,U=D*(x.tileID.canonical.x+x.tileID.wrap*k),Z=D*x.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:w.tl,u_pattern_br_b:w.br,u_texsize:[M,B],u_mix:y.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:w.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/j(x,1,_.transform.tileZoom),u_pixel_coord_upper:[U>>16,Z>>16],u_pixel_coord_lower:[65535&U,65535&Z]}}(a,d,n,c),{u_matrix:o,u_opacity:t}),ua={fillExtrusion:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_lightpos:new h.Uniform3f(o,t.u_lightpos),u_lightintensity:new h.Uniform1f(o,t.u_lightintensity),u_lightcolor:new h.Uniform3f(o,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(o,t.u_vertical_gradient),u_opacity:new h.Uniform1f(o,t.u_opacity)}),fillExtrusionPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_lightpos:new h.Uniform3f(o,t.u_lightpos),u_lightintensity:new h.Uniform1f(o,t.u_lightintensity),u_lightcolor:new h.Uniform3f(o,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(o,t.u_vertical_gradient),u_height_factor:new h.Uniform1f(o,t.u_height_factor),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade),u_opacity:new h.Uniform1f(o,t.u_opacity)}),fill:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),fillPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),fillOutline:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world)}),fillOutlinePattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),circle:(o,t)=>({u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_scale_with_map:new h.Uniform1i(o,t.u_scale_with_map),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_extrude_scale:new h.Uniform2f(o,t.u_extrude_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),collisionBox:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pixels_to_tile_units:new h.Uniform1f(o,t.u_pixels_to_tile_units),u_extrude_scale:new h.Uniform2f(o,t.u_extrude_scale),u_overscale_factor:new h.Uniform1f(o,t.u_overscale_factor)}),collisionCircle:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_inv_matrix:new h.UniformMatrix4f(o,t.u_inv_matrix),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_viewport_size:new h.Uniform2f(o,t.u_viewport_size)}),debug:(o,t)=>({u_color:new h.UniformColor(o,t.u_color),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_overlay:new h.Uniform1i(o,t.u_overlay),u_overlay_scale:new h.Uniform1f(o,t.u_overlay_scale)}),clippingMask:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),heatmap:(o,t)=>({u_extrude_scale:new h.Uniform1f(o,t.u_extrude_scale),u_intensity:new h.Uniform1f(o,t.u_intensity),u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),heatmapTexture:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world),u_image:new h.Uniform1i(o,t.u_image),u_color_ramp:new h.Uniform1i(o,t.u_color_ramp),u_opacity:new h.Uniform1f(o,t.u_opacity)}),hillshade:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_latrange:new h.Uniform2f(o,t.u_latrange),u_light:new h.Uniform2f(o,t.u_light),u_shadow:new h.UniformColor(o,t.u_shadow),u_highlight:new h.UniformColor(o,t.u_highlight),u_accent:new h.UniformColor(o,t.u_accent)}),hillshadePrepare:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_dimension:new h.Uniform2f(o,t.u_dimension),u_zoom:new h.Uniform1f(o,t.u_zoom),u_unpack:new h.Uniform4f(o,t.u_unpack)}),line:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels)}),lineGradient:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_image:new h.Uniform1i(o,t.u_image),u_image_height:new h.Uniform1f(o,t.u_image_height)}),linePattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texsize:new h.Uniform2f(o,t.u_texsize),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_image:new h.Uniform1i(o,t.u_image),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),lineSDF:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_patternscale_a:new h.Uniform2f(o,t.u_patternscale_a),u_patternscale_b:new h.Uniform2f(o,t.u_patternscale_b),u_sdfgamma:new h.Uniform1f(o,t.u_sdfgamma),u_image:new h.Uniform1i(o,t.u_image),u_tex_y_a:new h.Uniform1f(o,t.u_tex_y_a),u_tex_y_b:new h.Uniform1f(o,t.u_tex_y_b),u_mix:new h.Uniform1f(o,t.u_mix)}),raster:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_tl_parent:new h.Uniform2f(o,t.u_tl_parent),u_scale_parent:new h.Uniform1f(o,t.u_scale_parent),u_buffer_scale:new h.Uniform1f(o,t.u_buffer_scale),u_fade_t:new h.Uniform1f(o,t.u_fade_t),u_opacity:new h.Uniform1f(o,t.u_opacity),u_image0:new h.Uniform1i(o,t.u_image0),u_image1:new h.Uniform1i(o,t.u_image1),u_brightness_low:new h.Uniform1f(o,t.u_brightness_low),u_brightness_high:new h.Uniform1f(o,t.u_brightness_high),u_saturation_factor:new h.Uniform1f(o,t.u_saturation_factor),u_contrast_factor:new h.Uniform1f(o,t.u_contrast_factor),u_spin_weights:new h.Uniform3f(o,t.u_spin_weights)}),symbolIcon:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texture:new h.Uniform1i(o,t.u_texture)}),symbolSDF:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texture:new h.Uniform1i(o,t.u_texture),u_gamma_scale:new h.Uniform1f(o,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(o,t.u_is_halo)}),symbolTextAndIcon:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texsize_icon:new h.Uniform2f(o,t.u_texsize_icon),u_texture:new h.Uniform1i(o,t.u_texture),u_texture_icon:new h.Uniform1i(o,t.u_texture_icon),u_gamma_scale:new h.Uniform1f(o,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(o,t.u_is_halo)}),background:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_opacity:new h.Uniform1f(o,t.u_opacity),u_color:new h.UniformColor(o,t.u_color)}),backgroundPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_opacity:new h.Uniform1f(o,t.u_opacity),u_image:new h.Uniform1i(o,t.u_image),u_pattern_tl_a:new h.Uniform2f(o,t.u_pattern_tl_a),u_pattern_br_a:new h.Uniform2f(o,t.u_pattern_br_a),u_pattern_tl_b:new h.Uniform2f(o,t.u_pattern_tl_b),u_pattern_br_b:new h.Uniform2f(o,t.u_pattern_br_b),u_texsize:new h.Uniform2f(o,t.u_texsize),u_mix:new h.Uniform1f(o,t.u_mix),u_pattern_size_a:new h.Uniform2f(o,t.u_pattern_size_a),u_pattern_size_b:new h.Uniform2f(o,t.u_pattern_size_b),u_scale_a:new h.Uniform1f(o,t.u_scale_a),u_scale_b:new h.Uniform1f(o,t.u_scale_b),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_tile_units_to_pixels:new h.Uniform1f(o,t.u_tile_units_to_pixels)}),terrain:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texture:new h.Uniform1i(o,t.u_texture),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)}),terrainDepth:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)}),terrainCoords:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texture:new h.Uniform1i(o,t.u_texture),u_terrain_coords_id:new h.Uniform1f(o,t.u_terrain_coords_id),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)})};class _s{constructor(t,n,a){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ys={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class pa{constructor(t,n,a,c){this.length=n.length,this.attributes=a,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;const d=t.gl;this.buffer=d.createBuffer(),t.bindVertexBuffer.set(this.buffer),d.bufferData(d.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let a=0;a0){const be=h.create(),ze=ce;h.mul(be,oe.placementInvProjMatrix,o.transform.glCoordMatrix),h.mul(be,be,oe.placementViewportMatrix),T.push({circleArray:le,circleOffset:M,transform:ze,invTransform:be,coord:K}),w+=le.length/4,M=w}ue&&x.draw(y,_.LINES,We.disabled,gt.disabled,o.colorModeForRenderPass(),ft.disabled,la(ce,o.transform,ee),o.style.map.terrain&&o.style.map.terrain.getTerrainData(K),n.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,null,o.transform.zoom,null,null,ue.collisionVertexBuffer)}if(!m||!T.length)return;const B=o.useProgram("collisionCircle"),k=new h.CollisionCircleLayoutArray;k.resize(4*w),k._trim();let D=0;for(const O of T)for(let K=0;K=0&&(k[U.associatedIconIndex]={shiftedAnchor:Ve,angle:me})}else z(U.numGlyphs,M)}if(x){B.clear();const D=o.icon.placedSymbolArray;for(let U=0;Uo.style.map.terrain.getElevation(ue,Gs,Tr):null,Ai=n.layout.get("text-rotation-alignment")==="map";yr(be,ue.posMatrix,o,c,Wi,ui,U,x,Ai,$t)}const ri=o.translatePosMatrix(ue.posMatrix,le,d,m),Gt=Z||c&&oe||is?wa:Wi,nt=o.translatePosMatrix(ui,le,d,m,!0),Nt=me&&n.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Xt;Xt=me?be.iconsInText?gs(Be.kind,Pt,J,U,o,ri,Gt,nt,$e,Zt):vn(Be.kind,Pt,J,U,o,ri,Gt,nt,c,$e,!0):xn(Be.kind,Pt,J,U,o,ri,Gt,nt,c,$e);const at={program:it,buffers:ze,uniformValues:Xt,atlasTexture:It,atlasTextureIcon:Ii,atlasInterpolation:hi,atlasInterpolationIcon:zt,isSDF:me,hasHalo:Nt};if(O&&be.canOverlap){K=!0;const $t=ze.segments.get();for(const Ai of $t)ce.push({segments:new h.SegmentVector([Ai]),sortKey:Ai.sortKey,state:at,terrainData:rt})}else ce.push({segments:ze.segments,sortKey:0,state:at,terrainData:rt})}K&&ce.sort((ue,le)=>ue.sortKey-le.sortKey);for(const ue of ce){const le=ue.state;if(M.activeTexture.set(B.TEXTURE0),le.atlasTexture.bind(le.atlasInterpolation,B.CLAMP_TO_EDGE),le.atlasTextureIcon&&(M.activeTexture.set(B.TEXTURE1),le.atlasTextureIcon&&le.atlasTextureIcon.bind(le.atlasInterpolationIcon,B.CLAMP_TO_EDGE)),le.isSDF){const be=le.uniformValues;le.hasHalo&&(be.u_is_halo=1,Ta(le.buffers,ue.segments,n,o,le.program,ee,T,w,be,ue.terrainData)),be.u_is_halo=0}Ta(le.buffers,ue.segments,n,o,le.program,ee,T,w,le.uniformValues,ue.terrainData)}}function Ta(o,t,n,a,c,d,m,y,_,x){const T=a.context;c.draw(T,T.gl.TRIANGLES,d,m,y,ft.disabled,_,x,n.id,o.layoutVertexBuffer,o.indexBuffer,t,n.paint,a.transform.zoom,o.programConfigurations.get(n.id),o.dynamicLayoutVertexBuffer,o.opacityVertexBuffer)}function Ea(o,t,n,a,c){if(!n||!a||!a.imageAtlas)return;const d=a.imageAtlas.patternPositions;let m=d[n.to.toString()],y=d[n.from.toString()];if(!m||!y){const _=c.getPaintProperty(t);m=d[_],y=d[_]}m&&y&&o.setConstantPatternPositions(m,y)}function jn(o,t,n,a,c,d,m){const y=o.context.gl,_="fill-pattern",x=n.paint.get(_),T=x&&x.constantOr(1),w=n.getCrossfadeParameters();let M,B,k,D,U;m?(B=T&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",M=y.LINES):(B=T?"fillPattern":"fill",M=y.TRIANGLES);const Z=x.constantOr(null);for(const J of a){const O=t.getTile(J);if(T&&!O.patternsLoaded())continue;const K=O.getBucket(n);if(!K)continue;const ee=K.programConfigurations.get(n.id),oe=o.useProgram(B,ee),ce=o.style.map.terrain&&o.style.map.terrain.getTerrainData(J);T&&(o.context.activeTexture.set(y.TEXTURE0),O.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),ee.updatePaintBuffers(w)),Ea(ee,_,Z,O,n);const ue=ce?J:null,le=o.translatePosMatrix(ue?ue.posMatrix:J.posMatrix,O,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(m){D=K.indexBuffer2,U=K.segments2;const be=[y.drawingBufferWidth,y.drawingBufferHeight];k=B==="fillOutlinePattern"&&T?uo(le,o,w,O,be):dl(le,be)}else D=K.indexBuffer,U=K.segments,k=T?oa(le,o,w,O):ho(le);oe.draw(o.context,M,c,o.stencilModeForClipping(J),d,ft.disabled,k,ce,n.id,K.layoutVertexBuffer,D,U,n.paint,o.transform.zoom,ee)}}function Zn(o,t,n,a,c,d,m){const y=o.context,_=y.gl,x="fill-extrusion-pattern",T=n.paint.get(x),w=T.constantOr(1),M=n.getCrossfadeParameters(),B=n.paint.get("fill-extrusion-opacity"),k=T.constantOr(null);for(const D of a){const U=t.getTile(D),Z=U.getBucket(n);if(!Z)continue;const J=o.style.map.terrain&&o.style.map.terrain.getTerrainData(D),O=Z.programConfigurations.get(n.id),K=o.useProgram(w?"fillExtrusionPattern":"fillExtrusion",O);w&&(o.context.activeTexture.set(_.TEXTURE0),U.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),O.updatePaintBuffers(M)),Ea(O,x,k,U,n);const ee=o.translatePosMatrix(D.posMatrix,U,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),oe=n.paint.get("fill-extrusion-vertical-gradient"),ce=w?aa(ee,o,oe,B,D,M,U):co(ee,o,oe,B);K.draw(y,y.gl.TRIANGLES,c,d,m,ft.backCCW,ce,J,n.id,Z.layoutVertexBuffer,Z.indexBuffer,Z.segments,n.paint,o.transform.zoom,O,o.style.map.terrain&&Z.centroidVertexBuffer)}}function Sl(o,t,n,a,c,d,m){const y=o.context,_=y.gl,x=n.fbo;if(!x)return;const T=o.useProgram("hillshade"),w=o.style.map.terrain&&o.style.map.terrain.getTerrainData(t);y.activeTexture.set(_.TEXTURE0),_.bindTexture(_.TEXTURE_2D,x.colorAttachment.get()),T.draw(y,_.TRIANGLES,c,d,m,ft.disabled,((M,B,k,D)=>{const U=k.paint.get("hillshade-shadow-color"),Z=k.paint.get("hillshade-highlight-color"),J=k.paint.get("hillshade-accent-color");let O=k.paint.get("hillshade-illumination-direction")*(Math.PI/180);k.paint.get("hillshade-illumination-anchor")==="viewport"&&(O-=M.transform.angle);const K=!M.options.moving;return{u_matrix:D?D.posMatrix:M.transform.calculatePosMatrix(B.tileID.toUnwrapped(),K),u_image:0,u_latrange:fo(0,B.tileID),u_light:[k.paint.get("hillshade-exaggeration"),O],u_shadow:U,u_highlight:Z,u_accent:J}})(o,n,a,w?t:null),w,a.id,o.rasterBoundsBuffer,o.quadTriangleIndexBuffer,o.rasterBoundsSegments)}function So(o,t,n,a,c,d){const m=o.context,y=m.gl,_=t.dem;if(_&&_.data){const x=_.dim,T=_.stride,w=_.getPixels();if(m.activeTexture.set(y.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||o.getTileTexture(T),t.demTexture){const B=t.demTexture;B.update(w,{premultiply:!1}),B.bind(y.NEAREST,y.CLAMP_TO_EDGE)}else t.demTexture=new ct(m,w,y.RGBA,{premultiply:!1}),t.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);m.activeTexture.set(y.TEXTURE0);let M=t.fbo;if(!M){const B=new ct(m,{width:x,height:x,data:null},y.RGBA);B.bind(y.LINEAR,y.CLAMP_TO_EDGE),M=t.fbo=m.createFramebuffer(x,x,!0,!1),M.colorAttachment.set(B.texture)}m.bindFramebuffer.set(M.framebuffer),m.viewport.set([0,0,x,x]),o.useProgram("hillshadePrepare").draw(m,y.TRIANGLES,a,c,d,ft.disabled,((B,k)=>{const D=k.stride,U=h.create();return h.ortho(U,0,h.EXTENT,-h.EXTENT,0,0,1),h.translate(U,U,[0,-h.EXTENT,0]),{u_matrix:U,u_image:1,u_dimension:[D,D],u_zoom:B.overscaledZ,u_unpack:k.getUnpackVector()}})(t.tileID,_),null,n.id,o.rasterBoundsBuffer,o.quadTriangleIndexBuffer,o.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Mt(o,t,n,a,c,d){const m=a.paint.get("raster-fade-duration");if(!d&&m>0){const y=h.exported.now(),_=(y-o.timeAdded)/m,x=t?(y-t.timeAdded)/m:-1,T=n.getSource(),w=c.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),M=!t||Math.abs(t.tileID.overscaledZ-w)>Math.abs(o.tileID.overscaledZ-w),B=M&&o.refreshedUponExpiration?1:h.clamp(M?_:1-x,0,1);return o.refreshedUponExpiration&&_>=1&&(o.refreshedUponExpiration=!1),t?{opacity:1,mix:1-B}:{opacity:B,mix:0}}return{opacity:1,mix:0}}const Qr=new h.Color(1,0,0,1),Vi=new h.Color(0,1,0,1),Io=new h.Color(0,0,1,1),Sa=new h.Color(1,0,1,1),Ao=new h.Color(0,1,1,1);function en(o,t,n,a){In(o,0,t+n/2,o.transform.width,n,a)}function Gn(o,t,n,a){In(o,t-n/2,0,n,o.transform.height,a)}function In(o,t,n,a,c,d){const m=o.context,y=m.gl;y.enable(y.SCISSOR_TEST),y.scissor(t*o.pixelRatio,n*o.pixelRatio,a*o.pixelRatio,c*o.pixelRatio),m.clear({color:d}),y.disable(y.SCISSOR_TEST)}function Co(o,t,n){const a=o.context,c=a.gl,d=n.posMatrix,m=o.useProgram("debug"),y=We.disabled,_=gt.disabled,x=o.colorModeForRenderPass(),T="$debug",w=o.style.map.terrain&&o.style.map.terrain.getTerrainData(n);a.activeTexture.set(c.TEXTURE0);const M=t.getTileByID(n.key).latestRawTileData,B=Math.floor((M&&M.byteLength||0)/1024),k=t.getTile(n).tileSize,D=512/Math.min(k,512)*(n.overscaledZ/o.transform.zoom)*.5;let U=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(U+=` => ${n.overscaledZ}`),function(Z,J){Z.initDebugOverlayCanvas();const O=Z.debugOverlayCanvas,K=Z.context.gl,ee=Z.debugOverlayCanvas.getContext("2d");ee.clearRect(0,0,O.width,O.height),ee.shadowColor="white",ee.shadowBlur=2,ee.lineWidth=1.5,ee.strokeStyle="white",ee.textBaseline="top",ee.font="bold 36px Open Sans, sans-serif",ee.fillText(J,5,5),ee.strokeText(J,5,5),Z.debugOverlayTexture.update(O),Z.debugOverlayTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE)}(o,`${U} ${B}kB`),m.draw(a,c.TRIANGLES,y,_,Tt.alphaBlended,ft.disabled,ca(d,h.Color.transparent,D),null,T,o.debugBuffer,o.quadTriangleIndexBuffer,o.debugSegments),m.draw(a,c.LINE_STRIP,y,_,x,ft.disabled,ca(d,h.Color.red),w,T,o.debugBuffer,o.tileBorderIndexBuffer,o.debugSegments)}function Ia(o,t,n){const a=o.context,c=a.gl,d=o.colorModeForRenderPass(),m=new We(c.LEQUAL,We.ReadWrite,o.depthRangeFor3D),y=o.useProgram("terrain"),_=t.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,o.width,o.height]);for(const x of n){const T=o.renderToTexture.getTexture(x),w=t.getTerrainData(x.tileID);a.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,T.texture);const M={u_matrix:o.transform.calculatePosMatrix(x.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(o.transform.zoom)};y.draw(a,c.TRIANGLES,m,gt.disabled,d,ft.backCCW,M,w,"terrain",_.vertexBuffer,_.indexBuffer,_.segments)}}const Aa={symbol:function(o,t,n,a,c){if(o.renderPass!=="translucent")return;const d=gt.disabled,m=o.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(y,_,x,T,w,M,B){const k=_.transform,D=w==="map",U=M==="map";for(const Z of y){const J=T.getTile(Z),O=J.getBucket(x);if(!O||!O.text||!O.text.segments.get().length)continue;const K=h.evaluateSizeForZoom(O.textSizeData,k.zoom),ee=j(J,1,_.transform.zoom),oe=Ne(Z.posMatrix,U,D,_.transform,ee),ce=x.layout.get("icon-text-fit")!=="none"&&O.hasIconData();if(K){const ue=Math.pow(2,k.zoom-J.tileID.overscaledZ);Eo(O,D,U,B,k,oe,Z.posMatrix,ue,K,ce,_.style.map.terrain?(le,be)=>_.style.map.terrain.getElevation(Z,le,be):null)}}}(a,o,n,t,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),c),n.paint.get("icon-opacity").constantOr(1)!==0&&Ss(o,t,n,a,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),d,m),n.paint.get("text-opacity").constantOr(1)!==0&&Ss(o,t,n,a,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),d,m),t.map.showCollisionBoxes&&(To(o,t,n,a,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),To(o,t,n,a,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(o,t,n,a){if(o.renderPass!=="translucent")return;const c=n.paint.get("circle-opacity"),d=n.paint.get("circle-stroke-width"),m=n.paint.get("circle-stroke-opacity"),y=!n.layout.get("circle-sort-key").isConstant();if(c.constantOr(1)===0&&(d.constantOr(1)===0||m.constantOr(1)===0))return;const _=o.context,x=_.gl,T=o.depthModeForSublayer(0,We.ReadOnly),w=gt.disabled,M=o.colorModeForRenderPass(),B=[];for(let k=0;kk.sortKey-D.sortKey);for(const k of B){const{programConfiguration:D,program:U,layoutVertexBuffer:Z,indexBuffer:J,uniformValues:O,terrainData:K}=k.state;U.draw(_,x.TRIANGLES,T,w,M,ft.disabled,O,K,n.id,Z,J,k.segments,n.paint,o.transform.zoom,D)}},heatmap:function(o,t,n,a){if(n.paint.get("heatmap-opacity")!==0)if(o.renderPass==="offscreen"){const c=o.context,d=c.gl,m=gt.disabled,y=new Tt([d.ONE,d.ONE],h.Color.transparent,[!0,!0,!0,!0]);(function(_,x,T){const w=_.gl;_.activeTexture.set(w.TEXTURE1),_.viewport.set([0,0,x.width/4,x.height/4]);let M=T.heatmapFbo;if(M)w.bindTexture(w.TEXTURE_2D,M.colorAttachment.get()),_.bindFramebuffer.set(M.framebuffer);else{const B=w.createTexture();w.bindTexture(w.TEXTURE_2D,B),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,w.LINEAR),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,w.LINEAR),M=T.heatmapFbo=_.createFramebuffer(x.width/4,x.height/4,!1,!1),function(k,D,U,Z){var J,O;const K=k.gl,ee=(J=k.HALF_FLOAT)!==null&&J!==void 0?J:K.UNSIGNED_BYTE,oe=(O=k.RGBA16F)!==null&&O!==void 0?O:K.RGBA;K.texImage2D(K.TEXTURE_2D,0,oe,D.width/4,D.height/4,0,K.RGBA,ee,null),Z.colorAttachment.set(U)}(_,x,B,M)}})(c,o,n),c.clear({color:h.Color.transparent});for(let _=0;_{const k=h.create();h.ortho(k,0,T.width,T.height,0,0,1);const D=T.context.gl;return{u_matrix:k,u_world:[D.drawingBufferWidth,D.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:w.paint.get("heatmap-opacity")}})(c,d),null,d.id,c.viewportBuffer,c.quadTriangleIndexBuffer,c.viewportSegments,d.paint,c.transform.zoom)}(o,n))},line:function(o,t,n,a){if(o.renderPass!=="translucent")return;const c=n.paint.get("line-opacity"),d=n.paint.get("line-width");if(c.constantOr(1)===0||d.constantOr(1)===0)return;const m=o.depthModeForSublayer(0,We.ReadOnly),y=o.colorModeForRenderPass(),_=n.paint.get("line-dasharray"),x=n.paint.get("line-pattern"),T=x.constantOr(1),w=n.paint.get("line-gradient"),M=n.getCrossfadeParameters(),B=T?"linePattern":_?"lineSDF":w?"lineGradient":"line",k=o.context,D=k.gl;let U=!0;for(const Z of a){const J=t.getTile(Z);if(T&&!J.patternsLoaded())continue;const O=J.getBucket(n);if(!O)continue;const K=O.programConfigurations.get(n.id),ee=o.context.program.get(),oe=o.useProgram(B,K),ce=U||oe.program!==ee,ue=o.style.map.terrain&&o.style.map.terrain.getTerrainData(Z),le=x.constantOr(null);if(le&&J.imageAtlas){const Ve=J.imageAtlas,me=Ve.patternPositions[le.to.toString()],Be=Ve.patternPositions[le.from.toString()];me&&Be&&K.setConstantPatternPositions(me,Be)}const be=ue?Z:null,ze=T?Ui(o,J,n,M,be):_?ds(o,J,n,_,M,be):w?ps(o,J,n,O.lineClipsArray.length,be):vr(o,J,n,be);if(T)k.activeTexture.set(D.TEXTURE0),J.imageAtlasTexture.bind(D.LINEAR,D.CLAMP_TO_EDGE),K.updatePaintBuffers(M);else if(_&&(ce||o.lineAtlas.dirty))k.activeTexture.set(D.TEXTURE0),o.lineAtlas.bind(k);else if(w){const Ve=O.gradients[n.id];let me=Ve.texture;if(n.gradientVersion!==Ve.version){let Be=256;if(n.stepInterpolant){const we=t.getSource().maxzoom,it=Z.canonical.z===we?Math.ceil(1<256&&this.clearStencil(),a.setColorMode(Tt.disabled),a.setDepthMode(We.disabled);const d=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of n){const y=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,_=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);d.draw(a,c.TRIANGLES,We.disabled,new gt({func:c.ALWAYS,mask:0},y,255,c.KEEP,c.KEEP,c.REPLACE),Tt.disabled,ft.disabled,ha(m.posMatrix),_,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new gt({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new gt({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,a=t.sort((m,y)=>y.overscaledZ-m.overscaledZ),c=a[a.length-1].overscaledZ,d=a[0].overscaledZ-c+1;if(d>1){this.currentStencilSource=void 0,this.nextStencilID+d>256&&this.clearStencil();const m={};for(let y=0;y=0;this.currentLayer--){const _=this.style._layers[a[this.currentLayer]],x=c[_.source],T=d[_.source];this._renderTileClippingMasks(_,T),this.renderLayer(this,x,_,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerU.source&&!U.isHidden(T)?[x.sourceCaches[U.source]]:[]),B=M.filter(U=>U.getSource().type==="vector"),k=M.filter(U=>U.getSource().type!=="vector"),D=U=>{(!w||w.getSource().maxzoomD(U)),w||k.forEach(U=>D(U)),w}(this.style,this.transform.zoom);_&&Aa.debug(this,_,_.getVisibleCoordinates())}this.options.showPadding&&function(_){const x=_.transform.padding;en(_,_.transform.height-(x.top||0),3,Qr),en(_,x.bottom||0,3,Vi),Gn(_,x.left||0,3,Io),Gn(_,_.transform.width-(x.right||0),3,Sa);const T=_.transform.centerPoint;(function(w,M,B,k){In(w,M-1,B-10,2,20,k),In(w,M-10,B-1,20,2,k)})(_,T.x,_.transform.height-T.y,Ao)}(this),this.context.setDefault()}renderLayer(t,n,a,c){a.isHidden(this.transform.zoom)||(a.type==="background"||a.type==="custom"||(c||[]).length)&&(this.id=a.id,Aa[a.type](t,n,a,c,this.style.placement.variableOffsets))}translatePosMatrix(t,n,a,c,d){if(!a[0]&&!a[1])return t;const m=d?c==="map"?this.transform.angle:0:c==="viewport"?-this.transform.angle:0;if(m){const x=Math.sin(m),T=Math.cos(m);a=[a[0]*T-a[1]*x,a[0]*x+a[1]*T]}const y=[d?a[0]:j(n,a[0],this.transform.zoom),d?a[1]:j(n,a[1],this.transform.zoom),0],_=new Float32Array(16);return h.translate(_,t,y),_}saveTileTexture(t){const n=this._tileTextures[t.size[0]];n?n.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),a=this.imageManager.getPattern(t.to.toString());return!n||!a}useProgram(t,n){this.cache=this.cache||{};const a=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new us(this.context,t,Or[t],n,ua[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new ct(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class Is{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,a){const c=Math.pow(2,a),d=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(y=>{const _=1/(y=h.transformMat4([],y,t))[3]/n*c;return h.mul$1(y,y,[_,_,1/y[3],_])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(y=>{const _=function(M,B){var k=B[0],D=B[1],U=B[2],Z=k*k+D*D+U*U;return Z>0&&(Z=1/Math.sqrt(Z)),M[0]=B[0]*Z,M[1]=B[1]*Z,M[2]=B[2]*Z,M}([],function(M,B,k){var D=B[0],U=B[1],Z=B[2],J=k[0],O=k[1],K=k[2];return M[0]=U*K-Z*O,M[1]=Z*J-D*K,M[2]=D*O-U*J,M}([],cn([],d[y[0]],d[y[1]]),cn([],d[y[2]],d[y[1]]))),x=-((T=_)[0]*(w=d[y[1]])[0]+T[1]*w[1]+T[2]*w[2]);var T,w;return _.concat(x)});return new Is(d,m)}}class rr{constructor(t,n){this.min=t,this.max=n,this.center=function(a,c,d){return a[0]=.5*c[0],a[1]=.5*c[1],a[2]=.5*c[2],a}([],function(a,c,d){return a[0]=c[0]+d[0],a[1]=c[1]+d[1],a[2]=c[2]+d[2],a}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],a=gi(this.min),c=gi(this.max);for(let d=0;d=0&&m++;if(m===0)return 0;m!==n.length&&(a=!1)}if(a)return 2;for(let c=0;c<3;c++){let d=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let y=0;ythis.max[c]-this.min[c])return 0}return 1}}class As{constructor(t=0,n=0,a=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(a)||a<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=a,this.right=c}interpolate(t,n,a){return n.top!=null&&t.top!=null&&(this.top=h.interpolate.number(t.top,n.top,a)),n.bottom!=null&&t.bottom!=null&&(this.bottom=h.interpolate.number(t.bottom,n.bottom,a)),n.left!=null&&t.left!=null&&(this.left=h.interpolate.number(t.left,n.left,a)),n.right!=null&&t.right!=null&&(this.right=h.interpolate.number(t.right,n.right,a)),this}getCenter(t,n){const a=h.clamp((this.left+t-this.right)/2,0,t),c=h.clamp((this.top+n-this.bottom)/2,0,n);return new h.Point(a,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new As(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Cs{constructor(t,n,a,c,d){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=d===void 0||!!d,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=c??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new h.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new As,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const t=new Cs(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new h.Point(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-h.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var a=new h.ARRAY_TYPE(4);return h.ARRAY_TYPE!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,c,d){var m=c[0],y=c[1],_=c[2],x=c[3],T=Math.sin(d),w=Math.cos(d);a[0]=m*w+_*T,a[1]=y*w+x*T,a[2]=m*-T+_*w,a[3]=y*-T+x*w}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=h.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,a){this._unmodified=!1,this._edgeInsets.interpolate(t,n,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new h.UnwrappedTileID(0,t)];if(this._renderWorldCopies){const a=this.pointCoordinate(new h.Point(0,0)),c=this.pointCoordinate(new h.Point(this.width,0)),d=this.pointCoordinate(new h.Point(this.width,this.height)),m=this.pointCoordinate(new h.Point(0,this.height)),y=Math.floor(Math.min(a.x,c.x,d.x,m.x)),_=Math.floor(Math.max(a.x,c.x,d.x,m.x)),x=1;for(let T=y-x;T<=_+x;T++)T!==0&&n.push(new h.UnwrappedTileID(T,t))}return n}coveringTiles(t){var n,a;let c=this.coveringZoomLevel(t);const d=c;if(t.minzoom!==void 0&&ct.maxzoom&&(c=t.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),y=h.MercatorCoordinate.fromLngLat(this.center),_=Math.pow(2,c),x=[_*m.x,_*m.y,0],T=[_*y.x,_*y.y,0],w=Is.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c);let M=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(M=c);const B=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,k=O=>({aabb:new rr([O*_,0,0],[(O+1)*_,_,0]),zoom:0,x:0,y:0,wrap:O,fullyVisible:!1}),D=[],U=[],Z=c,J=t.reparseOverscaled?d:c;if(this._renderWorldCopies)for(let O=1;O<=3;O++)D.push(k(-O)),D.push(k(O));for(D.push(k(0));D.length>0;){const O=D.pop(),K=O.x,ee=O.y;let oe=O.fullyVisible;if(!oe){const ze=O.aabb.intersects(w);if(ze===0)continue;oe=ze===2}const ce=t.terrain?x:T,ue=O.aabb.distanceX(ce),le=O.aabb.distanceY(ce),be=Math.max(Math.abs(ue),Math.abs(le));if(O.zoom===Z||be>B+(1<=M){const ze=Z-O.zoom,Ve=x[0]-.5-(K<>1),Be=O.zoom+1;let we=O.aabb.quadrant(ze);if(t.terrain){const it=new h.OverscaledTileID(Be,O.wrap,Be,Ve,me),Pt=t.terrain.getMinMaxElevation(it),rt=(n=Pt.minElevation)!==null&&n!==void 0?n:this.elevation,$e=(a=Pt.maxElevation)!==null&&a!==void 0?a:this.elevation;we=new rr([we.min[0],we.min[1],rt],[we.max[0],we.max[1],$e])}D.push({aabb:we,zoom:Be,x:Ve,y:me,wrap:O.wrap,fullyVisible:oe})}}return U.sort((O,K)=>O.distanceSq-K.distanceSq).map(O=>O.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const n=h.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new h.Point(h.mercatorXfromLng(t.lng)*this.worldSize,h.mercatorYfromLat(n)*this.worldSize)}unproject(t){return new h.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(t){this.freezeElevation||(this.elevation=t?this.getElevation(this._center,t):0)}getElevation(t,n){const a=h.MercatorCoordinate.fromLngLat(t.wrap()),c=(1<m&&(c=m-k)}if(this.lngRange){const B=(y+_)/2,k=h.wrap(w.x,B-this.worldSize/2,B+this.worldSize/2),D=x.x/2;k-D_&&(a=_-D)}a===void 0&&c===void 0||(this.center=this.unproject(new h.Point(a!==void 0?a:w.x,c!==void 0?c:w.y)).wrap()),this._unmodified=T,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=h.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let c=h.identity(new Float64Array(16));h.scale(c,c,[this.width/2,-this.height/2,1]),h.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=h.identity(new Float64Array(16)),h.scale(c,c,[1,-1,1]),h.translate(c,c,[-1,-1,0]),h.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const d=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,m=Math.PI/2+this._pitch,y=this._fov*(.5+t.y/this.height),_=Math.sin(y)*d/Math.sin(h.clamp(Math.PI-m-y,.01,Math.PI-.01)),x=this.getHorizon(),T=2*Math.atan(x/this.cameraToCenterDistance)*(.5+t.y/(2*x)),w=Math.sin(T)*d/Math.sin(h.clamp(Math.PI-m-T,.01,Math.PI-.01)),M=Math.min(_,w),B=1.01*(Math.cos(Math.PI/2-this._pitch)*M+d),k=this.height/50;c=new Float64Array(16),h.perspective(c,this._fov,this.width/this.height,k,B),c[8]=2*-t.x/this.width,c[9]=2*t.y/this.height,h.scale(c,c,[1,-1,1]),h.translate(c,c,[0,0,-this.cameraToCenterDistance]),h.rotateX(c,c,this._pitch),h.rotateZ(c,c,this.angle),h.translate(c,c,[-n,-a,0]),this.mercatorMatrix=h.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),h.scale(c,c,[1,1,this._pixelPerMeter]),this.pixelMatrix=h.multiply(new Float64Array(16),this.labelPlaneMatrix,c),h.translate(c,c,[0,0,-this.elevation]),this.projMatrix=c,this.invProjMatrix=h.invert([],c),this.pixelMatrix3D=h.multiply(new Float64Array(16),this.labelPlaneMatrix,c);const D=this.width%2/2,U=this.height%2/2,Z=Math.cos(this.angle),J=Math.sin(this.angle),O=n-Math.round(n)+Z*D+J*U,K=a-Math.round(a)+Z*U+J*D,ee=new Float64Array(c);if(h.translate(ee,ee,[O>.5?O-1:O,K>.5?K-1:K,0]),this.alignedProjMatrix=ee,c=h.invert(new Float64Array(16),this.pixelMatrix),!c)throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new h.Point(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return h.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new h.Point(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let a=n.x,c=n.y,d=n.x,m=n.y;for(const y of t)a=Math.min(a,y.x),c=Math.min(c,y.y),d=Math.max(d,y.x),m=Math.max(m,y.y);return[new h.Point(a,c),new h.Point(d,c),new h.Point(d,m),new h.Point(a,m),new h.Point(a,c)]}}}class Po{constructor(t){this._hashName=t&&encodeURIComponent(t),h.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(n,a){let c=!1,d=null;const m=()=>{d=null,c&&(n(),d=setTimeout(m,300),c=!1)};return()=>(c=!0,d||m(),d)}(this._updateHashUnthrottled.bind(this))}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const n=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,c=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),d=Math.pow(10,c),m=Math.round(n.lng*d)/d,y=Math.round(n.lat*d)/d,_=this._map.getBearing(),x=this._map.getPitch();let T="";if(T+=t?`/${m}/${y}/${a}`:`${a}/${y}/${m}`,(_||x)&&(T+="/"+Math.round(10*_)/10),x&&(T+=`/${Math.round(x)}`),this._hashName){const w=this._hashName;let M=!1;const B=window.location.hash.slice(1).split("&").map(k=>{const D=k.split("=")[0];return D===w?(M=!0,`${D}=${T}`):k}).filter(k=>k);return M||B.push(`${w}=${T}`),`#${B.join("&")}`}return`#${T}`}_getCurrentHash(){const t=window.location.hash.replace("#","");if(this._hashName){let n;return t.split("&").map(a=>a.split("=")).forEach(a=>{a[0]===this._hashName&&(n=a)}),(n&&n[1]||"").split("/")}return t.split("/")}_onHashChange(){const t=this._getCurrentHash();if(t.length>=3&&!t.some(n=>isNaN(n))){const n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,t)}catch{}}}const Xn={linearity:.3,easing:h.bezier(0,0,.3,1)},zo=h.extend({deceleration:2500,maxSpeed:1400},Xn),ko=h.extend({deceleration:20,maxSpeed:1400},Xn),Wn=h.extend({deceleration:1e3,maxSpeed:360},Xn),Do=h.extend({deceleration:1e3,maxSpeed:90},Xn);class nr{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:h.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=h.exported.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new h.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:d}of this._inertiaBuffer)n.zoom+=d.zoomDelta||0,n.bearing+=d.bearingDelta||0,n.pitch+=d.pitchDelta||0,d.panDelta&&n.pan._add(d.panDelta),d.around&&(n.around=d.around),d.pinchAround&&(n.pinchAround=d.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){const d=Hn(n.pan.mag(),a,h.extend({},zo,t||{}));c.offset=n.pan.mult(d.amount/n.pan.mag()),c.center=this._map.transform.center,Ni(c,d)}if(n.zoom){const d=Hn(n.zoom,a,ko);c.zoom=this._map.transform.zoom+d.amount,Ni(c,d)}if(n.bearing){const d=Hn(n.bearing,a,Wn);c.bearing=this._map.transform.bearing+h.clamp(d.amount,-179,179),Ni(c,d)}if(n.pitch){const d=Hn(n.pitch,a,Do);c.pitch=this._map.transform.pitch+d.amount,Ni(c,d)}if(c.zoom||c.bearing){const d=n.pinchAround===void 0?n.around:n.pinchAround;c.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),h.extend(c,{noMoveStart:!0})}}function Ni(o,t){(!o.duration||o.durationn.unproject(_)),y=d.reduce((_,x,T,w)=>_.add(x.div(w.length)),new h.Point(0,0));super(t,{points:d,point:y,lngLats:m,lngLat:n.unproject(y),originalEvent:a}),this._defaultPrevented=!1}}class Il extends h.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,a){super(t,{originalEvent:a}),this._defaultPrevented=!1}}class Al{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Il(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Rt(t.type,this._map,t))}mouseup(t){this._map.fire(new Rt(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Rt(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Rt(t.type,this._map,t))}mouseover(t){this._map.fire(new Rt(t.type,this._map,t))}mouseout(t){this._map.fire(new Rt(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Vr(t.type,this._map,t))}touchmove(t){this._map.fire(new Vr(t.type,this._map,t))}touchend(t){this._map.fire(new Vr(t.type,this._map,t))}touchcancel(t){this._map.fire(new Vr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Cl{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Rt(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Rt(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class An{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(h.Point.convert(t),this._map.terrain)}}class Kn{constructor(t,n){this._map=t,this._tr=new An(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(te.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const a=n;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)d.fitScreenCoordinates(a,c,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(te.remove(this._box),this._box=null),te.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new h.Event(t,{originalEvent:n}))}}function sr(o,t){if(o.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${o.length}, points ${t.length}`);const n={};for(let a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),a.length===this.numTouches&&(this.centroid=function(c){const d=new h.Point(0,0);for(const m of c)d._add(m);return d.div(c.length)}(n),this.touches=sr(a,n)))}touchmove(t,n,a){if(this.aborted||!this.centroid)return;const c=sr(a,n);for(const d in this.touches){const m=c[d];(!m||m.dist(this.touches[d])>30)&&(this.aborted=!0)}}touchend(t,n,a){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class Ms{constructor(t){this.singleTap=new Ee(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,a){this.singleTap.touchstart(t,n,a)}touchmove(t,n,a){this.singleTap.touchmove(t,n,a)}touchend(t,n,a){const c=this.singleTap.touchend(t,n,a);if(c){const d=t.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(c)<30;if(d&&m||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class Yn{constructor(t){this._tr=new An(t),this._zoomIn=new Ms({numTouches:1,numTaps:2}),this._zoomOut=new Ms({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,a){this._zoomIn.touchstart(t,n,a),this._zoomOut.touchstart(t,n,a)}touchmove(t,n,a){this._zoomIn.touchmove(t,n,a),this._zoomOut.touchmove(t,n,a)}touchend(t,n,a){const c=this._zoomIn.touchend(t,n,a),d=this._zoomOut.touchend(t,n,a),m=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(c)},{originalEvent:t})}):d?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(d)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class br{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const c=n.length?n[0]:n;return!this._moved&&c.dist(a){o.mousedown=o.dragStart,o.mousemoveWindow=o.dragMove,o.mouseup=o.dragEnd,o.contextmenu=function(t){t.preventDefault()}},Bo=({enable:o,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const a=new ye({checkCorrectEvent:c=>te.mouseButton(c)===0&&c.ctrlKey||te.mouseButton(c)===2});return new br({clickTolerance:t,move:(c,d)=>({bearingDelta:(d.x-c.x)*n}),moveStateManager:a,enable:o,assignEvents:Ca})},zs=({enable:o,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const a=new ye({checkCorrectEvent:c=>te.mouseButton(c)===0&&c.ctrlKey||te.mouseButton(c)===2});return new br({clickTolerance:t,move:(c,d)=>({pitchDelta:(d.y-c.y)*n}),moveStateManager:a,enable:o,assignEvents:Ca})};class Ro{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new h.Point(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,n,a){return this._calculateTransform(t,n,a)}touchmove(t,n,a){if(this._map._cooperativeGestures&&(this._minTouches===2&&a.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,a.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(a.length0&&(this._active=!0);const c=sr(a,n),d=new h.Point(0,0),m=new h.Point(0,0);let y=0;for(const x in c){const T=c[x],w=this._touches[x];w&&(d._add(T),m._add(T.sub(w)),y++,c[x]=T)}if(this._touches=c,yMath.abs(o.x)}class xi extends ks{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,a){super.touchstart(t,n,a),this._currentTouchCount=a.length}_start(t){this._lastPoints=t,Jn(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,a){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const c=t[0].sub(this._lastPoints[0]),d=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,d,a.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+d.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,a){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,d=n.mag()>=2;if(!c&&!d)return;if(!c||!d)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const m=t.y>0==n.y>0;return Jn(t)&&Jn(n)&&m}}const Nr={panStep:100,bearingStep:15,pitchStep:10};class Oo{constructor(t){this._tr=new An(t);const n=Nr;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,a=0,c=0,d=0,m=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?a=-1:(t.preventDefault(),d=-1);break;case 39:t.shiftKey?a=1:(t.preventDefault(),d=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),m=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(a=0,c=0),{cameraAnimation:y=>{const _=this._tr;y.easeTo({duration:300,easeId:"keyboardHandler",easing:za,zoom:n?Math.round(_.zoom)+n*(t.shiftKey?2:1):_.zoom,bearing:_.bearing+a*this._bearingStep,pitch:_.pitch+c*this._pitchStep,offset:[-d*this._panStep,-m*this._panStep],center:_.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function za(o){return o*(2-o)}const Bs=4.000244140625;class ka{constructor(t,n){this._map=t,this._tr=new An(t),this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,h.bindAll(["_onTimeout"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const a=h.exported.now(),c=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,n!==0&&n%Bs==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=te.mousePos(this._el,t),a=this._tr;this._around=h.LngLat.convert(this._aroundCenter?a.center:a.unproject(n)),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const y=this._type==="wheel"&&Math.abs(this._delta)>Bs?this._wheelZoomRate:this._defaultZoomRate;let _=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&_!==0&&(_=1/_);const x=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(x*_))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,a=this._startZoom,c=this._easing;let d,m=!1;if(this._type==="wheel"&&a&&c){const y=Math.min((h.exported.now()-this._lastWheelEventTime)/200,1),_=c(y);d=h.interpolate.number(a,n,_),y<1?this._frameId||(this._frameId=!0):m=!0}else d=n,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:d-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=h.ease;if(this._prevEase){const a=this._prevEase,c=(h.exported.now()-a.start)/a.duration,d=a.easing(c+.01)-a.easing(c),m=.27/Math.sqrt(d*d+1e-4)*.01,y=Math.sqrt(.0729-m*m);n=h.bezier(m,y,.25,1)}return this._prevEase={start:h.exported.now(),duration:t,easing:n},n}reset(){this._active=!1}}class Uo{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class $i{constructor(t){this._tr=new An(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class bt{constructor(){this._tap=new Ms({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(t,n,a){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?a.length>0&&(this._swipePoint=n[0],this._swipeTouch=a[0].identifier):this._tap.touchstart(t,n,a))}touchmove(t,n,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const c=n[0],d=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:d/128}}}else this._tap.touchmove(t,n,a)}touchend(t,n,a){this._tapTime?this._swipePoint&&a.length===0&&this.reset():this._tap.touchend(t,n,a)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Rs{constructor(t,n,a){this._el=t,this._mousePan=n,this._touchPan=a}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Da{constructor(t,n,a){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=a}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Vo{constructor(t,n,a,c){this._el=t,this._touchZoom=n,this._touchRotate=a,this._tapDragZoom=c,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Qn=o=>o.zoom||o.drag||o.pitch||o.rotate;class No extends h.Event{}function La(o){return o.panDelta&&o.panDelta.mag()||o.zoomDelta||o.bearingDelta||o.pitchDelta}class ar{constructor(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nr(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),h.bindAll(["handleEvent","handleWindowEvent"],this);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[c,d,m]of this._listeners)te.addEventListener(c,d,c===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[t,n,a]of this._listeners)te.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(t){const n=this._map,a=n.getCanvasContainer();this._add("mapEvent",new Al(n,t));const c=n.boxZoom=new Kn(n,t);this._add("boxZoom",c);const d=new Yn(n),m=new $i(n);n.doubleClickZoom=new Uo(m,d),this._add("tapZoom",d),this._add("clickZoom",m);const y=new bt;this._add("tapDragZoom",y);const _=n.touchPitch=new xi(n);this._add("touchPitch",_);const x=Bo(t),T=zs(t);n.dragRotate=new Da(t,x,T),this._add("mouseRotate",x,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const w=(({enable:Z,clickTolerance:J})=>{const O=new ye({checkCorrectEvent:K=>te.mouseButton(K)===0&&!K.ctrlKey});return new br({clickTolerance:J,move:(K,ee)=>({around:ee,panDelta:ee.sub(K)}),activateOnStart:!0,moveStateManager:O,enable:Z,assignEvents:Ca})})(t),M=new Ro(t,n);n.dragPan=new Rs(a,w,M),this._add("mousePan",w),this._add("touchPan",M,["touchZoom","touchRotate"]);const B=new Pa,k=new Ma;n.touchZoomRotate=new Vo(a,k,B,y),this._add("touchRotate",B,["touchPan","touchZoom"]),this._add("touchZoom",k,["touchPan","touchRotate"]);const D=n.scrollZoom=new ka(n,this);this._add("scrollZoom",D,["mousePan"]);const U=n.keyboard=new Oo(n);this._add("keyboard",U),this._add("blockableMapEvent",new Cl(n));for(const Z of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[Z]&&n[Z].enable(t[Z])}_add(t,n,a){this._handlers.push({handlerName:t,handler:n,allowed:a}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Qn(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,a){for(const c in t)if(c!==a&&(!n||n.indexOf(c)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const n=[];for(const a of t)this._el.contains(a.target)&&n.push(a);return n}handleEvent(t,n){if(t.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const a=t.type==="renderFrame"?void 0:t,c={needsRenderFrame:!1},d={},m={},y=t.touches,_=y?this._getMapTouches(y):void 0,x=_?te.touchPos(this._el,_):te.mousePos(this._el,t);for(const{handlerName:M,handler:B,allowed:k}of this._handlers){if(!B.isEnabled())continue;let D;this._blockedByActive(m,k,M)?B.reset():B[n||t.type]&&(D=B[n||t.type](t,x,_),this.mergeHandlerResult(c,d,D,M,a),D&&D.needsRenderFrame&&this._triggerRenderFrame()),(D||B.isActive())&&(m[M]=B)}const T={};for(const M in this._previousActiveHandlers)m[M]||(T[M]=a);this._previousActiveHandlers=m,(Object.keys(T).length||La(c))&&(this._changes.push([c,d,T]),this._triggerRenderFrame()),(Object.keys(m).length||La(c))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:w}=c;w&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],w(this._map))}mergeHandlerResult(t,n,a,c,d){if(!a)return;h.extend(t,a);const m={handlerName:c,originalEvent:a.originalEvent||d};a.zoomDelta!==void 0&&(n.zoom=m),a.panDelta!==void 0&&(n.drag=m),a.pitchDelta!==void 0&&(n.pitch=m),a.bearingDelta!==void 0&&(n.rotate=m)}_applyChanges(){const t={},n={},a={};for(const[c,d,m]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new h.Point(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),h.extend(n,d),h.extend(a,m);this._updateMapTransform(t,n,a),this._changes=[]}_updateMapTransform(t,n,a){const c=this._map,d=c._getTransformForUpdate(),m=c.terrain;if(!(La(t)||m&&this._terrainMovement))return this._fireEvents(n,a,!0);let{panDelta:y,zoomDelta:_,bearingDelta:x,pitchDelta:T,around:w,pinchAround:M}=t;M!==void 0&&(w=M),c._stop(!0),w=w||c.transform.centerPoint;const B=d.pointLocation(y?w.sub(y):w);x&&(d.bearing+=x),T&&(d.pitch+=T),_&&(d.zoom+=_),m?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?d.center=d.pointLocation(d.centerPoint.sub(y)):d.setLocationAtPoint(B,w):(this._terrainMovement=!0,d.freezeElevation=!0,d.setLocationAtPoint(B,w),this._map.once("moveend",()=>{d.freezeElevation=!1,this._terrainMovement=!1,d.recalculateZoom(c.terrain)})):d.setLocationAtPoint(B,w),c._applyUpdatedTransform(d),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,a,!0)}_fireEvents(t,n,a){const c=Qn(this._eventsInProgress),d=Qn(t),m={};for(const T in t){const{originalEvent:w}=t[T];this._eventsInProgress[T]||(m[`${T}start`]=w),this._eventsInProgress[T]=t[T]}!c&&d&&this._fireEvent("movestart",d.originalEvent);for(const T in m)this._fireEvent(T,m[T]);d&&this._fireEvent("move",d.originalEvent);for(const T in t){const{originalEvent:w}=t[T];this._fireEvent(T,w)}const y={};let _;for(const T in this._eventsInProgress){const{handlerName:w,originalEvent:M}=this._eventsInProgress[T];this._handlersById[w].isActive()||(delete this._eventsInProgress[T],_=n[w]||M,y[`${T}end`]=_)}for(const T in y)this._fireEvent(T,y[T]);const x=Qn(this._eventsInProgress);if(a&&(c||d)&&!x){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=M=>M!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new No("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Fs={extend:(o,...t)=>h.extend(o,...t),run(o){o()},logToElement(o,t=!1,n="log"){const a=window.document.getElementById(n);a&&(t&&(a.innerHTML=""),a.innerHTML+=`
${o}`)}};class Me extends h.Evented{constructor(t,n){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,h.bindAll(["_renderFrameCallback"],this),this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new h.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,a){return t=h.Point.convert(t).mult(-1),this.panTo(this.transform.center,h.extend({offset:t},n),a)}panTo(t,n,a){return this.easeTo(h.extend({center:t},n),a)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,a){return this.easeTo(h.extend({zoom:t},n),a)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,a){return this.easeTo(h.extend({bearing:t},n),a)}resetNorth(t,n){return this.rotateTo(0,h.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(h.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(a.zoom=h.interpolate.number(c,_,oe)),this._rotating&&(a.bearing=h.interpolate.number(d,x,oe)),this._pitching&&(a.pitch=h.interpolate.number(m,T,oe)),this._padding&&(a.interpolatePadding(y,w,oe),B=a.centerPoint.add(M)),this.terrain&&!t.freezeElevation&&this._updateElevation(oe),O)a.setLocationAtPoint(O,K);else{const ce=a.zoomScale(a.zoom-c),ue=_>c?Math.min(2,J):Math.max(.5,J),le=Math.pow(ue,1-oe),be=a.unproject(U.add(Z.mult(oe*le)).mult(ce));a.setLocationAtPoint(a.renderWorldCopies?be.wrap():be,B)}this._applyUpdatedTransform(a),this._fireMoveEvents(n)},oe=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,oe)},t),this}_prepareEase(t,n,a={}){this._moving=!0,n||a.moving||this.fire(new h.Event("movestart",t)),this._zooming&&!a.zooming&&this.fire(new h.Event("zoomstart",t)),this._rotating&&!a.rotating&&this.fire(new h.Event("rotatestart",t)),this._pitching&&!a.pitching&&this.fire(new h.Event("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(t,this.terrain),this.transform.freezeElevation=!0}_updateElevation(t){const n=this.transform.getElevation(this._elevationCenter,this.terrain);if(t<1&&n!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(a-(n-(a*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=h.interpolate.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:a,zoom:c,pitch:d,bearing:m,elevation:y}=this.transformCameraUpdate(n);a&&(n.center=a),c!==void 0&&(n.zoom=c),d!==void 0&&(n.pitch=d),m!==void 0&&(n.bearing=m),y!==void 0&&(n.elevation=y),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new h.Event("move",t)),this._zooming&&this.fire(new h.Event("zoom",t)),this._rotating&&this.fire(new h.Event("rotate",t)),this._pitching&&this.fire(new h.Event("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const a=this._zooming,c=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new h.Event("zoomend",t)),c&&this.fire(new h.Event("rotateend",t)),d&&this.fire(new h.Event("pitchend",t)),this.fire(new h.Event("moveend",t))}flyTo(t,n){if(!t.essential&&h.exported.prefersReducedMotion){const we=h.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(we,n)}this.stop(),t=h.extend({offset:[0,0],speed:1.2,curve:1.42,easing:h.ease},t);const a=this._getTransformForUpdate(),c=this.getZoom(),d=this.getBearing(),m=this.getPitch(),y=this.getPadding(),_="zoom"in t?h.clamp(+t.zoom,a.minZoom,a.maxZoom):c,x="bearing"in t?this._normalizeBearing(t.bearing,d):d,T="pitch"in t?+t.pitch:m,w="padding"in t?t.padding:a.padding,M=a.zoomScale(_-c),B=h.Point.convert(t.offset);let k=a.centerPoint.add(B);const D=a.pointLocation(k),U=h.LngLat.convert(t.center||D);this._normalizeCenter(U);const Z=a.project(D),J=a.project(U).sub(Z);let O=t.curve;const K=Math.max(a.width,a.height),ee=K/M,oe=J.mag();if("minZoom"in t){const we=h.clamp(Math.min(t.minZoom,c,_),a.minZoom,a.maxZoom),it=K/a.zoomScale(we-c);O=Math.sqrt(it/oe*2)}const ce=O*O;function ue(we){const it=(ee*ee-K*K+(we?-1:1)*ce*ce*oe*oe)/(2*(we?ee:K)*ce*oe);return Math.log(Math.sqrt(it*it+1)-it)}function le(we){return(Math.exp(we)-Math.exp(-we))/2}function be(we){return(Math.exp(we)+Math.exp(-we))/2}const ze=ue(0);let Ve=function(we){return be(ze)/be(ze+O*we)},me=function(we){return K*((be(ze)*(le(it=ze+O*we)/be(it))-le(ze))/ce)/oe;var it},Be=(ue(1)-ze)/O;if(Math.abs(oe)<1e-6||!isFinite(Be)){if(Math.abs(K-ee)<1e-6)return this.easeTo(t,n);const we=eet.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=d!==x,this._pitching=T!==m,this._padding=!a.isPaddingEqual(w),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(U),this._ease(we=>{const it=we*Be,Pt=1/Ve(it);a.zoom=we===1?_:c+a.scaleZoom(Pt),this._rotating&&(a.bearing=h.interpolate.number(d,x,we)),this._pitching&&(a.pitch=h.interpolate.number(m,T,we)),this._padding&&(a.interpolatePadding(y,w,we),k=a.centerPoint.add(B)),this.terrain&&!t.freezeElevation&&this._updateElevation(we);const rt=we===1?U:a.unproject(Z.add(J.mult(me(it))).mult(Pt));a.setLocationAtPoint(a.renderWorldCopies?rt.wrap():rt,k),this._applyUpdatedTransform(a),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const a=this._onEaseEnd;delete this._onEaseEnd,a.call(this,n)}if(!t){const a=this.handlers;a&&a.stop(!1)}return this}_ease(t,n,a){a.animate===!1||a.duration===0?(t(1),n()):(this._easeStart=h.exported.now(),this._easeOptions=a,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((h.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,n){t=h.wrap(t,-180,180);const a=Math.abs(t-n);return Math.abs(t-360-n)180?-360:a<-180?360:0}queryTerrainElevation(t){return this.terrain?this.transform.getElevation(h.LngLat.convert(t),this.terrain)-this.transform.elevation:null}}class Le{constructor(t={}){this.options=t,h.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=te.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=te.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=te.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){te.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const a=this._map._getUIString(`AttributionControl.${n}`);t.title=a,t.setAttribute("aria-label",a)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))}_updateData(t){!t||t.sourceDataType!=="metadata"&&t.sourceDataType!=="visibility"&&t.dataType!=="style"&&t.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(c=>typeof c!="string"?"":c)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const n=this._map.style.sourceCaches;for(const c in n){const d=n[c];if(d.used||d.usedForTerrain){const m=d.getSource();m.attribution&&t.indexOf(m.attribution)<0&&t.push(m.attribution)}}t=t.filter(c=>String(c).trim()),t.sort((c,d)=>c.length-d.length),t=t.filter((c,d)=>{for(let m=d+1;m=0)return!1;return!0});const a=t.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")}}class es{constructor(t={}){this.options=t,h.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=te.create("div","maplibregl-ctrl");const n=te.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){te.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const t=this._container.children;if(t.length){const n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}}}class Ba{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,a=n?this._queue.concat(n):this._queue;for(const c of a)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const a of n)if(!a.cancelled&&(a.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Ra={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var vi=h.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class $o extends h.Evented{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const a={};for(const c of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))a[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.posMatrix=new Float64Array(16),h.ortho(c.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),this._tiles[c.key]=new Wr(c,this.tileSize));for(const c in this._tiles)a[c]||delete this._tiles[c]}freeRtt(t){for(const n in this._tiles){const a=this._tiles[n];(!t||a.tileID.equals(t)||a.tileID.isChildOf(t)||t.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const a of this._renderableTilesKeys){const c=this._tiles[a].tileID;if(c.canonical.equals(t.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16),h.ortho(d.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),n[a]=d}else if(c.canonical.isChildOf(t.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16);const m=c.canonical.z-t.canonical.z,y=c.canonical.x-(c.canonical.x>>m<>m<>m;h.ortho(d.posMatrix,0,x,0,x,0,1),h.translate(d.posMatrix,d.posMatrix,[-y*x,-_*x,0]),n[a]=d}else if(t.canonical.isChildOf(c.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16);const m=t.canonical.z-c.canonical.z,y=t.canonical.x-(t.canonical.x>>m<>m<>m;h.ortho(d.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),h.translate(d.posMatrix,d.posMatrix,[y*x,_*x,0]),h.scale(d.posMatrix,d.posMatrix,[1/2**m,1/2**m,0]),n[a]=d}}return n}getSourceTile(t,n){const a=this.sourceCache._source;let c=t.overscaledZ-this.deltaZoom;if(c>a.maxzoom&&(c=a.maxzoom),c=a.minzoom&&(!d||!d.dem);)d=this.sourceCache.getTileByID(t.scaledTo(c--).key);return d}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class or{constructor(t,n,a){this.painter=t,this.sourceCache=new $o(n),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,a,c=h.EXTENT){if(!(n>=0&&n=0&&at.canonical.z&&(t.canonical.z>=c?d=t.canonical.z-c:h.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=t.canonical.x-(t.canonical.x>>d<>d<>8<<4|d>>8,n[m+3]=0;const a=new h.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),c=new ct(t,a,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){const n=new Uint8Array(4),a=this.painter.context,c=a.gl;a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),a.bindFramebuffer.set(null);const d=n[0]+(n[2]>>4<<8),m=n[1]+((15&n[2])<<8),y=this.coordsIndex[255-n[3]],_=y&&this.sourceCache.getTileByID(y);if(!_)return null;const x=this._coordsTextureSize,T=(1<<_.tileID.canonical.z)*x;return new h.MercatorCoordinate((_.tileID.canonical.x*x+d)/T,(_.tileID.canonical.y*x+m)/T,this.getElevation(_.tileID,d,m,x))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,n=new h.Pos3dArray,a=new h.TriangleIndexArray,c=this.meshSize,d=h.EXTENT/c,m=c*c;for(let w=0;w<=c;w++)for(let M=0;M<=c;M++)n.emplaceBack(M*d,w*d,0);for(let w=0;wt.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const wr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class St{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new Ml(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(a=>!t._layers[a].isHidden(n)),this._coordsDescendingInv={};for(const a in t.sourceCaches){this._coordsDescendingInv[a]={};const c=t.sourceCaches[a].getVisibleCoordinates();for(const d of c){const m=this.terrain.sourceCache.getTerrainCoords(d);for(const y in m)this._coordsDescendingInv[a][y]||(this._coordsDescendingInv[a][y]=[]),this._coordsDescendingInv[a][y].push(m[y])}}this._coordsDescendingInvStr={};for(const a of t._order){const c=t._layers[a],d=c.source;if(wr[c.type]&&!this._coordsDescendingInvStr[d]){this._coordsDescendingInvStr[d]={};for(const m in this._coordsDescendingInv[d])this._coordsDescendingInvStr[d][m]=this._coordsDescendingInv[d][m].map(y=>y.key).sort().join()}}for(const a of this._renderableTiles)for(const c in this._coordsDescendingInvStr){const d=this._coordsDescendingInvStr[c][a.tileID.key];d&&d!==a.rttCoords[c]&&(a.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,a=this.painter,c=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(wr[n]&&(this._prevType&&wr[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!c))return!0;if(wr[this._prevType]||wr[n]&&c){this._prevType=n;const d=this._stacks.length-1,m=this._stacks[d]||[];for(const y of this._renderableTiles){if(this.pool.isFull()&&(Ia(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(y),y.rtt[d]){const x=this.pool.getObjectForId(y.rtt[d].id);if(x.stamp===y.rtt[d].stamp){this.pool.useObject(x);continue}}const _=this.pool.getOrCreateFreeObject();this.pool.useObject(_),this.pool.stampObject(_),y.rtt[d]={id:_.id,stamp:_.stamp},a.context.bindFramebuffer.set(_.fbo.framebuffer),a.context.clear({color:h.Color.transparent,stencil:0}),a.currentStencilSource=void 0;for(let x=0;x{o.touchstart=o.dragStart,o.touchmoveWindow=o.dragMove,o.touchend=o.dragEnd},Os={showCompass:!0,showZoom:!0,visualizePitch:!1};class Fa{constructor(t,n,a=!1){this._clickTolerance=10;const c=t.dragRotate._mouseRotate.getClickTolerance(),d=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=Bo({clickTolerance:c,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:y,bearingDegreesPerPixelMoved:_=.8})=>{const x=new Ps;return new br({clickTolerance:y,move:(T,w)=>({bearingDelta:(w.x-T.x)*_}),moveStateManager:x,enable:m,assignEvents:Cn})})({clickTolerance:c,enable:!0}),this.map=t,a&&(this.mousePitch=zs({clickTolerance:d,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:y,pitchDegreesPerPixelMoved:_=-.5})=>{const x=new Ps;return new br({clickTolerance:y,move:(T,w)=>({pitchDelta:(w.y-T.y)*_}),moveStateManager:x,enable:m,assignEvents:Cn})})({clickTolerance:d,enable:!0})),h.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),te.addEventListener(n,"mousedown",this.mousedown),te.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),te.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),te.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),te.disableDrag()}moveMouse(t,n){const a=this.map,{bearingDelta:c}=this.mouseRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.mousePitch){const{pitchDelta:d}=this.mousePitch.dragMove(t,n)||{};d&&a.setPitch(a.getPitch()+d)}}moveTouch(t,n){const a=this.map,{bearingDelta:c}=this.touchRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.touchPitch){const{pitchDelta:d}=this.touchPitch.dragMove(t,n)||{};d&&a.setPitch(a.getPitch()+d)}}off(){const t=this.element;te.removeEventListener(t,"mousedown",this.mousedown),te.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.removeEventListener(window,"touchend",this.touchend),te.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){te.enableDrag(),te.removeEventListener(window,"mousemove",this.mousemove),te.removeEventListener(window,"mouseup",this.mouseup),te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.removeEventListener(window,"touchend",this.touchend)}mousedown(t){this.startMouse(h.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),te.mousePos(this.element,t)),te.addEventListener(window,"mousemove",this.mousemove),te.addEventListener(window,"mouseup",this.mouseup)}mousemove(t){this.moveMouse(t,te.mousePos(this.element,t))}mouseup(t){this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()}touchstart(t){t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=te.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),te.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.addEventListener(window,"touchend",this.touchend))}touchmove(t){t.targetTouches.length!==1?this.reset():(this._lastPos=te.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))}touchend(t){t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const a=n.locationPoint(o);if(a.x>=0&&a.y>=0&&a.x<=n.width&&a.y<=n.height)break;o.lng>n.center.lng?o.lng-=360:o.lng+=360}return o}const tn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Vs(o,t,n){const a=o.classList;for(const c in tn)a.remove(`maplibregl-${n}-anchor-${c}`);a.add(`maplibregl-${n}-anchor-${t}`)}class ts extends h.Evented{constructor(t,n){if(super(),(t instanceof HTMLElement||n)&&(t=h.extend({element:t},n)),h.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=h.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=te.create("div"),this._element.setAttribute("aria-label","Map marker");const a=te.createNS("http://www.w3.org/2000/svg","svg"),c=41,d=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${c}px`),a.setAttributeNS(null,"width",`${d}px`),a.setAttributeNS(null,"viewBox",`0 0 ${d} ${c}`);const m=te.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");const y=te.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const _=te.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const x=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const J of x){const O=te.createNS("http://www.w3.org/2000/svg","ellipse");O.setAttributeNS(null,"opacity","0.04"),O.setAttributeNS(null,"cx","10.5"),O.setAttributeNS(null,"cy","5.80029008"),O.setAttributeNS(null,"rx",J.rx),O.setAttributeNS(null,"ry",J.ry),_.appendChild(O)}const T=te.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill",this._color);const w=te.createNS("http://www.w3.org/2000/svg","path");w.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),T.appendChild(w);const M=te.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"opacity","0.25"),M.setAttributeNS(null,"fill","#000000");const B=te.createNS("http://www.w3.org/2000/svg","path");B.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),M.appendChild(B);const k=te.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"transform","translate(6.0, 7.0)"),k.setAttributeNS(null,"fill","#FFFFFF");const D=te.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"transform","translate(8.0, 8.0)");const U=te.createNS("http://www.w3.org/2000/svg","circle");U.setAttributeNS(null,"fill","#000000"),U.setAttributeNS(null,"opacity","0.25"),U.setAttributeNS(null,"cx","5.5"),U.setAttributeNS(null,"cy","5.5"),U.setAttributeNS(null,"r","5.4999962");const Z=te.createNS("http://www.w3.org/2000/svg","circle");Z.setAttributeNS(null,"fill","#FFFFFF"),Z.setAttributeNS(null,"cx","5.5"),Z.setAttributeNS(null,"cy","5.5"),Z.setAttributeNS(null,"r","5.4999962"),D.appendChild(U),D.appendChild(Z),y.appendChild(_),y.appendChild(T),y.appendChild(M),y.appendChild(k),y.appendChild(D),a.appendChild(y),a.setAttributeNS(null,"height",c*this._scale+"px"),a.setAttributeNS(null,"width",d*this._scale+"px"),this._element.appendChild(a),this._offset=h.Point.convert(t&&t.offset||[0,-14])}this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",a=>{a.preventDefault()}),this._element.addEventListener("mousedown",a=>{a.preventDefault()}),Vs(this._element,this._anchor,"marker"),this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),te.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=h.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const c=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(t){const n=t.code,a=t.charCode||t.keyCode;n!=="Space"&&n!=="Enter"&&a!==32&&a!==13||this.togglePopup()}_onMapClick(t){const n=t.originalEvent.target,a=this._element;this._popup&&(n===a||a.contains(n))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_update(t){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Us(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let n="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?n=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?a="rotateX(0deg)":this._pitchAlignment==="map"&&(a=`rotateX(${this._map.getPitch()}deg)`),t&&t.type!=="moveend"||(this._pos=this._pos.round()),te.setTransform(this._element,`${tn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${n}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const c=this._map.unproject(this._pos),d=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=c.distanceTo(this._lngLat)>20*d?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(t){return this._offset=h.Point.convert(t),this._update(),this}_onMove(t){if(!this._isDragging){const n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new h.Event("dragstart"))),this.fire(new h.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new h.Event("dragend")),this._state="inactive"}_addDragHandler(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Oa={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Mn=0,rn=!1;const Ua={maxWidth:100,unit:"metric"};function Ns(o,t,n){const a=n&&n.maxWidth||100,c=o._container.clientHeight/2,d=o.unproject([0,c]),m=o.unproject([a,c]),y=d.distanceTo(m);if(n&&n.unit==="imperial"){const _=3.2808*y;_>5280?nn(t,a,_/5280,o._getUIString("ScaleControl.Miles")):nn(t,a,_,o._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?nn(t,a,y/1852,o._getUIString("ScaleControl.NauticalMiles")):y>=1e3?nn(t,a,y/1e3,o._getUIString("ScaleControl.Kilometers")):nn(t,a,y,o._getUIString("ScaleControl.Meters"))}function nn(o,t,n,a){const c=function(d){const m=Math.pow(10,`${Math.floor(d)}`.length-1);let y=d/m;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(_){const x=Math.pow(10,Math.ceil(-Math.log(_)/Math.LN10));return Math.round(_*x)/x}(y),m*y}(n);o.style.width=t*(c/n)+"px",o.innerHTML=`${c} ${a}`}const $s={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Va=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function qs(o){if(o){if(typeof o=="number"){const t=Math.round(Math.sqrt(.5*Math.pow(o,2)));return{center:new h.Point(0,0),top:new h.Point(0,o),"top-left":new h.Point(t,t),"top-right":new h.Point(-t,t),bottom:new h.Point(0,-o),"bottom-left":new h.Point(t,-t),"bottom-right":new h.Point(-t,-t),left:new h.Point(o,0),right:new h.Point(-o,0)}}if(o instanceof h.Point||Array.isArray(o)){const t=h.Point.convert(o);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:h.Point.convert(o.center||[0,0]),top:h.Point.convert(o.top||[0,0]),"top-left":h.Point.convert(o["top-left"]||[0,0]),"top-right":h.Point.convert(o["top-right"]||[0,0]),bottom:h.Point.convert(o.bottom||[0,0]),"bottom-left":h.Point.convert(o["bottom-left"]||[0,0]),"bottom-right":h.Point.convert(o["bottom-right"]||[0,0]),left:h.Point.convert(o.left||[0,0]),right:h.Point.convert(o.right||[0,0])}}return qs(new h.Point(0,0))}const js=vt,Zs={setRTLTextPlugin:h.setRTLTextPlugin,getRTLTextPluginStatus:h.getRTLTextPluginStatus,Map:class extends Me{constructor(o){var t;if(h.PerformanceUtils.mark(h.PerformanceMarkers.create),(o=h.extend({},qo,o)).minZoom!=null&&o.maxZoom!=null&&o.minZoom>o.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(o.minPitch!=null&&o.maxPitch!=null&&o.minPitch>o.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(o.minPitch!=null&&o.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(o.maxPitch!=null&&o.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Cs(o.minZoom,o.maxZoom,o.minPitch,o.maxPitch,o.renderWorldCopies),{bearingSnap:o.bearingSnap}),this._interactive=o.interactive,this._cooperativeGestures=o.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=o.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=o.preserveDrawingBuffer,this._antialias=o.antialias,this._trackResize=o.trackResize,this._bearingSnap=o.bearingSnap,this._refreshExpiredTiles=o.refreshExpiredTiles,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=o.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=o.collectResourceTiming,this._renderTaskQueue=new Ba,this._controls=[],this._mapId=h.uniqueId(),this._locale=h.extend({},Ra,o.locale),this._clickTolerance=o.clickTolerance,this._pixelRatio=(t=o.pixelRatio)!==null&&t!==void 0?t:devicePixelRatio,this.transformCameraUpdate=o.transformCameraUpdate,this._imageQueueHandle=mi.addThrottleControl(()=>this.isMoving()),this._requestManager=new _t(o.transformRequest),typeof o.container=="string"){if(this._container=document.getElementById(o.container),!this._container)throw new Error(`Container '${o.container}' not found.`)}else{if(!(o.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=o.container}if(o.maxBounds&&this.setMaxBounds(o.maxBounds),h.bindAll(["_onWindowOnline","_onMapScroll","_cooperativeGesturesOnWheel","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let n=!1;this._resizeObserver=new ResizeObserver(a=>{n?this._trackResize&&this.resize(a)._update():n=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ar(this,o),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=o.hash&&new Po(typeof o.hash=="string"&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,h.extend({},o.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=o.localIdeographFontFamily,this._validateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new Le({customAttribution:o.customAttribution})),o.maplibreLogo&&this.addControl(new es,o.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new h.Event(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new h.Event(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new h.Event("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(o,t){if(t===void 0&&(t=o.getDefaultPosition?o.getDefaultPosition():"top-right"),!o||!o.onAdd)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=o.onAdd(this);this._controls.push(o);const a=this._controlPositions[t];return t.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this}removeControl(o){if(!o||!o.onRemove)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(o);return t>-1&&this._controls.splice(t,1),o.onRemove(this),this}hasControl(o){return this._controls.indexOf(o)>-1}calculateCameraOptionsFromTo(o,t,n,a){return a==null&&this.terrain&&(a=this.transform.getElevation(n,this.terrain)),super.calculateCameraOptionsFromTo(o,t,n,a)}resize(o){var t;const n=this._containerDimensions(),a=n[0],c=n[1];this._resizeCanvas(a,c,this.getPixelRatio()),this.transform.resize(a,c),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,c),this.painter.resize(a,c,this.getPixelRatio());const d=!this._moving;return d&&(this.stop(),this.fire(new h.Event("movestart",o)).fire(new h.Event("move",o))),this.fire(new h.Event("resize",o)),d&&this.fire(new h.Event("moveend",o)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(o){const[t,n]=this._containerDimensions();this._pixelRatio=o,this._resizeCanvas(t,n,o),this.painter.resize(t,n,o)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(o){return this.transform.setMaxBounds(Yt.convert(o)),this._update()}setMinZoom(o){if((o=o??-2)>=-2&&o<=this.transform.maxZoom)return this.transform.minZoom=o,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=o,this._update(),this.getZoom()>o&&this.setZoom(o),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(o){if((o=o??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(o>=0&&o<=this.transform.maxPitch)return this.transform.minPitch=o,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(o>=this.transform.minPitch)return this.transform.maxPitch=o,this._update(),this.getPitch()>o&&this.setPitch(o),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(o){return this.transform.renderWorldCopies=o,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(o){return this._cooperativeGestures=o,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(o){return this.transform.locationPoint(h.LngLat.convert(o),this.style&&this.terrain)}unproject(o){return this.transform.pointLocation(h.Point.convert(o),this.terrain)}isMoving(){var o;return this._moving||((o=this.handlers)===null||o===void 0?void 0:o.isMoving())}isZooming(){var o;return this._zooming||((o=this.handlers)===null||o===void 0?void 0:o.isZooming())}isRotating(){var o;return this._rotating||((o=this.handlers)===null||o===void 0?void 0:o.isRotating())}_createDelegatedListener(o,t,n){if(o==="mouseenter"||o==="mouseover"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:d=>{const m=this.getLayer(t)?this.queryRenderedFeatures(d.point,{layers:[t]}):[];m.length?a||(a=!0,n.call(this,new Rt(o,this,d.originalEvent,{features:m}))):a=!1},mouseout:()=>{a=!1}}}}if(o==="mouseleave"||o==="mouseout"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:m=>{(this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[]).length?a=!0:a&&(a=!1,n.call(this,new Rt(o,this,m.originalEvent)))},mouseout:m=>{a&&(a=!1,n.call(this,new Rt(o,this,m.originalEvent)))}}}}{const a=c=>{const d=this.getLayer(t)?this.queryRenderedFeatures(c.point,{layers:[t]}):[];d.length&&(c.features=d,n.call(this,c),delete c.features)};return{layer:t,listener:n,delegates:{[o]:a}}}}on(o,t,n){if(n===void 0)return super.on(o,t);const a=this._createDelegatedListener(o,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[o]=this._delegatedListeners[o]||[],this._delegatedListeners[o].push(a);for(const c in a.delegates)this.on(c,a.delegates[c]);return this}once(o,t,n){if(n===void 0)return super.once(o,t);const a=this._createDelegatedListener(o,t,n);for(const c in a.delegates)this.once(c,a.delegates[c]);return this}off(o,t,n){return n===void 0?super.off(o,t):(this._delegatedListeners&&this._delegatedListeners[o]&&(a=>{const c=this._delegatedListeners[o];for(let d=0;dthis._updateStyle(o,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!o)),o?(this.style=new ei(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof o=="string"?this.style.loadURL(o,t,n):this.style.loadJSON(o,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ei(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(o,t){if(typeof o=="string"){const n=this._requestManager.transformRequest(o,ot.Style);h.getJSON(n,(a,c)=>{a?this.fire(new h.ErrorEvent(a)):c&&this._updateDiff(c,t)})}else typeof o=="object"&&this._updateDiff(o,t)}_updateDiff(o,t){try{this.style.setState(o,t)&&this._update(!0)}catch(n){h.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(o,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():h.warnOnce("There is no style added to the map.")}addSource(o,t){return this._lazyInitEmptyStyle(),this.style.addSource(o,t),this._update(!0)}isSourceLoaded(o){const t=this.style&&this.style.sourceCaches[o];if(t!==void 0)return t.loaded();this.fire(new h.ErrorEvent(new Error(`There is no source with ID '${o}'`)))}setTerrain(o){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),o){const t=this.style.sourceCaches[o.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${o.source}`);for(const n in this.style._layers){const a=this.style._layers[n];a.type==="hillshade"&&a.source===o.source&&h.warnOnce("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new or(this.painter,t,o),this.painter.renderToTexture=new St(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId===o.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.updateElevation(this.terrain);return this.fire(new h.Event("terrain",{terrain:o})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){const o=this.style&&this.style.sourceCaches;for(const t in o){const n=o[t]._tiles;for(const a in n){const c=n[a];if(c.state!=="loaded"&&c.state!=="errored")return!1}}return!0}addSourceType(o,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(o,t,n)}removeSource(o){return this.style.removeSource(o),this._update(!0)}getSource(o){return this.style.getSource(o)}addImage(o,t,{pixelRatio:n=1,sdf:a=!1,stretchX:c,stretchY:d,content:m}={}){if(this._lazyInitEmptyStyle(),t instanceof HTMLImageElement||h.isImageBitmap(t)){const{width:y,height:_,data:x}=h.exported.getImageData(t);this.style.addImage(o,{data:new h.RGBAImage({width:y,height:_},x),pixelRatio:n,stretchX:c,stretchY:d,content:m,sdf:a,version:0})}else{if(t.width===void 0||t.height===void 0)return this.fire(new h.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:y,height:_,data:x}=t,T=t;this.style.addImage(o,{data:new h.RGBAImage({width:y,height:_},new Uint8Array(x)),pixelRatio:n,stretchX:c,stretchY:d,content:m,sdf:a,version:0,userImage:T}),T.onAdd&&T.onAdd(this,o)}}}updateImage(o,t){const n=this.style.getImage(o);if(!n)return this.fire(new h.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=t instanceof HTMLImageElement||h.isImageBitmap(t)?h.exported.getImageData(t):t,{width:c,height:d,data:m}=a;if(c===void 0||d===void 0)return this.fire(new h.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(c!==n.data.width||d!==n.data.height)return this.fire(new h.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const y=!(t instanceof HTMLImageElement||h.isImageBitmap(t));n.data.replace(m,y),this.style.updateImage(o,n)}getImage(o){return this.style.getImage(o)}hasImage(o){return o?!!this.style.getImage(o):(this.fire(new h.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(o){this.style.removeImage(o)}loadImage(o,t){mi.getImage(this._requestManager.transformRequest(o,ot.Image),t)}listImages(){return this.style.listImages()}addLayer(o,t){return this._lazyInitEmptyStyle(),this.style.addLayer(o,t),this._update(!0)}moveLayer(o,t){return this.style.moveLayer(o,t),this._update(!0)}removeLayer(o){return this.style.removeLayer(o),this._update(!0)}getLayer(o){return this.style.getLayer(o)}setLayerZoomRange(o,t,n){return this.style.setLayerZoomRange(o,t,n),this._update(!0)}setFilter(o,t,n={}){return this.style.setFilter(o,t,n),this._update(!0)}getFilter(o){return this.style.getFilter(o)}setPaintProperty(o,t,n,a={}){return this.style.setPaintProperty(o,t,n,a),this._update(!0)}getPaintProperty(o,t){return this.style.getPaintProperty(o,t)}setLayoutProperty(o,t,n,a={}){return this.style.setLayoutProperty(o,t,n,a),this._update(!0)}getLayoutProperty(o,t){return this.style.getLayoutProperty(o,t)}setGlyphs(o,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(o,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(o,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(o,t,n,a=>{a||this._update(!0)}),this}removeSprite(o){return this._lazyInitEmptyStyle(),this.style.removeSprite(o),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(o,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(o,t,n=>{n||this._update(!0)}),this}setLight(o,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(o,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(o,t){return this.style.setFeatureState(o,t),this._update()}removeFeatureState(o,t){return this.style.removeFeatureState(o,t),this._update()}getFeatureState(o){return this.style.getFeatureState(o)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let o=0,t=0;return this._container&&(o=this._container.clientWidth||400,t=this._container.clientHeight||300),[o,t]}_setupContainer(){const o=this._container;o.classList.add("maplibregl-map");const t=this._canvasContainer=te.create("div","maplibregl-canvas-container",o);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=te.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const n=this._containerDimensions();this._resizeCanvas(n[0],n[1],this.getPixelRatio());const a=this._controlContainer=te.create("div","maplibregl-control-container",o),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{c[d]=te.create("div",`maplibregl-ctrl-${d} `,a)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_cooperativeGesturesOnWheel(o){this._onCooperativeGesture(o,o[this._metaKey],1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=te.create("div","maplibregl-cooperative-gesture-screen",this._container);let o=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(o=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=` +
${o}
+
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
+ `,this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){te.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(o,t,n){this._canvas.width=n*o,this._canvas.height=n*t,this._canvas.style.width=`${o}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const o={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{t={requestedAttributes:o},a&&(t.statusMessage=a.statusMessage,t.type=a.type)},{once:!0});const n=this._canvas.getContext("webgl2",o)||this._canvas.getContext("webgl",o);if(!n){const a="Failed to initialize WebGL";throw t?(t.message=a,new Error(JSON.stringify(t))):new Error(a)}this.painter=new Mo(n,this.transform),Kt.testSupport(n)}_contextLost(o){o.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new h.Event("webglcontextlost",{originalEvent:o}))}_contextRestored(o){this._setupPainter(),this.resize(),this._update(),this.fire(new h.Event("webglcontextrestored",{originalEvent:o}))}_onMapScroll(o){if(o.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(o,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(o){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||o,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(o){return this._update(),this._renderTaskQueue.add(o)}_cancelRenderFrame(o){this._renderTaskQueue.remove(o)}_render(o){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(o),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,d=h.exported.now();this.style.zoomHistory.update(c,d);const m=new h.EvaluationParameters(c,{now:d,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),y=m.crossFadingFactor();y===1&&y===this._crossFadingFactor||(n=!0,this._crossFadingFactor=y),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new h.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.load),this.fire(new h.Event("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new h.Event("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var o;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),mi.removeThrottleControl(this._imageQueueHandle),(o=this._resizeObserver)===null||o===void 0||o.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),te.remove(this._canvasContainer),te.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),h.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new h.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=h.exported.frame(o=>{h.PerformanceUtils.frame(o),this._frame=null,this._render(o)}))}_onWindowOnline(){this._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(o){this._showTileBoundaries!==o&&(this._showTileBoundaries=o,this._update())}get showPadding(){return!!this._showPadding}set showPadding(o){this._showPadding!==o&&(this._showPadding=o,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(o){this._showCollisionBoxes!==o&&(this._showCollisionBoxes=o,o?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(o){this._showOverdrawInspector!==o&&(this._showOverdrawInspector=o,this._update())}get repaint(){return!!this._repaint}set repaint(o){this._repaint!==o&&(this._repaint=o,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(o){this._vertices=o,this._update()}get version(){return Ft}getCameraTargetElevation(){return this.transform.elevation}},NavigationControl:class{constructor(o){this.options=h.extend({},Os,o),this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(h.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),te.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),te.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(h.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=te.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const o=this._map.getZoom(),t=o===this._map.getMaxZoom(),n=o===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=o}onAdd(o){return this._map=o,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Fa(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){te.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(o,t){const n=te.create("button",o,this._container);return n.type="button",n.addEventListener("click",t),n}_setButtonTitle(o,t){const n=this._map._getUIString(`NavigationControl.${t}`);o.title=n,o.setAttribute("aria-label",n)}},GeolocateControl:class extends h.Evented{constructor(o){super(),this.options=h.extend({},Oa,o),h.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(o){return this._map=o,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,n=!1){lr===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(a=>{lr=a.state!=="denied",t(lr)}).catch(()=>{lr=!!window.navigator.geolocation,t(lr)}):(lr=!!window.navigator.geolocation,t(lr)):t(lr)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),te.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Mn=0,rn=!1}_isOutOfMapMaxBounds(o){const t=this._map.getMaxBounds(),n=o.coords;return t&&(n.longitudet.getEast()||n.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(o){if(this._map){if(this._isOutOfMapMaxBounds(o))return this._setErrorState(),this.fire(new h.Event("outofmaxbounds",o)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=o,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(o),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(o),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new h.Event("geolocate",o)),this._finish()}}_updateCamera(o){const t=new h.LngLat(o.coords.longitude,o.coords.latitude),n=o.coords.accuracy,a=this._map.getBearing(),c=h.extend({bearing:a},this.options.fitBoundsOptions),d=Yt.fromLngLat(t,n);this._map.fitBounds(d,c,{geolocateSource:!0})}_updateMarker(o){if(o){const t=new h.LngLat(o.coords.longitude,o.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=o.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const o=this._map.getBounds(),t=o.getSouthEast(),n=o.getNorthEast(),a=t.distanceTo(n),c=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(o){if(this._map){if(this.options.trackUserLocation)if(o.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(o.code===3&&rn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new h.Event("error",o)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(o){if(this._map){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=te.create("button","maplibregl-ctrl-geolocate",this._container),te.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",o===!1){h.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=te.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ts(this._dotElement),this._circleElement=te.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ts({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||t.originalEvent&&t.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new h.Event("trackuserlocationend")))})}}trigger(){if(!this._setup)return h.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new h.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Mn--,rn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new h.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new h.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let o;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Mn++,Mn>1?(o={maximumAge:6e5,timeout:0},rn=!0):(o=this.options.positionOptions,rn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,o)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Le,LogoControl:es,ScaleControl:class{constructor(o){this.options=h.extend({},Ua,o),h.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Ns(this._map,this._container,this.options)}onAdd(o){return this._map=o,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-scale",o.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){te.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(o){this.options.unit=o,Ns(this._map,this._container,this.options)}},FullscreenControl:class extends h.Evented{constructor(o={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,o&&o.container&&(o.container instanceof HTMLElement?this._container=o.container:h.warnOnce("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(o){return this._map=o,this._container||(this._container=this._map.getContainer()),this._controlContainer=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){te.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const o=this._fullscreenButton=te.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);te.create("span","maplibregl-ctrl-icon",o).setAttribute("aria-hidden","true"),o.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const o=this._getTitle();this._fullscreenButton.setAttribute("aria-label",o),this._fullscreenButton.title=o}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new h.Event("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new h.Event("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},TerrainControl:class{constructor(o){this.options=o,h.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(o){return this._map=o,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=te.create("button","maplibregl-ctrl-terrain",this._container),te.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){te.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends h.Evented{constructor(o){super(),this.options=h.extend(Object.create($s),o),h.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(o){return this._map&&this.remove(),this._map=o,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new h.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&te.remove(this._content),this._container&&(te.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new h.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=h.LngLat.convert(o),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(o){return this.setDOMContent(document.createTextNode(o))}setHTML(o){const t=document.createDocumentFragment(),n=document.createElement("body");let a;for(n.innerHTML=o;a=n.firstChild,a;)t.appendChild(a);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(o){return this.options.maxWidth=o,this._update(),this}setDOMContent(o){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=te.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(o),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(o){this._container&&this._container.classList.add(o)}removeClassName(o){this._container&&this._container.classList.remove(o)}setOffset(o){return this.options.offset=o,this._update(),this}toggleClassName(o){if(this._container)return this._container.classList.toggle(o)}_createCloseButton(){this.options.closeButton&&(this._closeButton=te.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(o){this._update(o.point)}_onMouseMove(o){this._update(o.point)}_onDrag(o){this._update(o.point)}_update(o){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=te.create("div","maplibregl-popup",this._map.getContainer()),this._tip=te.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(d=>this._container.classList.add(d)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Us(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!o))return;const t=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);let n=this.options.anchor;const a=qs(this.options.offset);if(!n){const d=this._container.offsetWidth,m=this._container.offsetHeight;let y;y=t.y+a.bottom.ythis._map.transform.height-m?["bottom"]:[],t.xthis._map.transform.width-d/2&&y.push("right"),n=y.length===0?"bottom":y.join("-")}const c=t.add(a[n]).round();te.setTransform(this._container,`${tn[n]} translate(${c.x}px,${c.y}px)`),Vs(this._container,n,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const o=this._container.querySelector(Va);o&&o.focus()}_onClose(){this.remove()}},Marker:ts,Style:ei,LngLat:h.LngLat,LngLatBounds:Yt,Point:h.Point,MercatorCoordinate:h.MercatorCoordinate,Evented:h.Evented,AJAXError:h.AJAXError,config:h.config,CanvasSource:ie,GeoJSONSource:mr,ImageSource:Fi,RasterDEMTileSource:Dr,RasterTileSource:Xr,VectorTileSource:dn,VideoSource:fn,prewarm:function(){gn().acquire(Kr)},clearPrewarmedResources:function(){const o=ii;o&&(o.isPreloaded()&&o.numActive()===1?(o.release(Kr),ii=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return js},get workerCount(){return de.workerCount},set workerCount(o){de.workerCount=o},get maxParallelImageRequests(){return h.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(o){h.config.MAX_PARALLEL_IMAGE_REQUESTS=o},get workerUrl(){return h.config.WORKER_URL},set workerUrl(o){h.config.WORKER_URL=o},addProtocol(o,t){h.config.REGISTERED_PROTOCOLS[o]=t},removeProtocol(o){delete h.config.REGISTERED_PROTOCOLS[o]}};return Fs.extend(Zs,{isSafari:h.isSafari,getPerformanceMetrics:h.PerformanceUtils.getPerformanceMetrics}),Zs});var Qi=ht;return Qi})})(eu);var qp=eu.exports;const iu=$p(qp);function jp(Je,Ke,Xe){Xe===void 0&&(Xe={});var Ye={type:"Feature"};return(Xe.id===0||Xe.id)&&(Ye.id=Xe.id),Xe.bbox&&(Ye.bbox=Xe.bbox),Ye.properties=Ke||{},Ye.geometry=Je,Ye}function pl(Je,Ke,Xe){if(Xe===void 0&&(Xe={}),!Je)throw new Error("coordinates is required");if(!Array.isArray(Je))throw new Error("coordinates must be an Array");if(Je.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Qh(Je[0])||!Qh(Je[1]))throw new Error("coordinates must contain numbers");var Ye={type:"Point",coordinates:Je};return jp(Ye,Ke,Xe)}function Zp(Je,Ke){Ke===void 0&&(Ke={});var Xe={type:"FeatureCollection"};return Ke.id&&(Xe.id=Ke.id),Ke.bbox&&(Xe.bbox=Ke.bbox),Xe.features=Je,Xe}function Qh(Je){return!isNaN(Je)&&Je!==null&&!Array.isArray(Je)}function ru(Je,Ke,Xe){if(Je!==null)for(var Ye,ht,jt,Qi,h,vt,te,Kt=0,Ae=0,Li,er=Je.type,Cr=er==="FeatureCollection",Mr=er==="Feature",pr=Cr?Je.features.length:1,ot=0;otXe[0]&&(Ke[0]=Xe[0]),Ke[1]>Xe[1]&&(Ke[1]=Xe[1]),Ke[2]MIERUNE, under CC BY. Data by OpenStreetMap contributors, under ODbL."}},layers:[{id:"MIERUNEMAP",type:"raster",source:"MIERUNEMAP",minzoom:0,maxzoom:18}]},center:[139.767,35.681],zoom:11});ra.addControl(new iu.NavigationControl({visualizePitch:!0}));ra.on("load",function(){const Je=Zp([pl([139.7594,35.6865]),pl([139.7692,35.6665]),pl([139.7812,35.6849])]);ra.addSource("FeaturesPoint",{type:"geojson",data:Je}),ra.addLayer({id:"FeaturesPoint",type:"circle",source:"FeaturesPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#1253A4","circle-stroke-width":5,"circle-stroke-opacity":.8,"circle-color":"#1253A4","circle-radius":5,"circle-opacity":.5}});const Ke=Gp(Je);ra.addSource("CenterPoint",{type:"geojson",data:Ke}),ra.addLayer({id:"CenterPoint",type:"circle",source:"CenterPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#8DCF3F","circle-stroke-width":10,"circle-stroke-opacity":.8,"circle-color":"#8DCF3F","circle-radius":10,"circle-opacity":.5}})}); diff --git a/docs/assets/index-c3ae4bcd.css b/docs/assets/index-c3ae4bcd.css new file mode 100644 index 0000000..99d0eaa --- /dev/null +++ b/docs/assets/index-c3ae4bcd.css @@ -0,0 +1 @@ +html,body{height:100%;padding:0;margin:0}#map{z-index:0;height:100%}.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999} diff --git a/docs/assets/index.361518a2.js b/docs/assets/index.361518a2.js deleted file mode 100644 index 496ee88..0000000 --- a/docs/assets/index.361518a2.js +++ /dev/null @@ -1,504 +0,0 @@ -const hp=function(){const Je=document.createElement("link").relList;if(Je&&Je.supports&&Je.supports("modulepreload"))return;for(const ct of document.querySelectorAll('link[rel="modulepreload"]'))Qe(ct);new MutationObserver(ct=>{for(const Nt of ct)if(Nt.type==="childList")for(const Ui of Nt.addedNodes)Ui.tagName==="LINK"&&Ui.rel==="modulepreload"&&Qe(Ui)}).observe(document,{childList:!0,subtree:!0});function Ze(ct){const Nt={};return ct.integrity&&(Nt.integrity=ct.integrity),ct.referrerpolicy&&(Nt.referrerPolicy=ct.referrerpolicy),ct.crossorigin==="use-credentials"?Nt.credentials="include":ct.crossorigin==="anonymous"?Nt.credentials="omit":Nt.credentials="same-origin",Nt}function Qe(ct){if(ct.ep)return;ct.ep=!0;const Nt=Ze(ct);fetch(ct.href,Nt)}};hp();var up=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},xh={exports:{}};(function(lt,Je){(function(Ze,Qe){lt.exports=Qe()})(up,function(){var Ze,Qe,ct;function Nt(h,zt){if(!Ze)Ze=zt;else if(!Qe)Qe=zt;else{var Qt="var sharedChunk = {}; ("+Ze+")(sharedChunk); ("+Qe+")(sharedChunk);",mi={};Ze(mi),ct=zt(mi),typeof window!="undefined"&&(ct.workerUrl=window.URL.createObjectURL(new Blob([Qt],{type:"text/javascript"})))}}Nt(["exports"],function(h){var zt=Qt;function Qt(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}function mi(i,e,r,a){const s=new zt(i,e,r,a);return function(u){return s.solve(u)}}Qt.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var s=this.sampleCurveX(r)-i;if(Math.abs(s)s?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};const Ne=mi(.25,.1,.25,1);function ne(i,e,r){return Math.min(r,Math.max(e,i))}function Yi(i,e,r){const a=r-e,s=((i-e)%a+a)%a+e;return s===e?r:s}function oi(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let zr=1;function Ji(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function si(i,e,r){const a={};for(const s in i)a[s]=e.call(r||this,i[s],s,i);return a}function Qi(i,e,r){const a={};for(const s in i)e.call(r||this,i[s],s,i)&&(a[s]=i[s]);return a}function et(i){return Array.isArray(i)?i.map(et):typeof i=="object"&&i?si(i,et):i}const zi={};function wt(i){zi[i]||(typeof console!="undefined"&&console.warn(i),zi[i]=!0)}function li(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function mr(i){let e=0;for(let r,a,s=0,u=i.length,p=u-1;s@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,s,u)=>{const p=s||u;return e[a]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let en,Sr,fr=null;function zn(i){if(fr==null){const e=i.navigator?i.navigator.userAgent:null;fr=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return fr}function ir(i){return typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap}const Tr={now:typeof performance!="undefined"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){const r=window.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=i.width,r.height=i.height,a.drawImage(i,0,0,i.width,i.height),a.getImageData(-e,-e,i.width+2*e,i.height+2*e)},resolveURL:i=>(en||(en=document.createElement("a")),en.href=i,en.href),hardwareConcurrency:typeof navigator!="undefined"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Sr==null&&(Sr=matchMedia("(prefers-reduced-motion: reduce)")),Sr.matches)}};var De=rr;function rr(i,e){this.x=i,this.y=e}rr.prototype={clone:function(){return new rr(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),s=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},rr.convert=function(i){return i instanceof rr?i:Array.isArray(i)?new rr(i[0],i[1]):i};const gr={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},_r="mapbox-tiles";let Pi,Ir,Ar=500,nr=50;function yr(){typeof caches=="undefined"||Pi||(Pi=caches.open(_r))}let Cr=1/0;const Mi={supported:!1,testSupport:function(i){!tn&&or&&(Qn?Sn(i):ar=i)}};let ar,or,tn=!1,Qn=!1;function Sn(i){const e=i.createTexture();i.bindTexture(i.TEXTURE_2D,e);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,or),i.isContextLost())return;Mi.supported=!0}catch{}i.deleteTexture(e),tn=!0}typeof document!="undefined"&&(or=document.createElement("img"),or.onload=function(){ar&&Sn(ar),ar=null,Qn=!0},or.onerror=function(){tn=!0,ar=null},or.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const ea={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(ea);class $t extends Error{constructor(e,r,a,s){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=s}}const xr=er()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function Tn(i,e){const r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:xr(),signal:r.signal});let s=!1,u=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),((p,m,g)=>{if(u)return;const x=Date.now();fetch(a).then(w=>w.ok?((z,T,A)=>{(i.type==="arrayBuffer"?z.arrayBuffer():i.type==="json"?z.json():z.text()).then(C=>{u||(T&&A&&function(O,V,X){if(yr(),!Pi)return;const K={status:V.status,statusText:V.statusText,headers:new Headers};V.headers.forEach((ie,le)=>K.headers.set(le,ie));const W=tr(V.headers.get("Cache-Control")||"");W["no-store"]||(W["max-age"]&&K.headers.set("Expires",new Date(X+1e3*W["max-age"]).toUTCString()),new Date(K.headers.get("Expires")).getTime()-X<42e4||function(ie,le){if(Ir===void 0)try{new Response(new ReadableStream),Ir=!0}catch{Ir=!1}Ir?le(ie.body):ie.blob().then(le)}(V,ie=>{const le=new Response(ie,K);yr(),Pi&&Pi.then(oe=>oe.put(function(Ee){const Ae=Ee.indexOf("?");return Ae<0?Ee:Ee.slice(0,Ae)}(O.url),le)).catch(oe=>wt(oe.message))}))}(a,T,A),s=!0,e(null,C,z.headers.get("Cache-Control"),z.headers.get("Expires")))}).catch(C=>{u||e(new Error(C.message))})})(w,null,x):w.blob().then(z=>e(new $t(w.status,w.statusText,i.url,z)))).catch(w=>{w.code!==20&&e(new Error(w.message))})})(),{cancel:()=>{u=!0,s||r.abort()}}}const kr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(er()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!er()){const a=i.url.substring(0,i.url.indexOf("://"));return(gr.REGISTERED_PROTOCOLS[a]||Tn)(i,e)}}if(!(/^file:/.test(r=i.url)||/^file:/.test(xr())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Tn(i,e);if(er()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(a,s){const u=new XMLHttpRequest;u.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(u.responseType="arraybuffer");for(const p in a.headers)u.setRequestHeader(p,a.headers[p]);return a.type==="json"&&(u.responseType="text",u.setRequestHeader("Accept","application/json")),u.withCredentials=a.credentials==="include",u.onerror=()=>{s(new Error(u.statusText))},u.onload=()=>{if((u.status>=200&&u.status<300||u.status===0)&&u.response!==null){let p=u.response;if(a.type==="json")try{p=JSON.parse(u.response)}catch(m){return s(m)}s(null,p,u.getResponseHeader("Cache-Control"),u.getResponseHeader("Expires"))}else{const p=new Blob([u.response],{type:u.getResponseHeader("Content-Type")});s(new $t(u.status,u.statusText,a.url,p))}},u.send(a.body),{cancel:()=>u.abort()}}(i,e)},Ni=function(i,e){return kr(oi(i,{type:"arrayBuffer"}),e)};function ta(i){const e=window.document.createElement("a");return e.href=i,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}const sr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let $i,qi;$i=[],qi=0;const In=function(i,e){if(Mi.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),qi>=gr.MAX_PARALLEL_IMAGE_REQUESTS){const u={requestParameters:i,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return $i.push(u),u}qi++;let r=!1;const a=()=>{if(!r)for(r=!0,qi--;$i.length&&qi{a(),u?e(u):p&&function(x,w){typeof createImageBitmap=="function"?function(z,T){const A=new Blob([new Uint8Array(z)],{type:"image/png"});createImageBitmap(A).then(C=>{T(null,C)}).catch(C=>{T(new Error(`Could not load image because of ${C.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(x,w):function(z,T){const A=new Image;A.onload=()=>{T(null,A),URL.revokeObjectURL(A.src),A.onload=null,window.requestAnimationFrame(()=>{A.src=sr})},A.onerror=()=>T(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const C=new Blob([new Uint8Array(z)],{type:"image/png"});A.src=z.byteLength?URL.createObjectURL(C):sr}(x,w)}(p,(x,w)=>{x!=null?e(x):w!=null&&e(null,w,{cacheControl:m,expires:g})})});return{cancel:()=>{s.cancel(),a()}}};function Ke(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function Pr(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class vr{constructor(e,r={}){oi(this,r),this.type=e}}class Mr extends vr{constructor(e,r={}){super("error",oi({error:e},r))}}class An{on(e,r){return this._listeners=this._listeners||{},Ke(e,r,this._listeners),this}off(e,r){return Pr(e,r,this._listeners),Pr(e,r,this._oneTimeListeners),this}once(e,r){return this._oneTimeListeners=this._oneTimeListeners||{},Ke(e,r,this._oneTimeListeners),this}fire(e,r){typeof e=="string"&&(e=new vr(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const s=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const m of s)m.call(this,e);const u=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const m of u)Pr(a,m,this._oneTimeListeners),m.call(this,e);const p=this._eventedParent;p&&(oi(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof Mr&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var te={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},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},"*":{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:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},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:{},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_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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","property-type":"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","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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-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"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},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:"*",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}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","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-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],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-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"]},"property-type":"cross-faded"},"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"},"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:"number",default:335,minimum:0,maximum:359,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:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",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"}},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"}}};class fe{constructor(e,r,a,s){this.message=(e?`${e}: `:"")+a,s&&(this.identifier=s),r!=null&&r.__line__&&(this.line=r.__line__)}}function Dr(i){const e=i.value;return e?[new fe(i.key,e,"constants have been deprecated as of v8")]:[]}function lr(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}function pt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Si(i){if(Array.isArray(i))return i.map(Si);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Si(i[r]);return e}return pt(i)}class ei extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Lr{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[a,s]of r)this.bindings[a]=s}concat(e){return new Lr(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const ft={kind:"null"},de={kind:"number"},$e={kind:"string"},Oe={kind:"boolean"},ti={kind:"color"},Di={kind:"object"},Ve={kind:"value"},Br={kind:"collator"},Li={kind:"formatted"},cr={kind:"resolvedImage"};function Pt(i,e){return{kind:"array",itemType:i,N:e}}function dt(i){if(i.kind==="array"){const e=dt(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const Ti=[ft,de,$e,Oe,ti,Li,Di,Pt(Ve),cr];function Rr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Rr(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of Ti)if(!Rr(r,e))return null}}return`Expected ${dt(i)} but found ${dt(e)} instead.`}function Ft(i,e){return e.some(r=>r.kind===i.kind)}function Bi(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}var Ri,Cn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function rn(i){return(i=Math.round(i))<0?0:i>255?255:i}function nn(i){return rn(i[i.length-1]==="%"?parseFloat(i)/100*255:parseInt(i))}function D(i){return(e=i[i.length-1]==="%"?parseFloat(i)/100:parseFloat(i))<0?0:e>1?1:e;var e}function v(i,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?i+(e-i)*r*6:2*r<1?e:3*r<2?i+(e-i)*(2/3-r)*6:i}try{Ri={}.parseCSSColor=function(i){var e,r=i.replace(/ /g,"").toLowerCase();if(r in Cn)return Cn[r].slice();if(r[0]==="#")return r.length===4?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:r.length===7&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var a=r.indexOf("("),s=r.indexOf(")");if(a!==-1&&s+1===r.length){var u=r.substr(0,a),p=r.substr(a+1,s-(a+1)).split(","),m=1;switch(u){case"rgba":if(p.length!==4)return null;m=D(p.pop());case"rgb":return p.length!==3?null:[nn(p[0]),nn(p[1]),nn(p[2]),m];case"hsla":if(p.length!==4)return null;m=D(p.pop());case"hsl":if(p.length!==3)return null;var g=(parseFloat(p[0])%360+360)%360/360,x=D(p[1]),w=D(p[2]),z=w<=.5?w*(x+1):w+x-w*x,T=2*w-z;return[rn(255*v(T,z,g+1/3)),rn(255*v(T,z,g)),rn(255*v(T,z,g-1/3)),m];default:return null}}return null}}catch{}class E{constructor(e,r,a,s=1){this.r=e,this.g=r,this.b=a,this.a=s}static parse(e){if(!e)return;if(e instanceof E)return e;if(typeof e!="string")return;const r=Ri(e);return r?new E(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,r,a,s]=this.toArray();return`rgba(${Math.round(e)},${Math.round(r)},${Math.round(a)},${s})`}toArray(){const{r:e,g:r,b:a,a:s}=this;return s===0?[0,0,0,0]:[255*e/s,255*r/s,255*a/s,s]}}E.black=new E(0,0,0,1),E.white=new E(1,1,1,1),E.transparent=new E(0,0,0,0),E.red=new E(1,0,0,1);class k{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class L{constructor(e,r,a,s,u){this.text=e,this.image=r,this.scale=a,this.fontStack=s,this.textColor=u}}class B{constructor(e){this.sections=e}static fromString(e){return new B([new L(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof B?e:B.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const r of this.sections){if(r.image){e.push(["image",r.image.name]);continue}e.push(r.text);const a={};r.fontStack&&(a["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(a["font-scale"]=r.scale),r.textColor&&(a["text-color"]=["rgba"].concat(r.textColor.toArray())),e.push(a)}return e}}class ${constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new $({name:e,available:!1}):null}serialize(){return["image",this.name]}}function U(i,e,r,a){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function N(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof E||i instanceof k||i instanceof B||i instanceof $)return!0;if(Array.isArray(i)){for(const e of i)if(!N(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!N(i[e]))return!1;return!0}return!1}function q(i){if(i===null)return ft;if(typeof i=="string")return $e;if(typeof i=="boolean")return Oe;if(typeof i=="number")return de;if(i instanceof E)return ti;if(i instanceof k)return Br;if(i instanceof B)return Li;if(i instanceof $)return cr;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const s=q(a);if(r){if(r===s)continue;r=Ve;break}r=s}return Pt(r||Ve,e)}return Di}function Q(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof E||i instanceof B||i instanceof $?i.toString():JSON.stringify(i)}class se{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!N(e[1]))return r.error("invalid value");const a=e[1];let s=q(a);const u=r.expectedType;return s.kind!=="array"||s.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(s=u),new se(s,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof E?["rgba"].concat(this.value.toArray()):this.value instanceof B?this.value.serialize():this.value}}class Y{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Se={string:$e,number:de,boolean:Oe,object:Di};class ve{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,s=1;const u=e[0];if(u==="array"){let m,g;if(e.length>2){const x=e[1];if(typeof x!="string"||!(x in Se)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=Se[x],s++}else m=Ve;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=e[2],s++}a=Pt(m,g)}else a=Se[u];const p=[];for(;se.outputDefined())}serialize(){const e=this.type,r=[e.kind];if(e.kind==="array"){const a=e.itemType;if(a.kind==="string"||a.kind==="number"||a.kind==="boolean"){r.push(a.kind);const s=e.N;(typeof s=="number"||this.args.length>1)&&r.push(s)}}return r.concat(this.args.map(a=>a.serialize()))}}class Ie{constructor(e){this.type=Li,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const s=[];let u=!1;for(let p=1;p<=e.length-1;++p){const m=e[p];if(u&&typeof m=="object"&&!Array.isArray(m)){u=!1;let g=null;if(m["font-scale"]&&(g=r.parse(m["font-scale"],1,de),!g))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,Pt($e)),!x))return null;let w=null;if(m["text-color"]&&(w=r.parse(m["text-color"],1,ti),!w))return null;const z=s[s.length-1];z.scale=g,z.font=x,z.textColor=w}else{const g=r.parse(e[p],1,Ve);if(!g)return null;const x=g.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,s.push({content:g,scale:null,font:null,textColor:null})}}return new Ie(s)}evaluate(e){return new B(this.sections.map(r=>{const a=r.content.evaluate(e);return q(a)===cr?new L("",a,null,null,null):new L(Q(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const r of this.sections){e.push(r.content.serialize());const a={};r.scale&&(a["font-scale"]=r.scale.serialize()),r.font&&(a["text-font"]=r.font.serialize()),r.textColor&&(a["text-color"]=r.textColor.serialize()),e.push(a)}return e}}class ke{constructor(e){this.type=cr,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,$e);return a?new ke(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=$.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const tt={"to-boolean":Oe,"to-color":ti,"to-number":de,"to-string":$e};class Xe{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if((a==="to-boolean"||a==="to-string")&&e.length!==2)return r.error("Expected one argument.");const s=tt[a],u=[];for(let p=1;p4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:U(r[0],r[1],r[2],r[3]),!a))return new E(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Y(a||`Could not parse color from value '${typeof r=="string"?r:String(JSON.stringify(r))}'`)}if(this.type.kind==="number"){let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const s=Number(r);if(!isNaN(s))return s}throw new Y(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?B.fromString(Q(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?$.fromString(Q(this.args[0].evaluate(e))):Q(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Ie([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new ke(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(r=>{e.push(r.serialize())}),e}}const qe=["Unknown","Point","LineString","Polygon"];class Ue{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?qe[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 r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=E.parse(e)),r}}class Fe{constructor(e,r,a,s){this.name=e,this.type=r,this._evaluate=a,this.args=s}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,r){const a=e[0],s=Fe.definitions[a];if(!s)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const u=Array.isArray(s)?s[0]:s.type,p=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,m=p.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let g=null;for(const[x,w]of m){g=new na(r.registry,r.path,null,r.scope);const z=[];let T=!1;for(let A=1;A{return T=z,Array.isArray(T)?`(${T.map(dt).join(", ")})`:`(${dt(T.type)}...)`;var T}).join(" | "),w=[];for(let z=1;z=e[2]||i[1]<=e[1]||i[3]>=e[3])}function qa(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(r*s*Tt),Math.round(a*s*Tt)]}function Ga(i,e,r){const a=i[0]-e[0],s=i[1]-e[1],u=i[0]-r[0],p=i[1]-r[1];return a*p-u*s==0&&a*u<=0&&s*p<=0}function mt(i,e){let r=!1;for(let p=0,m=e.length;p(a=i)[1]!=(u=g[x+1])[1]>a[1]&&a[0]<(u[0]-s[0])*(a[1]-s[1])/(u[1]-s[1])+s[0]&&(r=!r)}}var a,s,u;return r}function Zs(i,e){for(let r=0;r0&&m<0||p<0&&m>0}function Xs(i,e,r){for(const x of r)for(let w=0;wr[2]){const s=.5*a;let u=i[0]-r[0]>s?-a:r[0]-i[0]>s?a:0;u===0&&(u=i[0]-r[2]>s?-a:r[2]-i[0]>s?a:0),i[0]+=u}qt(e,i)}function Zo(i,e,r,a){const s=Math.pow(2,a.z)*Tt,u=[a.x*Tt,a.y*Tt],p=[];for(const m of i)for(const g of m){const x=[g.x+u[0],g.y+u[1]];Wa(x,e,r,s),p.push(x)}return p}function Xo(i,e,r,a){const s=Math.pow(2,a.z)*Tt,u=[a.x*Tt,a.y*Tt],p=[];for(const g of i){const x=[];for(const w of g){const z=[w.x+u[0],w.y+u[1]];qt(e,z),x.push(z)}p.push(x)}if(e[2]-e[0]<=s/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const g of p)for(const x of g)Wa(x,e,r,s)}var m;return p}class Fr{constructor(e,r){this.type=Oe,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(N(e[1])){const a=e[1];if(a.type==="FeatureCollection")for(let s=0;s{e&&!ia(r)&&(e=!1)}),e}function an(i){if(i instanceof Fe&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!an(r)&&(e=!1)}),e}function kn(i,e){if(i instanceof Fe&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!kn(a,e)&&(r=!1)}),r}class ra{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const a=e[1];return r.scope.has(a)?new ra(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class na{constructor(e,r=[],a,s=new Lr,u=[]){this.registry=e,this.path=r,this.key=r.map(p=>`[${p}]`).join(""),this.scope=s,this.errors=u,this.expectedType=a}parse(e,r,a,s,u={}){return r?this.concat(r,a,s)._parse(e,u):this._parse(e,u)}_parse(e,r){function a(s,u,p){return p==="assert"?new ve(u,[s]):p==="coerce"?new Xe(u,[s]):s}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const s=e[0];if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const u=this.registry[s];if(u){let p=u.parse(e,this);if(!p)return null;if(this.expectedType){const m=this.expectedType,g=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||g.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string"){if(this.checkSubtype(m,g))return null}else p=a(p,m,r.typeAnnotation||"coerce");else p=a(p,m,r.typeAnnotation||"assert")}if(!(p instanceof se)&&p.type.kind!=="resolvedImage"&&Pn(p)){const m=new Ue;try{p=new se(p.type,p.evaluate(m))}catch(g){return this.error(g.message),null}}return p}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,a){const s=typeof e=="number"?this.path.concat(e):this.path,u=a?this.scope.concat(a):this.scope;return new na(this.registry,s,r||null,u,this.errors)}error(e,...r){const a=`${this.key}${r.map(s=>`[${s}]`).join("")}`;this.errors.push(new ei(a,e))}checkSubtype(e,r){const a=Rr(e,r);return a&&this.error(a),a}}function Pn(i){if(i instanceof ra)return Pn(i.boundExpression);if(i instanceof Fe&&i.name==="error"||i instanceof Ct||i instanceof Fr)return!1;const e=i instanceof Xe||i instanceof ve;let r=!0;return i.eachChild(a=>{r=e?r&&Pn(a):r&&a instanceof se}),!!r&&ia(i)&&kn(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function aa(i,e){const r=i.length-1;let a,s,u=0,p=r,m=0;for(;u<=p;)if(m=Math.floor((u+p)/2),a=i[m],s=i[m+1],a<=e){if(m===r||ee))throw new Y("Input is not a number.");p=m-1}return 0}class Mn{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[s,u]of a)this.labels.push(s),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,de);if(!a)return null;const s=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let p=1;p=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const z=r.parse(g,w,u);if(!z)return null;u=u||z.type,s.push([m,z])}return new Mn(u,a,s)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const s=this.input.evaluate(e);if(s<=r[0])return a[0].evaluate(e);const u=r.length;return s>=r[u-1]?a[u-1].evaluate(e):a[aa(r,s)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let r=0;r0&&e.push(this.labels[r]),e.push(this.outputs[r].serialize());return e}}function Mt(i,e,r){return i*(1-r)+e*r}var Dn=Object.freeze({__proto__:null,number:Mt,color:function(i,e,r){return new E(Mt(i.r,e.r,r),Mt(i.g,e.g,r),Mt(i.b,e.b,r),Mt(i.a,e.a,r))},array:function(i,e,r){return i.map((a,s)=>Mt(a,e[s],r))}});const Ka=.95047,Ho=1.08883,Wo=4/29,oa=6/29,Ya=3*oa*oa,Hs=Math.PI/180,Ws=180/Math.PI;function Ja(i){return i>.008856451679035631?Math.pow(i,1/3):i/Ya+Wo}function Qa(i){return i>oa?i*i*i:Ya*(i-Wo)}function eo(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function to(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Ko(i){const e=to(i.r),r=to(i.g),a=to(i.b),s=Ja((.4124564*e+.3575761*r+.1804375*a)/Ka),u=Ja((.2126729*e+.7151522*r+.072175*a)/1);return{l:116*u-16,a:500*(s-u),b:200*(u-Ja((.0193339*e+.119192*r+.9503041*a)/Ho)),alpha:i.a}}function nt(i){let e=(i.l+16)/116,r=isNaN(i.a)?e:e+i.a/500,a=isNaN(i.b)?e:e-i.b/200;return e=1*Qa(e),r=Ka*Qa(r),a=Ho*Qa(a),new E(eo(3.2404542*r-1.5371385*e-.4985314*a),eo(-.969266*r+1.8760108*e+.041556*a),eo(.0556434*r-.2040259*e+1.0572252*a),i.alpha)}function Ks(i,e,r){const a=e-i;return i+r*(a>180||a<-180?a-360*Math.round(a/360):a)}const Ln={forward:Ko,reverse:nt,interpolate:function(i,e,r){return{l:Mt(i.l,e.l,r),a:Mt(i.a,e.a,r),b:Mt(i.b,e.b,r),alpha:Mt(i.alpha,e.alpha,r)}}},Bn={forward:function(i){const{l:e,a:r,b:a}=Ko(i),s=Math.atan2(a,r)*Ws;return{h:s<0?s+360:s,c:Math.sqrt(r*r+a*a),l:e,alpha:i.a}},reverse:function(i){const e=i.h*Hs,r=i.c;return nt({l:i.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:i.alpha})},interpolate:function(i,e,r){return{h:Ks(i.h,e.h,r),c:Mt(i.c,e.c,r),l:Mt(i.l,e.l,r),alpha:Mt(i.alpha,e.alpha,r)}}};var Yo=Object.freeze({__proto__:null,lab:Ln,hcl:Bn});class fi{constructor(e,r,a,s,u){this.type=e,this.operator=r,this.interpolation=a,this.input=s,this.labels=[],this.outputs=[];for(const[p,m]of u)this.labels.push(p),this.outputs.push(m)}static interpolationFactor(e,r,a,s){let u=0;if(e.name==="exponential")u=io(r,e.base,a,s);else if(e.name==="linear")u=io(r,1,a,s);else if(e.name==="cubic-bezier"){const p=e.controlPoints;u=new zt(p[0],p[1],p[2],p[3]).solve(io(r,1,a,s))}return u}static parse(e,r){let[a,s,u,...p]=e;if(!Array.isArray(s)||s.length===0)return r.error("Expected an interpolation type expression.",1);if(s[0]==="linear")s={name:"linear"};else if(s[0]==="exponential"){const x=s[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:x}}else{if(s[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(s[0])}`,1,0);{const x=s.slice(1);if(x.length!==4||x.some(w=>typeof w!="number"||w<0||w>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:x}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,de),!u)return null;const m=[];let g=null;a==="interpolate-hcl"||a==="interpolate-lab"?g=ti:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let x=0;x=w)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',T);const C=r.parse(z,A,g);if(!C)return null;g=g||C.type,m.push([w,C])}return g.kind==="number"||g.kind==="color"||g.kind==="array"&&g.itemType.kind==="number"&&typeof g.N=="number"?new fi(g,a,s,u,m):r.error(`Type ${dt(g)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const s=this.input.evaluate(e);if(s<=r[0])return a[0].evaluate(e);const u=r.length;if(s>=r[u-1])return a[u-1].evaluate(e);const p=aa(r,s),m=fi.interpolationFactor(this.interpolation,s,r[p],r[p+1]),g=a[p].evaluate(e),x=a[p+1].evaluate(e);return this.operator==="interpolate"?Dn[this.type.kind.toLowerCase()](g,x,m):this.operator==="interpolate-hcl"?Bn.reverse(Bn.interpolate(Bn.forward(g),Bn.forward(x),m)):Ln.reverse(Ln.interpolate(Ln.forward(g),Ln.forward(x),m))}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const r=[this.operator,e,this.input.serialize()];for(let a=0;aRr(s,m.type));return new sa(p?Ve:a,u)}evaluate(e){let r,a=null,s=0;for(const u of this.args)if(s++,a=u.evaluate(e),a&&a instanceof $&&!a.available&&(r||(r=a.name),a=null,s===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class la{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let u=1;u=a.length)throw new Y(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Y(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class no{constructor(e,r){this.type=Oe,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),s=r.parse(e[2],2,Ve);return a&&s?Ft(a.type,[Oe,$e,de,ft,Ve])?new no(a,s):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${dt(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!Bi(r,["boolean","string","number","null"]))throw new Y(`Expected first argument to be of type boolean, string, number or null, but found ${dt(q(r))} instead.`);if(!Bi(a,["string","array"]))throw new Y(`Expected second argument to be of type array or string, but found ${dt(q(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class ca{constructor(e,r,a){this.type=de,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),s=r.parse(e[2],2,Ve);if(!a||!s)return null;if(!Ft(a.type,[Oe,$e,de,ft,Ve]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${dt(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,de);return u?new ca(a,s,u):null}return new ca(a,s)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!Bi(r,["boolean","string","number","null"]))throw new Y(`Expected first argument to be of type boolean, string, number or null, but found ${dt(q(r))} instead.`);if(!Bi(a,["string","array"]))throw new Y(`Expected second argument to be of type array or string, but found ${dt(q(a))} instead.`);if(this.fromIndex){const s=this.fromIndex.evaluate(e);return a.indexOf(r,s)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ao{constructor(e,r,a,s,u,p){this.inputType=e,this.type=r,this.input=a,this.cases=s,this.outputs=u,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const u={},p=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return T.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof C=="number"&&Math.floor(C)!==C)return T.error("Numeric branch labels must be integer values.");if(a){if(T.checkSubtype(a,q(C)))return null}else a=q(C);if(u[String(C)]!==void 0)return T.error("Branch labels must be unique.");u[String(C)]=p.length}const A=r.parse(z,x,s);if(!A)return null;s=s||A.type,p.push(A)}const m=r.parse(e[1],1,Ve);if(!m)return null;const g=r.parse(e[e.length-1],e.length-1,s);return g?m.type.kind!=="value"&&r.concat(1).checkSubtype(a,m.type)?null:new ao(a,s,m,u,p,g):null}evaluate(e){const r=this.input.evaluate(e);return(q(r)===this.inputType&&this.outputs[this.cases[r]]||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()}serialize(){const e=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),a=[],s={};for(const p of r){const m=s[this.cases[p]];m===void 0?(s[this.cases[p]]=a.length,a.push([this.cases[p],[p]])):a[m][1].push(p)}const u=p=>this.inputType.kind==="number"?Number(p):p;for(const[p,m]of a)e.push(m.length===1?u(m[0]):m.map(u)),e.push(this.outputs[p].serialize());return e.push(this.otherwise.serialize()),e}}class oo{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const s=[];for(let p=1;pr.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class ha{constructor(e,r,a,s){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=s}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),s=r.parse(e[2],2,de);if(!a||!s)return null;if(!Ft(a.type,[Pt(Ve),$e,Ve]))return r.error(`Expected first argument to be of type array or string, but found ${dt(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,de);return u?new ha(a.type,a,s,u):null}return new ha(a.type,a,s)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!Bi(r,["string","array"]))throw new Y(`Expected first argument to be of type array or string, but found ${dt(q(r))} instead.`);if(this.endIndex){const s=this.endIndex.evaluate(e);return r.slice(a,s)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Jo(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Qo(i,e,r,a){return a.compare(e,r)===0}function on(i,e,r){const a=i!=="=="&&i!=="!=";return class vh{constructor(u,p,m){this.type=Oe,this.lhs=u,this.rhs=p,this.collator=m,this.hasUntypedArgument=u.type.kind==="value"||p.type.kind==="value"}static parse(u,p){if(u.length!==3&&u.length!==4)return p.error("Expected two or three arguments.");const m=u[0];let g=p.parse(u[1],1,Ve);if(!g)return null;if(!Jo(m,g.type))return p.concat(1).error(`"${m}" comparisons are not supported for type '${dt(g.type)}'.`);let x=p.parse(u[2],2,Ve);if(!x)return null;if(!Jo(m,x.type))return p.concat(2).error(`"${m}" comparisons are not supported for type '${dt(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error(`Cannot compare types '${dt(g.type)}' and '${dt(x.type)}'.`);a&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new ve(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new ve(g.type,[x])));let w=null;if(u.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(w=p.parse(u[3],3,Br),!w)return null}return new vh(g,x,w)}evaluate(u){const p=this.lhs.evaluate(u),m=this.rhs.evaluate(u);if(a&&this.hasUntypedArgument){const g=q(p),x=q(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new Y(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const g=q(p),x=q(m);if(g.kind!=="string"||x.kind!=="string")return e(u,p,m)}return this.collator?r(u,p,m,this.collator.evaluate(u)):e(u,p,m)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}serialize(){const u=[i];return this.eachChild(p=>{u.push(p.serialize())}),u}}}const Ys=on("==",function(i,e,r){return e===r},Qo),Js=on("!=",function(i,e,r){return e!==r},function(i,e,r,a){return!Qo(0,e,r,a)}),Qs=on("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,a){return a.compare(e,r)>0}),tl=on("<=",function(i,e,r){return e<=r},function(i,e,r,a){return a.compare(e,r)<=0}),il=on(">=",function(i,e,r){return e>=r},function(i,e,r,a){return a.compare(e,r)>=0});class so{constructor(e,r,a,s,u){this.type=$e,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=s,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,de);if(!a)return null;const s=e[2];if(typeof s!="object"||Array.isArray(s))return r.error("NumberFormat options argument must be an object.");let u=null;if(s.locale&&(u=r.parse(s.locale,1,$e),!u))return null;let p=null;if(s.currency&&(p=r.parse(s.currency,1,$e),!p))return null;let m=null;if(s["min-fraction-digits"]&&(m=r.parse(s["min-fraction-digits"],1,de),!m))return null;let g=null;return s["max-fraction-digits"]&&(g=r.parse(s["max-fraction-digits"],1,de),!g)?null:new so(a,u,p,m,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class lo{constructor(e){this.type=de,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${dt(a.type)} instead.`):new lo(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Y(`Expected value to be of type string or array, but found ${dt(q(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(r=>{e.push(r.serialize())}),e}}const sn={"==":Ys,"!=":Js,">":el,"<":Qs,">=":il,"<=":tl,array:ve,at:ro,boolean:ve,case:oo,coalesce:sa,collator:Ct,format:Ie,image:ke,in:no,"index-of":ca,interpolate:fi,"interpolate-hcl":fi,"interpolate-lab":fi,length:lo,let:la,literal:se,match:ao,number:ve,"number-format":so,object:ve,slice:ha,step:Mn,string:ve,"to-boolean":Xe,"to-color":Xe,"to-number":Xe,"to-string":Xe,var:ra,within:Fr};function es(i,[e,r,a,s]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const u=s?s.evaluate(i):1,p=U(e,r,a,u);if(p)throw new Y(p);return new E(e/255*u,r/255*u,a/255*u,u)}function ts(i,e){return i in e}function co(i,e){const r=e[i];return r===void 0?null:r}function Or(i){return{type:i}}function is(i){return{result:"success",value:i}}function Vr(i){return{result:"error",value:i}}function ln(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function rs(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function ho(i){return!!i.expression&&i.expression.interpolated}function Re(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function ua(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function st(i){return i}function pa(i,e){const r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",s=a||!(a||i.property!==void 0),u=i.type||(ho(e)?"exponential":"interval");if(r&&((i=lr({},i)).stops&&(i.stops=i.stops.map(x=>[x[0],E.parse(x[1])])),i.default=E.parse(i.default?i.default:e.default)),i.colorSpace&&i.colorSpace!=="rgb"&&!Yo[i.colorSpace])throw new Error(`Unknown color space: ${i.colorSpace}`);let p,m,g;if(u==="exponential")p=uo;else if(u==="interval")p=da;else if(u==="categorical"){p=It,m=Object.create(null);for(const x of i.stops)m[x[0]]=x[1];g=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);p=rl}if(a){const x={},w=[];for(let A=0;AA[0]),evaluate:({zoom:A},C)=>uo({stops:z,base:i.base},e,A).evaluate(A,C)}}if(s){const x=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:x,interpolationFactor:fi.interpolationFactor.bind(void 0,x),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>p(i,e,w,m,g)}}return{kind:"source",evaluate(x,w){const z=w&&w.properties?w.properties[i.property]:void 0;return z===void 0?_t(i.default,e.default):p(i,e,z,m,g)}}}function _t(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function It(i,e,r,a,s){return _t(typeof r===s?a[r]:void 0,i.default,e.default)}function da(i,e,r){if(Re(r)!=="number")return _t(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const s=aa(i.stops.map(u=>u[0]),r);return i.stops[s][1]}function uo(i,e,r){const a=i.base!==void 0?i.base:1;if(Re(r)!=="number")return _t(i.default,e.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const u=aa(i.stops.map(w=>w[0]),r),p=function(w,z,T,A){const C=A-T,O=w-T;return C===0?0:z===1?O/C:(Math.pow(z,O)-1)/(Math.pow(z,C)-1)}(r,a,i.stops[u][0],i.stops[u+1][0]),m=i.stops[u][1],g=i.stops[u+1][1];let x=Dn[e.type]||st;if(i.colorSpace&&i.colorSpace!=="rgb"){const w=Yo[i.colorSpace];x=(z,T)=>w.reverse(w.interpolate(w.forward(z),w.forward(T),p))}return typeof m.evaluate=="function"?{evaluate(...w){const z=m.evaluate.apply(void 0,w),T=g.evaluate.apply(void 0,w);if(z!==void 0&&T!==void 0)return x(z,T,p)}}:x(m,g,p)}function rl(i,e,r){return e.type==="color"?r=E.parse(r):e.type==="formatted"?r=B.fromString(r.toString()):e.type==="resolvedImage"?r=$.fromString(r.toString()):Re(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0),_t(r,i.default,e.default)}Fe.register(sn,{error:[{kind:"error"},[$e],(i,[e])=>{throw new Y(e.evaluate(i))}],typeof:[$e,[Ve],(i,[e])=>dt(q(e.evaluate(i)))],"to-rgba":[Pt(de,4),[ti],(i,[e])=>e.evaluate(i).toArray()],rgb:[ti,[de,de,de],es],rgba:[ti,[de,de,de,de],es],has:{type:Oe,overloads:[[[$e],(i,[e])=>ts(e.evaluate(i),i.properties())],[[$e,Di],(i,[e,r])=>ts(e.evaluate(i),r.evaluate(i))]]},get:{type:Ve,overloads:[[[$e],(i,[e])=>co(e.evaluate(i),i.properties())],[[$e,Di],(i,[e,r])=>co(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Ve,[$e],(i,[e])=>co(e.evaluate(i),i.featureState||{})],properties:[Di,[],i=>i.properties()],"geometry-type":[$e,[],i=>i.geometryType()],id:[Ve,[],i=>i.id()],zoom:[de,[],i=>i.globals.zoom],"heatmap-density":[de,[],i=>i.globals.heatmapDensity||0],"line-progress":[de,[],i=>i.globals.lineProgress||0],accumulated:[Ve,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[de,Or(de),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[de,Or(de),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:de,overloads:[[[de,de],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[de],(i,[e])=>-e.evaluate(i)]]},"/":[de,[de,de],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[de,[de,de],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[de,[],()=>Math.LN2],pi:[de,[],()=>Math.PI],e:[de,[],()=>Math.E],"^":[de,[de,de],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[de,[de],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[de,[de],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[de,[de],(i,[e])=>Math.log(e.evaluate(i))],log2:[de,[de],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[de,[de],(i,[e])=>Math.sin(e.evaluate(i))],cos:[de,[de],(i,[e])=>Math.cos(e.evaluate(i))],tan:[de,[de],(i,[e])=>Math.tan(e.evaluate(i))],asin:[de,[de],(i,[e])=>Math.asin(e.evaluate(i))],acos:[de,[de],(i,[e])=>Math.acos(e.evaluate(i))],atan:[de,[de],(i,[e])=>Math.atan(e.evaluate(i))],min:[de,Or(de),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[de,Or(de),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[de,[de],(i,[e])=>Math.abs(e.evaluate(i))],round:[de,[de],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[de,[de],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[de,[de],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Oe,[$e,Ve],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Oe,[Ve],(i,[e])=>i.id()===e.value],"filter-type-==":[Oe,[$e],(i,[e])=>i.geometryType()===e.value],"filter-<":[Oe,[$e,Ve],(i,[e,r])=>{const a=i.properties()[e.value],s=r.value;return typeof a==typeof s&&a{const r=i.id(),a=e.value;return typeof r==typeof a&&r":[Oe,[$e,Ve],(i,[e,r])=>{const a=i.properties()[e.value],s=r.value;return typeof a==typeof s&&a>s}],"filter-id->":[Oe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[Oe,[$e,Ve],(i,[e,r])=>{const a=i.properties()[e.value],s=r.value;return typeof a==typeof s&&a<=s}],"filter-id-<=":[Oe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[Oe,[$e,Ve],(i,[e,r])=>{const a=i.properties()[e.value],s=r.value;return typeof a==typeof s&&a>=s}],"filter-id->=":[Oe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[Oe,[Ve],(i,[e])=>e.value in i.properties()],"filter-has-id":[Oe,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Oe,[Pt($e)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Oe,[Pt(Ve)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Oe,[$e,Pt(Ve)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Oe,[$e,Pt(Ve)],(i,[e,r])=>function(a,s,u,p){for(;u<=p;){const m=u+p>>1;if(s[m]===a)return!0;s[m]>a?p=m-1:u=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Oe,overloads:[[[Oe,Oe],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Or(Oe),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Oe,overloads:[[[Oe,Oe],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Or(Oe),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Oe,[Oe],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Oe,[$e],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[$e,[$e],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[$e,[$e],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[$e,Or(Ve),(i,e)=>e.map(r=>Q(r.evaluate(i))).join("")],"resolved-locale":[$e,[Br],(i,[e])=>e.evaluate(i).resolvedLocale()]});class po{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new Ue,this._defaultValue=r?function(a){return a.type==="color"&&ua(a.default)?new E(0,0,0,0):a.type==="color"?E.parse(a.default)||null:a.default===void 0?null:a.default}(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,s,u,p){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=s,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,s,u,p){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=s,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Y(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console!="undefined"&&console.warn(m.message)),this._defaultValue}}}function ma(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in sn}function fa(i,e){const r=new na(sn,[],e?function(s){const u={color:ti,string:$e,number:de,enum:$e,boolean:Oe,formatted:Li,resolvedImage:cr};return s.type==="array"?Pt(u[s.value]||Ve,s.length):u[s.type]}(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?is(new po(a,e)):Vr(r.errors)}class ga{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!an(r.expression)}evaluateWithoutErrorHandling(e,r,a,s,u,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,s,u,p)}evaluate(e,r,a,s,u,p){return this._styleExpression.evaluate(e,r,a,s,u,p)}}class _a{constructor(e,r,a,s){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!an(r.expression),this.interpolationType=s}evaluateWithoutErrorHandling(e,r,a,s,u,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,s,u,p)}evaluate(e,r,a,s,u,p){return this._styleExpression.evaluate(e,r,a,s,u,p)}interpolationFactor(e,r,a){return this.interpolationType?fi.interpolationFactor(this.interpolationType,e,r,a):0}}function mo(i,e){const r=fa(i,e);if(r.result==="error")return r;const a=r.value.expression,s=ia(a);if(!s&&!ln(e))return Vr([new ei("","data expressions not supported")]);const u=kn(a,["zoom"]);if(!u&&!rs(e))return Vr([new ei("","zoom expressions not supported")]);const p=ya(a);return p||u?p instanceof ei?Vr([p]):p instanceof fi&&!ho(e)?Vr([new ei("",'"interpolate" expressions cannot be used with this property')]):is(p?new _a(s?"camera":"composite",r.value,p.labels,p instanceof fi?p.interpolation:void 0):new ga(s?"constant":"source",r.value)):Vr([new ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class cn{constructor(e,r){this._parameters=e,this._specification=r,lr(this,pa(this._parameters,this._specification))}static deserialize(e){return new cn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ya(i){let e=null;if(i instanceof la)e=ya(i.result);else if(i instanceof sa){for(const r of i.args)if(e=ya(r),e)break}else(i instanceof Mn||i instanceof fi)&&i.input instanceof Fe&&i.input.name==="zoom"&&(e=i);return e instanceof ei||i.eachChild(r=>{const a=ya(r);a instanceof ei?e=a:!e&&a?e=new ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new ei("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Fi(i){const e=i.key,r=i.value,a=i.valueSpec||{},s=i.objectElementValidators||{},u=i.style,p=i.styleSpec;let m=[];const g=Re(r);if(g!=="object")return[new fe(e,r,`object expected, ${g} found`)];for(const x in r){const w=x.split(".")[0],z=a[w]||a["*"];let T;if(s[w])T=s[w];else if(a[w])T=ci;else if(s["*"])T=s["*"];else{if(!a["*"]){m.push(new fe(e,r[x],`unknown property "${x}"`));continue}T=ci}m=m.concat(T({key:(e&&`${e}.`)+x,value:r[x],valueSpec:z,style:u,styleSpec:p,object:r,objectKey:x},r))}for(const x in a)s[x]||a[x].required&&a[x].default===void 0&&r[x]===void 0&&m.push(new fe(e,r,`missing required property "${x}"`));return m}function ns(i){const e=i.value,r=i.valueSpec,a=i.style,s=i.styleSpec,u=i.key,p=i.arrayElementValidator||ci;if(Re(e)!=="array")return[new fe(u,e,`array expected, ${Re(e)} found`)];if(r.length&&e.length!==r.length)return[new fe(u,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.lengtha.maximum?[new fe(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function os(i){const e=i.valueSpec,r=pt(i.value.type);let a,s,u,p={};const m=r!=="categorical"&&i.value.property===void 0,g=!m,x=Re(i.value.stops)==="array"&&Re(i.value.stops[0])==="array"&&Re(i.value.stops[0][0])==="object",w=Fi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(A){if(r==="identity")return[new fe(A.key,A.value,'identity function may not have a "stops" property')];let C=[];const O=A.value;return C=C.concat(ns({key:A.key,value:O,valueSpec:A.valueSpec,style:A.style,styleSpec:A.styleSpec,arrayElementValidator:z})),Re(O)==="array"&&O.length===0&&C.push(new fe(A.key,O,"array must have at least one stop")),C},default:function(A){return ci({key:A.key,value:A.value,valueSpec:e,style:A.style,styleSpec:A.styleSpec})}}});return r==="identity"&&m&&w.push(new fe(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||w.push(new fe(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!ho(i.valueSpec)&&w.push(new fe(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!ln(i.valueSpec)?w.push(new fe(i.key,i.value,"property functions not supported")):m&&!rs(i.valueSpec)&&w.push(new fe(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||w.push(new fe(i.key,i.value,'"property" property is required')),w;function z(A){let C=[];const O=A.value,V=A.key;if(Re(O)!=="array")return[new fe(V,O,`array expected, ${Re(O)} found`)];if(O.length!==2)return[new fe(V,O,`array length 2 expected, length ${O.length} found`)];if(x){if(Re(O[0])!=="object")return[new fe(V,O,`object expected, ${Re(O[0])} found`)];if(O[0].zoom===void 0)return[new fe(V,O,"object stop key must have zoom")];if(O[0].value===void 0)return[new fe(V,O,"object stop key must have value")];if(u&&u>pt(O[0].zoom))return[new fe(V,O[0].zoom,"stop zoom values must appear in ascending order")];pt(O[0].zoom)!==u&&(u=pt(O[0].zoom),s=void 0,p={}),C=C.concat(Fi({key:`${V}[0]`,value:O[0],valueSpec:{zoom:{}},style:A.style,styleSpec:A.styleSpec,objectElementValidators:{zoom:as,value:T}}))}else C=C.concat(T({key:`${V}[0]`,value:O[0],valueSpec:{},style:A.style,styleSpec:A.styleSpec},O));return ma(Si(O[1]))?C.concat([new fe(`${V}[1]`,O[1],"expressions are not allowed in function stops.")]):C.concat(ci({key:`${V}[1]`,value:O[1],valueSpec:e,style:A.style,styleSpec:A.styleSpec}))}function T(A,C){const O=Re(A.value),V=pt(A.value),X=A.value!==null?A.value:C;if(a){if(O!==a)return[new fe(A.key,X,`${O} stop domain type must match previous stop domain type ${a}`)]}else a=O;if(O!=="number"&&O!=="string"&&O!=="boolean")return[new fe(A.key,X,"stop domain value must be a number, string, or boolean")];if(O!=="number"&&r!=="categorical"){let K=`number expected, ${O} found`;return ln(e)&&r===void 0&&(K+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new fe(A.key,X,K)]}return r!=="categorical"||O!=="number"||isFinite(V)&&Math.floor(V)===V?r!=="categorical"&&O==="number"&&s!==void 0&&Vnew fe(`${i.key}${a.key}`,i.value,a.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new fe(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!an(r))return[new fe(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!an(r))return[new fe(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!kn(r,["zoom","feature-state"]))return[new fe(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!ia(r))return[new fe(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function xa(i){const e=i.key,r=i.value,a=i.valueSpec,s=[];return Array.isArray(a.values)?a.values.indexOf(pt(r))===-1&&s.push(new fe(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(pt(r))===-1&&s.push(new fe(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),s}function fo(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!fo(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const ss={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function va(i){if(i==null)return{filter:()=>!0,needGeometry:!1};fo(i)||(i=Rn(i));const e=fa(i,ss);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,s)=>e.value.evaluate(r,a,{},s),needGeometry:ls(i)}}function ba(i,e){return ie?1:0}function ls(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?go(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Rn))):e==="all"?["all"].concat(i.slice(1).map(Rn)):e==="none"?["all"].concat(i.slice(1).map(Rn).map(un)):e==="in"?wa(i[1],i.slice(2)):e==="!in"?un(wa(i[1],i.slice(2))):e==="has"?Ea(i[1]):e==="!has"?un(Ea(i[1])):e!=="within"||i;var r}function go(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function wa(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(ba)]]:["filter-in-small",i,["literal",e]]}}function Ea(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function un(i){return["!",i]}function Fn(i){return fo(Si(i.value))?hn(lr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):cs(i)}function cs(i){const e=i.value,r=i.key;if(Re(e)!=="array")return[new fe(r,e,`array expected, ${Re(e)} found`)];const a=i.styleSpec;let s,u=[];if(e.length<1)return[new fe(r,e,"filter array must have at least 1 element")];switch(u=u.concat(xa({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),pt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&pt(e[1])==="$type"&&u.push(new fe(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new fe(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=Re(e[1]),s!=="string"&&u.push(new fe(`${r}[1]`,e[1],`string expected, ${s} found`)));for(let p=2;p{x in r&&e.push(new fe(a,r[x],`"${x}" is prohibited for ref layers`))}),s.layers.forEach(x=>{pt(x.id)===m&&(g=x)}),g?g.ref?e.push(new fe(a,r.ref,"ref cannot reference another ref layer")):p=pt(g.type):e.push(new fe(a,r.ref,`ref layer "${m}" not found`))}else if(p!=="background")if(r.source){const g=s.sources&&s.sources[r.source],x=g&&pt(g.type);g?x==="vector"&&p==="raster"?e.push(new fe(a,r.source,`layer "${r.id}" requires a raster source`)):x==="raster"&&p!=="raster"?e.push(new fe(a,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&p!=="hillshade"?e.push(new fe(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):p!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&g.lineMetrics||e.push(new fe(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new fe(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new fe(a,r.source,`source "${r.source}" not found`))}else e.push(new fe(a,r,'missing required property "source"'));return e=e.concat(Fi({key:a,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{"*":()=>[],type:()=>ci({key:`${a}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,object:r,objectKey:"type"}),filter:Fn,layout:g=>Fi({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{"*":x=>us(lr({layerType:p},x))}}),paint:g=>Fi({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{"*":x=>hs(lr({layerType:p},x))}})}})),e}function pn(i){const e=i.value,r=i.key,a=Re(e);return a!=="string"?[new fe(r,e,`string expected, ${a} found`)]:[]}const ds={promoteId:function({key:i,value:e}){if(Re(e)==="string")return pn({key:i,value:e});{const r=[];for(const a in e)r.push(...pn({key:`${i}.${a}`,value:e[a]}));return r}}};function Vn(i){const e=i.value,r=i.key,a=i.styleSpec,s=i.style;if(!e.type)return[new fe(r,e,'"type" is required')];const u=pt(e.type);let p;switch(u){case"vector":case"raster":case"raster-dem":return p=Fi({key:r,value:e,valueSpec:a[`source_${u.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:ds}),p;case"geojson":if(p=Fi({key:r,value:e,valueSpec:a.source_geojson,style:s,styleSpec:a,objectElementValidators:ds}),e.cluster)for(const m in e.clusterProperties){const[g,x]=e.clusterProperties[m],w=typeof g=="string"?[g,["accumulated"],["get",m]]:g;p.push(...hn({key:`${r}.${m}.map`,value:x,expressionContext:"cluster-map"})),p.push(...hn({key:`${r}.${m}.reduce`,value:w,expressionContext:"cluster-reduce"}))}return p;case"video":return Fi({key:r,value:e,valueSpec:a.source_video,style:s,styleSpec:a});case"image":return Fi({key:r,value:e,valueSpec:a.source_image,style:s,styleSpec:a});case"canvas":return[new fe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return xa({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:s,styleSpec:a})}}function Un(i){const e=i.value,r=i.styleSpec,a=r.light,s=i.style;let u=[];const p=Re(e);if(e===void 0)return u;if(p!=="object")return u=u.concat([new fe("light",e,`object expected, ${p} found`)]),u;for(const m in e){const g=m.match(/^(.*)-transition$/);u=u.concat(g&&a[g[1]]&&a[g[1]].transition?ci({key:m,value:e[m],valueSpec:r.transition,style:s,styleSpec:r}):a[m]?ci({key:m,value:e[m],valueSpec:a[m],style:s,styleSpec:r}):[new fe(m,e[m],`unknown property "${m}"`)])}return u}const gi={"*":()=>[],array:ns,boolean:function(i){const e=i.value,r=i.key,a=Re(e);return a!=="boolean"?[new fe(r,e,`boolean expected, ${a} found`)]:[]},number:as,color:function(i){const e=i.key,r=i.value,a=Re(r);return a!=="string"?[new fe(e,r,`color expected, ${a} found`)]:Ri(r)===null?[new fe(e,r,`color expected, "${r}" found`)]:[]},constants:Dr,enum:xa,filter:Fn,function:os,layer:ps,object:Fi,source:Vn,light:Un,string:pn,formatted:function(i){return pn(i).length===0?[]:hn(i)},resolvedImage:function(i){return pn(i).length===0?[]:hn(i)}};function ci(i){const e=i.value,r=i.valueSpec,a=i.styleSpec;return r.expression&&ua(pt(e))?os(i):r.expression&&ma(Si(e))?hn(i):r.type&&gi[r.type]?gi[r.type](i):Fi(lr({},i,{valueSpec:r.type?a[r.type]:r}))}function nl(i){const e=i.value,r=i.key,a=pn(i);return a.length||(e.indexOf("{fontstack}")===-1&&a.push(new fe(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new fe(r,e,'"glyphs" url must include a "{range}" token'))),a}function Ur(i,e=te){let r=[];return r=r.concat(ci({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,objectElementValidators:{glyphs:nl,"*":()=>[]}})),i.constants&&(r=r.concat(Dr({key:"constants",value:i.constants,style:i,styleSpec:e}))),ms(r)}function ms(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function dn(i){return function(...e){return ms(i.apply(this,e))}}Ur.source=dn(Vn),Ur.light=dn(Un),Ur.layer=dn(ps),Ur.filter=dn(Fn),Ur.paintProperty=dn(hs),Ur.layoutProperty=dn(us);const Nr=Ur,al=Nr.light,_o=Nr.paintProperty,ol=Nr.layoutProperty;function fs(i,e){let r=!1;if(e&&e.length)for(const a of e)i.fire(new Mr(new Error(a.message))),r=!0;return r}class $r{constructor(e,r,a){const s=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const p=new Int32Array(this.arrayBuffer);e=p[0],this.d=(r=p[1])+2*(a=p[2]);for(let g=0;g=z[C+0]&&s>=z[C+1])?(m[A]=!0,p.push(w[A])):m[A]=!1}}}}_forEachCell(e,r,a,s,u,p,m,g){const x=this._convertToCellCoord(e),w=this._convertToCellCoord(r),z=this._convertToCellCoord(a),T=this._convertToCellCoord(s);for(let A=x;A<=z;A++)for(let C=w;C<=T;C++){const O=this.d*C+A;if((!g||g(this._convertFromCellCoord(A),this._convertFromCellCoord(C),this._convertFromCellCoord(A+1),this._convertFromCellCoord(C+1)))&&u.call(this,e,r,a,s,O,p,m,g))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;const e=this.cells,r=3+this.cells.length+1+1;let a=0;for(let p=0;p=0)continue;const p=i[u];s[u]=mn[a].shallow.indexOf(u)>=0?p:Nn(p,e)}i instanceof Error&&(s.message=i.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(s.$name=a),s}throw new Error("can't serialize object of type "+typeof i)}function qr(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||yo(i)||ir(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(qr);if(typeof i=="object"){const e=i.$name||"Object";if(!mn[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=mn[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const s of Object.keys(i)){if(s==="$name")continue;const u=i[s];a[s]=mn[e].shallow.indexOf(s)>=0?u:qr(u)}return a}throw new Error("can't deserialize object of type "+typeof i)}class $n{constructor(){this.first=!0}update(e,r){const a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function xo(i){for(const e of i)if(qn(e.charCodeAt(0)))return!0;return!1}function gs(i){for(const e of i)if(!sl(e.charCodeAt(0)))return!1;return!0}function sl(i){return!(me.Arabic(i)||me["Arabic Supplement"](i)||me["Arabic Extended-A"](i)||me["Arabic Presentation Forms-A"](i)||me["Arabic Presentation Forms-B"](i))}function qn(i){return!(i!==746&&i!==747&&(i<4352||!(me["Bopomofo Extended"](i)||me.Bopomofo(i)||me["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||me["CJK Compatibility Ideographs"](i)||me["CJK Compatibility"](i)||me["CJK Radicals Supplement"](i)||me["CJK Strokes"](i)||!(!me["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||me["CJK Unified Ideographs Extension A"](i)||me["CJK Unified Ideographs"](i)||me["Enclosed CJK Letters and Months"](i)||me["Hangul Compatibility Jamo"](i)||me["Hangul Jamo Extended-A"](i)||me["Hangul Jamo Extended-B"](i)||me["Hangul Jamo"](i)||me["Hangul Syllables"](i)||me.Hiragana(i)||me["Ideographic Description Characters"](i)||me.Kanbun(i)||me["Kangxi Radicals"](i)||me["Katakana Phonetic Extensions"](i)||me.Katakana(i)&&i!==12540||!(!me["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!me["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||me["Unified Canadian Aboriginal Syllabics"](i)||me["Unified Canadian Aboriginal Syllabics Extended"](i)||me["Vertical Forms"](i)||me["Yijing Hexagram Symbols"](i)||me["Yi Syllables"](i)||me["Yi Radicals"](i))))}function _s(i){return!(qn(i)||function(e){return!!(me["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||me["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||me["Letterlike Symbols"](e)||me["Number Forms"](e)||me["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||me["Control Pictures"](e)&&e!==9251||me["Optical Character Recognition"](e)||me["Enclosed Alphanumerics"](e)||me["Geometric Shapes"](e)||me["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||me["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||me["CJK Symbols and Punctuation"](e)||me.Katakana(e)||me["Private Use Area"](e)||me["CJK Compatibility Forms"](e)||me["Small Form Variants"](e)||me["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function ys(i){return i>=1424&&i<=2303||me["Arabic Presentation Forms-A"](i)||me["Arabic Presentation Forms-B"](i)}function ll(i,e){return!(!e&&ys(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||me.Khmer(i))}function cl(i){for(const e of i)if(ys(e.charCodeAt(0)))return!0;return!1}const za="deferred",vo="loading",bo="loaded";let wo=null,hi="unavailable",br=null;const xs=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(hi="error"),wo&&wo(i)};function Eo(){fn.fire(new vr("pluginStateChange",{pluginStatus:hi,pluginURL:br}))}const fn=new An,zo=function(){return hi},Sa=function(){if(hi!==za||!br)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");hi=vo,Eo(),br&&Ni({url:br},i=>{i?xs(i):(hi=bo,Eo())})},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>hi===bo||Ii.applyArabicShaping!=null,isLoading:()=>hi===vo,setState(i){hi=i.pluginStatus,br=i.pluginURL},isParsed:()=>Ii.applyArabicShaping!=null&&Ii.processBidirectionalText!=null&&Ii.processStyledBidirectionalText!=null,getPluginURL:()=>br};class yt{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new $n,this.transition={})}isSupportedScript(e){return function(r,a){for(const s of r)if(!ll(s.charCodeAt(0),a))return!1;return!0}(e,Ii.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class Ta{constructor(e,r){this.property=e,this.value=r,this.expression=function(a,s){if(ua(a))return new cn(a,s);if(ma(a)){const u=mo(a,s);if(u.result==="error")throw new Error(u.value.map(p=>`${p.key}: ${p.message}`).join(", "));return u.value}{let u=a;return typeof a=="string"&&s.type==="color"&&(u=E.parse(a)),{kind:"constant",evaluate:()=>u}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class Ia{constructor(e){this.property=e,this.value=new Ta(e,void 0)}transitioned(e,r){return new vs(this.property,this.value,r,oi({},e.transition,this.transition),e.now)}untransitioned(){return new vs(this.property,this.value,null,{},0)}}class So{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return et(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ia(this._values[e].property)),this._values[e].value=new Ta(this._values[e].property,r===null?void 0:et(r))}getTransition(e){return et(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ia(this._values[e].property)),this._values[e].transition=et(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a);const s=this.getTransition(r);s!==void 0&&(e[`${r}-transition`]=s)}return e}transitioned(e,r){const a=new bs(this._properties);for(const s of Object.keys(this._values))a._values[s]=this._values[s].transitioned(e,r._values[s]);return a}untransitioned(){const e=new bs(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class vs{constructor(e,r,a,s,u){this.property=e,this.value=r,this.begin=u+s.delay||0,this.end=this.begin+s.duration||0,e.specification.transition&&(s.delay||s.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){const s=e.now||0,u=this.value.possiblyEvaluate(e,r,a),p=this.prior;if(p){if(s>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(s=1)return 1;const x=g*g,w=x*g;return 4*(g<.5?w:3*(g-x)+w-.75)}(m))}}return u}}class bs{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){const s=new Aa(this._properties);for(const u of Object.keys(this._values))s._values[u]=this._values[u].possiblyEvaluate(e,r,a);return s}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class hl{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return et(this._values[e].value)}setValue(e,r){this._values[e]=new Ta(this._values[e].property,r===null?void 0:et(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){const s=new Aa(this._properties);for(const u of Object.keys(this._values))s._values[u]=this._values[u].possiblyEvaluate(e,r,a);return s}}class Gi{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,s){return this.property.evaluate(this.value,this.parameters,e,r,a,s)}}class Aa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Te{constructor(e){this.specification=e}possiblyEvaluate(e,r){return e.expression.evaluate(r)}interpolate(e,r,a){const s=Dn[this.specification.type];return s?s(e,r,a):e}}class Pe{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,s){return new Gi(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,s)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new Gi(this,{kind:"constant",value:void 0},e.parameters);const s=Dn[this.specification.type];return s?new Gi(this,{kind:"constant",value:s(e.value.value,r.value.value,a)},e.parameters):e}evaluate(e,r,a,s,u,p){return e.kind==="constant"?e.value:e.evaluate(r,a,s,u,p)}}class Gn extends Pe{possiblyEvaluate(e,r,a,s){if(e.value===void 0)return new Gi(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},a,s),p=e.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,m=this._calculate(p,p,p,r);return new Gi(this,{kind:"constant",value:m},r)}if(e.expression.kind==="camera"){const u=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new Gi(this,{kind:"constant",value:u},r)}return new Gi(this,e.expression,r)}evaluate(e,r,a,s,u,p){if(e.kind==="source"){const m=e.evaluate(r,a,s,u,p);return this._calculate(m,m,m,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,s),e.evaluate({zoom:Math.floor(r.zoom)},a,s),e.evaluate({zoom:Math.floor(r.zoom)+1},a,s),r):e.value}_calculate(e,r,a,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class jn{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,s){if(e.value!==void 0){if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},a,s);return this._calculate(u,u,u,r)}return this._calculate(e.expression.evaluate(new yt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new yt(Math.floor(r.zoom),r)),e.expression.evaluate(new yt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class To{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,s){return!!e.expression.evaluate(r,null,{},a,s)}interpolate(){return!1}}class Ot{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const s=this.defaultPropertyValues[r]=new Ta(a,void 0),u=this.defaultTransitionablePropertyValues[r]=new Ia(a);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=s.possiblyEvaluate({})}}}we("DataDrivenProperty",Pe),we("DataConstantProperty",Te),we("CrossFadedDataDrivenProperty",Gn),we("CrossFadedProperty",jn),we("ColorRampProperty",To);const Gr="-transition";class ui extends An{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new hl(r.layout)),r.paint)){this._transitionablePaint=new So(r.paint);for(const a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(const a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Aa(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,a={}){r!=null&&this._validate(ol,`layers.${this.id}.layout.${e}`,e,r,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Gr)?this._transitionablePaint.getTransition(e.slice(0,-Gr.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate(_o,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(Gr))return this._transitionablePaint.setTransition(e.slice(0,-Gr.length),r||void 0),!1;{const s=this._transitionablePaint._values[e],u=s.property.specification["property-type"]==="cross-faded-data-driven",p=s.value.isDataDriven(),m=s.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const g=this._transitionablePaint._values[e].value;return g.isDataDriven()||p||u||this._handleOverridablePaintPropertyUpdate(e,m,g)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,a){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const 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&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Qi(e,(r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length))}_validate(e,r,a,s,u={}){return(!u||u.validate!==!1)&&fs(this,e.call(Nr,{key:r,layerType:this.type,objectKey:a,value:s,styleSpec:te,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof Gi&&ln(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const ul={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Zn{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class gt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Vt(i,e=1){let r=0,a=0;return{members:i.map(s=>{const u=ul[s.type].BYTES_PER_ELEMENT,p=r=ws(r,Math.max(e,u)),m=s.components||1;return a=Math.max(a,u),r+=u*m,{name:s.name,type:s.type,components:m,offset:p}}),size:ws(r,Math.max(a,e)),alignment:e}}function ws(i,e){return Math.ceil(i/e)*e}class gn extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const s=2*e;return this.int16[s+0]=r,this.int16[s+1]=a,e}}gn.prototype.bytesPerElement=4,we("StructArrayLayout2i4",gn);class Xn extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,s)}emplace(e,r,a,s,u){const p=4*e;return this.int16[p+0]=r,this.int16[p+1]=a,this.int16[p+2]=s,this.int16[p+3]=u,e}}Xn.prototype.bytesPerElement=8,we("StructArrayLayout4i8",Xn);class l extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,s,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,s,u,p)}emplace(e,r,a,s,u,p,m){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=a,this.int16[g+2]=s,this.int16[g+3]=u,this.int16[g+4]=p,this.int16[g+5]=m,e}}l.prototype.bytesPerElement=12,we("StructArrayLayout2i4i12",l);class t extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,s,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,s,u,p)}emplace(e,r,a,s,u,p,m){const g=4*e,x=8*e;return this.int16[g+0]=r,this.int16[g+1]=a,this.uint8[x+4]=s,this.uint8[x+5]=u,this.uint8[x+6]=p,this.uint8[x+7]=m,e}}t.prototype.bytesPerElement=8,we("StructArrayLayout2i4ub8",t);class n extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const s=2*e;return this.float32[s+0]=r,this.float32[s+1]=a,e}}n.prototype.bytesPerElement=8,we("StructArrayLayout2f8",n);class o extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,s,u,p,m,g,x,w){const z=this.length;return this.resize(z+1),this.emplace(z,e,r,a,s,u,p,m,g,x,w)}emplace(e,r,a,s,u,p,m,g,x,w,z){const T=10*e;return this.uint16[T+0]=r,this.uint16[T+1]=a,this.uint16[T+2]=s,this.uint16[T+3]=u,this.uint16[T+4]=p,this.uint16[T+5]=m,this.uint16[T+6]=g,this.uint16[T+7]=x,this.uint16[T+8]=w,this.uint16[T+9]=z,e}}o.prototype.bytesPerElement=20,we("StructArrayLayout10ui20",o);class c extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,s,u,p,m,g,x,w,z,T){const A=this.length;return this.resize(A+1),this.emplace(A,e,r,a,s,u,p,m,g,x,w,z,T)}emplace(e,r,a,s,u,p,m,g,x,w,z,T,A){const C=12*e;return this.int16[C+0]=r,this.int16[C+1]=a,this.int16[C+2]=s,this.int16[C+3]=u,this.uint16[C+4]=p,this.uint16[C+5]=m,this.uint16[C+6]=g,this.uint16[C+7]=x,this.int16[C+8]=w,this.int16[C+9]=z,this.int16[C+10]=T,this.int16[C+11]=A,e}}c.prototype.bytesPerElement=24,we("StructArrayLayout4i4ui4i24",c);class d extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,r,a)}emplace(e,r,a,s){const u=3*e;return this.float32[u+0]=r,this.float32[u+1]=a,this.float32[u+2]=s,e}}d.prototype.bytesPerElement=12,we("StructArrayLayout3f12",d);class f extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}f.prototype.bytesPerElement=4,we("StructArrayLayout1ul4",f);class _ extends gt{_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,r,a,s,u,p,m,g,x){const w=this.length;return this.resize(w+1),this.emplace(w,e,r,a,s,u,p,m,g,x)}emplace(e,r,a,s,u,p,m,g,x,w){const z=10*e,T=5*e;return this.int16[z+0]=r,this.int16[z+1]=a,this.int16[z+2]=s,this.int16[z+3]=u,this.int16[z+4]=p,this.int16[z+5]=m,this.uint32[T+3]=g,this.uint16[z+8]=x,this.uint16[z+9]=w,e}}_.prototype.bytesPerElement=20,we("StructArrayLayout6i1ul2ui20",_);class y extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,s,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,s,u,p)}emplace(e,r,a,s,u,p,m){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=a,this.int16[g+2]=s,this.int16[g+3]=u,this.int16[g+4]=p,this.int16[g+5]=m,e}}y.prototype.bytesPerElement=12,we("StructArrayLayout2i2i2i12",y);class b extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,s,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,s,u)}emplace(e,r,a,s,u,p){const m=4*e,g=8*e;return this.float32[m+0]=r,this.float32[m+1]=a,this.float32[m+2]=s,this.int16[g+6]=u,this.int16[g+7]=p,e}}b.prototype.bytesPerElement=16,we("StructArrayLayout2f1f2i16",b);class S extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,s)}emplace(e,r,a,s,u){const p=12*e,m=3*e;return this.uint8[p+0]=r,this.uint8[p+1]=a,this.float32[m+1]=s,this.float32[m+2]=u,e}}S.prototype.bytesPerElement=12,we("StructArrayLayout2ub2f12",S);class I extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,r,a)}emplace(e,r,a,s){const u=3*e;return this.uint16[u+0]=r,this.uint16[u+1]=a,this.uint16[u+2]=s,e}}I.prototype.bytesPerElement=6,we("StructArrayLayout3ui6",I);class P extends gt{_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,r,a,s,u,p,m,g,x,w,z,T,A,C,O,V,X){const K=this.length;return this.resize(K+1),this.emplace(K,e,r,a,s,u,p,m,g,x,w,z,T,A,C,O,V,X)}emplace(e,r,a,s,u,p,m,g,x,w,z,T,A,C,O,V,X,K){const W=24*e,ie=12*e,le=48*e;return this.int16[W+0]=r,this.int16[W+1]=a,this.uint16[W+2]=s,this.uint16[W+3]=u,this.uint32[ie+2]=p,this.uint32[ie+3]=m,this.uint32[ie+4]=g,this.uint16[W+10]=x,this.uint16[W+11]=w,this.uint16[W+12]=z,this.float32[ie+7]=T,this.float32[ie+8]=A,this.uint8[le+36]=C,this.uint8[le+37]=O,this.uint8[le+38]=V,this.uint32[ie+10]=X,this.int16[W+22]=K,e}}P.prototype.bytesPerElement=48,we("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",P);class F extends gt{_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,r,a,s,u,p,m,g,x,w,z,T,A,C,O,V,X,K,W,ie,le,oe,Ee,Ae,_e,ye,pe,be){const xe=this.length;return this.resize(xe+1),this.emplace(xe,e,r,a,s,u,p,m,g,x,w,z,T,A,C,O,V,X,K,W,ie,le,oe,Ee,Ae,_e,ye,pe,be)}emplace(e,r,a,s,u,p,m,g,x,w,z,T,A,C,O,V,X,K,W,ie,le,oe,Ee,Ae,_e,ye,pe,be,xe){const he=34*e,Me=17*e;return this.int16[he+0]=r,this.int16[he+1]=a,this.int16[he+2]=s,this.int16[he+3]=u,this.int16[he+4]=p,this.int16[he+5]=m,this.int16[he+6]=g,this.int16[he+7]=x,this.uint16[he+8]=w,this.uint16[he+9]=z,this.uint16[he+10]=T,this.uint16[he+11]=A,this.uint16[he+12]=C,this.uint16[he+13]=O,this.uint16[he+14]=V,this.uint16[he+15]=X,this.uint16[he+16]=K,this.uint16[he+17]=W,this.uint16[he+18]=ie,this.uint16[he+19]=le,this.uint16[he+20]=oe,this.uint16[he+21]=Ee,this.uint16[he+22]=Ae,this.uint32[Me+12]=_e,this.float32[Me+13]=ye,this.float32[Me+14]=pe,this.float32[Me+15]=be,this.float32[Me+16]=xe,e}}F.prototype.bytesPerElement=68,we("StructArrayLayout8i15ui1ul4f68",F);class M extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}M.prototype.bytesPerElement=4,we("StructArrayLayout1f4",M);class R extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,r,a)}emplace(e,r,a,s){const u=3*e;return this.int16[u+0]=r,this.int16[u+1]=a,this.int16[u+2]=s,e}}R.prototype.bytesPerElement=6,we("StructArrayLayout3i6",R);class G extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,r,a)}emplace(e,r,a,s){const u=4*e;return this.uint32[2*e+0]=r,this.uint16[u+2]=a,this.uint16[u+3]=s,e}}G.prototype.bytesPerElement=8,we("StructArrayLayout1ul2ui8",G);class j extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const s=2*e;return this.uint16[s+0]=r,this.uint16[s+1]=a,e}}j.prototype.bytesPerElement=4,we("StructArrayLayout2ui4",j);class H extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}H.prototype.bytesPerElement=2,we("StructArrayLayout1ui2",H);class Z extends gt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,s)}emplace(e,r,a,s,u){const p=4*e;return this.float32[p+0]=r,this.float32[p+1]=a,this.float32[p+2]=s,this.float32[p+3]=u,e}}Z.prototype.bytesPerElement=16,we("StructArrayLayout4f16",Z);class ae extends Zn{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 De(this.anchorPointX,this.anchorPointY)}}ae.prototype.size=20;class J extends _{get(e){return new ae(this,e)}}we("CollisionBoxArray",J);class ee extends Zn{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]}}ee.prototype.size=48;class ce extends P{get(e){return new ee(this,e)}}we("PlacedSymbolArray",ce);class ue extends Zn{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]}get 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 textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}ue.prototype.size=68;class re extends F{get(e){return new ue(this,e)}}we("SymbolInstanceArray",re);class ze extends M{getoffsetX(e){return this.float32[1*e+0]}}we("GlyphOffsetArray",ze);class ge extends R{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}we("SymbolLineVertexArray",ge);class Le extends Zn{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]}}Le.prototype.size=8;class Ye extends G{get(e){return new Le(this,e)}}we("FeatureIndexArray",Ye);class Ge extends gn{}class He extends gn{}class St extends l{}class Be extends t{}class it extends n{}class ht extends o{}class Xt extends c{}class _i extends d{}class Ai extends f{}class Ci extends y{}class wr extends S{}class pi extends I{}class ji extends j{}const jr=Vt([{name:"a_pos",components:2,type:"Int16"}],4),{members:yi}=jr;class rt{constructor(e=[]){this.segments=e}prepareSegment(e,r,a,s){let u=this.segments[this.segments.length-1];return e>rt.MAX_VERTEX_ARRAY_LENGTH&&wt(`Max vertices per segment is ${rt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!u||u.vertexLength+e>rt.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==s)&&(u={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},s!==void 0&&(u.sortKey=s),this.segments.push(u)),u}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,s){return new rt([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:s,vaos:{},sortKey:0}])}}function at(i,e){return 256*(i=ne(Math.floor(i),0,255))+ne(Math.floor(e),0,255)}rt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,we("SegmentVector",rt);const Dt=Vt([{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"}]);var ii={exports:{}},xt={exports:{}};xt.exports=function(i,e){var r,a,s,u,p,m,g,x;for(a=i.length-(r=3&i.length),s=e,p=3432918353,m=461845907,x=0;x>>16)*p&65535)<<16)&4294967295)<<15|g>>>17))*m+(((g>>>16)*m&65535)<<16)&4294967295)<<13|s>>>19))+((5*(s>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(g=0,r){case 3:g^=(255&i.charCodeAt(x+2))<<16;case 2:g^=(255&i.charCodeAt(x+1))<<8;case 1:s^=g=(65535&(g=(g=(65535&(g^=255&i.charCodeAt(x)))*p+(((g>>>16)*p&65535)<<16)&4294967295)<<15|g>>>17))*m+(((g>>>16)*m&65535)<<16)&4294967295}return s^=i.length,s=2246822507*(65535&(s^=s>>>16))+((2246822507*(s>>>16)&65535)<<16)&4294967295,s=3266489909*(65535&(s^=s>>>13))+((3266489909*(s>>>16)&65535)<<16)&4294967295,(s^=s>>>16)>>>0};var Zr={exports:{}};Zr.exports=function(i,e){for(var r,a=i.length,s=e^a,u=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),s=1540483477*(65535&s)+((1540483477*(s>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++u;switch(a){case 3:s^=(255&i.charCodeAt(u+2))<<16;case 2:s^=(255&i.charCodeAt(u+1))<<8;case 1:s=1540483477*(65535&(s^=255&i.charCodeAt(u)))+((1540483477*(s>>>16)&65535)<<16)}return s=1540483477*(65535&(s^=s>>>13))+((1540483477*(s>>>16)&65535)<<16),(s^=s>>>15)>>>0};var Zi=xt.exports,Ca=Zr.exports;ii.exports=Zi,ii.exports.murmur3=Zi,ii.exports.murmur2=Ca;var Io=ii.exports;class ka{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,s){this.ids.push(Es(e)),this.positions.push(r,a,s)}getPositions(e){const r=Es(e);let a=0,s=this.ids.length-1;for(;a>1;this.ids[p]>=r?s=p:a=p+1}const u=[];for(;this.ids[a]===r;)u.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return u}static serialize(e,r){const a=new Float64Array(e.ids),s=new Uint32Array(e.positions);return Xr(a,s,0,a.length-1),r&&r.push(a.buffer,s.buffer),{ids:a,positions:s}}static deserialize(e){const r=new ka;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Es(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Io(String(i))}function Xr(i,e,r,a){for(;r>1];let u=r-1,p=a+1;for(;;){do u++;while(i[u]s);if(u>=p)break;Pa(i,u,p),Pa(e,3*u,3*p),Pa(e,3*u+1,3*p+1),Pa(e,3*u+2,3*p+2)}p-r`u_${s}`),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new Ql(e,r):new _n(e,r)}}class Ma{constructor(e,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,a,s){const u=s==="u_pattern_to"?this.patternTo:s==="u_pattern_from"?this.patternFrom:s==="u_pixel_ratio_to"?this.pixelRatioTo:s==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"?new Jl(e,r):new _n(e,r)}}class Hr{constructor(e,r,a,s){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,r,a,s,u){const p=this.paintVertexArray.length,m=this.expression.evaluate(new yt(0),r,{},s,[],u);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,r,a,s){const u=this.expression.evaluate({zoom:0},a,s);this._setPaintValue(e,r,u)}_setPaintValue(e,r,a){if(this.type==="color"){const s=pl(a);for(let u=e;u`u_${m}_t`),this.type=a,this.useIntegerZoom=s,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new p}populatePaintArray(e,r,a,s,u){const p=this.expression.evaluate(new yt(this.zoom),r,{},s,[],u),m=this.expression.evaluate(new yt(this.zoom+1),r,{},s,[],u),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,p,m)}updatePaintArray(e,r,a,s){const u=this.expression.evaluate({zoom:this.zoom},a,s),p=this.expression.evaluate({zoom:this.zoom+1},a,s);this._setPaintValue(e,r,u,p)}_setPaintValue(e,r,a,s){if(this.type==="color"){const u=pl(a),p=pl(s);for(let m=e;m`#define HAS_UNIFORM_${s}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof Hr||a instanceof hr)for(let s=0;s!0){this.programConfigurations={};for(const s of e)this.programConfigurations[s.id]=new ec(s,r,a);this.needsUpload=!1,this._featureMap=new ka,this._bufferOffset=0}populatePaintArrays(e,r,a,s,u,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,s,u,p);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,s){for(const u of a)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,s)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function zh(i,e){return{"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-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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function tc(i,e,r){const a={color:{source:n,composite:Z},number:{source:M,composite:n}},s=function(u){return{"line-pattern":{source:ht,composite:ht},"fill-pattern":{source:ht,composite:ht},"fill-extrusion-pattern":{source:ht,composite:ht}}[u]}(i);return s&&s[r]||a[e][r]}we("ConstantBinder",Ao),we("CrossFadedConstantBinder",Ma),we("SourceExpressionBinder",Hr),we("CrossFadedCompositeBinder",yn),we("CompositeExpressionBinder",hr),we("ProgramConfiguration",ec,{omit:["_buffers"]}),we("ProgramConfigurationSet",Hn);var Ut=8192;const dl=Math.pow(2,14)-1,ic=-dl-1;function Wn(i){const e=Ut/i.extent,r=i.loadGeometry();for(let a=0;ap.x+1||gp.y+1)&&wt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Kn(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Wn(i):[]}}function zs(i,e,r,a,s){i.emplaceBack(2*e+(a+1)/2,2*r+(s+1)/2)}class ml{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ge,this.indexArray=new pi,this.segments=new rt,this.programConfigurations=new Hn(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){const s=this.layers[0],u=[];let p=null,m=!1;s.type==="circle"&&(p=s.layout.get("circle-sort-key"),m=!p.isConstant());for(const{feature:g,id:x,index:w,sourceLayerIndex:z}of e){const T=this.layers[0]._featureFilter.needGeometry,A=Kn(g,T);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),A,a))continue;const C=m?p.evaluate(A,{},a):void 0,O={id:x,properties:g.properties,type:g.type,sourceLayerIndex:z,index:w,geometry:T?A.geometry:Wn(g),patterns:{},sortKey:C};u.push(O)}m&&u.sort((g,x)=>g.sortKey-x.sortKey);for(const g of u){const{geometry:x,index:w,sourceLayerIndex:z}=g,T=e[w].feature;this.addFeature(g,x,w,a),r.featureIndex.insert(T,x,w,z,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,yi),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,r,a,s){for(const u of r)for(const p of u){const m=p.x,g=p.y;if(m<0||m>=Ut||g<0||g>=Ut)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=x.vertexLength;zs(this.layoutVertexArray,m,g,-1,-1),zs(this.layoutVertexArray,m,g,1,-1),zs(this.layoutVertexArray,m,g,1,1),zs(this.layoutVertexArray,m,g,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+3,w+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},s)}}function rc(i,e){for(let r=0;r1){if(fl(i,e))return!0;for(let a=0;a1?r:r.sub(e)._mult(s)._add(e))}function oc(i,e){let r,a,s,u=!1;for(let p=0;pe.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(u=!u)}return u}function Da(i,e){let r=!1;for(let a=0,s=i.length-1;ae.y!=p.y>e.y&&e.x<(p.x-u.x)*(e.y-u.y)/(p.y-u.y)+u.x&&(r=!r)}return r}function Ah(i,e,r){const a=r[0],s=r[2];if(i.xs.x&&e.x>s.x||i.ys.y&&e.y>s.y)return!1;const u=li(i,e,r[0]);return u!==li(i,e,r[1])||u!==li(i,e,r[2])||u!==li(i,e,r[3])}function Co(i,e,r){const a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Ss(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Ts(i,e,r,a,s){if(!e[0]&&!e[1])return i;const u=De.convert(e)._mult(s);r==="viewport"&&u._rotate(-a);const p=[];for(let m=0;mi.width||s.height>i.height||r.x>i.width-s.width||r.y>i.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||a.x>e.width-s.width||a.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");const p=i.data,m=e.data;for(let g=0;g{e[i.evaluationKey]=g;const x=i.expression.evaluate(e);s.data[p+m+0]=Math.floor(255*x.r/x.a),s.data[p+m+1]=Math.floor(255*x.g/x.a),s.data[p+m+2]=Math.floor(255*x.b/x.a),s.data[p+m+3]=Math.floor(255*x.a)};if(i.clips)for(let p=0,m=0;p80*r){a=u=i[0],s=p=i[1];for(var C=r;Cu&&(u=m),g>p&&(p=g);x=(x=Math.max(u-a,p-s))!==0?1/x:0}return Mo(T,A,r,a,s,x),A}function pc(i,e,r,a,s){var u,p;if(s===El(i,e,r,a)>0)for(u=e;u=e;u-=a)p=fc(u,i[u],i[u+1],p);return p&&Cs(p,p.next)&&(Lo(p),p=p.next),p}function xn(i,e){if(!i)return i;e||(e=i);var r,a=i;do if(r=!1,a.steiner||!Cs(a,a.next)&&kt(a.prev,a,a.next)!==0)a=a.next;else{if(Lo(a),(a=e=a.prev)===a.next)break;r=!0}while(r||a!==e);return e}function Mo(i,e,r,a,s,u,p){if(i){!p&&u&&function(w,z,T,A){var C=w;do C.z===null&&(C.z=bl(C.x,C.y,z,T,A)),C.prevZ=C.prev,C.nextZ=C.next,C=C.next;while(C!==w);C.prevZ.nextZ=null,C.prevZ=null,function(O){var V,X,K,W,ie,le,oe,Ee,Ae=1;do{for(X=O,O=null,ie=null,le=0;X;){for(le++,K=X,oe=0,V=0;V0||Ee>0&&K;)oe!==0&&(Ee===0||!K||X.z<=K.z)?(W=X,X=X.nextZ,oe--):(W=K,K=K.nextZ,Ee--),ie?ie.nextZ=W:O=W,W.prevZ=ie,ie=W;X=K}ie.nextZ=null,Ae*=2}while(le>1)}(C)}(i,a,s,u);for(var m,g,x=i;i.prev!==i.next;)if(m=i.prev,g=i.next,u?Fh(i,a,s,u):Rh(i))e.push(m.i/r),e.push(i.i/r),e.push(g.i/r),Lo(i),i=g.next,x=g.next;else if((i=g)===x){p?p===1?Mo(i=Oh(xn(i),e,r),e,r,a,s,u,2):p===2&&Vh(i,e,r,a,s,u):Mo(xn(i),e,r,a,s,u,1);break}}}function Rh(i){var e=i.prev,r=i,a=i.next;if(kt(e,r,a)>=0)return!1;for(var s=i.next.next;s!==i.prev;){if(Ba(e.x,e.y,r.x,r.y,a.x,a.y,s.x,s.y)&&kt(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function Fh(i,e,r,a){var s=i.prev,u=i,p=i.next;if(kt(s,u,p)>=0)return!1;for(var m=s.x>u.x?s.x>p.x?s.x:p.x:u.x>p.x?u.x:p.x,g=s.y>u.y?s.y>p.y?s.y:p.y:u.y>p.y?u.y:p.y,x=bl(s.x=x&&T&&T.z<=w;){if(z!==i.prev&&z!==i.next&&Ba(s.x,s.y,u.x,u.y,p.x,p.y,z.x,z.y)&&kt(z.prev,z,z.next)>=0||(z=z.prevZ,T!==i.prev&&T!==i.next&&Ba(s.x,s.y,u.x,u.y,p.x,p.y,T.x,T.y)&&kt(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;z&&z.z>=x;){if(z!==i.prev&&z!==i.next&&Ba(s.x,s.y,u.x,u.y,p.x,p.y,z.x,z.y)&&kt(z.prev,z,z.next)>=0)return!1;z=z.prevZ}for(;T&&T.z<=w;){if(T!==i.prev&&T!==i.next&&Ba(s.x,s.y,u.x,u.y,p.x,p.y,T.x,T.y)&&kt(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function Oh(i,e,r){var a=i;do{var s=a.prev,u=a.next.next;!Cs(s,u)&&dc(s,a,a.next,u)&&Do(s,u)&&Do(u,s)&&(e.push(s.i/r),e.push(a.i/r),e.push(u.i/r),Lo(a),Lo(a.next),a=i=u),a=a.next}while(a!==i);return xn(a)}function Vh(i,e,r,a,s,u){var p=i;do{for(var m=p.next.next;m!==p.prev;){if(p.i!==m.i&&Gh(p,m)){var g=mc(p,m);return p=xn(p,p.next),g=xn(g,g.next),Mo(p,e,r,a,s,u),void Mo(g,e,r,a,s,u)}m=m.next}p=p.next}while(p!==i)}function Uh(i,e){return i.x-e.x}function Nh(i,e){var r=function(u,p){var m,g=p,x=u.x,w=u.y,z=-1/0;do{if(w<=g.y&&w>=g.next.y&&g.next.y!==g.y){var T=g.x+(w-g.y)*(g.next.x-g.x)/(g.next.y-g.y);if(T<=x&&T>z){if(z=T,T===x){if(w===g.y)return g;if(w===g.next.y)return g.next}m=g.x=g.x&&g.x>=O&&x!==g.x&&Ba(wm.x||g.x===m.x&&$h(m,g)))&&(m=g,X=A)),g=g.next;while(g!==C);return m}(i,e);if(!r)return e;var a=mc(r,i),s=xn(r,r.next);return xn(a,a.next),e===r?s:e}function $h(i,e){return kt(i.prev,i,e.prev)<0&&kt(e.next,i,i.next)<0}function bl(i,e,r,a,s){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-r)*s)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-a)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function qh(i){var e=i,r=i;do(e.x=0&&(i-p)*(a-m)-(r-p)*(e-m)>=0&&(r-p)*(u-m)-(s-p)*(a-m)>=0}function Gh(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,a){var s=r;do{if(s.i!==r.i&&s.next.i!==r.i&&s.i!==a.i&&s.next.i!==a.i&&dc(s,s.next,r,a))return!0;s=s.next}while(s!==r);return!1}(i,e)&&(Do(i,e)&&Do(e,i)&&function(r,a){var s=r,u=!1,p=(r.x+a.x)/2,m=(r.y+a.y)/2;do s.y>m!=s.next.y>m&&s.next.y!==s.y&&p<(s.next.x-s.x)*(m-s.y)/(s.next.y-s.y)+s.x&&(u=!u),s=s.next;while(s!==r);return u}(i,e)&&(kt(i.prev,i,e.prev)||kt(i,e.prev,e))||Cs(i,e)&&kt(i.prev,i,i.next)>0&&kt(e.prev,e,e.next)>0)}function kt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function Cs(i,e){return i.x===e.x&&i.y===e.y}function dc(i,e,r,a){var s=Ps(kt(i,e,r)),u=Ps(kt(i,e,a)),p=Ps(kt(r,a,i)),m=Ps(kt(r,a,e));return s!==u&&p!==m||!(s!==0||!ks(i,r,e))||!(u!==0||!ks(i,a,e))||!(p!==0||!ks(r,i,a))||!(m!==0||!ks(r,e,a))}function ks(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function Ps(i){return i>0?1:i<0?-1:0}function Do(i,e){return kt(i.prev,i,i.next)<0?kt(i,e,i.next)>=0&&kt(i,i.prev,e)>=0:kt(i,e,i.prev)<0||kt(i,i.next,e)<0}function mc(i,e){var r=new wl(i.i,i.x,i.y),a=new wl(e.i,e.x,e.y),s=i.next,u=e.prev;return i.next=e,e.prev=i,r.next=s,s.prev=r,a.next=r,r.prev=a,u.next=a,a.prev=u,a}function fc(i,e,r,a){var s=new wl(i,e,r);return a?(s.next=a.next,s.prev=a,a.next.prev=s,a.next=s):(s.prev=s,s.next=s),s}function Lo(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function wl(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function El(i,e,r,a){for(var s=0,u=e,p=r-a;u0&&r.holes.push(a+=i[s-1].length)}return r};var gc=vl.exports;function jh(i,e,r,a,s){_c(i,e,r||0,a||i.length-1,s||Zh)}function _c(i,e,r,a,s){for(;a>r;){if(a-r>600){var u=a-r+1,p=e-r+1,m=Math.log(u),g=.5*Math.exp(2*m/3),x=.5*Math.sqrt(m*g*(u-g)/u)*(p-u/2<0?-1:1);_c(i,e,Math.max(r,Math.floor(e-p*g/u+x)),Math.min(a,Math.floor(e+(u-p)*g/u+x)),s)}var w=i[e],z=r,T=a;for(Bo(i,r,e),s(i[a],w)>0&&Bo(i,r,a);z0;)T--}s(i[r],w)===0?Bo(i,r,T):Bo(i,++T,a),T<=e&&(r=T+1),e<=T&&(a=T-1)}}function Bo(i,e,r){var a=i[e];i[e]=i[r],i[r]=a}function Zh(i,e){return ie?1:0}function zl(i,e){const r=i.length;if(r<=1)return[i];const a=[];let s,u;for(let p=0;p1)for(let p=0;pr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new He,this.indexArray=new pi,this.indexArray2=new ji,this.programConfigurations=new Hn(e.layers,e.zoom),this.segments=new rt,this.segments2=new rt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=Sl("fill",this.layers,r);const s=this.layers[0].layout.get("fill-sort-key"),u=!s.isConstant(),p=[];for(const{feature:m,id:g,index:x,sourceLayerIndex:w}of e){const z=this.layers[0]._featureFilter.needGeometry,T=Kn(m,z);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),T,a))continue;const A=u?s.evaluate(T,{},a,r.availableImages):void 0,C={id:g,properties:m.properties,type:m.type,sourceLayerIndex:w,index:x,geometry:z?T.geometry:Wn(m),patterns:{},sortKey:A};p.push(C)}u&&p.sort((m,g)=>m.sortKey-g.sortKey);for(const m of p){const{geometry:g,index:x,sourceLayerIndex:w}=m;if(this.hasPattern){const z=Tl("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(z)}else this.addFeature(m,g,x,a,{});r.featureIndex.insert(e[x].feature,g,x,w,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const s of this.patternFeatures)this.addFeature(s,s.geometry,s.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bh),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())}addFeature(e,r,a,s,u){for(const p of zl(r,500)){let m=0;for(const A of p)m+=A.length;const g=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=g.vertexLength,w=[],z=[];for(const A of p){if(A.length===0)continue;A!==p[0]&&z.push(w.length/2);const C=this.segments2.prepareSegment(A.length,this.layoutVertexArray,this.indexArray2),O=C.vertexLength;this.layoutVertexArray.emplaceBack(A[0].x,A[0].y),this.indexArray2.emplaceBack(O+A.length-1,O),w.push(A[0].x),w.push(A[0].y);for(let V=1;V>3}if(s--,a===1||a===2)u+=i.readSVarint(),p+=i.readSVarint(),a===1&&(e&&m.push(e),e=[]),e.push(new Jh(u,p));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&m.push(e),m},Ra.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,a=0,s=0,u=0,p=1/0,m=-1/0,g=1/0,x=-1/0;i.pos>3}if(a--,r===1||r===2)(s+=i.readSVarint())m&&(m=s),(u+=i.readSVarint())x&&(x=u);else if(r!==7)throw new Error("unknown command "+r)}return[p,g,m,x]},Ra.prototype.toGeoJSON=function(i,e,r){var a,s,u=this.extent*Math.pow(2,r),p=this.extent*i,m=this.extent*e,g=this.loadGeometry(),x=Ra.types[this.type];function w(A){for(var C=0;C>3;s=p===1?a.readString():p===2?a.readFloat():p===3?a.readDouble():p===4?a.readVarint64():p===5?a.readVarint():p===6?a.readSVarint():p===7?a.readBoolean():null}return s}(r))}vc.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new tu(this._pbf,e,this.extent,this._keys,this._values)};var ru=xc;function nu(i,e,r){if(i===3){var a=new ru(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}vn.VectorTile=function(i,e){this.layers=i.readFields(nu,{},e)},vn.VectorTileFeature=yc,vn.VectorTileLayer=xc;const au=vn.VectorTileFeature.types,Al=Math.pow(2,13);function Ro(i,e,r,a,s,u,p,m){i.emplaceBack(e,r,2*Math.floor(a*Al)+p,s*Al*2,u*Al*2,Math.round(m))}class Cl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new St,this.indexArray=new pi,this.programConfigurations=new Hn(e.layers,e.zoom),this.segments=new rt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.features=[],this.hasPattern=Sl("fill-extrusion",this.layers,r);for(const{feature:s,id:u,index:p,sourceLayerIndex:m}of e){const g=this.layers[0]._featureFilter.needGeometry,x=Kn(s,g);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),x,a))continue;const w={id:u,sourceLayerIndex:m,index:p,geometry:g?x.geometry:Wn(s),properties:s.properties,type:s.type,patterns:{}};this.hasPattern?this.features.push(Tl("fill-extrusion",this.layers,w,this.zoom,r)):this.addFeature(w,w.geometry,p,a,{}),r.featureIndex.insert(s,w.geometry,p,m,this.index,!0)}}addFeatures(e,r,a){for(const s of this.features){const{geometry:u}=s;this.addFeature(s,u,s.index,r,a)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yh),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,r,a,s,u){for(const p of zl(r,500)){let m=0;for(const A of p)m+=A.length;let g=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const A of p){if(A.length===0||su(A))continue;let C=0;for(let O=0;O=1){const X=A[O-1];if(!ou(V,X)){g.vertexLength+4>rt.MAX_VERTEX_ARRAY_LENGTH&&(g=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const K=V.sub(X)._perp()._unit(),W=X.dist(V);C+W>32768&&(C=0),Ro(this.layoutVertexArray,V.x,V.y,K.x,K.y,0,0,C),Ro(this.layoutVertexArray,V.x,V.y,K.x,K.y,0,1,C),C+=W,Ro(this.layoutVertexArray,X.x,X.y,K.x,K.y,0,0,C),Ro(this.layoutVertexArray,X.x,X.y,K.x,K.y,0,1,C);const ie=g.vertexLength;this.indexArray.emplaceBack(ie,ie+2,ie+1),this.indexArray.emplaceBack(ie+1,ie+2,ie+3),g.vertexLength+=4,g.primitiveLength+=2}}}}if(g.vertexLength+m>rt.MAX_VERTEX_ARRAY_LENGTH&&(g=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray)),au[e.type]!=="Polygon")continue;const x=[],w=[],z=g.vertexLength;for(const A of p)if(A.length!==0){A!==p[0]&&w.push(x.length/2);for(let C=0;CUt)||i.y===e.y&&(i.y<0||i.y>Ut)}function su(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Ut)||i.every(e=>e.y<0)||i.every(e=>e.y>Ut)}we("FillExtrusionBucket",Cl,{omit:["layers","features"]});var lu={paint:new Ot({"fill-extrusion-opacity":new Te(te["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Pe(te["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Te(te["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Te(te["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Gn(te["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Pe(te["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Pe(te["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Te(te["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Fo(i,e){return i.x*e.x+i.y*e.y}function bc(i,e){if(i.length===1){let r=0;const a=e[r++];let s;for(;!s||a.equals(s);)if(s=e[r++],!s)return 1/0;for(;rr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Be,this.layoutVertexArray2=new it,this.indexArray=new pi,this.programConfigurations=new Hn(e.layers,e.zoom),this.segments=new rt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=Sl("line",this.layers,r);const s=this.layers[0].layout.get("line-sort-key"),u=!s.isConstant(),p=[];for(const{feature:m,id:g,index:x,sourceLayerIndex:w}of e){const z=this.layers[0]._featureFilter.needGeometry,T=Kn(m,z);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),T,a))continue;const A=u?s.evaluate(T,{},a):void 0,C={id:g,properties:m.properties,type:m.type,sourceLayerIndex:w,index:x,geometry:z?T.geometry:Wn(m),patterns:{},sortKey:A};p.push(C)}u&&p.sort((m,g)=>m.sortKey-g.sortKey);for(const m of p){const{geometry:g,index:x,sourceLayerIndex:w}=m;if(this.hasPattern){const z=Tl("line",this.layers,m,this.zoom,r);this.patternFeatures.push(z)}else this.addFeature(m,g,x,a,{});r.featureIndex.insert(e[x].feature,g,x,w,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const s of this.patternFeatures)this.addFeature(s,s.geometry,s.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,pu)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hu),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.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,a,s,u){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),g=p.get("line-cap"),x=p.get("line-miter-limit"),w=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const z of r)this.addLine(z,e,m,g,x,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,u,s)}addLine(e,r,a,s,u,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let X=0;X=2&&e[g-1].equals(e[g-2]);)g--;let x=0;for(;x0;if(Ee&&X>x){const pe=T.dist(A);if(pe>2*w){const be=T.sub(T.sub(A)._mult(w/pe)._round());this.updateDistance(A,be),this.addCurrentVertex(be,O,0,0,z),A=be}}const _e=A&&C;let ye=_e?a:m?"butt":s;if(_e&&ye==="round"&&(leu&&(ye="bevel"),ye==="bevel"&&(le>2&&(ye="flipbevel"),le100)K=V.mult(-1);else{const pe=le*O.add(V).mag()/O.sub(V).mag();K._perp()._mult(pe*(Ae?-1:1))}this.addCurrentVertex(T,K,0,0,z),this.addCurrentVertex(T,K.mult(-1),0,0,z)}else if(ye==="bevel"||ye==="fakeround"){const pe=-Math.sqrt(le*le-1),be=Ae?pe:0,xe=Ae?0:pe;if(A&&this.addCurrentVertex(T,O,be,xe,z),ye==="fakeround"){const he=Math.round(180*oe/Math.PI/20);for(let Me=1;Me2*w){const be=T.add(C.sub(T)._mult(w/pe)._round());this.updateDistance(T,be),this.addCurrentVertex(be,V,0,0,z),T=be}}}}addCurrentVertex(e,r,a,s,u,p=!1){const m=r.y*s-r.x,g=-r.y-r.x*s;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,p,!1,a,u),this.addHalfVertex(e,m,g,p,!0,-s,u),this.distance>wc/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,r,a,s,u,p))}addHalfVertex({x:e,y:r},a,s,u,p,m,g){const x=.5*(this.lineClips?this.scaledDistance*(wc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(u?1:0),(r<<1)+(p?1:0),Math.round(63*a)+128,Math.round(63*s)+128,1+(m===0?0:m<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const w=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,w),g.primitiveLength++),p?this.e2=w:this.e1=w}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}we("LineBucket",kl,{omit:["layers","patternFeatures"]});const fu=new Ot({"line-cap":new Te(te.layout_line["line-cap"]),"line-join":new Pe(te.layout_line["line-join"]),"line-miter-limit":new Te(te.layout_line["line-miter-limit"]),"line-round-limit":new Te(te.layout_line["line-round-limit"]),"line-sort-key":new Pe(te.layout_line["line-sort-key"])});var Ec={paint:new Ot({"line-opacity":new Pe(te.paint_line["line-opacity"]),"line-color":new Pe(te.paint_line["line-color"]),"line-translate":new Te(te.paint_line["line-translate"]),"line-translate-anchor":new Te(te.paint_line["line-translate-anchor"]),"line-width":new Pe(te.paint_line["line-width"]),"line-gap-width":new Pe(te.paint_line["line-gap-width"]),"line-offset":new Pe(te.paint_line["line-offset"]),"line-blur":new Pe(te.paint_line["line-blur"]),"line-dasharray":new jn(te.paint_line["line-dasharray"]),"line-pattern":new Gn(te.paint_line["line-pattern"]),"line-gradient":new To(te.paint_line["line-gradient"])}),layout:fu};const zc=new class extends Pe{possiblyEvaluate(i,e){return e=new yt(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(i,e)}evaluate(i,e,r,a){return e=oi({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(i,e,r,a)}}(Ec.paint.properties["line-width"].specification);function Sc(i,e){return e>0?e+2*i:i}zc.useIntegerZoom=!0;const gu=Vt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),_u=Vt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Vt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const yu=Vt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Vt([{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"}]);const Tc=Vt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),xu=Vt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function vu(i,e,r){return i.sections.forEach(a=>{a.text=function(s,u,p){const m=u.layout.get("text-transform").evaluate(p,{});return m==="uppercase"?s=s.toLocaleUpperCase():m==="lowercase"&&(s=s.toLocaleLowerCase()),Ii.applyArabicShaping&&(s=Ii.applyArabicShaping(s)),s}(a.text,e,r)}),i}Vt([{name:"triangle",components:3,type:"Uint16"}]),Vt([{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"}]),Vt([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Vt([{type:"Float32",name:"offsetX"}]),Vt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const Oo={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var Ht=24,Pl=ut,Ic=function(i,e,r,a,s){var u,p,m=8*s-a-1,g=(1<>1,w=-7,z=r?s-1:0,T=r?-1:1,A=i[e+z];for(z+=T,u=A&(1<<-w)-1,A>>=-w,w+=m;w>0;u=256*u+i[e+z],z+=T,w-=8);for(p=u&(1<<-w)-1,u>>=-w,w+=a;w>0;p=256*p+i[e+z],z+=T,w-=8);if(u===0)u=1-x;else{if(u===g)return p?NaN:1/0*(A?-1:1);p+=Math.pow(2,a),u-=x}return(A?-1:1)*p*Math.pow(2,u-a)},Ac=function(i,e,r,a,s,u){var p,m,g,x=8*u-s-1,w=(1<>1,T=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:u-1,C=a?1:-1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,p=w):(p=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-p))<1&&(p--,g*=2),(e+=p+z>=1?T/g:T*Math.pow(2,1-z))*g>=2&&(p++,g/=2),p+z>=w?(m=0,p=w):p+z>=1?(m=(e*g-1)*Math.pow(2,s),p+=z):(m=e*Math.pow(2,z-1)*Math.pow(2,s),p=0));s>=8;i[r+A]=255&m,A+=C,m/=256,s-=8);for(p=p<0;i[r+A]=255&p,A+=C,p/=256,x-=8);i[r+A-C]|=128*O};function ut(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}ut.Varint=0,ut.Fixed64=1,ut.Bytes=2,ut.Fixed32=5;var bn,Ml=4294967296,Cc=1/Ml,kc=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function Wr(i){return i.type===ut.Bytes?i.readVarint()+i.pos:i.pos+1}function Fa(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Pc(i,e,r){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(var s=r.pos-1;s>=i;s--)r.buf[s+a]=r.buf[s]}function bu(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function Mc(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}function ku(i,e,r){i===1&&r.readMessage(Pu,e)}function Pu(i,e,r){if(i===3){const{id:a,bitmap:s,width:u,height:p,left:m,top:g,advance:x}=r.readMessage(Mu,{});e.push({id:a,bitmap:new Po({width:u+6,height:p+6},s),metrics:{width:u,height:p,left:m,top:g,advance:x}})}}function Mu(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}function Dc(i){let e=0,r=0;for(const p of i)e+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,m)=>m.h-p.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let s=0,u=0;for(const p of i)for(let m=a.length-1;m>=0;m--){const g=a[m];if(!(p.w>g.w||p.h>g.h)){if(p.x=g.x,p.y=g.y,u=Math.max(u,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===g.w&&p.h===g.h){const x=a.pop();m>3,u=this.pos;this.type=7&a,i(s,e,this),this.pos===u&&this.skip(a)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Ms(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Mc(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Ms(this.buf,this.pos)+Ms(this.buf,this.pos+4)*Ml;return this.pos+=8,i},readSFixed64:function(){var i=Ms(this.buf,this.pos)+Mc(this.buf,this.pos+4)*Ml;return this.pos+=8,i},readFloat:function(){var i=Ic(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Ic(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,a=this.buf;return e=127&(r=a[this.pos++]),r<128?e:(e|=(127&(r=a[this.pos++]))<<7,r<128?e:(e|=(127&(r=a[this.pos++]))<<14,r<128?e:(e|=(127&(r=a[this.pos++]))<<21,r<128?e:function(s,u,p){var m,g,x=p.buf;if(m=(112&(g=x[p.pos++]))>>4,g<128||(m|=(127&(g=x[p.pos++]))<<3,g<128)||(m|=(127&(g=x[p.pos++]))<<10,g<128)||(m|=(127&(g=x[p.pos++]))<<17,g<128)||(m|=(127&(g=x[p.pos++]))<<24,g<128)||(m|=(1&(g=x[p.pos++]))<<31,g<128))return Fa(s,m,u);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&kc?function(r,a,s){return kc.decode(r.subarray(a,s))}(this.buf,e,i):function(r,a,s){for(var u="",p=a;p239?4:w>223?3:w>191?2:1;if(p+T>s)break;T===1?w<128&&(z=w):T===2?(192&(m=r[p+1]))==128&&(z=(31&w)<<6|63&m)<=127&&(z=null):T===3?(g=r[p+2],(192&(m=r[p+1]))==128&&(192&g)==128&&((z=(15&w)<<12|(63&m)<<6|63&g)<=2047||z>=55296&&z<=57343)&&(z=null)):T===4&&(g=r[p+2],x=r[p+3],(192&(m=r[p+1]))==128&&(192&g)==128&&(192&x)==128&&((z=(15&w)<<18|(63&m)<<12|(63&g)<<6|63&x)<=65535||z>=1114112)&&(z=null)),z===null?(z=65533,T=1):z>65535&&(z-=65536,u+=String.fromCharCode(z>>>10&1023|55296),z=56320|1023&z),u+=String.fromCharCode(z),p+=T}return u}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==ut.Bytes)return i.push(this.readVarint(e));var r=Wr(this);for(i=i||[];this.pos127;);else if(e===ut.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ut.Fixed32)this.pos+=4;else{if(e!==ut.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var a,s;if(e>=0?(a=e%4294967296|0,s=e/4294967296|0):(s=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,s=s+1|0)),e>=0xffffffffffffffff||e<-0xffffffffffffffff)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,p,m){m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,m.buf[m.pos]=127&(u>>>=7)}(a,0,r),function(u,p){var m=(7&u)<<4;p.buf[p.pos++]|=m|((u>>>=3)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u)))))}(s,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(Boolean(i))},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(a,s,u){for(var p,m,g=0;g55295&&p<57344){if(!m){p>56319||g+1===s.length?(a[u++]=239,a[u++]=191,a[u++]=189):m=p;continue}if(p<56320){a[u++]=239,a[u++]=191,a[u++]=189,m=p;continue}p=m-55296<<10|p-56320|65536,m=null}else m&&(a[u++]=239,a[u++]=191,a[u++]=189,m=null);p<128?a[u++]=p:(p<2048?a[u++]=p>>6|192:(p<65536?a[u++]=p>>12|224:(a[u++]=p>>18|240,a[u++]=p>>12&63|128),a[u++]=p>>6&63|128),a[u++]=63&p|128)}return u}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&Pc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Ac(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Ac(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Pc(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,e,r){this.writeTag(i,ut.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,bu,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,wu,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Su,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Eu,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,zu,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Tu,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Iu,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Au,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Cu,e)},writeBytesField:function(i,e){this.writeTag(i,ut.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,ut.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,ut.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,ut.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,ut.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,ut.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,ut.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,ut.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,ut.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,ut.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,Boolean(e))}};class Dl{constructor(e,{pixelRatio:r,version:a,stretchX:s,stretchY:u,content:p}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=s,this.stretchY=u,this.content=p,this.version=a}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]}}class Lc{constructor(e,r){const a={},s={};this.haveRenderCallbacks=[];const u=[];this.addImages(e,a,u),this.addImages(r,s,u);const{w:p,h:m}=Dc(u),g=new Oi({width:p||1,height:m||1});for(const x in e){const w=e[x],z=a[x].paddedRect;Oi.copy(w.data,g,{x:0,y:0},{x:z.x+1,y:z.y+1},w.data)}for(const x in r){const w=r[x],z=s[x].paddedRect,T=z.x+1,A=z.y+1,C=w.data.width,O=w.data.height;Oi.copy(w.data,g,{x:0,y:0},{x:T,y:A},w.data),Oi.copy(w.data,g,{x:0,y:O-1},{x:T,y:A-1},{width:C,height:1}),Oi.copy(w.data,g,{x:0,y:0},{x:T,y:A+O},{width:C,height:1}),Oi.copy(w.data,g,{x:C-1,y:0},{x:T-1,y:A},{width:1,height:O}),Oi.copy(w.data,g,{x:0,y:0},{x:T+C,y:A},{width:1,height:O})}this.image=g,this.iconPositions=a,this.patternPositions=s}addImages(e,r,a){for(const s in e){const u=e[s],p={x:0,y:0,w:u.data.width+2,h:u.data.height+2};a.push(p),r[s]=new Dl(p,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(s)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in e.updatedImages)this.patchUpdatedImage(this.iconPositions[a],e.getImage(a),r),this.patchUpdatedImage(this.patternPositions[a],e.getImage(a),r)}patchUpdatedImage(e,r,a){if(!e||!r||e.version===r.version)return;e.version=r.version;const[s,u]=e.tl;a.update(r.data,void 0,{x:s,y:u})}}we("ImagePosition",Dl),we("ImageAtlas",Lc),h.WritingMode=void 0,(bn=h.WritingMode||(h.WritingMode={}))[bn.none=0]="none",bn[bn.horizontal=1]="horizontal",bn[bn.vertical=2]="vertical",bn[bn.horizontalOnly=3]="horizontalOnly";const Ds=-17;class Vo{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){const a=new Vo;return a.scale=e||1,a.fontStack=r,a}static forImage(e){const r=new Vo;return r.imageName=e,r}}class Va{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const a=new Va;for(let s=0;s=0&&a>=e&&Bs[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const a=new Va;return a.text=this.text.substring(e,r),a.sectionIndex=this.sectionIndex.slice(e,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(Vo.forText(e.scale,e.fontStack||r));const a=this.sections.length-1;for(let s=0;s=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ls(i,e,r,a,s,u,p,m,g,x,w,z,T,A,C,O){const V=Va.fromFeature(i,s);let X;z===h.WritingMode.vertical&&V.verticalizePunctuation();const{processBidirectionalText:K,processStyledBidirectionalText:W}=Ii;if(K&&V.sections.length===1){X=[];const oe=K(V.toString(),Ll(V,x,u,e,a,A,C));for(const Ee of oe){const Ae=new Va;Ae.text=Ee,Ae.sections=V.sections;for(let _e=0;_e0&&Jr>bi&&(bi=Jr)}else{const Vi=Ae[je.fontStack],wi=Vi&&Vi[Jt];if(wi&&wi.rect)ur=wi.rect,Wi=wi.metrics;else{const Jr=Ee[je.fontStack],$o=Jr&&Jr[Jt];if(!$o)continue;Wi=$o.metrics}ai=(Yt-je.scale)*Ht}Ki?(oe.verticalizable=!0,vi.push({glyph:Jt,imageName:pr,x:ot,y:vt+ai,vertical:Ki,scale:je.scale,fontStack:je.fontStack,sectionIndex:ki,metrics:Wi,rect:ur}),ot+=Yr*je.scale+Me):(vi.push({glyph:Jt,imageName:pr,x:ot,y:vt+ai,vertical:Ki,scale:je.scale,fontStack:je.fontStack,sectionIndex:ki,metrics:Wi,rect:ur}),ot+=Wi.advance*je.scale+Me)}vi.length!==0&&(bt=Math.max(ot-Me,bt),Bu(vi,0,vi.length-1,Lt,bi)),ot=0;const Et=pe*Yt+bi;di.lineOffset=Math.max(bi,ni),vt+=Et,Wt=Math.max(Et,Wt),++Bt}var Gt;const Kt=vt-Ds,{horizontalAlign:ri,verticalAlign:xi}=Bl(be);(function(Rt,Yt,ni,di,vi,bi,Et,jt,je){const ki=(Yt-ni)*vi;let Jt=0;Jt=bi!==Et?-jt*di-Ds:(-di*je+.5)*Et;for(const ai of Rt)for(const Wi of ai.positionedGlyphs)Wi.x+=ki,Wi.y+=Jt})(oe.positionedLines,Lt,ri,xi,bt,Wt,pe,Kt,ye.length),oe.top+=-xi*Kt,oe.bottom=oe.top+Kt,oe.left+=-ri*bt,oe.right=oe.left+bt}(le,e,r,a,X,p,m,g,z,x,T,O),!function(oe){for(const Ee of oe)if(Ee.positionedGlyphs.length!==0)return!1;return!0}(ie)&&le}const Bs={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Du={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Bc(i,e,r,a,s,u){if(e.imageName){const p=a[e.imageName];return p?p.displaySize[0]*e.scale*Ht/u+s:0}{const p=r[e.fontStack],m=p&&p[i];return m?m.metrics.advance*e.scale+s:0}}function Rc(i,e,r,a){const s=Math.pow(i-e,2);return a?i=0;let w=0;for(let T=0;T-r/2;){if(p--,p<0)return!1;m-=i[p].dist(u),u=i[p]}m+=i[p].dist(i[p+1]),p++;const g=[];let x=0;for(;ma;)x-=g.shift().angleDelta;if(x>s)return!1;p++,m+=w.dist(z)}return!0}function $c(i){let e=0;for(let r=0;rx){const C=(x-g)/A,O=Mt(z.x,T.x,C),V=Mt(z.y,T.y,C),X=new wn(O,V,T.angleTo(z),w);return X._round(),!p||Nc(i,X,m,p,e)?X:void 0}g+=A}}function Ou(i,e,r,a,s,u,p,m,g){const x=qc(a,u,p),w=Gc(a,s),z=w*p,T=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return e-z=0&&ie=0&&le=0&&T+x<=w){const oe=new wn(ie,le,K,C);oe._round(),a&&!Nc(i,oe,u,a,s)||A.push(oe)}}z+=X}return m||A.length||p||(A=jc(i,z/2,r,a,s,u,p,!0,g)),A}function Zc(i,e,r,a,s){const u=[];for(let p=0;p=a&&z.x>=a||(w.x>=a?w=new De(a,w.y+(a-w.x)/(z.x-w.x)*(z.y-w.y))._round():z.x>=a&&(z=new De(a,w.y+(a-w.x)/(z.x-w.x)*(z.y-w.y))._round()),w.y>=s&&z.y>=s||(w.y>=s?w=new De(w.x+(s-w.y)/(z.y-w.y)*(z.x-w.x),s)._round():z.y>=s&&(z=new De(w.x+(s-w.y)/(z.y-w.y)*(z.x-w.x),s)._round()),g&&w.equals(g[g.length-1])||(g=[w],u.push(g)),g.push(z)))))}}return u}function Xc(i,e,r,a){const s=[],u=i.image,p=u.pixelRatio,m=u.paddedRect.w-2,g=u.paddedRect.h-2,x=i.right-i.left,w=i.bottom-i.top,z=u.stretchX||[[0,m]],T=u.stretchY||[[0,g]],A=(pe,be)=>pe+be[1]-be[0],C=z.reduce(A,0),O=T.reduce(A,0),V=m-C,X=g-O;let K=0,W=C,ie=0,le=O,oe=0,Ee=V,Ae=0,_e=X;if(u.content&&a){const pe=u.content;K=Rs(z,0,pe[0]),ie=Rs(T,0,pe[1]),W=Rs(z,pe[0],pe[2]),le=Rs(T,pe[1],pe[3]),oe=pe[0]-K,Ae=pe[1]-ie,Ee=pe[2]-pe[0]-W,_e=pe[3]-pe[1]-le}const ye=(pe,be,xe,he)=>{const Me=Fs(pe.stretch-K,W,x,i.left),Ce=Os(pe.fixed-oe,Ee,pe.stretch,C),We=Fs(be.stretch-ie,le,w,i.top),ot=Os(be.fixed-Ae,_e,be.stretch,O),vt=Fs(xe.stretch-K,W,x,i.left),bt=Os(xe.fixed-oe,Ee,xe.stretch,C),Wt=Fs(he.stretch-ie,le,w,i.top),Lt=Os(he.fixed-Ae,_e,he.stretch,O),Bt=new De(Me,We),Gt=new De(vt,We),Kt=new De(vt,Wt),ri=new De(Me,Wt),xi=new De(Ce/p,ot/p),Rt=new De(bt/p,Lt/p),Yt=e*Math.PI/180;if(Yt){const vi=Math.sin(Yt),bi=Math.cos(Yt),Et=[bi,-vi,vi,bi];Bt._matMult(Et),Gt._matMult(Et),ri._matMult(Et),Kt._matMult(Et)}const ni=pe.stretch+pe.fixed,di=be.stretch+be.fixed;return{tl:Bt,tr:Gt,bl:ri,br:Kt,tex:{x:u.paddedRect.x+1+ni,y:u.paddedRect.y+1+di,w:xe.stretch+xe.fixed-ni,h:he.stretch+he.fixed-di},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:xi,pixelOffsetBR:Rt,minFontScaleX:Ee/p/x,minFontScaleY:_e/p/w,isSDF:r}};if(a&&(u.stretchX||u.stretchY)){const pe=Hc(z,V,C),be=Hc(T,X,O);for(let xe=0;xe0&&(C=Math.max(10,C),this.circleDiameter=C)}else{let z=p.top*m-g,T=p.bottom*m+g,A=p.left*m-g,C=p.right*m+g;const O=p.collisionPadding;if(O&&(A-=O[0]*m,z-=O[1]*m,C+=O[2]*m,T+=O[3]*m),w){const V=new De(A,z),X=new De(C,z),K=new De(A,T),W=new De(C,T),ie=w*Math.PI/180;V._rotate(ie),X._rotate(ie),K._rotate(ie),W._rotate(ie),A=Math.min(V.x,X.x,K.x,W.x),C=Math.max(V.x,X.x,K.x,W.x),z=Math.min(V.y,X.y,K.y,W.y),T=Math.max(V.y,X.y,K.y,W.y)}e.emplaceBack(r.x,r.y,A,z,C,T,a,s,u)}this.boxEndIndex=e.length}}class Vu{constructor(e=[],r=Uu){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:a}=this,s=r[e];for(;e>0;){const u=e-1>>1,p=r[u];if(a(s,p)>=0)break;r[e]=p,e=u}r[e]=s}_down(e){const{data:r,compare:a}=this,s=this.length>>1,u=r[e];for(;e=0)break;r[e]=m,e=p}r[e]=u}}function Uu(i,e){return ie?1:0}function Nu(i,e=1,r=!1){let a=1/0,s=1/0,u=-1/0,p=-1/0;const m=i[0];for(let A=0;Au)&&(u=C.x),(!A||C.y>p)&&(p=C.y)}const g=Math.min(u-a,p-s);let x=g/2;const w=new Vu([],$u);if(g===0)return new De(a,s);for(let A=a;Az.d||!z.d)&&(z=A,r&&console.log("found best %d after %d probes",Math.round(1e4*A.d)/1e4,T)),A.max-z.d<=e||(x=A.h/2,w.push(new Ua(A.p.x-x,A.p.y-x,x,i)),w.push(new Ua(A.p.x+x,A.p.y-x,x,i)),w.push(new Ua(A.p.x-x,A.p.y+x,x,i)),w.push(new Ua(A.p.x+x,A.p.y+x,x,i)),T+=4)}return r&&(console.log(`num probes: ${T}`),console.log(`best distance: ${z.d}`)),z.p}function $u(i,e){return e.max-i.max}function Ua(i,e,r,a){this.p=new De(i,e),this.h=r,this.d=function(s,u){let p=!1,m=1/0;for(let g=0;gs.y!=C.y>s.y&&s.x<(C.x-A.x)*(s.y-A.y)/(C.y-A.y)+A.x&&(p=!p),m=Math.min(m,ac(s,A,C))}}return(p?1:-1)*Math.sqrt(m)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}const Rl=Number.POSITIVE_INFINITY;function Wc(i,e){return e[1]!==Rl?function(r,a,s){let u=0,p=0;switch(a=Math.abs(a),s=Math.abs(s),r){case"top-right":case"top-left":case"top":p=s-7;break;case"bottom-right":case"bottom-left":case"bottom":p=7-s}switch(r){case"top-right":case"bottom-right":case"right":u=-a;break;case"top-left":case"bottom-left":case"left":u=a}return[u,p]}(i,e[0],e[1]):function(r,a){let s=0,u=0;a<0&&(a=0);const p=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":u=p-7;break;case"bottom-right":case"bottom-left":u=7-p;break;case"bottom":u=7-a;break;case"top":u=a-7}switch(r){case"top-right":case"bottom-right":s=-p;break;case"top-left":case"bottom-left":s=p;break;case"left":s=a;break;case"right":s=-a}return[s,u]}(i,e[0])}function Fl(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qu(i,e,r,a,s,u,p,m,g,x,w){let z=u.textMaxSize.evaluate(e,{});z===void 0&&(z=p);const T=i.layers[0].layout,A=T.get("icon-offset").evaluate(e,{},w),C=Yc(r.horizontal),O=p/24,V=i.tilePixelRatio*O,X=i.tilePixelRatio*z/24,K=i.tilePixelRatio*m,W=i.tilePixelRatio*T.get("symbol-spacing"),ie=T.get("text-padding")*i.tilePixelRatio,le=T.get("icon-padding")*i.tilePixelRatio,oe=T.get("text-max-angle")/180*Math.PI,Ee=T.get("text-rotation-alignment")!=="viewport"&&T.get("symbol-placement")!=="point",Ae=T.get("icon-rotation-alignment")==="map"&&T.get("symbol-placement")!=="point",_e=T.get("symbol-placement"),ye=W/2,pe=T.get("icon-text-fit");let be;a&&pe!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(be=Vc(a,r.vertical,pe,T.get("icon-text-fit-padding"),A,O)),C&&(a=Vc(a,C,pe,T.get("icon-text-fit-padding"),A,O)));const xe=(he,Me)=>{Me.x<0||Me.x>=Ut||Me.y<0||Me.y>=Ut||function(Ce,We,ot,vt,bt,Wt,Lt,Bt,Gt,Kt,ri,xi,Rt,Yt,ni,di,vi,bi,Et,jt,je,ki,Jt,ai,Wi){const ur=Ce.addToLineVertexArray(We,ot);let pr,Yr,Ki,Vi,wi=0,Jr=0,$o=0,dh=0,Xl=-1,Hl=-1;const Qr={};let mh=Io(""),Wl=0,Kl=0;if(Bt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[Wl,Kl]=Bt.layout.get("text-offset").evaluate(je,{},ai).map(Ei=>Ei*Ht):(Wl=Bt.layout.get("text-radial-offset").evaluate(je,{},ai)*Ht,Kl=Rl),Ce.allowVerticalPlacement&&vt.vertical){const Ei=Bt.layout.get("text-rotate").evaluate(je,{},ai)+90;Ki=new Vs(Gt,We,Kt,ri,xi,vt.vertical,Rt,Yt,ni,Ei),Lt&&(Vi=new Vs(Gt,We,Kt,ri,xi,Lt,vi,bi,ni,Ei))}if(bt){const Ei=Bt.layout.get("icon-rotate").evaluate(je,{}),Er=Bt.layout.get("icon-text-fit")!=="none",qo=Xc(bt,Ei,Jt,Er),Go=Lt?Xc(Lt,Ei,Jt,Er):void 0;Yr=new Vs(Gt,We,Kt,ri,xi,bt,vi,bi,!1,Ei),wi=4*qo.length;const _h=Ce.iconSizeData;let Jn=null;_h.kind==="source"?(Jn=[Kr*Bt.layout.get("icon-size").evaluate(je,{})],Jn[0]>En&&wt(`${Ce.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):_h.kind==="composite"&&(Jn=[Kr*ki.compositeIconSizes[0].evaluate(je,{},ai),Kr*ki.compositeIconSizes[1].evaluate(je,{},ai)],(Jn[0]>En||Jn[1]>En)&&wt(`${Ce.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Ce.addSymbols(Ce.icon,qo,Jn,jt,Et,je,h.WritingMode.none,We,ur.lineStartIndex,ur.lineLength,-1,ai),Xl=Ce.icon.placedSymbolArray.length-1,Go&&(Jr=4*Go.length,Ce.addSymbols(Ce.icon,Go,Jn,jt,Et,je,h.WritingMode.vertical,We,ur.lineStartIndex,ur.lineLength,-1,ai),Hl=Ce.icon.placedSymbolArray.length-1)}const fh=Object.keys(vt.horizontal);for(const Ei of fh){const Er=vt.horizontal[Ei];if(!pr){mh=Io(Er.text);const Go=Bt.layout.get("text-rotate").evaluate(je,{},ai);pr=new Vs(Gt,We,Kt,ri,xi,Er,Rt,Yt,ni,Go)}const qo=Er.positionedLines.length===1;if($o+=Kc(Ce,We,Er,Wt,Bt,ni,je,di,ur,vt.vertical?h.WritingMode.horizontal:h.WritingMode.horizontalOnly,qo?fh:[Ei],Qr,Xl,ki,ai),qo)break}vt.vertical&&(dh+=Kc(Ce,We,vt.vertical,Wt,Bt,ni,je,di,ur,h.WritingMode.vertical,["vertical"],Qr,Hl,ki,ai));const ip=pr?pr.boxStartIndex:Ce.collisionBoxArray.length,rp=pr?pr.boxEndIndex:Ce.collisionBoxArray.length,np=Ki?Ki.boxStartIndex:Ce.collisionBoxArray.length,ap=Ki?Ki.boxEndIndex:Ce.collisionBoxArray.length,op=Yr?Yr.boxStartIndex:Ce.collisionBoxArray.length,sp=Yr?Yr.boxEndIndex:Ce.collisionBoxArray.length,lp=Vi?Vi.boxStartIndex:Ce.collisionBoxArray.length,cp=Vi?Vi.boxEndIndex:Ce.collisionBoxArray.length;let dr=-1;const Gs=(Ei,Er)=>Ei&&Ei.circleDiameter?Math.max(Ei.circleDiameter,Er):Er;dr=Gs(pr,dr),dr=Gs(Ki,dr),dr=Gs(Yr,dr),dr=Gs(Vi,dr);const gh=dr>-1?1:0;gh&&(dr*=Wi/Ht),Ce.glyphOffsetArray.length>=Na.MAX_GLYPHS&&wt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),je.sortKey!==void 0&&Ce.addToSortKeyRanges(Ce.symbolInstances.length,je.sortKey),Ce.symbolInstances.emplaceBack(We.x,We.y,Qr.right>=0?Qr.right:-1,Qr.center>=0?Qr.center:-1,Qr.left>=0?Qr.left:-1,Qr.vertical||-1,Xl,Hl,mh,ip,rp,np,ap,op,sp,lp,cp,Kt,$o,dh,wi,Jr,gh,0,Rt,Wl,Kl,dr)}(i,Me,he,r,a,s,be,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,V,ie,Ee,g,K,le,Ae,A,e,u,x,w,p)};if(_e==="line")for(const he of Zc(e.geometry,0,0,Ut,Ut)){const Me=Ou(he,W,oe,r.vertical||C,a,24,X,i.overscaling,Ut);for(const Ce of Me){const We=C;We&&Gu(i,We.text,ye,Ce)||xe(he,Ce)}}else if(_e==="line-center"){for(const he of e.geometry)if(he.length>1){const Me=Fu(he,oe,r.vertical||C,a,24,X);Me&&xe(he,Me)}}else if(e.type==="Polygon")for(const he of zl(e.geometry,0)){const Me=Nu(he,16);xe(he[0],new wn(Me.x,Me.y,0))}else if(e.type==="LineString")for(const he of e.geometry)xe(he,new wn(he[0].x,he[0].y,0));else if(e.type==="Point")for(const he of e.geometry)for(const Me of he)xe([Me],new wn(Me.x,Me.y,0))}const En=32640;function Kc(i,e,r,a,s,u,p,m,g,x,w,z,T,A,C){const O=function(K,W,ie,le,oe,Ee,Ae,_e){const ye=le.layout.get("text-rotate").evaluate(Ee,{})*Math.PI/180,pe=[];for(const be of W.positionedLines)for(const xe of be.positionedGlyphs){if(!xe.rect)continue;const he=xe.rect||{};let Me=4,Ce=!0,We=1,ot=0;const vt=(oe||_e)&&xe.vertical,bt=xe.metrics.advance*xe.scale/2;if(_e&&W.verticalizable){const Et=(xe.scale-1)*Ht,jt=(Ht-xe.metrics.width*xe.scale)/2;ot=be.lineOffset/2-(xe.imageName?-jt:Et)}if(xe.imageName){const Et=Ae[xe.imageName];Ce=Et.sdf,We=Et.pixelRatio,Me=1/We}const Wt=oe?[xe.x+bt,xe.y]:[0,0];let Lt=oe?[0,0]:[xe.x+bt+ie[0],xe.y+ie[1]-ot],Bt=[0,0];vt&&(Bt=Lt,Lt=[0,0]);const Gt=(xe.metrics.left-Me)*xe.scale-bt+Lt[0],Kt=(-xe.metrics.top-Me)*xe.scale+Lt[1],ri=Gt+he.w*xe.scale/We,xi=Kt+he.h*xe.scale/We,Rt=new De(Gt,Kt),Yt=new De(ri,Kt),ni=new De(Gt,xi),di=new De(ri,xi);if(vt){const Et=new De(-bt,bt-Ds),jt=-Math.PI/2,je=12-bt,ki=new De(22-je,-(xe.imageName?je:0)),Jt=new De(...Bt);Rt._rotateAround(jt,Et)._add(ki)._add(Jt),Yt._rotateAround(jt,Et)._add(ki)._add(Jt),ni._rotateAround(jt,Et)._add(ki)._add(Jt),di._rotateAround(jt,Et)._add(ki)._add(Jt)}if(ye){const Et=Math.sin(ye),jt=Math.cos(ye),je=[jt,-Et,Et,jt];Rt._matMult(je),Yt._matMult(je),ni._matMult(je),di._matMult(je)}const vi=new De(0,0),bi=new De(0,0);pe.push({tl:Rt,tr:Yt,bl:ni,br:di,tex:he,writingMode:W.writingMode,glyphOffset:Wt,sectionIndex:xe.sectionIndex,isSDF:Ce,pixelOffsetTL:vi,pixelOffsetBR:bi,minFontScaleX:0,minFontScaleY:0})}return pe}(0,r,m,s,u,p,a,i.allowVerticalPlacement),V=i.textSizeData;let X=null;V.kind==="source"?(X=[Kr*s.layout.get("text-size").evaluate(p,{})],X[0]>En&&wt(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):V.kind==="composite"&&(X=[Kr*A.compositeTextSizes[0].evaluate(p,{},C),Kr*A.compositeTextSizes[1].evaluate(p,{},C)],(X[0]>En||X[1]>En)&&wt(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),i.addSymbols(i.text,O,X,m,u,p,x,e,g.lineStartIndex,g.lineLength,T,C);for(const K of w)z[K]=i.text.placedSymbolArray.length-1;return 4*O.length}function Yc(i){for(const e in i)return i[e];return null}function Gu(i,e,r,a){const s=i.compareText;if(e in s){const u=s[e];for(let p=u.length-1;p>=0;p--)if(a.dist(u[p])p.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=_l([]),this.placementViewportMatrix=_l([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Uc(this.zoom,r["text-size"]),this.iconSizeData=Uc(this.zoom,r["icon-size"]);const a=this.layers[0].layout,s=a.get("symbol-sort-key"),u=a.get("symbol-z-order");this.canOverlap=$l(a,"text-overlap","text-allow-overlap")!=="never"||$l(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!s.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(p=>h.WritingMode[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=e.sourceID}createArrays(){this.text=new Vl(new Hn(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Vl(new Hn(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ze,this.lineVertexArray=new ge,this.symbolInstances=new re}calculateGlyphDependencies(e,r,a,s,u){for(let p=0;p0)&&(p.value.kind!=="constant"||p.value.value.length>0),w=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,z=u.get("symbol-sort-key");if(this.features=[],!x&&!w)return;const T=r.iconDependencies,A=r.glyphDependencies,C=r.availableImages,O=new yt(this.zoom);for(const{feature:V,id:X,index:K,sourceLayerIndex:W}of e){const ie=s._featureFilter.needGeometry,le=Kn(V,ie);if(!s._featureFilter.filter(O,le,a))continue;let oe,Ee;if(ie||(le.geometry=Wn(V)),x){const _e=s.getValueAndResolveTokens("text-field",le,a,C),ye=B.factory(_e);Xu(ye)&&(this.hasRTLText=!0),(!this.hasRTLText||zo()==="unavailable"||this.hasRTLText&&Ii.isParsed())&&(oe=vu(ye,s,le))}if(w){const _e=s.getValueAndResolveTokens("icon-image",le,a,C);Ee=_e instanceof $?_e:$.fromString(_e)}if(!oe&&!Ee)continue;const Ae=this.sortFeaturesByKey?z.evaluate(le,{},a):void 0;if(this.features.push({id:X,text:oe,icon:Ee,index:K,sourceLayerIndex:W,geometry:le.geometry,properties:V.properties,type:ju[V.type],sortKey:Ae}),Ee&&(T[Ee.name]=!0),oe){const _e=p.evaluate(le,{},a).join(","),ye=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(h.WritingMode.vertical)>=0;for(const pe of oe.sections)if(pe.image)T[pe.image.name]=!0;else{const be=xo(oe.toString()),xe=pe.fontStack||_e,he=A[xe]=A[xe]||{};this.calculateGlyphDependencies(pe.text,he,ye,this.allowVerticalPlacement,be)}}}u.get("symbol-placement")==="line"&&(this.features=function(V){const X={},K={},W=[];let ie=0;function le(_e){W.push(V[_e]),ie++}function oe(_e,ye,pe){const be=K[_e];return delete K[_e],K[ye]=be,W[be].geometry[0].pop(),W[be].geometry[0]=W[be].geometry[0].concat(pe[0]),be}function Ee(_e,ye,pe){const be=X[ye];return delete X[ye],X[_e]=be,W[be].geometry[0].shift(),W[be].geometry[0]=pe[0].concat(W[be].geometry[0]),be}function Ae(_e,ye,pe){const be=pe?ye[0][ye[0].length-1]:ye[0][0];return`${_e}:${be.x}:${be.y}`}for(let _e=0;_e_e.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((V,X)=>V.sortKey-X.sortKey)}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!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,r){const a=this.lineVertexArray.length;if(e.segment!==void 0){let s=e.dist(r[e.segment+1]),u=e.dist(r[e.segment]);const p={};for(let m=e.segment+1;m=0;m--)p[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:u},m>0&&(u+=r[m-1].dist(r[m]));for(let m=0;m0}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,r){const a=e.placedSymbolArray.get(r),s=a.vertexStartIndex+4*a.numGlyphs;for(let u=a.vertexStartIndex;us[m]-s[g]||u[g]-u[m]),p}addToSortKeyRanges(e,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((s,u,p)=>{s>=0&&p.indexOf(s)===u&&this.addIndicesForPlacedSymbol(this.text,s)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}we("SymbolBucket",Na,{omit:["layers","collisionBoxArray","features","compareText"]}),Na.MAX_GLYPHS=65535,Na.addDynamicAttributes=Ol;const Hu=new Ot({"symbol-placement":new Te(te.layout_symbol["symbol-placement"]),"symbol-spacing":new Te(te.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Te(te.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Pe(te.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Te(te.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Te(te.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Te(te.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Te(te.layout_symbol["icon-ignore-placement"]),"icon-optional":new Te(te.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Te(te.layout_symbol["icon-rotation-alignment"]),"icon-size":new Pe(te.layout_symbol["icon-size"]),"icon-text-fit":new Te(te.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Te(te.layout_symbol["icon-text-fit-padding"]),"icon-image":new Pe(te.layout_symbol["icon-image"]),"icon-rotate":new Pe(te.layout_symbol["icon-rotate"]),"icon-padding":new Te(te.layout_symbol["icon-padding"]),"icon-keep-upright":new Te(te.layout_symbol["icon-keep-upright"]),"icon-offset":new Pe(te.layout_symbol["icon-offset"]),"icon-anchor":new Pe(te.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Te(te.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Te(te.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Te(te.layout_symbol["text-rotation-alignment"]),"text-field":new Pe(te.layout_symbol["text-field"]),"text-font":new Pe(te.layout_symbol["text-font"]),"text-size":new Pe(te.layout_symbol["text-size"]),"text-max-width":new Pe(te.layout_symbol["text-max-width"]),"text-line-height":new Te(te.layout_symbol["text-line-height"]),"text-letter-spacing":new Pe(te.layout_symbol["text-letter-spacing"]),"text-justify":new Pe(te.layout_symbol["text-justify"]),"text-radial-offset":new Pe(te.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Te(te.layout_symbol["text-variable-anchor"]),"text-anchor":new Pe(te.layout_symbol["text-anchor"]),"text-max-angle":new Te(te.layout_symbol["text-max-angle"]),"text-writing-mode":new Te(te.layout_symbol["text-writing-mode"]),"text-rotate":new Pe(te.layout_symbol["text-rotate"]),"text-padding":new Te(te.layout_symbol["text-padding"]),"text-keep-upright":new Te(te.layout_symbol["text-keep-upright"]),"text-transform":new Pe(te.layout_symbol["text-transform"]),"text-offset":new Pe(te.layout_symbol["text-offset"]),"text-allow-overlap":new Te(te.layout_symbol["text-allow-overlap"]),"text-overlap":new Te(te.layout_symbol["text-overlap"]),"text-ignore-placement":new Te(te.layout_symbol["text-ignore-placement"]),"text-optional":new Te(te.layout_symbol["text-optional"])});var Nl={paint:new Ot({"icon-opacity":new Pe(te.paint_symbol["icon-opacity"]),"icon-color":new Pe(te.paint_symbol["icon-color"]),"icon-halo-color":new Pe(te.paint_symbol["icon-halo-color"]),"icon-halo-width":new Pe(te.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Pe(te.paint_symbol["icon-halo-blur"]),"icon-translate":new Te(te.paint_symbol["icon-translate"]),"icon-translate-anchor":new Te(te.paint_symbol["icon-translate-anchor"]),"text-opacity":new Pe(te.paint_symbol["text-opacity"]),"text-color":new Pe(te.paint_symbol["text-color"],{runtimeType:ti,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Pe(te.paint_symbol["text-halo-color"]),"text-halo-width":new Pe(te.paint_symbol["text-halo-width"]),"text-halo-blur":new Pe(te.paint_symbol["text-halo-blur"]),"text-translate":new Te(te.paint_symbol["text-translate"]),"text-translate-anchor":new Te(te.paint_symbol["text-translate-anchor"])}),layout:Hu};class Jc{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:ft,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}we("FormatSectionOverride",Jc,{omit:["defaultValue"]});class Ns extends ui{constructor(e){super(e,Nl)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const a=this.layout.get("text-writing-mode");if(a){const s=[];for(const u of a)s.indexOf(u)<0&&s.push(u);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,a,s){const u=this.layout.get(e).evaluate(r,{},a,s),p=this._unevaluatedLayout._values[e];return p.isDataDriven()||ma(p.value)||!u?u:function(m,g){return g.replace(/{([^{}]+)}/g,(x,w)=>w in m?String(m[w]):"")}(r.properties,u)}createBucket(e){return new Na(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Nl.paint.overridableProperties){if(!Ns.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),a=new Jc(r),s=new po(a,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new ga("source",s):new _a("composite",s,r.value.zoomStops,r.value._interpolationType),this.paint._values[e]=new Gi(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&Ns.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const a=e.get("text-field"),s=Nl.paint.properties[r];let u=!1;const p=m=>{for(const g of m)if(s.overrides&&s.overrides.hasOverride(g))return void(u=!0)};if(a.value.kind==="constant"&&a.value.value instanceof B)p(a.value.value.sections);else if(a.value.kind==="source"){const m=x=>{u||(x instanceof se&&q(x.value)===Li?p(x.value.sections):x instanceof Ie?p(x.sections):x.eachChild(m))},g=a.value;g._styleExpression&&m(g._styleExpression.expression)}return u}}function $l(i,e,r){let a="never";const s=i.get(e);return s?a=s:i.get(r)&&(a="always"),a}var Wu={paint:new Ot({"background-color":new Te(te.paint_background["background-color"]),"background-pattern":new jn(te.paint_background["background-pattern"]),"background-opacity":new Te(te.paint_background["background-opacity"])})},Ku={paint:new Ot({"raster-opacity":new Te(te.paint_raster["raster-opacity"]),"raster-hue-rotate":new Te(te.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Te(te.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Te(te.paint_raster["raster-brightness-max"]),"raster-saturation":new Te(te.paint_raster["raster-saturation"]),"raster-contrast":new Te(te.paint_raster["raster-contrast"]),"raster-resampling":new Te(te.paint_raster["raster-resampling"]),"raster-fade-duration":new Te(te.paint_raster["raster-fade-duration"])})};class Yu extends ui{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}}const Ju={circle:class extends ui{constructor(i){super(i,kh)}createBucket(i){return new ml(i)}queryRadius(i){const e=i;return Co("circle-radius",this,e)+Co("circle-stroke-width",this,e)+Ss(this.paint.get("circle-translate"))}queryIntersectsFeature(i,e,r,a,s,u,p,m){const g=Ts(i,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),u.angle,p),x=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),w=this.paint.get("circle-pitch-alignment")==="map",z=w?g:function(A,C){return A.map(O=>lc(O,C))}(g,m),T=w?x*p:x;for(const A of a)for(const C of A){const O=w?C:lc(C,m);let V=T;const X=Is([],[C.x,C.y,0,1],m);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?V*=X[3]/u.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(V*=u.cameraToCenterDistance/X[3]),Sh(z,O,V))return!0}return!1}},heatmap:class extends ui{constructor(i){super(i,Mh),this._updateColorRamp()}createBucket(i){return new cc(i)}_handleSpecialPaintPropertyUpdate(i){i==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=uc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends ui{constructor(i){super(i,Dh)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends ui{constructor(i){super(i,Wh)}recalculate(i,e){super.recalculate(i,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(i){return new Il(i)}queryRadius(){return Ss(this.paint.get("fill-translate"))}queryIntersectsFeature(i,e,r,a,s,u,p){return nc(Ts(i,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),u.angle,p),a)}isTileClipped(){return!0}},"fill-extrusion":class extends ui{constructor(i){super(i,lu)}createBucket(i){return new Cl(i)}queryRadius(){return Ss(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,e,r,a,s,u,p,m){const g=Ts(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),u.angle,p),x=this.paint.get("fill-extrusion-height").evaluate(e,r),w=this.paint.get("fill-extrusion-base").evaluate(e,r),z=function(A,C,O,V){const X=[];for(const K of A){const W=[K.x,K.y,0,1];Is(W,W,C),X.push(new De(W[0]/W[3],W[1]/W[3]))}return X}(g,m),T=function(A,C,O,V){const X=[],K=[],W=V[8]*C,ie=V[9]*C,le=V[10]*C,oe=V[11]*C,Ee=V[8]*O,Ae=V[9]*O,_e=V[10]*O,ye=V[11]*O;for(const pe of A){const be=[],xe=[];for(const he of pe){const Me=he.x,Ce=he.y,We=V[0]*Me+V[4]*Ce+V[12],ot=V[1]*Me+V[5]*Ce+V[13],vt=V[2]*Me+V[6]*Ce+V[14],bt=V[3]*Me+V[7]*Ce+V[15],Wt=vt+le,Lt=bt+oe,Bt=We+Ee,Gt=ot+Ae,Kt=vt+_e,ri=bt+ye,xi=new De((We+W)/Lt,(ot+ie)/Lt);xi.z=Wt/Lt,be.push(xi);const Rt=new De(Bt/ri,Gt/ri);Rt.z=Kt/ri,xe.push(Rt)}X.push(be),K.push(xe)}return[X,K]}(a,w,x,m);return function(A,C,O){let V=1/0;nc(O,C)&&(V=bc(O,C[0]));for(let X=0;X=3){for(let O=0;O{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const Qc=63710088e-1;class At{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new At(Yi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,a=this.lat*r,s=e.lat*r,u=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((e.lng-this.lng)*r);return Qc*Math.acos(Math.min(u,1))}toBounds(e=0){const r=360*e/40075017,a=r/Math.cos(Math.PI/180*this.lat);return new Yn(new At(this.lng-a,this.lat-r),new At(this.lng+a,this.lat+r))}static convert(e){if(e instanceof At)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new At(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new At(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class Yn{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}setSouthWest(e){return this._sw=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}extend(e){const r=this._sw,a=this._ne;let s,u;if(e instanceof At)s=e,u=e;else{if(!(e instanceof Yn))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Yn.convert(e)):this.extend(At.convert(e)):this;if(s=e._sw,u=e._ne,!s||!u)return this}return r||a?(r.lng=Math.min(s.lng,r.lng),r.lat=Math.min(s.lat,r.lat),a.lng=Math.max(u.lng,a.lng),a.lat=Math.max(u.lat,a.lat)):(this._sw=new At(s.lng,s.lat),this._ne=new At(u.lng,u.lat)),this}getCenter(){return new At((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new At(this.getWest(),this.getNorth())}getSouthEast(){return new At(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:r,lat:a}=At.convert(e);let s=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(s=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&s}static convert(e){return e instanceof Yn?e:e&&new Yn(e)}}const eh=2*Math.PI*Qc;function th(i){return eh*Math.cos(i*Math.PI/180)}function ih(i){return(180+i)/360}function rh(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function nh(i,e){return i/th(e)}function ql(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class $s{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){const a=At.convert(e);return new $s(ih(a.lng),rh(a.lat),nh(r,a.lat))}toLngLat(){return new At(360*this.x-180,ql(this.y))}toAltitude(){return this.z*th(ql(this.y))}meterInMercatorCoordinateUnits(){return 1/eh*(e=ql(this.y),1/Math.cos(e*Math.PI/180));var e}}function ah(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class Gl{constructor(e,r,a){this.z=e,this.x=r,this.y=a,this.key=Uo(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){const s=(p=this.y,m=this.z,g=ah(256*(u=this.x),256*(p=Math.pow(2,m)-p-1),m),x=ah(256*(u+1),256*(p+1),m),g[0]+","+g[1]+","+x[0]+","+x[1]);var u,p,m,g,x;const w=function(z,T,A){let C,O="";for(let V=z;V>0;V--)C=1<1?"@2x":"").replace(/{quadkey}/g,w).replace(/{bbox-epsg-3857}/g,s)}getTilePoint(e){const r=Math.pow(2,this.z);return new De((e.x*r-this.x)*Ut,(e.y*r-this.y)*Ut)}toString(){return`${this.z}/${this.x}/${this.y}`}}class oh{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Uo(e,r.z,r.z,r.x,r.y)}}class Hi{constructor(e,r,a,s,u){this.overscaledZ=e,this.wrap=r,this.canonical=new Gl(a,+s,+u),this.key=Uo(r,e,a,s,u)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const r=this.canonical.z-e;return e>this.canonical.z?new Hi(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Hi(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){const a=this.canonical.z-e;return e>this.canonical.z?Uo(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Uo(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new Hi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,s=2*this.canonical.y;return[new Hi(r,this.wrap,r,a,s),new Hi(r,this.wrap,r,a+1,s),new Hi(r,this.wrap,r,a,s+1),new Hi(r,this.wrap,r,a+1,s+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}_unpackMapbox(e,r,a){return(256*e*256+256*r+a)/10-1e4}_unpackTerrarium(e,r,a){return 256*e+r+a/256-32768}getPixels(){return new Oi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=r*this.dim,u=r*this.dim+this.dim,p=a*this.dim,m=a*this.dim+this.dim;switch(r){case-1:s=u-1;break;case 1:u=s+1}switch(a){case-1:p=m-1;break;case 1:m=p+1}const g=-r*this.dim,x=-a*this.dim;for(let w=p;w=0&&z[3]>=0&&g.insert(m,z[0],z[1],z[2],z[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new vn.VectorTile(new Pl(this.rawTileData)).layers,this.sourceLayerCoder=new lh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,a,s){this.loadVTLayers();const u=e.params||{},p=Ut/e.tileSize/e.scale,m=va(u.filter),g=e.queryGeometry,x=e.queryPadding*p,w=ph(g),z=this.grid.query(w.minX-x,w.minY-x,w.maxX+x,w.maxY+x),T=ph(e.cameraQueryGeometry),A=this.grid3D.query(T.minX-x,T.minY-x,T.maxX+x,T.maxY+x,(V,X,K,W)=>function(ie,le,oe,Ee,Ae){for(const ye of ie)if(le<=ye.x&&oe<=ye.y&&Ee>=ye.x&&Ae>=ye.y)return!0;const _e=[new De(le,oe),new De(le,Ae),new De(Ee,Ae),new De(Ee,oe)];if(ie.length>2){for(const ye of _e)if(Da(ie,ye))return!0}for(let ye=0;ye(W||(W=Wn(ie)),le.queryIntersectsFeature(g,ie,oe,W,this.z,e.transform,p,e.pixelPosMatrix)))}return C}loadMatchingFeature(e,r,a,s,u,p,m,g,x,w,z){const T=this.bucketLayerIDs[r];if(p&&!function(V,X){for(let K=0;K=0)return!0;return!1}(p,T))return;const A=this.sourceLayerCoder.decode(a),C=this.vtLayers[A].feature(s);if(u.needGeometry){const V=Kn(C,!0);if(!u.filter(new yt(this.tileID.overscaledZ),V,this.tileID.canonical))return}else if(!u.filter(new yt(this.tileID.overscaledZ),C))return;const O=this.getId(C,A);for(let V=0;V{const m=e instanceof Aa?e.get(p):null;return m&&m.evaluate?m.evaluate(r,a,s):m})}function ph(i){let e=1/0,r=1/0,a=-1/0,s=-1/0;for(const u of i)e=Math.min(e,u.x),r=Math.min(r,u.y),a=Math.max(a,u.x),s=Math.max(s,u.y);return{minX:e,minY:r,maxX:a,maxY:s}}function ep(i,e){return e-i}var jl;we("FeatureIndex",hh,{omit:["rawTileData","sourceLayerCoder"]}),h.PerformanceMarkers=void 0,(jl=h.PerformanceMarkers||(h.PerformanceMarkers={})).create="create",jl.load="load",jl.fullLoad="fullLoad";let qs=null,No=[];const Zl=1e3/30,tp={mark(i){performance.mark(i)},frame(i){const e=i;qs!=null&&No.push(e-qs),qs=e},clearMetrics(){qs=null,No=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const i in h.PerformanceMarkers)performance.clearMarks(h.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure("loadTime",h.PerformanceMarkers.create,h.PerformanceMarkers.load),performance.measure("fullLoadTime",h.PerformanceMarkers.create,h.PerformanceMarkers.fullLoad);const i=performance.getEntriesByName("loadTime")[0].duration,e=performance.getEntriesByName("fullLoadTime")[0].duration,r=No.length,a=1/(No.reduce((u,p)=>u+p,0)/r/1e3),s=No.filter(u=>u>Zl).reduce((u,p)=>u+(p-Zl)/Zl,0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:s/(r+s)*100}}};h.AJAXError=$t,h.ARRAY_TYPE=La,h.Actor=class{constructor(i,e,r){this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Ji(["receive","process"],this),this.invoker=new Qu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=er()?i:window}send(i,e,r,a,s=!1){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[u]=r);const p=zn(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:i,hasCallback:!!r,targetMapId:a,mustQueue:s,sourceMapId:this.mapId,data:Nn(e,p)},p),{cancel:()=>{r&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(i){const e=i.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type===""){delete this.tasks[r];const a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else er()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(!this.taskQueue.length)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){if(e.type===""){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(qr(e.error)):r(null,qr(e.data)))}else{let r=!1;const a=zn(this.globalScope)?void 0:[],s=e.hasCallback?(m,g)=>{r=!0,delete this.cancelCallbacks[i],this.target.postMessage({id:i,type:"",sourceMapId:this.mapId,error:m?Nn(m):null,data:Nn(g,a)},a)}:m=>{r=!0};let u=null;const p=qr(e.data);if(this.parent[e.type])u=this.parent[e.type](e.sourceMapId,p,s);else if(this.parent.getWorkerSource){const m=e.type.split(".");u=this.parent.getWorkerSource(e.sourceMapId,m[0],p.source)[m[1]](p,s)}else s(new Error(`Could not find function ${e.type}`));!r&&u&&u.cancel&&(this.cancelCallbacks[i]=u.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},h.AlphaImage=Po,h.CanonicalTileID=Gl,h.CollisionBoxArray=J,h.CollisionCircleLayoutArray=class extends b{},h.Color=E,h.DEMData=sh,h.DataConstantProperty=Te,h.DictionaryCoder=lh,h.EXTENT=Ut,h.ErrorEvent=Mr,h.EvaluationParameters=yt,h.Event=vr,h.Evented=An,h.FeatureIndex=hh,h.FillBucket=Il,h.FillExtrusionBucket=Cl,h.GeoJSONFeature=ch,h.ImageAtlas=Lc,h.ImagePosition=Dl,h.LineBucket=kl,h.LineStripIndexArray=class extends H{},h.LngLat=At,h.LngLatBounds=Yn,h.MercatorCoordinate=$s,h.ONE_EM=Ht,h.OverscaledTileID=Hi,h.PerformanceUtils=tp,h.PosArray=class extends gn{},h.Properties=Ot,h.QuadTriangleArray=class extends I{},h.RGBAImage=Oi,h.RasterBoundsArray=class extends Xn{},h.RequestPerformance=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},h.ResourceType=ea,h.SegmentVector=rt,h.SymbolBucket=Na,h.Transitionable=So,h.TriangleIndexArray=pi,h.Uniform1f=_n,h.Uniform1i=class extends Xi{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},h.Uniform2f=class extends Xi{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},h.Uniform3f=class extends Xi{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},h.Uniform4f=Jl,h.UniformColor=Ql,h.UniformMatrix4f=class extends Xi{constructor(i,e){super(i,e),this.current=Eh}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},h.UnwrappedTileID=oh,h.ValidationError=fe,h.ZoomHistory=$n,h.addDynamicAttributes=Ol,h.asyncAll=function(i,e,r){if(!i.length)return r(null,[]);let a=i.length;const s=new Array(i.length);let u=null;i.forEach((p,m)=>{e(p,(g,x)=>{g&&(u=g),s[m]=x,--a==0&&r(u,s)})})},h.bezier=mi,h.bindAll=Ji,h.cacheEntryPossiblyAdded=function(i){Cr++,Cr>nr&&(i.getActor().send("enforceCacheSizeLimit",Ar),Cr=0)},h.clamp=ne,h.clearTileCache=function(i){const e=caches.delete(_r);i&&e.catch(i).then(()=>i())},h.clipLine=Zc,h.clone=function(i){var e=new La(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},h.clone$1=et,h.collisionCircleLayout=xu,h.config=gr,h.create=function(){var i=new La(16);return La!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},h.createExpression=fa,h.createFilter=va,h.createLayout=Vt,h.createStyleLayer=function(i){return i.type==="custom"?new Yu(i):new Ju[i.type](i)},h.dot=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},h.ease=Ne,h.emitValidationErrors=fs,h.enforceCacheSizeLimit=function(i){yr(),Pi&&Pi.then(e=>{e.keys().then(r=>{for(let a=0;a{}}},h.identity=_l,h.invert=function(i,e){var r=e[0],a=e[1],s=e[2],u=e[3],p=e[4],m=e[5],g=e[6],x=e[7],w=e[8],z=e[9],T=e[10],A=e[11],C=e[12],O=e[13],V=e[14],X=e[15],K=r*m-a*p,W=r*g-s*p,ie=r*x-u*p,le=a*g-s*m,oe=a*x-u*m,Ee=s*x-u*g,Ae=w*O-z*C,_e=w*V-T*C,ye=w*X-A*C,pe=z*V-T*O,be=z*X-A*O,xe=T*X-A*V,he=K*xe-W*be+ie*pe+le*ye-oe*_e+Ee*Ae;return he?(i[0]=(m*xe-g*be+x*pe)*(he=1/he),i[1]=(s*be-a*xe-u*pe)*he,i[2]=(O*Ee-V*oe+X*le)*he,i[3]=(T*oe-z*Ee-A*le)*he,i[4]=(g*ye-p*xe-x*_e)*he,i[5]=(r*xe-s*ye+u*_e)*he,i[6]=(V*ie-C*Ee-X*W)*he,i[7]=(w*Ee-T*ie+A*W)*he,i[8]=(p*be-m*ye+x*Ae)*he,i[9]=(a*ye-r*be-u*Ae)*he,i[10]=(C*oe-O*ie+X*K)*he,i[11]=(z*ie-w*oe-A*K)*he,i[12]=(m*_e-p*pe-g*Ae)*he,i[13]=(r*pe-a*_e+s*Ae)*he,i[14]=(O*W-C*le-V*K)*he,i[15]=(w*le-z*W+T*K)*he,i):null},h.isImageBitmap=ir,h.isSafari=zn,h.keysDifference=function(i,e){const r=[];for(const a in i)a in e||r.push(a);return r},h.lazyLoadRTLTextPlugin=function(){Ii.isLoading()||Ii.isLoaded()||zo()!=="deferred"||Sa()},h.makeRequest=kr,h.mapObject=si,h.mercatorXfromLng=ih,h.mercatorYfromLat=rh,h.mercatorZfromAltitude=nh,h.mul=Ph,h.multiply=sc,h.nextPowerOfTwo=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},h.number=Mt,h.ortho=function(i,e,r,a,s,u,p){var m=1/(e-r),g=1/(a-s),x=1/(u-p);return i[0]=-2*m,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*g,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*x,i[11]=0,i[12]=(e+r)*m,i[13]=(s+a)*g,i[14]=(p+u)*x,i[15]=1,i},h.parseCacheControl=tr,h.parseGlyphPBF=function(i){return new Pl(i).readFields(ku,[])},h.pbf=Pl,h.performSymbolLayout=function(i,e,r,a,s,u,p){i.createArrays(),i.tilePixelRatio=Ut/(512*i.overscaling),i.compareText={},i.iconsNeedLinear=!1;const m=i.layers[0].layout,g=i.layers[0]._unevaluatedLayout._values,x={layoutIconSize:g["icon-size"].possiblyEvaluate(new yt(i.zoom+1),p),layoutTextSize:g["text-size"].possiblyEvaluate(new yt(i.zoom+1),p),textMaxSize:g["text-size"].possiblyEvaluate(new yt(18))};if(i.textSizeData.kind==="composite"){const{minZoom:C,maxZoom:O}=i.textSizeData;x.compositeTextSizes=[g["text-size"].possiblyEvaluate(new yt(C),p),g["text-size"].possiblyEvaluate(new yt(O),p)]}if(i.iconSizeData.kind==="composite"){const{minZoom:C,maxZoom:O}=i.iconSizeData;x.compositeIconSizes=[g["icon-size"].possiblyEvaluate(new yt(C),p),g["icon-size"].possiblyEvaluate(new yt(O),p)]}const w=m.get("text-line-height")*Ht,z=m.get("text-rotation-alignment")!=="viewport"&&m.get("symbol-placement")!=="point",T=m.get("text-keep-upright"),A=m.get("text-size");for(const C of i.features){const O=m.get("text-font").evaluate(C,{},p).join(","),V=A.evaluate(C,{},p),X=x.layoutTextSize.evaluate(C,{},p),K=x.layoutIconSize.evaluate(C,{},p),W={horizontal:{},vertical:void 0},ie=C.text;let le,oe=[0,0];if(ie){const _e=ie.toString(),ye=m.get("text-letter-spacing").evaluate(C,{},p)*Ht,pe=gs(_e)?ye:0,be=m.get("text-anchor").evaluate(C,{},p),xe=m.get("text-variable-anchor");if(!xe){const ot=m.get("text-radial-offset").evaluate(C,{},p);oe=ot?Wc(be,[ot*Ht,Rl]):m.get("text-offset").evaluate(C,{},p).map(vt=>vt*Ht)}let he=z?"center":m.get("text-justify").evaluate(C,{},p);const Me=m.get("symbol-placement"),Ce=Me==="point"?m.get("text-max-width").evaluate(C,{},p)*Ht:0,We=()=>{i.allowVerticalPlacement&&xo(_e)&&(W.vertical=Ls(ie,e,r,s,O,Ce,w,be,"left",pe,oe,h.WritingMode.vertical,!0,Me,X,V))};if(!z&&xe){const ot=he==="auto"?xe.map(bt=>Fl(bt)):[he];let vt=!1;for(let bt=0;btthis._layers[se.id]),$=B[0];if($.visibility==="none")continue;const U=$.source||"";let N=this.familiesBySource[U];N||(N=this.familiesBySource[U]={});const q=$.sourceLayer||"_geojsonTileLayer";let Q=N[q];Q||(Q=N[q]=[]),Q.push(B)}}}class Ne{constructor(v){const E={},k=[];for(const U in v){const N=v[U],q=E[U]={};for(const Q in N){const se=N[+Q];if(!se||se.bitmap.width===0||se.bitmap.height===0)continue;const Y={x:0,y:0,w:se.bitmap.width+2,h:se.bitmap.height+2};k.push(Y),q[Q]={rect:Y,metrics:se.metrics}}}const{w:L,h:B}=h.potpack(k),$=new h.AlphaImage({width:L||1,height:B||1});for(const U in v){const N=v[U];for(const q in N){const Q=N[+q];if(!Q||Q.bitmap.width===0||Q.bitmap.height===0)continue;const se=E[U][q].rect;h.AlphaImage.copy(Q.bitmap,$,{x:0,y:0},{x:se.x+1,y:se.y+1},Q.bitmap)}}this.image=$,this.positions=E}}h.register("GlyphAtlas",Ne);class ne{constructor(v){this.tileID=new h.OverscaledTileID(v.tileID.overscaledZ,v.tileID.wrap,v.tileID.canonical.z,v.tileID.canonical.x,v.tileID.canonical.y),this.uid=v.uid,this.zoom=v.zoom,this.pixelRatio=v.pixelRatio,this.tileSize=v.tileSize,this.source=v.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=v.showCollisionBoxes,this.collectResourceTiming=!!v.collectResourceTiming,this.returnDependencies=!!v.returnDependencies,this.promoteId=v.promoteId}parse(v,E,k,L,B){this.status="parsing",this.data=v,this.collisionBoxArray=new h.CollisionBoxArray;const $=new h.DictionaryCoder(Object.keys(v.layers).sort()),U=new h.FeatureIndex(this.tileID,this.promoteId);U.bucketLayerIDs=[];const N={},q={featureIndex:U,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:k},Q=E.familiesBySource[this.source];for(const qe in Q){const Ue=v.layers[qe];if(!Ue)continue;Ue.version===1&&h.warnOnce(`Vector tile source "${this.source}" layer "${qe}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Fe=$.encode(qe),Ct=[];for(let Tt=0;Tt=qt.maxzoom||qt.visibility!=="none"&&(Yi(Tt,this.zoom,k),(N[qt.id]=qt.createBucket({index:U.bucketLayerIDs.length,layers:Tt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Fe,sourceID:this.source})).populate(Ct,q,this.tileID.canonical),U.bucketLayerIDs.push(Tt.map(Zt=>Zt.id)))}}let se,Y,Se,ve;const Ie=h.mapObject(q.glyphDependencies,qe=>Object.keys(qe).map(Number));Object.keys(Ie).length?L.send("getGlyphs",{uid:this.uid,stacks:Ie},(qe,Ue)=>{se||(se=qe,Y=Ue,Xe.call(this))}):Y={};const ke=Object.keys(q.iconDependencies);ke.length?L.send("getImages",{icons:ke,source:this.source,tileID:this.tileID,type:"icons"},(qe,Ue)=>{se||(se=qe,Se=Ue,Xe.call(this))}):Se={};const tt=Object.keys(q.patternDependencies);function Xe(){if(se)return B(se);if(Y&&Se&&ve){const qe=new Ne(Y),Ue=new h.ImageAtlas(Se,ve);for(const Fe in N){const Ct=N[Fe];Ct instanceof h.SymbolBucket?(Yi(Ct.layers,this.zoom,k),h.performSymbolLayout(Ct,Y,qe.positions,Se,Ue.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ct.hasPattern&&(Ct instanceof h.LineBucket||Ct instanceof h.FillBucket||Ct instanceof h.FillExtrusionBucket)&&(Yi(Ct.layers,this.zoom,k),Ct.addFeatures(q,this.tileID.canonical,Ue.patternPositions))}this.status="done",B(null,{buckets:Object.values(N).filter(Fe=>!Fe.isEmpty()),featureIndex:U,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:qe.image,imageAtlas:Ue,glyphMap:this.returnDependencies?Y:null,iconMap:this.returnDependencies?Se:null,glyphPositions:this.returnDependencies?qe.positions:null})}}tt.length?L.send("getImages",{icons:tt,source:this.source,tileID:this.tileID,type:"patterns"},(qe,Ue)=>{se||(se=qe,ve=Ue,Xe.call(this))}):ve={},Xe.call(this)}}function Yi(D,v,E){const k=new h.EvaluationParameters(v);for(const L of D)L.recalculate(k,E)}function oi(D,v){const E=h.getArrayBuffer(D.request,(k,L,B,$)=>{k?v(k):L&&v(null,{vectorTile:new h.vectorTile.VectorTile(new h.pbf(L)),rawData:L,cacheControl:B,expires:$})});return()=>{E.cancel(),v()}}class zr{constructor(v,E,k,L){this.actor=v,this.layerIndex=E,this.availableImages=k,this.loadVectorData=L||oi,this.loading={},this.loaded={}}loadTile(v,E){const k=v.uid;this.loading||(this.loading={});const L=!!(v&&v.request&&v.request.collectResourceTiming)&&new h.RequestPerformance(v.request),B=this.loading[k]=new ne(v);B.abort=this.loadVectorData(v,($,U)=>{if(delete this.loading[k],$||!U)return B.status="done",this.loaded[k]=B,E($);const N=U.rawData,q={};U.expires&&(q.expires=U.expires),U.cacheControl&&(q.cacheControl=U.cacheControl);const Q={};if(L){const se=L.finish();se&&(Q.resourceTiming=JSON.parse(JSON.stringify(se)))}B.vectorTile=U.vectorTile,B.parse(U.vectorTile,this.layerIndex,this.availableImages,this.actor,(se,Y)=>{if(se||!Y)return E(se);E(null,h.extend({rawTileData:N.slice(0)},Y,q,Q))}),this.loaded=this.loaded||{},this.loaded[k]=B})}reloadTile(v,E){const k=this.loaded,L=v.uid,B=this;if(k&&k[L]){const $=k[L];$.showCollisionBoxes=v.showCollisionBoxes;const U=(N,q)=>{const Q=$.reloadCallback;Q&&(delete $.reloadCallback,$.parse($.vectorTile,B.layerIndex,this.availableImages,B.actor,Q)),E(N,q)};$.status==="parsing"?$.reloadCallback=U:$.status==="done"&&($.vectorTile?$.parse($.vectorTile,this.layerIndex,this.availableImages,this.actor,U):U())}}abortTile(v,E){const k=this.loading,L=v.uid;k&&k[L]&&k[L].abort&&(k[L].abort(),delete k[L]),E()}removeTile(v,E){const k=this.loaded,L=v.uid;k&&k[L]&&delete k[L],E()}}class Ji{constructor(){this.loaded={}}loadTile(v,E){const{uid:k,encoding:L,rawImageData:B}=v,$=h.isImageBitmap(B)?this.getImageData(B):B,U=new h.DEMData(k,$,L);this.loaded=this.loaded||{},this.loaded[k]=U,E(null,U)}getImageData(v){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(v.width,v.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=v.width,this.offscreenCanvas.height=v.height,this.offscreenCanvasContext.drawImage(v,0,0,v.width,v.height);const E=this.offscreenCanvasContext.getImageData(-1,-1,v.width+2,v.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new h.RGBAImage({width:E.width,height:E.height},E.data)}removeTile(v){const E=this.loaded,k=v.uid;E&&E[k]&&delete E[k]}}var si=function D(v,E){var k,L=v&&v.type;if(L==="FeatureCollection")for(k=0;k=Math.abs(U)?E-N+U:U-N+E,E=N}E+k>=0!=!!v&&D.reverse()}const zi=h.vectorTile.VectorTileFeature.prototype.toGeoJSON;class wt{constructor(v){this._feature=v,this.extent=h.EXTENT,this.type=v.type,this.properties=v.tags,"id"in v&&!isNaN(v.id)&&(this.id=parseInt(v.id,10))}loadGeometry(){if(this._feature.type===1){const v=[];for(const E of this._feature.geometry)v.push([new h.pointGeometry(E[0],E[1])]);return v}{const v=[];for(const E of this._feature.geometry){const k=[];for(const L of E)k.push(new h.pointGeometry(L[0],L[1]));v.push(k)}return v}}toGeoJSON(v,E,k){return zi.call(this,v,E,k)}}class li{constructor(v){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=h.EXTENT,this.length=v.length,this._features=v}feature(v){return new wt(this._features[v])}}var mr={exports:{}},er=h.pointGeometry,tr=h.vectorTile.VectorTileFeature,en=Sr;function Sr(D,v){this.options=v||{},this.features=D,this.length=D.length}function fr(D,v){this.id=typeof D.id=="number"?D.id:void 0,this.type=D.type,this.rawGeometry=D.type===1?[D.geometry]:D.geometry,this.properties=D.tags,this.extent=v||4096}Sr.prototype.feature=function(D){return new fr(this.features[D],this.options.extent)},fr.prototype.loadGeometry=function(){var D=this.rawGeometry;this.geometry=[];for(var v=0;v>31}function Ir(D,v){for(var E=D.loadGeometry(),k=D.type,L=0,B=0,$=E.length,U=0;U<$;U++){var N=E[U],q=1;k===1&&(q=N.length),v.writeVarint(_r(1,q));for(var Q=k===3?N.length-1:N.length,se=0;se>1;Cr(D,v,$,k,L,B%2),yr(D,v,E,k,$-1,B+1),yr(D,v,E,$+1,L,B+1)}function Cr(D,v,E,k,L,B){for(;L>k;){if(L-k>600){const q=L-k+1,Q=E-k+1,se=Math.log(q),Y=.5*Math.exp(2*se/3),Se=.5*Math.sqrt(se*Y*(q-Y)/q)*(Q-q/2<0?-1:1);Cr(D,v,E,Math.max(k,Math.floor(E-Q*Y/q+Se)),Math.min(L,Math.floor(E+(q-Q)*Y/q+Se)),B)}const $=v[2*E+B];let U=k,N=L;for(Mi(D,v,k,E),v[2*L+B]>$&&Mi(D,v,k,L);U$;)N--}v[2*k+B]===$?Mi(D,v,k,N):(N++,Mi(D,v,N,L)),N<=E&&(k=N+1),E<=N&&(L=N-1)}}function Mi(D,v,E,k){ar(D,E,k),ar(v,2*E,2*k),ar(v,2*E+1,2*k+1)}function ar(D,v,E){const k=D[v];D[v]=D[E],D[E]=k}function or(D,v,E,k){const L=D-E,B=v-k;return L*L+B*B}const tn=D=>D[0],Qn=D=>D[1];class Sn{constructor(v,E=tn,k=Qn,L=64,B=Float64Array){this.nodeSize=L,this.points=v;const $=v.length<65536?Uint16Array:Uint32Array,U=this.ids=new $(v.length),N=this.coords=new B(2*v.length);for(let q=0;q=U&&ve<=q&&Ie>=N&&Ie<=Q&&Se.push(B[Fe]);continue}const qe=Math.floor((Xe+tt)/2);ve=$[2*qe],Ie=$[2*qe+1],ve>=U&&ve<=q&&Ie>=N&&Ie<=Q&&Se.push(B[qe]);const Ue=(ke+1)%2;(ke===0?U<=ve:N<=Ie)&&(Y.push(Xe),Y.push(qe-1),Y.push(Ue)),(ke===0?q>=ve:Q>=Ie)&&(Y.push(qe+1),Y.push(tt),Y.push(Ue))}return Se}(this.ids,this.coords,v,E,k,L,this.nodeSize)}within(v,E,k){return function(L,B,$,U,N,q){const Q=[0,L.length-1,0],se=[],Y=N*N;for(;Q.length;){const Se=Q.pop(),ve=Q.pop(),Ie=Q.pop();if(ve-Ie<=q){for(let Ue=Ie;Ue<=ve;Ue++)or(B[2*Ue],B[2*Ue+1],$,U)<=Y&&se.push(L[Ue]);continue}const ke=Math.floor((Ie+ve)/2),tt=B[2*ke],Xe=B[2*ke+1];or(tt,Xe,$,U)<=Y&&se.push(L[ke]);const qe=(Se+1)%2;(Se===0?$-N<=tt:U-N<=Xe)&&(Q.push(Ie),Q.push(ke-1),Q.push(qe)),(Se===0?$+N>=tt:U+N>=Xe)&&(Q.push(ke+1),Q.push(ve),Q.push(qe))}return se}(this.ids,this.coords,v,E,k,this.nodeSize)}}const ea={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:D=>D},$t=Math.fround||(xr=new Float32Array(1),D=>(xr[0]=+D,xr[0]));var xr;class Tn{constructor(v){this.options=Ke(Object.create(ea),v),this.trees=new Array(this.options.maxZoom+1)}load(v){const{log:E,minZoom:k,maxZoom:L,nodeSize:B}=this.options;E&&console.time("total time");const $=`prepare ${v.length} points`;E&&console.time($),this.points=v;let U=[];for(let N=0;N=k;N--){const q=+Date.now();U=this._cluster(U,N),this.trees[N]=new Sn(U,Pr,vr,B,Float32Array),E&&console.log("z%d: %d clusters in %dms",N,U.length,+Date.now()-q)}return E&&console.timeEnd("total time"),this}getClusters(v,E){let k=((v[0]+180)%360+360)%360-180;const L=Math.max(-90,Math.min(90,v[1]));let B=v[2]===180?180:((v[2]+180)%360+360)%360-180;const $=Math.max(-90,Math.min(90,v[3]));if(v[2]-v[0]>=360)k=-180,B=180;else if(k>B){const Q=this.getClusters([k,L,180,$],E),se=this.getClusters([-180,L,B,$],E);return Q.concat(se)}const U=this.trees[this._limitZoom(E)],N=U.range($i(k),qi($),$i(B),qi(L)),q=[];for(const Q of N){const se=U.points[Q];q.push(se.numPoints?ta(se):this.points[se.index])}return q}getChildren(v){const E=this._getOriginId(v),k=this._getOriginZoom(v),L="No cluster with the specified id.",B=this.trees[k];if(!B)throw new Error(L);const $=B.points[E];if(!$)throw new Error(L);const U=this.options.radius/(this.options.extent*Math.pow(2,k-1)),N=B.within($.x,$.y,U),q=[];for(const Q of N){const se=B.points[Q];se.parentId===v&&q.push(se.numPoints?ta(se):this.points[se.index])}if(q.length===0)throw new Error(L);return q}getLeaves(v,E,k){const L=[];return this._appendLeaves(L,v,E=E||10,k=k||0,0),L}getTile(v,E,k){const L=this.trees[this._limitZoom(v)],B=Math.pow(2,v),{extent:$,radius:U}=this.options,N=U/$,q=(k-N)/B,Q=(k+1+N)/B,se={features:[]};return this._addTileFeatures(L.range((E-N)/B,q,(E+1+N)/B,Q),L.points,E,k,B,se),E===0&&this._addTileFeatures(L.range(1-N/B,q,1,Q),L.points,B,k,B,se),E===B-1&&this._addTileFeatures(L.range(0,q,N/B,Q),L.points,-1,k,B,se),se.features.length?se:null}getClusterExpansionZoom(v){let E=this._getOriginZoom(v)-1;for(;E<=this.options.maxZoom;){const k=this.getChildren(v);if(E++,k.length!==1)break;v=k[0].properties.cluster_id}return E}_appendLeaves(v,E,k,L,B){const $=this.getChildren(E);for(const U of $){const N=U.properties;if(N&&N.cluster?B+N.point_count<=L?B+=N.point_count:B=this._appendLeaves(v,N.cluster_id,k,L,B):BE&&(ve+=ke.numPoints||1)}if(ve>Se&&ve>=U){let Ie=Q.x*Se,ke=Q.y*Se,tt=$&&Se>1?this._map(Q,!0):null;const Xe=(q<<5)+(E+1)+this.points.length;for(const qe of Y){const Ue=se.points[qe];if(Ue.zoom<=E)continue;Ue.zoom=E;const Fe=Ue.numPoints||1;Ie+=Ue.x*Fe,ke+=Ue.y*Fe,Ue.parentId=Xe,$&&(tt||(tt=this._map(Q,!0)),$(tt,this._map(Ue)))}Q.parentId=Xe,k.push(kr(Ie/ve,ke/ve,Xe,ve,tt))}else if(k.push(Q),ve>1)for(const Ie of Y){const ke=se.points[Ie];ke.zoom<=E||(ke.zoom=E,k.push(ke))}}return k}_getOriginId(v){return v-this.points.length>>5}_getOriginZoom(v){return(v-this.points.length)%32}_map(v,E){if(v.numPoints)return E?Ke({},v.properties):v.properties;const k=this.points[v.index].properties,L=this.options.map(k);return E&&L===k?Ke({},L):L}}function kr(D,v,E,k,L){return{x:$t(D),y:$t(v),zoom:1/0,id:E,parentId:-1,numPoints:k,properties:L}}function Ni(D,v){const[E,k]=D.geometry.coordinates;return{x:$t($i(E)),y:$t(qi(k)),zoom:1/0,index:v,parentId:-1}}function ta(D){return{type:"Feature",id:D.id,properties:sr(D),geometry:{type:"Point",coordinates:[(v=D.x,360*(v-.5)),In(D.y)]}};var v}function sr(D){const v=D.numPoints,E=v>=1e4?`${Math.round(v/1e3)}k`:v>=1e3?Math.round(v/100)/10+"k":v;return Ke(Ke({},D.properties),{cluster:!0,cluster_id:D.id,point_count:v,point_count_abbreviated:E})}function $i(D){return D/360+.5}function qi(D){const v=Math.sin(D*Math.PI/180),E=.5-.25*Math.log((1+v)/(1-v))/Math.PI;return E<0?0:E>1?1:E}function In(D){const v=(180-360*D)*Math.PI/180;return 360*Math.atan(Math.exp(v))/Math.PI-90}function Ke(D,v){for(const E in v)D[E]=v[E];return D}function Pr(D){return D.x}function vr(D){return D.y}function Mr(D,v,E,k){for(var L,B=k,$=E-v>>1,U=E-v,N=D[v],q=D[v+1],Q=D[E],se=D[E+1],Y=v+3;YB)L=Y,B=Se;else if(Se===B){var ve=Math.abs(Y-$);vek&&(L-v>3&&Mr(D,v,L,k),D[L+2]=B,E-L>3&&Mr(D,L,E,k))}function An(D,v,E,k,L,B){var $=L-E,U=B-k;if($!==0||U!==0){var N=((D-E)*$+(v-k)*U)/($*$+U*U);N>1?(E=L,k=B):N>0&&(E+=$*N,k+=U*N)}return($=D-E)*$+(U=v-k)*U}function te(D,v,E,k){var L={id:D===void 0?null:D,type:v,geometry:E,tags:k,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(B){var $=B.geometry,U=B.type;if(U==="Point"||U==="MultiPoint"||U==="LineString")fe(B,$);else if(U==="Polygon"||U==="MultiLineString")for(var N=0;N<$.length;N++)fe(B,$[N]);else if(U==="MultiPolygon")for(N=0;N<$.length;N++)for(var q=0;q<$[N].length;q++)fe(B,$[N][q])}(L),L}function fe(D,v){for(var E=0;E0&&($+=k?(L*q-N*B)/2:Math.sqrt(Math.pow(N-L,2)+Math.pow(q-B,2))),L=N,B=q}var Q=v.length-3;v[2]=1,Mr(v,0,Q,E),v[Q+2]=1,v.size=Math.abs($),v.start=0,v.end=v.size}function Si(D,v,E,k){for(var L=0;L1?1:E}function ft(D,v,E,k,L,B,$,U){if(k/=v,B>=(E/=v)&&$=k)return null;for(var N=[],q=0;q=E&&ve=k)){var Ie=[];if(Y==="Point"||Y==="MultiPoint")de(se,Ie,E,k,L);else if(Y==="LineString")$e(se,Ie,E,k,L,!1,U.lineMetrics);else if(Y==="MultiLineString")ti(se,Ie,E,k,L,!1);else if(Y==="Polygon")ti(se,Ie,E,k,L,!0);else if(Y==="MultiPolygon")for(var ke=0;ke=E&&$<=k&&(v.push(D[B]),v.push(D[B+1]),v.push(D[B+2]))}}function $e(D,v,E,k,L,B,$){for(var U,N,q=Oe(D),Q=L===0?Ve:Br,se=D.start,Y=0;YE&&(N=Q(q,Se,ve,ke,tt,E),$&&(q.start=se+U*N)):Xe>k?qe=E&&(N=Q(q,Se,ve,ke,tt,E),Ue=!0),qe>k&&Xe<=k&&(N=Q(q,Se,ve,ke,tt,k),Ue=!0),!B&&Ue&&($&&(q.end=se+U*N),v.push(q),q=Oe(D)),$&&(se+=U)}var Fe=D.length-3;Se=D[Fe],ve=D[Fe+1],Ie=D[Fe+2],(Xe=L===0?Se:ve)>=E&&Xe<=k&&Di(q,Se,ve,Ie),Fe=q.length-3,B&&Fe>=3&&(q[Fe]!==q[0]||q[Fe+1]!==q[1])&&Di(q,q[0],q[1],q[2]),q.length&&v.push(q)}function Oe(D){var v=[];return v.size=D.size,v.start=D.start,v.end=D.end,v}function ti(D,v,E,k,L,B){for(var $=0;$$.maxX&&($.maxX=Q),se>$.maxY&&($.maxY=se)}return $}function Rr(D,v,E,k){var L=v.geometry,B=v.type,$=[];if(B==="Point"||B==="MultiPoint")for(var U=0;U0&&v.size<(L?$:k))E.numPoints+=v.length/3;else{for(var U=[],N=0;N$)&&(E.numSimplified++,U.push(v[N]),U.push(v[N+1])),E.numPoints++;L&&function(q,Q){for(var se=0,Y=0,Se=q.length,ve=Se-2;Y0===Q)for(Y=0,Se=q.length;Y24)throw new Error("maxZoom should be in the 0-24 range");if(v.promoteId&&v.generateId)throw new Error("promoteId and generateId cannot be used together.");var k=function(L,B){var $=[];if(L.type==="FeatureCollection")for(var U=0;U1&&console.time("creation"),Y=this.tiles[se]=Ti(D,v,E,k,N),this.tileCoords.push({z:v,x:E,y:k}),q)){q>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",v,E,k,Y.numFeatures,Y.numPoints,Y.numSimplified),console.timeEnd("creation"));var Se="z"+v;this.stats[Se]=(this.stats[Se]||0)+1,this.total++}if(Y.source=D,L){if(v===N.maxZoom||v===L)continue;var ve=1<1&&console.time("clipping");var Ie,ke,tt,Xe,qe,Ue,Fe=.5*N.buffer/N.extent,Ct=.5-Fe,Tt=.5+Fe,qt=1+Fe;Ie=ke=tt=Xe=null,qe=ft(D,Q,E-Fe,E+Tt,0,Y.minX,Y.maxX,N),Ue=ft(D,Q,E+Ct,E+qt,0,Y.minX,Y.maxX,N),D=null,qe&&(Ie=ft(qe,Q,k-Fe,k+Tt,1,Y.minY,Y.maxY,N),ke=ft(qe,Q,k+Ct,k+qt,1,Y.minY,Y.maxY,N),qe=null),Ue&&(tt=ft(Ue,Q,k-Fe,k+Tt,1,Y.minY,Y.maxY,N),Xe=ft(Ue,Q,k+Ct,k+qt,1,Y.minY,Y.maxY,N),Ue=null),q>1&&console.timeEnd("clipping"),U.push(Ie||[],v+1,2*E,2*k),U.push(ke||[],v+1,2*E,2*k+1),U.push(tt||[],v+1,2*E+1,2*k),U.push(Xe||[],v+1,2*E+1,2*k+1)}}},Bi.prototype.getTile=function(D,v,E){var k=this.options,L=k.extent,B=k.debug;if(D<0||D>24)return null;var $=1<1&&console.log("drilling down to z%d-%d-%d",D,v,E);for(var N,q=D,Q=v,se=E;!N&&q>0;)q--,Q=Math.floor(Q/2),se=Math.floor(se/2),N=this.tiles[Ri(q,Q,se)];return N&&N.source?(B>1&&console.log("found parent tile z%d-%d-%d",q,Q,se),B>1&&console.time("drilling down"),this.splitTile(N.source,q,Q,se,D,v,E),B>1&&console.timeEnd("drilling down"),this.tiles[U]?Pt(this.tiles[U],L):null):null};class rn extends zr{constructor(v,E,k,L){super(v,E,k,Cn),L&&(this.loadGeoJSON=L)}loadData(v,E){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=E,this._pendingLoadDataParams=v,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())}_loadData(){if(!this._pendingCallback||!this._pendingLoadDataParams)return;const v=this._pendingCallback,E=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;const k=!!(E&&E.request&&E.request.collectResourceTiming)&&new h.RequestPerformance(E.request);this.loadGeoJSON(E,(L,B)=>{if(L||!B)return v(L);if(typeof B!="object")return v(new Error(`Input data given to '${E.source}' is not a valid GeoJSON object.`));{si(B,!0);try{if(E.filter){const U=h.createExpression(E.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(U.result==="error")throw new Error(U.value.map(q=>`${q.key}: ${q.message}`).join(", "));const N=B.features.filter(q=>U.value.evaluate({zoom:0},q));B={type:"FeatureCollection",features:N}}this._geoJSONIndex=E.cluster?new Tn(function({superclusterOptions:U,clusterProperties:N}){if(!N||!U)return U;const q={},Q={},se={accumulated:null,zoom:0},Y={properties:null},Se=Object.keys(N);for(const ve of Se){const[Ie,ke]=N[ve],tt=h.createExpression(ke),Xe=h.createExpression(typeof Ie=="string"?[Ie,["accumulated"],["get",ve]]:Ie);q[ve]=tt.value,Q[ve]=Xe.value}return U.map=ve=>{Y.properties=ve;const Ie={};for(const ke of Se)Ie[ke]=q[ke].evaluate(se,Y);return Ie},U.reduce=(ve,Ie)=>{Y.properties=Ie;for(const ke of Se)se.accumulated=ve[ke],ve[ke]=Q[ke].evaluate(se,Y)},U}(E)).load(B.features):function(U,N){return new Bi(U,N)}(B,E.geojsonVtOptions)}catch(U){return v(U)}this.loaded={};const $={};if(k){const U=k.finish();U&&($.resourceTiming={},$.resourceTiming[E.source]=JSON.parse(JSON.stringify(U)))}v(null,$)}})}coalesce(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())}reloadTile(v,E){const k=this.loaded;return k&&k[v.uid]?super.reloadTile(v,E):this.loadTile(v,E)}loadGeoJSON(v,E){if(v.request)h.getJSON(v.request,E);else{if(typeof v.data!="string")return E(new Error(`Input data given to '${v.source}' is not a valid GeoJSON object.`));try{return E(null,JSON.parse(v.data))}catch{return E(new Error(`Input data given to '${v.source}' is not a valid GeoJSON object.`))}}}removeSource(v,E){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),E()}getClusterExpansionZoom(v,E){try{E(null,this._geoJSONIndex.getClusterExpansionZoom(v.clusterId))}catch(k){E(k)}}getClusterChildren(v,E){try{E(null,this._geoJSONIndex.getChildren(v.clusterId))}catch(k){E(k)}}getClusterLeaves(v,E){try{E(null,this._geoJSONIndex.getLeaves(v.clusterId,v.limit,v.offset))}catch(k){E(k)}}}class nn{constructor(v){this.self=v,this.actor=new h.Actor(v,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:zr,geojson:rn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(E,k)=>{if(this.workerSourceTypes[E])throw new Error(`Worker source with name "${E}" already registered.`);this.workerSourceTypes[E]=k},this.self.registerRTLTextPlugin=E=>{if(h.plugin.isParsed())throw new Error("RTL text plugin already registered.");h.plugin.applyArabicShaping=E.applyArabicShaping,h.plugin.processBidirectionalText=E.processBidirectionalText,h.plugin.processStyledBidirectionalText=E.processStyledBidirectionalText}}setReferrer(v,E){this.referrer=E}setImages(v,E,k){this.availableImages[v]=E;for(const L in this.workerSources[v]){const B=this.workerSources[v][L];for(const $ in B)B[$].availableImages=E}k()}setLayers(v,E,k){this.getLayerIndex(v).replace(E),k()}updateLayers(v,E,k){this.getLayerIndex(v).update(E.layers,E.removedIds),k()}loadTile(v,E,k){this.getWorkerSource(v,E.type,E.source).loadTile(E,k)}loadDEMTile(v,E,k){this.getDEMWorkerSource(v,E.source).loadTile(E,k)}reloadTile(v,E,k){this.getWorkerSource(v,E.type,E.source).reloadTile(E,k)}abortTile(v,E,k){this.getWorkerSource(v,E.type,E.source).abortTile(E,k)}removeTile(v,E,k){this.getWorkerSource(v,E.type,E.source).removeTile(E,k)}removeDEMTile(v,E){this.getDEMWorkerSource(v,E.source).removeTile(E)}removeSource(v,E,k){if(!this.workerSources[v]||!this.workerSources[v][E.type]||!this.workerSources[v][E.type][E.source])return;const L=this.workerSources[v][E.type][E.source];delete this.workerSources[v][E.type][E.source],L.removeSource!==void 0?L.removeSource(E,k):k()}loadWorkerSource(v,E,k){try{this.self.importScripts(E.url),k()}catch(L){k(L.toString())}}syncRTLPluginState(v,E,k){try{h.plugin.setState(E);const L=h.plugin.getPluginURL();if(h.plugin.isLoaded()&&!h.plugin.isParsed()&&L!=null){this.self.importScripts(L);const B=h.plugin.isParsed();k(B?void 0:new Error(`RTL Text Plugin failed to import scripts from ${L}`),B)}}catch(L){k(L.toString())}}getAvailableImages(v){let E=this.availableImages[v];return E||(E=[]),E}getLayerIndex(v){let E=this.layerIndexes[v];return E||(E=this.layerIndexes[v]=new mi),E}getWorkerSource(v,E,k){if(this.workerSources[v]||(this.workerSources[v]={}),this.workerSources[v][E]||(this.workerSources[v][E]={}),!this.workerSources[v][E][k]){const L={send:(B,$,U)=>{this.actor.send(B,$,U,v)}};this.workerSources[v][E][k]=new this.workerSourceTypes[E](L,this.getLayerIndex(v),this.getAvailableImages(v))}return this.workerSources[v][E][k]}getDEMWorkerSource(v,E){return this.demWorkerSources[v]||(this.demWorkerSources[v]={}),this.demWorkerSources[v][E]||(this.demWorkerSources[v][E]=new Ji),this.demWorkerSources[v][E]}enforceCacheSizeLimit(v,E){h.enforceCacheSizeLimit(E)}}return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope&&(self.worker=new nn(self)),nn}),Nt(["./shared"],function(h){var zt=Qt;function Qt(l){return!function(t){return typeof window=="undefined"||typeof document=="undefined"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var o,c,d=new Blob([""],{type:"text/javascript"}),f=URL.createObjectURL(d);try{c=new Worker(f),o=!0}catch{o=!1}return c&&c.terminate(),URL.revokeObjectURL(f),o}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var o=document.createElement("canvas");o.width=o.height=1;var c=o.getContext("2d");if(!c)return!1;var d=c.getImageData(0,0,1,1);return d&&d.width===o.width}()?(mi[n=t&&t.failIfMajorPerformanceCaveat]===void 0&&(mi[n]=function(o){var c,d=function(f){var _=document.createElement("canvas"),y=Object.create(Qt.webGLContextAttributes);return y.failIfMajorPerformanceCaveat=f,_.getContext("webgl",y)||_.getContext("experimental-webgl",y)}(o);if(!d)return!1;try{c=d.createShader(d.VERTEX_SHADER)}catch{return!1}return!(!c||d.isContextLost())&&(d.shaderSource(c,"void main() {}"),d.compileShader(c),d.getShaderParameter(c,d.COMPILE_STATUS)===!0)}(n)),mi[n]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var n}(l)}var mi={};function Ne(l,t){if(Array.isArray(l)){if(!Array.isArray(t)||l.length!==t.length)return!1;for(let n=0;n{window.removeEventListener("click",ne.suppressClickInternal,!0)},0)}static mousePos(t,n){const o=t.getBoundingClientRect();return new h.pointGeometry(n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop)}static touchPos(t,n){const o=t.getBoundingClientRect(),c=[];for(let d=0;d-1);y++,d[y]=_,f[y]=b,f[y+1]=li}for(let _=0,y=0;_{let _=this.entries[c];_||(_=this.entries[c]={glyphs:{},requests:{},ranges:{}});let y=_.glyphs[d];if(y!==void 0)return void f(null,{stack:c,id:d,glyph:y});if(y=this._tinySDF(_,c,d),y)return _.glyphs[d]=y,void f(null,{stack:c,id:d,glyph:y});const b=Math.floor(d/256);if(256*b>65535)return void f(new Error("glyphs > 65535 not supported"));if(_.ranges[b])return void f(null,{stack:c,id:d,glyph:y});let S=_.requests[b];S||(S=_.requests[b]=[],tr.loadGlyphRange(c,b,this.url,this.requestManager,(I,P)=>{if(P){for(const F in P)this._doesCharSupportLocalGlyph(+F)||(_.glyphs[+F]=P[+F]);_.ranges[b]=!0}for(const F of S)F(I,P);delete _.requests[b]})),S.push((I,P)=>{I?f(I):P&&f(null,{stack:c,id:d,glyph:P[d]||null})})},(c,d)=>{if(c)n(c);else if(d){const f={};for(const{stack:_,id:y,glyph:b}of d)(f[_]||(f[_]={}))[y]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics};n(null,f)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(h.unicodeBlockLookup["CJK Unified Ideographs"](t)||h.unicodeBlockLookup["Hangul Syllables"](t)||h.unicodeBlockLookup.Hiragana(t)||h.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,o){const c=this.localIdeographFontFamily;if(!c||!this._doesCharSupportLocalGlyph(o))return;let d=t.tinySDF;if(!d){let _="400";/bold/i.test(n)?_="900":/medium/i.test(n)?_="500":/light/i.test(n)&&(_="200"),d=t.tinySDF=new tr.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:c,fontWeight:_})}const f=d.draw(String.fromCharCode(o));return{id:o,bitmap:new h.AlphaImage({width:f.width||30,height:f.height||30},f.data),metrics:{width:f.glyphWidth||24,height:f.glyphHeight||24,left:f.glyphLeft||0,top:f.glyphTop-27||-8,advance:f.glyphAdvance||24}}}}tr.loadGlyphRange=function(l,t,n,o,c){const d=256*t,f=d+255,_=o.transformRequest(n.replace("{fontstack}",l).replace("{range}",`${d}-${f}`),h.ResourceType.Glyphs);h.getArrayBuffer(_,(y,b)=>{if(y)c(y);else if(b){const S={};for(const I of h.parseGlyphPBF(b))S[I.id]=I;c(null,S)}})},tr.TinySDF=class{constructor({fontSize:l=24,buffer:t=3,radius:n=8,cutoff:o=.25,fontFamily:c="sans-serif",fontWeight:d="normal",fontStyle:f="normal"}={}){this.buffer=t,this.cutoff=o,this.radius=n;const _=this.size=l+4*t,y=this._createCanvas(_),b=this.ctx=y.getContext("2d",{willReadFrequently:!0});b.font=`${f} ${d} ${l}px ${c}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(_*_),this.gridInner=new Float64Array(_*_),this.f=new Float64Array(_),this.z=new Float64Array(_+1),this.v=new Uint16Array(_)}_createCanvas(l){const t=document.createElement("canvas");return t.width=t.height=l,t}draw(l){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:o,actualBoundingBoxLeft:c,actualBoundingBoxRight:d}=this.ctx.measureText(l),f=Math.ceil(n),_=Math.min(this.size-this.buffer,Math.ceil(d-c)),y=Math.min(this.size-this.buffer,f+Math.ceil(o)),b=_+2*this.buffer,S=y+2*this.buffer,I=Math.max(b*S,0),P=new Uint8ClampedArray(I),F={data:P,width:b,height:S,glyphWidth:_,glyphHeight:y,glyphTop:f,glyphLeft:0,glyphAdvance:t};if(_===0||y===0)return F;const{ctx:M,buffer:R,gridInner:G,gridOuter:j}=this;M.clearRect(R,R,_,y),M.fillText(l,R,R+f);const H=M.getImageData(R,R,_,y);j.fill(li,0,I),G.fill(0,0,I);for(let Z=0;Z0?ce*ce:0,G[ee]=ce<0?ce*ce:0}}mr(j,0,0,b,S,b,this.f,this.v,this.z),mr(G,R,R,_,y,b,this.f,this.v,this.z);for(let Z=0;Z1&&(y=t[++_]);const S=Math.abs(b-y.left),I=Math.abs(b-y.right),P=Math.min(S,I);let F;const M=d/o*(c+1);if(y.isDash){const R=c-Math.abs(M);F=Math.sqrt(P*P+R*R)}else F=c-Math.sqrt(P*P+M*M);this.data[f+b]=Math.max(0,Math.min(255,F+128))}}}addRegularDash(t){for(let _=t.length-1;_>=0;--_){const y=t[_],b=t[_+1];y.zeroLength?t.splice(_,1):b&&b.isDash===y.isDash&&(b.left=y.left,t.splice(_,1))}const n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);const c=this.width*this.nextRow;let d=0,f=t[d];for(let _=0;_1&&(f=t[++d]);const y=Math.abs(_-f.left),b=Math.abs(_-f.right),S=Math.min(y,b);this.data[c+_]=Math.max(0,Math.min(255,(f.isDash?S:-S)+128))}}addDash(t,n){const o=n?7:0,c=2*o+1;if(this.nextRow+c>this.height)return h.warnOnce("LineAtlas out of space"),null;let d=0;for(let _=0;_{c.send(t,n,d)},o=o||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(t=>{t.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Tr(l,t,n){const o=function(c,d){if(c)return n(c);if(d){const f=h.pick(h.extend(d,l),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);d.vector_layers&&(f.vectorLayers=d.vector_layers,f.vectorLayerIds=f.vectorLayers.map(_=>_.id)),n(null,f)}};return l.url?h.getJSON(t.transformRequest(l.url,h.ResourceType.Source),o):h.exported.frame(()=>o(null,l))}ir.Actor=h.Actor;class De{constructor(t,n,o){this.bounds=h.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=o||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),o=Math.floor(h.mercatorXfromLng(this.bounds.getWest())*n),c=Math.floor(h.mercatorYfromLat(this.bounds.getNorth())*n),d=Math.ceil(h.mercatorXfromLng(this.bounds.getEast())*n),f=Math.ceil(h.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=o&&t.x=c&&t.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new De(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}loadTile(t,n){const o=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(o,h.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(f,_){return delete t.request,t.aborted?n(null):f&&f.status!==404?n(f):(_&&_.resourceTiming&&(t.resourceTiming=_.resourceTiming),this.map._refreshExpiredTiles&&_&&t.setExpiryData(_),t.loadVectorData(_,this.map.painter),h.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}c.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",c,d.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",c,d.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class gr extends h.Evented{constructor(t,n,o,c){super(),this.id=t,this.dispatcher=o,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h.extend({type:"raster"},n),h.extend(this,h.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Tr(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new De(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const o=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=h.getImage(this.map._requestManager.transformRequest(o,h.ResourceType.Tile),(c,d,f)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(c)t.state="errored",n(c);else if(d){this.map._refreshExpiredTiles&&t.setExpiryData(f);const _=this.map.painter.context,y=_.gl;t.texture=this.map.painter.getTileTexture(d.width),t.texture?t.texture.update(d,{useMipmap:!0}):(t.texture=new et(_,d,y.RGBA,{useMipmap:!0}),t.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),_.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax)),t.state="loaded",h.cacheEntryPossiblyAdded(this.dispatcher),n(null)}})}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}let _r;class Pi extends gr{constructor(t,n,o,c){super(t,n,o,c),this.type="raster-dem",this.maxzoom=22,this._options=h.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,n){const o=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function c(d,f){d&&(t.state="errored",n(d)),f&&(t.dem=f,t.needsHillshadePrepare=!0,t.state="loaded",n(null))}t.request=h.getImage(this.map._requestManager.transformRequest(o,h.ResourceType.Tile),function(d,f){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(d)t.state="errored",n(d);else if(f){this.map._refreshExpiredTiles&&t.setExpiryData(f),delete f.cacheControl,delete f.expires;const _=h.isImageBitmap(f)&&(_r==null&&(_r=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),_r)?f:h.exported.getImageData(f,1),y={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:_,encoding:this.encoding};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",y,c.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}_getNeighboringTiles(t){const n=t.canonical,o=Math.pow(2,n.z),c=(n.x-1+o)%o,d=n.x===0?t.wrap-1:t.wrap,f=(n.x+1+o)%o,_=n.x+1===o?t.wrap+1:t.wrap,y={};return y[new h.OverscaledTileID(t.overscaledZ,d,n.z,c,n.y).key]={backfilled:!1},y[new h.OverscaledTileID(t.overscaledZ,_,n.z,f,n.y).key]={backfilled:!1},n.y>0&&(y[new h.OverscaledTileID(t.overscaledZ,d,n.z,c,n.y-1).key]={backfilled:!1},y[new h.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new h.OverscaledTileID(t.overscaledZ,_,n.z,f,n.y-1).key]={backfilled:!1}),n.y+1{if(this._pendingLoads--,this._removed||d&&d.abandoned)return;let f=null;if(d&&d.resourceTiming&&d.resourceTiming[this.id]&&(f=d.resourceTiming[this.id].slice(0)),this.actor.send(`${this.type}.coalesce`,{source:n.source},null),c)return void this.fire(new h.ErrorEvent(c));const _={dataType:"source",sourceDataType:t};this._collectResourceTiming&&f&&f.length>0&&h.extend(_,{resourceTiming:f}),this.fire(new h.Event("data",_))})}loaded(){return this._pendingLoads===0}loadTile(t,n){const o=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const c={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(o,c,(d,f)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):d?n(d):(t.loadVectorData(f,this.map.painter,o==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return h.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ar=h.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class nr extends h.Evented{constructor(t,n,o,c){super(),this.id=t,this.dispatcher=o,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}load(t,n){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this.url=this.options.url,h.getImage(this.map._requestManager.transformRequest(this.url,h.ResourceType.Image),(o,c)=>{this._loaded=!0,o?this.fire(new h.ErrorEvent(o)):c&&(this.image=c,t&&(this.coordinates=t),n&&n(),this._finishLoading())})}loaded(){return this._loaded}updateImage(t){return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}setCoordinates(t){this.coordinates=t;const n=t.map(h.MercatorCoordinate.fromLngLat);this.tileID=function(c){let d=1/0,f=1/0,_=-1/0,y=-1/0;for(const P of c)d=Math.min(d,P.x),f=Math.min(f,P.y),_=Math.max(_,P.x),y=Math.max(y,P.y);const b=Math.max(_-d,y-f),S=Math.max(0,Math.floor(-Math.log(b)/Math.LN2)),I=Math.pow(2,S);return new h.CanonicalTileID(S,Math.floor((d+_)/2*I),Math.floor((f+y)/2*I))}(n),this.minzoom=this.maxzoom=this.tileID.z;const o=n.map(c=>this.tileID.getTilePoint(c)._round());return this._boundsArray=new h.RasterBoundsArray,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,h.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,h.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,h.EXTENT,h.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Ar.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new et(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));for(const o in this.tiles){const c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture)}}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class yr extends nr{constructor(t,n,o,c){super(t,n,o,c),this.roundZoom=!0,this.type="video",this.options=n}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,h.ResourceType.Source).url);h.getVideo(this.urls,(n,o)=>{this._loaded=!0,n?this.fire(new h.ErrorEvent(n)):o&&(this.video=o,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Ar.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new et(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));for(const o in this.tiles){const c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Cr extends nr{constructor(t,n,o,c){super(t,n,o,c),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new h.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,o=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Ar.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new et(n,this.canvas,o.RGBA,{premultiply:!0});for(const c in this.tiles){const d=this.tiles[c];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Mi={vector:rr,raster:gr,"raster-dem":Pi,geojson:Ir,video:yr,image:nr,canvas:Cr};function ar(l,t){const n=h.create();return h.translate(n,n,[1,1,0]),h.scale(n,n,[.5*l.width,.5*l.height,1]),h.multiply(n,n,l.calculatePosMatrix(t.toUnwrapped()))}function or(l,t,n,o,c,d){const f=function(I,P,F){if(I)for(const M of I){const R=P[M];if(R&&R.source===F&&R.type==="fill-extrusion")return!0}else for(const M in P){const R=P[M];if(R.source===F&&R.type==="fill-extrusion")return!0}return!1}(c&&c.layers,t,l.id),_=d.maxPitchScaleFactor(),y=l.tilesIn(o,_,f);y.sort(tn);const b=[];for(const I of y)b.push({wrappedTileID:I.tileID.wrapped().key,queryResults:I.tile.queryRenderedFeatures(t,n,l._state,I.queryGeometry,I.cameraQueryGeometry,I.scale,c,d,_,ar(l.transform,I.tileID))});const S=function(I){const P={},F={};for(const M of I){const R=M.queryResults,G=M.wrappedTileID,j=F[G]=F[G]||{};for(const H in R){const Z=R[H],ae=j[H]=j[H]||{},J=P[H]=P[H]||[];for(const ee of Z)ae[ee.featureIndex]||(ae[ee.featureIndex]=!0,J.push(ee))}}return P}(b);for(const I in S)S[I].forEach(P=>{const F=P.feature,M=l.getFeatureState(F.layer["source-layer"],F.id);F.source=F.layer.source,F.layer["source-layer"]&&(F.sourceLayer=F.layer["source-layer"]),F.state=M});return S}function tn(l,t){const n=l.tileID,o=t.tileID;return n.overscaledZ-o.overscaledZ||n.canonical.y-o.canonical.y||n.wrap-o.wrap||n.canonical.x-o.canonical.x}class Qn{constructor(t,n){this.tileID=t,this.uid=h.uniqueId(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const n=t+this.timeAdded;nd.getLayer(b)).filter(Boolean);if(y.length!==0){_.layers=y,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(b=>y.filter(S=>S.id===b)[0]));for(const b of y)f[b.id]=_}}return f}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const d=this.buckets[c];if(d instanceof h.SymbolBucket){if(this.hasSymbolBuckets=!0,!o)break;d.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const d=this.buckets[c];if(d instanceof h.SymbolBucket&&d.hasRTLText){this.hasRTLText=!0,h.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const c in this.buckets){const d=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(d))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new h.CollisionBoxArray}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const o in this.buckets){const c=this.buckets[o];c.uploadPending()&&c.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new et(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new et(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,o,c,d,f,_,y,b,S){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:d,scale:f,tileSize:this.tileSize,pixelPosMatrix:S,transform:y,params:_,queryPadding:this.queryPadding*b},t,n,o):{}}querySourceFeatures(t,n){const o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;const c=o.loadVTLayers(),d=n?n.sourceLayer:"",f=c._geojsonTileLayer||c[d];if(!f)return;const _=h.createFilter(n&&n.filter),{z:y,x:b,y:S}=this.tileID.canonical,I={z:y,x:b,y:S};for(let P=0;Po)c=!1;else if(n)if(this.expirationTime{this.remove(t,d)},o)),this.data[c].push(d),this.order.push(c),this.order.length>this.max){const f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const o=t.wrapped().key,c=n===void 0?0:this.data[o].indexOf(n),d=this.data[o][c];return this.data[o].splice(c,1),d.timeout&&clearTimeout(d.timeout),this.data[o].length===0&&delete this.data[o],this.onRemove(d.value),this.order.splice(this.order.indexOf(o),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const o in this.data)for(const c of this.data[o])t(c.value)||n.push(c);for(const o of n)this.remove(o.value.tileID,o)}}class ea{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,o){const c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},h.extend(this.stateChanges[t][c],o),this.deletedStates[t]===null){this.deletedStates[t]={};for(const d in this.state[t])d!==c&&(this.deletedStates[t][d]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(const d in this.state[t][c])o[d]||(this.deletedStates[t][c][d]=null)}else for(const d in o)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][d]===null&&delete this.deletedStates[t][c][d]}removeFeatureState(t,n,o){if(this.deletedStates[t]===null)return;const c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},o&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][o]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(o in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][o]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){const o=String(n),c=h.extend({},(this.state[t]||{})[o],(this.stateChanges[t]||{})[o]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const d=this.deletedStates[t][n];if(d===null)return{};for(const f in d)delete c[f]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const o={};for(const c in this.stateChanges){this.state[c]=this.state[c]||{};const d={};for(const f in this.stateChanges[c])this.state[c][f]||(this.state[c][f]={}),h.extend(this.state[c][f],this.stateChanges[c][f]),d[f]=this.state[c][f];o[c]=d}for(const c in this.deletedStates){this.state[c]=this.state[c]||{};const d={};if(this.deletedStates[c]===null)for(const f in this.state[c])d[f]={},this.state[c][f]={};else for(const f in this.deletedStates[c]){if(this.deletedStates[c][f]===null)this.state[c][f]={};else for(const _ of Object.keys(this.deletedStates[c][f]))delete this.state[c][f][_];d[f]=this.state[c][f]}o[c]=o[c]||{},h.extend(o[c],d)}if(this.stateChanges={},this.deletedStates={},Object.keys(o).length!==0)for(const c in t)t[c].setFeatureState(o,n)}}class $t extends h.Evented{constructor(t,n,o){super(),this.id=t,this.dispatcher=o,this.on("data",c=>{c.dataType==="source"&&c.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&c.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(c,d,f,_){const y=new Mi[d.type](c,d,f,_);if(y.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${y.id}`);return h.bindAll(["load","abort","unload","serialize","prepare"],y),y}(t,n,o,this),this._tiles={},this._cache=new Sn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ea}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new h.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const o=this._tiles[n];o.upload(t),o.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(xr).map(t=>t.key)}getRenderableIds(t){const n=[];for(const o in this._tiles)this._isIdRenderable(o,t)&&n.push(this._tiles[o]);return t?n.sort((o,c)=>{const d=o.tileID,f=c.tileID,_=new h.pointGeometry(d.canonical.x,d.canonical.y)._rotate(this.transform.angle),y=new h.pointGeometry(f.canonical.x,f.canonical.y)._rotate(this.transform.angle);return d.overscaledZ-f.overscaledZ||y.y-_.y||y.x-_.x}).map(o=>o.tileID.key):n.map(o=>o.tileID).sort(xr).map(o=>o.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){const o=this._tiles[t];o&&(o.state!=="loading"&&(o.state=n),this._loadTile(o,this._tileLoaded.bind(this,o,t,n)))}_tileLoaded(t,n,o,c){if(c)return t.state="errored",void(c.status!==404?this._source.fire(new h.ErrorEvent(c,{tile:t})):this.update(this.transform));t.timeAdded=h.exported.now(),o==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new h.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let c=0;c1||(Math.abs(f)>1&&(Math.abs(f+y)===1?f+=y:Math.abs(f-y)===1&&(f-=y)),d.dem&&c.dem&&(c.dem.backfillBorder(d.dem,f,_),c.neighboringTiles&&c.neighboringTiles[b]&&(c.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,o,c){for(const d in this._tiles){let f=this._tiles[d];if(c[d]||!f.hasData()||f.tileID.overscaledZ<=n||f.tileID.overscaledZ>o)continue;let _=f.tileID;for(;f&&f.tileID.overscaledZ>n+1;){const b=f.tileID.scaledTo(f.tileID.overscaledZ-1);f=this._tiles[b.key],f&&f.hasData()&&(_=b)}let y=_;for(;y.overscaledZ>n;)if(y=y.scaledTo(y.overscaledZ-1),t[y.key]){c[_.key]=_;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const o=this._loadedParentTiles[t.key];return o&&o.tileID.overscaledZ>=n?o:null}for(let o=t.overscaledZ-1;o>=n;o--){const c=t.scaledTo(o),d=this._getLoadedTile(c);if(d)return d}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,o=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*o*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._cache.setMaxSize(d)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const o={};for(const c in this._tiles){const d=this._tiles[c];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+n),o[d.tileID.key]=d}this._tiles=o;for(const c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(const c in this._tiles)this._setTileReloadTimer(c,this._tiles[c])}}update(t){if(this.transform=t,!this._sourceLoaded||this._paused)return;let n;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(y=>new h.OverscaledTileID(y.canonical.z,y.wrap,y.canonical.z,y.canonical.x,y.canonical.y)):(n=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(n=n.filter(y=>this._source.hasTile(y)))):n=[];const o=t.coveringZoomLevel(this._source),c=Math.max(o-$t.maxOverzooming,this._source.minzoom),d=Math.max(o+$t.maxUnderzooming,this._source.minzoom),f=this._updateRetainedTiles(n,o);if(Tn(this._source.type)){const y={},b={},S=Object.keys(f);for(const I of S){const P=f[I],F=this._tiles[I];if(!F||F.fadeEndTime&&F.fadeEndTime<=h.exported.now())continue;const M=this.findLoadedParent(P,c);M&&(this._addTile(M.tileID),y[M.tileID.key]=M.tileID),b[I]=P}this._retainLoadedChildren(b,o,d,f);for(const I in y)f[I]||(this._coveredTiles[I]=!0,f[I]=y[I])}for(const y in f)this._tiles[y].clearFadeHold();const _=h.keysDifference(this._tiles,f);for(const y of _){const b=this._tiles[y];b.hasSymbolBuckets&&!b.holdingForFade()?b.setHoldDuration(this.map._fadeDuration):b.hasSymbolBuckets&&!b.symbolFadeFinished()||this._removeTile(y)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const o={},c={},d=Math.max(n-$t.maxOverzooming,this._source.minzoom),f=Math.max(n+$t.maxUnderzooming,this._source.minzoom),_={};for(const y of t){const b=this._addTile(y);o[y.key]=y,b.hasData()||nthis._source.maxzoom){const I=y.children(this._source.maxzoom)[0],P=this.getTile(I);if(P&&P.hasData()){o[I.key]=I;continue}}else{const I=y.children(this._source.maxzoom);if(o[I[0].key]&&o[I[1].key]&&o[I[2].key]&&o[I[3].key])continue}let S=b.wasRequested();for(let I=y.overscaledZ-1;I>=d;--I){const P=y.scaledTo(I);if(c[P.key]||(c[P.key]=!0,b=this.getTile(P),!b&&S&&(b=this._addTile(P)),b&&(o[P.key]=P,S=b.wasRequested(),b.hasData())))break}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let o,c=this._tiles[t].tileID;for(;c.overscaledZ>0;){if(c.key in this._loadedParentTiles){o=this._loadedParentTiles[c.key];break}n.push(c.key);const d=c.scaledTo(c.overscaledZ-1);if(o=this._getLoadedTile(d),o)break;c=d}for(const d of n)this._loadedParentTiles[d]=o}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const o=n;return n||(n=new Qn(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,o||this._source.fire(new h.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const o=n.getExpiryTimeout();o&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},o))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,o){const c=[],d=this.transform;if(!d)return c;const f=o?d.getCameraQueryGeometry(t):t,_=t.map(M=>d.pointCoordinate(M)),y=f.map(M=>d.pointCoordinate(M)),b=this.getIds();let S=1/0,I=1/0,P=-1/0,F=-1/0;for(const M of y)S=Math.min(S,M.x),I=Math.min(I,M.y),P=Math.max(P,M.x),F=Math.max(F,M.y);for(let M=0;M=0&&Z[1].y+H>=0){const ae=_.map(ee=>G.getTilePoint(ee)),J=y.map(ee=>G.getTilePoint(ee));c.push({tile:R,tileID:G,queryGeometry:ae,cameraQueryGeometry:J,scale:j})}}return c}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(o=>this._tiles[o].tileID);for(const o of n)o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(Tn(this._source.type))for(const t in this._tiles){const n=this._tiles[t];if(n.fadeEndTime!==void 0&&n.fadeEndTime>=h.exported.now())return!0}return!1}setFeatureState(t,n,o){this._state.updateState(t=t||"_geojsonTileLayer",n,o)}removeFeatureState(t,n,o){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,o)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,o){const c=this._tiles[t];c&&c.setDependencies(n,o)}reloadTilesForDependencies(t,n){for(const o in this._tiles)this._tiles[o].hasDependency(t,n)&&this._reloadTile(o,"reloading");this._cache.filter(o=>!o.hasDependency(t,n))}}function xr(l,t){const n=Math.abs(2*l.wrap)-+(l.wrap<0),o=Math.abs(2*t.wrap)-+(t.wrap<0);return l.overscaledZ-t.overscaledZ||o-n||t.canonical.y-l.canonical.y||t.canonical.x-l.canonical.x}function Tn(l){return l==="raster"||l==="image"||l==="video"}$t.maxOverzooming=10,$t.maxUnderzooming=3;const kr="mapboxgl_preloaded_worker_pool";class Ni{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[kr]}numActive(){return Object.keys(this.active).length}}const ta=Math.floor(h.exported.hardwareConcurrency/2);let sr;function $i(){return sr||(sr=new Ni),sr}function qi(l,t){const n={};for(const o in l)o!=="ref"&&(n[o]=l[o]);return h.refProperties.forEach(o=>{o in t&&(n[o]=t[o])}),n}function In(l){l=l.slice();const t=Object.create(null);for(let n=0;n0?(c-f)/_:0;return this.points[d].mult(1-y).add(this.points[n].mult(y))}}function pt(l,t){let n=!0;return l==="always"||l!=="never"&&t!=="never"||(n=!1),n}class Si{constructor(t,n,o){const c=this.boxCells=[],d=this.circleCells=[];this.xCellCount=Math.ceil(t/o),this.yCellCount=Math.ceil(n/o);for(let f=0;fthis.width||c<0||n>this.height)return[];const y=[];if(t<=0&&n<=0&&this.width<=o&&this.height<=c){if(d)return[{key:null,x1:t,y1:n,x2:o,y2:c}];for(let b=0;b0}hitTestCircle(t,n,o,c,d){const f=t-o,_=t+o,y=n-o,b=n+o;if(_<0||f>this.width||b<0||y>this.height)return!1;const S=[];return this._forEachCell(f,y,_,b,this._queryCellCircle,S,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:o},seenUids:{box:{},circle:{}}},d),S.length>0}_queryCell(t,n,o,c,d,f,_,y){const{seenUids:b,hitTest:S,overlapMode:I}=_,P=this.boxCells[d];if(P!==null){const M=this.bboxes;for(const R of P)if(!b.box[R]){b.box[R]=!0;const G=4*R,j=this.boxKeys[R];if(t<=M[G+2]&&n<=M[G+3]&&o>=M[G+0]&&c>=M[G+1]&&(!y||y(j))&&(!S||!pt(I,j.overlapMode))&&(f.push({key:j,x1:M[G],y1:M[G+1],x2:M[G+2],y2:M[G+3]}),S))return!0}}const F=this.circleCells[d];if(F!==null){const M=this.circles;for(const R of F)if(!b.circle[R]){b.circle[R]=!0;const G=3*R,j=this.circleKeys[R];if(this._circleAndRectCollide(M[G],M[G+1],M[G+2],t,n,o,c)&&(!y||y(j))&&(!S||!pt(I,j.overlapMode))){const H=M[G],Z=M[G+1],ae=M[G+2];if(f.push({key:j,x1:H-ae,y1:Z-ae,x2:H+ae,y2:Z+ae}),S)return!0}}}return!1}_queryCellCircle(t,n,o,c,d,f,_,y){const{circle:b,seenUids:S,overlapMode:I}=_,P=this.boxCells[d];if(P!==null){const M=this.bboxes;for(const R of P)if(!S.box[R]){S.box[R]=!0;const G=4*R,j=this.boxKeys[R];if(this._circleAndRectCollide(b.x,b.y,b.radius,M[G+0],M[G+1],M[G+2],M[G+3])&&(!y||y(j))&&!pt(I,j.overlapMode))return f.push(!0),!0}}const F=this.circleCells[d];if(F!==null){const M=this.circles;for(const R of F)if(!S.circle[R]){S.circle[R]=!0;const G=3*R,j=this.circleKeys[R];if(this._circlesCollide(M[G],M[G+1],M[G+2],b.x,b.y,b.radius)&&(!y||y(j))&&!pt(I,j.overlapMode))return f.push(!0),!0}}}_forEachCell(t,n,o,c,d,f,_,y){const b=this._convertToXCellCoord(t),S=this._convertToYCellCoord(n),I=this._convertToXCellCoord(o),P=this._convertToYCellCoord(c);for(let F=b;F<=I;F++)for(let M=S;M<=P;M++)if(d.call(this,t,n,o,c,this.xCellCount*M+F,f,_,y))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,o,c,d,f){const _=c-t,y=d-n,b=o+f;return b*b>_*_+y*y}_circleAndRectCollide(t,n,o,c,d,f,_){const y=(f-c)/2,b=Math.abs(t-(c+y));if(b>y+o)return!1;const S=(_-d)/2,I=Math.abs(n-(d+S));if(I>S+o)return!1;if(b<=y||I<=S)return!0;const P=b-y,F=I-S;return P*P+F*F<=o*o}}function ei(l,t,n,o,c){const d=h.create();return t?(h.scale(d,d,[1/c,1/c,1]),n||h.rotateZ(d,d,o.angle)):h.multiply(d,o.labelPlaneMatrix,l),d}function Lr(l,t,n,o,c){if(t){const d=h.clone(l);return h.scale(d,d,[c,c,1]),n||h.rotateZ(d,d,-o.angle),d}return o.glCoordMatrix}function ft(l,t){const n=[l.x,l.y,0,1];dt(n,n,t);const o=n[3];return{point:new h.pointGeometry(n[0]/o,n[1]/o),signedDistanceFromCamera:o}}function de(l,t){return .5+l/t*.5}function $e(l,t){const n=l[0]/l[3],o=l[1]/l[3];return n>=-t[0]&&n<=t[0]&&o>=-t[1]&&o<=t[1]}function Oe(l,t,n,o,c,d,f,_,y){const b=o?l.textSizeData:l.iconSizeData,S=h.evaluateSizeForZoom(b,n.transform.zoom),I=[256/n.width*2+1,256/n.height*2+1],P=o?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;P.clear();const F=l.lineVertexArray,M=o?l.text.placedSymbolArray:l.icon.placedSymbolArray,R=n.transform.width/n.transform.height;let G=!1;for(let j=0;jMath.abs(n.x-t.x)*o?{useVertical:!0}:(l===h.WritingMode.vertical?t.yn.x)?{needsFlipping:!0}:null}function Ve(l,t,n,o,c,d,f,_,y,b,S,I,P,F,M){const R=t/24,G=l.lineOffsetX*R,j=l.lineOffsetY*R;let H;if(l.numGlyphs>1){const Z=l.glyphStartIndex+l.numGlyphs,ae=l.lineStartIndex,J=l.lineStartIndex+l.lineLength,ee=ti(R,_,G,j,n,S,I,l,y,d,P,M);if(!ee)return{notEnoughRoom:!0};const ce=ft(ee.first.point,f).point,ue=ft(ee.last.point,f).point;if(o&&!n){const re=Di(l.writingMode,ce,ue,F);if(re)return re}H=[ee.first];for(let re=l.glyphStartIndex+1;re0?ce.point:Br(I,ee,ae,1,c),re=Di(l.writingMode,ae,ue,F);if(re)return re}const Z=Li(R*_.getoffsetX(l.glyphStartIndex),G,j,n,S,I,l.segment,l.lineStartIndex,l.lineStartIndex+l.lineLength,y,d,P,M);if(!Z)return{notEnoughRoom:!0};H=[Z]}for(const Z of H)h.addDynamicAttributes(b,Z.point,Z.angle);return{}}function Br(l,t,n,o,c){const d=ft(l.add(l.sub(t)._unit()),c).point,f=n.sub(d);return n.add(f._mult(o/f.mag()))}function Li(l,t,n,o,c,d,f,_,y,b,S,I,P){const F=o?l-t:l+t;let M=F>0?1:-1,R=0;o&&(M*=-1,R=Math.PI),M<0&&(R+=Math.PI);let G=M>0?_+f:_+f+1,j=c,H=c,Z=0,ae=0;const J=Math.abs(F),ee=[];for(;Z+ae<=J;){if(G+=M,G<_||G>=y)return null;if(H=j,ee.push(j),j=I[G],j===void 0){const ge=new h.pointGeometry(b.getx(G),b.gety(G)),Le=ft(ge,S);if(Le.signedDistanceFromCamera>0)j=I[G]=Le.point;else{const Ye=G-M;j=Br(Z===0?d:new h.pointGeometry(b.getx(Ye),b.gety(Ye)),ge,H,J-Z+1,S)}}Z+=ae,ae=H.dist(j)}const ce=(J-Z)/ae,ue=j.sub(H),re=ue.mult(ce)._add(H);re._add(ue._unit()._perp()._mult(n*M));const ze=R+Math.atan2(j.y-H.y,j.x-H.x);return ee.push(re),{point:re,angle:P?ze:0,path:ee}}const cr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Pt(l,t){for(let n=0;n=1;Be--)Ge.push(Le.path[Be]);for(let Be=1;Beft(it,y));Ge=Be.some(it=>it.signedDistanceFromCamera<=0)?[]:Be.map(it=>it.point)}let St=[];if(Ge.length>0){const Be=Ge[0].clone(),it=Ge[0].clone();for(let ht=1;ht=re.x&&it.x<=ze.x&&Be.y>=re.y&&it.y<=ze.y?[Ge]:it.xze.x||it.yze.y?[]:h.clipLine([Ge],re.x,re.y,ze.x,ze.y)}for(const Be of St){ge.reset(Be,.25*ue);let it=0;it=ge.length<=.5*ue?1:Math.ceil(ge.paddedLength/He)+1;for(let ht=0;ht=this.screenRightBoundary||cthis.screenBottomBoundary}isInsideGrid(t,n,o,c){return o>=0&&t=0&&no.collisionGroupID===n}}return this.collisionGroups[t]}}function v(l,t,n,o,c){const{horizontalAlign:d,verticalAlign:f}=h.getAnchorAlignment(l),_=-(d-.5)*t,y=-(f-.5)*n,b=h.evaluateVariableOffset(l,o);return new h.pointGeometry(_+b[0]*c,y+b[1]*c)}function E(l,t,n,o,c,d){const{x1:f,x2:_,y1:y,y2:b,anchorPointX:S,anchorPointY:I}=l,P=new h.pointGeometry(t,n);return o&&P._rotate(c?d:-d),{x1:f+P.x,y1:y+P.y,x2:_+P.x,y2:b+P.y,anchorPointX:S,anchorPointY:I}}class k{constructor(t,n,o,c){this.transform=t.clone(),this.collisionIndex=new Rr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new D(o),this.collisionCircleArrays={},this.prevPlacement=c,c&&(c.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,o,c){const d=o.getBucket(n),f=o.latestFeatureIndex;if(!d||!f||n.id!==d.layerIds[0])return;const _=o.collisionBoxArray,y=d.layers[0].layout,b=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ),S=o.tileSize/h.EXTENT,I=this.transform.calculatePosMatrix(o.tileID.toUnwrapped()),P=y.get("text-pitch-alignment")==="map",F=y.get("text-rotation-alignment")==="map",M=Ft(o,1,this.transform.zoom),R=ei(I,P,F,this.transform,M);let G=null;if(P){const H=Lr(I,P,F,this.transform,M);G=h.multiply([],this.transform.labelPlaneMatrix,H)}this.retainedQueryData[d.bucketInstanceId]=new nn(d.bucketInstanceId,f,d.sourceLayerIndex,d.index,o.tileID);const j={bucket:d,layout:y,posMatrix:I,textLabelPlaneMatrix:R,labelToScreenMatrix:G,scale:b,textPixelRatio:S,holdingForFade:o.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:h.evaluateSizeForZoom(d.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(d.sourceID)};if(c)for(const H of d.sortKeyRanges){const{sortKey:Z,symbolInstanceStart:ae,symbolInstanceEnd:J}=H;t.push({sortKey:Z,symbolInstanceStart:ae,symbolInstanceEnd:J,parameters:j})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:d.symbolInstances.length,parameters:j})}attemptAnchorPlacement(t,n,o,c,d,f,_,y,b,S,I,P,F,M,R){const G=[P.textOffset0,P.textOffset1],j=v(t,o,c,G,d),H=this.collisionIndex.placeCollisionBox(E(n,j.x,j.y,f,_,this.transform.angle),I,y,b,S.predicate);if((!R||this.collisionIndex.placeCollisionBox(E(R,j.x,j.y,f,_,this.transform.angle),I,y,b,S.predicate).box.length!==0)&&H.box.length>0){let Z;return this.prevPlacement&&this.prevPlacement.variableOffsets[P.crossTileID]&&this.prevPlacement.placements[P.crossTileID]&&this.prevPlacement.placements[P.crossTileID].text&&(Z=this.prevPlacement.variableOffsets[P.crossTileID].anchor),this.variableOffsets[P.crossTileID]={textOffset:G,width:o,height:c,anchor:t,textBoxScale:d,prevAnchor:Z},this.markUsedJustification(F,t,P,M),F.allowVerticalPlacement&&(this.markUsedOrientation(F,M,P),this.placedOrientations[P.crossTileID]=M),{shift:j,placedGlyphBoxes:H}}}placeLayerBucketPart(t,n,o){const{bucket:c,layout:d,posMatrix:f,textLabelPlaneMatrix:_,labelToScreenMatrix:y,textPixelRatio:b,holdingForFade:S,collisionBoxArray:I,partiallyEvaluatedTextSize:P,collisionGroup:F}=t.parameters,M=d.get("text-optional"),R=d.get("icon-optional"),G=h.getOverlapMode(d,"text-overlap","text-allow-overlap"),j=G==="always",H=h.getOverlapMode(d,"icon-overlap","icon-allow-overlap"),Z=H==="always",ae=d.get("text-rotation-alignment")==="map",J=d.get("text-pitch-alignment")==="map",ee=d.get("icon-text-fit")!=="none",ce=d.get("symbol-z-order")==="viewport-y",ue=j&&(Z||!c.hasIconData()||R),re=Z&&(j||!c.hasTextData()||M);!c.collisionArrays&&I&&c.deserializeCollisionBoxes(I);const ze=(ge,Le)=>{if(n[ge.crossTileID])return;if(S)return void(this.placements[ge.crossTileID]=new Cn(!1,!1,!1));let Ye=!1,Ge=!1,He=!0,St=null,Be={box:null,offscreen:null},it={box:null,offscreen:null},ht=null,Xt=null,_i=null,Ai=0,Ci=0,wr=0;Le.textFeatureIndex?Ai=Le.textFeatureIndex:ge.useRuntimeCollisionCircles&&(Ai=ge.featureIndex),Le.verticalTextFeatureIndex&&(Ci=Le.verticalTextFeatureIndex);const pi=Le.textBox;if(pi){const yi=at=>{let Dt=h.WritingMode.horizontal;if(c.allowVerticalPlacement&&!at&&this.prevPlacement){const ii=this.prevPlacement.placedOrientations[ge.crossTileID];ii&&(this.placedOrientations[ge.crossTileID]=ii,Dt=ii,this.markUsedOrientation(c,Dt,ge))}return Dt},rt=(at,Dt)=>{if(c.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&Le.verticalTextBox){for(const ii of c.writingModes)if(ii===h.WritingMode.vertical?(Be=Dt(),it=Be):Be=at(),Be&&Be.box&&Be.box.length)break}else Be=at()};if(d.get("text-variable-anchor")){let at=d.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[ge.crossTileID]){const xt=this.prevPlacement.variableOffsets[ge.crossTileID];at.indexOf(xt.anchor)>0&&(at=at.filter(Zr=>Zr!==xt.anchor),at.unshift(xt.anchor))}const Dt=(xt,Zr,Zi)=>{const Ca=xt.x2-xt.x1,Io=xt.y2-xt.y1,ka=ge.textBoxScale,Es=ee&&H==="never"?Zr:null;let Xr={box:[],offscreen:!1};const Pa=G!=="never"?2*at.length:at.length;for(let Xi=0;Xi=at.length?G:"never",ge,c,Zi,Es);if(_n&&(Xr=_n.placedGlyphBoxes,Xr&&Xr.box&&Xr.box.length)){Ye=!0,St=_n.shift;break}}return Xr};rt(()=>Dt(pi,Le.iconBox,h.WritingMode.horizontal),()=>{const xt=Le.verticalTextBox;return c.allowVerticalPlacement&&!(Be&&Be.box&&Be.box.length)&&ge.numVerticalGlyphVertices>0&&xt?Dt(xt,Le.verticalIconBox,h.WritingMode.vertical):{box:null,offscreen:null}}),Be&&(Ye=Be.box,He=Be.offscreen);const ii=yi(Be&&Be.box);if(!Ye&&this.prevPlacement){const xt=this.prevPlacement.variableOffsets[ge.crossTileID];xt&&(this.variableOffsets[ge.crossTileID]=xt,this.markUsedJustification(c,xt.anchor,ge,ii))}}else{const at=(Dt,ii)=>{const xt=this.collisionIndex.placeCollisionBox(Dt,G,b,f,F.predicate);return xt&&xt.box&&xt.box.length&&(this.markUsedOrientation(c,ii,ge),this.placedOrientations[ge.crossTileID]=ii),xt};rt(()=>at(pi,h.WritingMode.horizontal),()=>{const Dt=Le.verticalTextBox;return c.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&Dt?at(Dt,h.WritingMode.vertical):{box:null,offscreen:null}}),yi(Be&&Be.box&&Be.box.length)}}if(ht=Be,Ye=ht&&ht.box&&ht.box.length>0,He=ht&&ht.offscreen,ge.useRuntimeCollisionCircles){const yi=c.text.placedSymbolArray.get(ge.centerJustifiedTextSymbolIndex),rt=h.evaluateSizeForFeature(c.textSizeData,P,yi),at=d.get("text-padding");Xt=this.collisionIndex.placeCollisionCircles(G,yi,c.lineVertexArray,c.glyphOffsetArray,rt,f,_,y,o,J,F.predicate,ge.collisionCircleDiameter,at),Ye=j||Xt.circles.length>0&&!Xt.collisionDetected,He=He&&Xt.offscreen}if(Le.iconFeatureIndex&&(wr=Le.iconFeatureIndex),Le.iconBox){const yi=rt=>{const at=ee&&St?E(rt,St.x,St.y,ae,J,this.transform.angle):rt;return this.collisionIndex.placeCollisionBox(at,H,b,f,F.predicate)};it&&it.box&&it.box.length&&Le.verticalIconBox?(_i=yi(Le.verticalIconBox),Ge=_i.box.length>0):(_i=yi(Le.iconBox),Ge=_i.box.length>0),He=He&&_i.offscreen}const ji=M||ge.numHorizontalGlyphVertices===0&&ge.numVerticalGlyphVertices===0,jr=R||ge.numIconVertices===0;if(ji||jr?jr?ji||(Ge=Ge&&Ye):Ye=Ge&&Ye:Ge=Ye=Ge&&Ye,Ye&&ht&&ht.box&&this.collisionIndex.insertCollisionBox(ht.box,G,d.get("text-ignore-placement"),c.bucketInstanceId,it&&it.box&&Ci?Ci:Ai,F.ID),Ge&&_i&&this.collisionIndex.insertCollisionBox(_i.box,H,d.get("icon-ignore-placement"),c.bucketInstanceId,wr,F.ID),Xt&&(Ye&&this.collisionIndex.insertCollisionCircles(Xt.circles,G,d.get("text-ignore-placement"),c.bucketInstanceId,Ai,F.ID),o)){const yi=c.bucketInstanceId;let rt=this.collisionCircleArrays[yi];rt===void 0&&(rt=this.collisionCircleArrays[yi]=new rn);for(let at=0;at=0;--Le){const Ye=ge[Le];ze(c.symbolInstances.get(Ye),c.collisionArrays[Ye])}}else for(let ge=t.symbolInstanceStart;ge=0&&(t.text.placedSymbolArray.get(_).crossTileID=d>=0&&_!==d?0:o.crossTileID)}markUsedOrientation(t,n,o){const c=n===h.WritingMode.horizontal||n===h.WritingMode.horizontalOnly?n:0,d=n===h.WritingMode.vertical?n:0,f=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];for(const _ of f)t.text.placedSymbolArray.get(_).placedOrientation=c;o.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).placedOrientation=d)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let o=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const c=n?n.symbolFadeChange(t):1,d=n?n.opacities:{},f=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(const y in this.placements){const b=this.placements[y],S=d[y];S?(this.opacities[y]=new Ri(S,c,b.text,b.icon),o=o||b.text!==S.text.placed||b.icon!==S.icon.placed):(this.opacities[y]=new Ri(null,c,b.text,b.icon,b.skipFade),o=o||b.text||b.icon)}for(const y in d){const b=d[y];if(!this.opacities[y]){const S=new Ri(b,c,!1,!1);S.isHidden()||(this.opacities[y]=S,o=o||b.text.placed||b.icon.placed)}}for(const y in f)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=f[y]);for(const y in _)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=_[y]);o?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const o={};for(const c of n){const d=c.getBucket(t);d&&c.latestFeatureIndex&&t.id===d.layerIds[0]&&this.updateBucketOpacities(d,o,c.collisionBoxArray)}}updateBucketOpacities(t,n,o){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,d=new Ri(null,0,!1,!1,!0),f=c.get("text-allow-overlap"),_=c.get("icon-allow-overlap"),y=c.get("text-variable-anchor"),b=c.get("text-rotation-alignment")==="map",S=c.get("text-pitch-alignment")==="map",I=c.get("icon-text-fit")!=="none",P=new Ri(null,0,f&&(_||!t.hasIconData()||c.get("icon-optional")),_&&(f||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&o&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(o);const F=(M,R,G)=>{for(let j=0;j0,J=this.placedOrientations[R.crossTileID],ee=J===h.WritingMode.vertical,ce=J===h.WritingMode.horizontal||J===h.WritingMode.horizontalOnly;if(G>0||j>0){const ue=Y(Z.text);F(t.text,G,ee?Se:ue),F(t.text,j,ce?Se:ue);const re=Z.text.isHidden();[R.rightJustifiedTextSymbolIndex,R.centerJustifiedTextSymbolIndex,R.leftJustifiedTextSymbolIndex].forEach(Le=>{Le>=0&&(t.text.placedSymbolArray.get(Le).hidden=re||ee?1:0)}),R.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(R.verticalPlacedTextSymbolIndex).hidden=re||ce?1:0);const ze=this.variableOffsets[R.crossTileID];ze&&this.markUsedJustification(t,ze.anchor,R,J);const ge=this.placedOrientations[R.crossTileID];ge&&(this.markUsedJustification(t,"left",R,ge),this.markUsedOrientation(t,ge,R))}if(ae){const ue=Y(Z.icon),re=!(I&&R.verticalPlacedIconSymbolIndex&&ee);R.placedIconSymbolIndex>=0&&(F(t.icon,R.numIconVertices,re?ue:Se),t.icon.placedSymbolArray.get(R.placedIconSymbolIndex).hidden=Z.icon.isHidden()),R.verticalPlacedIconSymbolIndex>=0&&(F(t.icon,R.numVerticalIconVertices,re?Se:ue),t.icon.placedSymbolArray.get(R.verticalPlacedIconSymbolIndex).hidden=Z.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ue=t.collisionArrays[M];if(ue){let re=new h.pointGeometry(0,0);if(ue.textBox||ue.verticalTextBox){let ge=!0;if(y){const Le=this.variableOffsets[H];Le?(re=v(Le.anchor,Le.width,Le.height,Le.textOffset,Le.textBoxScale),b&&re._rotate(S?this.transform.angle:-this.transform.angle)):ge=!1}ue.textBox&&L(t.textCollisionBox.collisionVertexArray,Z.text.placed,!ge||ee,re.x,re.y),ue.verticalTextBox&&L(t.textCollisionBox.collisionVertexArray,Z.text.placed,!ge||ce,re.x,re.y)}const ze=Boolean(!ce&&ue.verticalIconBox);ue.iconBox&&L(t.iconCollisionBox.collisionVertexArray,Z.icon.placed,ze,I?re.x:0,I?re.y:0),ue.verticalIconBox&&L(t.iconCollisionBox.collisionVertexArray,Z.icon.placed,!ze,I?re.x:0,I?re.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const M=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=M.invProjMatrix,t.placementViewportMatrix=M.viewportMatrix,t.collisionCircleArray=M.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function L(l,t,n,o,c){l.emplaceBack(t?1:0,n?1:0,o||0,c||0),l.emplaceBack(t?1:0,n?1:0,o||0,c||0),l.emplaceBack(t?1:0,n?1:0,o||0,c||0),l.emplaceBack(t?1:0,n?1:0,o||0,c||0)}const B=Math.pow(2,25),$=Math.pow(2,24),U=Math.pow(2,17),N=Math.pow(2,16),q=Math.pow(2,9),Q=Math.pow(2,8),se=Math.pow(2,1);function Y(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const t=l.placed?1:0,n=Math.floor(127*l.opacity);return n*B+t*$+n*U+t*N+n*q+t*Q+n*se+t}const Se=0;class ve{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,o,c,d){const f=this._bucketParts;for(;this._currentTileIndex_.sortKey-y.sortKey));this._currentPartIndex{const f=h.exported.now()-c;return!this._forceFullPlacement&&f>2};for(;this._currentPlacementIndex>=0;){const f=n[t[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if(f.type==="symbol"&&(!f.minzoom||f.minzoom<=_)&&(!f.maxzoom||f.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new ve(f)),this._inProgressLayer.continuePlacement(o[f.source],this.placement,this._showCollisionBoxes,f,d))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const ke=512/h.EXTENT/2;class tt{constructor(t,n,o){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=o;for(let c=0;ct.overscaledZ)for(const _ in f){const y=f[_];y.tileID.isChildOf(t)&&y.findMatches(n.symbolInstances,t,c)}else{const _=f[t.scaledTo(Number(d)).key];_&&_.findMatches(n.symbolInstances,t,c)}}for(let d=0;d{n[o]=!0});for(const o in this.layerIndexes)n[o]||delete this.layerIndexes[o]}}const Fe=(l,t)=>h.emitValidationErrors(l,t&&t.filter(n=>n.identifier!=="source.canvas")),Ct=h.pick(Ke,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Tt=h.pick(Ke,["setCenter","setZoom","setBearing","setPitch"]),qt=function(){const l={},t=h.spec.$version;for(const n in h.spec.$root){const o=h.spec.$root[n];if(o.required){let c=null;c=n==="version"?t:o.type==="array"?[]:{},c!=null&&(l[n]=c)}}return l}();class Zt extends h.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new ir($i(),this),this.imageManager=new wt,this.imageManager.setEventedParent(this),this.glyphManager=new tr(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new zn(256,512),this.crossTileSymbolIndex=new Ue,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new h.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",h.getReferrer());const o=this;this._rtlTextPluginCallback=Zt.registerForPluginStateChange(c=>{o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:c.pluginStatus,pluginURL:c.pluginURL},(d,f)=>{if(h.triggerPluginCompletionEvent(d),f&&f.every(_=>_))for(const _ in o.sourceCaches)o.sourceCaches[_].reload()})}),this.on("data",c=>{if(c.dataType!=="source"||c.sourceDataType!=="metadata")return;const d=this.sourceCaches[c.sourceId];if(!d)return;const f=d.getSource();if(f&&f.vectorLayerIds)for(const _ in this._layers){const y=this._layers[_];y.source===f.id&&this._validateLayer(y)}})}loadURL(t,n={}){this.fire(new h.Event("dataloading",{dataType:"style"}));const o=typeof n.validate!="boolean"||n.validate,c=this.map._requestManager.transformRequest(t,h.ResourceType.Style);this._request=h.getJSON(c,(d,f)=>{this._request=null,d?this.fire(new h.ErrorEvent(d)):f&&this._load(f,o)})}loadJSON(t,n={}){this.fire(new h.Event("dataloading",{dataType:"style"})),this._request=h.exported.frame(()=>{this._request=null,this._load(t,n.validate!==!1)})}loadEmpty(){this.fire(new h.Event("dataloading",{dataType:"style"})),this._load(qt,!1)}_load(t,n){if(n&&Fe(this,h.validateStyle(t)))return;this._loaded=!0,this.stylesheet=t;for(const c in t.sources)this.addSource(c,t.sources[c],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);const o=In(this.stylesheet.layers);this._order=o.map(c=>c.id),this._layers={},this._serializedLayers={};for(let c of o)c=h.createStyleLayer(c),c.setEventedParent(this,{layer:{id:c.id}}),this._layers[c.id]=c,this._serializedLayers[c.id]=c.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new fr(this.stylesheet.light),this.fire(new h.Event("data",{dataType:"style"})),this.fire(new h.Event("style.load"))}_loadSprite(t){this._spriteRequest=function(n,o,c,d){let f,_,y;const b=c>1?"@2x":"";let S=h.getJSON(o.transformRequest(o.normalizeSpriteURL(n,b,".json"),h.ResourceType.SpriteJSON),(F,M)=>{S=null,y||(y=F,f=M,P())}),I=h.getImage(o.transformRequest(o.normalizeSpriteURL(n,b,".png"),h.ResourceType.SpriteImage),(F,M)=>{I=null,y||(y=F,_=M,P())});function P(){if(y)d(y);else if(f&&_){const F=h.exported.getImageData(_),M={};for(const R in f){const{width:G,height:j,x:H,y:Z,sdf:ae,pixelRatio:J,stretchX:ee,stretchY:ce,content:ue}=f[R],re=new h.RGBAImage({width:G,height:j});h.RGBAImage.copy(F,re,{x:H,y:Z},{x:0,y:0},{width:G,height:j}),M[R]={data:re,pixelRatio:J,sdf:ae,stretchX:ee,stretchY:ce,content:ue}}d(null,M)}}return{cancel(){S&&(S.cancel(),S=null),I&&(I.cancel(),I=null)}}}(t,this.map._requestManager,this.map.getPixelRatio(),(n,o)=>{if(this._spriteRequest=null,n)this.fire(new h.ErrorEvent(n));else if(o)for(const c in o)this.imageManager.addImage(c,o[c]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))})}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const o=t.sourceLayer;if(!o)return;const c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(o)===-1)&&this.fire(new h.ErrorEvent(new Error(`Source layer "${o}" does not exist on source "${c.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(t){const n=[];for(const o of t){const c=this._layers[o];c.type!=="custom"&&n.push(c.serialize())}return n}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const c=Object.keys(this._updatedLayers),d=Object.keys(this._removedLayers);(c.length||d.length)&&this._updateWorkerLayers(c,d);for(const f in this._updatedSources){const _=this._updatedSources[f];_==="reload"?this._reloadSource(f):_==="clear"&&this._clearSource(f)}this._updateTilesForChangedImages();for(const f in this._updatedPaintProps)this._layers[f].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const o={};for(const c in this.sourceCaches){const d=this.sourceCaches[c];o[c]=d.used,d.used=!1}for(const c of this._order){const d=this._layers[c];d.recalculate(t,this._availableImages),!d.isHidden(t.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(const c in o){const d=this.sourceCaches[c];o[c]!==d.used&&d.fire(new h.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new h.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(t){if(this._checkLoaded(),Fe(this,h.validateStyle(t)))return!1;(t=h.clone$1(t)).layers=In(t.layers);const n=function(c,d){if(!c)return[{command:Ke.setStyle,args:[d]}];let f=[];try{if(!Ne(c.version,d.version))return[{command:Ke.setStyle,args:[d]}];Ne(c.center,d.center)||f.push({command:Ke.setCenter,args:[d.center]}),Ne(c.zoom,d.zoom)||f.push({command:Ke.setZoom,args:[d.zoom]}),Ne(c.bearing,d.bearing)||f.push({command:Ke.setBearing,args:[d.bearing]}),Ne(c.pitch,d.pitch)||f.push({command:Ke.setPitch,args:[d.pitch]}),Ne(c.sprite,d.sprite)||f.push({command:Ke.setSprite,args:[d.sprite]}),Ne(c.glyphs,d.glyphs)||f.push({command:Ke.setGlyphs,args:[d.glyphs]}),Ne(c.transition,d.transition)||f.push({command:Ke.setTransition,args:[d.transition]}),Ne(c.light,d.light)||f.push({command:Ke.setLight,args:[d.light]});const _={},y=[];(function(S,I,P,F){let M;for(M in I=I||{},S=S||{})Object.prototype.hasOwnProperty.call(S,M)&&(Object.prototype.hasOwnProperty.call(I,M)||vr(M,P,F));for(M in I)Object.prototype.hasOwnProperty.call(I,M)&&(Object.prototype.hasOwnProperty.call(S,M)?Ne(S[M],I[M])||(S[M].type==="geojson"&&I[M].type==="geojson"&&An(S,I,M)?P.push({command:Ke.setGeoJSONSourceData,args:[M,I[M].data]}):Mr(M,I,P,F)):Pr(M,I,P))})(c.sources,d.sources,y,_);const b=[];c.layers&&c.layers.forEach(S=>{_[S.source]?f.push({command:Ke.removeLayer,args:[S.id]}):b.push(S)}),f=f.concat(y),function(S,I,P){I=I||[];const F=(S=S||[]).map(fe),M=I.map(fe),R=S.reduce(Dr,{}),G=I.reduce(Dr,{}),j=F.slice(),H=Object.create(null);let Z,ae,J,ee,ce,ue,re;for(Z=0,ae=0;Z!(c.command in Tt));if(n.length===0)return!1;const o=n.filter(c=>!(c.command in Ct));if(o.length>0)throw new Error(`Unimplemented: ${o.map(c=>c.command).join(", ")}.`);return n.forEach(c=>{c.command!=="setTransition"&&this[c.command].apply(this,c.args)}),this.stylesheet=t,!0}addImage(t,n){if(this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,o={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(h.validateStyle.source,`sources.${t}`,n,null,o))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const c=this.sourceCaches[t]=new $t(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:c.serialize(),sourceId:t})),c.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const o in this._layers)if(this._layers[o].source===t)return this.fire(new h.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${o}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new h.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){this._checkLoaded(),this.sourceCaches[t].getSource().setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,o={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new h.ErrorEvent(new Error(`Layer "${c}" already exists on this map.`)));let d;if(t.type==="custom"){if(Fe(this,h.validateCustomStyleLayer(t)))return;d=h.createStyleLayer(t)}else{if(typeof t.source=="object"&&(this.addSource(c,t.source),t=h.clone$1(t),t=h.extend(t,{source:c})),this._validate(h.validateStyle.layer,`layers.${c}`,t,{arrayIndex:-1},o))return;d=h.createStyleLayer(t),this._validateLayer(d),d.setEventedParent(this,{layer:{id:c}}),this._serializedLayers[d.id]=d.serialize()}const f=n?this._order.indexOf(n):this._order.length;if(n&&f===-1)this.fire(new h.ErrorEvent(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(f,0,c),this._layerOrderChanged=!0,this._layers[c]=d,this._removedLayers[c]&&d.source&&d.type!=="custom"){const _=this._removedLayers[c];delete this._removedLayers[c],_.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new h.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const o=this._order.indexOf(t);this._order.splice(o,1);const c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new h.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new h.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const o=this._order.indexOf(t);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,o){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===o||(n!=null&&(c.minzoom=n),o!=null&&(c.maxzoom=o),this._updateLayer(c)):this.fire(new h.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,o={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!Ne(c.filter,n))return n==null?(c.filter=void 0,void this._updateLayer(c)):void(this._validate(h.validateStyle.filter,`layers.${c.id}.filter`,n,null,o)||(c.filter=h.clone$1(n),this._updateLayer(c)))}else this.fire(new h.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return h.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,o,c={}){this._checkLoaded();const d=this.getLayer(t);d?Ne(d.getLayoutProperty(n),o)||(d.setLayoutProperty(n,o,c),this._updateLayer(d)):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const o=this.getLayer(t);if(o)return o.getLayoutProperty(n);this.fire(new h.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,o,c={}){this._checkLoaded();const d=this.getLayer(t);d?Ne(d.getPaintProperty(n),o)||(d.setPaintProperty(n,o,c)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const o=t.source,c=t.sourceLayer,d=this.sourceCaches[o];if(d===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)));const f=d.getSource().type;f==="geojson"&&c?this.fire(new h.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):f!=="vector"||c?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(c,t.id,n)):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const o=t.source,c=this.sourceCaches[o];if(c===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)));const d=c.getSource().type,f=d==="vector"?t.sourceLayer:void 0;d!=="vector"||f?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new h.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(f,t.id,n):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,o=t.sourceLayer,c=this.sourceCaches[n];if(c!==void 0)return c.getSource().type!=="vector"||o?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),c.getFeatureState(o,t.id)):void this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new h.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return h.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return h.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:h.mapObject(this.sourceCaches,t=>t.serialize()),layers:this._serializeLayers(this._order)},t=>t!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=f=>this._layers[f].type==="fill-extrusion",o={},c=[];for(let f=this._order.length-1;f>=0;f--){const _=this._order[f];if(n(_)){o[_]=f;for(const y of t){const b=y[_];if(b)for(const S of b)c.push(S)}}}c.sort((f,_)=>_.intersectionZ-f.intersectionZ);const d=[];for(let f=this._order.length-1;f>=0;f--){const _=this._order[f];if(n(_))for(let y=c.length-1;y>=0;y--){const b=c[y].feature;if(o[b.layer.id]{const ce=G.featureSortOrder;if(ce){const ue=ce.indexOf(J.featureIndex);return ce.indexOf(ee.featureIndex)-ue}return ee.featureIndex-J.featureIndex});for(const J of ae)Z.push(J)}}for(const G in F)F[G].forEach(j=>{const H=j.feature,Z=y[f[G].source].getFeatureState(H.layer["source-layer"],H.id);H.source=H.layer.source,H.layer["source-layer"]&&(H.sourceLayer=H.layer["source-layer"]),H.state=Z});return F}(this._layers,this._serializedLayers,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(d)}querySourceFeatures(t,n){n&&n.filter&&this._validate(h.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);const o=this.sourceCaches[t];return o?function(c,d){const f=c.getRenderableIds().map(b=>c.getTileByID(b)),_=[],y={};for(let b=0;bP.getTileByID(F)).sort((F,M)=>M.tileID.overscaledZ-F.tileID.overscaledZ||(F.tileID.isLessThan(M.tileID)?-1:1))}const I=this.crossTileSymbolIndex.addLayer(S,y[S.source],t.center.lng);f=f||I}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||o===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(h.exported.now(),t.zoom))&&(this.pauseablePlacement=new Ie(t,this._order,d,n,o,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(h.exported.now()),_=!0),f&&this.pauseablePlacement.placement.setStale()),_||f)for(const b of this._order){const S=this._layers[b];S.type==="symbol"&&this.placement.updateLayerOpacities(S,y[S.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(h.exported.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,o){this.imageManager.getImages(n.icons,o),this._updateTilesForChangedImages();const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,o){this.glyphManager.getGlyphs(n.stacks,o)}getResource(t,n,o){return h.makeRequest(n,o)}}Zt.getSourceType=function(l){return Mi[l]},Zt.setSourceType=function(l,t){Mi[l]=t},Zt.registerForPluginStateChange=h.registerForPluginStateChange;var qa=h.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ga={prelude:mt(`#ifdef GL_ES -precision mediump float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif`,`#ifdef GL_ES -precision highp float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 -);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),background:mt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:mt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:mt(`varying vec3 v_data; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:mt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:mt(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:mt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:mt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:mt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:mt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),fill:mt(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_FragColor=color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:mt(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:mt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:mt(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:mt(`varying vec4 v_color;void main() {gl_FragColor=v_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color; -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:mt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 -? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:mt(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:mt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; -#define PI 3.141592653589793 -void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:mt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),lineGradient:mt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),linePattern:mt(`#ifdef GL_ES -precision highp float; -#endif -uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:mt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:mt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:mt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),symbolSDF:mt(`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:mt(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`)};function mt(l,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=t.match(/attribute ([\w]+) ([\w]+)/g),c=l.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=d?d.concat(c):c,_={};return{fragmentSource:l=l.replace(n,(y,b,S,I,P)=>(_[P]=!0,b==="define"?` -#ifndef HAS_UNIFORM_u_${P} -varying ${S} ${I} ${P}; -#else -uniform ${S} ${I} u_${P}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${P} - ${S} ${I} ${P} = u_${P}; -#endif -`)),vertexSource:t=t.replace(n,(y,b,S,I,P)=>{const F=I==="float"?"vec2":"vec4",M=P.match(/color/)?"color":F;return _[P]?b==="define"?` -#ifndef HAS_UNIFORM_u_${P} -uniform lowp float u_${P}_t; -attribute ${S} ${F} a_${P}; -varying ${S} ${I} ${P}; -#else -uniform ${S} ${I} u_${P}; -#endif -`:M==="vec4"?` -#ifndef HAS_UNIFORM_u_${P} - ${P} = a_${P}; -#else - ${S} ${I} ${P} = u_${P}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${P} - ${P} = unpack_mix_${M}(a_${P}, u_${P}_t); -#else - ${S} ${I} ${P} = u_${P}; -#endif -`:b==="define"?` -#ifndef HAS_UNIFORM_u_${P} -uniform lowp float u_${P}_t; -attribute ${S} ${F} a_${P}; -#else -uniform ${S} ${I} u_${P}; -#endif -`:M==="vec4"?` -#ifndef HAS_UNIFORM_u_${P} - ${S} ${I} ${P} = a_${P}; -#else - ${S} ${I} ${P} = u_${P}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${P} - ${S} ${I} ${P} = unpack_mix_${M}(a_${P}, u_${P}_t); -#else - ${S} ${I} ${P} = u_${P}; -#endif -`}),staticAttributes:o,staticUniforms:f}}class Zs{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,o,c,d,f,_,y){this.context=t;let b=this.boundPaintVertexBuffers.length!==c.length;for(let S=0;!b&&S>16,_>>16],u_pixel_coord_lower:[65535&f,65535&_]}}const jo=(l,t,n,o)=>{const c=t.style.light,d=c.properties.get("position"),f=[d.x,d.y,d.z],_=function(){var b=new h.ARRAY_TYPE(9);return h.ARRAY_TYPE!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b}();c.properties.get("anchor")==="viewport"&&function(b,S){var I=Math.sin(S),P=Math.cos(S);b[0]=P,b[1]=I,b[2]=0,b[3]=-I,b[4]=P,b[5]=0,b[6]=0,b[7]=0,b[8]=1}(_,-t.transform.angle),function(b,S,I){var P=S[0],F=S[1],M=S[2];b[0]=P*I[0]+F*I[3]+M*I[6],b[1]=P*I[1]+F*I[4]+M*I[7],b[2]=P*I[2]+F*I[5]+M*I[8]}(f,f,_);const y=c.properties.get("color");return{u_matrix:l,u_lightpos:f,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+n,u_opacity:o}},Xa=(l,t,n,o,c,d,f)=>h.extend(jo(l,t,n,o),Za(d,t,f),{u_height_factor:-Math.pow(2,c.overscaledZ)/f.tileSize/8}),Ha=l=>({u_matrix:l}),Wa=(l,t,n,o)=>h.extend(Ha(l),Za(n,t,o)),Zo=(l,t)=>({u_matrix:l,u_world:t}),Xo=(l,t,n,o,c)=>h.extend(Wa(l,t,n,o),{u_world:c}),Fr=(l,t,n,o)=>{const c=l.transform;let d,f;if(o.paint.get("circle-pitch-alignment")==="map"){const _=Ft(n,1,c.zoom);d=!0,f=[_,_]}else d=!1,f=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(o.paint.get("circle-pitch-scale")==="map"),u_matrix:l.translatePosMatrix(t.posMatrix,n,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_pitch_with_map:+d,u_device_pixel_ratio:l.pixelRatio,u_extrude_scale:f}},ia=(l,t,n)=>{const o=Ft(n,1,t.zoom),c=Math.pow(2,t.zoom-n.tileID.overscaledZ),d=n.tileID.overscaleFactor();return{u_matrix:l,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:o,u_extrude_scale:[t.pixelsToGLUnits[0]/(o*c),t.pixelsToGLUnits[1]/(o*c)],u_overscale_factor:d}},an=(l,t,n=1)=>({u_matrix:l,u_color:t,u_overlay:0,u_overlay_scale:n}),kn=l=>({u_matrix:l}),ra=(l,t,n,o)=>({u_matrix:l,u_extrude_scale:Ft(t,1,n),u_intensity:o});function na(l,t){const n=Math.pow(2,t.canonical.z),o=t.canonical.y;return[new h.MercatorCoordinate(0,o/n).toLngLat().lat,new h.MercatorCoordinate(0,(o+1)/n).toLngLat().lat]}const Pn=(l,t,n)=>{const o=l.transform;return{u_matrix:Ka(l,t,n),u_ratio:1/Ft(t,1,o.zoom),u_device_pixel_ratio:l.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},aa=(l,t,n,o)=>h.extend(Pn(l,t,n),{u_image:0,u_image_height:o}),Mn=(l,t,n,o)=>{const c=l.transform,d=Dn(t,c);return{u_matrix:Ka(l,t,n),u_texsize:t.imageAtlasTexture.size,u_ratio:1/Ft(t,1,c.zoom),u_device_pixel_ratio:l.pixelRatio,u_image:0,u_scale:[d,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},Mt=(l,t,n,o,c)=>{const d=l.lineAtlas,f=Dn(t,l.transform),_=n.layout.get("line-cap")==="round",y=d.getDash(o.from,_),b=d.getDash(o.to,_),S=y.width*c.fromScale,I=b.width*c.toScale;return h.extend(Pn(l,t,n),{u_patternscale_a:[f/S,-y.height/2],u_patternscale_b:[f/I,-b.height/2],u_sdfgamma:d.width/(256*Math.min(S,I)*l.pixelRatio)/2,u_image:0,u_tex_y_a:y.y,u_tex_y_b:b.y,u_mix:c.t})};function Dn(l,t){return 1/Ft(l,1,t.tileZoom)}function Ka(l,t,n){return l.translatePosMatrix(t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Ho=(l,t,n,o,c)=>{return{u_matrix:l,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:o.mix,u_opacity:o.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(f=c.paint.get("raster-saturation"),f>0?1-1/(1.001-f):-f),u_contrast_factor:(d=c.paint.get("raster-contrast"),d>0?1/(1-d):1+d),u_spin_weights:Wo(c.paint.get("raster-hue-rotate"))};var d,f};function Wo(l){l*=Math.PI/180;const t=Math.sin(l),n=Math.cos(l);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const oa=(l,t,n,o,c,d,f,_,y,b)=>{const S=c.transform;return{u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:S.cameraToCenterDistance,u_pitch:S.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:S.width/S.height,u_fade_change:c.options.fadeDuration?c.symbolFadeChange:1,u_matrix:d,u_label_plane_matrix:f,u_coord_matrix:_,u_is_text:+y,u_pitch_with_map:+o,u_texsize:b,u_texture:0}},Ya=(l,t,n,o,c,d,f,_,y,b,S)=>{const I=c.transform;return h.extend(oa(l,t,n,o,c,d,f,_,y,b),{u_gamma_scale:o?Math.cos(I._pitch)*I.cameraToCenterDistance:1,u_device_pixel_ratio:c.pixelRatio,u_is_halo:+S})},Hs=(l,t,n,o,c,d,f,_,y,b)=>h.extend(Ya(l,t,n,o,c,d,f,_,!0,y,!0),{u_texsize_icon:b,u_texture_icon:1}),Ws=(l,t,n)=>({u_matrix:l,u_opacity:t,u_color:n}),Ja=(l,t,n,o,c,d)=>h.extend(function(f,_,y,b){const S=y.imageManager.getPattern(f.from.toString()),I=y.imageManager.getPattern(f.to.toString()),{width:P,height:F}=y.imageManager.getPixelSize(),M=Math.pow(2,b.tileID.overscaledZ),R=b.tileSize*Math.pow(2,y.transform.tileZoom)/M,G=R*(b.tileID.canonical.x+b.tileID.wrap*M),j=R*b.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:S.tl,u_pattern_br_a:S.br,u_pattern_tl_b:I.tl,u_pattern_br_b:I.br,u_texsize:[P,F],u_mix:_.t,u_pattern_size_a:S.displaySize,u_pattern_size_b:I.displaySize,u_scale_a:_.fromScale,u_scale_b:_.toScale,u_tile_units_to_pixels:1/Ft(b,1,y.transform.tileZoom),u_pixel_coord_upper:[G>>16,j>>16],u_pixel_coord_lower:[65535&G,65535&j]}}(o,d,n,c),{u_matrix:l,u_opacity:t}),Qa={fillExtrusion:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_lightpos:new h.Uniform3f(l,t.u_lightpos),u_lightintensity:new h.Uniform1f(l,t.u_lightintensity),u_lightcolor:new h.Uniform3f(l,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(l,t.u_vertical_gradient),u_opacity:new h.Uniform1f(l,t.u_opacity)}),fillExtrusionPattern:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_lightpos:new h.Uniform3f(l,t.u_lightpos),u_lightintensity:new h.Uniform1f(l,t.u_lightintensity),u_lightcolor:new h.Uniform3f(l,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(l,t.u_vertical_gradient),u_height_factor:new h.Uniform1f(l,t.u_height_factor),u_image:new h.Uniform1i(l,t.u_image),u_texsize:new h.Uniform2f(l,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(l,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(l,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(l,t.u_scale),u_fade:new h.Uniform1f(l,t.u_fade),u_opacity:new h.Uniform1f(l,t.u_opacity)}),fill:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix)}),fillPattern:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_image:new h.Uniform1i(l,t.u_image),u_texsize:new h.Uniform2f(l,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(l,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(l,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(l,t.u_scale),u_fade:new h.Uniform1f(l,t.u_fade)}),fillOutline:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_world:new h.Uniform2f(l,t.u_world)}),fillOutlinePattern:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_world:new h.Uniform2f(l,t.u_world),u_image:new h.Uniform1i(l,t.u_image),u_texsize:new h.Uniform2f(l,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(l,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(l,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(l,t.u_scale),u_fade:new h.Uniform1f(l,t.u_fade)}),circle:(l,t)=>({u_camera_to_center_distance:new h.Uniform1f(l,t.u_camera_to_center_distance),u_scale_with_map:new h.Uniform1i(l,t.u_scale_with_map),u_pitch_with_map:new h.Uniform1i(l,t.u_pitch_with_map),u_extrude_scale:new h.Uniform2f(l,t.u_extrude_scale),u_device_pixel_ratio:new h.Uniform1f(l,t.u_device_pixel_ratio),u_matrix:new h.UniformMatrix4f(l,t.u_matrix)}),collisionBox:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_camera_to_center_distance:new h.Uniform1f(l,t.u_camera_to_center_distance),u_pixels_to_tile_units:new h.Uniform1f(l,t.u_pixels_to_tile_units),u_extrude_scale:new h.Uniform2f(l,t.u_extrude_scale),u_overscale_factor:new h.Uniform1f(l,t.u_overscale_factor)}),collisionCircle:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_inv_matrix:new h.UniformMatrix4f(l,t.u_inv_matrix),u_camera_to_center_distance:new h.Uniform1f(l,t.u_camera_to_center_distance),u_viewport_size:new h.Uniform2f(l,t.u_viewport_size)}),debug:(l,t)=>({u_color:new h.UniformColor(l,t.u_color),u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_overlay:new h.Uniform1i(l,t.u_overlay),u_overlay_scale:new h.Uniform1f(l,t.u_overlay_scale)}),clippingMask:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix)}),heatmap:(l,t)=>({u_extrude_scale:new h.Uniform1f(l,t.u_extrude_scale),u_intensity:new h.Uniform1f(l,t.u_intensity),u_matrix:new h.UniformMatrix4f(l,t.u_matrix)}),heatmapTexture:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_world:new h.Uniform2f(l,t.u_world),u_image:new h.Uniform1i(l,t.u_image),u_color_ramp:new h.Uniform1i(l,t.u_color_ramp),u_opacity:new h.Uniform1f(l,t.u_opacity)}),hillshade:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_image:new h.Uniform1i(l,t.u_image),u_latrange:new h.Uniform2f(l,t.u_latrange),u_light:new h.Uniform2f(l,t.u_light),u_shadow:new h.UniformColor(l,t.u_shadow),u_highlight:new h.UniformColor(l,t.u_highlight),u_accent:new h.UniformColor(l,t.u_accent)}),hillshadePrepare:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_image:new h.Uniform1i(l,t.u_image),u_dimension:new h.Uniform2f(l,t.u_dimension),u_zoom:new h.Uniform1f(l,t.u_zoom),u_unpack:new h.Uniform4f(l,t.u_unpack)}),line:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_ratio:new h.Uniform1f(l,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(l,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(l,t.u_units_to_pixels)}),lineGradient:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_ratio:new h.Uniform1f(l,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(l,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(l,t.u_units_to_pixels),u_image:new h.Uniform1i(l,t.u_image),u_image_height:new h.Uniform1f(l,t.u_image_height)}),linePattern:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_texsize:new h.Uniform2f(l,t.u_texsize),u_ratio:new h.Uniform1f(l,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(l,t.u_device_pixel_ratio),u_image:new h.Uniform1i(l,t.u_image),u_units_to_pixels:new h.Uniform2f(l,t.u_units_to_pixels),u_scale:new h.Uniform3f(l,t.u_scale),u_fade:new h.Uniform1f(l,t.u_fade)}),lineSDF:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_ratio:new h.Uniform1f(l,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(l,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(l,t.u_units_to_pixels),u_patternscale_a:new h.Uniform2f(l,t.u_patternscale_a),u_patternscale_b:new h.Uniform2f(l,t.u_patternscale_b),u_sdfgamma:new h.Uniform1f(l,t.u_sdfgamma),u_image:new h.Uniform1i(l,t.u_image),u_tex_y_a:new h.Uniform1f(l,t.u_tex_y_a),u_tex_y_b:new h.Uniform1f(l,t.u_tex_y_b),u_mix:new h.Uniform1f(l,t.u_mix)}),raster:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_tl_parent:new h.Uniform2f(l,t.u_tl_parent),u_scale_parent:new h.Uniform1f(l,t.u_scale_parent),u_buffer_scale:new h.Uniform1f(l,t.u_buffer_scale),u_fade_t:new h.Uniform1f(l,t.u_fade_t),u_opacity:new h.Uniform1f(l,t.u_opacity),u_image0:new h.Uniform1i(l,t.u_image0),u_image1:new h.Uniform1i(l,t.u_image1),u_brightness_low:new h.Uniform1f(l,t.u_brightness_low),u_brightness_high:new h.Uniform1f(l,t.u_brightness_high),u_saturation_factor:new h.Uniform1f(l,t.u_saturation_factor),u_contrast_factor:new h.Uniform1f(l,t.u_contrast_factor),u_spin_weights:new h.Uniform3f(l,t.u_spin_weights)}),symbolIcon:(l,t)=>({u_is_size_zoom_constant:new h.Uniform1i(l,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(l,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(l,t.u_size_t),u_size:new h.Uniform1f(l,t.u_size),u_camera_to_center_distance:new h.Uniform1f(l,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(l,t.u_pitch),u_rotate_symbol:new h.Uniform1i(l,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(l,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(l,t.u_fade_change),u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(l,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(l,t.u_coord_matrix),u_is_text:new h.Uniform1i(l,t.u_is_text),u_pitch_with_map:new h.Uniform1i(l,t.u_pitch_with_map),u_texsize:new h.Uniform2f(l,t.u_texsize),u_texture:new h.Uniform1i(l,t.u_texture)}),symbolSDF:(l,t)=>({u_is_size_zoom_constant:new h.Uniform1i(l,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(l,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(l,t.u_size_t),u_size:new h.Uniform1f(l,t.u_size),u_camera_to_center_distance:new h.Uniform1f(l,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(l,t.u_pitch),u_rotate_symbol:new h.Uniform1i(l,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(l,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(l,t.u_fade_change),u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(l,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(l,t.u_coord_matrix),u_is_text:new h.Uniform1i(l,t.u_is_text),u_pitch_with_map:new h.Uniform1i(l,t.u_pitch_with_map),u_texsize:new h.Uniform2f(l,t.u_texsize),u_texture:new h.Uniform1i(l,t.u_texture),u_gamma_scale:new h.Uniform1f(l,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(l,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(l,t.u_is_halo)}),symbolTextAndIcon:(l,t)=>({u_is_size_zoom_constant:new h.Uniform1i(l,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(l,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(l,t.u_size_t),u_size:new h.Uniform1f(l,t.u_size),u_camera_to_center_distance:new h.Uniform1f(l,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(l,t.u_pitch),u_rotate_symbol:new h.Uniform1i(l,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(l,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(l,t.u_fade_change),u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(l,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(l,t.u_coord_matrix),u_is_text:new h.Uniform1i(l,t.u_is_text),u_pitch_with_map:new h.Uniform1i(l,t.u_pitch_with_map),u_texsize:new h.Uniform2f(l,t.u_texsize),u_texsize_icon:new h.Uniform2f(l,t.u_texsize_icon),u_texture:new h.Uniform1i(l,t.u_texture),u_texture_icon:new h.Uniform1i(l,t.u_texture_icon),u_gamma_scale:new h.Uniform1f(l,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(l,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(l,t.u_is_halo)}),background:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_opacity:new h.Uniform1f(l,t.u_opacity),u_color:new h.UniformColor(l,t.u_color)}),backgroundPattern:(l,t)=>({u_matrix:new h.UniformMatrix4f(l,t.u_matrix),u_opacity:new h.Uniform1f(l,t.u_opacity),u_image:new h.Uniform1i(l,t.u_image),u_pattern_tl_a:new h.Uniform2f(l,t.u_pattern_tl_a),u_pattern_br_a:new h.Uniform2f(l,t.u_pattern_br_a),u_pattern_tl_b:new h.Uniform2f(l,t.u_pattern_tl_b),u_pattern_br_b:new h.Uniform2f(l,t.u_pattern_br_b),u_texsize:new h.Uniform2f(l,t.u_texsize),u_mix:new h.Uniform1f(l,t.u_mix),u_pattern_size_a:new h.Uniform2f(l,t.u_pattern_size_a),u_pattern_size_b:new h.Uniform2f(l,t.u_pattern_size_b),u_scale_a:new h.Uniform1f(l,t.u_scale_a),u_scale_b:new h.Uniform1f(l,t.u_scale_b),u_pixel_coord_upper:new h.Uniform2f(l,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(l,t.u_pixel_coord_lower),u_tile_units_to_pixels:new h.Uniform1f(l,t.u_tile_units_to_pixels)})};class eo{constructor(t,n,o){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=Boolean(o),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const to={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ko{constructor(t,n,o,c){this.length=n.length,this.attributes=o,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;const d=t.gl;this.buffer=d.createBuffer(),t.bindVertexBuffer.set(this.buffer),d.bufferData(d.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let o=0;o0){const ze=h.create(),ge=ce;h.mul(ze,ee.placementInvProjMatrix,l.transform.glCoordMatrix),h.mul(ze,ze,ee.placementViewportMatrix),S.push({circleArray:re,circleOffset:P,transform:ge,invTransform:ze}),I+=re.length/4,P=I}ue&&b.draw(_,y.LINES,st.disabled,_t.disabled,l.colorModeForRenderPass(),It.disabled,ia(ce,l.transform,J),n.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,null,l.transform.zoom,null,null,ue.collisionVertexBuffer)}if(!f||!S.length)return;const F=l.useProgram("collisionCircle"),M=new h.CollisionCircleLayoutArray;M.resize(4*I),M._trim();let R=0;for(const Z of S)for(let ae=0;ae=0&&(F[R.associatedIconIndex]={shiftedAnchor:Le,angle:Ye})}else Pt(R.numGlyphs,I)}if(b){P.clear();const M=l.icon.placedSymbolArray;for(let R=0;Rue.sortKey-re.sortKey);for(const ue of ce){const re=ue.state;if(P.activeTexture.set(F.TEXTURE0),re.atlasTexture.bind(re.atlasInterpolation,F.CLAMP_TO_EDGE),re.atlasTextureIcon&&(P.activeTexture.set(F.TEXTURE1),re.atlasTextureIcon&&re.atlasTextureIcon.bind(re.atlasInterpolationIcon,F.CLAMP_TO_EDGE)),re.isSDF){const ze=re.uniformValues;re.hasHalo&&(ze.u_is_halo=1,_a(re.buffers,ue.segments,n,l,re.program,J,S,I,ze)),ze.u_is_halo=0}_a(re.buffers,ue.segments,n,l,re.program,J,S,I,re.uniformValues)}}function _a(l,t,n,o,c,d,f,_,y){const b=o.context;c.draw(b,b.gl.TRIANGLES,d,f,_,It.disabled,y,n.id,l.layoutVertexBuffer,l.indexBuffer,t,n.paint,o.transform.zoom,l.programConfigurations.get(n.id),l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer)}function mo(l,t,n,o,c,d,f){const _=l.context.gl,y=n.paint.get("fill-pattern"),b=y&&y.constantOr(1),S=n.getCrossfadeParameters();let I,P,F,M,R;f?(P=b&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",I=_.LINES):(P=b?"fillPattern":"fill",I=_.TRIANGLES);for(const G of o){const j=t.getTile(G);if(b&&!j.patternsLoaded())continue;const H=j.getBucket(n);if(!H)continue;const Z=H.programConfigurations.get(n.id),ae=l.useProgram(P,Z);b&&(l.context.activeTexture.set(_.TEXTURE0),j.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),Z.updatePaintBuffers(S));const J=y.constantOr(null);if(J&&j.imageAtlas){const ce=j.imageAtlas,ue=ce.patternPositions[J.to.toString()],re=ce.patternPositions[J.from.toString()];ue&&re&&Z.setConstantPatternPositions(ue,re)}const ee=l.translatePosMatrix(G.posMatrix,j,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(f){M=H.indexBuffer2,R=H.segments2;const ce=[_.drawingBufferWidth,_.drawingBufferHeight];F=P==="fillOutlinePattern"&&b?Xo(ee,l,S,j,ce):Zo(ee,ce)}else M=H.indexBuffer,R=H.segments,F=b?Wa(ee,l,S,j):Ha(ee);ae.draw(l.context,I,c,l.stencilModeForClipping(G),d,It.disabled,F,n.id,H.layoutVertexBuffer,M,R,n.paint,l.transform.zoom,Z)}}function cn(l,t,n,o,c,d,f){const _=l.context,y=_.gl,b=n.paint.get("fill-extrusion-pattern"),S=b.constantOr(1),I=n.getCrossfadeParameters(),P=n.paint.get("fill-extrusion-opacity");for(const F of o){const M=t.getTile(F),R=M.getBucket(n);if(!R)continue;const G=R.programConfigurations.get(n.id),j=l.useProgram(S?"fillExtrusionPattern":"fillExtrusion",G);S&&(l.context.activeTexture.set(y.TEXTURE0),M.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),G.updatePaintBuffers(I));const H=b.constantOr(null);if(H&&M.imageAtlas){const ee=M.imageAtlas,ce=ee.patternPositions[H.to.toString()],ue=ee.patternPositions[H.from.toString()];ce&&ue&&G.setConstantPatternPositions(ce,ue)}const Z=l.translatePosMatrix(F.posMatrix,M,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ae=n.paint.get("fill-extrusion-vertical-gradient"),J=S?Xa(Z,l,ae,P,F,I,M):jo(Z,l,ae,P);j.draw(_,_.gl.TRIANGLES,c,d,f,It.backCCW,J,n.id,R.layoutVertexBuffer,R.indexBuffer,R.segments,n.paint,l.transform.zoom,G)}}function ya(l,t,n,o,c,d){const f=l.context,_=f.gl,y=t.fbo;if(!y)return;const b=l.useProgram("hillshade");f.activeTexture.set(_.TEXTURE0),_.bindTexture(_.TEXTURE_2D,y.colorAttachment.get());const S=((I,P,F)=>{const M=F.paint.get("hillshade-shadow-color"),R=F.paint.get("hillshade-highlight-color"),G=F.paint.get("hillshade-accent-color");let j=F.paint.get("hillshade-illumination-direction")*(Math.PI/180);F.paint.get("hillshade-illumination-anchor")==="viewport"&&(j-=I.transform.angle);const H=!I.options.moving;return{u_matrix:I.transform.calculatePosMatrix(P.tileID.toUnwrapped(),H),u_image:0,u_latrange:na(0,P.tileID),u_light:[F.paint.get("hillshade-exaggeration"),j],u_shadow:M,u_highlight:R,u_accent:G}})(l,t,n);b.draw(f,_.TRIANGLES,o,c,d,It.disabled,S,n.id,l.rasterBoundsBuffer,l.quadTriangleIndexBuffer,l.rasterBoundsSegments)}function Fi(l,t,n,o,c,d){const f=l.context,_=f.gl,y=t.dem;if(y&&y.data){const b=y.dim,S=y.stride,I=y.getPixels();if(f.activeTexture.set(_.TEXTURE1),f.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||l.getTileTexture(S),t.demTexture){const F=t.demTexture;F.update(I,{premultiply:!1}),F.bind(_.NEAREST,_.CLAMP_TO_EDGE)}else t.demTexture=new et(f,I,_.RGBA,{premultiply:!1}),t.demTexture.bind(_.NEAREST,_.CLAMP_TO_EDGE);f.activeTexture.set(_.TEXTURE0);let P=t.fbo;if(!P){const F=new et(f,{width:b,height:b,data:null},_.RGBA);F.bind(_.LINEAR,_.CLAMP_TO_EDGE),P=t.fbo=f.createFramebuffer(b,b,!0),P.colorAttachment.set(F.texture)}f.bindFramebuffer.set(P.framebuffer),f.viewport.set([0,0,b,b]),l.useProgram("hillshadePrepare").draw(f,_.TRIANGLES,o,c,d,It.disabled,((F,M)=>{const R=M.stride,G=h.create();return h.ortho(G,0,h.EXTENT,-h.EXTENT,0,0,1),h.translate(G,G,[0,-h.EXTENT,0]),{u_matrix:G,u_image:1,u_dimension:[R,R],u_zoom:F.overscaledZ,u_unpack:M.getUnpackVector()}})(t.tileID,y),n.id,l.rasterBoundsBuffer,l.quadTriangleIndexBuffer,l.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function ns(l,t,n,o,c){const d=o.paint.get("raster-fade-duration");if(d>0){const f=h.exported.now(),_=(f-l.timeAdded)/d,y=t?(f-t.timeAdded)/d:-1,b=n.getSource(),S=c.coveringZoomLevel({tileSize:b.tileSize,roundZoom:b.roundZoom}),I=!t||Math.abs(t.tileID.overscaledZ-S)>Math.abs(l.tileID.overscaledZ-S),P=I&&l.refreshedUponExpiration?1:h.clamp(I?_:1-y,0,1);return l.refreshedUponExpiration&&_>=1&&(l.refreshedUponExpiration=!1),t?{opacity:1,mix:1-P}:{opacity:P,mix:0}}return{opacity:1,mix:0}}const as=new h.Color(1,0,0,1),os=new h.Color(0,1,0,1),hn=new h.Color(0,0,1,1),xa=new h.Color(1,0,1,1),fo=new h.Color(0,1,1,1);function ss(l,t,n,o){ba(l,0,t+n/2,l.transform.width,n,o)}function va(l,t,n,o){ba(l,t-n/2,0,n,l.transform.height,o)}function ba(l,t,n,o,c,d){const f=l.context,_=f.gl;_.enable(_.SCISSOR_TEST),_.scissor(t*l.pixelRatio,n*l.pixelRatio,o*l.pixelRatio,c*l.pixelRatio),f.clear({color:d}),_.disable(_.SCISSOR_TEST)}function ls(l,t,n){const o=l.context,c=o.gl,d=n.posMatrix,f=l.useProgram("debug"),_=st.disabled,y=_t.disabled,b=l.colorModeForRenderPass(),S="$debug";o.activeTexture.set(c.TEXTURE0),l.emptyTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),f.draw(o,c.LINE_STRIP,_,y,b,It.disabled,an(d,h.Color.red),S,l.debugBuffer,l.tileBorderIndexBuffer,l.debugSegments);const I=t.getTileByID(n.key).latestRawTileData,P=Math.floor((I&&I.byteLength||0)/1024),F=t.getTile(n).tileSize,M=512/Math.min(F,512)*(n.overscaledZ/l.transform.zoom)*.5;let R=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(R+=` => ${n.overscaledZ}`),function(G,j){G.initDebugOverlayCanvas();const H=G.debugOverlayCanvas,Z=G.context.gl,ae=G.debugOverlayCanvas.getContext("2d");ae.clearRect(0,0,H.width,H.height),ae.shadowColor="white",ae.shadowBlur=2,ae.lineWidth=1.5,ae.strokeStyle="white",ae.textBaseline="top",ae.font="bold 36px Open Sans, sans-serif",ae.fillText(j,5,5),ae.strokeText(j,5,5),G.debugOverlayTexture.update(H),G.debugOverlayTexture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE)}(l,`${R} ${P}kb`),f.draw(o,c.TRIANGLES,_,y,Re.alphaBlended,It.disabled,an(d,h.Color.transparent,M),S,l.debugBuffer,l.quadTriangleIndexBuffer,l.debugSegments)}const Rn={symbol:function(l,t,n,o,c){if(l.renderPass!=="translucent")return;const d=_t.disabled,f=l.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(_,y,b,S,I,P,F){const M=y.transform,R=I==="map",G=P==="map";for(const j of _){const H=S.getTile(j),Z=H.getBucket(b);if(!Z||!Z.text||!Z.text.segments.get().length)continue;const ae=h.evaluateSizeForZoom(Z.textSizeData,M.zoom),J=Ft(H,1,y.transform.zoom),ee=ei(j.posMatrix,G,R,y.transform,J),ce=b.layout.get("icon-text-fit")!=="none"&&Z.hasIconData();if(ae){const ue=Math.pow(2,M.zoom-H.tileID.overscaledZ);ma(Z,R,G,F,M,ee,j.posMatrix,ue,ae,ce)}}}(o,l,n,t,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),c),n.paint.get("icon-opacity").constantOr(1)!==0&&ga(l,t,n,o,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),d,f),n.paint.get("text-opacity").constantOr(1)!==0&&ga(l,t,n,o,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),d,f),t.map.showCollisionBoxes&&(uo(l,t,n,o,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),uo(l,t,n,o,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(l,t,n,o){if(l.renderPass!=="translucent")return;const c=n.paint.get("circle-opacity"),d=n.paint.get("circle-stroke-width"),f=n.paint.get("circle-stroke-opacity"),_=!n.layout.get("circle-sort-key").isConstant();if(c.constantOr(1)===0&&(d.constantOr(1)===0||f.constantOr(1)===0))return;const y=l.context,b=y.gl,S=l.depthModeForSublayer(0,st.ReadOnly),I=_t.disabled,P=l.colorModeForRenderPass(),F=[];for(let M=0;MM.sortKey-R.sortKey);for(const M of F){const{programConfiguration:R,program:G,layoutVertexBuffer:j,indexBuffer:H,uniformValues:Z}=M.state;G.draw(y,b.TRIANGLES,S,I,P,It.disabled,Z,n.id,j,H,M.segments,n.paint,l.transform.zoom,R)}},heatmap:function(l,t,n,o){if(n.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){const c=l.context,d=c.gl,f=_t.disabled,_=new Re([d.ONE,d.ONE],h.Color.transparent,[!0,!0,!0,!0]);(function(y,b,S){const I=y.gl;y.activeTexture.set(I.TEXTURE1),y.viewport.set([0,0,b.width/4,b.height/4]);let P=S.heatmapFbo;if(P)I.bindTexture(I.TEXTURE_2D,P.colorAttachment.get()),y.bindFramebuffer.set(P.framebuffer);else{const F=I.createTexture();I.bindTexture(I.TEXTURE_2D,F),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),P=S.heatmapFbo=y.createFramebuffer(b.width/4,b.height/4,!1),function(M,R,G,j){const H=M.gl;H.texImage2D(H.TEXTURE_2D,0,H.RGBA,R.width/4,R.height/4,0,H.RGBA,M.extRenderToTextureHalfFloat?M.extTextureHalfFloat.HALF_FLOAT_OES:H.UNSIGNED_BYTE,null),j.colorAttachment.set(G)}(y,b,F,P)}})(c,l,n),c.clear({color:h.Color.transparent});for(let y=0;y{const M=h.create();h.ortho(M,0,S.width,S.height,0,0,1);const R=S.context.gl;return{u_matrix:M,u_world:[R.drawingBufferWidth,R.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:I.paint.get("heatmap-opacity")}})(c,d),d.id,c.viewportBuffer,c.quadTriangleIndexBuffer,c.viewportSegments,d.paint,c.transform.zoom)}(l,n))},line:function(l,t,n,o){if(l.renderPass!=="translucent")return;const c=n.paint.get("line-opacity"),d=n.paint.get("line-width");if(c.constantOr(1)===0||d.constantOr(1)===0)return;const f=l.depthModeForSublayer(0,st.ReadOnly),_=l.colorModeForRenderPass(),y=n.paint.get("line-dasharray"),b=n.paint.get("line-pattern"),S=b.constantOr(1),I=n.paint.get("line-gradient"),P=n.getCrossfadeParameters(),F=S?"linePattern":y?"lineSDF":I?"lineGradient":"line",M=l.context,R=M.gl;let G=!0;for(const j of o){const H=t.getTile(j);if(S&&!H.patternsLoaded())continue;const Z=H.getBucket(n);if(!Z)continue;const ae=Z.programConfigurations.get(n.id),J=l.context.program.get(),ee=l.useProgram(F,ae),ce=G||ee.program!==J,ue=b.constantOr(null);if(ue&&H.imageAtlas){const ze=H.imageAtlas,ge=ze.patternPositions[ue.to.toString()],Le=ze.patternPositions[ue.from.toString()];ge&&Le&&ae.setConstantPatternPositions(ge,Le)}const re=S?Mn(l,H,n,P):y?Mt(l,H,n,y,P):I?aa(l,H,n,Z.lineClipsArray.length):Pn(l,H,n);if(S)M.activeTexture.set(R.TEXTURE0),H.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),ae.updatePaintBuffers(P);else if(y&&(ce||l.lineAtlas.dirty))M.activeTexture.set(R.TEXTURE0),l.lineAtlas.bind(M);else if(I){const ze=Z.gradients[n.id];let ge=ze.texture;if(n.gradientVersion!==ze.version){let Le=256;if(n.stepInterpolant){const Ye=t.getSource().maxzoom,Ge=j.canonical.z===Ye?Math.ceil(1<256&&this.clearStencil(),o.setColorMode(Re.disabled),o.setDepthMode(st.disabled);const d=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const f of n){const _=this._tileClippingMaskIDs[f.key]=this.nextStencilID++;d.draw(o,c.TRIANGLES,st.disabled,new _t({func:c.ALWAYS,mask:0},_,255,c.KEEP,c.KEEP,c.REPLACE),Re.disabled,It.disabled,kn(f.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new _t({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new _t({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,o=t.sort((f,_)=>_.overscaledZ-f.overscaledZ),c=o[o.length-1].overscaledZ,d=o[0].overscaledZ-c+1;if(d>1){this.currentStencilSource=void 0,this.nextStencilID+d>256&&this.clearStencil();const f={};for(let _=0;_=0;this.currentLayer--){const y=this.style._layers[o[this.currentLayer]],b=c[y.source],S=d[y.source];this._renderTileClippingMasks(y,S),this.renderLayer(this,b,y,S)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer{S.source&&!S.isHidden(this.transform.zoom)&&(S.source!==(b&&b.id)&&(b=this.style.sourceCaches[S.source]),(!y||y.getSource().maxzoom0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),o=this.imageManager.getPattern(t.to.toString());return!n||!o}useProgram(t,n){this.cache=this.cache||{};const o=`${t}${n?n.cacheKey:""}${this._showOverdrawInspector?"/overdraw":""}`;return this.cache[o]||(this.cache[o]=new Xs(this.context,t,Ga[t],n,Qa[t],this._showOverdrawInspector)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new et(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class wa{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,o){const c=Math.pow(2,o),d=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(_=>h.transformMat4([],_,t)).map(_=>h.scale$1([],_,1/_[3]/n*c)),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(_=>{const y=function(P,F){var M=F[0],R=F[1],G=F[2],j=M*M+R*R+G*G;return j>0&&(j=1/Math.sqrt(j)),P[0]=F[0]*j,P[1]=F[1]*j,P[2]=F[2]*j,P}([],function(P,F,M){var R=F[0],G=F[1],j=F[2],H=M[0],Z=M[1],ae=M[2];return P[0]=G*ae-j*Z,P[1]=j*H-R*ae,P[2]=R*Z-G*H,P}([],si([],d[_[0]],d[_[1]]),si([],d[_[2]],d[_[1]]))),b=-((S=y)[0]*(I=d[_[1]])[0]+S[1]*I[1]+S[2]*I[2]);var S,I;return y.concat(b)});return new wa(d,f)}}class Ea{constructor(t,n){this.min=t,this.max=n,this.center=function(o,c,d){return o[0]=.5*c[0],o[1]=.5*c[1],o[2]=.5*c[2],o}([],function(o,c,d){return o[0]=c[0]+d[0],o[1]=c[1]+d[1],o[2]=c[2]+d[2],o}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],o=zr(this.min),c=zr(this.max);for(let d=0;d=0&&f++;if(f===0)return 0;f!==n.length&&(o=!1)}if(o)return 2;for(let c=0;c<3;c++){let d=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let _=0;_this.max[c]-this.min[c])return 0}return 1}}class un{constructor(t=0,n=0,o=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(o)||o<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=o,this.right=c}interpolate(t,n,o){return n.top!=null&&t.top!=null&&(this.top=h.number(t.top,n.top,o)),n.bottom!=null&&t.bottom!=null&&(this.bottom=h.number(t.bottom,n.bottom,o)),n.left!=null&&t.left!=null&&(this.left=h.number(t.left,n.left,o)),n.right!=null&&t.right!=null&&(this.right=h.number(t.right,n.right,o)),this}getCenter(t,n){const o=h.clamp((this.left+t-this.right)/2,0,t),c=h.clamp((this.top+n-this.bottom)/2,0,n);return new h.pointGeometry(o,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new un(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Fn{constructor(t,n,o,c,d){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=d===void 0||!!d,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=o==null?0:o,this._maxPitch=c==null?60:c,this.setMaxBounds(),this.width=0,this.height=0,this._center=new h.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new un,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const t=new Fn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new h.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-h.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var o=new h.ARRAY_TYPE(4);return h.ARRAY_TYPE!=Float32Array&&(o[1]=0,o[2]=0),o[0]=1,o[3]=1,o}(),function(o,c,d){var f=c[0],_=c[1],y=c[2],b=c[3],S=Math.sin(d),I=Math.cos(d);o[0]=f*I+y*S,o[1]=_*I+b*S,o[2]=f*-S+y*I,o[3]=_*-S+b*I}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=h.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.scale=this.zoomScale(n),this.tileZoom=Math.floor(n),this.zoomFraction=n-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,o){this._unmodified=!1,this._edgeInsets.interpolate(t,n,o),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new h.UnwrappedTileID(0,t)];if(this._renderWorldCopies){const o=this.pointCoordinate(new h.pointGeometry(0,0)),c=this.pointCoordinate(new h.pointGeometry(this.width,0)),d=this.pointCoordinate(new h.pointGeometry(this.width,this.height)),f=this.pointCoordinate(new h.pointGeometry(0,this.height)),_=Math.floor(Math.min(o.x,c.x,d.x,f.x)),y=Math.floor(Math.max(o.x,c.x,d.x,f.x)),b=1;for(let S=_-b;S<=y+b;S++)S!==0&&n.push(new h.UnwrappedTileID(S,t))}return n}coveringTiles(t){let n=this.coveringZoomLevel(t);const o=n;if(t.minzoom!==void 0&&nt.maxzoom&&(n=t.maxzoom);const c=h.MercatorCoordinate.fromLngLat(this.center),d=Math.pow(2,n),f=[d*c.x,d*c.y,0],_=wa.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n);let y=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(y=n);const b=M=>({aabb:new Ea([M*d,0,0],[(M+1)*d,d,0]),zoom:0,x:0,y:0,wrap:M,fullyVisible:!1}),S=[],I=[],P=n,F=t.reparseOverscaled?o:n;if(this._renderWorldCopies)for(let M=1;M<=3;M++)S.push(b(-M)),S.push(b(M));for(S.push(b(0));S.length>0;){const M=S.pop(),R=M.x,G=M.y;let j=M.fullyVisible;if(!j){const ee=M.aabb.intersects(_);if(ee===0)continue;j=ee===2}const H=M.aabb.distanceX(f),Z=M.aabb.distanceY(f),ae=Math.max(Math.abs(H),Math.abs(Z)),J=3+(1<J&&M.zoom>=y)I.push({tileID:new h.OverscaledTileID(M.zoom===P?F:M.zoom,M.wrap,M.zoom,R,G),distanceSq:Qi([f[0]-.5-R,f[1]-.5-G])});else for(let ee=0;ee<4;ee++){const ce=(R<<1)+ee%2,ue=(G<<1)+(ee>>1);S.push({aabb:M.aabb.quadrant(ee),zoom:M.zoom+1,x:ce,y:ue,wrap:M.wrap,fullyVisible:j})}}return I.sort((M,R)=>M.distanceSq-R.distanceSq).map(M=>M.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const n=h.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new h.pointGeometry(h.mercatorXfromLng(t.lng)*this.worldSize,h.mercatorYfromLat(n)*this.worldSize)}unproject(t){return new h.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(t,n){const o=this.pointCoordinate(n),c=this.pointCoordinate(this.centerPoint),d=this.locationCoordinate(t),f=new h.MercatorCoordinate(d.x-(o.x-c.x),d.y-(o.y-c.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t){return this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t){return this.coordinateLocation(this.pointCoordinate(t))}locationCoordinate(t){return h.MercatorCoordinate.fromLngLat(t)}coordinateLocation(t){return t.toLngLat()}pointCoordinate(t){const n=[t.x,t.y,0,1],o=[t.x,t.y,1,1];h.transformMat4(n,n,this.pixelMatrixInverse),h.transformMat4(o,o,this.pixelMatrixInverse);const c=n[3],d=o[3],f=n[1]/c,_=o[1]/d,y=n[2]/c,b=o[2]/d,S=y===b?0:(0-y)/(b-y);return new h.MercatorCoordinate(h.number(n[0]/c,o[0]/d,S)/this.worldSize,h.number(f,_,S)/this.worldSize)}coordinatePoint(t){const n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return h.transformMat4(n,n,this.pixelMatrix),new h.pointGeometry(n[0]/n[3],n[1]/n[3])}getBounds(){return new h.LngLatBounds().extend(this.pointLocation(new h.pointGeometry(0,0))).extend(this.pointLocation(new h.pointGeometry(this.width,0))).extend(this.pointLocation(new h.pointGeometry(this.width,this.height))).extend(this.pointLocation(new h.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new h.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,n=!1){const o=t.key,c=n?this._alignedPosMatrixCache:this._posMatrixCache;if(c[o])return c[o];const d=t.canonical,f=this.worldSize/this.zoomScale(d.z),_=d.x+Math.pow(2,d.z)*t.wrap,y=h.identity(new Float64Array(16));return h.translate(y,y,[_*f,d.y*f,0]),h.scale(y,y,[f/h.EXTENT,f/h.EXTENT,1]),h.multiply(y,n?this.alignedProjMatrix:this.projMatrix,y),c[o]=new Float32Array(y),c[o]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,o,c,d=-90,f=90,_=-180,y=180;const b=this.size,S=this._unmodified;if(this.latRange){const F=this.latRange;d=h.mercatorYfromLat(F[1])*this.worldSize,f=h.mercatorYfromLat(F[0])*this.worldSize,t=f-df&&(c=f-M)}if(this.lngRange){const F=I.x,M=b.x/2;F-M<_&&(o=_+M),F+M>y&&(o=y-M)}o===void 0&&c===void 0||(this.center=this.unproject(new h.pointGeometry(o!==void 0?o:I.x,c!==void 0?c:I.y))),this._unmodified=S,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;const n=Math.PI/2+this._pitch,o=this._fov*(.5+t.y/this.height),c=Math.sin(o)*this.cameraToCenterDistance/Math.sin(h.clamp(Math.PI-n-o,.01,Math.PI-.01)),d=this.point,f=d.x,_=d.y,y=1.01*(Math.cos(Math.PI/2-this._pitch)*c+this.cameraToCenterDistance),b=this.height/50;let S=new Float64Array(16);h.perspective(S,this._fov,this.width/this.height,b,y),S[8]=2*-t.x/this.width,S[9]=2*t.y/this.height,h.scale(S,S,[1,-1,1]),h.translate(S,S,[0,0,-this.cameraToCenterDistance]),h.rotateX(S,S,this._pitch),h.rotateZ(S,S,this.angle),h.translate(S,S,[-f,-_,0]),this.mercatorMatrix=h.scale([],S,[this.worldSize,this.worldSize,this.worldSize]),h.scale(S,S,[1,1,h.mercatorZfromAltitude(1,this.center.lat)*this.worldSize]),this.projMatrix=S,this.invProjMatrix=h.invert([],this.projMatrix);const I=this.width%2/2,P=this.height%2/2,F=Math.cos(this.angle),M=Math.sin(this.angle),R=f-Math.round(f)+F*I+M*P,G=_-Math.round(_)+F*P+M*I,j=new Float64Array(S);if(h.translate(j,j,[R>.5?R-1:R,G>.5?G-1:G,0]),this.alignedProjMatrix=j,S=h.create(),h.scale(S,S,[this.width/2,-this.height/2,1]),h.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=h.create(),h.scale(S,S,[1,-1,1]),h.translate(S,S,[-1,-1,0]),h.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.pixelMatrix=h.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),S=h.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");this.pixelMatrixInverse=S,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new h.pointGeometry(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return h.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new h.pointGeometry(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let o=n.x,c=n.y,d=n.x,f=n.y;for(const _ of t)o=Math.min(o,_.x),c=Math.min(c,_.y),d=Math.max(d,_.x),f=Math.max(f,_.y);return[new h.pointGeometry(o,c),new h.pointGeometry(d,c),new h.pointGeometry(d,f),new h.pointGeometry(o,f),new h.pointGeometry(o,c)]}}}class cs{constructor(t){this._hashName=t&&encodeURIComponent(t),h.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(n,o){let c=!1,d=null;const f=()=>{d=null,c&&(n(),d=setTimeout(f,300),c=!1)};return()=>(c=!0,d||f(),d)}(this._updateHashUnthrottled.bind(this))}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const n=this._map.getCenter(),o=Math.round(100*this._map.getZoom())/100,c=Math.ceil((o*Math.LN2+Math.log(512/360/.5))/Math.LN10),d=Math.pow(10,c),f=Math.round(n.lng*d)/d,_=Math.round(n.lat*d)/d,y=this._map.getBearing(),b=this._map.getPitch();let S="";if(S+=t?`/${f}/${_}/${o}`:`${o}/${_}/${f}`,(y||b)&&(S+="/"+Math.round(10*y)/10),b&&(S+=`/${Math.round(b)}`),this._hashName){const I=this._hashName;let P=!1;const F=window.location.hash.slice(1).split("&").map(M=>{const R=M.split("=")[0];return R===I?(P=!0,`${R}=${S}`):M}).filter(M=>M);return P||F.push(`${I}=${S}`),`#${F.join("&")}`}return`#${S}`}_getCurrentHash(){const t=window.location.hash.replace("#","");if(this._hashName){let n;return t.split("&").map(o=>o.split("=")).forEach(o=>{o[0]===this._hashName&&(n=o)}),(n&&n[1]||"").split("/")}return t.split("/")}_onHashChange(){const t=this._getCurrentHash();if(t.length>=3&&!t.some(n=>isNaN(n))){const n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,t)}catch{}}}const On={linearity:.3,easing:h.bezier(0,0,.3,1)},hs=h.extend({deceleration:2500,maxSpeed:1400},On),us=h.extend({deceleration:20,maxSpeed:1400},On),ps=h.extend({deceleration:1e3,maxSpeed:360},On),pn=h.extend({deceleration:1e3,maxSpeed:90},On);class ds{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:h.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=h.exported.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new h.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:d}of this._inertiaBuffer)n.zoom+=d.zoomDelta||0,n.bearing+=d.bearingDelta||0,n.pitch+=d.pitchDelta||0,d.panDelta&&n.pan._add(d.panDelta),d.around&&(n.around=d.around),d.pinchAround&&(n.pinchAround=d.pinchAround);const o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){const d=Un(n.pan.mag(),o,h.extend({},hs,t||{}));c.offset=n.pan.mult(d.amount/n.pan.mag()),c.center=this._map.transform.center,Vn(c,d)}if(n.zoom){const d=Un(n.zoom,o,us);c.zoom=this._map.transform.zoom+d.amount,Vn(c,d)}if(n.bearing){const d=Un(n.bearing,o,ps);c.bearing=this._map.transform.bearing+h.clamp(d.amount,-179,179),Vn(c,d)}if(n.pitch){const d=Un(n.pitch,o,pn);c.pitch=this._map.transform.pitch+d.amount,Vn(c,d)}if(c.zoom||c.bearing){const d=n.pinchAround===void 0?n.around:n.pinchAround;c.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),h.extend(c,{noMoveStart:!0})}}function Vn(l,t){(!l.duration||l.durationn.unproject(y)),_=d.reduce((y,b,S,I)=>y.add(b.div(I.length)),new h.pointGeometry(0,0));super(t,{points:d,point:_,lngLats:f,lngLat:n.unproject(_),originalEvent:o}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class nl extends h.Event{constructor(t,n,o){super(t,{originalEvent:o}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Ur{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new nl(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new gi(t.type,this._map,t))}mouseup(t){this._map.fire(new gi(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new gi(t.type,this._map,t))}dblclick(t){return this._firePreventable(new gi(t.type,this._map,t))}mouseover(t){this._map.fire(new gi(t.type,this._map,t))}mouseout(t){this._map.fire(new gi(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ci(t.type,this._map,t))}touchmove(t){this._map.fire(new ci(t.type,this._map,t))}touchend(t){this._map.fire(new ci(t.type,this._map,t))}touchcancel(t){this._map.fire(new ci(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ms{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(t){this._map.fire(new gi(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new gi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new gi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class dn{constructor(t,n){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(ne.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const o=n;if(this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)d.fitScreenCoordinates(o,c,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(ne.remove(this._box),this._box=null),ne.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new h.Event(t,{originalEvent:n}))}}function Nr(l,t){const n={};for(let o=0;othis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),o.length===this.numTouches&&(this.centroid=function(c){const d=new h.pointGeometry(0,0);for(const f of c)d._add(f);return d.div(c.length)}(n),this.touches=Nr(o,n)))}touchmove(t,n,o){if(this.aborted||!this.centroid)return;const c=Nr(o,n);for(const d in this.touches){const f=this.touches[d],_=c[d];(!_||_.dist(f)>30)&&(this.aborted=!0)}}touchend(t,n,o){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),o.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class _o{constructor(t){this.singleTap=new al(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,o){this.singleTap.touchstart(t,n,o)}touchmove(t,n,o){this.singleTap.touchmove(t,n,o)}touchend(t,n,o){const c=this.singleTap.touchend(t,n,o);if(c){const d=t.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(c)<30;if(d&&f||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class ol{constructor(){this._zoomIn=new _o({numTouches:1,numTaps:2}),this._zoomOut=new _o({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,o){this._zoomIn.touchstart(t,n,o),this._zoomOut.touchstart(t,n,o)}touchmove(t,n,o){this._zoomIn.touchmove(t,n,o),this._zoomOut.touchmove(t,n,o)}touchend(t,n,o){const c=this._zoomIn.touchend(t,n,o),d=this._zoomOut.touchend(t,n,o);return c?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:f=>f.easeTo({duration:300,zoom:f.getZoom()+1,around:f.unproject(c)},{originalEvent:t})}):d?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:f=>f.easeTo({duration:300,zoom:f.getZoom()-1,around:f.unproject(d)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const fs={0:1,2:2};class $r{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(t,n){return!1}_move(t,n){return{}}mousedown(t,n){if(this._lastPoint)return;const o=ne.mouseButton(t);this._correctButton(t,o)&&(this._lastPoint=n,this._eventButton=o)}mousemoveWindow(t,n){const o=this._lastPoint;if(o){if(t.preventDefault(),function(c,d){const f=fs[d];return c.buttons===void 0||(c.buttons&f)!==f}(t,this._eventButton))this.reset();else if(this._moved||!(n.dist(o)0&&(this._active=!0);const c=Nr(o,n),d=new h.pointGeometry(0,0),f=new h.pointGeometry(0,0);let _=0;for(const b in c){const S=c[b],I=this._touches[b];I&&(d._add(S),f._add(S.sub(I)),_++,c[b]=S)}if(this._touches=c,_Math.abs(l.x)}class _s extends qr{reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(t){this._lastPoints=t,qn(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,o){const c=t[0].sub(this._lastPoints[0]),d=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(c,d,o.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+d.y)/2*-.5}}gestureBeginsVertically(t,n,o){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,d=n.mag()>=2;if(!c&&!d)return;if(!c||!d)return this._firstMove===void 0&&(this._firstMove=o),o-this._firstMove<100&&void 0;const f=t.y>0==n.y>0;return qn(t)&&qn(n)&&f}}const ys={panStep:100,bearingStep:15,pitchStep:10};class ll{constructor(){const t=ys;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,o=0,c=0,d=0,f=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?o=-1:(t.preventDefault(),d=-1);break;case 39:t.shiftKey?o=1:(t.preventDefault(),d=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),f=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),f=1);break;default:return}return this._rotationDisabled&&(o=0,c=0),{cameraAnimation:_=>{const y=_.getZoom();_.easeTo({duration:300,easeId:"keyboardHandler",easing:cl,zoom:n?Math.round(y)+n*(t.shiftKey?2:1):y,bearing:_.getBearing()+o*this._bearingStep,pitch:_.getPitch()+c*this._pitchStep,offset:[-d*this._panStep,-f*this._panStep],center:_.getCenter()},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function cl(l){return l*(2-l)}const za=4.000244140625;class vo{constructor(t,n){this._map=t,this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,h.bindAll(["_onTimeout"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const o=h.exported.now(),c=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,n!==0&&n%za==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=ne.mousePos(this._el,t);this._around=h.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._map.transform;if(this._delta!==0){const _=this._type==="wheel"&&Math.abs(this._delta)>za?this._wheelZoomRate:this._defaultZoomRate;let y=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&y!==0&&(y=1/y);const b=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(b*y))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,o=this._startZoom,c=this._easing;let d,f=!1;if(this._type==="wheel"&&o&&c){const _=Math.min((h.exported.now()-this._lastWheelEventTime)/200,1),y=c(_);d=h.number(o,n,y),_<1?this._frameId||(this._frameId=!0):f=!0}else d=n,f=!0;return this._active=!0,f&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!f,zoomDelta:d-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=h.ease;if(this._prevEase){const o=this._prevEase,c=(h.exported.now()-o.start)/o.duration,d=o.easing(c+.01)-o.easing(c),f=.27/Math.sqrt(d*d+1e-4)*.01,_=Math.sqrt(.0729-f*f);n=h.bezier(f,_,.25,1)}return this._prevEase={start:h.exported.now(),duration:t,easing:n},n}reset(){this._active=!1}}class bo{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class wo{constructor(){this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:o=>{o.easeTo({duration:300,zoom:o.getZoom()+(t.shiftKey?-1:1),around:o.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hi{constructor(){this._tap=new _o({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(t,n,o){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?o.length>0&&(this._swipePoint=n[0],this._swipeTouch=o[0].identifier):this._tap.touchstart(t,n,o))}touchmove(t,n,o){if(this._tapTime){if(this._swipePoint){if(o[0].identifier!==this._swipeTouch)return;const c=n[0],d=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:d/128}}}else this._tap.touchmove(t,n,o)}touchend(t,n,o){this._tapTime?this._swipePoint&&o.length===0&&this.reset():this._tap.touchend(t,n,o)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class br{constructor(t,n,o){this._el=t,this._mousePan=n,this._touchPan=o}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class xs{constructor(t,n,o){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=o}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Eo{constructor(t,n,o,c){this._el=t,this._touchZoom=n,this._touchRotate=o,this._tapDragZoom=c,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const fn=l=>l.zoom||l.drag||l.pitch||l.rotate;class zo extends h.Event{}function Sa(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class Ii{constructor(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ds(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),h.bindAll(["handleEvent","handleWindowEvent"],this);const o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[window,"blur",void 0]];for(const[c,d,f]of this._listeners)ne.addEventListener(c,d,c===document?this.handleWindowEvent:this.handleEvent,f)}destroy(){for(const[t,n,o]of this._listeners)ne.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,o)}_addDefaultHandlers(t){const n=this._map,o=n.getCanvasContainer();this._add("mapEvent",new Ur(n,t));const c=n.boxZoom=new dn(n,t);this._add("boxZoom",c);const d=new ol,f=new wo;n.doubleClickZoom=new bo(f,d),this._add("tapZoom",d),this._add("clickZoom",f);const _=new hi;this._add("tapDragZoom",_);const y=n.touchPitch=new _s;this._add("touchPitch",y);const b=new we(t),S=new yo(t);n.dragRotate=new xs(t,b,S),this._add("mouseRotate",b,["mousePitch"]),this._add("mousePitch",S,["mouseRotate"]);const I=new mn(t),P=new Nn(t);n.dragPan=new br(o,I,P),this._add("mousePan",I),this._add("touchPan",P,["touchZoom","touchRotate"]);const F=new sl,M=new xo;n.touchZoomRotate=new Eo(o,M,F,_),this._add("touchRotate",F,["touchPan","touchZoom"]),this._add("touchZoom",M,["touchPan","touchRotate"]);const R=n.scrollZoom=new vo(n,this);this._add("scrollZoom",R,["mousePan"]);const G=n.keyboard=new ll;this._add("keyboard",G),this._add("blockableMapEvent",new ms(n));for(const j of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[j]&&n[j].enable(t[j])}_add(t,n,o){this._handlers.push({handlerName:t,handler:n,allowed:o}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(fn(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,n,o){for(const c in t)if(c!==o&&(!n||n.indexOf(c)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const n=[];for(const o of t)this._el.contains(o.target)&&n.push(o);return n}handleEvent(t,n){if(t.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const o=t.type==="renderFrame"?void 0:t,c={needsRenderFrame:!1},d={},f={},_=t.touches,y=_?this._getMapTouches(_):void 0,b=y?ne.touchPos(this._el,y):ne.mousePos(this._el,t);for(const{handlerName:P,handler:F,allowed:M}of this._handlers){if(!F.isEnabled())continue;let R;this._blockedByActive(f,M,P)?F.reset():F[n||t.type]&&(R=F[n||t.type](t,b,y),this.mergeHandlerResult(c,d,R,P,o),R&&R.needsRenderFrame&&this._triggerRenderFrame()),(R||F.isActive())&&(f[P]=F)}const S={};for(const P in this._previousActiveHandlers)f[P]||(S[P]=o);this._previousActiveHandlers=f,(Object.keys(S).length||Sa(c))&&(this._changes.push([c,d,S]),this._triggerRenderFrame()),(Object.keys(f).length||Sa(c))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:I}=c;I&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],I(this._map))}mergeHandlerResult(t,n,o,c,d){if(!o)return;h.extend(t,o);const f={handlerName:c,originalEvent:o.originalEvent||d};o.zoomDelta!==void 0&&(n.zoom=f),o.panDelta!==void 0&&(n.drag=f),o.pitchDelta!==void 0&&(n.pitch=f),o.bearingDelta!==void 0&&(n.rotate=f)}_applyChanges(){const t={},n={},o={};for(const[c,d,f]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new h.pointGeometry(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),h.extend(n,d),h.extend(o,f);this._updateMapTransform(t,n,o),this._changes=[]}_updateMapTransform(t,n,o){const c=this._map,d=c.transform;if(!Sa(t))return this._fireEvents(n,o,!0);let{panDelta:f,zoomDelta:_,bearingDelta:y,pitchDelta:b,around:S,pinchAround:I}=t;I!==void 0&&(S=I),c._stop(!0),S=S||c.transform.centerPoint;const P=d.pointLocation(f?S.sub(f):S);y&&(d.bearing+=y),b&&(d.pitch+=b),_&&(d.zoom+=_),d.setLocationAtPoint(P,S),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,o,!0)}_fireEvents(t,n,o){const c=fn(this._eventsInProgress),d=fn(t),f={};for(const S in t){const{originalEvent:I}=t[S];this._eventsInProgress[S]||(f[`${S}start`]=I),this._eventsInProgress[S]=t[S]}!c&&d&&this._fireEvent("movestart",d.originalEvent);for(const S in f)this._fireEvent(S,f[S]);d&&this._fireEvent("move",d.originalEvent);for(const S in t){const{originalEvent:I}=t[S];this._fireEvent(S,I)}const _={};let y;for(const S in this._eventsInProgress){const{handlerName:I,originalEvent:P}=this._eventsInProgress[S];this._handlersById[I].isActive()||(delete this._eventsInProgress[S],y=n[I]||P,_[`${S}end`]=y)}for(const S in _)this._fireEvent(S,_[S]);const b=fn(this._eventsInProgress);if(o&&(c||d)&&!b){this._updatingCamera=!0;const S=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),I=P=>P!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new zo("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const yt={extend:(l,...t)=>h.extend(l,...t),run(l){l()},logToElement(l,t=!1,n="log"){const o=window.document.getElementById(n);o&&(t&&(o.innerHTML=""),o.innerHTML+=`
${l}`)}};class Ta extends h.Evented{constructor(t,n){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,h.bindAll(["_renderFrameCallback"],this)}getCenter(){return new h.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,o){return t=h.pointGeometry.convert(t).mult(-1),this.panTo(this.transform.center,h.extend({offset:t},n),o)}panTo(t,n,o){return this.easeTo(h.extend({center:t},n),o)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,o){return this.easeTo(h.extend({zoom:t},n),o)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,o){return this.easeTo(h.extend({bearing:t},n),o)}resetNorth(t,n){return this.rotateTo(0,h.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(h.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=h.number(c,y,ee)),this._rotating&&(o.bearing=h.number(d,b,ee)),this._pitching&&(o.pitch=h.number(f,S,ee)),this._padding&&(o.interpolatePadding(_,I,ee),F=o.centerPoint.add(P)),Z)o.setLocationAtPoint(Z,ae);else{const ce=o.zoomScale(o.zoom-c),ue=y>c?Math.min(2,H):Math.max(.5,H),re=Math.pow(ue,1-ee),ze=o.unproject(G.add(j.mult(ee*re)).mult(ce));o.setLocationAtPoint(o.renderWorldCopies?ze.wrap():ze,F)}this._fireMoveEvents(n)},ee=>{this._afterEase(n,ee)},t),this}_prepareEase(t,n,o={}){this._moving=!0,n||o.moving||this.fire(new h.Event("movestart",t)),this._zooming&&!o.zooming&&this.fire(new h.Event("zoomstart",t)),this._rotating&&!o.rotating&&this.fire(new h.Event("rotatestart",t)),this._pitching&&!o.pitching&&this.fire(new h.Event("pitchstart",t))}_fireMoveEvents(t){this.fire(new h.Event("move",t)),this._zooming&&this.fire(new h.Event("zoom",t)),this._rotating&&this.fire(new h.Event("rotate",t)),this._pitching&&this.fire(new h.Event("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const o=this._zooming,c=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,o&&this.fire(new h.Event("zoomend",t)),c&&this.fire(new h.Event("rotateend",t)),d&&this.fire(new h.Event("pitchend",t)),this.fire(new h.Event("moveend",t))}flyTo(t,n){if(!t.essential&&h.exported.prefersReducedMotion){const He=h.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(He,n)}this.stop(),t=h.extend({offset:[0,0],speed:1.2,curve:1.42,easing:h.ease},t);const o=this.transform,c=this.getZoom(),d=this.getBearing(),f=this.getPitch(),_=this.getPadding(),y="zoom"in t?h.clamp(+t.zoom,o.minZoom,o.maxZoom):c,b="bearing"in t?this._normalizeBearing(t.bearing,d):d,S="pitch"in t?+t.pitch:f,I="padding"in t?t.padding:o.padding,P=o.zoomScale(y-c),F=h.pointGeometry.convert(t.offset);let M=o.centerPoint.add(F);const R=o.pointLocation(M),G=h.LngLat.convert(t.center||R);this._normalizeCenter(G);const j=o.project(R),H=o.project(G).sub(j);let Z=t.curve;const ae=Math.max(o.width,o.height),J=ae/P,ee=H.mag();if("minZoom"in t){const He=h.clamp(Math.min(t.minZoom,c,y),o.minZoom,o.maxZoom),St=ae/o.zoomScale(He-c);Z=Math.sqrt(St/ee*2)}const ce=Z*Z;function ue(He){const St=(J*J-ae*ae+(He?-1:1)*ce*ce*ee*ee)/(2*(He?J:ae)*ce*ee);return Math.log(Math.sqrt(St*St+1)-St)}function re(He){return(Math.exp(He)-Math.exp(-He))/2}function ze(He){return(Math.exp(He)+Math.exp(-He))/2}const ge=ue(0);let Le=function(He){return ze(ge)/ze(ge+Z*He)},Ye=function(He){return ae*((ze(ge)*(re(St=ge+Z*He)/ze(St))-re(ge))/ce)/ee;var St},Ge=(ue(1)-ge)/Z;if(Math.abs(ee)<1e-6||!isFinite(Ge)){if(Math.abs(ae-J)<1e-6)return this.easeTo(t,n);const He=Jt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=d!==b,this._pitching=S!==f,this._padding=!o.isPaddingEqual(I),this._prepareEase(n,!1),this._ease(He=>{const St=He*Ge,Be=1/Le(St);o.zoom=He===1?y:c+o.scaleZoom(Be),this._rotating&&(o.bearing=h.number(d,b,He)),this._pitching&&(o.pitch=h.number(f,S,He)),this._padding&&(o.interpolatePadding(_,I,He),M=o.centerPoint.add(F));const it=He===1?G:o.unproject(j.add(H.mult(Ye(St))).mult(Be));o.setLocationAtPoint(o.renderWorldCopies?it.wrap():it,M),this._fireMoveEvents(n)},()=>this._afterEase(n),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,n)}if(!t){const o=this.handlers;o&&o.stop(!1)}return this}_ease(t,n,o){o.animate===!1||o.duration===0?(t(1),n()):(this._easeStart=h.exported.now(),this._easeOptions=o,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((h.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,n){t=h.wrap(t,-180,180);const o=Math.abs(t-n);return Math.abs(t-360-n)180?-360:o<-180?360:0}}class Ia{constructor(t={}){this.options=t,h.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=ne.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=ne.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ne.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){ne.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const o=this._map._getUIString(`AttributionControl.${n}`);t.title=o,t.setAttribute("aria-label",o)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(t){!t||t.sourceDataType!=="metadata"&&t.sourceDataType!=="visibility"&&t.dataType!=="style"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(c=>typeof c!="string"?"":c)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const n=this._map.style.sourceCaches;for(const c in n){const d=n[c];if(d.used){const f=d.getSource();f.attribution&&t.indexOf(f.attribution)<0&&t.push(f.attribution)}}t=t.filter(c=>String(c).trim()),t.sort((c,d)=>c.length-d.length),t=t.filter((c,d)=>{for(let f=d+1;f=0)return!1;return!0});const o=t.join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class So{constructor(t={}){this.options=t,h.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=ne.create("div","maplibregl-ctrl mapboxgl-ctrl");const n=ne.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){ne.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const t=this._container.children;if(t.length){const n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&n.classList.add("maplibregl-compact","mapboxgl-compact"):n.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class vs{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,o=n?this._queue.concat(n):this._queue;for(const c of o)if(c.id===t)return void(c.cancelled=!0)}run(t=0){const n=this._currentlyRunning=this._queue;this._queue=[];for(const o of n)if(!o.cancelled&&(o.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const bs={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},hl={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},Gi={showCompass:!0,showZoom:!0,visualizePitch:!1};class Aa{constructor(t,n,o=!1){this._clickTolerance=10,this.element=n,this.mouseRotate=new we({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,o&&(this.mousePitch=new yo({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),h.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),ne.addEventListener(n,"mousedown",this.mousedown),ne.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),ne.addEventListener(n,"touchmove",this.touchmove),ne.addEventListener(n,"touchend",this.touchend),ne.addEventListener(n,"touchcancel",this.reset)}down(t,n){this.mouseRotate.mousedown(t,n),this.mousePitch&&this.mousePitch.mousedown(t,n),ne.disableDrag()}move(t,n){const o=this.map,c=this.mouseRotate.mousemoveWindow(t,n);if(c&&c.bearingDelta&&o.setBearing(o.getBearing()+c.bearingDelta),this.mousePitch){const d=this.mousePitch.mousemoveWindow(t,n);d&&d.pitchDelta&&o.setPitch(o.getPitch()+d.pitchDelta)}}off(){const t=this.element;ne.removeEventListener(t,"mousedown",this.mousedown),ne.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),ne.removeEventListener(t,"touchmove",this.touchmove),ne.removeEventListener(t,"touchend",this.touchend),ne.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){ne.enableDrag(),ne.removeEventListener(window,"mousemove",this.mousemove),ne.removeEventListener(window,"mouseup",this.mouseup)}mousedown(t){this.down(h.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),ne.mousePos(this.element,t)),ne.addEventListener(window,"mousemove",this.mousemove),ne.addEventListener(window,"mouseup",this.mouseup)}mousemove(t){this.move(t,ne.mousePos(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ne.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){t.targetTouches.length!==1?this.reset():(this._lastPos=ne.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const o=n.locationPoint(l);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;l.lng>n.center.lng?l.lng-=360:l.lng+=360}return l}const Pe={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Gn(l,t,n){const o=l.classList;for(const c in Pe)o.remove(`maplibregl-${n}-anchor-${c}`,`mapboxgl-${n}-anchor-${c}`);o.add(`maplibregl-${n}-anchor-${t}`,`mapboxgl-${n}-anchor-${t}`)}class jn extends h.Evented{constructor(t,n){if(super(),(t instanceof HTMLElement||n)&&(t=h.extend({element:t},n)),h.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=h.pointGeometry.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=ne.create("div"),this._element.setAttribute("aria-label","Map marker");const o=ne.createNS("http://www.w3.org/2000/svg","svg"),c=41,d=27;o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height",`${c}px`),o.setAttributeNS(null,"width",`${d}px`),o.setAttributeNS(null,"viewBox",`0 0 ${d} ${c}`);const f=ne.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");const _=ne.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"fill-rule","nonzero");const y=ne.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(3.0, 29.0)"),y.setAttributeNS(null,"fill","#000000");const b=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const H of b){const Z=ne.createNS("http://www.w3.org/2000/svg","ellipse");Z.setAttributeNS(null,"opacity","0.04"),Z.setAttributeNS(null,"cx","10.5"),Z.setAttributeNS(null,"cy","5.80029008"),Z.setAttributeNS(null,"rx",H.rx),Z.setAttributeNS(null,"ry",H.ry),y.appendChild(Z)}const S=ne.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill",this._color);const I=ne.createNS("http://www.w3.org/2000/svg","path");I.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),S.appendChild(I);const P=ne.createNS("http://www.w3.org/2000/svg","g");P.setAttributeNS(null,"opacity","0.25"),P.setAttributeNS(null,"fill","#000000");const F=ne.createNS("http://www.w3.org/2000/svg","path");F.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),P.appendChild(F);const M=ne.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"transform","translate(6.0, 7.0)"),M.setAttributeNS(null,"fill","#FFFFFF");const R=ne.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(8.0, 8.0)");const G=ne.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#000000"),G.setAttributeNS(null,"opacity","0.25"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962");const j=ne.createNS("http://www.w3.org/2000/svg","circle");j.setAttributeNS(null,"fill","#FFFFFF"),j.setAttributeNS(null,"cx","5.5"),j.setAttributeNS(null,"cy","5.5"),j.setAttributeNS(null,"r","5.4999962"),R.appendChild(G),R.appendChild(j),_.appendChild(y),_.appendChild(S),_.appendChild(P),_.appendChild(M),_.appendChild(R),o.appendChild(_),o.setAttributeNS(null,"height",c*this._scale+"px"),o.setAttributeNS(null,"width",d*this._scale+"px"),this._element.appendChild(o),this._offset=h.pointGeometry.convert(t&&t.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",o=>{o.preventDefault()}),this._element.addEventListener("mousedown",o=>{o.preventDefault()}),Gn(this._element,this._anchor,"marker"),this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),ne.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=h.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const c=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(t){const n=t.code,o=t.charCode||t.keyCode;n!=="Space"&&n!=="Enter"&&o!==32&&o!==13||this.togglePopup()}_onMapClick(t){const n=t.originalEvent.target,o=this._element;this._popup&&(n===o||o.contains(n))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_update(t){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Te(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let n="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?n=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let o="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?o="rotateX(0deg)":this._pitchAlignment==="map"&&(o=`rotateX(${this._map.getPitch()}deg)`),t&&t.type!=="moveend"||(this._pos=this._pos.round()),ne.setTransform(this._element,`${Pe[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${o} ${n}`)}getOffset(){return this._offset}setOffset(t){return this._offset=h.pointGeometry.convert(t),this._update(),this}_onMove(t){if(!this._isDragging){const n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new h.Event("dragstart"))),this.fire(new h.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new h.Event("dragend")),this._state="inactive"}_addDragHandler(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const To={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ot,Gr=0,ui=!1;const ul={maxWidth:100,unit:"metric"};function Zn(l,t,n){const o=n&&n.maxWidth||100,c=l._container.clientHeight/2,d=l.unproject([0,c]),f=l.unproject([o,c]),_=d.distanceTo(f);if(n&&n.unit==="imperial"){const y=3.2808*_;y>5280?gt(t,o,y/5280,l._getUIString("ScaleControl.Miles")):gt(t,o,y,l._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?gt(t,o,_/1852,l._getUIString("ScaleControl.NauticalMiles")):_>=1e3?gt(t,o,_/1e3,l._getUIString("ScaleControl.Kilometers")):gt(t,o,_,l._getUIString("ScaleControl.Meters"))}function gt(l,t,n,o){const c=function(d){const f=Math.pow(10,`${Math.floor(d)}`.length-1);let _=d/f;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:function(y){const b=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*b)/b}(_),f*_}(n);l.style.width=t*(c/n)+"px",l.innerHTML=`${c} ${o}`}const Vt={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ws=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function gn(l){if(l){if(typeof l=="number"){const t=Math.round(Math.sqrt(.5*Math.pow(l,2)));return{center:new h.pointGeometry(0,0),top:new h.pointGeometry(0,l),"top-left":new h.pointGeometry(t,t),"top-right":new h.pointGeometry(-t,t),bottom:new h.pointGeometry(0,-l),"bottom-left":new h.pointGeometry(t,-t),"bottom-right":new h.pointGeometry(-t,-t),left:new h.pointGeometry(l,0),right:new h.pointGeometry(-l,0)}}if(l instanceof h.pointGeometry||Array.isArray(l)){const t=h.pointGeometry.convert(l);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:h.pointGeometry.convert(l.center||[0,0]),top:h.pointGeometry.convert(l.top||[0,0]),"top-left":h.pointGeometry.convert(l["top-left"]||[0,0]),"top-right":h.pointGeometry.convert(l["top-right"]||[0,0]),bottom:h.pointGeometry.convert(l.bottom||[0,0]),"bottom-left":h.pointGeometry.convert(l["bottom-left"]||[0,0]),"bottom-right":h.pointGeometry.convert(l["bottom-right"]||[0,0]),left:h.pointGeometry.convert(l.left||[0,0]),right:h.pointGeometry.convert(l.right||[0,0])}}return gn(new h.pointGeometry(0,0))}const Xn={supported:zt,setRTLTextPlugin:h.setRTLTextPlugin,getRTLTextPluginStatus:h.getRTLTextPluginStatus,Map:class extends Ta{constructor(l){var t;if(h.PerformanceUtils.mark(h.PerformanceMarkers.create),(l=h.extend({},hl,l)).minZoom!=null&&l.maxZoom!=null&&l.minZoom>l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Fn(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),{bearingSnap:l.bearingSnap}),this._interactive=l.interactive,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._crossSourceCollisions=l.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=l.collectResourceTiming,this._renderTaskQueue=new vs,this._controls=[],this._mapId=h.uniqueId(),this._locale=h.extend({},bs,l.locale),this._clickTolerance=l.clickTolerance,this._pixelRatio=(t=l.pixelRatio)!==null&&t!==void 0?t:devicePixelRatio,this._requestManager=new Yi(l.transformRequest),typeof l.container=="string"){if(this._container=document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(l.maxBounds&&this.setMaxBounds(l.maxBounds),h.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),typeof window!="undefined"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ii(this,l),this._hash=l.hash&&new cs(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,h.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localIdeographFontFamily:l.localIdeographFontFamily}),l.attributionControl&&this.addControl(new Ia({customAttribution:l.customAttribution})),l.maplibreLogo&&this.addControl(new So,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new h.Event(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new h.Event(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new h.Event("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(l,t){if(t===void 0&&(t=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=l.onAdd(this);this._controls.push(l);const o=this._controlPositions[t];return t.indexOf("bottom")!==-1?o.insertBefore(n,o.firstChild):o.appendChild(n),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(l);return t>-1&&this._controls.splice(t,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}resize(l){const t=this._containerDimensions(),n=t[0],o=t[1];this._resizeCanvas(n,o,this.getPixelRatio()),this.transform.resize(n,o),this.painter.resize(n,o,this.getPixelRatio());const c=!this._moving;return c&&(this.stop(),this.fire(new h.Event("movestart",l)).fire(new h.Event("move",l))),this.fire(new h.Event("resize",l)),c&&this.fire(new h.Event("moveend",l)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(l){const[t,n]=this._containerDimensions();this._pixelRatio=l,this._resizeCanvas(t,n,l),this.painter.resize(t,n,l)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(l){return this.transform.setMaxBounds(h.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=l==null?-2:l)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l&&this.setZoom(l),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=l==null?0:l)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l&&this.setPitch(l),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this._update()}project(l){return this.transform.locationPoint(h.LngLat.convert(l))}unproject(l){return this.transform.pointLocation(h.pointGeometry.convert(l))}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(l,t,n){if(l==="mouseenter"||l==="mouseover"){let o=!1;return{layer:t,listener:n,delegates:{mousemove:d=>{const f=this.getLayer(t)?this.queryRenderedFeatures(d.point,{layers:[t]}):[];f.length?o||(o=!0,n.call(this,new gi(l,this,d.originalEvent,{features:f}))):o=!1},mouseout:()=>{o=!1}}}}if(l==="mouseleave"||l==="mouseout"){let o=!1;return{layer:t,listener:n,delegates:{mousemove:f=>{(this.getLayer(t)?this.queryRenderedFeatures(f.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,n.call(this,new gi(l,this,f.originalEvent)))},mouseout:f=>{o&&(o=!1,n.call(this,new gi(l,this,f.originalEvent)))}}}}{const o=c=>{const d=this.getLayer(t)?this.queryRenderedFeatures(c.point,{layers:[t]}):[];d.length&&(c.features=d,n.call(this,c),delete c.features)};return{layer:t,listener:n,delegates:{[l]:o}}}}on(l,t,n){if(n===void 0)return super.on(l,t);const o=this._createDelegatedListener(l,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(o);for(const c in o.delegates)this.on(c,o.delegates[c]);return this}once(l,t,n){if(n===void 0)return super.once(l,t);const o=this._createDelegatedListener(l,t,n);for(const c in o.delegates)this.once(c,o.delegates[c]);return this}off(l,t,n){return n===void 0?super.off(l,t):(this._delegatedListeners&&this._delegatedListeners[l]&&(o=>{const c=this._delegatedListeners[l];for(let d=0;d{o?this.fire(new h.ErrorEvent(o)):c&&this._updateDiff(c,t)})}else typeof l=="object"&&this._updateDiff(l,t)}_updateDiff(l,t){try{this.style.setState(l)&&this._update(!0)}catch(n){h.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(l,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():h.warnOnce("There is no style added to the map.")}addSource(l,t){return this._lazyInitEmptyStyle(),this.style.addSource(l,t),this._update(!0)}isSourceLoaded(l){const t=this.style&&this.style.sourceCaches[l];if(t!==void 0)return t.loaded();this.fire(new h.ErrorEvent(new Error(`There is no source with ID '${l}'`)))}areTilesLoaded(){const l=this.style&&this.style.sourceCaches;for(const t in l){const n=l[t]._tiles;for(const o in n){const c=n[o];if(c.state!=="loaded"&&c.state!=="errored")return!1}}return!0}addSourceType(l,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(l,t,n)}removeSource(l){return this.style.removeSource(l),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,t,{pixelRatio:n=1,sdf:o=!1,stretchX:c,stretchY:d,content:f}={}){if(this._lazyInitEmptyStyle(),t instanceof HTMLImageElement||h.isImageBitmap(t)){const{width:_,height:y,data:b}=h.exported.getImageData(t);this.style.addImage(l,{data:new h.RGBAImage({width:_,height:y},b),pixelRatio:n,stretchX:c,stretchY:d,content:f,sdf:o,version:0})}else{if(t.width===void 0||t.height===void 0)return this.fire(new h.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:_,height:y,data:b}=t,S=t;this.style.addImage(l,{data:new h.RGBAImage({width:_,height:y},new Uint8Array(b)),pixelRatio:n,stretchX:c,stretchY:d,content:f,sdf:o,version:0,userImage:S}),S.onAdd&&S.onAdd(this,l)}}}updateImage(l,t){const n=this.style.getImage(l);if(!n)return this.fire(new h.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const o=t instanceof HTMLImageElement||h.isImageBitmap(t)?h.exported.getImageData(t):t,{width:c,height:d,data:f}=o;if(c===void 0||d===void 0)return this.fire(new h.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(c!==n.data.width||d!==n.data.height)return this.fire(new h.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const _=!(t instanceof HTMLImageElement||h.isImageBitmap(t));n.data.replace(f,_),this.style.updateImage(l,n)}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new h.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,t){h.getImage(this._requestManager.transformRequest(l,h.ResourceType.Image),t)}listImages(){return this.style.listImages()}addLayer(l,t){return this._lazyInitEmptyStyle(),this.style.addLayer(l,t),this._update(!0)}moveLayer(l,t){return this.style.moveLayer(l,t),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,t,n){return this.style.setLayerZoomRange(l,t,n),this._update(!0)}setFilter(l,t,n={}){return this.style.setFilter(l,t,n),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,t,n,o={}){return this.style.setPaintProperty(l,t,n,o),this._update(!0)}getPaintProperty(l,t){return this.style.getPaintProperty(l,t)}setLayoutProperty(l,t,n,o={}){return this.style.setLayoutProperty(l,t,n,o),this._update(!0)}getLayoutProperty(l,t){return this.style.getLayoutProperty(l,t)}setLight(l,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(l,t){return this.style.setFeatureState(l,t),this._update()}removeFeatureState(l,t){return this.style.removeFeatureState(l,t),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let l=0,t=0;return this._container&&(l=this._container.clientWidth||400,t=this._container.clientHeight||300),[l,t]}_setupContainer(){const l=this._container;l.classList.add("maplibregl-map","mapboxgl-map");const t=this._canvasContainer=ne.create("div","maplibregl-canvas-container mapboxgl-canvas-container",l);this._interactive&&t.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=ne.create("canvas","maplibregl-canvas mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const n=this._containerDimensions();this._resizeCanvas(n[0],n[1],this.getPixelRatio());const o=this._controlContainer=ne.create("div","maplibregl-control-container mapboxgl-control-container",l),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{c[d]=ne.create("div",`maplibregl-ctrl-${d} mapboxgl-ctrl-${d}`,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,t,n){this._canvas.width=n*l,this._canvas.height=n*t,this._canvas.style.width=`${l}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const l=h.extend({},zt.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),t=this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);t?(this.painter=new go(t,this.transform),h.exported$1.testSupport(t)):this.fire(new h.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new h.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new h.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_render(l){let t,n=0;const o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(t=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,t),n=h.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(l),this._removed)return;let c=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const f=this.transform.zoom,_=h.exported.now();this.style.zoomHistory.update(f,_);const y=new h.EvaluationParameters(f,{now:_,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),b=y.crossFadingFactor();b===1&&b===this._crossFadingFactor||(c=!0,this._crossFadingFactor=b),this.style.update(y)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new h.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.load),this.fire(new h.Event("load"))),this.style&&(this.style.hasTransitions()||c)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const f=h.exported.now()-n;o.endQueryEXT(o.TIME_ELAPSED_EXT,t),setTimeout(()=>{const _=o.getQueryObjectEXT(t,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(t),this.fire(new h.Event("gpu-timing-frame",{cpuTime:f,gpuTime:_}))},50)}if(this.listens("gpu-timing-layer")){const f=this.painter.collectGpuTimers();setTimeout(()=>{const _=this.painter.queryGpuTimers(f);this.fire(new h.Event("gpu-timing-layer",{layerTimes:_}))},50)}const d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new h.Event("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window!="undefined"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));const l=this.painter.context.gl.getExtension("WEBGL_lose_context");l&&l.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ne.remove(this._canvasContainer),ne.remove(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),h.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new h.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=h.exported.frame(l=>{h.PerformanceUtils.frame(l),this._frame=null,this._render(l)}))}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}_setCacheLimits(l,t){h.setCacheLimits(l,t)}},NavigationControl:class{constructor(l){this.options=h.extend({},Gi,l),this._container=ne.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(h.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),ne.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),ne.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(h.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=ne.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map.getZoom(),t=l===this._map.getMaxZoom(),n=l===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const l=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=l}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Aa(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ne.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(l,t){const n=ne.create("button",l,this._container);return n.type="button",n.addEventListener("click",t),n}_setButtonTitle(l,t){const n=this._map._getUIString(`NavigationControl.${t}`);l.title=n,l.setAttribute("aria-label",n)}},GeolocateControl:class extends h.Evented{constructor(l){super(),this.options=h.extend({},To,l),h.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(l){var t;return this._map=l,this._container=ne.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),t=this._setupUI,Ot!==void 0?t(Ot):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(n=>{Ot=n.state!=="denied",t(Ot)}):(Ot=!!window.navigator.geolocation,t(Ot)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),ne.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gr=0,ui=!1}_isOutOfMapMaxBounds(l){const t=this._map.getMaxBounds(),n=l.coords;return t&&(n.longitudet.getEast()||n.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new h.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(l),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new h.Event("geolocate",l)),this._finish()}}_updateCamera(l){const t=new h.LngLat(l.coords.longitude,l.coords.latitude),n=l.coords.accuracy,o=this._map.getBearing(),c=h.extend({bearing:o},this.options.fitBoundsOptions);this._map.fitBounds(t.toBounds(n),c,{geolocateSource:!0})}_updateMarker(l){if(l){const t=new h.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map._container.clientHeight/2,t=this._map.unproject([0,l]),n=this._map.unproject([1,l]),o=t.distanceTo(n),c=Math.ceil(2*this._accuracy/o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(l){if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&ui)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new h.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=ne.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),ne.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",l===!1){h.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ne.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new jn(this._dotElement),this._circleElement=ne.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new jn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||t.originalEvent&&t.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new h.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return h.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new h.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gr--,ui=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new h.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new h.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let l;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Gr++,Gr>1?(l={maximumAge:6e5,timeout:0},ui=!0):(l=this.options.positionOptions,ui=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,l)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ia,LogoControl:So,ScaleControl:class{constructor(l){this.options=h.extend({},ul,l),h.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Zn(this._map,this._container,this.options)}onAdd(l){return this._map=l,this._container=ne.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ne.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(l){this.options.unit=l,Zn(this._map,this._container,this.options)}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof HTMLElement?this._container=l.container:h.warnOnce("Full screen control 'container' must be a DOM element.")),h.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=ne.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",h.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){ne.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=ne.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);ne.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.title=l}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends h.Evented{constructor(l){super(),this.options=h.extend(Object.create(Vt),l),h.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new h.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&ne.remove(this._content),this._container&&(ne.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new h.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){return this._lngLat=h.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(document.createTextNode(l))}setHTML(l){const t=document.createDocumentFragment(),n=document.createElement("body");let o;for(n.innerHTML=l;o=n.firstChild,o;)t.appendChild(o);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=ne.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(l),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(l){this._container&&this._container.classList.add(l)}removeClassName(l){this._container&&this._container.classList.remove(l)}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){if(this._container)return this._container.classList.toggle(l)}_createCloseButton(){this.options.closeButton&&(this._closeButton=ne.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(l){this._update(l.point)}_onMouseMove(l){this._update(l.point)}_onDrag(l){this._update(l.point)}_update(l){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=ne.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=ne.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(d=>this._container.classList.add(d)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Te(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!l))return;const t=this._pos=this._trackPointer&&l?l:this._map.project(this._lngLat);let n=this.options.anchor;const o=gn(this.options.offset);if(!n){const d=this._container.offsetWidth,f=this._container.offsetHeight;let _;_=t.y+o.bottom.ythis._map.transform.height-f?["bottom"]:[],t.xthis._map.transform.width-d/2&&_.push("right"),n=_.length===0?"bottom":_.join("-")}const c=t.add(o[n]).round();ne.setTransform(this._container,`${Pe[n]} translate(${c.x}px,${c.y}px)`),Gn(this._container,n,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(ws);l&&l.focus()}_onClose(){this.remove()}},Marker:jn,Style:Zt,LngLat:h.LngLat,LngLatBounds:h.LngLatBounds,Point:h.pointGeometry,MercatorCoordinate:h.MercatorCoordinate,Evented:h.Evented,AJAXError:h.AJAXError,config:h.config,CanvasSource:Cr,GeoJSONSource:Ir,ImageSource:nr,RasterDEMTileSource:Pi,RasterTileSource:gr,VectorTileSource:rr,VideoSource:yr,prewarm:function(){$i().acquire(kr)},clearPrewarmedResources:function(){const l=sr;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(kr),sr=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get workerCount(){return Ni.workerCount},set workerCount(l){Ni.workerCount=l},get maxParallelImageRequests(){return h.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){h.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){h.clearTileCache(l)},workerUrl:"",addProtocol(l,t){h.config.REGISTERED_PROTOCOLS[l]=t},removeProtocol(l){delete h.config.REGISTERED_PROTOCOLS[l]}};return yt.extend(Xn,{isSafari:h.isSafari,getPerformanceMetrics:h.PerformanceUtils.getPerformanceMetrics}),Xn});var Ui=ct;return Ui})})(xh);var bh=xh.exports;function pp(lt,Je,Ze){Ze===void 0&&(Ze={});var Qe={type:"Feature"};return(Ze.id===0||Ze.id)&&(Qe.id=Ze.id),Ze.bbox&&(Qe.bbox=Ze.bbox),Qe.properties=Je||{},Qe.geometry=lt,Qe}function js(lt,Je,Ze){if(Ze===void 0&&(Ze={}),!lt)throw new Error("coordinates is required");if(!Array.isArray(lt))throw new Error("coordinates must be an Array");if(lt.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!yh(lt[0])||!yh(lt[1]))throw new Error("coordinates must contain numbers");var Qe={type:"Point",coordinates:lt};return pp(Qe,Je,Ze)}function dp(lt,Je){Je===void 0&&(Je={});var Ze={type:"FeatureCollection"};return Je.id&&(Ze.id=Je.id),Je.bbox&&(Ze.bbox=Je.bbox),Ze.features=lt,Ze}function yh(lt){return!isNaN(lt)&<!==null&&!Array.isArray(lt)}function wh(lt,Je,Ze){if(lt!==null)for(var Qe,ct,Nt,Ui,h,zt,Qt,mi=0,Ne=0,ne,Yi=lt.type,oi=Yi==="FeatureCollection",zr=Yi==="Feature",Ji=oi?lt.features.length:1,si=0;siZe[0]&&(Je[0]=Ze[0]),Je[1]>Ze[1]&&(Je[1]=Ze[1]),Je[2]MIERUNE, under CC BY. Data by OpenStreetMap contributors, under ODbL."}},layers:[{id:"MIERUNEMAP",type:"raster",source:"MIERUNEMAP",minzoom:0,maxzoom:18}]},center:[139.767,35.681],zoom:11});$a.addControl(new bh.NavigationControl({visualizePitch:!0}));$a.on("load",function(){const lt=dp([js([139.7594,35.6865]),js([139.7692,35.6665]),js([139.7812,35.6849])]);$a.addSource("FeaturesPoint",{type:"geojson",data:lt}),$a.addLayer({id:"FeaturesPoint",type:"circle",source:"FeaturesPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#1253A4","circle-stroke-width":5,"circle-stroke-opacity":.8,"circle-color":"#1253A4","circle-radius":5,"circle-opacity":.5}});const Je=mp(lt);$a.addSource("CenterPoint",{type:"geojson",data:Je}),$a.addLayer({id:"CenterPoint",type:"circle",source:"CenterPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#8DCF3F","circle-stroke-width":10,"circle-stroke-opacity":.8,"circle-color":"#8DCF3F","circle-radius":10,"circle-opacity":.5}})}); diff --git a/docs/assets/index.b25085c0.css b/docs/assets/index.b25085c0.css deleted file mode 100644 index ea3ad36..0000000 --- a/docs/assets/index.b25085c0.css +++ /dev/null @@ -1 +0,0 @@ -html,body{height:100%;padding:0;margin:0}#map{z-index:0;height:100%}.mapboxgl-map,.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas,.maplibregl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:fullscreen,.maplibregl-map:fullscreen{height:100%;width:100%}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass,.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer,.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active,.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right,.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left,.maplibregl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right,.maplibregl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left,.maplibregl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right,.maplibregl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl,.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl,.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl,.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group,.maplibregl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button,.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon,.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon,.maplibregl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner,.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus,.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled,.maplibregl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover,.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible,.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible),.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child,.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child,.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child,.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact,a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib,.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact,.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a,.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover,.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-attrib-empty,.maplibregl-attrib-empty{display:none}.mapboxgl-ctrl-scale,.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.mapboxgl-popup,.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right,.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right,.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left,.maplibregl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right,.maplibregl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip,.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button,.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover,.maplibregl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content,.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content,.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content,.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer,.maplibregl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *,.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer,.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer,.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.mapboxgl-marker,.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.mapboxgl-user-location-dot,.maplibregl-user-location-dot{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before,.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;background-color:#1da1f2;border-radius:50%;content:"";height:15px;position:absolute;width:15px}.mapboxgl-user-location-dot:after,.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale,.maplibregl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after,.maplibregl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle,.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active,.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom,.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0} diff --git a/docs/index.html b/docs/index.html index 337da93..a54f0e0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,10 +5,11 @@ Turf.js Starter - - + +
+ diff --git a/package-lock.json b/package-lock.json index d633789..ce43749 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,363 @@ "license": "ISC", "dependencies": { "@turf/turf": "^6.5.0", - "maplibre-gl": "^2.1.9" + "maplibre-gl": "^3.1.0" }, "devDependencies": { - "typescript": "^4.5.4", - "vite": "^2.9.16" + "typescript": "^5.1.6", + "vite": "^4.3.9" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" } }, "node_modules/@mapbox/geojson-rewind": { @@ -37,20 +389,15 @@ "node": ">= 0.6" } }, - "node_modules/@mapbox/mapbox-gl-supported": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-2.0.1.tgz", - "integrity": "sha512-HP6XvfNIzfoMVfyGjBckjiAOQK9WfX0ywdLubuPMPv+Vqf5fj0uCbgBQYpiqcWZT6cbyyRnTSXDheT1ugvF6UQ==" - }, "node_modules/@mapbox/point-geometry": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==" }, "node_modules/@mapbox/tiny-sdf": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.5.tgz", - "integrity": "sha512-OhXt2lS//WpLdkqrzo/KwB7SRD8AiNTFFzuo9n14IBupzIMa67yGItcK7I2W9D8Ghpa4T04Sw9FWsKCJG50Bxw==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz", + "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==" }, "node_modules/@mapbox/unitbezier": { "version": "0.0.1", @@ -73,6 +420,26 @@ "node": ">=6.0.0" } }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.2.1.tgz", + "integrity": "sha512-ZVT5QlkVhlxlPav+ca0NO3Moc7EzbHDO2FXW4ic3Q0Vm+TDUw9I8A2EBws7xUUQZf7HQB3kQ+3Jsh5mFLRD4GQ==", + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/unitbezier": "^0.0.1", + "@types/mapbox__point-geometry": "^0.1.2", + "json-stringify-pretty-compact": "^3.0.0", + "minimist": "^1.2.8", + "rw": "^1.3.3", + "sort-object": "^3.0.3" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, "node_modules/@turf/along": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/along/-/along-6.5.0.tgz", @@ -1662,6 +2029,39 @@ "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz", "integrity": "sha512-EDrLIPaPXOZqDjrkzxxbX7UlJSeQVgah3i0aA4pOSzmK9zq3BIh7/MZIQxED7slJByvKM4Gc6Hypyu2lJzh3SQ==" }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/bytewise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", + "dependencies": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "node_modules/bytewise-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", + "dependencies": { + "typewise-core": "^1.2" + } + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -1690,431 +2090,119 @@ "tinyqueue": "^2.0.3" } }, - "node_modules/concaveman/node_modules/rbush": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", - "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", - "dependencies": { - "quickselect": "^2.0.0" - } - }, - "node_modules/csscolorparser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", - "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==" - }, - "node_modules/d3-array": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", - "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" - }, - "node_modules/d3-geo": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.7.1.tgz", - "integrity": "sha512-O4AempWAr+P5qbk2bC2FuN/sDW4z+dN2wDf9QV3bxQt4M5HfOEeXLgJ/UKQW0+o1Dj8BE+L5kiDbdWUMjsmQpw==", - "dependencies": { - "d3-array": "1" - } - }, - "node_modules/d3-voronoi": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.2.tgz", - "integrity": "sha512-RhGS1u2vavcO7ay7ZNAPo4xeDh/VYeGof3x5ZLJBQgYhLegxr3s5IykvWmJ94FTU6mcbtp4sloqZ54mP6R4Utw==" - }, - "node_modules/deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", - "dependencies": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/density-clustering": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/density-clustering/-/density-clustering-1.3.0.tgz", - "integrity": "sha512-icpmBubVTwLnsaor9qH/4tG5+7+f61VcqMN3V3pm9sxxSCt2Jcs0zWOgwZW9ARJYaKD3FumIgHiMOcIMRRAzFQ==" - }, - "node_modules/earcut": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.3.tgz", - "integrity": "sha512-iRDI1QeCQIhMCZk48DRDMVgQSSBDmbzzNhnxIo+pwx3swkfjMh6vh0nWLq1NdvGHLKH6wIrAM3vQWeTj6qeoug==" - }, - "node_modules/esbuild": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.46.tgz", - "integrity": "sha512-vdm5G1JdZBktva8dwQci/s44VbeBUg8g907xoZx77mqFZ4gU5GlMULNsdGeID+qXCXocsfYSGtE0LvqH3eiNQg==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "esbuild-android-64": "0.14.46", - "esbuild-android-arm64": "0.14.46", - "esbuild-darwin-64": "0.14.46", - "esbuild-darwin-arm64": "0.14.46", - "esbuild-freebsd-64": "0.14.46", - "esbuild-freebsd-arm64": "0.14.46", - "esbuild-linux-32": "0.14.46", - "esbuild-linux-64": "0.14.46", - "esbuild-linux-arm": "0.14.46", - "esbuild-linux-arm64": "0.14.46", - "esbuild-linux-mips64le": "0.14.46", - "esbuild-linux-ppc64le": "0.14.46", - "esbuild-linux-riscv64": "0.14.46", - "esbuild-linux-s390x": "0.14.46", - "esbuild-netbsd-64": "0.14.46", - "esbuild-openbsd-64": "0.14.46", - "esbuild-sunos-64": "0.14.46", - "esbuild-windows-32": "0.14.46", - "esbuild-windows-64": "0.14.46", - "esbuild-windows-arm64": "0.14.46" - } - }, - "node_modules/esbuild-android-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.46.tgz", - "integrity": "sha512-ZyJqwAcjNbZprs0ZAxnUAOhEhdE5kTKwz+CZuLmZYNLAPyRgBtaC8pT2PCuPifNvV8Cl3yLlrQPaOCjovoyb5g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-android-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.46.tgz", - "integrity": "sha512-BKcnUksvCijO9ONv6b4SikZE/OZftwJvX91XROODZGQmuwGVg97jmLDVu3lxuHdFlMNNzxh8taJ2mbCWZzH/Iw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.46.tgz", - "integrity": "sha512-/ss2kO92sUJ9/1nHnMb3+oab8w6dyqKrMtPMvSYJ9KZIYGAZxz/WYxfFprY7Xk+ZxWnnlASSyZlG+If1nVmFYg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.46.tgz", - "integrity": "sha512-WX0JOaEFf6t+rIjXO6THsf/0fhQAt2Zb0/PSYlvXnuQQAmOmFAfPsuRNocp5ME0NGaUqZd4FxqqmLEVK3RzPAg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.46.tgz", - "integrity": "sha512-o+ozPFuHRCAGCVWU2bLurOUgVkT0jcPEu082VBUY2Q/yLf+B+/3nXzh4Fjp5O21tOvJRTn7hUVydG9j5+vYE6A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.46.tgz", - "integrity": "sha512-9zicZ0X43WDKz3sjNfcqYO38xbfJpSWYXB+FxvYYkmBwGA52K0SAu4oKuTTLi8od8X2IIo1x5C5TUNvKDSVJww==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-32": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.46.tgz", - "integrity": "sha512-ZnTpZMVb0VGvL99R5eh4OrJwbUyvpM6M88VAMuHP4LvFjuvZrhgefjKqEGuWZZW7JRnAjKqjXLjWdhdSjwMFnQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.46.tgz", - "integrity": "sha512-ECCRRZtX6l4ubeVhHhiVoK/uYAkvzNqfmR4gP4N/9H9RPu+b8YCcN4bQGp7xCuYIV6Xd41WpOMyO+xpcQvjtQQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.46.tgz", - "integrity": "sha512-RvTJEi4vj13c5FP9YPp+8Y6x6HK1E7uSqfy3y9UoeaNAzNZWA7fN1U3hQjTL/dy5zTJH5KE64mrt5k5+he+CQA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.46.tgz", - "integrity": "sha512-HX0TXCHyI0NEWG4jg8LlW1PbZQbnz+PUH56yjx996cgM5pC90u32drKs/tyJiyyQmNk9OXOogjKw7LEdp/Qc1w==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.46.tgz", - "integrity": "sha512-jnb2NDwGqJUVmxn1v0f7seNdDm0nRNWHP9Z3MrWAGnBCdnnDlsjqRFDnbKoaQvWONEa+rOOr/giK+VL0hgQExA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.46.tgz", - "integrity": "sha512-uu3JTQUrwwauKY9z8yq5MnDyOlT3f2DNOzBcYz4dB78HqwEqilCsifoBGd0WcbED5n57dc59X+LZMTZ8Ose44w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-riscv64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.46.tgz", - "integrity": "sha512-OB29r1EG44ZY34JnXCRERxo7k4pRKoQdaoRg2HIeCavatsXZwW4LCakpLnMQ72vXT1HtpBUABEjHkKkn5JyrUg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" + "node_modules/concaveman/node_modules/rbush": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", + "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", + "dependencies": { + "quickselect": "^2.0.0" } }, - "node_modules/esbuild-linux-s390x": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.46.tgz", - "integrity": "sha512-XQ/U9TueMSGYyPTKyZsJVraiuvxhwCDIMn/QwFXCRCJ6H/Cy/Rq33u9qhpeSziinHKfzJROGx5A8mQY6aYamdQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } + "node_modules/d3-array": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", + "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" }, - "node_modules/esbuild-netbsd-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.46.tgz", - "integrity": "sha512-i15BwqHaAIFp1vBJkitAbHtwXcLk9TdHs/Ia1xGIAutQYXSJNPLM3Z4B4hyfHNEFl2yBqBIYpglMohv2ClNdOQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" + "node_modules/d3-geo": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.7.1.tgz", + "integrity": "sha512-O4AempWAr+P5qbk2bC2FuN/sDW4z+dN2wDf9QV3bxQt4M5HfOEeXLgJ/UKQW0+o1Dj8BE+L5kiDbdWUMjsmQpw==", + "dependencies": { + "d3-array": "1" } }, - "node_modules/esbuild-openbsd-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.46.tgz", - "integrity": "sha512-XwOIFCE140Y/PvjrwjFfa/QLWBuvhR1mPCOa35mKx02jt++wPNgf0qhn6HfdVC3vQe7R46RwTp4q2cp99fepEg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } + "node_modules/d3-voronoi": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.2.tgz", + "integrity": "sha512-RhGS1u2vavcO7ay7ZNAPo4xeDh/VYeGof3x5ZLJBQgYhLegxr3s5IykvWmJ94FTU6mcbtp4sloqZ54mP6R4Utw==" }, - "node_modules/esbuild-sunos-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.46.tgz", - "integrity": "sha512-+kV3JnmfdxBVpHyFvuGXWtu6tXxXApOLPkSrVkMJf6+ns/3PLtPndpzwCzHjD+qYUEk8ln4MA+ufQ2qmjW5mZg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" + "node_modules/deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dependencies": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esbuild-windows-32": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.46.tgz", - "integrity": "sha512-gzGC1Q11B/Bo5A2EX4N22oigWmhL7Z0eDyc8kbSoJjqSrGQuRE7B0uMpluO+q0O/gZ1S3zdw+M4PCWlqOIeXLA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], + "node_modules/define-properties": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, "engines": { - "node": ">=12" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esbuild-windows-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.46.tgz", - "integrity": "sha512-Do2daaskfOjmCB7o3ygz6fD3K6SPjZLERiZLktzHz2oUCwsebKu/gmop0+j/XdrVIXC32wFzHzDS+9CTu9OShw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } + "node_modules/density-clustering": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/density-clustering/-/density-clustering-1.3.0.tgz", + "integrity": "sha512-icpmBubVTwLnsaor9qH/4tG5+7+f61VcqMN3V3pm9sxxSCt2Jcs0zWOgwZW9ARJYaKD3FumIgHiMOcIMRRAzFQ==" }, - "node_modules/esbuild-windows-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.46.tgz", - "integrity": "sha512-VEzMy6bM60/HT/URTDElyhfi2Pk0quCCrEhRlI4MRno/AIqYUGw0rZwkPl6PeoqVI6BgoBHGY576GWTiPmshCA==", - "cpu": [ - "arm64" - ], + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, + "node_modules/esbuild": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, "engines": { "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/fsevents": { @@ -2201,11 +2289,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/gl-matrix": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==" }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2272,6 +2381,11 @@ } ] }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -2287,18 +2401,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -2313,6 +2415,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -2328,46 +2449,87 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/kdbush": { + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/json-stringify-pretty-compact": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz", - "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==" + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", + "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==" + }, + "node_modules/kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==" + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/maplibre-gl": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.1.9.tgz", - "integrity": "sha512-pnWJmILeZpgA5QSI7K7xFK3yrkyYTd9srw3fCi2Ca52Phm78hsznPwUErEQcZLfxXKn/1h9t8IPdj0TH0NBNbg==", - "hasInstallScript": true, + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.1.0.tgz", + "integrity": "sha512-KFarVUUszCEucPwnGsFJtPMQBg/F6lg+SPDmTztKUD/n0YShETjIOdNmm5jpxacEX3+dq50MzlqDr6VH+RtDDA==", "dependencies": { - "@mapbox/geojson-rewind": "^0.5.1", + "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/mapbox-gl-supported": "^2.0.1", "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^2.0.4", + "@mapbox/tiny-sdf": "^2.0.6", "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@types/geojson": "^7946.0.8", + "@maplibre/maplibre-gl-style-spec": "^19.2.1", + "@types/geojson": "^7946.0.10", "@types/mapbox__point-geometry": "^0.1.2", "@types/mapbox__vector-tile": "^1.3.0", "@types/pbf": "^3.0.2", - "csscolorparser": "~1.0.3", - "earcut": "^2.2.3", + "earcut": "^2.2.4", "geojson-vt": "^3.2.1", "gl-matrix": "^3.4.3", + "global-prefix": "^3.0.0", + "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", "pbf": "^3.2.1", - "potpack": "^1.0.2", + "potpack": "^2.0.0", "quickselect": "^2.0.0", - "supercluster": "^7.1.4", + "supercluster": "^8.0.1", "tinyqueue": "^2.0.3", "vt-pbf": "^3.1.3" + }, + "engines": { + "node": ">=16.14.0", + "npm": ">=8.1.0" + }, + "funding": { + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" } }, + "node_modules/maplibre-gl/node_modules/@types/geojson": { + "version": "7946.0.10", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", + "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==" + }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/murmurhash-js": { "version": "1.0.0", @@ -2375,10 +2537,16 @@ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==" }, "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -2417,12 +2585,6 @@ "node": ">= 0.4" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, "node_modules/pbf": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", @@ -2455,9 +2617,9 @@ } }, "node_modules/postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.24", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", + "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", "dev": true, "funding": [ { @@ -2467,10 +2629,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -2479,9 +2645,9 @@ } }, "node_modules/potpack": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", - "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz", + "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==" }, "node_modules/protocol-buffers-schema": { "version": "3.6.0", @@ -2522,23 +2688,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/resolve-protobuf-schema": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", @@ -2553,25 +2702,77 @@ "integrity": "sha512-l4NwboJM74Ilm4VKfbAtFeGq7aEjWL+5kVFcmgFA2MrdnQWx9iE/tUGvxY5HyMI7o/WpSIUFLbC5fbeaHgSCYg==" }, "node_modules/rollup": { - "version": "2.75.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", - "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", + "version": "3.26.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.0.tgz", + "integrity": "sha512-YzJH0eunH2hr3knvF3i6IkLO/jTjAEwU4HoMUbQl4//Tnl3ou0e7P5SjxdDr8HQJdeUJShlbEHXrrnEHy1l7Yg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=10.0.0" + "node": ">=14.18.0", + "npm": ">=8.0.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/skmeans": { "version": "0.9.7", "resolved": "https://registry.npmjs.org/skmeans/-/skmeans-0.9.7.tgz", "integrity": "sha512-hNj1/oZ7ygsfmPZ7ZfN5MUBRoGg1gtpnImuJBgLO0ljQ67DtJuiQaiYdS4lUA6s0KCwnPhGivtC/WRwIZLkHyg==" }, + "node_modules/sort-asc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", + "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-desc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", + "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-object": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", + "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", + "dependencies": { + "bytewise": "^1.1.0", + "get-value": "^2.0.2", + "is-extendable": "^0.1.1", + "sort-asc": "^0.2.0", + "sort-desc": "^0.2.0", + "union-value": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -2586,24 +2787,46 @@ "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.1.tgz", "integrity": "sha512-9FaQ18FF0+sZc/ieEeXHt+Jw2eSpUgUtTLDYB/HXKWvhYVyOc7h1hzkn5MMO3GPib9MmXG1go8+OsBBzs/NMww==" }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/supercluster": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz", - "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", "dependencies": { - "kdbush": "^3.0.0" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "kdbush": "^4.0.2" } }, "node_modules/tinyqueue": { @@ -2641,44 +2864,76 @@ "integrity": "sha512-Ja03QIJlPuHt4IQ2FfGex4F4JAr8m3jpaHbFbQrgwr7s7L6U8ocrHiF3J1+wf9jzhGKxvDeaCAnGDot8OjGFyA==" }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" + } + }, + "node_modules/typewise": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", + "dependencies": { + "typewise-core": "^1.2.0" + } + }, + "node_modules/typewise-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==" + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/vite": { - "version": "2.9.16", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.16.tgz", - "integrity": "sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==", + "version": "4.3.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", + "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", "dev": true, "dependencies": { - "esbuild": "^0.14.27", - "postcss": "^8.4.13", - "resolve": "^1.22.0", - "rollup": ">=2.59.0 <2.78.0" + "esbuild": "^0.17.5", + "postcss": "^8.4.23", + "rollup": "^3.21.0" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": ">=12.2.0" + "node": "^14.18.0 || >=16.0.0" }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { + "@types/node": ">= 14", "less": "*", "sass": "*", - "stylus": "*" + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" }, "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, "less": { "optional": true }, @@ -2687,6 +2942,12 @@ }, "stylus": { "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true } } }, @@ -2699,9 +2960,174 @@ "@mapbox/vector-tile": "^1.3.1", "pbf": "^3.2.1" } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } } }, "dependencies": { + "@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "dev": true, + "optional": true + }, "@mapbox/geojson-rewind": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", @@ -2716,20 +3142,15 @@ "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==" }, - "@mapbox/mapbox-gl-supported": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-2.0.1.tgz", - "integrity": "sha512-HP6XvfNIzfoMVfyGjBckjiAOQK9WfX0ywdLubuPMPv+Vqf5fj0uCbgBQYpiqcWZT6cbyyRnTSXDheT1ugvF6UQ==" - }, "@mapbox/point-geometry": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==" }, "@mapbox/tiny-sdf": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.5.tgz", - "integrity": "sha512-OhXt2lS//WpLdkqrzo/KwB7SRD8AiNTFFzuo9n14IBupzIMa67yGItcK7I2W9D8Ghpa4T04Sw9FWsKCJG50Bxw==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz", + "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==" }, "@mapbox/unitbezier": { "version": "0.0.1", @@ -2749,6 +3170,21 @@ "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==" }, + "@maplibre/maplibre-gl-style-spec": { + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.2.1.tgz", + "integrity": "sha512-ZVT5QlkVhlxlPav+ca0NO3Moc7EzbHDO2FXW4ic3Q0Vm+TDUw9I8A2EBws7xUUQZf7HQB3kQ+3Jsh5mFLRD4GQ==", + "requires": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/unitbezier": "^0.0.1", + "@types/mapbox__point-geometry": "^0.1.2", + "json-stringify-pretty-compact": "^3.0.0", + "minimist": "^1.2.8", + "rw": "^1.3.3", + "sort-object": "^3.0.3" + } + }, "@turf/along": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/along/-/along-6.5.0.tgz", @@ -4017,6 +4453,33 @@ "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz", "integrity": "sha512-EDrLIPaPXOZqDjrkzxxbX7UlJSeQVgah3i0aA4pOSzmK9zq3BIh7/MZIQxED7slJByvKM4Gc6Hypyu2lJzh3SQ==" }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==" + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==" + }, + "bytewise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", + "requires": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "bytewise-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", + "requires": { + "typewise-core": "^1.2" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -4052,11 +4515,6 @@ } } }, - "csscolorparser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", - "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==" - }, "d3-array": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", @@ -4103,177 +4561,47 @@ "integrity": "sha512-icpmBubVTwLnsaor9qH/4tG5+7+f61VcqMN3V3pm9sxxSCt2Jcs0zWOgwZW9ARJYaKD3FumIgHiMOcIMRRAzFQ==" }, "earcut": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.3.tgz", - "integrity": "sha512-iRDI1QeCQIhMCZk48DRDMVgQSSBDmbzzNhnxIo+pwx3swkfjMh6vh0nWLq1NdvGHLKH6wIrAM3vQWeTj6qeoug==" + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" }, "esbuild": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.46.tgz", - "integrity": "sha512-vdm5G1JdZBktva8dwQci/s44VbeBUg8g907xoZx77mqFZ4gU5GlMULNsdGeID+qXCXocsfYSGtE0LvqH3eiNQg==", + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", "dev": true, "requires": { - "esbuild-android-64": "0.14.46", - "esbuild-android-arm64": "0.14.46", - "esbuild-darwin-64": "0.14.46", - "esbuild-darwin-arm64": "0.14.46", - "esbuild-freebsd-64": "0.14.46", - "esbuild-freebsd-arm64": "0.14.46", - "esbuild-linux-32": "0.14.46", - "esbuild-linux-64": "0.14.46", - "esbuild-linux-arm": "0.14.46", - "esbuild-linux-arm64": "0.14.46", - "esbuild-linux-mips64le": "0.14.46", - "esbuild-linux-ppc64le": "0.14.46", - "esbuild-linux-riscv64": "0.14.46", - "esbuild-linux-s390x": "0.14.46", - "esbuild-netbsd-64": "0.14.46", - "esbuild-openbsd-64": "0.14.46", - "esbuild-sunos-64": "0.14.46", - "esbuild-windows-32": "0.14.46", - "esbuild-windows-64": "0.14.46", - "esbuild-windows-arm64": "0.14.46" - } - }, - "esbuild-android-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.46.tgz", - "integrity": "sha512-ZyJqwAcjNbZprs0ZAxnUAOhEhdE5kTKwz+CZuLmZYNLAPyRgBtaC8pT2PCuPifNvV8Cl3yLlrQPaOCjovoyb5g==", - "dev": true, - "optional": true - }, - "esbuild-android-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.46.tgz", - "integrity": "sha512-BKcnUksvCijO9ONv6b4SikZE/OZftwJvX91XROODZGQmuwGVg97jmLDVu3lxuHdFlMNNzxh8taJ2mbCWZzH/Iw==", - "dev": true, - "optional": true - }, - "esbuild-darwin-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.46.tgz", - "integrity": "sha512-/ss2kO92sUJ9/1nHnMb3+oab8w6dyqKrMtPMvSYJ9KZIYGAZxz/WYxfFprY7Xk+ZxWnnlASSyZlG+If1nVmFYg==", - "dev": true, - "optional": true - }, - "esbuild-darwin-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.46.tgz", - "integrity": "sha512-WX0JOaEFf6t+rIjXO6THsf/0fhQAt2Zb0/PSYlvXnuQQAmOmFAfPsuRNocp5ME0NGaUqZd4FxqqmLEVK3RzPAg==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.46.tgz", - "integrity": "sha512-o+ozPFuHRCAGCVWU2bLurOUgVkT0jcPEu082VBUY2Q/yLf+B+/3nXzh4Fjp5O21tOvJRTn7hUVydG9j5+vYE6A==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.46.tgz", - "integrity": "sha512-9zicZ0X43WDKz3sjNfcqYO38xbfJpSWYXB+FxvYYkmBwGA52K0SAu4oKuTTLi8od8X2IIo1x5C5TUNvKDSVJww==", - "dev": true, - "optional": true - }, - "esbuild-linux-32": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.46.tgz", - "integrity": "sha512-ZnTpZMVb0VGvL99R5eh4OrJwbUyvpM6M88VAMuHP4LvFjuvZrhgefjKqEGuWZZW7JRnAjKqjXLjWdhdSjwMFnQ==", - "dev": true, - "optional": true - }, - "esbuild-linux-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.46.tgz", - "integrity": "sha512-ECCRRZtX6l4ubeVhHhiVoK/uYAkvzNqfmR4gP4N/9H9RPu+b8YCcN4bQGp7xCuYIV6Xd41WpOMyO+xpcQvjtQQ==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.46.tgz", - "integrity": "sha512-RvTJEi4vj13c5FP9YPp+8Y6x6HK1E7uSqfy3y9UoeaNAzNZWA7fN1U3hQjTL/dy5zTJH5KE64mrt5k5+he+CQA==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.46.tgz", - "integrity": "sha512-HX0TXCHyI0NEWG4jg8LlW1PbZQbnz+PUH56yjx996cgM5pC90u32drKs/tyJiyyQmNk9OXOogjKw7LEdp/Qc1w==", - "dev": true, - "optional": true - }, - "esbuild-linux-mips64le": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.46.tgz", - "integrity": "sha512-jnb2NDwGqJUVmxn1v0f7seNdDm0nRNWHP9Z3MrWAGnBCdnnDlsjqRFDnbKoaQvWONEa+rOOr/giK+VL0hgQExA==", - "dev": true, - "optional": true - }, - "esbuild-linux-ppc64le": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.46.tgz", - "integrity": "sha512-uu3JTQUrwwauKY9z8yq5MnDyOlT3f2DNOzBcYz4dB78HqwEqilCsifoBGd0WcbED5n57dc59X+LZMTZ8Ose44w==", - "dev": true, - "optional": true - }, - "esbuild-linux-riscv64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.46.tgz", - "integrity": "sha512-OB29r1EG44ZY34JnXCRERxo7k4pRKoQdaoRg2HIeCavatsXZwW4LCakpLnMQ72vXT1HtpBUABEjHkKkn5JyrUg==", - "dev": true, - "optional": true - }, - "esbuild-linux-s390x": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.46.tgz", - "integrity": "sha512-XQ/U9TueMSGYyPTKyZsJVraiuvxhwCDIMn/QwFXCRCJ6H/Cy/Rq33u9qhpeSziinHKfzJROGx5A8mQY6aYamdQ==", - "dev": true, - "optional": true - }, - "esbuild-netbsd-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.46.tgz", - "integrity": "sha512-i15BwqHaAIFp1vBJkitAbHtwXcLk9TdHs/Ia1xGIAutQYXSJNPLM3Z4B4hyfHNEFl2yBqBIYpglMohv2ClNdOQ==", - "dev": true, - "optional": true - }, - "esbuild-openbsd-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.46.tgz", - "integrity": "sha512-XwOIFCE140Y/PvjrwjFfa/QLWBuvhR1mPCOa35mKx02jt++wPNgf0qhn6HfdVC3vQe7R46RwTp4q2cp99fepEg==", - "dev": true, - "optional": true - }, - "esbuild-sunos-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.46.tgz", - "integrity": "sha512-+kV3JnmfdxBVpHyFvuGXWtu6tXxXApOLPkSrVkMJf6+ns/3PLtPndpzwCzHjD+qYUEk8ln4MA+ufQ2qmjW5mZg==", - "dev": true, - "optional": true - }, - "esbuild-windows-32": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.46.tgz", - "integrity": "sha512-gzGC1Q11B/Bo5A2EX4N22oigWmhL7Z0eDyc8kbSoJjqSrGQuRE7B0uMpluO+q0O/gZ1S3zdw+M4PCWlqOIeXLA==", - "dev": true, - "optional": true - }, - "esbuild-windows-64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.46.tgz", - "integrity": "sha512-Do2daaskfOjmCB7o3ygz6fD3K6SPjZLERiZLktzHz2oUCwsebKu/gmop0+j/XdrVIXC32wFzHzDS+9CTu9OShw==", - "dev": true, - "optional": true - }, - "esbuild-windows-arm64": { - "version": "0.14.46", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.46.tgz", - "integrity": "sha512-VEzMy6bM60/HT/URTDElyhfi2Pk0quCCrEhRlI4MRno/AIqYUGw0rZwkPl6PeoqVI6BgoBHGY576GWTiPmshCA==", - "dev": true, - "optional": true + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "requires": { + "is-extendable": "^0.1.0" + } }, "fsevents": { "version": "2.3.2", @@ -4342,11 +4670,26 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==" + }, "gl-matrix": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==" }, + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -4381,6 +4724,11 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -4390,15 +4738,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, "is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -4407,6 +4746,19 @@ "has-tostringtag": "^1.0.0" } }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==" + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -4416,45 +4768,73 @@ "has-tostringtag": "^1.0.0" } }, - "kdbush": { + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==" + }, + "json-stringify-pretty-compact": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz", - "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==" + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", + "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==" + }, + "kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==" + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" }, "maplibre-gl": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.1.9.tgz", - "integrity": "sha512-pnWJmILeZpgA5QSI7K7xFK3yrkyYTd9srw3fCi2Ca52Phm78hsznPwUErEQcZLfxXKn/1h9t8IPdj0TH0NBNbg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.1.0.tgz", + "integrity": "sha512-KFarVUUszCEucPwnGsFJtPMQBg/F6lg+SPDmTztKUD/n0YShETjIOdNmm5jpxacEX3+dq50MzlqDr6VH+RtDDA==", "requires": { - "@mapbox/geojson-rewind": "^0.5.1", + "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/mapbox-gl-supported": "^2.0.1", "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^2.0.4", + "@mapbox/tiny-sdf": "^2.0.6", "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@types/geojson": "^7946.0.8", + "@maplibre/maplibre-gl-style-spec": "^19.2.1", + "@types/geojson": "^7946.0.10", "@types/mapbox__point-geometry": "^0.1.2", "@types/mapbox__vector-tile": "^1.3.0", "@types/pbf": "^3.0.2", - "csscolorparser": "~1.0.3", - "earcut": "^2.2.3", + "earcut": "^2.2.4", "geojson-vt": "^3.2.1", "gl-matrix": "^3.4.3", + "global-prefix": "^3.0.0", + "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", "pbf": "^3.2.1", - "potpack": "^1.0.2", + "potpack": "^2.0.0", "quickselect": "^2.0.0", - "supercluster": "^7.1.4", + "supercluster": "^8.0.1", "tinyqueue": "^2.0.3", "vt-pbf": "^3.1.3" + }, + "dependencies": { + "@types/geojson": { + "version": "7946.0.10", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", + "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==" + } } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" }, "murmurhash-js": { "version": "1.0.0", @@ -4462,9 +4842,9 @@ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==" }, "nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true }, "object-assign": { @@ -4486,12 +4866,6 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, "pbf": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", @@ -4521,20 +4895,20 @@ } }, "postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.24", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", + "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", "dev": true, "requires": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } }, "potpack": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", - "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz", + "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==" }, "protocol-buffers-schema": { "version": "3.6.0", @@ -4571,17 +4945,6 @@ "functions-have-names": "^1.2.2" } }, - "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, "resolve-protobuf-schema": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", @@ -4596,19 +4959,58 @@ "integrity": "sha512-l4NwboJM74Ilm4VKfbAtFeGq7aEjWL+5kVFcmgFA2MrdnQWx9iE/tUGvxY5HyMI7o/WpSIUFLbC5fbeaHgSCYg==" }, "rollup": { - "version": "2.75.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", - "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", + "version": "3.26.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.0.tgz", + "integrity": "sha512-YzJH0eunH2hr3knvF3i6IkLO/jTjAEwU4HoMUbQl4//Tnl3ou0e7P5SjxdDr8HQJdeUJShlbEHXrrnEHy1l7Yg==", "dev": true, "requires": { "fsevents": "~2.3.2" } }, + "rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + } + }, "skmeans": { "version": "0.9.7", "resolved": "https://registry.npmjs.org/skmeans/-/skmeans-0.9.7.tgz", "integrity": "sha512-hNj1/oZ7ygsfmPZ7ZfN5MUBRoGg1gtpnImuJBgLO0ljQ67DtJuiQaiYdS4lUA6s0KCwnPhGivtC/WRwIZLkHyg==" }, + "sort-asc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", + "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==" + }, + "sort-desc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", + "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==" + }, + "sort-object": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", + "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", + "requires": { + "bytewise": "^1.1.0", + "get-value": "^2.0.2", + "is-extendable": "^0.1.1", + "sort-asc": "^0.2.0", + "sort-desc": "^0.2.0", + "union-value": "^1.0.1" + } + }, "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -4620,19 +5022,40 @@ "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.1.tgz", "integrity": "sha512-9FaQ18FF0+sZc/ieEeXHt+Jw2eSpUgUtTLDYB/HXKWvhYVyOc7h1hzkn5MMO3GPib9MmXG1go8+OsBBzs/NMww==" }, - "supercluster": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz", - "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==", + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "requires": { - "kdbush": "^3.0.0" + "extend-shallow": "^3.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } } }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true + "supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "requires": { + "kdbush": "^4.0.2" + } }, "tinyqueue": { "version": "2.0.3", @@ -4661,22 +5084,45 @@ "integrity": "sha512-Ja03QIJlPuHt4IQ2FfGex4F4JAr8m3jpaHbFbQrgwr7s7L6U8ocrHiF3J1+wf9jzhGKxvDeaCAnGDot8OjGFyA==" }, "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true }, + "typewise": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", + "requires": { + "typewise-core": "^1.2.0" + } + }, + "typewise-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==" + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, "vite": { - "version": "2.9.16", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.16.tgz", - "integrity": "sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==", + "version": "4.3.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", + "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", "dev": true, "requires": { - "esbuild": "^0.14.27", + "esbuild": "^0.17.5", "fsevents": "~2.3.2", - "postcss": "^8.4.13", - "resolve": "^1.22.0", - "rollup": ">=2.59.0 <2.78.0" + "postcss": "^8.4.23", + "rollup": "^3.21.0" } }, "vt-pbf": { @@ -4688,6 +5134,14 @@ "@mapbox/vector-tile": "^1.3.1", "pbf": "^3.2.1" } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } } } } diff --git a/package.json b/package.json index 5c6c891..9cefed3 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ "author": "Yasunori Kirimoto", "license": "ISC", "devDependencies": { - "typescript": "^4.5.4", - "vite": "^2.9.16" + "typescript": "^5.1.6", + "vite": "^4.3.9" }, "dependencies": { "@turf/turf": "^6.5.0", - "maplibre-gl": "^2.1.9" + "maplibre-gl": "^3.1.0" } }