1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[552],{22572:(e,t,r)=>{let a,i,n,o,l;r.r(t),r.d(t,{AJAXError:()=>oV,ANIM_LAYER_PREFIX:()=>os,AnimatedRouteLayer:()=>ou,AttributionControl:()=>es,AttributionControlMLGL:()=>oL,BoxZoomHandler:()=>ed,BoxZoomHandlerMLGL:()=>oT,CanvasSource:()=>Q,CanvasSourceMLGL:()=>of,ColorRamp:()=>nY,ColorRampCollection:()=>nQ,CooperativeGesturesHandler:()=>ef,CooperativeGesturesHandlerMLGL:()=>oP,CubemapFaceNames:()=>ik,CubemapImagesPresets:()=>iw,CubemapLayer:()=>iI,DOMcreate:()=>aq,DOMremove:()=>aG,DoubleClickZoomHandler:()=>o0,DragPanHandler:()=>oY,DragRotateHandler:()=>oX,EdgeInsets:()=>oJ,Evented:()=>oG,FullscreenControl:()=>ec,FullscreenControlMLGL:()=>oE,GeoJSONSource:()=>ee,GeoJSONSourceMLGL:()=>oy,GeolocateControl:()=>el,GeolocateControlMLGL:()=>ok,GeolocationType:()=>iG,Hash:()=>oZ,ImageSource:()=>et,ImageSourceMLGL:()=>og,ImageViewer:()=>nl,ImageViewerEvent:()=>iZ,ImageViewerMarker:()=>np,ImageViewerMarkerEvent:()=>nd,KeyboardHandler:()=>ey,KeyboardHandlerMLGL:()=>oI,Language:()=>ew,LngLat:()=>oU,LngLatBounds:()=>oB,LogoControl:()=>eu,LogoControlMLGL:()=>oA,Map:()=>iV,MapMLGL:()=>oc,MapMouseEvent:()=>ex,MapMouseEventMLGL:()=>oO,MapStyle:()=>D.Gj,MapStyleVariant:()=>D.Hu,MapTouchEvent:()=>eb,MapTouchEventMLGL:()=>o$,MapWheelEvent:()=>ev,MapWheelEventMLGL:()=>oR,MaptilerAnimation:()=>ol,MaptilerCustomControl:()=>aY,MaptilerExternalControl:()=>a2,MaptilerGeolocateControl:()=>aX,MaptilerLogoControl:()=>eE,MaptilerNavigationControl:()=>aW,MaptilerProjectionControl:()=>aQ,MaptilerTerrainControl:()=>aV,Marker:()=>J,MarkerMLGL:()=>oh,MercatorCoordinate:()=>oq,NavigationControMLGL:()=>oS,NavigationControl:()=>eo,Point:()=>oK,Popup:()=>X,PopupMLGL:()=>od,RadialGradientLayer:()=>iU,RasterDEMTileSource:()=>ea,RasterDEMTileSourceMLGL:()=>ob,RasterTileSource:()=>er,RasterTileSourceMLGL:()=>ov,ReferenceMapStyle:()=>D.rF,ScaleControl:()=>ep,ScaleControlMLGL:()=>oC,ScrollZoomHandler:()=>em,ScrollZoomHandlerMLGL:()=>oM,SdkConfig:()=>eA,ServiceError:()=>D._7,Style:()=>Y,StyleMLGL:()=>om,TerrainControMLGL:()=>o_,TerrainControl:()=>eh,TwoFingersTouchPitchHandler:()=>eg,TwoFingersTouchPitchHandlerMLGL:()=>oz,TwoFingersTouchRotateHandler:()=>o2,TwoFingersTouchZoomHandler:()=>o1,TwoFingersTouchZoomRotateHandler:()=>oQ,VectorTileSource:()=>ei,VectorTileSourceMLGL:()=>ox,VideoSource:()=>en,VideoSourceMLGL:()=>ow,addProtocol:()=>lt,addSourceType:()=>o7,areSameLanguages:()=>D.Io,bufferToPixelDataBrowser:()=>D.iV,canParsePixelData:()=>D.QB,circumferenceAtLatitude:()=>D.Hy,clearPrewarmedResources:()=>oW,config:()=>eC,configMLGL:()=>oF,coordinates:()=>D.G8,createBezierPathFromCoordinates:()=>n9,cubemapPresets:()=>iS,data:()=>D.p,displayWebGLContextLostWarning:()=>eq,elevation:()=>D.ET,expandMapStyle:()=>D.ub,geocoding:()=>iW,geolocation:()=>D.Re,getAutoLanguage:()=>D.IS,getAverageDistance:()=>n7,getBrowserLanguage:()=>eS,getBufferToPixelDataParser:()=>D.jO,getLanguageInfoFromCode:()=>D.m_,getLanguageInfoFromFlag:()=>D.p3,getLanguageInfoFromKey:()=>D.qy,getMapLibreVersion:()=>oj,getMaxParallelImageRequests:()=>o4,getRTLTextPluginStatus:()=>oD,getTileCache:()=>D.Lq,getVersion:()=>op,getWebGLSupportError:()=>eB,getWorkerCount:()=>o5,getWorkerUrl:()=>o6,gpx:()=>ng,gpxOrKml:()=>nR,hasChildNodeWithName:()=>nf,helpers:()=>n0,importScriptInWorkers:()=>le,isLanguageInfo:()=>D.h5,kml:()=>nv,lerp:()=>a3,lerpArrayValues:()=>n1,mapStylePresetList:()=>D.N0,math:()=>D.Dy,misc:()=>D.Lr,parseGeoJSONFeatureToKeyframes:()=>n3,prewarm:()=>oH,removeProtocol:()=>lr,resamplePath:()=>ot,setMaxParallelImageRequests:()=>o8,setRTLTextPlugin:()=>oN,setWorkerCount:()=>o3,setWorkerUrl:()=>o9,simplifyPath:()=>oe,staticMaps:()=>D.gZ,str2xml:()=>nm,stretchNumericalArray:()=>n4,styleToStyle:()=>D.oP,toLanguageInfo:()=>D.EA,toggleProjection:()=>a0,toggleTerrain:()=>aH,xml2str:()=>ny});var s,u,p,c,h,d,m,f,y,g,v,b,x,w,S,k,L,A,C,E,_,T,M,P,I,z,R,$,O,F=r(94777),j=r(52445),N=r(35978),D=r(57633),U=r(17418),B=Object.defineProperty,q=e=>{throw TypeError(e)},G=(e,t,r)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?B(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r},V=(e,t,r)=>t.has(e)||q("Cannot "+r),H=(e,t,r)=>(V(e,t,"read from private field"),r?r.call(e):t.get(e)),W=(e,t,r)=>t.has(e)?q("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Z=(e,t,r,a)=>(V(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r),K=(e,t,r)=>(V(e,t,"access private method"),r);typeof window>"u"||(window.requestIdleCallback=window.requestIdleCallback||function(e){let t=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)});let J=class extends F.Marker{addTo(e){return super.addTo(e)}};class X extends F.Popup{addTo(e){return super.addTo(e)}}class Y extends F.Style{constructor(e,t={}){super(e,t)}}class Q extends F.CanvasSource{onAdd(e){super.onAdd(e)}}class ee extends F.GeoJSONSource{onAdd(e){super.onAdd(e)}}class et extends F.ImageSource{onAdd(e){super.onAdd(e)}}class er extends F.RasterTileSource{onAdd(e){super.onAdd(e)}}class ea extends F.RasterDEMTileSource{onAdd(e){super.onAdd(e)}}class ei extends F.VectorTileSource{onAdd(e){super.onAdd(e)}}class en extends F.VideoSource{onAdd(e){super.onAdd(e)}}class eo extends F.NavigationControl{onAdd(e){return super.onAdd(e)}}class el extends F.GeolocateControl{onAdd(e){return super.onAdd(e)}}class es extends F.AttributionControl{onAdd(e){return super.onAdd(e)}}class eu extends F.LogoControl{onAdd(e){return super.onAdd(e)}}class ep extends F.ScaleControl{onAdd(e){return super.onAdd(e)}}class ec extends F.FullscreenControl{onAdd(e){return super.onAdd(e)}}class eh extends F.TerrainControl{onAdd(e){return super.onAdd(e)}}class ed extends F.BoxZoomHandler{constructor(e,t){super(e,t)}}class em extends F.ScrollZoomHandler{constructor(e,t){super(e,t)}}
1class ef extends F.CooperativeGesturesHandler{constructor(e,t){super(e,t)}}class ey extends F.KeyboardHandler{constructor(e){super(e)}}class eg extends F.TwoFingersTouchPitchHandler{constructor(e){super(e)}}class ev extends F.MapWheelEvent{constructor(e,t,r){super(e,t,r)}}class eb extends F.MapTouchEvent{constructor(e,t,r){super(e,t,r)}}class ex extends F.MapMouseEvent{constructor(e,t,r,a={}){super(e,t,r,a)}}let ew={VISITOR:{code:null,flag:"visitor",name:"Visitor",latin:!0,isMode:!0,geocoding:!1},VISITOR_ENGLISH:{code:null,flag:"visitor_en",name:"Visitor English",latin:!0,isMode:!0,geocoding:!1},STYLE:{code:null,flag:"style",name:"Style",latin:!1,isMode:!0,geocoding:!1},STYLE_LOCK:{code:null,flag:"style_lock",name:"Style Lock",latin:!1,isMode:!0,geocoding:!1},...D.TM};function eS(){if(typeof navigator>"u"){let e=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];return(0,D.m_)(e)||ew.ENGLISH}return Array.from(new Set(navigator.languages.map(e=>e.split("-")[0]))).map(e=>(0,D.m_)(e)).filter(e=>e)[0]??ew.LOCAL}let ek={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",telemetryURL:"https://api.maptiler.com/metrics",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:ew.STYLE,secondaryLanguage:ew.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(ek);let eL=(0,U.A)();class eA extends N{constructor(){super(...arguments),G(this,"primaryLanguage",ek.primaryLanguage),G(this,"secondaryLanguage"),G(this,"session",!0),G(this,"caching",!0),G(this,"telemetry",!0),G(this,"_unit","metric"),G(this,"_apiKey",""),G(this,"_experimentalDefaultPathSampleSteps",4),G(this,"_experimentalDefaultWorkerCount",4)}set unit(e){this._unit=e,this.emit("unit",e)}get unit(){return this._unit}set apiKey(e){this._apiKey=e,D.$W.apiKey=e,this.emit("apiKey",e)}get apiKey(){return this._apiKey}set fetch(e){D.$W.fetch=e}get fetch(){return D.$W.fetch}get experimental_defaultPathSampleSteps(){return this._experimentalDefaultPathSampleSteps}set experimental_defaultPathSampleSteps(e){this._experimentalDefaultPathSampleSteps=e,this.emit("experimentalDefaultPathSampleSteps",e)}get experimental_defaultWorkerCount(){return this._experimentalDefaultWorkerCount}set experimental_defaultWorkerCount(e){this._experimentalDefaultWorkerCount=e,this.emit("experimentalDefaultWorkerCount",e)}}let eC=new eA;class eE extends eu{constructor(e={}){super(e),G(this,"logoURL",""),G(this,"linkURL",""),this.logoURL=e.logoURL??ek.maptilerLogoURL,this.linkURL=e.linkURL??ek.maptilerURL}onAdd(e){this._map=e,this._compact=this.options.compact??!1,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";let t=window.document.createElement("a");return t.style.backgroundRepeat="no-repeat",t.style.cursor="pointer",t.style.display="block",t.style.height="23px",t.style.margin="0 0 -4px -4px",t.style.overflow="hidden",t.style.width="88px",t.style.backgroundImage=`url(${this.logoURL})`,t.style.backgroundSize="100px 30px",t.style.width="100px",t.style.height="30px",t.target="_blank",t.rel="noopener",t.href=this.linkURL,t.setAttribute("aria-label","MapTiler logo"),t.setAttribute("rel","noopener"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}let e_="localcache_source",eT="localcache",eM="u">typeof caches,{addProtocol:eP}=F;function eI(e){let t=new URL(e instanceof URL?e.href:e);return t.searchParams.delete("key"),t.searchParams.delete("mtsid"),t.toString()}async function ez(){return a||(a=await caches.open("maptiler_sdk")),a}let eR=0;async function e$(){let e=await ez(),t=await e.keys();for(let r of t.slice(0,Math.max(t.length-1e3,0)))e.delete(r)}async function eO(e,t){let r=new URL(e),a=eI(r),i=eM?await ez():null;if(i&&await i.match(a))return;let n=new URL(r),o=await fetch(n.toString(),{signal:t});if(i&&o.ok)try{await i.put(a,o)}catch{}}async function eF(e){if(typeof window>"u")return;let t=F.getRTLTextPluginStatus();if("unavailable"===t||"requested"===t)try{await F.setRTLTextPlugin(e??ek.rtlPluginURL,!0)}catch(e){console.error("Error enabling RTL plugin. It is enabled by default and cannot be unset after. Are you attempting to enable it twice?",e)}}function ej(e,t){let r=null;try{r=new URL(e)}catch{return{url:e}}return r.host===ek.maptilerApiHost&&(r.searchParams.has("key")||r.searchParams.append("key",eC.apiKey),eC.session&&r.searchParams.append("mtsid",eL)),{url:function(e,t){if(eM&&eC.caching&&eC.session&&e.host===ek.maptilerApiHost){if("Source"===t&&e.href.includes("tiles.json"))return e.href.replace("https://",`${e_}://`);
1if("Tile"===t||"Glyphs"===t)return e.href.replace("https://",`${eT}://`)}return e.href}(r,t)}}function eN(e){return async(t,r)=>{if(null!=e){let a=await e(t,r),i=ej((null==a?void 0:a.url)??"",r);return{...a,...i}}return ej(t,r)}}function eD(){return Math.random().toString(36).substring(2)}function eU(e){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(e)}function eB(){return document.createElement("canvas").getContext("webgl2")?null:"u">typeof WebGL2RenderingContext?"Graphic rendering with WebGL2 has been disabled or is not supported by your graphic card. The map cannot be displayed.":"Your browser does not support graphic rendering with WebGL2. The map cannot be displayed."}function eq(e){let t=e.getContainer(),r=document.createElement("div");r.innerHTML="The WebGL context was lost.",r.classList.add("webgl-warning-div"),t.appendChild(r)}var eG={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{}
vendor: 24,005 bytes, line 1
1,miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}
vendor: 5,054 bytes, line 1
1,"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},eV=class{constructor(e,t,r,a){this.message=(e?`${e}: `:"")+r,a&&(this.identifier=a),null!=t&&t.__line__&&(this.line=t.__line__)}};function eH(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}
1var eW=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},eZ=class e{constructor(e,t=[]){for(const[r,a]of(this.parent=e,this.bindings={},t))this.bindings[r]=a}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}};let eK={kind:"null"},eJ={kind:"number"},eX={kind:"string"},eY={kind:"boolean"},eQ={kind:"color"},e0={kind:"projectionDefinition"},e1={kind:"object"},e2={kind:"value"},e5={kind:"collator"},e3={kind:"formatted"},e4={kind:"padding"},e8={kind:"colorArray"},e6={kind:"numberArray"},e9={kind:"resolvedImage"},e7={kind:"variableAnchorOffsetCollection"};function te(e,t){return{kind:"array",itemType:e,N:t}}function tt(e){if("array"!==e.kind)return e.kind;{let t=tt(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}}let tr=[eK,eJ,eX,eY,eQ,e0,e3,e1,te(e2),e4,e6,e8,e9,e7];function ta(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ta(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind){for(let e of tr)if(!ta(e,t))return null}}return`Expected ${tt(e)} but found ${tt(t)} instead.`}function ti(e,t){return t.some(t=>t.kind===e.kind)}function tn(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function to(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}let tl=4/29,ts=6/29,tu=6/29*3*(6/29),tp=6/29*(6/29)*(6/29),tc=Math.PI/180,th=180/Math.PI;function td(e){return(e%=360)<0&&(e+=360),e}function tm([e,t,r,a]){let i,n;e=tf(e);let o=ty((.2225045*e+.7168786*(t=tf(t))+.0606169*(r=tf(r)))/1);e===t&&t===r?i=n=o:(i=ty((.4360747*e+.3850649*t+.1430804*r)/.96422),n=ty((.0139322*e+.0971045*t+.7141733*r)/.82521));let l=116*o-16;return[l<0?0:l,500*(i-o),200*(o-n),a]}function tf(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ty(e){return e>tp?Math.pow(e,1/3):e/tu+tl}function tg([e,t,r,a]){let i=(e+16)/116,n=isNaN(t)?i:i+t/500,o=isNaN(r)?i:i-r/200;return i=+tb(i),[tv(3.1338561*(n=.96422*tb(n))-1.6168667*i-.4906146*(o=.82521*tb(o))),tv(-.9787684*n+1.9161415*i+.033454*o),tv(.0719453*n-.2289914*i+1.4052427*o),a]}function tv(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function tb(e){return e>ts?e*e*e:tu*(e-tl)}let tx=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function tw(e,t){return tx(e,t)?e[t]:void 0}function tS(e){return parseInt(e.padEnd(2,e),16)/255}function tk(e,t){return tL(t?e/100:e,0,1)}function tL(e,t,r){return Math.min(Math.max(t,e),r)}function tA(e){return!e.some(Number.isNaN)}let tC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
1ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function tE(e,t,r){return e.map((e,a)=>e+r*(t[a]-e))}var t_,tT=((t_=class{constructor(e,t,r,a=1,i=!0){this.r=e,this.g=t,this.b=r,this.a=a,i||(this.r*=a,this.g*=a,this.b*=a,a||this.overwriteGetter("rgb",[e,t,r,a]))}static parse(e){if(e instanceof t_)return e;if("string"!=typeof e)return;let t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=tw(tC,e);if(t){let[e,r,a]=t;return[e/255,r/255,a/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,r=1;return[tS(e.slice(r,r+=t)),tS(e.slice(r,r+=t)),tS(e.slice(r,r+=t)),tS(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,r,a,i,n,o,l,s,u,p,c,h]=t,d=[i||" ",l||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){let e=[a,o,u].join(""),t="%%%"===e?100:255*(""===e);if(t){let e=[tL(r/t,0,1),tL(n/t,0,1),tL(s/t,0,1),c?tk(+c,h):1];if(tA(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,a,i,n,o,l,s,u]=r,p=[a||" ",n||" ",l].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){let e=[+t,tL(+i,0,100),tL(+o,0,100),s?tk(+s,u):1];if(tA(e))return function([e,t,r,a]){function i(a){let i=(a+e/30)%12,n=t*Math.min(r,1-r);return r-n*Math.max(-1,Math.min(i-3,9-i,1))}return e=td(e),t/=100,r/=100,[i(0),i(8),i(4),a]}(e)}}}(e);if(t)return new t_(...t,!1)}get rgb(){let{r:e,g:t,b:r,a}=this,i=a||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,a])}get hcl(){return this.overwriteGetter("hcl",function(e){let[t,r,a,i]=tm(e),n=Math.sqrt(r*r+a*a);return[Math.round(1e4*n)?td(Math.atan2(a,r)*th):NaN,n,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tm(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,a]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${a})`}static interpolate(e,t,r,a="rgb"){switch(a){case"rgb":{let[a,i,n,o]=tE(e.rgb,t.rgb,r);return new t_(a,i,n,o,!1)}case"hcl":{let a,i,[n,o,l,s]=e.hcl,[u,p,c,h]=t.hcl;if(isNaN(n)||isNaN(u))isNaN(n)?isNaN(u)?a=NaN:(a=u,(1===l||0===l)&&(i=p)):(a=n,(1===c||0===c)&&(i=o));else{let e=u-n;u>n&&e>180?e-=360:u<n&&n-u>180&&(e+=360),a=n+r*e}let[d,m,f,y]=function([e,t,r,a]){return tg([r,Math.cos(e=isNaN(e)?0:e*tc)*t,Math.sin(e)*t,a])}([a,i??o+r*(p-o),l+r*(c-l),s+r*(h-s)]);return new t_(d,m,f,y,!1)}case"lab":{let[a,i,n,o]=tg(tE(e.lab,t.lab,r));return new t_(a,i,n,o,!1)}}}}).black=new t_(0,0,0,1),t_.white=new t_(1,1,1,1),t_.transparent=new t_(0,0,0,0),t_.red=new t_(1,0,0,1),t_),tM=class{constructor(e,t,r){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};let tP=["bottom","center","top"];var tI=class{constructor(e,t,r,a,i,n){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=i,this.verticalAlign=n}},tz=class e{constructor(e){this.sections=e}static fromString(t){return new e([new tI(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}},tR=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,a){return new e(tE(t.values,r.values,a))}},t$=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t]);if(Array.isArray(t)){for(let e of t)if("number"!=typeof e)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,a){return new e(tE(t.values,r.values,a))}},tO=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("string"==typeof t){let r=tT.parse(t);return r?new e([r]):void 0}if(!Array.isArray(t))return;let r=[];for(let e of t){if("string"!=typeof e)return;let t=tT.parse(e);if(!t)return;r.push(t)}return new e(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,a,i="rgb"){let n=[];if(t.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)n.push(tT.interpolate(t.values[e],r.values[e],a,i));return new e(n)}}
1,tF=class extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}};let tj=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);var tN=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let e=0;e<t.length;e+=2){let r=t[e],a=t[e+1];if("string"!=typeof r||!tj.has(r)||!Array.isArray(a)||2!==a.length||"number"!=typeof a[0]||"number"!=typeof a[1])return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,a){let i=t.values,n=r.values;if(i.length!==n.length)throw new tF(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`);let o=[];for(let e=0;e<i.length;e+=2){if(i[e]!==n[e])throw new tF(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${i[e]}, to[${e}]: ${n[e]}`);o.push(i[e]);let[t,r]=i[e+1],[l,s]=n[e+1];o.push([t+a*(l-t),r+a*(s-r)])}return new e(o)}},tD=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},tU=class e{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(t,r,a){return new e(t,r,a)}static parse(t){return t instanceof e?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new e(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new e(t.from,t.to,t.transition):"string"==typeof t?new e(t,t,1):void 0}};function tB(e,t,r,a){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?typeof a>"u"||"number"==typeof a&&a>=0&&a<=1?null:`Invalid rgba value [${[e,t,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof a?[e,t,r,a]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function tq(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof tU||e instanceof tT||e instanceof tM||e instanceof tz||e instanceof tR||e instanceof t$||e instanceof tO||e instanceof tN||e instanceof tD)return!0;if(Array.isArray(e)){for(let t of e)if(!tq(t))return!1;return!0}if("object"!=typeof e)return!1;for(let t in e)if(!tq(e[t]))return!1;return!0}function tG(e){if(null===e)return eK;if("string"==typeof e)return eX;if("boolean"==typeof e)return eY;if("number"==typeof e)return eJ;if(e instanceof tT)return eQ;if(e instanceof tU)return e0;if(e instanceof tM)return e5;if(e instanceof tz)return e3;if(e instanceof tR)return e4;if(e instanceof t$)return e6;if(e instanceof tO)return e8;if(e instanceof tN)return e7;if(e instanceof tD)return e9;if(!Array.isArray(e))return e1;{let t,r=e.length;for(let r of e){let e=tG(r);if(t){if(t===e)continue;t=e2;break}t=e}return te(t||e2,r)}}function tV(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof tT||e instanceof tU||e instanceof tz||e instanceof tR||e instanceof t$||e instanceof tO||e instanceof tN||e instanceof tD?e.toString():JSON.stringify(e)}var tH=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,r){if(2!==t.length)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!tq(t[1]))return r.error("invalid value");let a=t[1],i=tG(a),n=r.expectedType;return"array"===i.kind&&0===i.N&&n&&"array"===n.kind&&("number"!=typeof n.N||0===n.N)&&(i=n),new e(i,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};let tW={string:eX,number:eJ,boolean:eY,object:e1};var tZ=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let a=1,i,n=t[0];if("array"===n){let e,n;if(t.length>2){let i=t[1];if("string"!=typeof i||!(i in tW)||"object"===i)return r.error('The item type argument of "array" must be one of string, number, boolean',1);e=tW[i],a++}else e=e2;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);n=t[2],a++}i=te(e,n)}else{if(!tW[n])throw Error(`Types doesn't contain name = ${n}`);i=tW[n]}let o=[];for(;a<t.length;a++){let e=r.parse(t[a],a,e2);
1if(!e)return null;o.push(e)}return new e(i,o)}evaluate(e){for(let t=0;t<this.args.length;t++){let r=this.args[t].evaluate(e);if(!ta(this.type,tG(r)))return r;if(t===this.args.length-1)throw new tF(`Expected value to be of type ${tt(this.type)}, but found ${tt(tG(r))} instead.`)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};let tK={"to-boolean":eY,"to-color":eQ,"to-number":eJ,"to-string":eX};var tJ=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let a=t[0];if(!tK[a])throw Error(`Can't parse ${a} as it is not part of the known types`);if(("to-boolean"===a||"to-string"===a)&&2!==t.length)return r.error("Expected one argument.");let i=tK[a],n=[];for(let e=1;e<t.length;e++){let a=r.parse(t[e],e,e2);if(!a)return null;n.push(a)}return new e(i,n)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(let a of this.args){if(t=a.evaluate(e),r=null,t instanceof tT)return t;if("string"==typeof t){let r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:tB(t[0],t[1],t[2],t[3])))return new tT(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new tF(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let a=tR.parse(t);if(a)return a}throw new tF(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(let r of this.args){t=r.evaluate(e);let a=t$.parse(t);if(a)return a}throw new tF(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(let r of this.args){t=r.evaluate(e);let a=tO.parse(t);if(a)return a}throw new tF(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let a=tN.parse(t);if(a)return a}throw new tF(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(let r of this.args){if(null===(t=r.evaluate(e)))return 0;let a=Number(t);if(!isNaN(a))return a}throw new tF(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return tz.fromString(tV(this.args[0].evaluate(e)));case"resolvedImage":return tD.fromString(tV(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return tV(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};let tX=["Unknown","Point","LineString","Polygon"];var tY=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?tX[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=tT.parse(e),this._parseColorCache.set(e,t)),t}},tQ=class e{constructor(e,t,r=[],a,i=new eZ,n=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=i,this.errors=n,this.expectedType=a,this._isConstant=t}parse(e,t,r,a,i={}){return t?this.concat(t,r,a)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new tZ(t,[e]):"coerce"===r?new tJ(t,[e]):e}if((null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]),!Array.isArray(e))return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`);{if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let a=e[0];if("string"!=typeof a)return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[a];if(i){let a=i.parse(e,this);if(!a)return null;if(this.expectedType){let e=this.expectedType,i=a.type;if(("string"===e.kind||"number"===e.kind||"boolean"===e.kind||"object"===e.kind||"array"===e.kind)&&"value"===i.kind)a=r(a,e,t.typeAnnotation||"assert");else if("projectionDefinition"===e.kind&&["string","array"].includes(i.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(i.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(i.kind)||"colorArray"===e.kind&&["value","string","array"].includes(i.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(i.kind))a=r(a,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,i))return null}if(!(a instanceof tH)&&"resolvedImage"!==a.type.kind&&this._isConstant(a)){let e=new tY;try{a=new tH(a.type,a.evaluate(e))}catch(e){return this.error(e.message),null}}return a}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}}concat(t,r,a){let i="number"==typeof t?this.path.concat(t):this.path,n=a?this.scope.concat(a):this.scope;return new e(this.registry,this._isConstant,i,r||null,n,this.errors)}error(e,...t){let r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new eW(r,e))}checkSubtype(e,t){let r=ta(e,t);return r&&this.error(r),r}},t0=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let a=[];for(let e=1;e<t.length-1;e+=2){let i=t[e];if("string"!=typeof i)return r.error(`Expected string, but found ${typeof i} instead.`,e);if(/[^a-zA-Z0-9_]/.test(i))return r.error("Variable names must contain only alphanumeric characters or '_'.",e);let n=r.parse(t[e+1],e+1);if(!n)return null;a.push([i,n])}let i=r.parse(t[t.length-1],t.length-1,r.expectedType,a);return i?new e(a,i):null}outputDefined(){return this.result.outputDefined()}},t1=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");let a=t[1];return r.scope.has(a)?new e(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}},t2=class e{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let a=r.parse(t[1],1,eJ),i=r.parse(t[2],2,te(r.expectedType||e2));return a&&i?new e(i.type.itemType,a,i):null}evaluate(e){let t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new tF(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new tF(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new tF(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},t5=class e{constructor(e,t){this.type=eY,this.needle=e,this.haystack=t}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let a=r.parse(t[1],1,e2),i=r.parse(t[2],2,e2);return a&&i?ti(a.type,[eY,eX,eJ,eK,e2])?new e(a,i):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${tt(a.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!tn(t,["boolean","string","number","null"]))throw new tF(`Expected first argument to be of type boolean, string, number or null, but found ${tt(tG(t))} instead.`);if(!tn(r,["string","array"]))throw new tF(`Expected second argument to be of type array or string, but found ${tt(tG(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},t3=class e{constructor(e,t,r){this.type=eJ,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let a=r.parse(t[1],1,e2),i=r.parse(t[2],2,e2);if(!a||!i)return null;if(!ti(a.type,[eY,eX,eJ,eK,e2]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${tt(a.type)} instead`);if(4!==t.length)return new e(a,i);{let n=r.parse(t[3],3,eJ);return n?new e(a,i,n):null}}evaluate(e){let t,r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!tn(r,["boolean","string","number","null"]))throw new tF(`Expected first argument to be of type boolean, string, number or null, but found ${tt(tG(r))} instead.`);if(this.fromIndex&&(t=this.fromIndex.evaluate(e)),tn(a,["string"])){let e=a.indexOf(r,t);return -1===e?-1:[...a.slice(0,e)].length}if(tn(a,["array"]))return a.indexOf(r,t);throw new tF(`Expected second argument to be of type array or string, but found ${tt(tG(a))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},t4=class e{constructor(e,t,r,a,i,n){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=i,this.otherwise=n}static parse(t,r){let a,i;if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);let n={},o=[];for(let e=2;e<t.length-1;e+=2){let l=t[e],s=t[e+1];Array.isArray(l)||(l=[l]);let u=r.concat(e);
1if(0===l.length)return u.error("Expected at least one branch label.");for(let e of l){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(a){if(u.checkSubtype(a,tG(e)))return null}else a=tG(e);if("u">typeof n[String(e)])return u.error("Branch labels must be unique.");n[String(e)]=o.length}let p=r.parse(s,e,i);if(!p)return null;i=i||p.type,o.push(p)}let l=r.parse(t[1],1,e2);if(!l)return null;let s=r.parse(t[t.length-1],t.length-1,i);return!s||"value"!==l.type.kind&&r.concat(1).checkSubtype(a,l.type)?null:new e(a,i,l,n,o,s)}evaluate(e){let t=this.input.evaluate(e);return(tG(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},t8=class e{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(t,r){let a;if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);let i=[];for(let e=1;e<t.length-1;e+=2){let n=r.parse(t[e],e,eY);if(!n)return null;let o=r.parse(t[e+1],e+1,a);if(!o)return null;i.push([n,o]),a=a||o.type}let n=r.parse(t[t.length-1],t.length-1,a);if(!n)return null;if(!a)throw Error("Can't infer output type");return new e(a,i,n)}evaluate(e){for(let[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},t6=class e{constructor(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let a=r.parse(t[1],1,e2),i=r.parse(t[2],2,eJ);if(!a||!i)return null;if(!ti(a.type,[te(e2),eX,e2]))return r.error(`Expected first argument to be of type array or string, but found ${tt(a.type)} instead`);if(4!==t.length)return new e(a.type,a,i);{let n=r.parse(t[3],3,eJ);return n?new e(a.type,a,i,n):null}}evaluate(e){let t,r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(this.endIndex&&(t=this.endIndex.evaluate(e)),tn(r,["string"]))return[...r].slice(a,t).join("");if(tn(r,["array"]))return r.slice(a,t);throw new tF(`Expected first argument to be of type array or string, but found ${tt(tG(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function t9(e,t){let r=e.length-1,a=0,i=r,n=0,o,l;for(;a<=i;)if(o=e[n=Math.floor((a+i)/2)],l=e[n+1],o<=t){if(n===r||t<l)return n;a=n+1}else if(o>t)i=n-1;else throw new tF("Input is not a number.");return 0}var t7=class e{constructor(e,t,r){for(const[a,i]of(this.type=e,this.input=t,this.labels=[],this.outputs=[],r))this.labels.push(a),this.outputs.push(i)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let a=r.parse(t[1],1,eJ);if(!a)return null;let i=[],n=null;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);for(let e=1;e<t.length;e+=2){let a=1===e?-1/0:t[e],o=t[e+1],l=e,s=e+1;if("number"!=typeof a)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(i.length&&i[i.length-1][0]>=a)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);let u=r.parse(o,s,n);if(!u)return null;n=n||u.type,i.push([a,u])}return new e(n,a,i)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);let i=t.length;return a>=t[i-1]?r[i-1].evaluate(e):r[t9(t,a)].evaluate(e)}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}
1,re=class e{constructor(e,t,r,a,i){for(const[n,o]of(this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[],i))this.labels.push(n),this.outputs.push(o)}static interpolationFactor(e,t,r,a){let i=0;if("exponential"===e.name)i=rt(t,e.base,r,a);else if("linear"===e.name)i=rt(t,1,r,a);else if("cubic-bezier"===e.name){var n,o,l,s;let u,p,c,h,d,m,f=e.controlPoints;i=(n=f[0],o=f[1],l=f[2],s=f[3],u=3*n,p=3*(l-n)-u,c=1-u-p,h=3*o,d=3*(s-o)-h,m=1-h-d,function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let r=e;for(let a=0;a<8;a++){let a=((c*r+p)*r+u)*r-e;if(Math.abs(a)<t)return((m*r+d)*r+h)*r;let i=(3*c*r+2*p)*r+u;if(1e-6>Math.abs(i))break;r-=a/i}let a=0,i=1;r=e;for(let n=0;n<20;n++){let n=((c*r+p)*r+u)*r;if(Math.abs(n-e)<t)break;e>n?a=r:i=r,r=(a+i)*.5}return((m*r+d)*r+h)*r})(rt(t,1,r,a))}return i}static parse(t,r){let[a,i,n,...o]=t;if(!Array.isArray(i)||0===i.length)return r.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){let e=i[1];if("number"!=typeof e)return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return r.error(`Unknown interpolation type ${String(i[0])}`,1,0);let e=i.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(n=r.parse(n,2,eJ)))return null;let l=[],s=null;("interpolate-hcl"===a||"interpolate-lab"===a)&&r.expectedType!=e8?s=eQ:r.expectedType&&"value"!==r.expectedType.kind&&(s=r.expectedType);for(let e=0;e<o.length;e+=2){let t=o[e],a=o[e+1],i=e+3,n=e+4;if("number"!=typeof t)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(l.length&&l[l.length-1][0]>=t)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);let u=r.parse(a,n,s);if(!u)return null;s=s||u.type,l.push([t,u])}return to(s,eJ)||to(s,e0)||to(s,eQ)||to(s,e4)||to(s,e6)||to(s,e8)||to(s,e7)||to(s,te(eJ))?new e(s,a,i,n,l):r.error(`Type ${tt(s)} is not interpolatable.`)}evaluate(t){let r=this.labels,a=this.outputs;if(1===r.length)return a[0].evaluate(t);let i=this.input.evaluate(t);if(i<=r[0])return a[0].evaluate(t);let n=r.length;if(i>=r[n-1])return a[n-1].evaluate(t);let o=t9(r,i),l=r[o],s=r[o+1],u=e.interpolationFactor(this.interpolation,i,l,s),p=a[o].evaluate(t),c=a[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return p+u*(c-p);case"color":return tT.interpolate(p,c,u);case"padding":return tR.interpolate(p,c,u);case"colorArray":return tO.interpolate(p,c,u);case"numberArray":return t$.interpolate(p,c,u);case"variableAnchorOffsetCollection":return tN.interpolate(p,c,u);case"array":return tE(p,c,u);case"projectionDefinition":return tU.interpolate(p,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return tT.interpolate(p,c,u,"hcl");case"colorArray":return tO.interpolate(p,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return tT.interpolate(p,c,u,"lab");case"colorArray":return tO.interpolate(p,c,u,"lab")}}}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function rt(e,t,r,a){let i=a-r,n=e-r;return 0===i?0:1===t?n/i:(Math.pow(t,n)-1)/(Math.pow(t,i)-1)}var rr=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let a=null,i=r.expectedType;i&&"value"!==i.kind&&(a=i);let n=[];for(let e of t.slice(1)){let t=r.parse(e,1+n.length,a,void 0,{typeAnnotation:"omit"});if(!t)return null;a=a||t.type,n.push(t)}if(!a)throw Error("No output type");return i&&n.some(e=>ta(i,e.type))?new e(e2,n):new e(a,n)}evaluate(e){let t=null,r=0,a;
1for(let i of this.args)if(r++,(t=i.evaluate(e))&&t instanceof tD&&!t.available&&(a||(a=t.name),t=null,r===this.args.length&&(t=a)),null!==t)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function ra(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ri(e,t,r,a){return 0===a.compare(t,r)}function rn(e,t,r){let a="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=eY,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let r=e[0],n=t.parse(e[1],1,e2);if(!n)return null;if(!ra(r,n.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${tt(n.type)}'.`);let o=t.parse(e[2],2,e2);if(!o)return null;if(!ra(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${tt(o.type)}'.`);if(n.type.kind!==o.type.kind&&"value"!==n.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${tt(n.type)}' and '${tt(o.type)}'.`);a&&("value"===n.type.kind&&"value"!==o.type.kind?n=new tZ(o.type,[n]):"value"!==n.type.kind&&"value"===o.type.kind&&(o=new tZ(n.type,[o])));let l=null;if(4===e.length){if("string"!==n.type.kind&&"string"!==o.type.kind&&"value"!==n.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(l=t.parse(e[3],3,e5)))return null}return new i(n,o,l)}evaluate(i){let n=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(a&&this.hasUntypedArgument){let t=tG(n),r=tG(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new tF(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){let e=tG(n),r=tG(o);if("string"!==e.kind||"string"!==r.kind)return t(i,n,o)}return this.collator?r(i,n,o,this.collator.evaluate(i)):t(i,n,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}let ro=rn("==",function(e,t,r){return t===r},ri),rl=rn("!=",function(e,t,r){return t!==r},function(e,t,r,a){return!ri(e,t,r,a)}),rs=rn("<",function(e,t,r){return t<r},function(e,t,r,a){return 0>a.compare(t,r)}),ru=rn(">",function(e,t,r){return t>r},function(e,t,r,a){return a.compare(t,r)>0}),rp=rn("<=",function(e,t,r){return t<=r},function(e,t,r,a){return 0>=a.compare(t,r)}),rc=rn(">=",function(e,t,r){return t>=r},function(e,t,r,a){return a.compare(t,r)>=0});var rh=class e{constructor(e,t,r){this.type=e5,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,r){if(2!==t.length)return r.error("Expected one argument.");let a=t[1];if("object"!=typeof a||Array.isArray(a))return r.error("Collator options argument must be an object.");let i=r.parse(void 0!==a["case-sensitive"]&&a["case-sensitive"],1,eY);if(!i)return null;let n=r.parse(void 0!==a["diacritic-sensitive"]&&a["diacritic-sensitive"],1,eY);if(!n)return null;let o=null;return!a.locale||(o=r.parse(a.locale,1,eX))?new e(i,n,o):null}evaluate(e){return new tM(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}},rd=class e{constructor(e,t,r,a,i,n){this.type=eX,this.number=e,this.locale=t,this.currency=r,this.unit=a,this.minFractionDigits=i,this.maxFractionDigits=n}static parse(t,r){if(3!==t.length)return r.error("Expected two arguments.");let a=r.parse(t[1],1,eJ);if(!a)return null;let i=t[2];if("object"!=typeof i||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&!(n=r.parse(i.locale,1,eX)))return null;let o=null;if(i.currency&&!(o=r.parse(i.currency,1,eX)))return null;let l=null;if(i.unit&&!(l=r.parse(i.unit,1,eX)))return null;if(o&&l)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(i["min-fraction-digits"]&&!(s=r.parse(i["min-fraction-digits"],1,eJ)))return null;let u=null;return!i["max-fraction-digits"]||(u=r.parse(i["max-fraction-digits"],1,eJ))?new e(a,n,o,l,s,u):null}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},rm=class e{constructor(e){this.type=e3,this.sections=e}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let a=t[1];if(!Array.isArray(a)&&"object"==typeof a)return r.error("First argument must be an image or text section.");let i=[],n=!1;for(let e=1;e<=t.length-1;++e){let a=t[e];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;let e=null;if(a["font-scale"]&&!(e=r.parse(a["font-scale"],1,eJ)))return null;let t=null;if(a["text-font"]&&!(t=r.parse(a["text-font"],1,te(eX))))return null;let o=null;if(a["text-color"]&&!(o=r.parse(a["text-color"],1,eQ)))return null;let l=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!tP.includes(a["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(!(l=r.parse(a["vertical-align"],1,eX)))return null}let s=i[i.length-1];s.scale=e,s.font=t,s.textColor=o,s.verticalAlign=l}else{let a=r.parse(t[e],1,e2);if(!a)return null;let o=a.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(i)}evaluate(e){return new tz(this.sections.map(t=>{let r=t.content.evaluate(e);return tG(r)===e9?new tI("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new tI(tV(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}},rf=class e{constructor(e){this.type=e9,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected two arguments.");
1let a=r.parse(t[1],1,eX);return a?new e(a):r.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=tD.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}},ry=class e{constructor(e){this.type=eJ,this.input=e}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let a=r.parse(t[1],1);return a?"array"!==a.type.kind&&"string"!==a.type.kind&&"value"!==a.type.kind?r.error(`Expected argument of type string or array, but found ${tt(a.type)} instead.`):new e(a):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new tF(`Expected value to be of type string or array, but found ${tt(tG(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}};function rg(e,t){let r=Math.pow(2,t.z);return[360*((e[0]/8192+t.x)/r)-180,360/Math.PI*Math.atan(Math.exp((180-360*((e[1]/8192+t.y)/r))*Math.PI/180))-90]}function rv(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function rb(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function rx(e,t,r,a){var i,n;let o=[t[0]-e[0],t[1]-e[1]];return 0!=(i=[a[0]-r[0],a[1]-r[1]],i[0]*(n=o)[1]-i[1]*n[0])&&!!(rk(e,t,r,a)&&rk(r,a,e,t))}function rw(e,t,r=!1){let a=!1;for(let o of t)for(let t=0;t<o.length-1;t++){var i,n;if(function(e,t,r){let a=e[0]-t[0],i=e[1]-t[1],n=e[0]-r[0],o=e[1]-r[1];return a*o-n*i==0&&a*n<=0&&i*o<=0}(e,o[t],o[t+1]))return r;i=o[t],n=o[t+1],i[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-i[0])*(e[1]-i[1])/(n[1]-i[1])+i[0]&&(a=!a)}return a}function rS(e,t){for(let r of e)if(!rw(r,t))return!1;for(let r=0;r<e.length-1;++r)if(function(e,t,r){for(let a of r)for(let r=0;r<a.length-1;++r)if(rx(e,t,a[r],a[r+1]))return!0;return!1}(e[r],e[r+1],t))return!1;return!0}function rk(e,t,r,a){let i=e[0]-r[0],n=e[1]-r[1],o=t[0]-r[0],l=t[1]-r[1],s=a[0]-r[0],u=a[1]-r[1],p=i*u-s*n,c=o*u-s*l;return p>0&&c<0||p<0&&c>0}function rL(e,t,r){let a=[];for(let i=0;i<e.length;i++){let n=[];for(let a=0;a<e[i].length;a++){let o=function(e,t){let r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*8192),Math.round(a*i*8192)]}(e[i][a],r);rv(t,o),n.push(o)}a.push(n)}return a}function rA(e,t,r){let a=[];for(let i=0;i<e.length;i++){let n=rL(e[i],t,r);a.push(n)}return a}function rC(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){let t=.5*a,i=e[0]-r[0]>t?-a:r[0]-e[0]>t?a:0;0===i&&(i=e[0]-r[2]>t?-a:r[2]-e[0]>t?a:0),e[0]+=i}rv(t,e)}function rE(e,t,r,a){let i=8192*Math.pow(2,a.z),n=[8192*a.x,8192*a.y],o=[];for(let a of e)for(let e of a){let a=[e.x+n[0],e.y+n[1]];rC(a,t,r,i),o.push(a)}return o}function r_(e,t,r,a){let i=8192*Math.pow(2,a.z),n=[8192*a.x,8192*a.y],o=[];for(let r of e){let e=[];for(let a of r){let r=[a.x+n[0],a.y+n[1]];rv(t,r),e.push(r)}o.push(e)}if(t[2]-t[0]<=i/2){for(let e of(t[0]=t[1]=1/0,t[2]=t[3]=-1/0,o))for(let a of e)rC(a,t,r,i)}return o}var rT=class e{constructor(e,t){this.type=eY,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(tq(t[1])){let r=t[1];if("FeatureCollection"===r.type){let t=[];for(let e of r.features){let{type:r,coordinates:a}=e.geometry;"Polygon"===r&&t.push(a),"MultiPolygon"===r&&t.push(...a)}if(t.length)return new e(r,{type:"MultiPolygon",coordinates:t})}else if("Feature"===r.type){let t=r.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new e(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new e(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){let n=rL(t.coordinates,a,i),o=rE(e.geometry(),r,a,i);if(!rb(r,a))return!1;for(let e of o)if(!rw(e,n))return!1}if("MultiPolygon"===t.type){let n=rA(t.coordinates,a,i),o=rE(e.geometry(),r,a,i);if(!rb(r,a))return!1;for(let e of o)if(!function(e,t){for(let r of t)if(rw(e,r))return!0;return!1}(e,n))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){let n=rL(t.coordinates,a,i),o=r_(e.geometry(),r,a,i);if(!rb(r,a))return!1;
1for(let e of o)if(!rS(e,n))return!1}if("MultiPolygon"===t.type){let n=rA(t.coordinates,a,i),o=r_(e.geometry(),r,a,i);if(!rb(r,a))return!1;for(let e of o)if(!function(e,t){for(let r of t)if(rS(e,r))return!0;return!1}(e,n))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},rM=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,a=t[e];for(;e>0;){let i=e-1>>1,n=t[i];if(r(a,n)>=0)break;t[e]=n,e=i}t[e]=a}_down(e){let{data:t,compare:r}=this,a=this.length>>1,i=t[e];for(;e<a;){let a=(e<<1)+1,n=a+1;if(n<this.length&&0>r(t[n],t[a])&&(a=n),r(t[a],i)>=0)break;t[e]=t[a],e=a}t[e]=i}};let rP=1/298.257223563*(2-1/298.257223563),rI=Math.PI/180;var rz=class{constructor(e){const t=6378.137*rI*1e3,r=Math.cos(e*rI),a=1/(1-rP*(1-r*r)),i=Math.sqrt(a);this.kx=t*i*r,this.ky=t*i*a*(1-rP)}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,a=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+a*a)}pointOnLine(e,t){let r=1/0,a,i,n,o;for(let l=0;l<e.length-1;l++){let s=e[l][0],u=e[l][1],p=this.wrap(e[l+1][0]-s)*this.kx,c=(e[l+1][1]-u)*this.ky,h=0;(0!==p||0!==c)&&((h=(this.wrap(t[0]-s)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c))>1?(s=e[l+1][0],u=e[l+1][1]):h>0&&(s+=p/this.kx*h,u+=c/this.ky*h));let d=(p=this.wrap(t[0]-s)*this.kx)*p+(c=(t[1]-u)*this.ky)*c;d<r&&(r=d,a=s,i=u,n=l,o=h)}return{point:[a,i],index:n,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function rR(e,t){return t[0]-e[0]}function r$(e){return e[1]-e[0]+1}function rO(e,t){return e[1]>=e[0]&&e[1]<t}function rF(e,t){if(e[0]>e[1])return[null,null];let r=r$(e);if(t){if(2===r)return[e,null];let t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];let a=Math.floor(r/2)-1;return[[e[0],e[0]+a],[e[0]+a+1,e[1]]]}function rj(e,t){if(!rO(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let a=t[0];a<=t[1];++a)rv(r,e[a]);return r}function rN(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let e of r)rv(t,e);return t}function rD(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function rU(e,t,r){if(!rD(e)||!rD(t))return NaN;let a=0,i=0;return e[2]<t[0]&&(a=t[0]-e[2]),e[0]>t[2]&&(a=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),r.distance([0,0],[a,i])}function rB(e,t,r){let a=r.pointOnLine(t,e);return r.distance(e,a.point)}function rq(e,t,r,a,i){return Math.min(Math.min(rB(e,[r,a],i),rB(t,[r,a],i)),Math.min(rB(r,[e,t],i),rB(a,[e,t],i)))}function rG(e,t){for(let r of e)for(let e of r)if(rw(e,t,!0))return!0;return!1}function rV(e,t,r,a,i,n){if(!n)return;let o=rU(rj(a,n),i,r);o<t&&e.push([o,n,[0,0]])}function rH(e,t,r,a,i,n,o){if(!n||!o)return;let l=rU(rj(a,n),rj(i,o),r);l<t&&e.push([l,n,o])}function rW(e,t,r,a,i=1/0){let n=Math.min(a.distance(e[0],r[0][0]),i);if(0===n)return n;let o=new rM([[0,[0,e.length-1],[0,0]]],rR),l=rN(r);for(;o.length>0;){let i=o.pop();if(i[0]>=n)continue;let s=i[1],u=t?50:100;if(r$(s)<=u){if(!rO(s,e.length))return NaN;if(t){let t=function(e,t,r,a){if(!rO(t,e.length))return NaN;for(let a=t[0];a<=t[1];++a)if(rw(e[a],r,!0))return 0;let i=1/0;for(let n=t[0];n<t[1];++n){let t=e[n],o=e[n+1];for(let e of r)for(let r=0,n=e.length,l=n-1;r<n;l=r++){let n=e[l],s=e[r];if(rx(t,o,n,s))return 0;i=Math.min(i,rq(t,o,n,s,a))}}return i}(e,s,r,a);if(isNaN(t)||0===t)return t;n=Math.min(n,t)}else for(let t=s[0];t<=s[1];++t)if(0===(n=Math.min(n,function(e,t,r){if(rw(e,t,!0))return 0;let a=1/0;for(let i of t){let t=i[0],n=i[i.length-1];if(t!==n&&0===(a=Math.min(a,rB(e,[n,t],r))))break;let o=r.pointOnLine(i,e);if(0===(a=Math.min(a,r.distance(e,o.point))))break}return a}(e[t],r,a))))return 0}else{let r=rF(s,t);rV(o,n,a,e,l,r[0]),rV(o,n,a,e,l,r[1])}}return n}function rZ(e,t,r,a,i,n=1/0){let o=Math.min(n,i.distance(e[0],r[0]));if(0===o)return o;let l=new rM([[0,[0,e.length-1],[0,r.length-1]]],rR);for(;l.length>0;){let n=l.pop();if(n[0]>=o)continue;let s=n[1],u=n[2],p=t?50:100,c=a?50:100;if(r$(s)<=p&&r$(u)<=c){if(!rO(s,e.length)&&rO(u,r.length))return NaN;
1if(t&&a)o=Math.min(o,function(e,t,r,a,i){if(!(rO(t,e.length)&&rO(a,r.length)))return 1/0;let n=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],l=e[o+1];for(let e=a[0];e<a[1];++e){let a=r[e],o=r[e+1];if(rx(t,l,a,o))return 0;n=Math.min(n,rq(t,l,a,o,i))}}return n}(e,s,r,u,i));else if(t&&!a){let t=e.slice(s[0],s[1]+1);for(let e=u[0];e<=u[1];++e)if(0===(o=Math.min(o,rB(r[e],t,i))))return o}else if(!t&&a){let t=r.slice(u[0],u[1]+1);for(let r=s[0];r<=s[1];++r)if(0===(o=Math.min(o,rB(e[r],t,i))))return o}else o=Math.min(o,function(e,t,r,a,i){if(!(rO(t,e.length)&&rO(a,r.length)))return NaN;let n=1/0;for(let o=t[0];o<=t[1];++o)for(let t=a[0];t<=a[1];++t)if(0===(n=Math.min(n,i.distance(e[o],r[t]))))return n;return n}(e,s,r,u,i))}else{let n=rF(s,t),p=rF(u,a);rH(l,o,i,e,r,n[0],p[0]),rH(l,o,i,e,r,n[0],p[1]),rH(l,o,i,e,r,n[1],p[0]),rH(l,o,i,e,r,n[1],p[1])}}return o}function rK(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}var rJ=class e{constructor(e,t){this.type=eJ,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(tq(t[1])){let r=t[1];if("FeatureCollection"===r.type)return new e(r,r.features.map(e=>rK(e.geometry)).flat());if("Feature"===r.type)return new e(r,rK(r.geometry));if("type"in r&&"coordinates"in r)return new e(r,rK(r))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=e.geometry(),a=r.flat().map(t=>rg([t.x,t.y],e.canonical));if(0===r.length)return NaN;let i=new rz(a[0][1]),n=1/0;for(let e of t){switch(e.type){case"Point":n=Math.min(n,rZ(a,!1,[e.coordinates],!1,i,n));break;case"LineString":n=Math.min(n,rZ(a,!1,e.coordinates,!0,i,n));break;case"Polygon":n=Math.min(n,rW(a,!1,e.coordinates,i,n))}if(0===n)break}return n}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=e.geometry(),a=r.flat().map(t=>rg([t.x,t.y],e.canonical));if(0===r.length)return NaN;let i=new rz(a[0][1]),n=1/0;for(let e of t){switch(e.type){case"Point":n=Math.min(n,rZ(a,!0,[e.coordinates],!1,i,n));break;case"LineString":n=Math.min(n,rZ(a,!0,e.coordinates,!0,i,n));break;case"Polygon":n=Math.min(n,rW(a,!0,e.coordinates,i,n))}if(0===n)break}return n}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){let r=e.geometry();if(0===r.length||0===r[0].length)return NaN;let a=(function(e,t){let r,a;if(e.length<=1)return[e];let i=[];for(let t of e){let e=function(e){let t=0;for(let r=0,a=e.length,i=a-1,n,o;r<a;i=r++)n=e[r],t+=((o=e[i]).x-n.x)*(n.y+o.y);return t}(t);0!==e&&(t.area=Math.abs(e),void 0===a&&(a=e<0),a===e<0?(r&&i.push(r),r=[t]):r.push(t))}return r&&i.push(r),i})(r).map(t=>t.map(t=>t.map(t=>rg([t.x,t.y],e.canonical)))),i=new rz(a[0][0][0][1]),n=1/0;for(let e of t)for(let t of a){switch(e.type){case"Point":n=Math.min(n,rW([e.coordinates],!1,t,i,n));break;case"LineString":n=Math.min(n,rW(e.coordinates,!0,t,i,n));break;case"Polygon":n=Math.min(n,function(e,t,r,a=1/0){let i=rN(e),n=rN(t);if(a!==1/0&&rU(i,n,r)>=a)return a;if(rb(i,n)){if(rG(e,t))return 0}else if(rG(t,e))return 0;let o=1/0;for(let a of e)for(let e=0,i=a.length,n=i-1;e<i;n=e++){let i=a[n],l=a[e];for(let e of t)for(let t=0,a=e.length,n=a-1;t<a;n=t++){let a=e[n],s=e[t];if(rx(i,l,a,s))return 0;o=Math.min(o,rq(i,l,a,s,r))}}return o}(t,e.coordinates,i,n))}if(0===n)return n}return n}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},rX=class e{constructor(e){this.type=e2,this.key=e}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let a=t[1];return null==a?r.error("Global state property must be defined."):"string"!=typeof a?r.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new e(a)}evaluate(e){var t;let r=null==(t=e.globals)?void 0:t.globalState;return r&&0!==Object.keys(r).length?tw(r,this.key)??null:null}eachChild(){}outputDefined(){return!1}};let rY={"==":ro,"!=":rl,">":ru,"<":rs,">=":rc,"<=":rp,array:tZ,at:t2,boolean:tZ,case:t8,coalesce:rr,collator:rh,format:rm,image:rf,in:t5,"index-of":t3,interpolate:re,"interpolate-hcl":re,"interpolate-lab":re,length:ry,let:t0,literal:tH,match:t4,number:tZ,"number-format":rd,object:tZ,slice:t6,step:t7,string:tZ,"to-boolean":tJ,"to-color":tJ,"to-number":tJ,"to-string":tJ,var:t1,within:rT,distance:rJ,"global-state":rX};var rQ=class e{constructor(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a}evaluate(e){return this._evaluate(e,this.args)}
vendor: 11,971 bytes, line 1
1eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,r){let a=t[0],i=e.definitions[a];if(!i)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);let n=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,l=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),s=null;for(let[i,o]of l){s=new tQ(r.registry,r5,r.path,null,r.scope);let l=[],u=!1;for(let e=1;e<t.length;e++){let r=t[e],a=Array.isArray(i)?i[e-1]:i.type,n=s.parse(r,1+l.length,a);if(!n){u=!0;break}l.push(n)}if(!u){if(Array.isArray(i)&&i.length!==l.length){s.error(`Expected ${i.length} arguments, but found ${l.length} instead.`);continue}for(let e=0;e<l.length;e++){let t=Array.isArray(i)?i[e]:i.type,r=l[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new e(a,n,o,l)}}if(1===l.length)r.errors.push(...s.errors);else{let e=(l.length?l:o).map(([e])=>{var t;return Array.isArray(t=e)?`(${t.map(tt).join(", ")})`:`(${tt(t.type)}...)`}).join(" | "),a=[];for(let e=1;e<t.length;e++){let i=r.parse(t[e],1+a.length);if(!i)return null;a.push(tt(i.type))}r.error(`Expected arguments of type ${e}, but found (${a.join(", ")}) instead.`)}return null}static register(t,r){for(let a in e.definitions=r,r)t[a]=e}};function r0(e,[t,r,a,i]){t=t.evaluate(e),r=r.evaluate(e),a=a.evaluate(e);let n=i?i.evaluate(e):1,o=tB(t,r,a,n);if(o)throw new tF(o);return new tT(t/255,r/255,a/255,n,!1)}function r1(e,t){let r=t[e];return typeof r>"u"?null:r}function r2(e){return{type:e}}function r5(e){if(e instanceof t1)return r5(e.boundExpression);if(e instanceof rQ&&"error"===e.name||e instanceof rh||e instanceof rT||e instanceof rJ||e instanceof rX)return!1;let t=e instanceof tJ||e instanceof tZ,r=!0;return e.eachChild(e=>{r=t?r&&r5(e):r&&e instanceof tH}),!!r&&r3(e)&&r8(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function r3(e){if(e instanceof rQ&&("get"===e.name&&1===e.args.length||"feature-state"===e.name||"has"===e.name&&1===e.args.length||"properties"===e.name||"geometry-type"===e.name||"id"===e.name||/^filter-/.test(e.name))||e instanceof rT||e instanceof rJ)return!1;let t=!0;return e.eachChild(e=>{t&&!r3(e)&&(t=!1)}),t}function r4(e){if(e instanceof rQ&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!r4(e)&&(t=!1)}),t}function r8(e,t){if(e instanceof rQ&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!r8(e,t)&&(r=!1)}),r}function r6(e){return{result:"success",value:e}}function r9(e){return{result:"error",value:e}}function r7(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function ae(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function at(e){return!!e.expression&&e.expression.interpolated}function ar(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function aa(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&tG(e)===e1}rQ.register(rY,{error:[{kind:"error"},[eX],(e,[t])=>{throw new tF(t.evaluate(e))}],typeof:[eX,[e2],(e,[t])=>tt(tG(t.evaluate(e)))],"to-rgba":[te(eJ,4),[eQ],(e,[t])=>{let[r,a,i,n]=t.evaluate(e).rgb;return[255*r,255*a,255*i,n]}],rgb:[eQ,[eJ,eJ,eJ],r0],rgba:[eQ,[eJ,eJ,eJ,eJ],r0],has:{type:eY,overloads:[[[eX],(e,[t])=>t.evaluate(e)in e.properties()],[[eX,e1],(e,[t,r])=>t.evaluate(e)in r.evaluate(e)]]},get:{type:e2,overloads:[[[eX],(e,[t])=>r1(t.evaluate(e),e.properties())],[[eX,e1],(e,[t,r])=>r1(t.evaluate(e),r.evaluate(e))]]},"feature-state":[e2,[eX],(e,[t])=>r1(t.evaluate(e),e.featureState||{})],properties:[e1,[],e=>e.properties()],"geometry-type":[eX,[],e=>e.geometryType()],id:[e2,[],e=>e.id()],zoom:[eJ,[],e=>e.globals.zoom],"heatmap-density":[eJ,[],e=>e.globals.heatmapDensity||0],elevation:[eJ,[],e=>e.globals.elevation||0],"line-progress":[eJ,[],e=>e.globals.lineProgress||0],accumulated:[e2,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[eJ,r2(eJ),(e,t)=>{let r=0;for(let a of t)r+=a.evaluate(e);return r}],"*":[eJ,r2(eJ),(e,t)=>{let r=1;for(let a of t)r*=a.evaluate(e);return r}],"-":{type:eJ,overloads:[[[eJ,eJ],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[eJ],(e,[t])=>-t.evaluate(e)]]},"/":[eJ,[eJ,eJ],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[eJ,[eJ,eJ],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[eJ,[],()=>Math.LN2],pi:[eJ,[],()=>Math.PI],e:[eJ,[],()=>Math.E],"^":[eJ,[eJ,eJ],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[eJ,[eJ],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[eJ,[eJ],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[eJ,[eJ],(e,[t])=>Math.log(t.evaluate(e))],log2:[eJ,[eJ],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[eJ,[eJ],(e,[t])=>Math.sin(t.evaluate(e))],cos:[eJ,[eJ],(e,[t])=>Math.cos(t.evaluate(e))],tan:[eJ,[eJ],(e,[t])=>Math.tan(t.evaluate(e))],asin:[eJ,[eJ],(e,[t])=>Math.asin(t.evaluate(e))],acos:[eJ,[eJ],(e,[t])=>Math.acos(t.evaluate(e))],atan:[eJ,[eJ],(e,[t])=>Math.atan(t.evaluate(e))],min:[eJ,r2(eJ),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[eJ,r2(eJ),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[eJ,[eJ],(e,[t])=>Math.abs(t.evaluate(e))],round:[eJ,[eJ],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[eJ,[eJ],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[eJ,[eJ],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[eY,[eX,e2],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[eY,[e2],(e,[t])=>e.id()===t.value],"filter-type-==":[eY,[eX],(e,[t])=>e.geometryType()===t.value],"filter-<":[eY,[eX,e2],(e,[t,r])=>{let a=e.properties()[t.value],i=r.value;return typeof a==typeof i&&a<i}],"filter-id-<":[eY,[e2],(e,[t])=>{let r=e.id(),a=t.value;return typeof r==typeof a&&r<a}],"filter->":[eY,[eX,e2],(e,[t,r])=>{let a=e.properties()[t.value],i=r.value;return typeof a==typeof i&&a>i}],"filter-id->":[eY,[e2],(e,[t])=>{let r=e.id(),a=t.value;return typeof r==typeof a&&r>a}],"filter-<=":[eY,[eX,e2],(e,[t,r])=>{let a=e.properties()[t.value],i=r.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[eY,[e2],(e,[t])=>{let r=e.id(),a=t.value;return typeof r==typeof a&&r<=a}],"filter->=":[eY,[eX,e2],(e,[t,r])=>{let a=e.properties()[t.value],i=r.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[eY,[e2],(e,[t])=>{let r=e.id(),a=t.value;return typeof r==typeof a&&r>=a}],"filter-has":[eY,[e2],(e,[t])=>t.value in e.properties()],"filter-has-id":[eY,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[eY,[te(eX)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[eY,[te(e2)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[eY,[eX,te(e2)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[eY,[eX,te(e2)],(e,[t,r])=>(function(e,t,r,a){for(;r<=a;){let i=r+a>>1;if(t[i]===e)return!0;t[i]>e?a=i-1:r=i+1}return!1})(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:eY,overloads:[[[eY,eY],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[r2(eY),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:eY,overloads:[[[eY,eY],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[r2(eY),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[eY,[eY],(e,[t])=>!t.evaluate(e)],"is-supported-script":[eY,[eX],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[eX,[eX],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[eX,[eX],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[eX,r2(e2),(e,t)=>t.map(t=>tV(t.evaluate(e))).join("")],split:[te(eX),[eX,eX],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[eX,[te(eX),eX],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[eX,[e5],(e,[t])=>t.evaluate(e).resolvedLocale()]});var ai=class{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new tY,this._defaultValue=t?function(e){if("color"===e.type&&aa(e.default))return new tT(0,0,0,0);switch(e.type){case"color":return tT.parse(e.default)||null;case"padding":return tR.parse(e.default)||null;case"numberArray":return t$.parse(e.default)||null;case"colorArray":return tO.parse(e.default)||null;case"variableAnchorOffsetCollection":return tN.parse(e.default)||null;case"projectionDefinition":return tU.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,a,i,n){return this._globalState&&(e=ap(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,a,i,n){this._globalState&&(e=ap(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=n||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new tF(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"u">typeof console&&console.warn(e.message)),this._defaultValue}}};function an(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in rY}function ao(e,t,r){var a;let i,n=new tQ(rY,r5,[],t?(a=t,i={color:eQ,string:eX,number:eJ,enum:eX,boolean:eY,formatted:e3,padding:e4,numberArray:e6,colorArray:e8,projectionDefinition:e0,resolvedImage:e9,variableAnchorOffsetCollection:e7},"array"===a.type?te(i[a.value]||e2,a.length):i[a.type]):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?r6(new ai(o,t,r)):r9(n.errors)}var al=class{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!r4(t.expression),this.globalStateRefs=au(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,a,i,n){return this._globalState&&(e=ap(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,i,n)}evaluate(e,t,r,a,i,n){return this._globalState&&(e=ap(e,this._globalState)),this._styleExpression.evaluate(e,t,r,a,i,n)}},as=class{constructor(e,t,r,a,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!r4(t.expression),this.globalStateRefs=au(t.expression),this.interpolationType=a,this._globalState=i}evaluateWithoutErrorHandling(e,t,r,a,i,n){return this._globalState&&(e=ap(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,i,n)}evaluate(e,t,r,a,i,n){return this._globalState&&(e=ap(e,this._globalState)),this._styleExpression.evaluate(e,t,r,a,i,n)}interpolationFactor(e,t,r){return this.interpolationType?re.interpolationFactor(this.interpolationType,e,t,r):0}};function au(e,t=new Set){return e instanceof rX&&t.add(e.key),e.eachChild(e=>{au(e,t)}),t}function ap(e,t){let{zoom:r,heatmapDensity:a,elevation:i,lineProgress:n,isSupportedScript:o,accumulated:l}=e??{};return{zoom:r,heatmapDensity:a,elevation:i,lineProgress:n,isSupportedScript:o,accumulated:l,globalState:t}}function ac(e){let t=e.key,r=e.value;return r?[new eV(t,r,"constants have been deprecated as of v8")]:[]}function ah(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function ad(e){if(Array.isArray(e))return e.map(ad);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=ad(e[r]);return t}return ah(e)}function am(e){let t=e.key,r=e.value,a=e.valueSpec||{},i=e.objectElementValidators||{},n=e.style,o=e.styleSpec,l=e.validateSpec,s=[],u=ar(r);if("object"!==u)return[new eV(t,r,`object expected, ${u}
1 found`)];for(let e in r){let u,p=e.split(".")[0],c=tw(a,p)||a["*"];if(tw(i,p))u=i[p];else if(tw(a,p)){if(void 0===r[e])continue;u=l}else if(i["*"])u=i["*"];else if(a["*"])u=l;else{s.push(new eV(t,r[e],`unknown property "${e}"`));continue}s=s.concat(u({key:(t&&`${t}.`)+e,value:r[e],valueSpec:c,style:n,styleSpec:o,object:r,objectKey:e,validateSpec:l},r))}for(let e in a)i[e]||a[e].required&&void 0===a[e].default&&void 0===r[e]&&s.push(new eV(t,r,`missing required property "${e}"`));return s}function af(e){let t=e.value,r=e.valueSpec,a=e.validateSpec,i=e.style,n=e.styleSpec,o=e.key,l=e.arrayElementValidator||a;if("array"!==ar(t))return[new eV(o,t,`array expected, ${ar(t)} found`)];if(r.length&&t.length!==r.length)return[new eV(o,t,`array length ${r.length} expected, length ${t.length} found`)];let s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===ar(r.value)&&(s=r.value);let u=[];for(let r=0;r<t.length;r++)u=u.concat(l({array:t,arrayIndex:r,value:t[r],valueSpec:s,validateSpec:e.validateSpec,style:i,styleSpec:n,key:`${o}[${r}]`}));return u}function ay(e){let t=e.key,r=e.value,a=e.valueSpec,i=ar(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new eV(t,r,`number expected, ${i} found`)]:"minimum"in a&&r<a.minimum?[new eV(t,r,`${r} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&r>a.maximum?[new eV(t,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function ag(e){let t=e.valueSpec,r=ah(e.value.type),a,i={},n,o,l="categorical"!==r&&void 0===e.value.property,s="array"===ar(e.value.stops)&&"array"===ar(e.value.stops[0])&&"object"===ar(e.value.stops[0][0]),u=am({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new eV(e.key,e.value,'identity function may not have a "stops" property')];let t=[],a=e.value;return t=t.concat(af({key:e.key,value:a,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:p})),"array"===ar(a)&&0===a.length&&t.push(new eV(e.key,a,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&l&&u.push(new eV(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new eV(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!at(e.valueSpec)&&u.push(new eV(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l||r7(e.valueSpec)?l&&!ae(e.valueSpec)&&u.push(new eV(e.key,e.value,"zoom functions not supported")):u.push(new eV(e.key,e.value,"property functions not supported"))),("categorical"===r||s)&&void 0===e.value.property&&u.push(new eV(e.key,e.value,'"property" property is required')),u;function p(e){let r=[],a=e.value,l=e.key;if("array"!==ar(a))return[new eV(l,a,`array expected, ${ar(a)} found`)];if(2!==a.length)return[new eV(l,a,`array length 2 expected, length ${a.length} found`)];if(s){if("object"!==ar(a[0]))return[new eV(l,a,`object expected, ${ar(a[0])} found`)];if(void 0===a[0].zoom)return[new eV(l,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new eV(l,a,"object stop key must have value")];if(o&&o>ah(a[0].zoom))return[new eV(l,a[0].zoom,"stop zoom values must appear in ascending order")];ah(a[0].zoom)!==o&&(o=ah(a[0].zoom),n=void 0,i={}),r=r.concat(am({key:`${l}[0]`,value:a[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:ay,value:c}}))}else r=r.concat(c({key:`${l}[0]`,value:a[0],validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},a));return an(ad(a[1]))?r.concat([new eV(`${l}[1]`,a[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${l}[1]`,value:a[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function c(e,o){let l=ar(e.value),s=ah(e.value),u=null!==e.value?e.value:o;
1if(a){if(l!==a)return[new eV(e.key,u,`${l} stop domain type must match previous stop domain type ${a}`)]}else a=l;if("number"!==l&&"string"!==l&&"boolean"!==l)return[new eV(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==r){let a=`number expected, ${l} found`;return r7(t)&&void 0===r&&(a+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new eV(e.key,u,a)]}return"categorical"!==r||"number"!==l||isFinite(s)&&Math.floor(s)===s?"categorical"!==r&&"number"===l&&void 0!==n&&s<n?[new eV(e.key,u,"stop domain values must appear in ascending order")]:(n=s,"categorical"===r&&s in i?[new eV(e.key,u,"stop domain values must be unique")]:(i[s]=!0,[])):[new eV(e.key,u,`integer expected, found ${s}`)]}}function av(e){let t=("property"===e.expressionContext?function(e,t,r){let a=ao(e,t,r);if("error"===a.result)return a;let i=a.value.expression,n=r3(i);if(!n&&!r7(t))return r9([new eW("","data expressions not supported")]);let o=r8(i,["zoom"]);if(!o&&!ae(t))return r9([new eW("","zoom expressions not supported")]);let l=function e(t){let r=null;if(t instanceof t0)r=e(t.result);else if(t instanceof rr){for(let a of t.args)if(r=e(a))break}else(t instanceof t7||t instanceof re)&&t.input instanceof rQ&&"zoom"===t.input.name&&(r=t);return r instanceof eW||t.eachChild(t=>{let a=e(t);a instanceof eW?r=a:!r&&a?r=new eW("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&a&&r!==a&&(r=new eW("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}(i);if(!l&&!o)return r9([new eW("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof eW)return r9([l]);if(l instanceof re&&!at(t))return r9([new eW("",'"interpolate" expressions cannot be used with this property')]);if(!l)return r6(n?new al("constant",a.value,r):new al("source",a.value,r));let s=l instanceof re?l.interpolation:void 0;return r6(n?new as("camera",a.value,l.labels,s,r):new as("composite",a.value,l.labels,s,r))}:ao)(ad(e.value),e.valueSpec);if("error"===t.result)return t.value.map(t=>new eV(`${e.key}${t.key}`,e.value,t.message));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new eV(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!r4(r))return[new eV(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!r4(r))return[new eV(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!r8(r,["zoom","feature-state"]))return[new eV(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!r3(r))return[new eV(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ab(e){let t=e.key,r=e.value,a=ar(r);return"string"!==a?[new eV(t,r,`color expected, ${a} found`)]:tT.parse(String(r))?[]:[new eV(t,r,`color expected, "${r}" found`)]}function ax(e){let t=e.key,r=e.value,a=e.valueSpec,i=[];return Array.isArray(a.values)?-1===a.values.indexOf(ah(r))&&i.push(new eV(t,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(a.values).indexOf(ah(r))&&i.push(new eV(t,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function aw(e){return!function e(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let r of t.slice(1))if(!e(r)&&"boolean"!=typeof r)return!1;return!0;default:return!0}}(ad(e.value))?function e(t){let r=t.value,a=t.key;if("array"!==ar(r))return[new eV(a,r,`array expected, ${ar(r)} found`)];let i=t.styleSpec,n,o=[];if(r.length<1)return[new eV(a,r,"filter array must have at least 1 element")];switch(o=o.concat(ax({key:`${a}[0]`,value:r[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),ah(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===ah(r[1])&&o.push(new eV(a,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":3!==r.length&&o.push(new eV(a,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&"string"!==(n=ar(r[1]))&&o.push(new eV(`${a}[1]`,r[1],`string expected, ${n} found`));for(let e=2;e<r.length;e++)n=ar(r[e]),"$type"===ah(r[1])?o=o.concat(ax({key:`${a}[${e}]`,value:r[e],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&o.push(new eV(`${a}[${e}]`,r[e],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let i=1;i<r.length;i++)o=o.concat(e({key:`${a}[${i}]`,value:r[i],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=ar(r[1]),2!==r.length?o.push(new eV(a,r,`filter array for "${r[0]}" operator must have 2 elements`)):"string"!==n&&o.push(new eV(`${a}[1]`,r[1],`string expected, ${n} found`))}return o}(e):av(eH({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))}function aS(e,t){let r,a=e.key,i=e.validateSpec,n=e.style,o=e.styleSpec,l=e.value,s=e.objectKey,u=o[`${t}_${e.layerType}`];if(!u)return[];let p=s.match(/^(.*)-transition$/);if("paint"===t&&p&&u[p[1]]&&u[p[1]].transition)return i({key:a,value:l,valueSpec:o.transition,style:n,styleSpec:o});let c=e.valueSpec||u[s];if(!c)return[new eV(a,l,`unknown property "${s}"`)];if("string"===ar(l)&&r7(c)&&!c.tokens&&(r=/^{([^}]+)}$/.exec(l)))return[new eV(a,l,`"${s}" does not support interpolation syntax 2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(r[1])} }\`.`)];let h=[];return"symbol"===e.layerType&&"text-font"===s&&aa(ad(l))&&"identity"===ah(l.type)&&h.push(new eV(a,l,'"text-font" does not support identity functions')),h.concat(i({key:e.key,value:l,valueSpec:c,style:n,styleSpec:o,expressionContext:"property",propertyType:t,propertyKey:s}))}function ak(e){return aS(e,"paint")}function aL(e){return aS(e,"layout")}function aA(e){var t,r;let a=[],i=e.value,n=e.key,o=e.style,l=e.styleSpec;if("object"!==ar(i))return[new eV(n,i,`object expected, ${ar(i)} found`)];i.type||i.ref||a.push(new eV(n,i,'either "type" or "ref" is required'));let s=ah(i.type),u=ah(i.ref);
2if(i.id){let t=ah(i.id);for(let r=0;r<e.arrayIndex;r++){let e=o.layers[r];ah(e.id)===t&&a.push(new eV(n,i.id,`duplicate layer id "${i.id}", previously used at line ${e.id.__line__}`))}}if("ref"in i){let e;["type","source","source-layer","filter","layout"].forEach(e=>{e in i&&a.push(new eV(n,i[e],`"${e}" is prohibited for ref layers`))}),o.layers.forEach(t=>{ah(t.id)===u&&(e=t)}),e?e.ref?a.push(new eV(n,i.ref,"ref cannot reference another ref layer")):s=ah(e.type):a.push(new eV(n,i.ref,`ref layer "${u}" not found`))}else if("background"!==s)if(i.source){let e=o.sources&&o.sources[i.source],t=e&&ah(e.type);e?"vector"===t&&"raster"===s?a.push(new eV(n,i.source,`layer "${i.id}" requires a raster source`)):"raster-dem"!==t&&"hillshade"===s||"raster-dem"!==t&&"color-relief"===s?a.push(new eV(n,i.source,`layer "${i.id}" requires a raster-dem source`)):"raster"===t&&"raster"!==s?a.push(new eV(n,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==t||i["source-layer"]?"raster-dem"===t&&"hillshade"!==s&&"color-relief"!==s?a.push(new eV(n,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===s&&i.paint&&i.paint["line-gradient"]&&("geojson"!==t||!e.lineMetrics)&&a.push(new eV(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):a.push(new eV(n,i,`layer "${i.id}" must specify a "source-layer"`)):a.push(new eV(n,i.source,`source "${i.source}" not found`))}else a.push(new eV(n,i,'missing required property "source"'));return"raster"===s&&null!=(t=i.paint)&&t.resampling&&null!=(r=i.paint)&&r["raster-resampling"]&&a.push(new eV(n,i.paint,`layer "${i.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),a=a.concat(am({key:n,value:i,valueSpec:l.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:i.type,valueSpec:l.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:i,objectKey:"type"}),filter:aw,layout:e=>am({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>aL(eH({layerType:s},e))}}),paint:e=>am({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>ak(eH({layerType:s},e))}})}}))}function aC(e){let t=e.value,r=e.key,a=ar(t);return"string"!==a?[new eV(r,t,`string expected, ${a} found`)]:[]}let aE={promoteId:function({key:e,value:t}){if("string"===ar(t))return aC({key:e,value:t});{let r=[];for(let a in t)r.push(...aC({key:`${e}.${a}`,value:t[a]}));return r}}};function a_(e){let t,r=e.value,a=e.key,i=e.styleSpec,n=e.style,o=e.validateSpec;if(!r.type)return[new eV(a,r,'"type" is required')];let l=ah(r.type);switch(l){case"vector":case"raster":return am({key:a,value:r,valueSpec:i[`source_${l.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:aE,validateSpec:o});case"raster-dem":return function(e){let t=e.sourceName??"",r=e.value,a=e.styleSpec,i=a.source_raster_dem,n=e.style,o=[],l=ar(r);if(void 0===r)return o;if("object"!==l)return o.push(new eV("source_raster_dem",r,`object expected, ${l} found`)),o;let s="custom"===ah(r.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],p=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let l in r)!s&&u.includes(l)?o.push(new eV(l,r[l],`In "${t}": "${l}" is only valid when "encoding" is set to "custom". ${p} encoding found`)):i[l]?o=o.concat(e.validateSpec({key:l,value:r[l],valueSpec:i[l],validateSpec:e.validateSpec,style:n,styleSpec:a})):o.push(new eV(l,r[l],`unknown property "${l}"`));return o}({sourceName:a,value:r,style:e.style,styleSpec:i,validateSpec:o});case"geojson":if(t=am({key:a,value:r,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:o,objectElementValidators:aE}),r.cluster)for(let e in r.clusterProperties){let[i,n]=r.clusterProperties[e],o="string"==typeof i?[i,["accumulated"],["get",e]]:i;t.push(...av({key:`${a}.${e}.map`,value:n,expressionContext:"cluster-map"})),t.push(...av({key:`${a}.${e}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return t;case"video":return am({key:a,value:r,valueSpec:i.source_video,style:n,validateSpec:o,styleSpec:i});case"image":return am({key:a,value:r,valueSpec:i.source_image,style:n,validateSpec:o,styleSpec:i});case"canvas":return[new eV(a,null,"Please use runtime APIs to add canvas sources, rather than
2including them in stylesheets.","source.canvas")];default:return ax({key:`${a}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function aT(e){let t=e.value,r=e.styleSpec,a=r.light,i=e.style,n=[],o=ar(t);if(void 0===t)return n;if("object"!==o)return n.concat([new eV("light",t,`object expected, ${o} found`)]);for(let o in t){let l=o.match(/^(.*)-transition$/);n=l&&a[l[1]]&&a[l[1]].transition?n.concat(e.validateSpec({key:o,value:t[o],valueSpec:r.transition,validateSpec:e.validateSpec,style:i,styleSpec:r})):a[o]?n.concat(e.validateSpec({key:o,value:t[o],valueSpec:a[o],validateSpec:e.validateSpec,style:i,styleSpec:r})):n.concat([new eV(o,t[o],`unknown property "${o}"`)])}return n}function aM(e){let t=e.value,r=e.styleSpec,a=r.sky,i=e.style,n=ar(t);if(void 0===t)return[];if("object"!==n)return[new eV("sky",t,`object expected, ${n} found`)];let o=[];for(let n in t)o=a[n]?o.concat(e.validateSpec({key:n,value:t[n],valueSpec:a[n],style:i,styleSpec:r})):o.concat([new eV(n,t[n],`unknown property "${n}"`)]);return o}function aP(e){let t=e.value,r=e.styleSpec,a=r.terrain,i=e.style,n=[],o=ar(t);if(void 0===t)return n;if("object"!==o)return n.concat([new eV("terrain",t,`object expected, ${o} found`)]);for(let o in t)n=a[o]?n.concat(e.validateSpec({key:o,value:t[o],valueSpec:a[o],validateSpec:e.validateSpec,style:i,styleSpec:r})):n.concat([new eV(o,t[o],`unknown property "${o}"`)]);return n}function aI(e){let t=[],r=e.value,a=e.key;if(!Array.isArray(r))return aC({key:a,value:r});{let i=[],n=[];for(let o in r)r[o].id&&i.includes(r[o].id)&&t.push(new eV(a,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&n.includes(r[o].url)&&t.push(new eV(a,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),n.push(r[o].url),t=t.concat(am({key:`${a}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}}function az(e){return!!e&&e.constructor===Object}function aR(e){return az(e.value)?[]:[new eV(e.key,e.value,`object expected, ${ar(e.value)} found`)]}let a$={"*":()=>[],array:af,boolean:function(e){let t=e.value,r=e.key,a=ar(t);return"boolean"!==a?[new eV(r,t,`boolean expected, ${a} found`)]:[]},number:ay,color:ab,constants:ac,enum:ax,filter:aw,function:ag,layer:aA,object:am,source:a_,light:aT,sky:aM,terrain:aP,projection:function(e){let t=e.value,r=e.styleSpec,a=r.projection,i=e.style,n=ar(t);if(void 0===t)return[];if("object"!==n)return[new eV("projection",t,`object expected, ${n} found`)];let o=[];for(let n in t)o=a[n]?o.concat(e.validateSpec({key:n,value:t[n],valueSpec:a[n],style:i,styleSpec:r})):o.concat([new eV(n,t[n],`unknown property "${n}"`)]);return o},projectionDefinition:function(e){var t;let r=e.key,a=e.value,i=ar(a=a instanceof String?a.valueOf():a);return"array"!==i||Array.isArray(t=a)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]||["interpolate","step","literal"].includes(a[0])?["array","string"].includes(i)?[]:[new eV(r,a,`projection expected, invalid type "${i}" found`)]:[new eV(r,a,`projection expected, invalid array ${JSON.stringify(a)} found`)]},string:aC,formatted:function(e){return 0===aC(e).length?[]:av(e)},resolvedImage:function(e){return 0===aC(e).length?[]:av(e)},padding:function(e){let t=e.key,r=e.value;if("array"!==ar(r))return ay({key:t,value:r,valueSpec:{}});{if(r.length<1||r.length>4)return[new eV(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let a={type:"number"},i=[];for(let n=0;n<r.length;n++)i=i.concat(e.validateSpec({key:`${t}[${n}]`,value:r[n],validateSpec:e.validateSpec,valueSpec:a}));return i}},numberArray:function(e){let t=e.key,r=e.value;if("array"!==ar(r))return ay({key:t,value:r,valueSpec:{}});{let a={type:"number"};if(r.length<1)return[new eV(t,r,"array length at least 1 expected, length 0 found")];let i=[];for(let n=0;n<r.length;n++)i=i.concat(e.validateSpec({key:`${t}[${n}]`,value:r[n],validateSpec:e.validateSpec,valueSpec:a}));return i}},colorArray:function(e){let t=e.key,r=e.value;if("array"!==ar(r))return ab({key:t,value:r});{if(r.length<1)return[new eV(t,r,"array length at least 1 expected, length 0 found")];let e=[];for(let a=0;a<r.length;a++)e=e.concat(ab({key:`${t}[${a}]`,value:r[a]}));return e}},variableAnchorOffsetCollection:function(e){let t=e.key,r=e.value,a=ar(r),i=e.styleSpec;if("array"!==a||r.length<1||r.length%2!=0)return[new eV(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let n=[];for(let a=0;a<r.length;a+=2)n=(n=n.concat(ax({key:`${t}[${a}]`,value:r[a],valueSpec:i.layout_symbol["text-anchor"]}))).concat(af({key:`${t}[${a+1}]`,value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return n},sprite:aI,state:aR,fontFaces:function(e){let t=e.key,r=e.value,a=e.validateSpec,i=e.styleSpec,n=e.style;if(!az(r))return[new eV(t,r,`object expected, ${ar(r)} found`)];let o=[];for(let e in r){let l=r[e],s=ar(l);if("string"===s)o.push(...aC({key:`${t}.${e}`,value:l}));else if("array"===s){let r={url:{type:"string",required:!0}
2,"unicode-range":{type:"array",value:"string"}};for(let[s,u]of l.entries())o.push(...am({key:`${t}.${e}[${s}]`,value:u,valueSpec:r,styleSpec:i,style:n,validateSpec:a}))}else o.push(new eV(`${t}.${e}`,l,`string or array expected, ${s} found`))}return o}};function aO(e){let t=e.value,r=e.valueSpec,a=e.styleSpec;return e.validateSpec=aO,r.expression&&aa(ah(t))?ag(e):r.expression&&an(ad(t))?av(e):r.type&&a$[r.type]?a$[r.type](e):am(eH({},e,{valueSpec:r.type?a[r.type]:r}))}function aF(e){let t=e.value,r=e.key,a=aC(e);return a.length||(-1===t.indexOf("{fontstack}")&&a.push(new eV(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&a.push(new eV(r,t,'"glyphs" url must include a "{range}" token'))),a}function aj(e,t=eG){let r=[];return r=r.concat(aO({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:aO,objectElementValidators:{glyphs:aF,"*":()=>[]}})),e.constants&&(r=r.concat(ac({key:"constants",value:e.constants}))),aD(r)}function aN(e){return function(t){return e(Object.assign({},t,{validateSpec:aO}))}}function aD(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function aU(e){return function(...t){return aD(e.apply(this,t))}}function aB(e){if(!e)return{style:D.Gj[D.N0[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!0};if("string"==typeof e){let t=function(e){try{let t=JSON.parse(e),r=aj(t);return{isValidJSON:!0,isValidStyle:0===r.length,styleObject:0===r.length?t:null}}catch{return{isValidJSON:!1,isValidStyle:!1,styleObject:null}}}(e);return t.isValidStyle?{style:t.styleObject,requiresUrlMonitoring:!1,isFallback:!1}:t.isValidJSON?{style:D.Gj[D.N0[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!0}:e.startsWith("http")?{style:e,requiresUrlMonitoring:!0,isFallback:!1}:e.toLowerCase().includes(".json")?{style:function(e){try{return new URL(e).href}catch{}return new URL(e,location.origin).href}(e),requiresUrlMonitoring:!0,isFallback:!1}:{style:(0,D.ub)(e),requiresUrlMonitoring:!0,isFallback:!1}}return e instanceof D.Hu?{style:e.getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!1}:e instanceof D.rF?{style:e.getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!1}:0===aj(e).length?{style:e,requiresUrlMonitoring:!1,isFallback:!1,isJSON:!0}:{style:D.Gj[D.N0[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!0}}function aq(e,t,r){let a=window.document.createElement(e);return void 0!==t&&(a.className=t),r&&r.appendChild(a),a}function aG(e){e.parentNode&&e.parentNode.removeChild(e)}aj.source=aU(aN(a_)),aj.sprite=aU(aN(aI)),aj.glyphs=aU(aN(aF)),aj.light=aU(aN(aT)),aj.sky=aU(aN(aM)),aj.terrain=aU(aN(aP)),aj.state=aU(aN(aR)),aj.layer=aU(aN(aA)),aj.filter=aU(aN(aw)),aj.paintProperty=aU(aN(ak)),aj.layoutProperty=aU(aN(aL));class aV{constructor(){G(this,"_map"),G(this,"_container"),G(this,"_terrainButton"),function(e,t){for(let r of e)"function"==typeof t[r]&&(t[r]=t[r].bind(t))}(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(e){return this._map=e,this._container=aq("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=aq("button","maplibregl-ctrl-terrain",this._container),aq("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(){aG(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){aH(this._map),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.hasTerrain()?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))}}function aH(e){e.hasTerrain()?e.disableTerrain():e.enableTerrain()}class aW extends eo{constructor(e={}){super({showCompass:e.showCompass??!0,showZoom:e.showZoom??!0,visualizePitch:e.visualizePitch??!0}),G(this,"_rotateCompassArrow",()=>{let e=this._map.getBearing(),t=this._map.getPitch(),r=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.cos(Math.PI/180*t)**.5)}) rotateX(${Math.min(70,t)}deg) rotateZ(${-e}deg)`:`rotate(${-e}deg)`;this._compassIcon.style.transform=r}),this._compass&&(this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",e=>{0===this._map.getPitch()?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}))}_createButton(e,t){let r=super._createButton(e,t);return r.clickFunction=t,r}}
2let aZ=F.Marker,aK=F.LngLat,aJ=F.LngLatBounds;class aX extends el{constructor(){super(...arguments),G(this,"lastUpdatedCenter",new aK(0,0)),G(this,"_updateCamera",e=>{var t;let r=new aK(e.coords.longitude,e.coords.latitude),a=e.coords.accuracy,i={bearing:this._map.getBearing(),...this.options.fitBoundsOptions,linear:!0},n=this._map.getZoom();n>((null==(t=this.options.fitBoundsOptions)?void 0:t.maxZoom)??30)&&(i.zoom=n),this._map.fitBounds(aJ.fromLngLat(r,a),i,{geolocateSource:!0});let o=!1,l=()=>{o=!0};this._map.once("click",l),this._map.once("dblclick",l),this._map.once("dragstart",l),this._map.once("mousedown",l),this._map.once("touchstart",l),this._map.once("wheel",l),this._map.once("moveend",()=>{this._map.off("click",l),this._map.off("dblclick",l),this._map.off("dragstart",l),this._map.off("mousedown",l),this._map.off("touchstart",l),this._map.off("wheel",l),o||(this.lastUpdatedCenter=this._map.getCenter())})}),G(this,"_finishSetupUI",e=>{if(this._map){if(!1===e){let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{let e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=aq("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new aZ({element:this._dotElement}),this._circleElement=aq("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new aZ({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",e=>{let t=e.originalEvent&&"resize"===e.originalEvent.type,r=this.lastUpdatedCenter.distanceTo(this._map.getCenter());e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t||!(r>1)||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}}),G(this,"_onZoom",()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()})}_updateCircleRadius(){if("BACKGROUND"!==this._watchState&&"ACTIVE_LOCK"!==this._watchState)return;let e=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],t=this._map.project(e),r=this._map.unproject([t.x,t.y]),a=this._map.unproject([t.x+20,t.y]),i=r.distanceTo(a)/20,n=Math.ceil(2*this._accuracy/i);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_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":case"BACKGROUND_ERROR":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}}class aY{constructor(e,t,r){if(W(this,u),W(this,p),W(this,c),W(this,h),W(this,d),"string"==typeof e){const t=document.querySelector(e);if(!t)throw Error(`No element has been found with selector "${e}
2" when creating an external control.`);Z(this,p,t)}else Z(this,p,e);t&&Z(this,c,e=>{t(H(this,u),H(this,p),e)}),r&&Z(this,h,e=>{r(H(this,u),H(this,p),e)}),Z(this,d,H(this,p).parentElement)}onAdd(e){return Z(this,u,e),H(this,c)&&H(this,p).addEventListener("click",H(this,c)),H(this,h)&&H(this,u).on("render",H(this,h)),aG(H(this,p)),H(this,p)}onRemove(){H(this,c)&&H(this,p).removeEventListener("click",H(this,c)),H(this,h)&&H(this,u).off("render",H(this,h)),H(this,d)?H(this,d).appendChild(H(this,p)):aG(H(this,p))}}u=new WeakMap,p=new WeakMap,c=new WeakMap,h=new WeakMap,d=new WeakMap;class aQ{constructor(){G(this,"map"),G(this,"container"),G(this,"projectionButton")}onAdd(e){return this.map=e,this.container=aq("div","maplibregl-ctrl maplibregl-ctrl-group"),this.projectionButton=aq("button","maplibregl-ctrl-projection",this.container),aq("span","maplibregl-ctrl-icon",this.projectionButton).setAttribute("aria-hidden","true"),this.projectionButton.type="button",this.projectionButton.addEventListener("click",this.toggleProjection.bind(this)),e.on("projectiontransition",this.updateProjectionIcon.bind(this)),this.updateProjectionIcon(),this.container}onRemove(){aG(this.container),this.map.off("projectiontransition",this.updateProjectionIcon),this.map=void 0}toggleProjection(){a0(this.map),this.updateProjectionIcon()}updateProjectionIcon(){this.projectionButton.classList.remove("maplibregl-ctrl-projection-globe"),this.projectionButton.classList.remove("maplibregl-ctrl-projection-mercator"),this.map.isGlobeProjection()?(this.projectionButton.classList.add("maplibregl-ctrl-projection-mercator"),this.projectionButton.title="Enable Mercator projection"):(this.projectionButton.classList.add("maplibregl-ctrl-projection-globe"),this.projectionButton.title="Enable Globe projection")}}function a0(e){void 0===e.getProjection()&&e.setProjection({type:"mercator"}),e.isGlobeProjection()?e.setProjection("mercator",{persist:!0}):e.setProjection("globe",{persist:!0})}let a1={"zoom-in":e=>e.zoomIn(),"zoom-out":e=>e.zoomOut(),"toggle-projection":a0,"toggle-terrain":aH,"reset-view":e=>{0===e.getPitch()?e.easeTo({pitch:Math.min(e.getMaxPitch(),80)}):e.resetNorthPitch()},"reset-bearing":e=>{e.rotateTo(0)},"reset-pitch":e=>{e.setPitch(0)},"reset-roll":e=>{e.setRoll(0)}};class a2 extends aY{constructor(e,t){if(t&&!(t in a1))throw Error(`data-maptiler-control value "${t}" is invalid.`);super(e,t&&a1[t]),W(this,m),W(this,f,new Map)}onAdd(e){return Z(this,m,e),super.onAdd(e)}onRemove(){for(let[e,t]of H(this,f)){let r=e.deref();r&&r.removeEventListener("click",t)}H(this,f).clear(),super.onRemove()}configureGroupItem(e,t){if(!t)return;if(!(t in a1))throw Error(`data-maptiler-control value "${t}" is invalid.`);let r=r=>{a1[t](H(this,m),e,r)};e.addEventListener("click",r),H(this,f).set(new WeakRef(e),r)}}m=new WeakMap,f=new WeakMap,G(a2,"controlCallbacks",a1);class a5{constructor(e,t){W(this,S),W(this,y),G(this,"map"),W(this,g),W(this,v),W(this,b),W(this,x,!1),W(this,w),void 0!==e.style&&Z(this,x,!0),Z(this,y,{zoomAdjust:-4,position:"top-right",...t,forceNoAttributionControl:!0,navigationControl:!1,geolocateControl:!1,maptilerLogo:!1,minimap:!1,hash:!1,pitchAdjust:!1,...e,containerStyle:{border:"1px solid #000",width:"400px",height:"300px",...e.containerStyle??{}}}),void 0!==e.lockZoom&&(H(this,y).minZoom=e.lockZoom,H(this,y).maxZoom=e.lockZoom)}setStyle(e,t){H(this,x)||this.map.setStyle(e,t),K(this,S,L).call(this)}addLayer(e,t){return H(this,x)||this.map.addLayer(e,t),K(this,S,L).call(this),this.map}moveLayer(e,t){return H(this,x)||this.map.moveLayer(e,t),K(this,S,L).call(this),this.map}removeLayer(e){return H(this,x)||this.map.removeLayer(e),K(this,S,L).call(this),this}setLayerZoomRange(e,t,r){return H(this,x)||this.map.setLayerZoomRange(e,t,r),K(this,S,L).call(this),this}setFilter(e,t,r){return H(this,x)||this.map.setFilter(e,t,r),K(this,S,L).call(this),this}setPaintProperty(e,t,r,a){return H(this,x)||this.map.setPaintProperty(e,t,r,a),K(this,S,L).call(this),this}setLayoutProperty(e,t,r,a){return H(this,x)||this.map.setLayoutProperty(e,t,r,a),K(this,S,L).call(this),this}setGlyphs(e,t){return H(this,x)||this.map.setGlyphs(e,t),K(this,S,L).call(this),this}onAdd(e){for(let[t,r]of(Z(this,g,e),Z(this,v,aq("div","maplibregl-ctrl maplibregl-ctrl-group")),Object.entries(H(this,y).containerStyle)))H(this,v).style.setProperty(t,r);return H(this,y).container=H(this,v),H(this,y).zoom=e.getZoom()+H(this,y).zoomAdjust,this.map=new iV(H(this,y)),this.map.once("style.load",()=>{this.map.resize()}),this.map.once("load",()=>
2{K(this,S,k).call(this,H(this,y).parentRect),Z(this,w,K(this,S,A).call(this))}),H(this,v)}onRemove(){var e;null==(e=H(this,w))||e.call(this),aG(H(this,v))}}function a3(e,t,r){return e+(t-e)*r}y=new WeakMap,g=new WeakMap,v=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,S=new WeakSet,k=function(e){void 0===e||void 0===e.linePaint&&void 0===e.fillPaint||(Z(this,b,{type:"Feature",properties:{name:"parentRect"},geometry:{type:"Polygon",coordinates:[[[],[],[],[],[]]]}}),this.map.addSource("parentRect",{type:"geojson",data:H(this,b)}),(void 0!==e.lineLayout||void 0!==e.linePaint)&&this.map.addLayer({id:"parentRectOutline",type:"line",source:"parentRect",layout:{...e.lineLayout},paint:{"line-color":"#FFF","line-width":1,"line-opacity":.85,...e.linePaint}}),void 0!==e.fillPaint&&this.map.addLayer({id:"parentRectFill",type:"fill",source:"parentRect",layout:{},paint:{"fill-color":"#08F","fill-opacity":.135,...e.fillPaint}}),K(this,S,L).call(this))},L=function(){if(void 0===H(this,b))return;let{devicePixelRatio:e}=window,t=H(this,g).getCanvas(),r=t.width/e,a=t.height/e,i=H(this,g).unproject.bind(H(this,g)),n=i([0,0]),o=i([r,0]),l=i([0,a]),s=i([r,a]);H(this,b).geometry.coordinates=[[l.toArray(),s.toArray(),o.toArray(),n.toArray(),l.toArray()]];let u=this.map.getSource("parentRect");void 0!==u&&u.setData(H(this,b))},A=function(){let{pitchAdjust:e}=H(this,y),t=()=>{n("parent")},r=()=>{n("minimap")},a=()=>{H(this,g).on("move",t),this.map.on("move",r)},i=()=>{H(this,g).off("move",t),this.map.off("move",r)},n=t=>{i();let r="parent"===t?H(this,g):this.map,n="parent"===t?this.map:H(this,g),o=r.getCenter(),l=r.getZoom()+H(this,y).zoomAdjust*("parent"===t?1:-1),s=r.getBearing(),u=r.getPitch();n.jumpTo({center:o,zoom:l,bearing:s,pitch:e?u:0}),K(this,S,L).call(this),a()};return a(),()=>{i()}};let a4=F.LngLatBounds;function a8(e,t){return(e+180)/360*Math.pow(2,t)}function a6(e,t){let r=e*Math.PI/180;return(1-Math.log(Math.tan(r)+1/Math.cos(r))/Math.PI)/2*Math.pow(2,t)}function a9(e){return[e.z,e.x,e.y].join("/")}function a7(e){let t=new Set;return e.filter(e=>{let r=a9(e);return!t.has(r)&&(t.add(r),!0)})}class ie{constructor(e){G(this,"map"),G(this,"activeAbortControllers",new Map),this.map=e}abortAll(){for(let e of this.activeAbortControllers.values())e.abort();this.activeAbortControllers.clear()}async preloadForBounds({bounds:e,minZoom:t,maxZoom:r,onProgress:a,onError:i}
2){let n=a7(function(e,t,r){let a=a4.convert(e),i=a.getSouthWest(),n=a.getNorthEast(),o=[];for(let e=Math.floor(t);e<=Math.ceil(r);e++){let t=Math.pow(2,e),r=Math.floor(Math.min(a8(i.lng,e),a8(n.lng,e))),a=Math.floor(Math.max(a8(i.lng,e),a8(n.lng,e))),l=Math.floor(a6(i.lat,e)),s=Math.floor(a6(n.lat,e)),u=Math.min(l,s),p=Math.max(l,s);for(let i=r;i<=a;i++)for(let r=u;r<=p;r++){let a=(i%t+t)%t;r>=0&&r<t&&o.push({z:e,x:a,y:r})}}return o}(e,t,r));await this.fetchTiles(n,{onProgress:a,onError:i})}async preloadForCameraPositions({positions:e,onProgress:t,onError:r}){let{width:a,height:i}=this.map.transform,n=[];for(let t of e)n.push(...function(e,t,r){let a=Math.floor(e.zoom),i=Math.pow(2,a),n=a8(e.lng,a),o=a6(e.lat,a),l=t/256,s=r/256,u=(e.pitch??0)/90*s,p=Math.floor(n-l/2)-1,c=Math.ceil(n+l/2)+1,h=Math.floor(o-s/2-u)-1,d=Math.ceil(o+s/2)+1,m=[];for(let e=p;e<=c;e++)for(let t=h;t<=d;t++){let r=(e%i+i)%i;t>=0&&t<i&&m.push({z:a,x:r,y:t})}return m}(t,a,i));return await this.fetchTiles(a7(n),{onProgress:t,onError:r}),n}async preloadByTileIDs({tileIDs:e,onProgress:t,onError:r}){let a=[];for(let t of e){let e=function(e){let t=e.split("/");if(3!==t.length)return null;let[r,a,i]=t.map(Number);return isNaN(r)||isNaN(a)||isNaN(i)?null:{z:r,x:a,y:i}}(t);e&&a.push(e)}await this.fetchTiles(a,{onProgress:t,onError:r})}preloadForLinearPath({start:e,end:t,onProgress:r,onError:a}){let i=function(e,t,r){let a=[];for(let u=0;u<=r;u++){var i,n,o,l,s;let p=u/r;a.push({lng:(i=e.lng,i+(t.lng-i)*p),lat:(n=e.lat,n+(t.lat-n)*p),zoom:(o=e.zoom,o+(t.zoom-o)*p),pitch:(l=e.pitch??0,l+((t.pitch??0)-l)*p),bearing:(s=e.bearing??0,s+((t.bearing??0)-s)*p)})}return a}(e,t,eC.experimental_defaultPathSampleSteps);return this.preloadForCameraPositions({positions:i,onProgress:r,onError:a})}async fetchTiles(e,t){let r=function(e){let t=e.getStyle();if(!(null!=t&&t.sources))return{};let r={};for(let a of Object.keys(t.sources)){let t=e.getSource(a);t&&Array.isArray(t.tiles)&&t.tiles.length>0&&(r[a]=t)}return r}(this.map),a=(null==t?void 0:t.maxTiles)??512,i=[];for(let t of e)if(i.push(...function(e,t){let r=a9(t),a=[];for(let n of Object.values(e)){var i;let e=(i=n.tiles[0],i.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));a.push({url:e,tileID:r})}return a}(r,t)),i.length>=a)break;i.length>=a&&console.warn(`[MapTiler SDK] Tile preloading capped at ${a} tiles, the remaining ${i.length-a} tile preloads will be skipped. Increase the \`maxTiles\` option to load more.`);let n=i.length,o=0,l=new AbortController,s=(0,U.A)();this.activeAbortControllers.set(s,l);let u=Math.min(16,n),p=i.slice();try{await Promise.all(Array.from({length:u},async()=>{for(var e,r;;){let a=p.shift();if(!a)break;try{await eO(a.url,l.signal)}catch(r){null==(e=null==t?void 0:t.onError)||e.call(t,r)}finally{o++,null==(r=null==t?void 0:t.onProgress)||r.call(t,o,n,a.tileID)}}}))}finally{this.activeAbortControllers.delete(s)}}}class it{constructor(e,t=2e3){G(this,"map"),G(this,"registeredModules",new Set),G(this,"viewerType"),this.map=e,this.viewerType="Map",setTimeout(async()=>{if(!eC.telemetry)return;let e=this.preparePayload();try{(await fetch(e,{method:"POST"})).ok||console.warn("The metrics could not be sent to MapTiler Cloud")}catch(e){console.warn("The metrics could not be sent to MapTiler Cloud",e)}},Math.max(1e3,t))}registerModule(e,t){this.registeredModules.add(`${e}:${t}`)}registerViewerType(e="Map"){this.viewerType=e}preparePayload(){let e=new URL(ek.telemetryURL);return e.searchParams.append("sdk",op()),e.searchParams.append("key",eC.apiKey),e.searchParams.append("mtsid",eL),e.searchParams.append("session",eC.session?"1":"0"),e.searchParams.append("caching",eC.caching?"1":"0"),e.searchParams.append("lang-updated",this.map.isLanguageUpdated()?"1":"0"),e.searchParams.append("terrain",this.map.getTerrain()?"1":"0"),e.searchParams.append("globe",this.map.isGlobeProjection()?"1":"0"),e.searchParams.append("viewerType",this.viewerType),this.registeredModules.size>0&&e.searchParams.append("modules",Array.from(this.registeredModules).join("|")),e.href}}var ir="u">typeof Float32Array?Float32Array:Array;function ia(){var e=new ir(16);return ir!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function ii(e,t,r){var a=Math.sin(r),i=Math.cos(r),n=t[4],o=t[5],l=t[6],s=t[7],u=t[8],p=t[9],c=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=n*i+u*a,e[5]=o*i+p*a,e[6]=l*i+c*a,e[7]=s*i+h*a,e[8]=u*i-n*a,e[9]=p*i-o*a,e[10]=c*i-l*a,e[11]=h*i-s*a,e}function io(e,t,r){var a=Math.sin(r),i=Math.cos(r),n=t[0],o=t[1],l=t[2],s=t[3],u=t[4],p=t[5],c=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=n*i+u*a,e[1]=o*i+p*a,e[2]=l*i+c*a,e[3]=s*i+h*a,e[4]=u*i-n*a,e[5]=p*i-o*a,e[6]=c*i-l*a,e[7]=h*i-s*a,e}var il=function(e,t,r,a,i){var n=1/Math.tan(t/2);
2if(e[0]=n/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0){var o=1/(a-i);e[10]=(i+a)*o,e[14]=2*i*a*o}else e[10]=-1,e[14]=-2*a;return e};function is(){var e=new ir(3);return ir!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function iu(e,t){var r=t[0],a=t[1],i=t[2],n=r*r+a*a+i*i;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function ip(e,t,r){var a=t[0],i=t[1],n=t[2],o=r[0],l=r[1],s=r[2];return e[0]=i*s-n*l,e[1]=n*o-a*s,e[2]=a*l-i*o,e}function ic(){if(T)return _;T=1;let e=(E||(E=1,C={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]}),C),t={};for(let r of Object.keys(e))t[e[r]]=r;let r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};
2for(let e of(_=r,Object.keys(r))){if(!("channels"in r[e]))throw Error("missing channels property: "+e);if(!("labels"in r[e]))throw Error("missing channel labels property: "+e);if(r[e].labels.length!==r[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:a}=r[e];delete r[e].channels,delete r[e].labels,Object.defineProperty(r[e],"channels",{value:t}),Object.defineProperty(r[e],"labels",{value:a})}return r.rgb.hsl=function(e){let t,r=e[0]/255,a=e[1]/255,i=e[2]/255,n=Math.min(r,a,i),o=Math.max(r,a,i),l=o-n;o===n?t=0:r===o?t=(a-i)/l:a===o?t=2+(i-r)/l:i===o&&(t=4+(r-a)/l),(t=Math.min(60*t,360))<0&&(t+=360);let s=(n+o)/2;return[t,100*(o===n?0:s<=.5?l/(o+n):l/(2-o-n)),100*s]},r.rgb.hsv=function(e){let t,r,a,i,n,o=e[0]/255,l=e[1]/255,s=e[2]/255,u=Math.max(o,l,s),p=u-Math.min(o,l,s),c=function(e){return(u-e)/6/p+.5};return 0===p?(i=0,n=0):(n=p/u,t=c(o),r=c(l),a=c(s),o===u?i=a-r:l===u?i=1/3+t-a:s===u&&(i=2/3+r-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*n,100*u]},r.rgb.hwb=function(e){let t=e[0],a=e[1],i=e[2];return[r.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(a,i))*100,100*(i=1-1/255*Math.max(t,Math.max(a,i)))]},r.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,i=Math.min(1-t,1-r,1-a);return[100*((1-t-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*((1-a-i)/(1-i)||0),100*i]},r.rgb.keyword=function(r){let a=t[r];if(a)return a;let i=1/0,n;for(let t of Object.keys(e)){let a=e[t],o=(r[0]-a[0])**2+(r[1]-a[1])**2+(r[2]-a[2])**2;o<i&&(i=o,n=t)}return n},r.keyword.rgb=function(t){return e[t]},r.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255;return[100*(.4124*(t=t>.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(r=r>.04045?((r+.055)/1.055)**2.4:r/12.92)+.1805*(a=a>.04045?((a+.055)/1.055)**2.4:a/12.92)),100*(.2126*t+.7152*r+.0722*a),100*(.0193*t+.1192*r+.9505*a)]},r.rgb.lab=function(e){let t=r.rgb.xyz(e),a=t[0],i=t[1],n=t[2];return a/=95.047,i/=100,n/=108.883,[116*(i=i>.008856?i**(1/3):7.787*i+16/116)-16,500*((a=a>.008856?a**(1/3):7.787*a+16/116)-i),200*(i-(n=n>.008856?n**(1/3):7.787*n+16/116))]},r.hsl.rgb=function(e){let t,r,a,i=e[0]/360,n=e[1]/100,o=e[2]/100;if(0===n)return[a=255*o,a,a];t=o<.5?o*(1+n):o+n-o*n;let l=2*o-t,s=[0,0,0];for(let e=0;e<3;e++)(r=i+-(1/3*(e-1)))<0&&r++,r>1&&r--,a=6*r<1?l+(t-l)*6*r:2*r<1?t:3*r<2?l+(t-l)*(2/3-r)*6:l,s[e]=255*a;return s},r.hsl.hsv=function(e){let t=e[0],r=e[1]/100,a=e[2]/100,i=r,n=Math.max(a,.01);a*=2,r*=a<=1?a:2-a,i*=n<=1?n:2-n;let o=(a+r)/2;return[t,100*(0===a?2*i/(n+i):2*r/(a+r)),100*o]},r.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,a=e[2]/100,i=Math.floor(t)%6,n=t-Math.floor(t),o=255*a*(1-r),l=255*a*(1-r*n),s=255*a*(1-r*(1-n));switch(a*=255,i){case 0:return[a,s,o];case 1:return[l,a,o];case 2:return[o,a,s];case 3:return[o,l,a];case 4:return[s,o,a];case 5:return[a,o,l]}},r.hsv.hsl=function(e){let t,r,a=e[0],i=e[1]/100,n=e[2]/100,o=Math.max(n,.01);r=(2-i)*n;let l=(2-i)*o;return[a,100*(t=(t=i*o/(l<=1?l:2-l))||0),100*(r/=2)]},r.hwb.rgb=function(e){let t,r,a,i,n=e[0]/360,o=e[1]/100,l=e[2]/100,s=o+l;s>1&&(o/=s,l/=s);let u=Math.floor(6*n),p=1-l;t=6*n-u,(1&u)!=0&&(t=1-t);let c=o+t*(p-o);switch(u){default:case 6:case 0:r=p,a=c,i=o;break;case 1:r=c,a=p,i=o;break;case 2:r=o,a=p,i=c;break;case 3:r=o,a=c,i=p;break;case 4:r=c,a=o,i=p;break;case 5:r=p,a=o,i=c}return[255*r,255*a,255*i]},r.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,a=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,a*(1-i)+i))]},r.xyz.rgb=function(e){let t,r,a,i=e[0]/100,n=e[1]/100,o=e[2]/100;return t=(t=3.2406*i+-1.5372*n+-.4986*o)>.0031308?1.055*t**(1/2.4)-.055:12.92*t,r=(r=-.9689*i+1.8758*n+.0415*o)>.0031308?1.055*r**(1/2.4)-.055:12.92*r,a=(a=.0557*i+-.204*n+1.057*o)>.0031308?1.055*a**(1/2.4)-.055:12.92*a,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(a=Math.min(Math.max(0,a),1))]},r.xyz.lab=function(e){let t=e[0],r=e[1],a=e[2];return t/=95.047,r/=100,a/=108.883,[116*(r=r>.008856?r**(1/3):7.787*r+16/116)-16,500*((t=t>.008856?t**(1/3):7.787*t+16/116)-r),200*(r-(a=a>.008856?a**(1/3):7.787*a+16/116))]},r.lab.xyz=function(e){let t,r,a,i=e[0],n=e[1],o=e[2];t=n/500+(r=(i+16)/116),a=r-o/200;let l=r**3,s=t**3,u=a**3;return r=(l>.008856?l:(r-16/116)/7.787)*100,[t=(s>.008856?s:(t-16/116)/7.787)*95.047,r,a=(u>.008856?u:(a-16/116)/7.787)*108.883]},r.lab.lch=function(e){let t,r=e[0],a=e[1],i=e[2];return(t=360*Math.atan2(i,a)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(a*a+i*i),t]},r.lch.lab=function(e){let t=e[0],r=e[1],a=e[2]/360*2*Math.PI;return[t,r*Math.cos(a),r*Math.sin(a)]},r.rgb.ansi16=function(e,t=null){let[a,i,n]=e,o=null===t?r.rgb.hsv(e)[2]:t;if(0===(o=Math.round(o/50)))return 30;let l=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(a/255));return 2===o&&(l+=60),l},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){let t=e[0],r=e[1],a=e[2];return t===r&&r===a?t<8?16:t>
2248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];let r=(~~(e>50)+1)*.5;return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},r.ansi256.rgb=function(e){let t;if(e>=232){let t=(e-232)*10+8;return[t,t,t]}return[Math.floor((e-=16)/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},r.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map(e=>e+e).join(""));let a=parseInt(r,16);return[a>>16&255,a>>8&255,255&a]},r.rgb.hcg=function(e){let t,r=e[0]/255,a=e[1]/255,i=e[2]/255,n=Math.max(Math.max(r,a),i),o=Math.min(Math.min(r,a),i),l=n-o;return t=l<1?o/(1-l):0,[360*((l<=0?0:n===r?(a-i)/l%6:n===a?2+(i-r)/l:4+(r-a)/l)/6%1),100*l,100*t]},r.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=r<.5?2*t*r:2*t*(1-r),i=0;return a<1&&(i=(r-.5*a)/(1-a)),[e[0],100*a,100*i]},r.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=t*r,i=0;return a<1&&(i=(r-a)/(1-a)),[e[0],100*a,100*i]},r.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100;if(0===r)return[255*a,255*a,255*a];let i=[0,0,0],n=t%1*6,o=n%1,l=1-o,s=0;switch(Math.floor(n)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=l,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=l,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=l}return s=(1-r)*a,[(r*i[0]+s)*255,(r*i[1]+s)*255,(r*i[2]+s)*255]},r.hcg.hsv=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t),a=0;return r>0&&(a=t/r),[e[0],100*a,100*r]},r.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[e[0],100*a,100*r]},r.hcg.hwb=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],(r-t)*100,(1-r)*100]},r.hwb.hcg=function(e){let t=e[1]/100,r=1-e[2]/100,a=r-t,i=0;return a<1&&(i=(r-a)/(1-a)),[e[0],100*a,100*i]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=function(e){return[0,0,e[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},_}is();let ih=(s=function(){if(z)return I;z=1;let e=ic(),t=function(){if(P)return M;P=1;let e=ic();return M=function(t){let r=function(t){let r=function(){let t={},r=Object.keys(e);for(let e=r.length,a=0;a<e;a++)t[r[a]]={distance:-1,parent:null};return t}(),a=[t];for(r[t].distance=0;a.length;){let t=a.pop(),i=Object.keys(e[t]);for(let e=i.length,n=0;n<e;n++){let e=i[n],o=r[e];-1===o.distance&&(o.distance=r[t].distance+1,o.parent=t,a.unshift(e))}}return r}(t),a={},i=Object.keys(r);for(let t=i.length,n=0;n<t;n++){let t=i[n];null!==r[t].parent&&(a[t]=function(t,r){let a=[r[t].parent,t],i=e[r[t].parent][t],n=r[t].parent;for(;r[n].parent;)a.unshift(r[n].parent),i=function(e,t){return function(r){return t(e(r))}}(e[r[n].parent][n],i),n=r[n].parent;return i.conversion=a,i}(t,r))}return a}}(),r={};return Object.keys(e).forEach(a=>{r[a]={},Object.defineProperty(r[a],"channels",{value:e[a].channels}),Object.defineProperty(r[a],"labels",{value:e[a].labels});let i=t(a);
2Object.keys(i).forEach(e=>{let t,n,o=i[e];r[a][e]=(t=function(...e){let t=e[0];if(null==t)return t;t.length>1&&(e=t);let r=o(e);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r},"conversion"in o&&(t.conversion=o.conversion),t),r[a][e].raw=(n=function(...e){let t=e[0];return null==t?t:(t.length>1&&(e=t),o(e))},"conversion"in o&&(n.conversion=o.conversion),n)})}),I=r}())&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s;function id({gl:e,type:t,source:r}){let a=e.createShader(t);if(null===a)throw Error("Cannot create shader");if(e.shaderSource(a,r),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS))throw console.error("Shader compilation error:",e.getShaderInfoLog(a)),e.deleteShader(a),Error("Cannot compile shader");return a}function im({gl:e,vertexShaderSource:t,fragmentShaderSource:r,attributesKeys:a,uniformsKeys:i,vertices:n,indices:o}){let l,s,u=function({gl:e,vertexShaderSource:t,fragmentShaderSource:r}){let a=id({gl:e,type:e.VERTEX_SHADER,source:t}),i=id({gl:e,type:e.FRAGMENT_SHADER,source:r}),n=e.createProgram();if(e.attachShader(n,a),e.attachShader(n,i),e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS))throw console.error("Error: ",e.getProgramInfoLog(n)),Error("Cannot link shader program");return n}({gl:e,vertexShaderSource:t,fragmentShaderSource:r}),p=a.reduce((t,r)=>(t[r]=e.getAttribLocation(u,`a_${r}`),t),{}),c=i.reduce((t,r)=>(t[r]=function(e,t,r){let a=e.getUniformLocation(t,r);if(null===a)throw Error(`Cannot get uniform location for ${r}`);return a}(e,u,`u_${r}`),t),{}),h=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,h),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW),void 0!==o&&(l=e.createBuffer(),s=o.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l),e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array(o),e.STATIC_DRAW)),{shaderProgram:u,programInfo:{attributesLocations:p,uniformsLocations:c},positionBuffer:h,indexBuffer:l,indexBufferLength:s}}function iy(e){if(!e||"transparent"===e)return[1,1,1,0];try{var t;let r=(t=e,(i=i??document.createElement("canvas").getContext("2d"))?(i.fillStyle=t,i.fillStyle):"#000000"),a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(r);if(null!=a&&a.length){let e=!!a[4];return[...ih.hex.rgb(r).map(e=>e/255),e?parseInt(a[4],16)/255:1]}let n=r.match(/(\d\.\d(\d+)?|\d{3}|\d{2}|\d{1})/gi)??["0","0","0"];if(r.includes("rgb")){let e=r.includes("rgba"),t=[...n.map(e=>parseFloat(e)).map((e,t)=>t<3?e/255:e)];return e||t.push(1),t}}catch{}return console.warn([`[parseColorStringToVec4]: Color ${e} is either not a valid color or its type is not supported, defaulting to black`]),[0,0,0,1]}let ig=[-.5,-.5,.5,.5,-.5,.5,.5,.5,.5,-.5,.5,.5,-.5,-.5,-.5,-.5,.5,-.5,.5,.5,-.5,.5,-.5,-.5,-.5,.5,-.5,-.5,.5,.5,.5,.5,.5,.5,.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5,-.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,.5,.5,-.5,.5,-.5],iv=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],ib=`attribute vec3 a_vertexPosition; 3varying vec3 vTextureCoord; 4 5uniform mat4 u_projectionMatrix; 6uniform mat4 u_modelViewMatrix; 7 8void main(void) { 9 vTextureCoord = vec3(-a_vertexPosition.x, a_vertexPosition.y, a_vertexPosition.z); 10 gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(a_vertexPosition, 1.0
10); 11} 12`,ix=`precision mediump float; 13 14varying vec3 vTextureCoord; 15 16%USE_TEXTURE_MACRO_MARKER% 17 18# ifdef USE_TEXTURE 19uniform samplerCube u_cubeSampler; 20uniform float u_fadeOpacity; 21# endif 22 23uniform vec4 u_bgColor; 24 25void main(void) { 26 #ifdef USE_TEXTURE 27 vec4 texColor = textureCube(u_cubeSampler, vTextureCoord); 28 29 gl_FragColor = mix( 30 u_bgColor, 31 texColor, 32 min(texColor.a, u_fadeOpacity) 33 ); 34 35 gl_FragColor.a = max(gl_FragColor.a, u_fadeOpacity); 36 37 #else 38 gl_FragColor = u_bgColor; 39 #endif 40} 41`;var iw=((o=iw||{}).UNIVERSE_DARK="universe-dark",o);let iS={stars:{color:"hsl(233,100%,92%)",preset:"stars"},space:{color:"hsl(210, 100%, 4%)",preset:"space"},milkyway:{color:"hsl(233,100%,92%)",preset:"milkyway"},"milkyway-subtle":{color:"hsl(233,100%,92%)",preset:"milkyway-subtle"},"milkyway-bright":{color:"hsl(233,100%,92%)",preset:"milkyway-bright"},"milkyway-colored":{color:"black",preset:"milkyway-colored"}};var ik=((l=ik||{}).POSITIVE_X="pX",l.NEGATIVE_X="nX",l.POSITIVE_Y="pY",l.NEGATIVE_Y="nY",l.POSITIVE_Z="pZ",l.NEGATIVE_Z="nZ",l);let iL=new Map,iA=new Map;function iC(e){return e?Object.fromEntries(Object.keys(e).sort().map(t=>[t,e[t]])):{}}let iE="https://api.maptiler.com/resources/space",i_=["vertexPosition"],iT=["projectionMatrix","modelViewMatrix","cubeSampler","bgColor","fadeOpacity"],iM="%USE_TEXTURE_MACRO_MARKER%",iP=iS.stars;class iI{constructor(e){G(this,"id","Cubemap Layer"),G(this,"type","custom"),G(this,"renderingMode","3d"),G(this,"map"),G(this,"faces"),G(this,"useCubemapTexture",!0),G(this,"currentFadeOpacity",0),G(this,"cubeMapNeedsUpdate",!1),G(this,"bgColor"),G(this,"previousBgColor",[0,0,0,0]),G(this,"targetBgColor",[0,0,0,0]),G(this,"transitionDelta",0),G(this,"gl"),G(this,"cubemap"),G(this,"texture"),G(this,"currentFacesDefinitionKey",""),G(this,"options"),G(this,"animationActive",!0),G(this,"imageIsAnimating",!1),G(this,"imageFadeInDelta",0);const t=iz(e);if(t.length>0)throw Error(`[CubemapLayer]: Invalid cubemap specification: 42- ${t.join(` 43 - `)}`);const r=function(e,t){if(!iz(e))return{color:"transparent"};if(!0===e)return t;let r={...e};if(e.faces||e.path)return delete r.preset,r;let a=e.preset;if(void 0!==a&&!(a in iS))throw Error(`[CubemapLayer]: Invalid preset "${a}". Available presets: ${Object.keys(iS).join(", ")}`);return{...r,color:r.color??iS[a].color??"hsl(233,100%,92%)"}}(e,iP);this.options=r,this.currentFacesDefinitionKey=JSON.stringify(r.faces??r.preset??r.path),this.bgColor=[0,0,0,0],this.targetBgColor=iy(r.color),this.faces=iR(r),this.useCubemapTexture=null!==this.faces}updateCubemap({facesNeedUpdate:e}={facesNeedUpdate:!0}){this.useCubemapTexture=null!==this.faces;let t=iT.filter(e=>"cubeSampler"!==e&&"fadeOpacity"!==e||this.useCubemapTexture);this.cubemap=im({gl:this.gl,vertexShaderSource:ib,fragmentShaderSource:this.useCubemapTexture?ix.replace(iM,"#define USE_TEXTURE"):ix.replace(iM,""),attributesKeys:i_,uniformsKeys:t,vertices:ig,indices:iv}),this.cubeMapNeedsUpdate=e,this.useCubemapTexture&&this.updateTexture(this.gl,this.faces),this.animateColorChange()}onAdd(e,t){this.map=e,this.gl=t,this.updateCubemap()}onRemove(e,t){let r;this.cubemap&&(this.texture&&((r=iL.get(t))&&(iL.delete(t),t.deleteTexture(r)),this.texture=void 0),t.deleteProgram(this.cubemap.shaderProgram),t.deleteBuffer(this.cubemap.positionBuffer))}updateTexture(e,t){!0===this.cubeMapNeedsUpdate&&!this.imageIsAnimating&&(this.cubeMapNeedsUpdate=!1,this.useCubemapTexture&&function({gl:e,faces:t,onReady:r,forceRefresh:a}){if(iL.get(e)&&!a&&n===JSON.stringify(t))return r(iL.get(e),iA.get(e));n=JSON.stringify(t);let i=iL.get(e)??e.createTexture();if(e.bindTexture(e.TEXTURE_CUBE_MAP,i),!t)return console.warn("[CubemapLayer][loadCubemapTexture]: Faces are null");let o=Object.keys(t).length;6!==o?console.warn(`[CubemapLayer][loadCubemapTexture]: Faces should contain exactly 6 images, but found ${o}`):Promise.all(Object.entries(t).map(([e,t])=>new Promise((r,a)=>{if(void 0===t)return void a(Error(`[CubemapLayer][loadCubemapTexture]: Face ${e} is undefined`));let i=new Image;i.crossOrigin="anonymous";let n=()=>{r({image:i,key:e})};
43i.src=t,i.complete&&i.naturalWidth>0?n():i.onload=n,i.onerror=()=>{a(Error(`[CubemapLayer][loadCubemapTexture]: Error loading image ${t}`))}}))).then(t=>{for(let r=0;r<t.length;r++){let a=e.RGBA,n=e.RGBA,o=e.UNSIGNED_BYTE,{image:l,key:s}=t[r]??{};if(!l||!s){console.warn("[CubemapLayer][loadCubemapTexture]: Image or key is null");continue}let u=function(e,t){if(t===ik.POSITIVE_X)return e.TEXTURE_CUBE_MAP_POSITIVE_X;if(t===ik.NEGATIVE_X)return e.TEXTURE_CUBE_MAP_NEGATIVE_X;if(t===ik.POSITIVE_Y)return e.TEXTURE_CUBE_MAP_POSITIVE_Y;if(t===ik.NEGATIVE_Y)return e.TEXTURE_CUBE_MAP_NEGATIVE_Y;if(t===ik.POSITIVE_Z)return e.TEXTURE_CUBE_MAP_POSITIVE_Z;if(t===ik.NEGATIVE_Z)return e.TEXTURE_CUBE_MAP_NEGATIVE_Z;throw Error(`[CubemapLayer][loadCubemapTexture]: Invalid key ${t}`)}(e,s);e.bindTexture(e.TEXTURE_CUBE_MAP,i),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(u,0,a,n,o,l)}e.bindTexture(e.TEXTURE_CUBE_MAP,i),e.generateMipmap(e.TEXTURE_CUBE_MAP),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR);let a=t.map(e=>e.image);r(i,a),iA.set(e,a),iL.set(e,i)}).catch(e=>{console.error("[CubemapLayer][loadCubemapTexture]: Error loading cubemap texture",e)})}({gl:e,faces:t,onReady:e=>{this.texture=e,this.animateIn()}}))}prerender(e,t){this.faces&&this.updateTexture(this.gl,this.faces)}animateColorChange(){let e=()=>{var t,r,a,i,n,o,l,s,u,p,c;this.transitionDelta<1&&(requestAnimationFrame(e),this.bgColor=(t=this.previousBgColor,r=this.targetBgColor,a=this.transitionDelta,[(i=t[0],n=r[0],i+(n-i)*a),(o=t[1],l=r[1],o+(l-o)*a),(s=t[2],u=r[2],s+(u-s)*a),(p=t[3],c=r[3],p+(c-p)*a)]),this.transitionDelta+=.075,this.map.triggerRepaint())};requestAnimationFrame(e)}async animateIn(){if(!this.imageIsAnimating){if(!this.animationActive){this.currentFadeOpacity=1,this.imageFadeInDelta=1,this.map.triggerRepaint();return}return new Promise(e=>{this.imageIsAnimating=!0;let t=()=>{(this.imageFadeInDelta=Math.min(this.imageFadeInDelta+.05,1),this.currentFadeOpacity=0+ +this.imageFadeInDelta,this.map.triggerRepaint(),this.imageFadeInDelta<1)?requestAnimationFrame(t):(this.imageIsAnimating=!1,this.imageFadeInDelta=0,e())};requestAnimationFrame(t)})}}async animateOut(){if(!(this.imageIsAnimating||!this.animationActive))return new Promise(e=>{let t=()=>{if(this.imageFadeInDelta=Math.min(this.imageFadeInDelta+.05,1),this.currentFadeOpacity=1+-1*this.imageFadeInDelta,this.map.triggerRepaint(),this.imageFadeInDelta>=1){this.imageIsAnimating=!1,this.imageFadeInDelta=0,e();return}requestAnimationFrame(t)};requestAnimationFrame(t)})}setAnimationActive(e){this.animationActive=e}render(e,t){var r,a,i,n,o,l,s,u,p,c,h;if(!this.map.isGlobeProjection())return;if(void 0===this.map)throw Error("[CubemapLayer]: Map is undefined");if(void 0===this.cubemap)throw Error("[CubemapLayer]: Cubemap is undefined");this.texture,e.disable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.DST_ALPHA),e.useProgram(this.cubemap.shaderProgram),e.bindBuffer(e.ARRAY_BUFFER,this.cubemap.positionBuffer),e.vertexAttribPointer(this.cubemap.programInfo.attributesLocations.vertexPosition,3,e.FLOAT,!1,0,0),e.enableVertexAttribArray(this.cubemap.programInfo.attributesLocations.vertexPosition);let d=e.canvas,m=d.clientWidth/d.clientHeight,f=this.map.transform,y=f.fov*(Math.PI/180),g=ia();il(g,y,m,.1,1e4),io(g,g,f.rollInRadians),ii(g,g,-f.pitchInRadians),io(g,g,f.bearingInRadians);let v=f.center.lat*Math.PI/180,b=f.center.lng*Math.PI/180;ii(g,g,v),a=Math.sin(r=-b),i=Math.cos(r),n=g[0],o=g[1],l=g[2],s=g[3],u=g[8],p=g[9],c=g[10],h=g[11],g!=g&&(g[4]=g[4],g[5]=g[5],g[6]=g[6],g[7]=g[7],g[12]=g[12],g[13]=g[13],g[14]=g[14],g[15]=g[15]),g[0]=n*i-u*a,g[1]=o*i-p*a,g[2]=l*i-c*a,g[3]=s*i-h*a,g[8]=n*a+u*i,g[9]=o*a+p*i,g[10]=l*a+c*i,g[11]=s*a+h*i,e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.projectionMatrix,!1,g);let x=ia();if(e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.modelViewMatrix,!1,x),e.uniform4fv(this.cubemap.programInfo.uniformsLocations.bgColor,new Float32Array(this.bgColor)),e.uniform1f(this.cubemap.programInfo.uniformsLocations.fadeOpacity,this.currentFadeOpacity),this.useCubemapTexture&&this.texture&&(e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_CUBE_MAP,this.texture),e.uniform1i(this.cubemap.programInfo.uniformsLocations.cubeSampler,0)),void 0===this.cubemap.indexBuffer)throw Error("Index buffer is undefined");if(void 0===this.cubemap.indexBufferLength)throw Error("Index buffer length is undefined");e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.cubemap.indexBuffer),e.drawElements(e.TRIANGLES,this.cubemap.indexBufferLength,e.UNSIGNED_SHORT,0)}setBgColor(e){this.targetBgColor=e,this.previousBgColor=this.bgColor,this.transitionDelta=0}getConfig(){return this.options}shouldUpdate(e){let t=this.getConfig();if(void 0===e&&t)return!0;let r="boolean"==typeof e?e:iC(e),a=iC(t);return JSON.stringify(r)!==JSON.stringify(a)}async setCubemapFaces(e){if(await this.animateOut(),!e.faces&&!e.preset&&!e.path){this.faces=null,this.useCubemapTexture=!1,this.currentFacesDefinitionKey="empty",await this.animateIn();return}this.faces=iR(e),this.currentFacesDefinitionKey=JSON.stringify(e.faces??e.preset??e.path)}async setCubemap(e){let t=iz(e);if(t.length>0)throw Error(`[CubemapLayer]: Invalid cubemap specification: 44- ${t.join(` 45 - `)}`);let r="boolean"==typeof e?iP:e;this.options=r;let a=JSON.stringify(r.faces??r.preset??r.path),i=this.currentFacesDefinitionKey!==a;i&&(await this.setCubemapFaces(r),this.cubeMapNeedsUpdate=!0);let n=iy(r.color);if(r.color&&this.targetBgColor.toString()!==n.toString())this.setBgColor(n);else if(!r.color&&r.preset&&r.preset in iS){let e=iS[r.preset];this.setBgColor(iy(e.color))}this.updateCubemap({facesNeedUpdate:i})}
45show(){this.map.setLayoutProperty(this.id,"visibility","visible")}hide(){this.map.setLayoutProperty(this.id,"visibility","none")}}function iz(e){let t=[];if(typeof e>"u")return t.push("Space specification is undefined."),t;if("boolean"==typeof e)return[];if(0===Object.keys(e).length)return t.push("Space specification is an empty object."),t;let r=["color","preset","path","faces"],a=Object.keys(e).filter(e=>!r.includes(e));if(a.length>0)return t.push(`Space specification contains unsupported properties: ${a.map(e=>`\`${e}\``).join(", ")}. Supported properties: \`color\`, \`preset\`, \`path\`, \`faces\`.`),t;if(!e.path&&!e.preset&&!e.faces&&!e.color)return t.push("Space specification contains neither a path, preset, faces, nor color."),t;!e.preset||e.preset in iS||t.push(`Space preset "${e.preset}" is not a valid preset. Available presets: ${Object.keys(iS).join(", ")}`);let i=Object.keys(e).filter(e=>"color"!==e).filter(e=>"preset"===e||"path"===e||"faces"===e);return i.length>1&&t.push(`Space specification contains multiple properties for cubemap definition: ${i.join(", ")}. Only one of \`path\`, \`preset\`, or \`faces\` should be defined.`),!e.faces||e.faces.pX&&e.faces.nX&&e.faces.pY&&e.faces.nY&&e.faces.pZ&&e.faces.nZ||t.push("Space specification contains faces but one or more of the faces are undefined."),e.faces&&Object.values(e.faces).every(e=>"string"!=typeof e)&&t.push("Space specification contains faces but one or more of the faces are not strings."),t}function iR(e){if(e.faces)return e.faces;if(e.preset)return{pX:`${iE}/${e.preset}/px.webp`,nX:`${iE}/${e.preset}/nx.webp`,pY:`${iE}/${e.preset}/py.webp`,nY:`${iE}/${e.preset}/ny.webp`,pZ:`${iE}/${e.preset}/pz.webp`,nZ:`${iE}/${e.preset}/nz.webp`};if(e.path){let t=e.path.baseUrl,r=e.path.format??"png";return{pX:`${t}/px.${r}`,nX:`${t}/nx.${r}`,pY:`${t}/py.${r}`,nY:`${t}/ny.${r}`,pZ:`${t}/pz.${r}`,nZ:`${t}/nz.${r}`}}return null}let i$=`attribute vec3 a_position; 46 47uniform mat4 u_matrix; 48uniform mat4 u_rotationMatrix; 49 50uniform float u_scale; 51 52varying vec2 v_pos; 53varying float v_scale; 54 55void main() { 56 v_scale = u_scale; 57 v_pos = a_position.xy * u_scale; 58 gl_Position = u_matrix * u_rotationMatrix * vec4(a_position, 1.0); 59} 60`,iO=`precision mediump float; 61varying vec2 v_pos; 62 63uniform int u_stopsNumber; 64uniform float u_stops[100]; 65uniform vec4 u_colors[100]; 66uniform float u_maxDistance; 67 68varying float v_scale; 69 70const float EPSILON = 0.000001; 71 72vec2 center = vec2(0.0, 0.0); 73void main() { 74 float rawDistance = distance(center, v_pos); 75 float distanceFromGlobeEdge = rawDistance - 1.0; 76 77 vec4 color = u_colors[0]; 78 79 // if we're further than the max distance, we should not render anything. 80 // This is to always render a circle, otherwise we end up rendering 81 // to the corners of the plane. 82 if (distance(center, v_pos) > u_maxDistance * v_scale) { 83 discard; 84 } 85 86 for (int i = 1; i < 100; i++) { 87 // if we're past the last stop 88 // we should fill to the end with the last stop color 89 if (i >= u_stopsNumber) { 90 color = u_colors[i - 1]; 91 break; 92 } 93 94 float scaledStopPosition = u_stops[i] * pow(v_scale, 1.6); 95 float lastStopValue = u_stops[i - 1]; 96 float thisStopValue = u_stops[i]; 97 98 // this is to avoid blending errors when the stops are the same 99 // eg when you would want a sharp edge between two stops. 100 // \`numbersAreEqual\` will be 1.0 if the numbers are equal, 0.0 if they are not. 101 // We then subtract EPSILON from the last stop making the stop value _almost_ equal 102 // to the next stop but not enough to cause blending issues. 103 // It's more efficient to do this than an if / else statement. 104 float numbersAreEqual = 1.0 - step(EPSILON, abs(lastStopValue - thisStopValue)); 105 lastStopValue = lastStopValue - numbersAreEqual * EPSILON; 106 107 float lastScaledStopPosition = lastStopValue * pow(v_scale, 1.6); 108 109 if (distanceFromGlobeEdge <= scaledStopPosition) { 110 float stopBlendFactor = (distanceFromGlobeEdge - lastScaledStopPosition) / (scaledStopPosition - lastScaledStopPosition); 111 color = mix(u_colors[i - 1], u_colors[i], stopBlendFactor); 112 break; 113 } 114 } 115 116 // gl_FragColor = color;
117 gl_FragColor = vec4(color.rgb * color.a, color.a); 118} 119`,iF=["position"],ij=["matrix","rotationMatrix","stopsNumber","stops","colors","maxDistance","scale"],iN=[-2,-2,0,2,-2,0,-2,2,0,2,2,0],iD=[[0,"rgba(176, 208, 240, 1)"],[.1,"rgba(98, 168, 229, 0.3)"],[.2,"rgba(98, 168, 229, 0.0)"]];class iU{constructor(e){if(G(this,"id","Halo Layer"),G(this,"type","custom"),G(this,"renderingMode","3d"),G(this,"gradient"),G(this,"scale",0),G(this,"animationDelta",0),G(this,"map"),G(this,"plane"),G(this,"animationActive",!0),"boolean"==typeof e){this.gradient={scale:.9,stops:iD};return}const t=iq(e);if(t.length>0)throw Error(`[RadialGradientLayer]: Invalid Halo specification: 120 - ${t.join(` 121 - `)} 122 `);this.gradient={scale:e.scale??.9,stops:e.stops??iD}}onAdd(e,t){this.map=e,this.plane=im({gl:t,vertexShaderSource:i$,fragmentShaderSource:iO,attributesKeys:iF,uniformsKeys:ij,vertices:iN}),this.animateIn()}getConfig(){return this.gradient}shouldUpdate(e){let t=this.getConfig();if(void 0===e&&t)return!0;let r="boolean"==typeof e?e:iC(e),a=iC(t);return JSON.stringify(r)!==JSON.stringify(a)}async animateIn(){if(!this.animationActive){this.scale=this.gradient.scale,this.animationDelta=1,this.map.triggerRepaint();return}return new Promise(e=>{this.animationDelta=0;let t=()=>{if(this.animationDelta<=1){this.scale=0+(this.gradient.scale-0)*this.animationDelta,this.animationDelta+=.06,this.map.triggerRepaint(),requestAnimationFrame(t);return}e()};requestAnimationFrame(t)})}async animateOut(){if(this.animationActive)return this.animationDelta=0,new Promise(e=>{let t=()=>{if(this.animationDelta<1){var r;this.scale=(r=this.gradient.scale)+(0-r)*this.animationDelta,this.animationDelta+=.06,this.map.triggerRepaint(),requestAnimationFrame(t);return}e()};t()})}onRemove(e,t){void 0!==this.plane&&(t.deleteProgram(this.plane.shaderProgram),t.deleteBuffer(this.plane.positionBuffer))}prerender(e,t){}render(e,t){var r,a,i,n,o,l,s,u,p,c,h,d,m,f,y,g,v,b,x,w,S,k,L,A,C,E,_,T,M,P,I,z,R,$,O;if(void 0===this.map)throw Error("[RadialGradientLayer]: Map is undefined");if(!this.map.isGlobeProjection())return;if(void 0===this.plane)throw Error("[RadialGradientLayer]: Plane is undefined");e.disable(e.DEPTH_TEST),e.enable(e.BLEND),e.useProgram(this.plane.shaderProgram),e.bindBuffer(e.ARRAY_BUFFER,this.plane.positionBuffer);let F=this.plane.programInfo.attributesLocations.position;e.enableVertexAttribArray(F),e.vertexAttribPointer(F,3,e.FLOAT,!1,0,0);let j=ia(),N=this.scale;a=(r=[N,N,N])[0],i=r[1],n=r[2],j[0]=j[0]*a,j[1]=j[1]*a,j[2]=j[2]*a,j[3]=j[3]*a,j[4]=j[4]*i,j[5]=j[5]*i,j[6]=j[6]*i,j[7]=j[7]*i,j[8]=j[8]*n,j[9]=j[9]*n,j[10]=j[10]*n,j[11]=j[11]*n,j[12]=j[12],j[13]=j[13],j[14]=j[14],j[15]=j[15];let D=ia();o=t.defaultProjectionData.mainMatrix,l=o[0],s=o[1],u=o[2],p=o[3],c=o[4],h=o[5],d=o[6],m=o[7],f=o[8],y=o[9],g=o[10],v=o[11],b=o[12],x=o[13],w=o[14],S=o[15],k=j[0],L=j[1],A=j[2],C=j[3],D[0]=k*l+L*c+A*f+C*b,D[1]=k*s+L*h+A*y+C*x,D[2]=k*u+L*d+A*g+C*w,D[3]=k*p+L*m+A*v+C*S,k=j[4],L=j[5],A=j[6],C=j[7],D[4]=k*l+L*c+A*f+C*b,D[5]=k*s+L*h+A*y+C*x,D[6]=k*u+L*d+A*g+C*w,D[7]=k*p+L*m+A*v+C*S,k=j[8],L=j[9],A=j[10],C=j[11],D[8]=k*l+L*c+A*f+C*b,D[9]=k*s+L*h+A*y+C*x,D[10]=k*u+L*d+A*g+C*w,D[11]=k*p+L*m+A*v+C*S,k=j[12],L=j[13],A=j[14],C=j[15],D[12]=k*l+L*c+A*f+C*b,D[13]=k*s+L*h+A*y+C*x,D[14]=k*u+L*d+A*g+C*w,D[15]=k*p+L*m+A*v+C*S;let U=this.plane.programInfo.uniformsLocations.matrix;e.uniformMatrix4fv(U,!1,D);let B=ia(),q=this.map.transform.cameraPosition,G=iu(is(),q),V=((E=new ir(3))[0]=0,E[1]=1,E[2]=0,E),H=is();ip(H,V,G),iu(H,H);let W=is();ip(W,G,H),iu(W,W),_=H[0],T=H[1],M=H[2],P=W[0],I=W[1],z=W[2],R=G[0],$=G[1],O=G[2],B[0]=_,B[1]=T,B[2]=M,B[3]=0,B[4]=P,B[5]=I,B[6]=z,B[7]=0,B[8]=R,B[9]=$,B[10]=O,B[11]=0,B[12]=0,B[13]=0,B[14]=0,B[15]=1;let Z=this.plane.programInfo.uniformsLocations.rotationMatrix;e.uniformMatrix4fv(Z,!1,B);let K=this.gradient.stops.length,J=[],X=[];for(let e=0;e<=K;e++)if(e<K){J[e]=this.gradient.stops[e][0];let t=iy(this.gradient.stops[e][1]);X.push(...t)}e.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber,K),e.uniform1fv(this.plane.programInfo.uniformsLocations.stops,new Float32Array(J)),e.uniform4fv(this.plane.programInfo.uniformsLocations.colors,new Float32Array(X)),e.uniform1f(this.plane.programInfo.uniformsLocations.maxDistance,2),e.uniform1f(this.plane.programInfo.uniformsLocations.scale,N),e.drawArrays(e.TRIANGLE_STRIP,0,4)}async setGradient(e){if(!1===e)return void await this.animateOut();await this.animateOut();let t=iq(e);if(t.length>0)throw Error(`[RadialGradientLayer]: Invalid Halo specification: 123 - ${t.join(` 124 - `)} 125 `);
125!0===e?(this.gradient.scale=.9,this.gradient.stops=iD):(this.gradient.scale=e.scale??.9,this.gradient.stops=e.stops??iD),await this.animateIn()}setAnimationActive(e){this.animationActive=e}show(){this.map.setLayoutProperty(this.id,"visibility","visible")}hide(){this.map.setLayoutProperty(this.id,"visibility","none")}}let iB=["scale","stops"];function iq(e){var t;let r=[];if("boolean"==typeof e)return[];try{let t=Object.keys(e).filter(e=>!iB.includes(e));t.length>0&&r.push(`Properties ${t.map(e=>`\`${e}\``).join(", ")} are not supported.`)}catch{r.push("Halo specification is not an object.")}return"number"!=typeof e.scale&&r.push("Halo `scale` property is not a number."),e.stops&&0!==e.stops.length&&Array.isArray(e.stops)?null!=(t=e.stops)&&t.some(e=>"number"!=typeof e[0]||"string"!=typeof e[1])&&r.push("Halo `stops` property is not an array of [number, string]"):r.push("Halo `stops` property is not an array."),r}let iG={POINT:"POINT",COUNTRY:"COUNTRY"},iV=class e extends F.Map{constructor(e){!1!==e.logSDKVersion&&function(){let e="color: #3A1888; background: white; padding: 5px 0; font-weight: bold;",t="color: #FBC935; background: white; padding: 5px; font-weight: bold;",r="color: #F1175D; background: white; padding: 5px 0; font-weight: bold;";console.info(`%câ%câ%câ %cMapTiler SDK JS v${op()} %câ%câ%câ`,t+"padding-right: 0;",e,r,"color: #333; background: white; padding: 5px 0; font-weight: bold;",r,e,t+"padding-left: 0;")}(),function(e){let t=eB();if(!t)return;let r=null;if("string"==typeof e?r=document.getElementById(e):e instanceof HTMLElement&&(r=e),!r)throw Error("The Map container must be provided.");let a=document.createElement("div");throw a.innerHTML=t,a.classList.add("webgl-warning-div"),r.appendChild(a),Error(t)}(e.container),e.apiKey&&(eC.apiKey=e.apiKey);const{style:t,requiresUrlMonitoring:r,isFallback:a}=aB(e.style);a&&console.warn("Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style."),eC.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");const i=location.hash;let n={compact:!1};e.customAttribution?n.customAttribution=e.customAttribution:e.attributionControl&&"object"==typeof e.attributionControl&&(n={...n,...e.attributionControl}),"auto"===n.compact&&(n.compact=void 0);const o={...e,style:t,maplibreLogo:!1,transformRequest:eN(e.transformRequest),attributionControl:!0!==e.forceNoAttributionControl&&n};delete o.style,e.useExperimentalTilePreloading&&(o3(eC.experimental_defaultWorkerCount),console.info(`Using ${eC.experimental_defaultWorkerCount} workers for experimental tile preloading.`)),super(o),G(this,"telemetry"),G(this,"space"),G(this,"halo"),G(this,"options"),G(this,"tilePreloader"),G(this,"isTerrainEnabled",!1),G(this,"terrainExaggeration",1),G(this,"primaryLanguage"),G(this,"terrainGrowing",!1),G(this,"terrainFlattening",!1),G(this,"minimap"),G(this,"forceLanguageUpdate"),G(this,"languageAlwaysBeenStyle"),G(this,"isReady",!1),G(this,"terrainAnimationDuration",1e3),G(this,"monitoredStyleUrls"),G(this,"styleInProcess",!1),G(this,"curentProjection"),G(this,"originalLabelStyle",new window.Map),G(this,"isStyleLocalized",!1),G(this,"languageIsUpdated",!1),G(this,"spaceboxLoadingState",{styleLoadCallbackSet:!1,styleLoadedCallbackFired:!1}),this.options=e,this.setStyle(t),r&&this.monitorStyleUrl(t);const l=()=>{let e="The distant style could not be loaded.";this.getStyle()?e+=" Leaving the style as is.":(this.setStyle(D.Gj.STREETS),e+=`Loading default MapTiler Cloud style "${D.Gj.STREETS.getDefaultVariant().getId()}" as a fallback.`),console.warn(e)};if(this.on("style.load",()=>{if(this.styleInProcess=!1,e.useExperimentalTilePreloading&&!this.tilePreloader){this.tilePreloader=new ie(this);try{this.telemetry.registerModule("experimental-tile-preloader","0.1.0")}catch{}}("string"==typeof e.rtlTextPlugin||typeof e.rtlTextPlugin>"u")&&eF(e.rtlTextPlugin)}),this.on("error",e=>{if(e.error instanceof F.AJAXError){let t=new URL(e.error.url);t.search="";let r=t.href;this.monitoredStyleUrls&&this.monitoredStyleUrls.has(r)&&(this.monitoredStyleUrls.delete(r),l());return}if(this.styleInProcess)return void l()}),eC.caching&&!eM&&console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"),eC.caching&&eM&&(eP(e_,async(e,t)=>{if(!e.url)throw Error("");e.url=e.url.replace(`${e_}://`,"https://"),e.signal=t.signal;let r=await fetch(e.url,e),a=await r.json();return a.tiles&&a.tiles.length>0&&(a.tiles[0]=`${a.tiles[0]}&last-modified=${r.headers.get("Last-Modified")??""}`),{data:a,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires")}}),eP(eT,async(e,t)=>{if(!e.url)throw Error("");e.url=e.url.replace(`${eT}://`,"https://");let r=new URL(e.url),a=eI(r),i=new URL(r);i.searchParams.delete("last-modified");let n=i.toString(),o=async e=>({data:await e.arrayBuffer(),cacheControl:e.headers.get("Cache-Control"),expires:e.headers.get("Expires")}),l=await ez(),s=await l.match(a);if(s)return await o(s);e.signal=t.signal;let u=await fetch(n,e);return u.status>=200&&u.status<300&&(l.put(a,u.clone()).catch(()=>{}),++eR>100&&(e$(),eR=0)),o(u)})),typeof e.language>"u")this.primaryLanguage=eC.primaryLanguage;else{const t=(0,D.EA)(e.language,ew);this.primaryLanguage=t??eC.primaryLanguage}this.forceLanguageUpdate=this.primaryLanguage!==ew.STYLE&&this.primaryLanguage!==ew.STYLE_LOCK,this.languageAlwaysBeenStyle=this.primaryLanguage===ew.STYLE,this.terrainExaggeration=e.terrainExaggeration??this.terrainExaggeration,this.curentProjection=e.projection,this.on("style.load",e=>{"mercator"===this.curentProjection?this.setProjection({type:"mercator"}):"globe"===this.curentProjection&&this.setProjection({type:"globe"})}),this.once("styledata",async()=>{let t;if(e.geolocate&&!e.center&&(!e.hash||!i)){try{if(e.geolocate===iG.COUNTRY)return void await this.fitToIpBounds()}catch(e){console.warn(e.message)}try{await this.centerOnIpPoint(e.zoom),t=this.getCameraHash()}catch(e){console.warn(e.message)}"granted"===(await navigator.permissions.query({name:"geolocation"})).state&&navigator.geolocation.getCurrentPosition(r=>{t===this.getCameraHash()&&(this.terrain?this.easeTo({center:[r.coords.longitude,r.co
125ords.latitude],zoom:e.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[r.coords.longitude,r.coords.latitude],zoom:e.zoom||12,duration:2e3})}))},null,{maximumAge:864e5,timeout:5e3,enableHighAccuracy:!1})}}),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage)}),this.on("styledata",()=>{null===this.getTerrain()&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",async()=>{let t={logo:null};try{let e=Object.keys(this.style.tileManagers).map(e=>this.getSource(e)).filter(e=>e&&"url"in e&&"string"==typeof e.url&&e.url.includes("tiles.json")),r=new URL(e[0].url);r.searchParams.has("key")||r.searchParams.append("key",eC.apiKey),t=await (await fetch(r.href)).json()}catch{}if(e.customControls){let t="[data-maptiler-control-group]",r="[data-maptiler-control]",a=e=>{let t=e.dataset.maptilerControl;return("true"===t||""===t)&&(t=void 0),t},i=e=>e.dataset.maptilerPosition,n=[...this._container.ownerDocument.querySelectorAll(t)],o=[...this._container.ownerDocument.querySelectorAll(r)].filter(e=>null===e.closest(t));if("string"==typeof e.customControls){let t=e.customControls;n=n.filter(e=>e.matches(t)||null!==e.closest(t)),o=o.filter(e=>e.matches(t)||null!==e.closest(t))}for(let e of n){let t=new a2(e);for(let n of(this.addControl(t,i(e)),e.querySelectorAll(r)))t.configureGroupItem(n,a(n))}for(let e of o)this.addControl(new a2(e,a(e)),i(e));let l=()=>{let{lng:e,lat:t}=this.getCenter();this._container.style.setProperty("--maptiler-center-lng",String(e)),this._container.style.setProperty("--maptiler-center-lat",String(t)),this._container.style.setProperty("--maptiler-zoom",String(this.getZoom())),this._container.style.setProperty("--maptiler-bearing",String(this.getBearing())),this._container.style.setProperty("--maptiler-pitch",String(this.getPitch())),this._container.style.setProperty("--maptiler-roll",String(this.getRoll())),this._container.style.setProperty("--maptiler-is-globe-projection",String(this.isGlobeProjection())),this._container.style.setProperty("--maptiler-has-terrain",String(this.hasTerrain()))};l(),this.on("render",l)}if(!0!==e.forceNoAttributionControl)if("logo"in t&&t.logo){let r=t.logo;this.addControl(new eE({logoURL:r}),e.logoPosition)}else e.maptilerLogo&&this.addControl(new eE,e.logoPosition);if(e.scaleControl){let t=!0===e.scaleControl||void 0===e.scaleControl?"bottom-right":e.scaleControl,r=new ep({unit:eC.unit});this.addControl(r,t),eC.on("unit",e=>{r.setUnit(e)})}if(!1!==e.navigationControl){let t=!0===e.navigationControl||void 0===e.navigationControl?"top-right":e.navigationControl;this.addControl(new aW,t)}if(!1!==e.geolocateControl){let t=!0===e.geolocateControl||void 0===e.geolocateControl?"top-right":e.geolocateControl;this.addControl(new aX({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),t)}if(e.terrainControl){let t=!0===e.terrainControl||void 0===e.terrainControl?"top-right":e.terrainControl;this.addControl(new aV,t)}if(e.projectionControl){let t=!0===e.projectionControl||void 0===e.projectionControl?"top-right":e.projectionControl;this.addControl(new aQ,t)}if(e.fullscreenControl){let t=!0===e.fullscreenControl||void 0===e.fullscreenControl?"top-right":e.fullscreenControl;this.addControl(new ec({}),t)}this.isReady=!0,this.fire("ready",{target:this})});let s=!1,u=!1,p;this.once("ready",()=>{s=!0,u&&this.fire("loadWithTerrain",p)}),this.once("style.load",()=>{let{minimap:t}=e;if("object"==typeof t){let{zoom:r,center:a,style:i,language:n,apiKey:o,maptilerLogo:l,canvasContextAttributes:s,refreshExpiredTiles:u,maxBounds:p,scrollZoom:c,minZoom:h,maxZoom:d,boxZoom:m,locale:f,fadeDuration:y,crossSourceCollisions:g,clickTolerance:v,bounds:b,fitBoundsOptions:x,pixelRatio:w,validateStyle:S}=e;this.minimap=new a5(t,{zoom:r,center:a,style:i,language:n,apiKey:o,container:"null",maptilerLogo:l,canvasContextAttributes:s,refreshExpiredTiles:u,maxBounds:p,scrollZoom:c,minZoom:h,maxZoom:d,boxZoom:m,locale:f,fadeDuration:y,crossSourceCollisions:g,clickTolerance:v,bounds:b,fitBoundsOptions:x,pixelRatio:w,validateStyle:S}),this.addControl(this.minimap,t.position??"bottom-left")}else!0===t?(this.minimap=new a5({},e),this.addControl(this.minimap,"bottom-left")):void 0!==t&&!1!==t&&(this.minimap=new a5({},e),this.addControl(this.minimap,t))});const c=e=>{e.terrain&&(u=!0,p={type:"loadWithTerrain",target:this,terrain:e.terrain},this.off("terrain",c),s&&this.fire("loadWithTerrain",p))};this.on("terrain",c),e.terrain&&this.enableTerrain(e.terrainExaggeration??this.terrainExaggeration),this.once("load",()=>{this.getCanvas().addEventListener("webglcontextlost",e=>{!0===this._removed?console.warn("[webglcontextlost]","WebGL context lost after map removal. This is harmless."):(console.warn("[webglcontextlost]","Unexpected loss of WebGL context!"),this.fire("webglContextLost",e))});let t=this.getLayersOrder()[0];e.space&&this.initSpace({options:e,before:t}),e.halo&&this.initHalo({options:e,before:t})}),this.telemetry=new it(this)}getSpace(){return this.space}setSpace(e,t=!0){if(t&&(this.options.space=e),!1===e){this.space=void 0;return}if(this.space){this.space.setCubemap(e),this.getLayer(this.space.id)||this.addLayer(this.space,this.getLayersOrder()[0]);return}this.space=new iI(e),this.once("load",()=>{let e=this.getLayersOrder()[0];this.space&&this.addLayer(this.space,e)})}enableSpaceAnimations(){this.setSpaceAnimationActive(!0)}disableSpaceAnimations(){this.setSpaceAnimationActive(!1)}enableHaloAnimations(){this.setHaloAnimationActive(!0)}disableHaloAnimations(){this.setHaloAnimationActive(!1)}setHaloAnimationActive(e){this.halo?this.halo.setAnimationActive(e):this.once("load",()=>{var t;null==(t=this.halo)||t.setAnimationActive(e)})}setSpaceAnimationActive(e){this.space?this.space.setAnimationActive(e):this.once("load",()=>{var t;null==(t=this.space)||t.setAnimationActive(e)})}setSpaceFromStyle({style:e}){var t,r,a;if(!0!==this.options.space&&"u">typeof this.options.space)return void this.setSpace(this.options.space);let i=null==(r=null==(t=e.metadata)?void 0:t.maptiler)?void 0:r.space;if(!this.options.space&&!i)return void this.setSpace(!1,!1);
125if(JSON.stringify(null==(a=this.space)?void 0:a.getConfig())===JSON.stringify(i)){if(this.space&&!this.getLayer(this.space.id)){let e=this.getLayersOrder()[0];this.addLayer(this.space,e)}return}if(!0===this.options.space)return void this.setSpace(i??!0);if(this.space&&this.isGlobeProjection()){if(!this.getLayer(this.space.id)){let e=this.getLayersOrder()[0];this.addLayer(this.space,e)}this.space.setCubemap(i)}}setHaloFromStyle({style:e}){var t,r,a,i;if(!1===this.options.halo)return;let n=null==(t=e.metadata)?void 0:t.maptiler;if(JSON.stringify(null==(r=this.halo)?void 0:r.getConfig())===JSON.stringify(null==n?void 0:n.halo)){if(this.halo&&!this.getLayer(this.halo.id)){let e=this.getLayersOrder().indexOf((null==(a=this.space)?void 0:a.id)??"")+1,t=this.getLayersOrder()[e];this.addLayer(this.halo,t)}return}if(!(null!=n&&n.halo)&&!this.options.halo)return void this.setHalo({stops:[[0,"transparent"],[.01,"transparent"]],scale:1});if(this.halo){if(!this.getLayer(this.halo.id)){let e=this.getLayersOrder().indexOf((null==(i=this.space)?void 0:i.id)??"")+1,t=this.getLayersOrder()[e];this.addLayer(this.halo,t)}let e=(null==n?void 0:n.halo)??this.options.halo;e&&this.halo.setGradient(e)}}initSpace({options:e=this.options,before:t,spec:r}){if(this.space){this.getLayer(this.space.id)||this.addLayer(this.space,t);return}if(!1!==e.space){if(e.space&&!0!==e.space){this.space=new iI(e.space),this.addLayer(this.space,t);return}if(r){this.space=new iI(r),this.addLayer(this.space,t);return}!0===this.options.space&&(this.space=new iI(!0),this.addLayer(this.space,t))}}initHalo({options:e=this.options,before:t,spec:r}){if(!(this.halo&&this.getLayer(this.halo.id))&&!1!==e.halo){if(e.halo&&!0!==e.halo){this.halo=new iU(e.halo),this.addLayer(this.halo,t);return}if(r&&(this.halo=new iU(r),this.addLayer(this.halo,t)),!0===this.options.halo){this.halo=new iU(!0),this.addLayer(this.halo,t);return}}}getHalo(){return this.halo}setHalo(e){if(this.options.halo=e,this.isGlobeProjection()){if(this.halo)return void this.halo.setGradient(e);this.halo=new iU(e),this.once("load",()=>{var e;let t=this.getLayersOrder(),r=t[0],a=t.indexOf((null==(e=this.space)?void 0:e.id)??"")+2,i=t[a];this.halo&&this.addLayer(this.halo,this.space?i:r)})}}recreate(){let t={center:this.getCenter(),zoom:this.getZoom(),bearing:this.getBearing(),pitch:this.getPitch()};this.remove(),Object.assign(this,new e({...this.options})),this.once("load",()=>{this.jumpTo(t)})}setTerrainAnimationDuration(e){this.terrainAnimationDuration=Math.max(e,0)}async onLoadAsync(){return new Promise(e=>{this.loaded()?e(this):this.once("load",()=>{e(this)})})}async onReadyAsync(){return new Promise(e=>{this.isReady?e(this):this.once("ready",()=>{e(this)})})}async onLoadWithTerrainAsync(){return new Promise(e=>{this.isReady&&this.terrain?e(this):this.once("loadWithTerrain",()=>{e(this)})})}monitorStyleUrl(e){typeof this.monitoredStyleUrls>"u"&&(this.monitoredStyleUrls=new Set);let t=new URL(e);t.search="",this.monitoredStyleUrls.add(t.href)}setStyle(e,t){var r,a,i,n,o;this.originalLabelStyle.clear(),null==(r=this.minimap)||r.setStyle(e),this.forceLanguageUpdate=!0,this.once("idle",()=>{this.forceLanguageUpdate=!1});let l=aB(e);if(l.requiresUrlMonitoring&&this.monitorStyleUrl(l.style),l.isFallback){if(this.getStyle())return console.warn("[Map.setStyle]: Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Keeping the curent style instead."),this;console.warn("[Map.setStyle]: Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style.")}this.spaceboxLoadingState.styleLoadedCallbackFired=!1,this.spaceboxLoadingState.styleLoadCallbackSet=!1;let s=this.getStyle(),u=l.style;try{super.setStyle(l.style,{...t,diff:"string"!=typeof l.style}),this.styleInProcess=!0}catch(e){this.styleInProcess=!1,console.error("[Map.setStyle]: Error while setting style:",e)}let p=()=>{let e=l.style;e.projection&&"mercator"!==e.projection.type?(this.setSpaceFromStyle({style:l.style}),this.setHaloFromStyle({style:l.style})):console.warn("[Map.setStyle]: Neither space nor halo is supported for mercator projection. Ignoring...")},c=e=>{var t,r,a,i;let n=(null==e?void 0:e.target.getStyle())??l.style;if(!this.spaceboxLoadingState.styleLoadedCallbackFired&&(this.spaceboxLoadingState.styleLoadedCallbackFired=!0,this.spaceboxLoadingState.styleLoadCallbackSet=!1,"string"!=typeof n))try{let e=this.getLayersOrder()[0];this.space?this.setSpaceFromStyle({style:n}):this.initSpace({before:e,spec:null==(r=null==(t=n.metadata)?void 0:t.maptiler)?void 0:r.space}),this.halo?this.setHaloFromStyle({style:n}):this.initHalo({before:e,spec:null==(i=null==(a=n.metadata)?void 0:a.maptiler)?void 0:i.halo})}catch(e){console.error(e)}};return"string"==typeof l.style||l.requiresUrlMonitoring?this.once("style.load",c):(requestIdleCallback(()=>{try{c()}catch(e){console.error(e)}}),this.spaceboxLoadingState.styleLoadCallbackSet?((null==(a=null==s?void 0:s.terrain)?void 0:a.source)!==(null==(i=null==u?void 0:u.terrain)?void 0:i.source)||(null==(n=null==s?void 0:s.terrain)?void 0:n.exaggeration)!==(null==(o=null==u?void 0:u.terrain)?void 0:o.exaggeration))&&this.once("terrain",p):(this.once("style.load",c),this.once("projection.change",c),this.spaceboxLoadingState.styleLoadCallbackSet=!0)),this}addLayer(e,t){var r;return null==(r=this.minimap)||r.addLayer(e,t),super.addLayer(e,t)}moveLayer(e,t){var r;return null==(r=this.minimap)||r.moveLayer(e,t),super.moveLayer(e,t)}removeLayer(e){var t;return null==(t=this.minimap)||t.removeLayer(e),super.removeLayer(e)}setLayerZoomRange(e,t,r){var a;return null==(a=this.minimap)||a.setLayerZoomRange(e,t,r),super.setLayerZoomRange(e,t,r)}setFilter(e,t,r){var a;return null==(a=this.minimap)||a.setFilter(e,t,r),super.setFilter(e,t,r)}setPaintProperty(e,t,r,a){var i;return null==(i=this.minimap)||i.setPaintProperty(e,t,r,a),super.setPaintProperty(e,t,r,a)}setLayoutProperty(e,t,r,a){var i;return null==(i=this.minimap)||i.setLayoutProperty(e,t,r,a),super.setLayoutProperty(e,t,r,a)}setGlyphs(e,t){var r;return null==(r=this.minimap)||r.setGlyphs(e,t),super.setGlyphs(e,t)}getStyleLanguage(){return this.style&&this.style.stylesheet&&this.style.stylesheet.metadata&&"object"==typeof this.style.stylesheet.metadata&&"maptiler:language"in this.style.stylesheet.metadata&&"string"==typeof this.style.stylesheet.metadata["maptiler:language"]?(0,D.p3)(this.style.stylesheet.metadata["maptiler:language"]):null}setLanguage(e){var t;null==(t=this.minimap)||t.map.setLanguage(e),this.onStyleReady(()=>{this.setPrimaryLanguage(e)}
125)}setPrimaryLanguage(e){let t=this.getStyleLanguage(),r=(0,D.EA)(e,ew);if(!r)return void console.warn(`The language "${r}" is not supported.`);if(!(r.flag===ew.STYLE.flag&&t&&(t.flag===ew.AUTO.flag||t.flag===ew.VISITOR.flag))&&(r.flag!==ew.STYLE.flag&&(this.languageAlwaysBeenStyle=!1),this.languageAlwaysBeenStyle||this.primaryLanguage===r&&!this.forceLanguageUpdate))return;if(this.primaryLanguage.flag===ew.STYLE_LOCK.flag)return void console.warn("The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag.");this.primaryLanguage=r;let a=r;if(r.flag===ew.STYLE.flag){if(!t)return void console.warn("The style has no default languages or has an invalid one.");a=t}let i=ew.LOCAL.flag,n=["get",i];n=a.flag===ew.VISITOR.flag?["case",["all",["has",i=eS().flag],["has",ew.LOCAL.flag]],["case",["==",["get",i],["get",ew.LOCAL.flag]],["get",ew.LOCAL.flag],["format",["get",i],{"font-scale":.8},` 126`,["get",ew.LOCAL.flag],{"font-scale":1.1}]],["get",ew.LOCAL.flag]]:a.flag===ew.VISITOR_ENGLISH.flag?["case",["all",["has",i=ew.ENGLISH.flag],["has",ew.LOCAL.flag]],["case",["==",["get",i],["get",ew.LOCAL.flag]],["get",ew.LOCAL.flag],["format",["get",i],{"font-scale":.8},` 127`,["get",ew.LOCAL.flag],{"font-scale":1.1}]],["get",ew.LOCAL.flag]]:a.flag===ew.AUTO.flag?["coalesce",["get",i=eS().flag],["get",ew.LOCAL.flag]]:a===ew.LOCAL?["get",i=ew.LOCAL.flag]:["coalesce",["get",i=a.flag],["get",ew.LOCAL.flag]];let{layers:o}=this.getStyle(),l=0===this.originalLabelStyle.size;if(l){let e=function(e,t){let r=[];for(let a of e){if("symbol"!==a.type)continue;let{id:e,layout:i}=a;if(!i||!("text-field"in i))continue;let n=t.getLayoutProperty(e,"text-field");if(n)if("string"==typeof n){let e=function(e){var t;let r=/\{name(?::(?<language>\S+))?\}/g,a=[];for(;;){let i=r.exec(e);if(!i)break;let n=(null==(t=i.groups)?void 0:t.language)??null;a.push(n)}return a}(n);r.push(e)}else{let e=function(e){let t=[],r=structuredClone(e),a=e=>{if("string"!=typeof e)for(let i=0;i<e.length;i+=1){var r;let n=Array.isArray(r=e[i])&&2===r.length&&"get"===r[0]&&"string"==typeof r[1]?"name"===r[1].trim()?{isLanguage:!0,localization:null}:r[1].trim().startsWith("name:")?{isLanguage:!0,localization:r[1].trim().split(":").pop()}:null:null;n?t.push(n.localization):a(e[i])}};return a([r]),t}(n);r.push(e)}}let a=r.flat(),i={unlocalized:0,localized:{}};for(let e of a)null===e?i.unlocalized+=1:(e in i.localized||(i.localized[e]=0),i.localized[e]+=1);return i}(o,this);this.isStyleLocalized=Object.keys(e.localized).length>0}for(let e of o){let t;if("symbol"!==e.type)continue;let r=this.getSource(e.source);if(!r||!("url"in r&&"string"==typeof r.url)||new URL(r.url).host!==ek.maptilerApiHost)continue;let{id:a,layout:i}=e;if(i&&"text-field"in i)if(l?(t=this.getLayoutProperty(a,"text-field"),this.originalLabelStyle.set(a,t)):t=this.originalLabelStyle.get(a),"string"==typeof t){let{contains:e,exactMatch:r}=function(e,t){let r=t?/\{name:\S+\}/:/\{name\}/;return{contains:r.test(e),exactMatch:RegExp(`^${r.source}$`).test(e)}}(t,this.isStyleLocalized);if(!e)continue;if(r)this.setLayoutProperty(a,"text-field",n);else{let e=function(e,t,r){let a=e.split(r?/\{name:\S+\}/:/\{name\}/);return["concat",...a.flatMap((e,r)=>{var i;let n="string"==typeof(i=e)&&i.includes("{ele}")?["case",["has","ele"],["concat",["case",["has","name"],` 128`,""],["get","ele"]," m"],""]:i;return r===a.length-1?[n]:[n,t]})]}(t,n,this.isStyleLocalized);this.setLayoutProperty(a,"text-field",e)}}else{let e=JSON.stringify(t);(e.includes('"name"')||e.includes('"name:'))&&this.setLayoutProperty(a,"text-field",n)}}this.languageIsUpdated=!0}getPrimaryLanguage(){return this.primaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(e){if(!this.terrain)return;let t=performance.now(),r=this.terrain.exaggeration,a=e-r,i=()=>{if(!this.terrain||this.terrainFlattening)return;let n=(performance.now()-t)/this.terrainAnimationDuration;n<.99?(this.terrain.exaggeration=r+(1-(1-n)**4)*a,requestAnimationFrame(i)):(this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=e,this.fire("terrainAnimationStop",{terrain:this.terrain})),this._elevationFreeze=!1,this.triggerRepaint()};this.terrainGrowing||this.terrainFlattening||this.fire("terrainAnimationStart",{terrain:this.terrain}),this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame(i)}enableTerrain(e=this.terrainExaggeration){if(e<0)return void console.warn("Terrain exaggeration cannot be negative.");let t=r=>{this.terrain&&"data"===r.type&&"source"===r.dataType&&"source"in r&&"maptiler-terrain"===r.sourceId&&"raster-dem"===r.source.type&&r.isSourceLoaded&&(this.off("data",t),this.growTerrain(e))},r=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=e,this.on("data",t),this.addSource(ek.terrainSourceId,{type:"raster-dem",url:ek.terrainSourceURL}),this.setTerrain({source:ek.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(e);return}if(this.loaded()||this.isTerrainEnabled)r();else{let e=()=>
128{this.getTerrain()&&this.getSource(ek.terrainSourceId)||r()};this.once(this.style._loaded?"render":"load",()=>{e()}),this.once("moveend",()=>{e()})}}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;let e=performance.now(),t=this.terrain.exaggeration,r=()=>{if(!this.terrain||this.terrainGrowing)return;let a=(performance.now()-e)/this.terrainAnimationDuration;(this._elevationFreeze=!1,a<.99)?(this.terrain.exaggeration=t*(1-a)**4,requestAnimationFrame(r)):(this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(),this.getSource(ek.terrainSourceId)&&this.removeSource(ek.terrainSourceId),this.fire("terrainAnimationStop",{terrain:null})),this.triggerRepaint()};this.terrainGrowing||this.terrainFlattening||this.fire("terrainAnimationStart",{terrain:this.terrain}),this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(r)}setTerrainExaggeration(e,t=!0){!t&&this.terrain?(this.terrainExaggeration=e,this.terrain.exaggeration=e,this.triggerRepaint()):this.enableTerrain(e)}onStyleReady(e){this.isStyleLoaded()?e():this.once("styledata",()=>{e()})}async fitToIpBounds(){let e=await D.Re.info();this.fitBounds(e.country_bounds,{duration:0,padding:100})}async centerOnIpPoint(e){let t=await D.Re.info();this.jumpTo({center:[t.longitude??0,t.latitude??0],zoom:e||11})}getCameraHash(){let e=new Float32Array(5),t=this.getCenter();return e[0]=t.lng,e[1]=t.lat,e[2]=this.getZoom(),e[3]=this.getPitch(),e[4]=this.getBearing(),j.o4.fromUint8Array(new Uint8Array(e.buffer))}getSdkConfig(){return eC}getMaptilerSessionId(){return eL}setTransformRequest(e){return super.setTransformRequest(eN(e)),this}getProjection(){let e=this.style.getProjection();return void 0===e&&this.style.projection?{type:this.style.projection.name}:e}isGlobeProjection(){let e=this.getProjection();return!!e&&"globe"===e.type}setProjection(e,t){return"string"==typeof e&&(e={type:e}),("mercator"===e.type||"globe"===e.type)&&null!=t&&t.persist&&(this.curentProjection=e.type),this.fire("projection.change",{target:this,projection:e}),super.setProjection(e)}forgetPersistedProjection(){return this.curentProjection=void 0,this}isLanguageUpdated(){return this.languageIsUpdated}async experimental_preloadTilesForBounds(e){var t;this.options.useExperimentalTilePreloading&&await (null==(t=this.tilePreloader)?void 0:t.preloadForBounds(e))}async experimental_preloadTilesForCameraPositions(e){var t;this.options.useExperimentalTilePreloading&&await (null==(t=this.tilePreloader)?void 0:t.preloadForCameraPositions(e))}async experimental_preloadTiles(e){var t;this.options.useExperimentalTilePreloading&&await (null==(t=this.tilePreloader)?void 0:t.preloadByTileIDs(e))}flyTo(e,t){var r,a;let{experimental_preload:i,...n}=e;if(i){null==(r=this.tilePreloader)||r.abortAll();let e=this.resolveCameraPosition(n);return null==(a=this.tilePreloader)||a.preloadForCameraPositions({positions:[e],...i}).then(()=>super.flyTo(n,t)),this}return super.flyTo(n,t)}panTo(e,t,r){var a,i;let{experimental_preload:n,...o}=t??{};if(n&&this.options.useExperimentalTilePreloading){null==(a=this.tilePreloader)||a.abortAll();let t=F.LngLat.convert(e),l=this.currentCameraPosition(),s={lng:t.lng,lat:t.lat,zoom:l.zoom,pitch:l.pitch,bearing:l.bearing},u=super.panTo.bind(this);return null==(i=this.tilePreloader)||i.preloadForLinearPath({start:l,end:s,...n}).then(()=>u(e,o,r)),this}return super.panTo(e,o,r)}easeTo(e,t){var r,a;let{experimental_preload:i,...n}=e;if(i&&this.options.useExperimentalTilePreloading){null==(r=this.tilePreloader)||r.abortAll();let e=this.currentCameraPosition(),o=this.resolveCameraPosition(n),l=super.easeTo.bind(this);return null==(a=this.tilePreloader)||a.preloadForLinearPath({start:e,end:o,...i}).then(()=>l(n,t)),this}return super.easeTo(n,t)}fitBounds(e,t,r){var a,i;let{experimental_preload:n,...o}=t??{};if(n&&this.options.useExperimentalTilePreloading){null==(a=this.tilePreloader)||a.abortAll();let t=this.cameraForBounds(e,o);if(null!=t&&t.center){let a=this.currentCameraPosition(),l=F.LngLat.convert(t.center),s={lng:l.lng,lat:l.lat,zoom:t.zoom??a.zoom,pitch:a.pitch,bearing:t.bearing??a.bearing},u=super.fitBounds.bind(this);return null==(i=this.tilePreloader)||i.preloadForLinearPath({start:a,end:s,...n}).then(()=>u(e,o,r)),this}}return super.fitBounds(e,o,r)}zoomTo(e,t,r){var a,i;let{experimental_preload:n,...o}=t??{};if(n&&this.options.useExperimentalTilePreloading){null==(a=this.tilePreloader)||a.abortAll();let t=this.currentCameraPosition(),l={...t,zoom:e},s=super.zoomTo.bind(this);return null==(i=this.tilePreloader)||i.preloadForLinearPath({start:t,end:l,...n}).then(()=>s(e,o,r)),this}return super.zoomTo(e,o,r)}currentCameraPosition(){let e=this.getCenter();return{lng:e.lng,lat:e.lat,zoom:this.getZoom(),pitch:this.getPitch(),bearing:this.getBearing()}}resolveCameraPosition(e){let t=this.currentCameraPosition(),r=t.lng,a=t.lat;if(e.center){let t=F.LngLat.convert(e.center);r=t.lng,a=t.lat}return{lng:r,lat:a,zoom:e.zoom??t.zoom,pitch:e.pitch??t.pitch,bearing:e.bearing??t.bearing}}};function iH(e){if(e={...e},eC.session?!1!==e.session:!0===e.session){let t=e.adjustSearchParams;e.adjustSearchParams=e=>{"function"==typeof t&&t(e),e.append("mtsid",eL)}}return delete e.session,e}let iW={forward:(e,t={})=>D.G0.forward(e,iH(t)),reverse:(e,t={})=>D.G0.reverse(e,iH(t)),byId:(e,t={})=>D.G0.byId(e,iH(t)),batch:(e,t={})=>D.G0.batch(e,iH(t))};class iZ{constructor(e,t,r,a={}){G(this,"type"),G(this,"target"),G(this,"originalEvent"),G(this,"imageX"),G(this,"imageY"),G(this,"isOutOfBounds"),this.type=e,this.target=t,this.originalEvent=r??null,Object.assign(this,a)}}let iK=["idle","render","load","remove","idle"],iJ=["error"],iX=["resize"],iY=["webglcontextlost","webglcontextrestored"],iQ=["moveend","movestart","move","zoomend","zoomstart","zoom","rotatestart","rotateend","rotate","dragstart","dragend","drag","boxzoomcancel","boxzoomend","boxzoomstart"],i0=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseover","contextmenu","touchstart","touchend","touchmove","touchcancel"],i1=["cooperativegestureprevented"],i2=["data","dataloading","sourcedata","sourcedataloading","dataabort","sourcedataabort"],i5=[...iK,...iJ,...iX,...iY,...iQ,...i0,...i2,...i1],i3=["lngLat","_defaultPrevented"];
128class i4 extends Error{constructor(e,t,r){const a=`[${r}]: Failed to fetch ${t} at ${e.url}: ${e.status.toString()}: ${e.statusText}`;super(a),G(this,"status"),G(this,"statusText"),this.name="FetchError",this.message=a,this.status=e.status,this.statusText=e.statusText}}function i8(e,t,r){return Math.min(r,Math.max(t,e))}function i6(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function i9(e){return(180+e)/360}function i7(e,t,r){let a=r-t,i=((e-t)%a+a)%a+t;return i===t?r:i}let ne={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%)"};class nt{constructor({imageViewer:e}){if(G(this,"viewer"),G(this,"container"),G(this,"handleClick",()=>{this.viewer.fitImageToViewport({ease:!0})}),!e)throw Error("ImageViewerFitImageToBoundsControl: an instance of 'ImageViewer' is required");this.viewer=e}onAdd(e){let t=document.createElement("button");this.container=document.createElement("div"),this.container.classList.add("maplibregl-ctrl","maplibregl-ctrl-group"),t.classList.add("maplibregl-ctrl-fit-image-to-bounds");let r=document.createElement("span");return r.classList.add("maplibregl-ctrl-icon"),t.title="Zoom image to viewport bounds",t.appendChild(r),t.addEventListener("click",this.handleClick),this.container.appendChild(t),this.container}onRemove(){this.container.remove()}}let nr=Symbol("MapTiler:ImageViewer:Internal:lngLatToPxInternal"),na=Symbol("MapTiler:ImageViewer:Internal:pxToLngLatInternal"),{Evented:ni}=F,nn={style:{version:8,sources:{},layers:[]},minPitch:0,maxPitch:0,pitch:0,bearing:0,projection:"mercator",geolocateControl:!1,navigationControl:!1,projectionControl:!1,hash:!1,renderWorldCopies:!1,terrain:!1,space:!1,halo:!1,transformConstrain:function(e,t){let r,a,i;t=i8(t,this.minZoom,this.maxZoom);let n={center:new oU(e.lng,e.lat),zoom:t},o=this.lngRange,l=this.latRange;null===o&&(o=[-179.9999999999,179.9999999999]);let s=this.tileSize*Math.pow(2,n.zoom),u=0,p=s,c=0,h=s,d=0,m=0,{x:f,y:y}=this.size;l&&(u=i6(l[1])*s,(p=i6(l[0])*s)-u<.5*y&&(d=.5*y/(p-u))),o&&(c=i7(i9(o[0])*s,0,s),(h=i7(i9(o[1])*s,0,s))<c&&(h+=s),h-c<.5*f&&(m=.5*f/(h-c)));let{x:g,y:v}=(i=i8(e.lat,-85.051129,85.051129),new oK(i9(e.lng)*s,i6(i)*s)),b=Math.min(m||0,d||0);if(b)return n.zoom+=Math.log(b)/Math.LN2,n;let x=0,w=0,S=1-(p-u)/y;x=Math.max(1-(h-c)/f,1),w=Math.max(S,1);let k=1-x,L=1-w;if(l){let e=L*y/2;v-e<u&&(a=u+e),v+e>p&&(a=p-e)}if(o){let e=k*f/2;g-e<c&&(r=c+e),g+e>h&&(r=h-e)}if(void 0!==r||void 0!==a){let e=new oK(r??g,a??v);n.center=new oq(e.x/s,e.y/s).toLngLat().wrap()}return n}},no={debug:!1,fitToBoundsControl:!0,navigationControl:!0};class nl extends(O=ni,$=nr,R=na,O){constructor(e){if(super(),G(this,"imageUUID"),G(this,"debug"),G(this,"imageMetadata"),G(this,"sdk"),G(this,"options"),G(this,"imageSize"),G(this,"paddedSizeMax"),G(this,"fitToBoundsControlInstance"),G(this,"shouldFitImageToViewport",!0),G(this,$,this.lngLatToPx.bind(this)),G(this,R,this.pxToLngLat.bind(this)),!e.imageUUID)throw Error("[ImageViewer]: `imageUUID` is required");if("string"!=typeof e.container&&!(e.container instanceof HTMLElement))throw Error("[ImageViewer]: `container` is required and must be a string or HTMLElement");this.options={...no,...e};const t={...this.options,...nn};delete t.center,this.sdk=new iV(t),this.sdk.telemetry.registerViewerType("ImageViewer");const{imageUUID:r,debug:a}=e;this.imageUUID=r,this.debug=a??!1,this.debug&&(this.sdk.showTileBoundaries=this.debug,this.sdk.showPadding=this.debug,this.sdk.showCollisionBoxes=this.debug,this.sdk.repaint=this.debug),this.init()}get version(){return this.sdk.version}async onReadyAsync(){try{await Promise.race([new Promise((e,t)=>{this.once("imageviewerready",t=>{e(t)}),this.once("imagevieweriniterror",e=>{t(e.error)})}),new Promise((e,t)=>{setTimeout(()=>{t(Error("Timeout waiting for image viewer to be ready"))},5e3)})])}catch(e){throw e}}
128async init(){var e,t,r;try{await this.sdk.onReadyAsync(),await this.fetchImageMetadata(),this.addImageSource(),this.options.navigationControl&&this.sdk.addControl(new eo({visualizePitch:!1,visualizeRoll:!1})),this.fitToBoundsControlInstance=new nt({imageViewer:this}),this.options.fitToBoundsControl&&this.sdk.addControl(this.fitToBoundsControlInstance),function({map:e,viewer:t,lngLatToPx:r}){i5.forEach(a=>{try{e.on(a,e=>{if(i0.includes(a)){let i=e.lngLat&&r(e.lngLat),n=t.getImageMetadata(),o={isOutOfBounds:!n||i[0]<0||i[0]>n.width||i[1]<0||i[1]>n.height,imageX:i[0],imageY:i[1],...Object.fromEntries(Object.entries(e).filter(([e])=>!i3.includes(e)))};t.fire(new iZ(a,t,e.originalEvent,o));return}iQ.includes(a)?t.fire(new iZ(a,t,e.originalEvent,e)):iJ.includes(a)||iX.includes(a)?t.fire(new iZ(a,t,null,e)):iY.includes(a)?t.fire(new iZ(a,t,e.originalEvent,e)):i2.includes(a)||i1.includes(a)?t.fire(new iZ(a,t,null,e)):iK.includes(a)&&t.fire(new iZ(a,t))})}catch(e){console.error(`Error forwarding event to ImageViewer, event of type "${a}" is not supported`,e)}})}({map:this.sdk,viewer:this,lngLatToPx:e=>this.lngLatToPx(e)});let{center:a,zoom:i,bearing:n}=this.options,o=a??[((null==(e=this.imageMetadata)?void 0:e.width)??0)/2,((null==(t=this.imageMetadata)?void 0:t.height)??0)/2];this.setCenter(o),this.setBearing(n??0),this.options.zoom?this.setZoom(i??(null==(r=this.imageMetadata)?void 0:r.maxzoom)??5):this.fitImageToViewport(),this.sdk.on("wheel",()=>{this.shouldFitImageToViewport=!1}),this.sdk.on("touchstart",()=>{this.shouldFitImageToViewport=!1}),this.sdk.on("drag",()=>{this.shouldFitImageToViewport=!1}),this.sdk.on("resize",()=>{var e,t;let r=this.getCenter(),a=(null==(e=this.imageMetadata)?void 0:e.width)??0,i=(null==(t=this.imageMetadata)?void 0:t.height)??0;this.shouldFitImageToViewport&&this.fitImageToViewport(),(r[0]!==a/2||r[1]!==i/2)&&this.setCenter(r)}),this.fire("imageviewerready",new iZ("imageviewerready",this))}catch(e){this.fire("imagevieweriniterror",{error:e})}}fitImageToViewport({ease:e=!1}={}){if(!this.imageMetadata)throw Error("[ImageViewer]: Image metadata not found");let t=this.pxToLngLat([0,0]),r=this.pxToLngLat([this.imageMetadata.width??0,this.imageMetadata.height??0]),a=this.sdk.cameraForBounds([t,r],{padding:50});a&&(e?this.sdk.easeTo({...a,pitch:0}):this.sdk.jumpTo({...a,pitch:0},null)),this.shouldFitImageToViewport=!0}async fetchImageMetadata(){var e;let t=(e=this.imageUUID,`${ns()}/${e}/image.json?key=${eC.apiKey}`),r=await fetch(t);if(!r.ok)throw new i4(r,"image metadata","ImageViewer");let a=await r.json();this.imageMetadata=a,Object.freeze(this.imageMetadata)}addImageSource(){var e;if(!this.imageMetadata)throw this.fire("error",new iZ("error",this,null,{error:Error("[ImageViewer]: Image metadata not found")})),Error("[ImageViewer]: Image metadata not found");let t=(e=this.imageUUID,`${ns()}/${e}/{z}/{x}/{y}?key=${eC.apiKey}`),r=e=>Math.pow(2,Math.ceil(Math.log(e)/Math.LN2));this.imageSize=[this.imageMetadata.width,this.imageMetadata.height],this.paddedSizeMax=Math.max(r(this.imageSize[0]),r(this.imageSize[1]));let a=this.pxToLngLat([0,0]),i=this.pxToLngLat(this.imageSize),n=[a.lng,i.lat,i.lng,a.lat];this.sdk.addSource("image",{...this.imageMetadata,type:"raster",bounds:n,tiles:[t]}),this.sdk.addLayer({id:"image",type:"raster",source:"image"})}triggerRepaint(){this.sdk.triggerRepaint()}get scrollZoom(){return this.sdk.scrollZoom}set scrollZoom(e){this.sdk.scrollZoom=e}get boxZoom(){return this.sdk.boxZoom}set boxZoom(e){this.sdk.boxZoom=e}get dragPan(){return this.sdk.dragPan}set dragPan(e){this.sdk.dragPan=e}get keyboard(){return this.sdk.keyboard}set keyboard(e){this.sdk.keyboard=e}get doubleClickZoom(){return this.sdk.doubleClickZoom}set doubleClickZoom(e){this.sdk.doubleClickZoom=e}get touchZoomRotate(){return this.sdk.touchZoomRotate}set touchZoomRotate(e){this.sdk.touchZoomRotate=e}get cooperativeGestures(){return this.sdk.cooperativeGestures}set cooperativeGestures(e){this.sdk.cooperativeGestures=e}lngLatToPx(e){if(!this.paddedSizeMax){let e="[ImageViewer]: Unable to convert LngLat to px, padded size max not set";throw this.fire("error",new iZ("error",this,null,{error:Error(e)})),Error(e)}let t=oq.fromLngLat(e);return[t.x*this.paddedSizeMax,t.y*this.paddedSizeMax]}pxToLngLat(e){if(!this.paddedSizeMax){let e="[ImageViewer]: Unable to convert px to LngLat, padded size max not set";throw this.fire("error",new iZ("error",this,null,{error:Error(e)})),Error(e)}return new oq(e[0]/this.paddedSizeMax,e[1]/this.paddedSizeMax).toLngLat()}getSDKInternal(){return this.sdk}getCanvas(){return this.sdk.getCanvas()}flyTo(e,t){let r=this.pxToLngLat(e.center);return this.sdk.flyTo({...e,pitch:0,center:r},t),this}jumpTo(e,t){let r=this.pxToLngLat(e.center);return this.sdk.jumpTo({...e,pitch:0,center:r},t),this}setZoom(e){return this.sdk.setZoom(e),this}getZoom(){return this.sdk.getZoom()}getCenter(){let e=this.sdk.getCenter();return this.lngLatToPx(e)}setCenter(e){return this.sdk.setCenter(this.pxToLngLat(e)),this}setBearing(e){return this.sdk.setBearing(e),this}getBearing(){return this.sdk.getBearing()}panBy(e,t,r){return this.sdk.panBy(e,{...t,pitch:0},r),this}panTo(e,t,r){return this.sdk.panTo(this.pxToLngLat(e),{...t,pitch:0},r),this}getImageMetadata(){return this.imageMetadata}getImageBounds(){let e=this.sdk.getBounds().toArray().map(e=>this.lngLatToPx(oU.convert(e)));return[[e[0][0],e[1][1]],[e[1][0],e[0][1]]]}fitImageBounds([e,t]){let r=this.pxToLngLat(e),a=this.pxToLngLat(t),i=oB.convert([r,a]);return this.sdk.fitBounds(i),this}remove(){this.fire("beforeremove",new iZ("beforeremove",this)),this.sdk.remove(),this._listeners&&Object.entries(this._listeners).forEac
128h(([e,t])=>{t.forEach(t=>{this.off(e,t)})}),this._oneTimeListeners&&Object.entries(this._oneTimeListeners).forEach(([e,t])=>{t.forEach(t=>{this.off(e,t)})})}pointIsWithinImageBounds(e){let t=this.getImageMetadata();if(!t)return!1;let r=[[0,0],[t.width,t.height]];return e[0]>=r[0][0]&&e[0]<=r[1][0]&&e[1]>=r[0][1]&&e[1]<=r[1][1]}}function ns(){return"https://api.maptiler.com/images"}let{Evented:nu}=F;class np extends nu{constructor({...e}){super(),G(this,"viewer"),G(this,"marker"),G(this,"position",[0,0]),this.marker=new J(e)}addTo(e){var t,r,a,i;if(!(e instanceof nl))throw Error("[ImageViewerMarker]: an ImageViewerMarker must be added to an instance of ImageViewer");this.viewer=e,r=this.marker,a=this,i=this.viewer[nr],nc.forEach(e=>{r.on(e,t=>{var r,n;if(null==(r=t.target)?void 0:r.getLngLat()){let e=i(null==(n=t.target)?void 0:n.getLngLat());a.setPosition(e)}a.fire(e,new nd(e,a,{...Object.fromEntries(Object.entries(t).filter(([e])=>!nh.includes(e)))}))})});let n=this.viewer.getSDKInternal();return this.setPosition(this.position),(t=this.marker)._update=(function(e){if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();(null==e?void 0:e.type)!=="terrain"&&((null==e?void 0:e.type)!=="render"||t)||this._map.once("render",this._update),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?a="rotateX(0deg)":"map"===this._pitchAlignment&&(a=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&"moveend"!==e.type||(this._pos=this._pos.round());let i=`${ne[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${r}`;this._element.style.transform=i}).bind(t),this.marker.addTo(n),this}addClassName(e){return this.marker.addClassName(e),this}getElement(){return this.marker.getElement()}getPosition(){return this.position}getOffset(){return this.marker.getOffset()}getPitchAlignment(){return this.marker.getPitchAlignment()}getPopup(){return this.marker.getPopup()}getRotation(){return this.marker.getRotation()}getRotationAlignment(){return this.marker.getRotationAlignment()}isDraggable(){return this.marker.isDraggable()}fire(e,t){return super.fire(e,t),this}off(e,t){return super.off(e,t),this}on(e,t){return super.on(e,t)}isWithinImageBounds(){return this.viewer.pointIsWithinImageBounds(this.position)}remove(){return this.marker.remove(),this.marker._listeners&&Object.entries(this.marker._listeners).forEach(([e,t])=>{t.forEach(t=>{this.off(e,t)})}),this.marker._oneTimeListeners&&Object.entries(this.marker._oneTimeListeners).forEach(([e,t])=>{t.forEach(t=>{this.off(e,t)})}),this}removeClassName(e){return this.marker.removeClassName(e),this}setDraggable(e){return this.marker.setDraggable(e),this}setPosition(e){if(this.position[0]=e[0],this.position[1]=e[1],!this.viewer)return this;let t=this.viewer[na](e);return this.marker.setLngLat(t),this}setOffset(e){return this.marker.setOffset(e),this}setOpacity(e,t){return this.marker.setOpacity(e,t),this}setPitchAlignment(e){return this.marker.setPitchAlignment(e),this}setPopup(e){return this.marker.setPopup(e),this}setRotation(e){return this.marker.setRotation(e),this}setRotationAlignment(e){return this.marker.setRotationAlignment(e),this}setSubpixelPositioning(e){return this.marker.setSubpixelPositioning(e),this}toggleClassName(e){return this.marker.toggleClassName(e),this}togglePopup(){return this.marker.togglePopup(),this}}let nc=["dragstart","drag","dragend"],nh=["lngLat","_defaultPrevented","target"];class nd{constructor(e,t,r){G(this,"type"),G(this,"target"),this.type=e,this.target=t,Object.assign(this,r)}}function nm(e){if("u">typeof DOMParser){let t=new DOMParser().parseFromString(e,"application/xml");if(t.querySelector("parsererror"))throw Error("The provided string is not val
128id XML");return t}throw Error("No XML parser found")}function nf(e,t){if(!e.hasChildNodes())return!1;for(let r of Array.from(e.childNodes)){let e=r.nodeName;if("string"==typeof e&&e.trim().toLowerCase()===t.toLowerCase())return!0}return!1}function ny(e){if("u">typeof XMLSerializer)return new XMLSerializer().serializeToString(e);throw Error("No XML serializer found")}function ng(e){let t="string"==typeof e?nm(e):e;if(!nf(t,"gpx"))throw Error("The XML document is not valid GPX");let r=nL(t,"trk"),a=nL(t,"rte"),i=nL(t,"wpt"),n={type:"FeatureCollection",features:[]};for(let e of Array.from(r)){let t=function(e){let t,r=nL(e,"trkseg"),a=[],i=[],n=[];for(let e=0;e<r.length;e++)if(void 0!==(t=nx(r[e],"trkpt"))&&(t.line&&a.push(t.line),t.times&&t.times.length&&i.push(t.times),n.length||t.heartRates&&t.heartRates.length)){if(!n.length)for(let t=0;t<e;t++)n.push(Array(a[t].length).fill(null));t.heartRates&&t.heartRates.length?n.push(t.heartRates):n.push(Array(t.line.length).fill(null))}if(0===a.length)return;let o={...nS(e),...nw(nE(e,"extensions"))};return 0!==i.length&&(o.coordTimes=1===a.length?i[0]:i),0!==n.length&&(o.heartRates=1===a.length?n[0]:n),1===a.length?{type:"Feature",properties:o,geometry:{type:"LineString",coordinates:a[0]}}:{type:"Feature",properties:o,geometry:{type:"MultiLineString",coordinates:a}}}(e);t&&n.features.push(t)}for(let e of Array.from(a)){let t=function(e){let t=nx(e,"rtept");return void 0===t?void 0:{type:"Feature",properties:{...nS(e),...nw(nE(e,"extensions"))},geometry:{type:"LineString",coordinates:t.line}}}(e);t&&n.features.push(t)}for(let e of Array.from(i)){var o;n.features.push({type:"Feature",properties:{...nS(o=e),...nM(o,["sym"])},geometry:{type:"Point",coordinates:nz(o).coordinates}})}return n}function nv(e,t){let r=e;if("string"==typeof r&&(r=nm(r)),!nf(r,"kml"))throw Error("The XML document is not valid KML");let a={type:"FeatureCollection",features:[]},i={},n={},o={},l=nL(r,"Placemark"),s=nL(r,"Style"),u=nL(r,"StyleMap");for(let e of Array.from(s)){let r=nk(void 0!==t?t(e):ny(e)).toString(16);i[`#${nA(e,"id")}`]=r,n[r]=e}for(let e of Array.from(u)){i[`#${nA(e,"id")}`]=nk(void 0!==t?t(e):ny(e)).toString(16);let r=nL(e,"Pair"),a={};for(let e of Array.from(r))a[nT(nE(e,"key"))??""]=nT(nE(e,"styleUrl"));o[`#${nA(e,"id")}`]=a}for(let e of Array.from(l))a.features=a.features.concat(function(e,t,r,a){let i=function e(t){let r,a,i,n,o,l=["Polygon","LineString","Point","Track","gx:Track"],s=[],u=[];if(null!==nE(t,"MultiGeometry"))return e(nE(t,"MultiGeometry"));if(null!==nE(t,"MultiTrack"))return e(nE(t,"MultiTrack"));if(null!==nE(t,"gx:MultiTrack"))return e(nE(t,"gx:MultiTrack"));for(i=0;i<l.length;i++)if(a=nL(t,l[i])){for(n=0;n<a.length;n++)if(r=a[n],"Point"===l[i])s.push({type:"Point",coordinates:nP(nT(nE(r,"coordinates"))??"")});else if("LineString"===l[i])s.push({type:"LineString",coordinates:nI(nT(nE(r,"coordinates"))??"")});else if("Polygon"===l[i]){let e=nL(r,"LinearRing"),t=[];for(o=0;o<e.length;o++)t.push(nI(nT(nE(e[o],"coordinates"))??""));s.push({type:"Polygon",coordinates:t})}else if("Track"===l[i]||"gx:Track"===l[i]){let e=function(e){let t=nL(e,"coord"),r=[],a=[];for(let a of(0===t.length&&(t=nL(e,"gx:coord")),Array.from(t)))r.push(n_((nT(a)??"").split(" ")));for(let t of Array.from(nL(e,"when")))a.push(nT(t));return{coords:r,times:a}}(r);s.push({type:"LineString",coordinates:e.coords}),e.times.length&&u.push(e.times)}}return{geoms:s,coordTimes:u}}(e),n={},o=nT(nE(e,"name")),l=nT(nE(e,"address")),s=nT(nE(e,"description")),u=nE(e,"TimeSpan"),p=nE(e,"TimeStamp"),c=nE(e,"ExtendedData"),h=nE(e,"visibility"),d,m=nT(nE(e,"styleUrl")),f=nE(e,"LineStyle"),y=nE(e,"PolyStyle");if(!i.geoms.length)return[];if(o&&(n.name=o),l&&(n.address=l),m){m.startsWith("#")||(m=`#${m}`),n.styleUrl=m,t[m]&&(n.styleHash=t[m]),a[m]&&(n.styleMapHash=a[m],n.styleHash=t[a[m].normal??""]);let e=r[n.styleHash??""];if(e){f||(f=nE(e,"LineStyle")),y||(y=nE(e,"PolyStyle"));let t=nE(e,"IconStyle");if(t){let e=nE(t,"Icon");if(e){let t=nT(nE(e,"href"));t&&(n.icon=t)}}}}if(s&&(n.description=s),u){let e=nT(nE(u,"begin")),t=nT(nE(u,"end"));e&&t&&(n.timespan={begin:e,end:t})}if(null!==p&&(n.timestamp=nT(nE(p,"when"))??new Date().toISOString()),null!==f){let e=nb(nT(nE(f,"color"))),t=e[0],r=e[1],a=Number.parseFloat(nT(nE(f,"width"))??"");t&&(n.stroke=t),Number.isNaN(r)||(n["stroke-opacity"]=r),Number.isNaN(a)||
128(n["stroke-width"]=a)}if(y){let e=nb(nT(nE(y,"color"))),t=e[0],r=e[1],a=nT(nE(y,"fill")),i=nT(nE(y,"outline"));t&&(n.fill=t),Number.isNaN(r)||(n["fill-opacity"]=r),a&&(n["fill-opacity"]="1"===a?n["fill-opacity"]||1:0),i&&(n["stroke-opacity"]="1"===i?n["stroke-opacity"]||1:0)}if(c){let e=nL(c,"Data"),t=nL(c,"SimpleData");for(d=0;d<e.length;d++)n[e[d].getAttribute("name")??""]=nT(nE(e[d],"value"))??"";for(d=0;d<t.length;d++)n[t[d].getAttribute("name")??""]=nT(t[d])??""}null!==h&&(n.visibility=nT(h)??""),0!==i.coordTimes.length&&(n.coordTimes=1===i.coordTimes.length?i.coordTimes[0]:i.coordTimes);let g={type:"Feature",geometry:1===i.geoms.length?i.geoms[0]:{type:"GeometryCollection",geometries:i.geoms},properties:n};return nA(e,"id")&&(g.id=nA(e,"id")??void 0),[g]}(e,i,n,o));return a}function nb(e){if(null===e)return["#000000",1];let t="",r=1,a=e;return a.startsWith("#")&&(a=a.substring(1)),(6===a.length||3===a.length)&&(t=a),8===a.length&&(r=Number.parseInt(a.substring(0,2),16)/255,t=`#${a.substring(6,8)}${a.substring(4,6)}${a.substring(2,4)}`),[t??"#000000",r??1]}function nx(e,t){let r=nL(e,t),a=[],i=[],n=[],o=r.length;if(!(o<2)){for(let e=0;e<o;e++){let t=nz(r[e]);a.push(t.coordinates),t.time&&i.push(t.time),(t.heartRate||n.length)&&(0===n.length&&(n=Array(e).fill(null)),n.push(t.heartRate))}return{line:a,times:i,heartRates:n}}}function nw(e){let t={};if(e){let r=nE(e,"line");if(r){let e=nT(nE(r,"color")),a=Number.parseFloat(nT(nE(r,"opacity"))??"0"),i=Number.parseFloat(nT(nE(r,"width"))??"0");e&&(t.stroke=e),Number.isNaN(a)||(t["stroke-opacity"]=a),Number.isNaN(i)||(t["stroke-width"]=96*i/25.4)}}return t}function nS(e){let t=nM(e,["name","cmt","desc","type","time","keywords"]),r=nL(e,"link");if(0!==r.length)for(let e of(t.links=[],Array.from(r))){let r={href:nA(e,"href"),...nM(e,["text","type"])};t.links.push(r)}return t}function nk(e){let t=0;if(!e||!e.length)return t;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t}function nL(e,t){return e.getElementsByTagName(t)}function nA(e,t){return e.getAttribute(t)}function nC(e,t){return Number.parseFloat(nA(e,t)??"0")}function nE(e,t){let r=nL(e,t);return r.length?r[0]:null}function n_(e){return e.map(Number.parseFloat).map(e=>Number.isNaN(e)?null:e)}function nT(e){return e&&e.normalize&&e.normalize(),e&&e.textContent}function nM(e,t){let r,a,i={};for(a=0;a<t.length;a++)(r=nE(e,t[a]))&&(i[t[a]]=nT(r)??"");return i}function nP(e){return n_(e.replace(/\s*/g,"").split(","))}function nI(e){let t=e.replace(/^\s*|\s*$/g,"").split(/\s+/),r=[];for(let e of t)r.push(nP(e));return r}function nz(e){let t,r=[nC(e,"lon"),nC(e,"lat")],a=nE(e,"ele"),i=nE(e,"gpxtpx:hr")||nE(e,"hr"),n=nE(e,"time");return a&&(Number.isNaN(t=Number.parseFloat(nT(a)??"0"))||r.push(t)),{coordinates:r,time:n?nT(n):null,heartRate:null!==i?Number.parseFloat(nT(i)??"0"):null}}function nR(e){let t=e;try{"string"==typeof t&&(t=nm(t))}catch{return null}try{return ng(t)}catch{}try{return nv(t)}catch{}return null}async function n$(e,t={}){var r;let a=t.download??!1,i=await (r=e,new Promise((e,t)=>{r.redraw(),r.once("idle",()=>{r.getCanvas().toBlob(r=>{r?e(r):t(Error("Screenshot could not be created."))},"image/png")})}));if(a){let e=t.filename??"maptiler_screenshot.png",r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.href=URL.createObjectURL(i),r.download=e,r.click(),setTimeout(()=>{document.body.removeChild(r),URL.revokeObjectURL(r.href)},0)}return i}let nO=[["#1D5B79","#468B97","#EF6262","#F3AA60"],["#614BC3","#33BBC5","#85E6C5","#C8FFE0"],["#461959","#7A316F","#CD6688","#AED8CC"],["#0079FF","#00DFA2","#F6FA70","#FF0060"],["#39B5E0","#A31ACB","#FF78F0","#F5EA5A"],["#37E2D5","#590696","#C70A80","#FBCB0A"],["#FFD36E","#FFF56D","#99FFCD","#9FB4FF"],["#00EAD3","#FFF5B7","#FF449F","#005F99"],["#10A19D","#540375","#FF7000","#FFBF00"]];function nF(){return nO[~~(Math.random()*nO.length)][~~(4*Math.random())]}function nj(){return`maptiler_source_${eD()}`}function nN(){return`maptiler_layer_${eD()}`}function nD(e,t){if(t<=e[0].zoom)return e[0].value;if(t>=e[e.length-1].zoom)return e[e.length-1].value;for(let r=0;r<e.length-1;r+=1)if(t>=e[r].zoom&&t<e[r+1].zoom){let a=e[r+1].zoom-e[r].zoom,i=(t-e[r].zoom)/a;return i*e[r+1].value+(1-i)*e[r].value}return 0}function nU(e){return["interpolate",["linear"],["zoom"],...e.flatMap(e=>[e.zoom,e.value])]}function nB(e){return["interpolate",["linear"],["zoom"],...e.flatMap(e=>[e.zoom,e.value])]}function nq(e,t){return"number"==typeof t&&"number"==typeof e?2*t+e:"number"==typeof t&&Array.isArray(e)?["interpolate",["linear"],["zoom"],...e.flatMap(e=>[e.zoom,2*t+e.value])]:"number"==typeof e&&Array.isArray(t)?["interpolate",["linear"],["zoom"],...t.flatMap(t=>[t.zoom,2*t.value+e])]:Array.isArray(e)&&Array.isArray(t)?["interpolate",["linear"],["zoom"],...Array.from(new Set([...e.map(e=>e.zoom),...t.map(e=>e.zoom)])).sort((e,t)=>
128e<t?-1:1).flatMap(r=>[r,2*nD(t,r)+nD(e,r)])]:0}function nG(e,t){return["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.propertyValue,e.value])]}function nV(e){let t=e.trimStart(),r=Array.from(`${t}${" ".repeat(e.length-t.length)}`);if(!r.every(e=>" "===e||"_"===e))throw Error("A dash pattern must be composed only of whitespace and underscore characters.");if(!(r.some(e=>"_"===e)&&r.some(e=>" "===e)))throw Error("A dash pattern must contain at least one underscore and one whitespace character");let a=[1];for(let e=1;e<r.length;e+=1)r[e-1]===r[e]?a[a.length-1]+=1:a.push(1);return a}function nH(e,t){return["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.value,e.color])]}function nW(e,t,r=!0){return r?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.value,.025*e.pointRadius])],2,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.value,.05*e.pointRadius])],4,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.value,.1*e.pointRadius])],8,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.value,.25*e.pointRadius])],16,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.value,e.pointRadius])]]:["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.value,e.pointRadius])]}function nZ(e,t,r=!0){return r?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.propertyValue,.025*e.value])],2,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.propertyValue,.05*e.value])],4,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.propertyValue,.1*e.value])],8,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.propertyValue,.25*e.value])],16,["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.propertyValue,e.value])]]:["interpolate",["linear"],["get",t],...e.flatMap(e=>[e.propertyValue,e.value])]}function nK(e,t){return e.every(t=>t.color[3]===e[0].color[3])?e[0].color[3]?e[0].color[3]/255:1:["interpolate",["linear"],["get",t],...e.getRawColorStops().flatMap(e=>{let t=e.value,r=e.color;return[t,4===r.length?r[3]/255:1]})]}function nJ(e,t=10){return["interpolate",["linear"],["heatmap-density"],...Array.from({length:t+1},(r,a)=>{let i=a/t;return[i,e.getColorHex(i)]}).flat()]}function nX(e){let t=e.toString(16);return 1===t.length?`0${t}`:t}class nY extends Array{constructor(e={}){super(),G(this,"min",0),G(this,"max",1),"min"in e&&(this.min=e.min),"max"in e&&(this.max=e.max),"stops"in e&&this.setStops(e.stops,{clone:!1})}static fromArrayDefinition(e){return new nY({stops:e.map(e=>({value:e[0],color:e[1]}))})}setStops(e,t={clone:!0}){let r=t.clone?this.clone():this;r.length=0;let a=1/0,i=-1/0;for(let t=0;t<e.length;t+=1)a=Math.min(a,e[t].value),i=Math.max(i,e[t].value),r.push({value:e[t].value,color:e[t].color.slice()});return r.sort((e,t)=>e.value<t.value?-1:1),this.min=a,this.max=i,r}scale(e,t,r={clone:!0}){let a=r.clone,i=this[0].value,n=this.at(-1).value-i,o=t-e,l=[];for(let t=0;t<this.length;t+=1){let r=(this[t].value-i)/n*o+e;a?l.push({value:r,color:this[t].color.slice()}):this[t].value=r}return a?new nY({stops:l}):this}at(e){return e<0?this[this.length+e]:this[e]}clone(){return new nY({stops:this.getRawColorStops()})}getRawColorStops(){let e=[];for(let t=0;t<this.length;t+=1)e.push({value:this[t].value,color:this[t].color});return e}reverse(e={clone:!0}){let t=e.clone?this.clone():this;for(let e=0;e<~~(t.length/2);e+=1){let r=t[e].color;t[e].color=t.at(-(e+1)).color,t.at(-(e+1)).color=r}return t}getBounds(){return{min:this.min,max:this.max}}getColor(e,t={smooth:!0}){if(e<=this[0].value)return this[0].color;if(e>=this.at(-1).value)return this.at(-1).color;for(let r=0;r<this.length-1;r+=1){if(e>this[r+1].value)continue;let a=this[r].color;if(!t.smooth)return a.slice();
128let i=this[r].value,n=this[r+1].value,o=this[r+1].color,l=(n-e)/(n-i);return a.map((e,t)=>Math.round(e*l+o[t]*(1-l)))}return[0,0,0]}getColorHex(e,t={smooth:!0,withAlpha:!1}){var r;return r=this.getColor(e,t),`#${nX(r[0])}${nX(r[1])}${nX(r[2])}${4===r.length?nX(r[3]):""}`}getColorRelative(e,t={smooth:!0}){let r=this.getBounds();return this.getColor(r.min+e*(r.max-r.min),t)}getCanvasStrip(e={horizontal:!0,size:512,smooth:!0}){let t=document.createElement("canvas");t.width=e.horizontal?e.size:1,t.height=e.horizontal?1:e.size;let r=t.getContext("2d");if(!r)throw Error("Canvs context is missing");let a=r.getImageData(0,0,t.width,t.height),i=a.data,n=e.size,o=this[0].value,l=(this.at(-1).value-o)/n;for(let t=0;t<n;t+=1){let r=this.getColor(o+t*l,{smooth:e.smooth});i[4*t]=r[0],i[4*t+1]=r[1],i[4*t+2]=r[2],i[4*t+3]=r.length>3?r[3]:255}return r.putImageData(a,0,0),t}resample(e,t=15){let r,a=this.getBounds(),i=this.scale(0,1),n=1/(t-1);if("ease-in-square"===e)r=Array.from({length:t},(e,t)=>{let r=t*n,a=i.getColor(r**2);return{value:r,color:a}});else if("ease-out-square"===e)r=Array.from({length:t},(e,t)=>{let r=t*n,a=i.getColor(1-(1-r)**2);return{value:r,color:a}});else if("ease-out-sqrt"===e)r=Array.from({length:t},(e,t)=>{let r=t*n,a=i.getColor(r**.5);return{value:r,color:a}});else if("ease-in-sqrt"===e)r=Array.from({length:t},(e,t)=>{let r=t*n,a=i.getColor(1-(1-r)**.5);return{value:r,color:a}});else if("ease-out-exp"===e)r=Array.from({length:t},(e,t)=>{let r=t*n,a=i.getColor(1-2**(-10*r));return{value:r,color:a}});else if("ease-in-exp"===e)r=Array.from({length:t},(e,t)=>{let r=t*n,a=i.getColor(2**(10*r-10));return{value:r,color:a}});else throw Error("Invalid ressampling method.");return new nY({stops:r}).scale(a.min,a.max)}transparentStart(){let e=this.getRawColorStops();for(let t of(e.unshift({value:e[0].value,color:e[0].color.slice()}),e[1].value+=.001,e))3===t.color.length&&t.color.push(255);return e[0].color[3]=0,new nY({stops:e})}hasTransparentStart(){return 4===this[0].color.length&&0===this[0].color[3]}}let nQ={NULL:new nY({stops:[{value:0,color:[0,0,0,0]},{value:1,color:[0,0,0,0]}]}),GRAY:new nY({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),JET:new nY({stops:[{value:0,color:[0,0,131]},{value:.125,color:[0,60,170]},{value:.375,color:[5,255,255]},{value:.625,color:[255,255,0]},{value:.875,color:[250,0,0]},{value:1,color:[128,0,0]}]}),HSV:new nY({stops:[{value:0,color:[255,0,0]},{value:.169,color:[253,255,2]},{value:.173,color:[247,255,2]},{value:.337,color:[0,252,4]},{value:.341,color:[0,252,10]},{value:.506,color:[1,249,255]},{value:.671,color:[2,0,253]},{value:.675,color:[8,0,253]},{value:.839,color:[255,0,251]},{value:.843,color:[255,0,245]},{value:1,color:[255,0,6]}]}),HOT:new nY({stops:[{value:0,color:[0,0,0]},{value:.3,color:[230,0,0]},{value:.6,color:[255,210,0]},{value:1,color:[255,255,255]}]}),SPRING:new nY({stops:[{value:0,color:[255,0,255]},{value:1,color:[255,255,0]}]}),SUMMER:new nY({stops:[{value:0,color:[0,128,102]},{value:1,color:[255,255,102]}]}),AUTOMN:new nY({stops:[{value:0,color:[255,0,0]},{value:1,color:[255,255,0]}]}),WINTER:new nY({stops:[{value:0,color:[0,0,255]},{value:1,color:[0,255,128]}]}),BONE:new nY({stops:[{value:0,color:[0,0,0]},{value:.376,color:[84,84,116]},{value:.753,color:[169,200,200]},{value:1,color:[255,255,255]}]}),COPPER:new nY({stops:[{value:0,color:[0,0,0]},{value:.804,color:[255,160,102]},{value:1,color:[255,199,127]}]}),GREYS:new nY({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),YIGNBU:new nY({stops:[{value:0,color:[8,29,88]},{value:.125,color:[37,52,148]},{value:.25,color:[34,94,168]},{value:.375,color:[29,145,192]},{value:.5,color:[65,182,196]},{value:.625,color:[127,205,187]},{value:.75,color:[199,233,180]},{value:.875,color:[237,248,217]},{value:1,color:[255,255,217]}]}),GREENS:new nY({stops:[{value:0,color:[0,68,27]},{value:.125,color:[0,109,44]},{value:.25,color:[35,139,69]},{value:.375,color:[65,171,93]},{value:.5,color:[116,196,118]},{value:.625,color:[161,217,155]},{value:.75,color:[199,233,192]},{value:.875,color:[229,245,224]},{value:1,color:[247,252,245]}]}),YIORRD:new nY({stops:[{value:0,color:[128,0,38]},{value:.125,color:[189,0,38]},{value:.25,color:[227,26,28]},{value:.375,color:[252,78,42]},{value:.5,color:[253,141,60]},{value:.625,color:[254,178,76]}
128,{value:.75,color:[254,217,118]},{value:.875,color:[255,237,160]},{value:1,color:[255,255,204]}]}),BLUERED:new nY({stops:[{value:0,color:[0,0,255]},{value:1,color:[255,0,0]}]}),RDBU:new nY({stops:[{value:0,color:[5,10,172]},{value:.35,color:[106,137,247]},{value:.5,color:[190,190,190]},{value:.6,color:[220,170,132]},{value:.7,color:[230,145,90]},{value:1,color:[178,10,28]}]}),PICNIC:new nY({stops:[{value:0,color:[0,0,255]},{value:.1,color:[51,153,255]},{value:.2,color:[102,204,255]},{value:.3,color:[153,204,255]},{value:.4,color:[204,204,255]},{value:.5,color:[255,255,255]},{value:.6,color:[255,204,255]},{value:.7,color:[255,153,255]},{value:.8,color:[255,102,204]},{value:.9,color:[255,102,102]},{value:1,color:[255,0,0]}]}),RAINBOW:new nY({stops:[{value:0,color:[150,0,90]},{value:.125,color:[0,0,200]},{value:.25,color:[0,25,255]},{value:.375,color:[0,152,255]},{value:.5,color:[44,255,150]},{value:.625,color:[151,255,0]},{value:.75,color:[255,234,0]},{value:.875,color:[255,111,0]},{value:1,color:[255,0,0]}]}),PORTLAND:new nY({stops:[{value:0,color:[12,51,131]},{value:.25,color:[10,136,186]},{value:.5,color:[242,211,56]},{value:.75,color:[242,143,56]},{value:1,color:[217,30,30]}]}),BLACKBODY:new nY({stops:[{value:0,color:[0,0,0]},{value:.2,color:[230,0,0]},{value:.4,color:[230,210,0]},{value:.7,color:[255,255,255]},{value:1,color:[160,200,255]}]}),EARTH:new nY({stops:[{value:0,color:[0,0,130]},{value:.1,color:[0,180,180]},{value:.2,color:[40,210,40]},{value:.4,color:[230,230,50]},{value:.6,color:[120,70,20]},{value:1,color:[255,255,255]}]}),ELECTRIC:new nY({stops:[{value:0,color:[0,0,0]},{value:.15,color:[30,0,100]},{value:.4,color:[120,0,100]},{value:.6,color:[160,90,0]},{value:.8,color:[230,200,0]},{value:1,color:[255,250,220]}]}),VIRIDIS:new nY({stops:[{value:0,color:[68,1,84]},{value:.13,color:[71,44,122]},{value:.25,color:[59,81,139]},{value:.38,color:[44,113,142]},{value:.5,color:[33,144,141]},{value:.63,color:[39,173,129]},{value:.75,color:[92,200,99]},{value:.88,color:[170,220,50]},{value:1,color:[253,231,37]}]}),INFERNO:new nY({stops:[{value:0,color:[0,0,4]},{value:.13,color:[31,12,72]},{value:.25,color:[85,15,109]},{value:.38,color:[136,34,106]},{value:.5,color:[186,54,85]},{value:.63,color:[227,89,51]},{value:.75,color:[249,140,10]},{value:.88,color:[249,201,50]},{value:1,color:[252,255,164]}]}),MAGMA:new nY({stops:[{value:0,color:[0,0,4]},{value:.13,color:[28,16,68]},{value:.25,color:[79,18,123]},{value:.38,color:[129,37,129]},{value:.5,color:[181,54,122]},{value:.63,color:[229,80,100]},{value:.75,color:[251,135,97]},{value:.88,color:[254,194,135]},{value:1,color:[252,253,191]}]}),PLASMA:new nY({stops:[{value:0,color:[13,8,135]},{value:.13,color:[75,3,161]},{value:.25,color:[125,3,168]},{value:.38,color:[168,34,150]},{value:.5,color:[203,70,121]},{value:.63,color:[229,107,93]},{value:.75,color:[248,148,65]},{value:.88,color:[253,195,40]},{value:1,color:[240,249,33]}]}),WARM:new nY({stops:[{value:0,color:[125,0,179]},{value:.13,color:[172,0,187]},{value:.25,color:[219,0,170]},{value:.38,color:[255,0,130]},{value:.5,color:[255,63,74]},{value:.63,color:[255,123,0]},{value:.75,color:[234,176,0]},{value:.88,color:[190,228,0]},{value:1,color:[147,255,0]}]}),COOL:new nY({stops:[{value:0,color:[125,0,179]},{value:.13,color:[116,0,218]},{value:.25,color:[98,74,237]},{value:.38,color:[68,146,231]},{value:.5,color:[0,204,197]},{value:.63,color:[0,247,146]},{value:.75,color:[0,255,88]},{value:.88,color:[40,255,8]},{value:1,color:[147,255,0]}]}),RAINBOW_SOFT:new nY({stops:[{value:0,color:[125,0,179]},{value:.1,color:[199,0,180]},{value:.2,color:[255,0,121]},{value:.3,color:[255,108,0]},{value:.4,color:[222,194,0]},{value:.5,color:[150,255,0]},{value:.6,color:[0,255,55]},{value:.7,color:[0,246,150]},{value:.8,color:[50,167,222]},{value:.9,color:[103,51,235]},{value:1,color:[124,0,186]}]}),BATHYMETRY:new nY({stops:[{value:0,color:[40,26,44]},{value:.13,color:[59,49,90]},{value:.25,color:[64,76,139]},{value:.38,color:[63,110,151]},{value:.5,color:[72,142,158]},{value:.63,color:[85,174,163]},{value:.75,color:[120,206,163]}
128,{value:.88,color:[187,230,172]},{value:1,color:[253,254,204]}]}),CDOM:new nY({stops:[{value:0,color:[47,15,62]},{value:.13,color:[87,23,86]},{value:.25,color:[130,28,99]},{value:.38,color:[171,41,96]},{value:.5,color:[206,67,86]},{value:.63,color:[230,106,84]},{value:.75,color:[242,149,103]},{value:.88,color:[249,193,135]},{value:1,color:[254,237,176]}]}),CHLOROPHYLL:new nY({stops:[{value:0,color:[18,36,20]},{value:.13,color:[25,63,41]},{value:.25,color:[24,91,59]},{value:.38,color:[13,119,72]},{value:.5,color:[18,148,80]},{value:.63,color:[80,173,89]},{value:.75,color:[132,196,122]},{value:.88,color:[175,221,162]},{value:1,color:[215,249,208]}]}),DENSITY:new nY({stops:[{value:0,color:[54,14,36]},{value:.13,color:[89,23,80]},{value:.25,color:[110,45,132]},{value:.38,color:[120,77,178]},{value:.5,color:[120,113,213]},{value:.63,color:[115,151,228]},{value:.75,color:[134,185,227]},{value:.88,color:[177,214,227]},{value:1,color:[230,241,241]}]}),FREESURFACE_BLUE:new nY({stops:[{value:0,color:[30,4,110]},{value:.13,color:[47,14,176]},{value:.25,color:[41,45,236]},{value:.38,color:[25,99,212]},{value:.5,color:[68,131,200]},{value:.63,color:[114,156,197]},{value:.75,color:[157,181,203]},{value:.88,color:[200,208,216]},{value:1,color:[241,237,236]}]}),FREESURFACE_RED:new nY({stops:[{value:0,color:[60,9,18]},{value:.13,color:[100,17,27]},{value:.25,color:[142,20,29]},{value:.38,color:[177,43,27]},{value:.5,color:[192,87,63]},{value:.63,color:[205,125,105]},{value:.75,color:[216,162,148]},{value:.88,color:[227,199,193]},{value:1,color:[241,237,236]}]}),OXYGEN:new nY({stops:[{value:0,color:[64,5,5]},{value:.13,color:[106,6,15]},{value:.25,color:[144,26,7]},{value:.38,color:[168,64,3]},{value:.5,color:[188,100,4]},{value:.63,color:[206,136,11]},{value:.75,color:[220,174,25]},{value:.88,color:[231,215,44]},{value:1,color:[248,254,105]}]}),PAR:new nY({stops:[{value:0,color:[51,20,24]},{value:.13,color:[90,32,35]},{value:.25,color:[129,44,34]},{value:.38,color:[159,68,25]},{value:.5,color:[182,99,19]},{value:.63,color:[199,134,22]},{value:.75,color:[212,171,35]},{value:.88,color:[221,210,54]},{value:1,color:[225,253,75]}]}),PHASE:new nY({stops:[{value:0,color:[145,105,18]},{value:.13,color:[184,71,38]},{value:.25,color:[186,58,115]},{value:.38,color:[160,71,185]},{value:.5,color:[110,97,218]},{value:.63,color:[50,123,164]},{value:.75,color:[31,131,110]},{value:.88,color:[77,129,34]},{value:1,color:[145,105,18]}]}),SALINITY:new nY({stops:[{value:0,color:[42,24,108]},{value:.13,color:[33,50,162]},{value:.25,color:[15,90,145]},{value:.38,color:[40,118,137]},{value:.5,color:[59,146,135]},{value:.63,color:[79,175,126]},{value:.75,color:[120,203,104]},{value:.88,color:[193,221,100]},{value:1,color:[253,239,154]}]}),TEMPERATURE:new nY({stops:[{value:0,color:[4,35,51]},{value:.13,color:[23,51,122]},{value:.25,color:[85,59,157]},{value:.38,color:[129,79,143]},{value:.5,color:[175,95,130]},{value:.63,color:[222,112,101]},{value:.75,color:[249,146,66]},{value:.88,color:[249,196,65]},{value:1,color:[232,250,91]}]}),TURBIDITY:new nY({stops:[{value:0,color:[34,31,27]},{value:.13,color:[65,50,41]},{value:.25,color:[98,69,52]},{value:.38,color:[131,89,57]},{value:.5,color:[161,112,59]},{value:.63,color:[185,140,66]},{value:.75,color:[202,174,88]},{value:.88,color:[216,209,126]},{value:1,color:[233,246,171]}]}),VELOCITY_BLUE:new nY({stops:[{value:0,color:[17,32,64]},{value:.13,color:[35,52,116]},{value:.25,color:[29,81,156]},{value:.38,color:[31,113,162]},{value:.5,color:[50,144,169]},{value:.63,color:[87,173,176]},{value:.75,color:[149,196,189]},{value:.88,color:[203,221,211]},{value:1,color:[254,251,230]}]}),VELOCITY_GREEN:new nY({stops:[{value:0,color:[23,35,19]},{value:.13,color:[24,64,38]},{value:.25,color:[11,95,45]},{value:.38,color:[39,123,35]},{value:.5,color:[95,146,12]},{value:.63,color:[152,165,18]},{value:.75,color:[201,186,69]},{value:.88,color:[233,216,137]},{value:1,color:[255,253,205]}]}),CUBEHELIX:new nY({stops:[{value:0,color:[0,0,0]},{value:.07,color:[22,5,59]},{value:.13,color:[60,4,105]},{value:.2,color:[109,1,135]},{value:.27,color:[161,0,147]},{value:.33,color:[210,2,142]},{value:.4,color:[251,11,123]},{value:.47,color:[255,29,97]},{value:.53,color:[255,54,69]},{value:.6,color:[255,85,46]},{value:.67,color:[255,120,34]},{value:.73,color:[255,157,37]},{value:.8,color:[241,191,57]},{value:.87,color:[224,220,93]},{value:.93,color:[218,241,142]},{value:1,color:[227,253,198]}]}),CIVIDIS:new nY({stops:[{value:0,color:[0,32,77,255]},{value:.125,color:[5,54,110,255]},{value:.25,color:[65,77,108,255]},{value:.375,color:[97,100,111,255]},{value:.5,color:[125,124,121,255]},{value:.625,color:[156,149,120,255]}
128,{value:.75,color:[190,175,111,255]},{value:.875,color:[225,204,94,255]},{value:1,color:[255,235,70,255]}]}),TURBO:new nY({stops:[{value:0,color:[48,18,59,255]},{value:.125,color:[70,107,227,255]},{value:.25,color:[40,187,236,255]},{value:.375,color:[49,242,153,255]},{value:.5,color:[162,252,60,255]},{value:.625,color:[237,208,58,255]},{value:.75,color:[251,128,34,255]},{value:.875,color:[210,49,5,255]},{value:1,color:[122,4,3,255]}]}),ROCKET:new nY({stops:[{value:0,color:[250,235,221,0]},{value:.133,color:[250,235,221,255]},{value:.266,color:[246,170,130,255]},{value:.4,color:[240,96,67,255]},{value:.533,color:[203,27,79,255]},{value:.666,color:[132,30,90,255]},{value:.8,color:[63,27,68,255]},{value:1,color:[3,5,26,255]}]}),MAKO:new nY({stops:[{value:0,color:[11,4,5,255]},{value:.125,color:[43,28,53,255]},{value:.25,color:[62,53,107,255]},{value:.375,color:[59,86,152,255]},{value:.5,color:[53,123,162,255]},{value:.625,color:[53,158,170,255]},{value:.75,color:[73,193,173,255]},{value:.875,color:[150,221,181,255]},{value:1,color:[222,245,229,255]}]})},n0=Object.freeze(Object.defineProperty({__proto__:null,addHeatmap:function(e,t){if(t.layerId&&e.getLayer(t.layerId))throw Error(`A layer already exists with the layer id: ${t.layerId}`);let r=t.sourceId??nj(),a=t.layerId??nN(),i=t.minzoom??0,n=t.maxzoom??23,o=t.zoomCompensation??!0,l=t.opacity??[{zoom:i,value:0},{zoom:i+.25,value:1},{zoom:n-.25,value:1},{zoom:n,value:0}],s=Array.isArray(t.colorRamp)?t.colorRamp:nQ.TURBO.transparentStart(),u=s.getBounds();(0!==u.min||1!==u.max)&&(s=s.scale(0,1)),s.hasTransparentStart()||(s=s.transparentStart());let p=t.intensity??[{zoom:0,value:.01},{zoom:4,value:.2},{zoom:16,value:1}],c=t.property??null,h=t.weight??1,d=1;c?"number"==typeof h?(d=h,"number"==typeof t.weight&&console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`")):Array.isArray(h)?d=nG(h,c):console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"):"number"==typeof h?d=h:Array.isArray(h)&&console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");let m=[{zoom:0,value:1.25},{zoom:2,value:2.5},{zoom:4,value:5},{zoom:8,value:12.5},{zoom:16,value:50}],f=t.radius??(o?m:10),y=1;if("number"==typeof f?y=f:Array.isArray(f)&&"zoom"in f[0]?y=nB(f):c&&Array.isArray(f)&&"propertyValue"in f[0]?y=nZ(f,c,o):!c&&Array.isArray(f)&&"propertyValue"in f[0]?(y=nB(m),console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")):y=nB(m),t.data&&!e.getSource(r)){let a=t.data;"string"==typeof a&&eU(a)&&(a=`https://api.maptiler.com/data/${a}/features.json?key=${eC.apiKey}`),e.addSource(r,{type:"geojson",data:a})}return e.addLayer({id:a,type:"heatmap",source:r,minzoom:i,maxzoom:n,paint:{"heatmap-weight":d,"heatmap-intensity":"number"==typeof p?p:nB(p),"heatmap-color":nJ(s),"heatmap-radius":y,"heatmap-opacity":"number"==typeof l?l:nB(l)}},t.beforeId),{heatmapLayerId:a,heatmapSourceId:r}},addPoint:function(e,t){let r;if(t.layerId&&e.getLayer(t.layerId))throw Error(`A layer already exists with the layer id: ${t.layerId}`);let a=t.minPointRadius??10,i=t.maxPointRadius??50,n=t.cluster??!1,o=Array.isArray(t.pointColor)?t.pointColor:nQ.TURBO.scale(10,t.cluster?1e4:1e3).resample("ease-out-square"),l=o.getBounds(),s=t.sourceId??nj(),u=t.layerId??nN(),p=t.showLabel??n,c=t.alignOnViewport??!0,h=t.outline??!1,d=t.outlineOpacity??1,m=t.outlineWidth??1,f=t.outlineColor??"#FFFFFF",y=t.zoomCompensation??!0,g=t.minzoom??0,v=t.maxzoom??23;r="number"==typeof t.pointOpacity?t.pointOpacity:Array.isArray(t.pointOpacity)?nB(t.pointOpacity):t.cluster?nK(o,"point_count"):t.property?nK(o,t.property):nB([{zoom:g,value:0},{zoom:g+.25,value:1},{zoom:v-.25,value:1},{zoom:v,value:0}]);let b={pointLayerId:u,clusterLayerId:"",labelLayerId:"",pointSourceId:s};if(t.data&&!e.getSource(s)){let r=t.data;"string"==typeof r&&eU(r)&&(r=`https://api.maptiler.com/data/${r}/features.json?key=${eC.apiKey}`),e.addSource(s,{type:"geojson",data:r,cluster:n})}if(n){b.clusterLayerId=`${u}_cluster`;let n=Array.from({length:20},(e,t)=>{let r=l.min+t*(l.max-l.min)/19;return{value:r,pointRadius:a+(i-a)*(t/19)**.5,color:o.getColorHex(r)}});
128e.addLayer({id:b.clusterLayerId,type:"circle",source:s,filter:["has","point_count"],paint:{"circle-color":"string"==typeof t.pointColor?t.pointColor:nH(n,"point_count"),"circle-radius":"number"==typeof t.pointRadius?t.pointRadius:Array.isArray(t.pointRadius)?nB(t.pointRadius):nW(n,"point_count",!1),"circle-pitch-alignment":c?"viewport":"map","circle-pitch-scale":"map","circle-opacity":r,...h&&{"circle-stroke-opacity":"number"==typeof d?d:nB(d),"circle-stroke-width":"number"==typeof m?m:nB(m),"circle-stroke-color":"string"==typeof f?f:nU(f)}},minzoom:g,maxzoom:v},t.beforeId),e.addLayer({id:b.pointLayerId,type:"circle",source:s,filter:["!",["has","point_count"]],paint:{"circle-pitch-alignment":c?"viewport":"map","circle-pitch-scale":"map","circle-color":"string"==typeof t.pointColor?t.pointColor:o.getColorHex(o.getBounds().min),"circle-radius":"number"==typeof t.pointRadius?t.pointRadius:Array.isArray(t.pointRadius)?nB(t.pointRadius):.75*n[0].pointRadius,"circle-opacity":r,...h&&{"circle-stroke-opacity":"number"==typeof d?d:nB(d),"circle-stroke-width":"number"==typeof m?m:nB(m),"circle-stroke-color":"string"==typeof f?f:nU(f)}},minzoom:g,maxzoom:v},t.beforeId)}else{let n="string"==typeof t.pointColor?t.pointColor:Array.isArray(t.pointColor)?t.pointColor.getColorHex(t.pointColor.getBounds().min):nF(),u="number"==typeof t.pointRadius?y?nB([{zoom:0,value:.025*t.pointRadius},{zoom:2,value:.05*t.pointRadius},{zoom:4,value:.1*t.pointRadius},{zoom:8,value:.25*t.pointRadius},{zoom:16,value:+t.pointRadius}]):t.pointRadius:Array.isArray(t.pointRadius)?nB(t.pointRadius):y?nB([{zoom:0,value:.05*a},{zoom:2,value:.1*a},{zoom:4,value:.2*a},{zoom:8,value:.5*a},{zoom:16,value:+a}]):a;if(t.property&&Array.isArray(t.pointColor)){let e=Array.from({length:20},(e,r)=>{let n=l.min+r*(l.max-l.min)/19;return{value:n,pointRadius:"number"==typeof t.pointRadius?t.pointRadius:a+(i-a)*(r/19)**.5,color:"string"==typeof t.pointColor?t.pointColor:o.getColorHex(n)}});n=nH(e,t.property),u=nW(e,t.property,y)}e.addLayer({id:b.pointLayerId,type:"circle",source:s,layout:{"circle-sort-key":t.property?["/",1,["get",t.property]]:0},paint:{"circle-pitch-alignment":c?"viewport":"map","circle-pitch-scale":"map","circle-color":n,"circle-opacity":r,"circle-radius":u,...h&&{"circle-stroke-opacity":"number"==typeof d?d:nB(d),"circle-stroke-width":"number"==typeof m?m:nB(m),"circle-stroke-color":"string"==typeof f?f:nU(f)}},minzoom:g,maxzoom:v},t.beforeId)}if(!1!==p&&(t.cluster||t.property)){b.labelLayerId=`${u}_label`;let a=t.labelColor??"#fff",i=t.labelSize??12;e.addLayer({id:b.labelLayerId,type:"symbol",source:s,filter:["has",t.cluster?"point_count":t.property],layout:{"text-field":t.cluster?"{point_count_abbreviated}":`{${t.property}}`,"text-font":["Noto Sans Regular"],"text-size":i,"text-pitch-alignment":c?"viewport":"map","symbol-sort-key":["/",1,["get",t.cluster?"point_count":t.property]]},paint:{"text-color":a,"text-opacity":r},minzoom:g,maxzoom:v},t.beforeId)}return b},addPolygon:function(e,t){if(t.layerId&&e.getLayer(t.layerId))throw Error(`A layer already exists with the layer id: ${t.layerId}`);let r=t.sourceId??nj(),a=t.layerId??nN(),i={polygonLayerId:a,polygonOutlineLayerId:t.outline?`${a}_outline`:"",polygonSourceId:r};if(t.data&&!e.getSource(r)){let a=t.data;"string"==typeof a&&eU(a)&&(a=`https://api.maptiler.com/data/${a}/features.json?key=${eC.apiKey}`),e.addSource(r,{type:"geojson",data:a})}let n=t.outlineDashArray??null,o=t.outlineWidth??1,l=t.outlineColor??"#FFFFFF",s=t.outlineOpacity??1,u=t.outlineBlur??0,p=t.fillColor??nF(),c=t.fillOpacity??1,h=t.outlinePosition??"center",d=t.pattern??null;"string"==typeof n&&(n=nV(n));let m=(d=null)=>{if(e.addLayer({id:a,type:"fill",source:r,minzoom:t.minzoom??0,maxzoom:t.maxzoom??23,paint:{"fill-color":"string"==typeof p?p:nU(p),"fill-opacity":"number"==typeof c?c:nB(c),...d&&{"fill-pattern":d}}},t.beforeId),!0===t.outline){let a;a="inside"===h?"number"==typeof o?.5*o:nB(o.map(({zoom:e,value:t})=>({zoom:e,value:.5*t}))):"outside"===h?"number"==typeof o?-.5*o:nB(o.map(e=>({zoom:e.zoom,value:-.5*e.value}))):0,e.addLayer({id:i.polygonOutlineLayerId,type:"line",source:r,layout:{"line-join":t.outlineJoin??"round","line-cap":t.outlineCap??"butt"},minzoom:t.minzoom??0,maxzoom:t.maxzoom??23,paint:{"line-opacity":"number"==typeof s?s:nB(s),"line-color":"string"==typeof l?l:nU(l),"line-width":"number"==typeof o?o:nB(o),"line-blur"
128:"number"==typeof u?u:nB(u),"line-offset":a,...n&&{"line-dasharray":n}}},t.beforeId)}};return d?e.hasImage(d)?m(d):e.loadImage(d).then(t=>{e.addImage(d,t.data),m(d)}).catch(e=>{console.error("Could not load the pattern image.",e.message),m()}):m(),i},addPolyline:async function e(t,r,a={}){if(!r.sourceId&&!r.data)throw Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");let i=r.data;if("string"==typeof i){if(eU(i))i=`https://api.maptiler.com/data/${i}/features.json?key=${eC.apiKey}`;else{if(/^(?:\w+:|\.|\/)/.test(i)){let e=await fetch(i,a);if(!e.ok)throw Error(`Failed to fetch polyline data: fetching URL ${i} failed with status ${String(e.status)}.`);i=await e.text()}i=function(e){try{return JSON.parse(e)}catch{}return null}(i)??nR(i)??""}if(!i)throw Error("Failed to parse polyline data: expected GeoJSON, GPX, or KML.")}return function(e,t){if(t.layerId&&e.getLayer(t.layerId))throw Error(`A layer already exists with the layer id: ${t.layerId}`);let r=t.sourceId??nj(),a=t.layerId??nN(),i={polylineLayerId:a,polylineOutlineLayerId:"",polylineSourceId:r};t.data&&!e.getSource(r)&&e.addSource(r,{type:"geojson",data:t.data});let n=t.lineWidth??3,o=t.lineColor??nF(),l=t.lineOpacity??1,s=t.lineBlur??0,u=t.lineGapWidth??0,p=t.lineDashArray??null,c=t.outlineWidth??1,h=t.outlineColor??"#FFFFFF",d=t.outlineOpacity??1,m=t.outlineBlur??0;if("string"==typeof p&&(p=nV(p)),!0===t.outline){let o=`${a}_outline`;i.polylineOutlineLayerId=o,e.addLayer({id:o,type:"line",source:r,layout:{"line-join":t.lineJoin??"round","line-cap":t.lineCap??"round"},minzoom:t.minzoom??0,maxzoom:t.maxzoom??23,paint:{"line-opacity":"number"==typeof d?d:nB(d),"line-color":"string"==typeof h?h:nU(h),"line-width":nq(n,c),"line-blur":"number"==typeof m?m:nB(m)}},t.beforeId)}return e.addLayer({id:a,type:"line",source:r,layout:{"line-join":t.lineJoin??"round","line-cap":t.lineCap??"round"},minzoom:t.minzoom??0,maxzoom:t.maxzoom??23,paint:{"line-opacity":"number"==typeof l?l:nB(l),"line-color":"string"==typeof o?o:nU(o),"line-width":"number"==typeof n?n:nB(n),"line-blur":"number"==typeof s?s:nB(s),"line-gap-width":"number"==typeof u?u:nB(u),...p&&{"line-dasharray":p}}},t.beforeId),i}(t,{...r,data:i})},colorDrivenByProperty:nH,colorPalettes:nO,computeRampedOutlineWidth:nq,dashArrayMaker:nV,generateRandomLayerName:nN,generateRandomSourceName:nj,getRandomColor:nF,heatmapIntensityFromColorRamp:nJ,lerpZoomNumberValues:nD,opacityDrivenByProperty:nK,paintColorOptionsToPaintSpec:nU,radiusDrivenByProperty:nW,radiusDrivenByPropertyHeatmap:nZ,rampedOptionsToLayerPaintSpec:nB,rampedPropertyValueWeight:nG,takeScreenshot:n$},Symbol.toStringTag,{value:"Module"}));function n1(e){if(0===e.length)throw Error("[lerpArrayValues]: Array empty, nothing to interpolate");if(e.every(e=>null===e))throw Error("[lerpArrayValues]: Cannot interpolate an array where all values are `null`");return e.map((e,t,r)=>{if("number"==typeof e)return e;let[a,i]=function(e,t){for(let r=t-1;r>=0;r--)if(null!==e[r])return[r,e[r]];return[null,null]}(r,t),[n,o]=function(e,t){for(let r=t+1;r<e.length;r++)if(null!==e[r])return[r,e[r]];return[null,null]}(r,t);return null===a||null===i?r[t+1]:null===n||null===o?i:i+(t-a)/(n-a)*(o-i)})}let n2={defaultEasing:"Linear",pathSmoothing:{resolution:20,epsilon:5}},n5=["MultiPoint","LineString","MultiLineString","Polygon"];function n3(e,t={}){let{defaultEasing:r,pathSmoothing:a,ignoreFields:i}={...n2,...t},n=e.geometry,o=e.properties??{},l=o["@easing"];l||console.warn(`[parseGeoJSONFeatureToKeyframes]: No '@easing' property found in GeoJSON properties, using default easing ${r}`);let s=o["@delta"];if(s||console.warn("[parseGeoJSONFeatureToKeyframes]: No '@delta' property found in GeoJSON properties, delta for each frame will default to its index divided by the total"),!n.type)throw Error("[parseGeoJSONFeatureToKeyframes]: No geometry found in feature");if(!n5.includes(n.type))throw Error(`[parseGeoJSONFeatureToKeyframes]: Geometry type '${n.type}' is not supported. Accepted types are: ${n5.join(", ")}`);let u="LineString"!==n.type&&"MultiPoint"!==n.type?n.coordinates.flat():n.coordinates,p=u.map(e=>e.length>2?e[2]:null),c=p.every(e=>null===e),h=Object.entries({...o,...!c&&{altitude:p}}).reduce((e,[t,r])=>t.startsWith("@")||null!=i&&i.includes(t)?e:{...e,[t]:r},{}),d=s??u.map((e,t)=>t/u.length),m=l??d.map(()=>r??"Linear");
128if(u.some(e=>e.length>2)&&console.warn("[parseGeoJSONFeatureToKeyframes]: Smoothing is not supported for 3D paths, only 2D smoothing will be applied, ignoring altitude"),a){let e=n9(u,a.resolution,a.epsilon),t=n1(n4([0,1],e.length)),i=t.map(()=>r??"Linear"),n=Object.entries(h).reduce((t,[r,a])=>{if(!Array.isArray(a))return t;let i=n4(a,e.length);return{...t,[r]:i}},{});return n8(e,t,i,n)}return n8(u,d,m,h)}function n4(e,t){let r=e.map((r,a)=>Math.round(a/(e.length-1)*(t-1)));return Array.from({length:t},(t,a)=>r.includes(a)?e[r.indexOf(a)]:null)}function n8(e,t,r,a={}){if(!function(...e){let t=e[0].length;return e.every(e=>e.length===t)}(e,t,r,...Object.values(a)))throw Error(` 129 [parseGeoJSONFeatureToKeyframes]: If smoothing is not applied, coordinates, deltas, easings and property arrays must be the same length 130 131 Coordinates: ${e.length} 132 Deltas: ${t.length} 133 Easing: ${r.length} 134 Properties: 135 ${Object.entries(a).map(([e,t])=>`"${e}": ${t.length}`).join(`, 136 `)} 137 `);let i=e.some(e=>e.length>2);return e.map((e,n)=>{let o=t[n],l=r[n];return{props:{...Object.entries(a).reduce((e,[t,r])=>({...e,[t]:r[n]}),{}),lng:e[0],lat:e[1],...i&&{altitude:e[2]??null}},delta:o,easing:l}})}function n6(e,t,r,a,i,n,o,l){let s=[r[0]+(a[0]-t[0])/6,r[1]+(a[1]-t[1])/6],u=[a[0]-(i[0]-r[0])/6,a[1]-(i[1]-r[1])/6],p=1/n,c=o-p;for(let t=o;t<=l;t+=p){let i=(1-t)**3*r[0]+3*(1-t)**2*t*s[0]+3*(1-t)*t**2*u[0]+t**3*a[0],n=(1-t)**3*r[1]+3*(1-t)**2*t*s[1]+3*(1-t)*t**2*u[1]+t**3*a[1];e.push([i,n]),c=t}let h=(1-l)**3*r[0]+3*(1-l)**2*l*s[0]+3*(1-l)*l**2*u[0]+l**3*a[0],d=(1-l)*
137*3*r[1]+3*(1-l)**2*l*s[1]+3*(1-l)*l**2*u[1]+l**3*a[1];l-c>1e-10?e.push([h,d]):e[e.length-1]=[h,d]}function n9(e,t=20,r){let a="number"==typeof r?oe(e,r):e;if(a.length<4)return a;"number"==typeof r&&(a[a.length-1]=[...e[e.length-1]]);let i=[];n6(i,[2*a[0][0]-a[1][0],2*a[0][1]-a[1][1]],a[0],a[1],a[2],t,0,1);let n=1/t;for(let e=1;e<a.length-2;e++)n6(i,a[e-1],a[e],a[e+1],a[e+2],t,n,1);let o=[2*a[a.length-1][0]-a[a.length-2][0],2*a[a.length-1][1]-a[a.length-2][1]];return n6(i,a[a.length-3],a[a.length-2],a[a.length-1],o,t,n,1),i}function n7(e){return e.map((t,r)=>{if(0===r)return 0;let a=e[r-1],i=new oU(t[0],t[1]),n=new oU(a[0],a[1]);return i.distanceTo(n)}).reduce((e,t)=>e+t,0)/e.length}function oe(e,t){let r=ot(e,n7(e)*t);if(r.length<2)return r;let a=[r[0]],i=r[0];for(let e=1;e<r.length;e++){let n=r[e],o=new oU(i[0],i[1]),l=new oU(n[0],n[1]);o.distanceTo(l)>=t&&(a.push(n),i=n)}return a.push([...e[e.length-1]]),a}function ot(e,t=10){if(e.length<2)return e;let r=[e[0]],a=t;for(let o=0;o<e.length-1;){let l=oU.convert(e[o]),s=oU.convert(e[o+1]),u=l.distanceTo(s);if(u<a)a-=u,o++;else{var i,n;let p=a/u,c=[(i=l.lng,i+(s.lng-i)*p),(n=l.lat,n+(s.lat-n)*p)];r.push(c),e[o]=c,a=t}}let o=e[e.length-1],l=r[r.length-1];return(l[0]!==o[0]||l[1]!==o[1])&&r.push([o[0],o[1]]),r}let or={animations:[],running:!1,add(e){this.animations.push(e),this.running||(this.running=!0,this.start())},remove(e){this.animations=this.animations.filter(t=>t!==e),0===this.animations.length&&this.stop()},stop(){this.running=!1},start(){if(!this.running)return;let e=()=>{if(0===this.animations.length){this.running=!1;return}this.animations.forEach(e=>{e.isPlaying&&e.updateInternal()}),requestAnimationFrame(e)};e()}},oa=["pause","reset","play","stop","timeupdate","scrub","playbackratechange","animationstart","animationend","keyframe","iteration"],oi={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){let t=2*e;return t<1?.5*t*t:-.5*((t-=1)*(t-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){let t=2*e;return t<1?.5*t*t*t:.5*((t-=2)*t*t+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return 0===e?0:1024**(e-1)},ExponentialOut:function(e){return 1===e?1:1-2**(-10*e)},ExponentialInOut:function(e){if(0===e)return 0;if(1===e)return 1;let t=2*e;return t<1?.5*1024**(t-1):.5*(-(2**(-10*(t-1)))+2)},ElasticIn:function(e){let t,r=.1;return 0===e?0:1===e?1:(r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),e-=1,-(r*2**(10*e)*Math.sin(2*Math.PI*(e-t)/.4)))},ElasticOut:function(e){let t,r=.1;return 0===e?0:1===e?1:(r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),r*2**(-10*e)*Math.sin(2*Math.PI*(e-t)/.4)+1)},ElasticInOut:function(e){let t,r=.1;if(0===e)return 0;if(1===e)return 1;r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI);let a=2*e;if(a<1){let e=a-1;return-(r*2**(10*e)*Math.sin(2*Math.PI*(e-t)/.4)*.5)}let i=a-1;return r*2**(-10*i)*Math.sin(2*Math.PI*(i-t)/.4)*.5+1},BounceIn:on,BounceOut:oo,BounceInOut:function(e){return e<.5?.5*on(2*e):.5*oo(2*e-1)+.5}};function on(e){return 1-oo(1-e)}function oo(e){if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){let t=e-.5454545454545454;return 7.5625*t*t+.75}if(e<2.5/2.75){let t=e-.8181818181818182;return 7.5625*t*t+.9375}let t=e-2.625/2.75;return 7.5625*t*t+.984375}class ol{constructor({keyframes:e,duration:t,iterations:r,manualMode:a,delay:i}){G(this,"playing",!1),G(this,"iterations"),G(this,"currentIteration",0),G(this,"keyframes"),G(this,"currentKeyframe"),G(this,"duration"),G(this,"effectiveDuration"),G(this,"playbackRate"),G(this,"currentTime"),G(this,"currentDelta"),G(this,"animationStartTime",0),G(this,"lastFrameAt",0),G(this,"delay",0),G(this,"delayTimeoutID"),G(this,"listeners",oa.reduce((e,t)=>(e[t]=[],e),{})),G(this,"previousProps");const n=e.map(({props:e})=>Object.keys(e)).flat().reduce((e,t)=>(t&&!e.includes(t)&&e.push(t),e),[]),o=e.sort((e,t)=>e.delta-t.delta).map(e=>{let t=n.reduce((e,t)=>
137t in e?e:{...e,[t]:null},e.props);return{...e,props:t}}),l=Object.entries(o.map(({props:e})=>e).reduce((e,t)=>{for(let[r,a]of Object.entries(t))r in e||(e[r]=[]),e[r].push(a);return e},{})).reduce((e,[t,r])=>(e[t]=n1(r),e),{});this.keyframes=o.map((e,t)=>({...e,props:n.reduce((e,r)=>(e[r]=l[r][t],e),{}),easing:e.easing??"Linear",id:(0,U.A)()})),this.duration=t,this.iterations=r,this.delay=i??0,this.playbackRate=1,this.effectiveDuration=t/this.playbackRate,this.currentTime=0,this.currentDelta=0,a||or.add(this)}get isPlaying(){return this.playing}play(){if(this.playing||this.delayTimeoutID)return this;let e=()=>{this.playing=!0,this.animationStartTime=performance.now(),this.lastFrameAt=this.animationStartTime,this.emitEvent("play")};return this.delay>0?this.delayTimeoutID=window.setTimeout(()=>{e(),this.delayTimeoutID=void 0},this.delay/this.playbackRate):e(),this}pause(){return this.playing=!1,this.emitEvent("pause"),this}stop(e=!1){return this.playing=!1,e||this.emitEvent("stop"),this}reset(e=!0){return this.stop(!0),window.clearTimeout(this.delayTimeoutID),this.currentTime=0,this.currentDelta=+(this.playbackRate<0),this.emitEvent("reset"),this.update(!1,!0),e||this.play(),this}updateInternal(){return this.playing?this.update(!1):this}update(e=!0,t=!1){let r=performance.now();if(this.currentDelta>=1||this.currentDelta<0)if(this.emitEvent("animationend"),0!==this.iterations&&!(this.currentIteration<this.iterations))return this.stop(),this;else this.reset(e);if(!t){let t=e?16:r-this.lastFrameAt,a=r-this.animationStartTime;this.lastFrameAt=r;let i=a*this.playbackRate;this.currentTime=i,this.currentDelta+=t/this.effectiveDuration}this.currentDelta>1&&(this.currentIteration=1),this.currentDelta<0&&(this.currentDelta=0);let{next:a,current:i}=this.getCurrentAndNextKeyFramesAtDelta(this.currentDelta);(null==i?void 0:i.id)!==this.currentKeyframe&&this.emitEvent("keyframe",i,a),this.currentKeyframe=null==i?void 0:i.id;let n=Object.keys((null==i?void 0:i.props)??{}).reduce((e,t)=>{if(i&&a){let r=i.props[t],n=a.props[t],o=(this.currentDelta-i.delta)/(a.delta-i.delta),l=(oi[i.easing]??(e=>e))(o);e[t]=r+(n-r)*l}return i&&!a&&(e[t]=i.props[t]),e},{});return this.previousProps||(this.previousProps=this.keyframes[0].props),this.emitEvent("timeupdate",i,a,n,this.previousProps),(this.currentDelta>=1||this.currentDelta<0)&&!t&&(this.currentIteration+=1,this.emitEvent("iteration",null,null,{})),this.previousProps={...n},this}getCurrentAndNextKeyFramesAtTime(e){return this.getCurrentAndNextKeyFramesAtDelta(e/this.effectiveDuration)}getCurrentAndNextKeyFramesAtDelta(e){let t=this.keyframes.find(t=>t.delta>e)??null;return{current:this.keyframes.findLast(t=>t.delta<=e)??null,next:t}}getCurrentTime(){return this.currentTime}setCurrentTime(e){if(e>this.effectiveDuration)throw Error("Cannot set time greater than duration");return this.currentTime=e,this.currentDelta=e/this.effectiveDuration,this.emitEvent("scrub"),this}getCurrentDelta(){return this.currentDelta}setCurrentDelta(e){if(e>1)throw Error("Cannot set delta greater than 1");return this.animationStartTime=performance.now(),this.lastFrameAt=this.animationStartTime,this.currentDelta=e,this.currentTime=e*this.effectiveDuration,this.update(!1,!0),this.emitEvent("scrub"),this}setPlaybackRate(e){return this.playbackRate=e,this.effectiveDuration=this.duration/this.playbackRate,this.emitEvent("playbackratechange"),this}getPlaybackRate(){return this.playbackRate}addEventListener(e,t){return e in this.listeners?this.listeners[e].push(t):console.warn(`Event type ${e} does not exist, ignoring`),this}removeEventListener(e,t){return e in this.listeners?this.listeners[e]=this.listeners[e].filter(e=>e!==t):console.warn(`Event type ${e} does not exist, ignoring`),this}emitEvent(e,t,r,a={},i){this.listeners[e].forEach(n=>{n({type:e,target:this,currentTime:this.currentTime,currentDelta:this.currentDelta,playbackRate:this.playbackRate,keyframe:t,nextKeyframe:r??t,props:a,previousProps:i??a})})}clone(){return new ol({keyframes:structuredClone(this.keyframes),duration:this.duration,iterations:this.iterations})}destroy(){this.stop(),this.listeners=oa.reduce((e,t)=>
137(e[t]=[],e),{}),or.remove(this)}}let os="animated-route-layer";class ou{constructor({keyframes:e,source:t,duration:r,iterations:a,easing:i,delay:n,cameraAnimation:o={},pathStrokeAnimation:l={activeColor:[255,0,0,1],inactiveColor:[0,0,255,1]},autoplay:s,manualUpdate:u=!1}){G(this,"id",`${os}-${(0,U.A)()}`),G(this,"type","custom"),G(this,"animationInstance",null),G(this,"keyframes",null),G(this,"source",null),G(this,"duration"),G(this,"iterations"),G(this,"delay"),G(this,"easing"),G(this,"map"),G(this,"cameraMaptilerAnimationOptions"),G(this,"pathStrokeAnimation"),G(this,"autoplay",!1),G(this,"manualUpdate",!1),G(this,"enquedEventHandlers",oa.reduce((e,t)=>(e[t]=[],e),{})),G(this,"enquedCommands",[]),this.keyframes=e??null,this.source=t??null,r&&(this.duration=r),a&&(this.iterations=a),n&&(this.delay=n),this.easing=i,this.cameraMaptilerAnimationOptions=!!o&&{pathSmoothing:{resolution:20,epsilon:5},follow:!0,...o&&o},l&&(this.pathStrokeAnimation=l),this.autoplay=s??!1,this.manualUpdate=u,this.update=this.update.bind(this)}async onAdd(e){if(this.map=e,this.map.getLayersOrder().some(e=>e.includes(os)&&this.id!==e))throw Error("[AnimatedRouteLayer.onAdd]: Currently, you can only have one active AnimatedRouteLayer at a time. Please remove the existing one before adding a new one.");let t=await this.getMaptilerAnimationOptions();this.animationInstance=new ol({...t,manualMode:this.manualUpdate}),this.animationInstance.addEventListener("timeupdate",this.update),Object.entries(this.enquedEventHandlers).forEach(([e,t])=>{t.forEach(t=>{var r;null==(r=this.animationInstance)||r.addEventListener(e,t)}),this.enquedEventHandlers[e]=[]}),this.enquedCommands.forEach(e=>{e()}),this.enquedCommands=[],this.autoplay&&this.animationInstance.play()}frameAdvance(){return this.animationInstance&&this.manualUpdate&&this.animationInstance.update(!0),this}addEventListener(e,t){return this.animationInstance?this.animationInstance.addEventListener(e,t):this.enquedEventHandlers[e].push(t),this}removeEventListener(e,t){return this.animationInstance&&this.animationInstance.removeEventListener(e,t),this}updateManual(){this.animationInstance&&this.manualUpdate&&this.animationInstance.update(!0)}update(e){let{props:t,currentDelta:r}=e;if(this.source&&this.pathStrokeAnimation){let{activeColor:e,inactiveColor:t}=this.pathStrokeAnimation;r>=1?this.map.setPaintProperty(this.source.layerID,"line-gradient",["interpolate",["linear"],["line-progress"],0,["rgba",...e],1,["rgba",...e]]):this.map.setPaintProperty(this.source.layerID,"line-gradient",["interpolate",["linear"],["line-progress"],0,["rgba",...e],1e-4+r,["rgba",...e],11e-5+r,["rgba",...t],1,["rgba",...t]])}if(t&&this.cameraMaptilerAnimationOptions&&this.cameraMaptilerAnimationOptions.follow){let{lng:e,lat:r,bearing:a,zoom:i,pitch:n,elevation:o}=t;this.map.jumpTo({center:[e,r],pitch:n??this.map.getPitch(),zoom:i??this.map.getZoom(),bearing:a??this.map.getBearing(),elevation:o??this.map.getCenterElevation()})}}play(){return this.animationInstance?this.animationInstance.play():this.enquedCommands.push(()=>{var e;null==(e=this.animationInstance)||e.play()}),this}pause(){return this.animationInstance?this.animationInstance.pause():this.enquedCommands.push(()=>{var e;null==(e=this.animationInstance)||e.pause()}),this}async getMaptilerAnimationOptions(){let e=this.map;if(this.source){let t=e.getSource(this.source.id);if(t){let e=await (null==t?void 0:t.getData());if(!e)throw Error("[AnimatedRouteLayer.onAdd]: No feature found in source data");if("FeatureCollection"===e.type&&(console.warn("[AnimatedRouteLayer.onAdd]: FeatureCollection found in source data, only single geojson features are currently supported, first feature will be used"),e=e.features[0]),"Feature"!==e.type)throw Error("[AnimatedRouteLayer.onAdd]: The first feature in the source data is not a valid GeoJSON of type `Feature`");let r=e;return r.properties["@duration"]&&(this.duration=r.properties["@duration"]??1e3),r.properties["@iterations"]&&(this.iterations=r.properties["@iterations"]??0),r.properties["@delay"]&&(this.delay=r.properties["@delay"]??0),r.properties["@autoplay"]&&(this.autoplay=r.properties["@autoplay"]??!1),{keyframes:n3(r,{pathSmoothing:!!this.cameraMaptilerAnimationOptions&&this.cameraMaptilerAnimationOptions.pathSmoothing,defaultEasing:this.easing}),duration:this.duration,iterations:this.iterations,delay:this.delay,autoplay:this.autoplay}}}if(this.keyframes)return{keyframes:this.keyframes,duration:this.duration,iterations:this.iterations,delay:this.delay,autoplay:this.autoplay};throw Error("[AnimatedRouteLayer.onAdd]: No keyframes or source provided")}onRemove(){var e;null==(e=this.animationInstance)||e.destroy()}render(){}}function op(){return"4.1.0"}let oc=F.Map,oh=F.Marker,od=F.Popup,om=F.Style,of=F.CanvasSource,oy=F.GeoJSONSource,og=F.ImageSource,ov=F.RasterTileSource,ob=F.RasterDEMTileSource,ox=F.VectorTileSource,ow=F.VideoSource,oS=F.NavigationControl,ok=F.GeolocateControl,oL=F.AttributionControl,oA=F.LogoControl,oC=F.ScaleControl,oE=F.FullscreenControl,o_=F.TerrainControl,oT=F.BoxZoomHandler,oM=F.ScrollZoomHandler,oP=F.CooperativeGesturesHandler,oI=F.KeyboardHandler,oz=F.TwoFingersTouchPitchHandler,oR=F.MapWheelEvent,o$=F.MapTouchEvent,oO=F.MapMouseEvent,oF=F.config,oj=F.getVersion,{setRTLTextPlugin:oN,getRTLTextPluginStatus:oD,LngLat:oU,LngLatBounds:oB,MercatorCoordinate:oq,Evented:oG,AJAXError:oV,prewarm:oH,clearPrewarmedResources:oW,Hash:oZ,Point:oK,EdgeInsets:oJ,DragRotateHandler:oX,DragPanHandler:oY,TwoFingersTouchZoomRotateHandler:oQ,DoubleClickZoomHandler:o0,TwoFingersTouchZoomHandler:o1,TwoFingersTouchRotateHandler:o2,getWorkerCount:o5,setWorkerCount:o3,getMaxParallelImageRequests:o4,setMaxParallelImageRequests:o8,getWorkerUrl:o6,setWorkerUrl:o9,addSourceType:o7,importScriptInWorkers:le,addProtocol:lt,removeProtocol:lr}=F}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.