@local-logic/sdks-app 1.0.0-beta.45 → 1.0.0-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index.fde633ba.js → index.5fab9b7a.js} +1 -1
- package/dist/assets/{index.58d7e039.js → index.a0f74ea9.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/types/context/stateManager/index.d.ts.map +1 -1
- package/dist/types/context/stateManager/index.js +2 -5
- package/dist/types/context/stateManager/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as Tf,r as Te,$ as jh,a as Xh,b as nt,j as Se,s as El,_ as Ef,c as Wh,d as Sf,i as Co,u as la,e as Sl,f as qc,g as Zc,h as If,k as Zt,t as Et,F as Il,l as Ri,m as Lc,n as os,o as jc,p as wl,q as Sh,v as ca,w as cr,x as Hh,y as Cf,U as Kh,z as Jh,L as Cl,A as tr,S as Ih,B as Af,C as oa,D as xl,E as Mf,T as Pf,G as zf,H as kf}from"./index.58d7e039.js";var sa=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};const Df=Tf["useId".toString()]||(()=>{});let Lf=0;function Yh(w){const[E,A]=Te.exports.useState(Df());return jh(()=>{w||A(z=>z!=null?z:String(Lf++))},[w]),w||(E?`radix-${E}`:"")}function Xc({prop:w,defaultProp:E,onChange:A=()=>{}}){const[z,F]=Rf({defaultProp:E,onChange:A}),N=w!==void 0,oe=N?w:z,a=Xh(A),ee=Te.exports.useCallback(te=>{if(N){const ue=typeof te=="function"?te(w):te;ue!==w&&a(ue)}else F(te)},[N,w,F,a]);return[oe,ee]}function Rf({defaultProp:w,onChange:E}){const A=Te.exports.useState(w),[z]=A,F=Te.exports.useRef(z),N=Xh(E);return Te.exports.useEffect(()=>{F.current!==z&&(N(z),F.current=z)},[z,F,N]),A}const Qh=nt.createContext({}),Zn=()=>Te.exports.useContext(Qh),Bf=(w,E)=>{switch(E.type){case"CATEGORY":return{...w,activeCategory:E.value};case"SCORE":{const A=El.find(z=>E.value===""?z.value===w.activeCategory:z.scores.includes(E.value)).value;return{activeCategory:A,activeScoreByCategory:{...w.activeScoreByCategory,[A]:E.value}}}}},Ff=({children:w})=>{const[E,A]=Te.exports.useState(!1),[z,F]=Te.exports.useReducer(Bf,{activeCategory:"commute",activeScoreByCategory:{commute:"pedestrian_friendly",amenities:"groceries",character:"vibrant",nature:"parks",education:"high_schools"}}),[N,oe]=Te.exports.useState(),[a,ee]=Te.exports.useState(),{activeCategory:te}=z,fe=z.activeScoreByCategory[te],ue=Ue=>{F({type:"SCORE",value:Ue})},ie=Ue=>{F({type:"CATEGORY",value:Ue})},qe=Te.exports.useMemo(()=>({activeScore:fe,setActiveScore:ue,activeCategory:te,setActiveCategory:ie,activePOI:N,setActivePOI:oe,hoveredPOI:a,setHoveredPOI:ee,showMobileList:E,setShowMobileList:A}),[fe,ue,te,ie,N,oe,a,ee,E,A]);return Se(Qh.Provider,{value:qe,children:w})},Of=Te.exports.createContext(null);function $f(w){const E=w.clone();return E.pixelsToGLUnits=w.pixelsToGLUnits,E}function Ch(w){return{longitude:w.center.lng,latitude:w.center.lat,zoom:w.zoom,pitch:w.pitch,bearing:w.bearing,padding:w.padding}}function Ah(w,E){const A=E.viewState||E;let z=!1;if("longitude"in A&&"latitude"in A){const F=w.center;w.center=new F.constructor(A.longitude,A.latitude),z=z||F!==w.center}if("zoom"in A){const F=w.zoom;w.zoom=A.zoom,z=z||F!==w.zoom}if("bearing"in A){const F=w.bearing;w.bearing=A.bearing,z=z||F!==w.bearing}if("pitch"in A){const F=w.pitch;w.pitch=A.pitch,z=z||F!==w.pitch}return A.padding&&!w.isPaddingEqual(A.padding)&&(z=!0,w.padding=A.padding),z}const Uf=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Mh(w){if(!w)return null;if(typeof w=="string"||("toJS"in w&&(w=w.toJS()),!w.layers))return w;const E={};for(const z of w.layers)E[z.id]=z;const A=w.layers.map(z=>{const F=E[z.ref];let N=null;if("interactive"in z&&(N={...z},delete N.interactive),F){N=N||{...z},delete N.ref;for(const oe of Uf)oe in F&&(N[oe]=F[oe])}return N||z});return{...w,layers:A}}function Vf(w,E){const A=Array.isArray(w)?w[0]:w?w.x:0,z=Array.isArray(w)?w[1]:w?w.y:0,F=Array.isArray(E)?E[0]:E?E.x:0,N=Array.isArray(E)?E[1]:E?E.y:0;return A===F&&z===N}function qn(w,E){if(w===E)return!0;if(!w||!E)return!1;if(Array.isArray(w)){if(!Array.isArray(E)||w.length!==E.length)return!1;for(let A=0;A<w.length;A++)if(!qn(w[A],E[A]))return!1;return!0}else if(Array.isArray(E))return!1;if(typeof w=="object"&&typeof E=="object"){const A=Object.keys(w),z=Object.keys(E);if(A.length!==z.length)return!1;for(const F of A)if(!E.hasOwnProperty(F)||!qn(w[F],E[F]))return!1;return!0}return!1}const Ph={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Rc={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},zh={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Nf=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Gf=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class ss{constructor(E,A,z){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=F=>{const N=this.props[zh[F.type]];N&&N(F)},this._onPointerEvent=F=>{(F.type==="mousemove"||F.type==="mouseout")&&this._updateHover(F);const N=this.props[Ph[F.type]];if(N){if(this.props.interactiveLayerIds&&F.type!=="mouseover"&&F.type!=="mouseout"){const oe=this._hoveredFeatures||this._map.queryRenderedFeatures(F.point,{layers:this.props.interactiveLayerIds});F.features=oe}N(F),delete F.features}},this._onCameraEvent=F=>{if(!this._internalUpdate){const N=this.props[Rc[F.type]];N&&N(F)}F.type in this._deferredEvents&&(this._deferredEvents[F.type]=!1)},this._MapClass=E,this.props=A,this._initialize(z)}get map(){return this._map}get transform(){return this._renderTransform}setProps(E){const A=this.props;this.props=E;const z=this._updateSettings(E,A);z&&this._createShadowTransform(this._map);const F=this._updateSize(E),N=this._updateViewState(E,!0);this._updateStyle(E,A),this._updateStyleComponents(E,A),this._updateHandlers(E,A),(z||F||N&&!this._map.isMoving())&&this.redraw()}static reuse(E,A){const z=ss.savedMaps.pop();if(!z)return null;const F=z.map,N=F.getContainer();for(A.className=N.className;N.childNodes.length>0;)A.appendChild(N.childNodes[0]);F._container=A,z.setProps({...E,styleDiffing:!1}),F.resize();const{initialViewState:oe}=E;return oe&&(oe.bounds?F.fitBounds(oe.bounds,{...oe.fitBoundsOptions,duration:0}):z._updateViewState(oe,!1)),F.isStyleLoaded()?F.fire("load"):F.once("styledata",()=>F.fire("load")),z}_initialize(E){const{props:A}=this,z={...A,...A.initialViewState,accessToken:A.mapboxAccessToken||qf()||null,container:E,style:Mh(A.mapStyle)},F=z.initialViewState||z.viewState||z;if(Object.assign(z,{center:[F.longitude||0,F.latitude||0],zoom:F.zoom||0,pitch:F.pitch||0,bearing:F.bearing||0}),A.gl){const te=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=te,A.gl)}const N=new this._MapClass(z);F.padding&&N.setPadding(F.padding),A.cursor&&(N.getCanvas().style.cursor=A.cursor),this._createShadowTransform(N);const oe=N._render;N._render=te=>{this._inRender=!0,oe.call(N,te),this._inRender=!1};const a=N._renderTaskQueue.run;N._renderTaskQueue.run=te=>{a.call(N._renderTaskQueue,te),this._onBeforeRepaint()},N.on("render",()=>this._onAfterRepaint());const ee=N.fire;N.fire=this._fireEvent.bind(this,ee),N.on("resize",()=>{this._renderTransform.resize(N.transform.width,N.transform.height)}),N.on("styledata",()=>this._updateStyleComponents(this.props,{})),N.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const te in Ph)N.on(te,this._onPointerEvent);for(const te in Rc)N.on(te,this._onCameraEvent);for(const te in zh)N.on(te,this._onEvent);this._map=N}recycle(){ss.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const E=this._map;!this._inRender&&E.style&&(E._frame&&(E._frame.cancel(),E._frame=null),E._render())}_createShadowTransform(E){const A=$f(E.transform);E.painter.transform=A,this._renderTransform=A}_updateSize(E){const{viewState:A}=E;if(A){const z=this._map;if(A.width!==z.transform.width||A.height!==z.transform.height)return z.resize(),!0}return!1}_updateViewState(E,A){if(this._internalUpdate)return!1;const z=this._map,F=this._renderTransform,{zoom:N,pitch:oe,bearing:a}=F,ee=z.isMoving();ee&&(F.cameraElevationReference="sea");const te=Ah(F,{...Ch(z.transform),...E});if(ee&&(F.cameraElevationReference="ground"),te&&A){const fe=this._deferredEvents;fe.move=!0,fe.zoom||(fe.zoom=N!==F.zoom),fe.rotate||(fe.rotate=a!==F.bearing),fe.pitch||(fe.pitch=oe!==F.pitch)}return ee||Ah(z.transform,E),te}_updateSettings(E,A){const z=this._map;let F=!1;for(const N of Nf)N in E&&!qn(E[N],A[N])&&(F=!0,z[`set${N[0].toUpperCase()}${N.slice(1)}`](E[N]));return F}_updateStyle(E,A){if(E.cursor!==A.cursor&&(this._map.getCanvas().style.cursor=E.cursor),E.mapStyle!==A.mapStyle){const z={diff:E.styleDiffing};return"localIdeographFontFamily"in E&&(z.localIdeographFontFamily=E.localIdeographFontFamily),this._map.setStyle(Mh(E.mapStyle),z),!0}return!1}_updateStyleComponents(E,A){const z=this._map;let F=!1;return z.style.loaded()&&("light"in E&&!qn(E.light,A.light)&&(F=!0,z.setLight(E.light)),"fog"in E&&!qn(E.fog,A.fog)&&(F=!0,z.setFog(E.fog)),"terrain"in E&&!qn(E.terrain,A.terrain)&&(!E.terrain||z.getSource(E.terrain.source))&&(F=!0,z.setTerrain(E.terrain))),F}_updateHandlers(E,A){const z=this._map;let F=!1;for(const N of Gf){const oe=E[N];qn(oe,A[N])||(F=!0,oe?z[N].enable(oe):z[N].disable())}return F}_updateHover(E){var A;const{props:z}=this;if(z.interactiveLayerIds&&(z.onMouseMove||z.onMouseEnter||z.onMouseLeave)){const N=E.type,oe=((A=this._hoveredFeatures)===null||A===void 0?void 0:A.length)>0;let a;if(N==="mousemove")try{a=this._map.queryRenderedFeatures(E.point,{layers:z.interactiveLayerIds})}catch{a=[]}else a=[];const ee=a.length>0;!ee&&oe&&(E.type="mouseleave",this._onPointerEvent(E)),this._hoveredFeatures=a,ee&&!oe&&(E.type="mouseenter",this._onPointerEvent(E)),E.type=N}else this._hoveredFeatures=null}_fireEvent(E,A,z){const F=this._map,N=F.transform,oe=typeof A=="string"?A:A.type;return oe==="move"&&this._updateViewState(this.props,!1),oe in Rc&&(typeof A=="object"&&(A.viewState=Ch(N)),this._map.isMoving())?(F.transform=this._renderTransform,E.call(F,A,z),F.transform=N,F):(E.call(F,A,z),F)}_onBeforeRepaint(){const E=this._map;this._internalUpdate=!0;for(const z in this._deferredEvents)this._deferredEvents[z]&&E.fire(z);this._internalUpdate=!1;const A=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=A}}}ss.savedMaps=[];function qf(){let w=null;if(typeof location!="undefined"){const E=/access_token=([^&\/]*)/.exec(location.search);w=E&&E[1]}try{w=w||{}.MapboxAccessToken}catch{}try{w=w||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return w}const Zf=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function jf(w,E){if(!w)return null;const A=w.map,z={getMap:()=>A,getCenter:()=>w.transform.center,getZoom:()=>w.transform.zoom,getBearing:()=>w.transform.bearing,getPitch:()=>w.transform.pitch,getPadding:()=>w.transform.padding,getBounds:()=>w.transform.getBounds(),project:F=>w.transform.locationPoint(E.LngLat.convert(F)),unproject:F=>w.transform.pointLocation(E.Point.convert(F)),queryTerrainElevation:(F,N)=>{const oe=A.transform;A.transform=w.transform;const a=A.queryTerrainElevation(F,N);return A.transform=oe,a}};for(const F of Xf(A))!(F in z)&&!Zf.includes(F)&&(z[F]=A[F].bind(A));return z}function Xf(w){const E=new Set;let A=w;for(;A;){for(const z of Object.getOwnPropertyNames(A))z[0]!=="_"&&typeof w[z]=="function"&&z!=="fire"&&z!=="setEventedParent"&&E.add(z);A=Object.getPrototypeOf(A)}return Array.from(E)}const Wf=typeof document!="undefined"?Te.exports.useLayoutEffect:Te.exports.useEffect,Hf=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Kf(w,E){for(const A of Hf)A in E&&(w[A]=E[A]);E.RTLTextPlugin&&w.getRTLTextPluginStatus&&w.getRTLTextPluginStatus()==="unavailable"&&w.setRTLTextPlugin(E.RTLTextPlugin,A=>{A&&console.error(A)},!1)}const Al=Te.exports.createContext(null),Jf={minZoom:0,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,mapStyle:{version:8,sources:{},layers:[]},styleDiffing:!0,projection:"mercator",renderWorldCopies:!0,onError:w=>console.error(w.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},Wc=Te.exports.forwardRef((w,E)=>{const A=Te.exports.useContext(Of),[z,F]=Te.exports.useState(null),N=Te.exports.useRef(),{current:oe}=Te.exports.useRef({mapLib:null,map:null});Te.exports.useEffect(()=>{const ee=w.mapLib;let te=!0,fe;return Promise.resolve(ee||Ef(()=>import("./index.c629d6a1.js").then(function(ue){return ue.i}),[])).then(ue=>{if(!!te){if(ue.Map||(ue=ue.default),!ue||!ue.Map)throw new Error("Invalid mapLib");if(ue.supported(w))Kf(ue,w),w.reuseMaps&&(fe=ss.reuse(w,N.current)),fe||(fe=new ss(ue.Map,w,N.current)),oe.map=jf(fe,ue),oe.mapLib=ue,F(fe),A==null||A.onMapMount(oe.map,w.id);else throw new Error("Map is not supported by this browser")}}).catch(ue=>{w.onError({type:"error",target:null,originalEvent:null,error:ue})}),()=>{te=!1,fe&&(A==null||A.onMapUnmount(w.id),w.reuseMaps?fe.recycle():fe.destroy())}},[]),Wf(()=>{z&&z.setProps(w)}),Te.exports.useImperativeHandle(E,()=>oe.map,[z]);const a=Te.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...w.style}),[w.style]);return Te.exports.createElement("div",{id:w.id,ref:N,style:a},z&&Te.exports.createElement(Al.Provider,{value:oe},w.children))});Wc.displayName="Map";Wc.defaultProps=Jf;const Yf=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ao(w,E){if(!w||!E)return;const A=w.style;for(const z in E){const F=E[z];Number.isFinite(F)&&!Yf.test(z)?A[z]=`${F}px`:A[z]=F}}const Qf={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function ep(w){const{map:E,mapLib:A}=Te.exports.useContext(Al),z=Te.exports.useRef({props:w});z.current.props=w;const F=Te.exports.useMemo(()=>{let N=!1;Te.exports.Children.forEach(w.children,ee=>{ee&&(N=!0)});const oe={...w,element:N?document.createElement("div"):null},a=new A.Marker(oe).setLngLat([w.longitude,w.latitude]);return a.getElement().addEventListener("click",ee=>{var te,fe;(fe=(te=z.current.props).onClick)===null||fe===void 0||fe.call(te,{type:"click",target:a,originalEvent:ee})}),a.on("dragstart",ee=>{var te,fe;const ue=ee;ue.lngLat=F.getLngLat(),(fe=(te=z.current.props).onDragStart)===null||fe===void 0||fe.call(te,ue)}),a.on("drag",ee=>{var te,fe;const ue=ee;ue.lngLat=F.getLngLat(),(fe=(te=z.current.props).onDrag)===null||fe===void 0||fe.call(te,ue)}),a.on("dragend",ee=>{var te,fe;const ue=ee;ue.lngLat=F.getLngLat(),(fe=(te=z.current.props).onDragEnd)===null||fe===void 0||fe.call(te,ue)}),a},[]);return Te.exports.useEffect(()=>(F.addTo(E.getMap()),()=>{F.remove()}),[]),Te.exports.useEffect(()=>{Ao(F.getElement(),w.style)},[w.style]),(F.getLngLat().lng!==w.longitude||F.getLngLat().lat!==w.latitude)&&F.setLngLat([w.longitude,w.latitude]),w.offset&&!Vf(F.getOffset(),w.offset)&&F.setOffset(w.offset),F.isDraggable()!==w.draggable&&F.setDraggable(w.draggable),F.getRotation()!==w.rotation&&F.setRotation(w.rotation),F.getRotationAlignment()!==w.rotationAlignment&&F.setRotationAlignment(w.rotationAlignment),F.getPitchAlignment()!==w.pitchAlignment&&F.setPitchAlignment(w.pitchAlignment),F.getPopup()!==w.popup&&F.setPopup(w.popup),Wh.exports.createPortal(w.children,F.getElement())}ep.defaultProps=Qf;var $c=Te.exports.memo(ep);function kh(w){return new Set(w?w.trim().split(/\s+/):[])}function em(w){const{map:E,mapLib:A}=Te.exports.useContext(Al),z=Te.exports.useMemo(()=>document.createElement("div"),[]),F=Te.exports.useRef({props:w});F.current.props=w;const N=Te.exports.useMemo(()=>{const oe={...w},a=new A.Popup(oe).setLngLat([w.longitude,w.latitude]);return a.once("open",ee=>{var te,fe;(fe=(te=F.current.props).onOpen)===null||fe===void 0||fe.call(te,ee)}),a},[]);if(Te.exports.useEffect(()=>{const oe=a=>{var ee,te;(te=(ee=F.current.props).onClose)===null||te===void 0||te.call(ee,a)};return N.on("close",oe),N.setDOMContent(z).addTo(E.getMap()),()=>{N.off("close",oe),N.isOpen()&&N.remove()}},[]),Te.exports.useEffect(()=>{Ao(N.getElement(),w.style)},[w.style]),N.isOpen()&&((N.getLngLat().lng!==w.longitude||N.getLngLat().lat!==w.latitude)&&N.setLngLat([w.longitude,w.latitude]),w.offset&&!qn(N.options.offset,w.offset)&&N.setOffset(w.offset),(N.options.anchor!==w.anchor||N.options.maxWidth!==w.maxWidth)&&(N.options.anchor=w.anchor,N.setMaxWidth(w.maxWidth)),N.options.className!==w.className)){const oe=kh(N.options.className),a=kh(w.className);for(const ee of oe)a.has(ee)||N.removeClassName(ee);for(const ee of a)oe.has(ee)||N.addClassName(ee);N.options.className=w.className}return Wh.exports.createPortal(w.children,z)}Te.exports.memo(em);function ua(w,E,A,z){const F=Te.exports.useContext(Al),N=Te.exports.useMemo(()=>w(F),[]);return Te.exports.useEffect(()=>{const oe=z||A||E,a=typeof E=="function"&&typeof A=="function"?E:null,ee=typeof A=="function"?A:typeof E=="function"?E:null,{map:te}=F;return te.hasControl(N)||(te.addControl(N,oe==null?void 0:oe.position),a&&a(F)),()=>{ee&&ee(F),te.hasControl(N)&&te.removeControl(N)}},[]),N}function tm(w){const E=ua(({mapLib:A})=>new A.AttributionControl(w),{position:w.position});return Te.exports.useEffect(()=>{Ao(E._container,w.style)},[w.style]),null}Te.exports.memo(tm);function im(w){const E=ua(({mapLib:A})=>new A.FullscreenControl({container:w.containerId&&document.getElementById(w.containerId)}),{position:w.position});return Te.exports.useEffect(()=>{Ao(E._controlContainer,w.style)},[w.style]),null}Te.exports.memo(im);const tp=Te.exports.forwardRef((w,E)=>{const A=Te.exports.useRef({props:w}),z=ua(({mapLib:F})=>{const N=new F.GeolocateControl(w),oe=N._setupUI;return N._setupUI=a=>{N._container.hasChildNodes()||oe(a)},N.on("geolocate",a=>{var ee,te;(te=(ee=A.current.props).onGeolocate)===null||te===void 0||te.call(ee,a)}),N.on("error",a=>{var ee,te;(te=(ee=A.current.props).onError)===null||te===void 0||te.call(ee,a)}),N.on("outofmaxbounds",a=>{var ee,te;(te=(ee=A.current.props).onOutOfMaxBounds)===null||te===void 0||te.call(ee,a)}),N.on("trackuserlocationstart",a=>{var ee,te;(te=(ee=A.current.props).onTrackUserLocationStart)===null||te===void 0||te.call(ee,a)}),N.on("trackuserlocationend",a=>{var ee,te;(te=(ee=A.current.props).onTrackUserLocationEnd)===null||te===void 0||te.call(ee,a)}),N},{position:w.position});return A.current.props=w,Te.exports.useImperativeHandle(E,()=>({trigger:()=>z.trigger()}),[]),Te.exports.useEffect(()=>{Ao(z._container,w.style)},[w.style]),null});tp.displayName="GeolocateControl";Te.exports.memo(tp);function rm(w){const E=ua(({mapLib:A})=>new A.NavigationControl(w),{position:w.position});return Te.exports.useEffect(()=>{Ao(E._container,w.style)},[w.style]),null}var nm=Te.exports.memo(rm);const om={unit:"metric",maxWidth:100};function ip(w){const E=ua(({mapLib:A})=>new A.ScaleControl(w),{position:w.position});return(E.options.unit!==w.unit||E.options.maxWidth!==w.maxWidth)&&(E.options.maxWidth=w.maxWidth,E.setUnit(w.unit)),Te.exports.useEffect(()=>{Ao(E._container,w.style)},[w.style]),null}ip.defaultProps=om;Te.exports.memo(ip);var rp={exports:{}};(function(w,E){(function(A,z){w.exports=z()})(sa,function(){var A,z,F;function N(a,ee){if(!A)A=ee;else if(!z)z=ee;else{var te="var sharedChunk = {}; ("+A+")(sharedChunk); ("+z+")(sharedChunk);",fe={};A(fe),F=ee(fe),typeof window!="undefined"&&(F.workerUrl=window.URL.createObjectURL(new Blob([te],{type:"text/javascript"})))}}N(["exports"],function(a){var ee=te;function te(i,e,r,o){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=o}function fe(i,e,r,o){const c=new ee(i,e,r,o);return function(h){return c.solve(h)}}te.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,o=0;o<8;o++){var c=this.sampleCurveX(r)-i;if(Math.abs(c)<e)return r;var h=this.sampleCurveDerivativeX(r);if(Math.abs(h)<1e-6)break;r-=c/h}var d=0,m=1;for(r=i,o=0;o<20&&(c=this.sampleCurveX(r),!(Math.abs(c-i)<e));o++)i>c?d=r:m=r,r=.5*(m-d)+d;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};const ue=fe(.25,.1,.25,1);function ie(i,e,r){return Math.min(r,Math.max(e,i))}function qe(i,e,r){const o=r-e,c=((i-e)%o+o)%o+e;return c===e?r:c}function Ue(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}let $e=1;function tt(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Ye(i,e,r){const o={};for(const c in i)o[c]=e.call(r||this,i[c],c,i);return o}function Qe(i,e,r){const o={};for(const c in i)e.call(r||this,i[c],c,i)&&(o[c]=i[c]);return o}function dt(i){return Array.isArray(i)?i.map(dt):typeof i=="object"&&i?Ye(i,dt):i}const gt={};function at(i){gt[i]||(typeof console!="undefined"&&console.warn(i),gt[i]=!0)}function Tt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function Ht(i){let e=0;for(let r,o,c=0,h=i.length,d=h-1;c<h;d=c++)r=i[c],o=i[d],e+=(o.x-r.x)*(r.y+o.y);return e}function Jt(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}function vr(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,o,c,h)=>{const d=c||h;return e[o]=!d||d.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let Wi,ur,Hi=null;function Rt(i){if(Hi==null){const e=i.navigator?i.navigator.userAgent:null;Hi=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Hi}function pi(i){return typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap}const di={now:typeof performance!="undefined"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){const r=window.document.createElement("canvas"),o=r.getContext("2d");if(!o)throw new Error("failed to create canvas 2d context");return r.width=i.width,r.height=i.height,o.drawImage(i,0,0,i.width,i.height),o.getImageData(-e,-e,i.width+2*e,i.height+2*e)},resolveURL:i=>(Wi||(Wi=document.createElement("a")),Wi.href=i,Wi.href),hardwareConcurrency:typeof navigator!="undefined"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(ur==null&&(ur=matchMedia("(prefers-reduced-motion: reduce)")),ur.matches)}};var Xe=Bi;function Bi(i,e){this.x=i,this.y=e}Bi.prototype={clone:function(){return new Bi(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),o=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=o,this},_rotateAround:function(i,e){var r=Math.cos(i),o=Math.sin(i),c=e.y+o*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-o*(this.y-e.y),this.y=c,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Bi.convert=function(i){return i instanceof Bi?i:Array.isArray(i)?new Bi(i[0],i[1]):i};const wi={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},Ci="mapbox-tiles";let Ai,Kr,gn=500,_n=50;function yn(){typeof caches=="undefined"||Ai||(Ai=caches.open(Ci))}let hr=1/0;const Dr={supported:!1,testSupport:function(i){!Mi&&Rr&&(xn?jn(i):Lr=i)}};let Lr,Rr,Mi=!1,xn=!1;function jn(i){const e=i.createTexture();i.bindTexture(i.TEXTURE_2D,e);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,Rr),i.isContextLost())return;Dr.supported=!0}catch{}i.deleteTexture(e),Mi=!0}typeof document!="undefined"&&(Rr=document.createElement("img"),Rr.onload=function(){Lr&&jn(Lr),Lr=null,xn=!0},Rr.onerror=function(){Mi=!0,Lr=null},Rr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const br={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(br);class Fi extends Error{constructor(e,r,o,c){super(`AJAXError: ${r} (${e}): ${o}`),this.status=e,this.statusText=r,this.url=o,this.body=c}}const Xn=Jt()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function Br(i,e){const r=new AbortController,o=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:Xn(),signal:r.signal});let c=!1,h=!1;return i.type==="json"&&o.headers.set("Accept","application/json"),((d,m,g)=>{if(h)return;const x=Date.now();fetch(o).then(T=>T.ok?((I,P,D)=>{(i.type==="arrayBuffer"?I.arrayBuffer():i.type==="json"?I.json():I.text()).then(L=>{h||(P&&D&&function(Z,q,re){if(yn(),!Ai)return;const ce={status:q.status,statusText:q.statusText,headers:new Headers};q.headers.forEach((ae,xe)=>ce.headers.set(xe,ae));const Q=vr(q.headers.get("Cache-Control")||"");Q["no-store"]||(Q["max-age"]&&ce.headers.set("Expires",new Date(re+1e3*Q["max-age"]).toUTCString()),new Date(ce.headers.get("Expires")).getTime()-re<42e4||function(ae,xe){if(Kr===void 0)try{new Response(new ReadableStream),Kr=!0}catch{Kr=!1}Kr?xe(ae.body):ae.blob().then(xe)}(q,ae=>{const xe=new Response(ae,ce);yn(),Ai&&Ai.then(ye=>ye.put(function(Fe){const Ne=Fe.indexOf("?");return Ne<0?Fe:Fe.slice(0,Ne)}(Z.url),xe)).catch(ye=>at(ye.message))}))}(o,P,D),c=!0,e(null,L,I.headers.get("Cache-Control"),I.headers.get("Expires")))}).catch(L=>{h||e(new Error(L.message))})})(T,null,x):T.blob().then(I=>e(new Fi(T.status,T.statusText,i.url,I)))).catch(T=>{T.code!==20&&e(new Error(T.message))})})(),{cancel:()=>{h=!0,c||r.abort()}}}const vn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Jt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Jt()){const o=i.url.substring(0,i.url.indexOf("://"));return(wi.REGISTERED_PROTOCOLS[o]||Br)(i,e)}}if(!(/^file:/.test(r=i.url)||/^file:/.test(Xn())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Br(i,e);if(Jt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(o,c){const h=new XMLHttpRequest;h.open(o.method||"GET",o.url,!0),o.type==="arrayBuffer"&&(h.responseType="arraybuffer");for(const d in o.headers)h.setRequestHeader(d,o.headers[d]);return o.type==="json"&&(h.responseType="text",h.setRequestHeader("Accept","application/json")),h.withCredentials=o.credentials==="include",h.onerror=()=>{c(new Error(h.statusText))},h.onload=()=>{if((h.status>=200&&h.status<300||h.status===0)&&h.response!==null){let d=h.response;if(o.type==="json")try{d=JSON.parse(h.response)}catch(m){return c(m)}c(null,d,h.getResponseHeader("Cache-Control"),h.getResponseHeader("Expires"))}else{const d=new Blob([h.response],{type:h.getResponseHeader("Content-Type")});c(new Fi(h.status,h.statusText,o.url,d))}},h.send(o.body),{cancel:()=>h.abort()}}(i,e)},bn=function(i,e){return vn(Ue(i,{type:"arrayBuffer"}),e)};function Wn(i){const e=window.document.createElement("a");return e.href=i,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}const yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let pr,Fr;pr=[],Fr=0;const Or=function(i,e){if(Dr.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),Fr>=wi.MAX_PARALLEL_IMAGE_REQUESTS){const h={requestParameters:i,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return pr.push(h),h}Fr++;let r=!1;const o=()=>{if(!r)for(r=!0,Fr--;pr.length&&Fr<wi.MAX_PARALLEL_IMAGE_REQUESTS;){const h=pr.shift(),{requestParameters:d,callback:m,cancelled:g}=h;g||(h.cancel=Or(d,m).cancel)}},c=bn(i,(h,d,m,g)=>{o(),h?e(h):d&&function(x,T){typeof createImageBitmap=="function"?function(I,P){const D=new Blob([new Uint8Array(I)],{type:"image/png"});createImageBitmap(D).then(L=>{P(null,L)}).catch(L=>{P(new Error(`Could not load image because of ${L.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(x,T):function(I,P){const D=new Image;D.onload=()=>{P(null,D),URL.revokeObjectURL(D.src),D.onload=null,window.requestAnimationFrame(()=>{D.src=yt})},D.onerror=()=>P(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const L=new Blob([new Uint8Array(I)],{type:"image/png"});D.src=I.byteLength?URL.createObjectURL(L):yt}(x,T)}(d,(x,T)=>{x!=null?e(x):T!=null&&e(null,T,{cacheControl:m,expires:g})})});return{cancel:()=>{c.cancel(),o()}}};function Hn(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function wr(i,e,r){if(r&&r[i]){const o=r[i].indexOf(e);o!==-1&&r[i].splice(o,1)}}class Tr{constructor(e,r={}){Ue(this,r),this.type=e}}class wn extends Tr{constructor(e,r={}){super("error",Ue({error:e},r))}}class Er{on(e,r){return this._listeners=this._listeners||{},Hn(e,r,this._listeners),this}off(e,r){return wr(e,r,this._listeners),wr(e,r,this._oneTimeListeners),this}once(e,r){return this._oneTimeListeners=this._oneTimeListeners||{},Hn(e,r,this._oneTimeListeners),this}fire(e,r){typeof e=="string"&&(e=new Tr(e,r||{}));const o=e.type;if(this.listens(o)){e.target=this;const c=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(const m of c)m.call(this,e);const h=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(const m of h)wr(o,m,this._oneTimeListeners),m.call(this,e);const d=this._eventedParent;d&&(Ue(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof wn&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var _e={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Me{constructor(e,r,o,c){this.message=(e?`${e}: `:"")+o,c&&(this.identifier=c),r!=null&&r.__line__&&(this.line=r.__line__)}}function Jr(i){const e=i.value;return e?[new Me(i.key,e,"constants have been deprecated as of v8")]:[]}function ir(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}function xt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Ki(i){if(Array.isArray(i))return i.map(Ki);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Ki(i[r]);return e}return xt(i)}class Oi extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class $i{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[o,c]of r)this.bindings[o]=c}concat(e){return new $i(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const $r={kind:"null"},Ie={kind:"number"},lt={kind:"string"},ot={kind:"boolean"},fi={kind:"color"},Ur={kind:"object"},rt={kind:"value"},Sr={kind:"collator"},oi={kind:"formatted"},Tn={kind:"padding"},Yt={kind:"resolvedImage"};function Ti(i,e){return{kind:"array",itemType:i,N:e}}function Pt(i){if(i.kind==="array"){const e=Pt(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const En=[$r,Ie,lt,ot,fi,oi,Ur,Ti(rt),Tn,Yt];function dr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!dr(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of En)if(!dr(r,e))return null}}return`Expected ${Pt(i)} but found ${Pt(e)} instead.`}function Yr(i,e){return e.some(r=>r.kind===i.kind)}function Qr(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}var Sn,en={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function O(i){return(i=Math.round(i))<0?0:i>255?255:i}function b(i){return O(i[i.length-1]==="%"?parseFloat(i)/100*255:parseInt(i))}function C(i){return(e=i[i.length-1]==="%"?parseFloat(i)/100:parseFloat(i))<0?0:e>1?1:e;var e}function R(i,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?i+(e-i)*r*6:2*r<1?e:3*r<2?i+(e-i)*(2/3-r)*6:i}try{Sn={}.parseCSSColor=function(i){var e,r=i.replace(/ /g,"").toLowerCase();if(r in en)return en[r].slice();if(r[0]==="#")return r.length===4?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:r.length===7&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var o=r.indexOf("("),c=r.indexOf(")");if(o!==-1&&c+1===r.length){var h=r.substr(0,o),d=r.substr(o+1,c-(o+1)).split(","),m=1;switch(h){case"rgba":if(d.length!==4)return null;m=C(d.pop());case"rgb":return d.length!==3?null:[b(d[0]),b(d[1]),b(d[2]),m];case"hsla":if(d.length!==4)return null;m=C(d.pop());case"hsl":if(d.length!==3)return null;var g=(parseFloat(d[0])%360+360)%360/360,x=C(d[1]),T=C(d[2]),I=T<=.5?T*(x+1):T+x-T*x,P=2*T-I;return[O(255*R(P,I,g+1/3)),O(255*R(P,I,g)),O(255*R(P,I,g-1/3)),m];default:return null}}return null}}catch{}class B{constructor(e,r,o,c=1){this.r=e,this.g=r,this.b=o,this.a=c}static parse(e){if(!e)return;if(e instanceof B)return e;if(typeof e!="string")return;const r=Sn(e);return r?new B(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,r,o,c]=this.toArray();return`rgba(${Math.round(e)},${Math.round(r)},${Math.round(o)},${c})`}toArray(){const{r:e,g:r,b:o,a:c}=this;return c===0?[0,0,0,0]:[255*e/c,255*r/c,255*o/c,c]}}B.black=new B(0,0,0,1),B.white=new B(1,1,1,1),B.transparent=new B(0,0,0,0),B.red=new B(1,0,0,1);class j{constructor(e,r,o){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class K{constructor(e,r,o,c,h){this.text=e,this.image=r,this.scale=o,this.fontStack=c,this.textColor=h}}class W{constructor(e){this.sections=e}static fromString(e){return new W([new K(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof W?e:W.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class X{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof X)return e;if(typeof e=="number")return new X([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new X(e)}}toString(){return JSON.stringify(this.values)}}class J{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new J({name:e,available:!1}):null}}function pe(i,e,r,o){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[i,e,r,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[i,e,r,o]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ve(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof B||i instanceof j||i instanceof W||i instanceof X||i instanceof J)return!0;if(Array.isArray(i)){for(const e of i)if(!ve(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!ve(i[e]))return!1;return!0}return!1}function he(i){if(i===null)return $r;if(typeof i=="string")return lt;if(typeof i=="boolean")return ot;if(typeof i=="number")return Ie;if(i instanceof B)return fi;if(i instanceof j)return Sr;if(i instanceof W)return oi;if(i instanceof X)return Tn;if(i instanceof J)return Yt;if(Array.isArray(i)){const e=i.length;let r;for(const o of i){const c=he(o);if(r){if(r===c)continue;r=rt;break}r=c}return Ti(r||rt,e)}return Ur}function Ve(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof B||i instanceof W||i instanceof X||i instanceof J?i.toString():JSON.stringify(i)}class Ge{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ve(e[1]))return r.error("invalid value");const o=e[1];let c=he(o);const h=r.expectedType;return c.kind!=="array"||c.N!==0||!h||h.kind!=="array"||typeof h.N=="number"&&h.N!==0||(c=h),new Ge(c,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Le{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Ke={string:lt,number:Ie,boolean:ot,object:Ur};class et{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let o,c=1;const h=e[0];if(h==="array"){let m,g;if(e.length>2){const x=e[1];if(typeof x!="string"||!(x in Ke)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=Ke[x],c++}else m=rt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=e[2],c++}o=Ti(m,g)}else{if(!Ke[h])throw new Error(`Types doesn't contain name = ${h}`);o=Ke[h]}const d=[];for(;c<e.length;c++){const m=r.parse(e[c],c,rt);if(!m)return null;d.push(m)}return new et(o,d)}evaluate(e){for(let r=0;r<this.args.length;r++){const o=this.args[r].evaluate(e);if(!dr(this.type,he(o)))return o;if(r===this.args.length-1)throw new Le(`Expected value to be of type ${Pt(this.type)}, but found ${Pt(he(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const vt={"to-boolean":ot,"to-color":fi,"to-number":Ie,"to-string":lt};class it{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[0];if(!vt[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if((o==="to-boolean"||o==="to-string")&&e.length!==2)return r.error("Expected one argument.");const c=vt[o],h=[];for(let d=1;d<e.length;d++){const m=r.parse(e[d],d,rt);if(!m)return null;h.push(m)}return new it(c,h)}evaluate(e){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(e));if(this.type.kind==="color"){let r,o;for(const c of this.args){if(r=c.evaluate(e),o=null,r instanceof B)return r;if(typeof r=="string"){const h=e.parseColor(r);if(h)return h}else if(Array.isArray(r)&&(o=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:pe(r[0],r[1],r[2],r[3]),!o))return new B(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Le(o||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="padding"){let r;for(const o of this.args){r=o.evaluate(e);const c=X.parse(r);if(c)return c}throw new Le(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="number"){let r=null;for(const o of this.args){if(r=o.evaluate(e),r===null)return 0;const c=Number(r);if(!isNaN(c))return c}throw new Le(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?W.fromString(Ve(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?J.fromString(Ve(this.args[0].evaluate(e))):Ve(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ct=["Unknown","Point","LineString","Polygon"];class bt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?ct[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=B.parse(e)),r}}class kt{constructor(e,r,o,c){this.name=e,this.type=r,this._evaluate=o,this.args=c}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const o=e[0],c=kt.definitions[o];if(!c)return r.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const h=Array.isArray(c)?c[0]:c.type,d=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,m=d.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let g=null;for(const[x,T]of m){g=new An(r.registry,r.path,null,r.scope);const I=[];let P=!1;for(let D=1;D<e.length;D++){const L=e[D],Z=Array.isArray(x)?x[D-1]:x.type,q=g.parse(L,1+I.length,Z);if(!q){P=!0;break}I.push(q)}if(!P)if(Array.isArray(x)&&x.length!==I.length)g.error(`Expected ${x.length} arguments, but found ${I.length} instead.`);else{for(let D=0;D<I.length;D++){const L=Array.isArray(x)?x[D]:x.type,Z=I[D];g.concat(D+1).checkSubtype(L,Z.type)}if(g.errors.length===0)return new kt(o,h,T,I)}}if(m.length===1)r.errors.push(...g.errors);else{const x=(m.length?m:d).map(([I])=>{return P=I,Array.isArray(P)?`(${P.map(Pt).join(", ")})`:`(${Pt(P.type)}...)`;var P}).join(" | "),T=[];for(let I=1;I<e.length;I++){const P=r.parse(e[I],1+T.length);if(!P)return null;T.push(Pt(P.type))}r.error(`Expected arguments of type ${x}, but found (${T.join(", ")}) instead.`)}return null}static register(e,r){kt.definitions=r;for(const o in r)e[o]=kt}}class si{constructor(e,r,o){this.type=Sr,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const o=e[1];if(typeof o!="object"||Array.isArray(o))return r.error("Collator options argument must be an object.");const c=r.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,ot);if(!c)return null;const h=r.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,ot);if(!h)return null;let d=null;return o.locale&&(d=r.parse(o.locale,1,lt),!d)?null:new si(c,h,d)}evaluate(e){return new j(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const $t=8192;function _i(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function In(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Kn(i,e){const r=(180+i[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,c=Math.pow(2,e.z);return[Math.round(r*c*$t),Math.round(o*c*$t)]}function Dt(i,e,r){const o=i[0]-e[0],c=i[1]-e[1],h=i[0]-r[0],d=i[1]-r[1];return o*d-h*c==0&&o*h<=0&&c*d<=0}function as(i,e){let r=!1;for(let d=0,m=e.length;d<m;d++){const g=e[d];for(let x=0,T=g.length;x<T-1;x++){if(Dt(i,g[x],g[x+1]))return!1;(c=g[x])[1]>(o=i)[1]!=(h=g[x+1])[1]>o[1]&&o[0]<(h[0]-c[0])*(o[1]-c[1])/(h[1]-c[1])+c[0]&&(r=!r)}}var o,c,h;return r}function ls(i,e){for(let r=0;r<e.length;r++)if(as(i,e[r]))return!0;return!1}function pa(i,e,r,o){const c=o[0]-r[0],h=o[1]-r[1],d=(i[0]-r[0])*h-c*(i[1]-r[1]),m=(e[0]-r[0])*h-c*(e[1]-r[1]);return d>0&&m<0||d<0&&m>0}function da(i,e,r){for(const x of r)for(let T=0;T<x.length-1;++T)if((m=[(d=x[T+1])[0]-(h=x[T])[0],d[1]-h[1]])[0]*(g=[(c=e)[0]-(o=i)[0],c[1]-o[1]])[1]-m[1]*g[0]!=0&&pa(o,c,h,d)&&pa(h,d,o,c))return!0;var o,c,h,d,m,g;return!1}function cs(i,e){for(let r=0;r<i.length;++r)if(!as(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(da(i[r],i[r+1],e))return!1;return!0}function Pl(i,e){for(let r=0;r<e.length;r++)if(cs(i,e[r]))return!0;return!1}function Mo(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=[];for(let d=0;d<i[c].length;d++){const m=Kn(i[c][d],r);_i(e,m),h.push(m)}o.push(h)}return o}function us(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=Mo(i[c],e,r);o.push(h)}return o}function fa(i,e,r,o){if(i[0]<r[0]||i[0]>r[2]){const c=.5*o;let h=i[0]-r[0]>c?-o:r[0]-i[0]>c?o:0;h===0&&(h=i[0]-r[2]>c?-o:r[2]-i[0]>c?o:0),i[0]+=h}_i(e,i)}function ma(i,e,r,o){const c=Math.pow(2,o.z)*$t,h=[o.x*$t,o.y*$t],d=[];for(const m of i)for(const g of m){const x=[g.x+h[0],g.y+h[1]];fa(x,e,r,c),d.push(x)}return d}function ga(i,e,r,o){const c=Math.pow(2,o.z)*$t,h=[o.x*$t,o.y*$t],d=[];for(const g of i){const x=[];for(const T of g){const I=[T.x+h[0],T.y+h[1]];_i(e,I),x.push(I)}d.push(x)}if(e[2]-e[0]<=c/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const g of d)for(const x of g)fa(x,e,r,c)}var m;return d}class tn{constructor(e,r){this.type=ot,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ve(e[1])){const o=e[1];if(o.type==="FeatureCollection")for(let c=0;c<o.features.length;++c){const h=o.features[c].geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new tn(o,o.features[c].geometry)}else if(o.type==="Feature"){const c=o.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new tn(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new tn(o,o)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,o){const c=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(o.type==="Polygon"){const m=Mo(o.coordinates,h,d),g=ma(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!as(x,m))return!1}if(o.type==="MultiPolygon"){const m=us(o.coordinates,h,d),g=ma(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!ls(x,m))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,o){const c=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(o.type==="Polygon"){const m=Mo(o.coordinates,h,d),g=ga(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!cs(x,m))return!1}if(o.type==="MultiPolygon"){const m=us(o.coordinates,h,d),g=ga(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!Pl(x,m))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function Jn(i){if(i instanceof kt&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof tn)return!1;let e=!0;return i.eachChild(r=>{e&&!Jn(r)&&(e=!1)}),e}function Cn(i){if(i instanceof kt&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!Cn(r)&&(e=!1)}),e}function Po(i,e){if(i instanceof kt&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(o=>{r&&!Po(o,e)&&(r=!1)}),r}class zo{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const o=e[1];return r.scope.has(o)?new zo(o,r.scope.get(o)):r.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class An{constructor(e,r=[],o,c=new $i,h=[]){this.registry=e,this.path=r,this.key=r.map(d=>`[${d}]`).join(""),this.scope=c,this.errors=h,this.expectedType=o}parse(e,r,o,c,h={}){return r?this.concat(r,o,c)._parse(e,h):this._parse(e,h)}_parse(e,r){function o(c,h,d){return d==="assert"?new et(h,[c]):d==="coerce"?new it(h,[c]):c}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const c=e[0];if(typeof c!="string")return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const h=this.registry[c];if(h){let d=h.parse(e,this);if(!d)return null;if(this.expectedType){const m=this.expectedType,g=d.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||g.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(m.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array"){if(this.checkSubtype(m,g))return null}else d=o(d,m,r.typeAnnotation||"coerce");else d=o(d,m,r.typeAnnotation||"coerce");else d=o(d,m,r.typeAnnotation||"assert")}if(!(d instanceof Ge)&&d.type.kind!=="resolvedImage"&&hs(d)){const m=new bt;try{d=new Ge(d.type,d.evaluate(m))}catch(g){return this.error(g.message),null}}return d}return this.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,o){const c=typeof e=="number"?this.path.concat(e):this.path,h=o?this.scope.concat(o):this.scope;return new An(this.registry,c,r||null,h,this.errors)}error(e,...r){const o=`${this.key}${r.map(c=>`[${c}]`).join("")}`;this.errors.push(new Oi(o,e))}checkSubtype(e,r){const o=dr(e,r);return o&&this.error(o),o}}function hs(i){if(i instanceof zo)return hs(i.boundExpression);if(i instanceof kt&&i.name==="error"||i instanceof si||i instanceof tn)return!1;const e=i instanceof it||i instanceof et;let r=!0;return i.eachChild(o=>{r=e?r&&hs(o):r&&o instanceof Ge}),!!r&&Jn(i)&&Po(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ko(i,e){const r=i.length-1;let o,c,h=0,d=r,m=0;for(;h<=d;)if(m=Math.floor((h+d)/2),o=i[m],c=i[m+1],o<=e){if(m===r||e<c)return m;h=m+1}else{if(!(o>e))throw new Le("Input is not a number.");d=m-1}return 0}class Yn{constructor(e,r,o){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[c,h]of o)this.labels.push(c),this.outputs.push(h)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const o=r.parse(e[1],1,Ie);if(!o)return null;const c=[];let h=null;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);for(let d=1;d<e.length;d+=2){const m=d===1?-1/0:e[d],g=e[d+1],x=d,T=d+1;if(typeof m!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(c.length&&c[c.length-1][0]>=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const I=r.parse(g,T,h);if(!I)return null;h=h||I.type,c.push([m,I])}return new Yn(h,o,c)}evaluate(e){const r=this.labels,o=this.outputs;if(r.length===1)return o[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return o[0].evaluate(e);const h=r.length;return c>=r[h-1]?o[h-1].evaluate(e):o[ko(r,c)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ut(i,e,r){return i*(1-r)+e*r}var Qn=Object.freeze({__proto__:null,number:Ut,color:function(i,e,r){return new B(Ut(i.r,e.r,r),Ut(i.g,e.g,r),Ut(i.b,e.b,r),Ut(i.a,e.a,r))},array:function(i,e,r){return i.map((o,c)=>Ut(o,e[c],r))},padding:function(i,e,r){const o=i.values,c=e.values;return new X([Ut(o[0],c[0],r),Ut(o[1],c[1],r),Ut(o[2],c[2],r),Ut(o[3],c[3],r)])}});const _a=.95047,ya=1.08883,ps=4/29,Do=6/29,xa=3*Do*Do,zl=Math.PI/180,kl=180/Math.PI;function ds(i){return i>.008856451679035631?Math.pow(i,1/3):i/xa+ps}function fs(i){return i>Do?i*i*i:xa*(i-ps)}function ms(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function gs(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function St(i){const e=gs(i.r),r=gs(i.g),o=gs(i.b),c=ds((.4124564*e+.3575761*r+.1804375*o)/_a),h=ds((.2126729*e+.7151522*r+.072175*o)/1);return{l:116*h-16,a:500*(c-h),b:200*(h-ds((.0193339*e+.119192*r+.9503041*o)/ya)),alpha:i.a}}function va(i){let e=(i.l+16)/116,r=isNaN(i.a)?e:e+i.a/500,o=isNaN(i.b)?e:e-i.b/200;return e=1*fs(e),r=_a*fs(r),o=ya*fs(o),new B(ms(3.2404542*r-1.5371385*e-.4985314*o),ms(-.969266*r+1.8760108*e+.041556*o),ms(.0556434*r-.2040259*e+1.0572252*o),i.alpha)}function Dl(i,e,r){const o=e-i;return i+r*(o>180||o<-180?o-360*Math.round(o/360):o)}const eo={forward:St,reverse:va,interpolate:function(i,e,r){return{l:Ut(i.l,e.l,r),a:Ut(i.a,e.a,r),b:Ut(i.b,e.b,r),alpha:Ut(i.alpha,e.alpha,r)}}},to={forward:function(i){const{l:e,a:r,b:o}=St(i),c=Math.atan2(o,r)*kl;return{h:c<0?c+360:c,c:Math.sqrt(r*r+o*o),l:e,alpha:i.a}},reverse:function(i){const e=i.h*zl,r=i.c;return va({l:i.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:i.alpha})},interpolate:function(i,e,r){return{h:Dl(i.h,e.h,r),c:Ut(i.c,e.c,r),l:Ut(i.l,e.l,r),alpha:Ut(i.alpha,e.alpha,r)}}};var ba=Object.freeze({__proto__:null,lab:eo,hcl:to});class Ui{constructor(e,r,o,c,h){this.type=e,this.operator=r,this.interpolation=o,this.input=c,this.labels=[],this.outputs=[];for(const[d,m]of h)this.labels.push(d),this.outputs.push(m)}static interpolationFactor(e,r,o,c){let h=0;if(e.name==="exponential")h=_s(r,e.base,o,c);else if(e.name==="linear")h=_s(r,1,o,c);else if(e.name==="cubic-bezier"){const d=e.controlPoints;h=new ee(d[0],d[1],d[2],d[3]).solve(_s(r,1,o,c))}return h}static parse(e,r){let[o,c,h,...d]=e;if(!Array.isArray(c)||c.length===0)return r.error("Expected an interpolation type expression.",1);if(c[0]==="linear")c={name:"linear"};else if(c[0]==="exponential"){const x=c[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);c={name:"exponential",base:x}}else{if(c[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(c[0])}`,1,0);{const x=c.slice(1);if(x.length!==4||x.some(T=>typeof T!="number"||T<0||T>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:x}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(h=r.parse(h,2,Ie),!h)return null;const m=[];let g=null;o==="interpolate-hcl"||o==="interpolate-lab"?g=fi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let x=0;x<d.length;x+=2){const T=d[x],I=d[x+1],P=x+3,D=x+4;if(typeof T!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',P);if(m.length&&m[m.length-1][0]>=T)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',P);const L=r.parse(I,D,g);if(!L)return null;g=g||L.type,m.push([T,L])}return g.kind==="number"||g.kind==="color"||g.kind==="padding"||g.kind==="array"&&g.itemType.kind==="number"&&typeof g.N=="number"?new Ui(g,o,c,h,m):r.error(`Type ${Pt(g)} is not interpolatable.`)}evaluate(e){const r=this.labels,o=this.outputs;if(r.length===1)return o[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return o[0].evaluate(e);const h=r.length;if(c>=r[h-1])return o[h-1].evaluate(e);const d=ko(r,c),m=Ui.interpolationFactor(this.interpolation,c,r[d],r[d+1]),g=o[d].evaluate(e),x=o[d+1].evaluate(e);return this.operator==="interpolate"?Qn[this.type.kind.toLowerCase()](g,x,m):this.operator==="interpolate-hcl"?to.reverse(to.interpolate(to.forward(g),to.forward(x),m)):eo.reverse(eo.interpolate(eo.forward(g),eo.forward(x),m))}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function _s(i,e,r,o){const c=o-r,h=i-r;return c===0?0:e===1?h/c:(Math.pow(e,h)-1)/(Math.pow(e,c)-1)}class Lo{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let o=null;const c=r.expectedType;c&&c.kind!=="value"&&(o=c);const h=[];for(const m of e.slice(1)){const g=r.parse(m,1+h.length,o,void 0,{typeAnnotation:"omit"});if(!g)return null;o=o||g.type,h.push(g)}if(!o)throw new Error("No output type");const d=c&&h.some(m=>dr(c,m.type));return new Lo(d?rt:o,h)}evaluate(e){let r,o=null,c=0;for(const h of this.args)if(c++,o=h.evaluate(e),o&&o instanceof J&&!o.available&&(r||(r=o.name),o=null,c===this.args.length&&(o=r)),o!==null)break;return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ro{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const o=[];for(let h=1;h<e.length-1;h+=2){const d=e[h];if(typeof d!="string")return r.error(`Expected string, but found ${typeof d} instead.`,h);if(/[^a-zA-Z0-9_]/.test(d))return r.error("Variable names must contain only alphanumeric characters or '_'.",h);const m=r.parse(e[h+1],h+1);if(!m)return null;o.push([d,m])}const c=r.parse(e[e.length-1],e.length-1,r.expectedType,o);return c?new Ro(o,c):null}outputDefined(){return this.result.outputDefined()}}class ys{constructor(e,r,o){this.type=e,this.index=r,this.input=o}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,Ie),c=r.parse(e[2],2,Ti(r.expectedType||rt));return o&&c?new ys(c.type.itemType,o,c):null}evaluate(e){const r=this.index.evaluate(e),o=this.input.evaluate(e);if(r<0)throw new Le(`Array index out of bounds: ${r} < 0.`);if(r>=o.length)throw new Le(`Array index out of bounds: ${r} > ${o.length-1}.`);if(r!==Math.floor(r))throw new Le(`Array index must be an integer, but found ${r} instead.`);return o[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class xs{constructor(e,r){this.type=ot,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,rt),c=r.parse(e[2],2,rt);return o&&c?Yr(o.type,[ot,lt,Ie,$r,rt])?new xs(o,c):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(o.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!Qr(r,["boolean","string","number","null"]))throw new Le(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(he(r))} instead.`);if(!Qr(o,["string","array"]))throw new Le(`Expected second argument to be of type array or string, but found ${Pt(he(o))} instead.`);return o.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Bo{constructor(e,r,o){this.type=Ie,this.needle=e,this.haystack=r,this.fromIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,rt),c=r.parse(e[2],2,rt);if(!o||!c)return null;if(!Yr(o.type,[ot,lt,Ie,$r,rt]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Ie);return h?new Bo(o,c,h):null}return new Bo(o,c)}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!Qr(r,["boolean","string","number","null"]))throw new Le(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(he(r))} instead.`);if(!Qr(o,["string","array"]))throw new Le(`Expected second argument to be of type array or string, but found ${Pt(he(o))} instead.`);if(this.fromIndex){const c=this.fromIndex.evaluate(e);return o.indexOf(r,c)}return o.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class vs{constructor(e,r,o,c,h,d){this.inputType=e,this.type=r,this.input=o,this.cases=c,this.outputs=h,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let o,c;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);const h={},d=[];for(let x=2;x<e.length-1;x+=2){let T=e[x];const I=e[x+1];Array.isArray(T)||(T=[T]);const P=r.concat(x);if(T.length===0)return P.error("Expected at least one branch label.");for(const L of T){if(typeof L!="number"&&typeof L!="string")return P.error("Branch labels must be numbers or strings.");if(typeof L=="number"&&Math.abs(L)>Number.MAX_SAFE_INTEGER)return P.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof L=="number"&&Math.floor(L)!==L)return P.error("Numeric branch labels must be integer values.");if(o){if(P.checkSubtype(o,he(L)))return null}else o=he(L);if(h[String(L)]!==void 0)return P.error("Branch labels must be unique.");h[String(L)]=d.length}const D=r.parse(I,x,c);if(!D)return null;c=c||D.type,d.push(D)}const m=r.parse(e[1],1,rt);if(!m)return null;const g=r.parse(e[e.length-1],e.length-1,c);return g?m.type.kind!=="value"&&r.concat(1).checkSubtype(o,m.type)?null:new vs(o,c,m,h,d,g):null}evaluate(e){const r=this.input.evaluate(e);return(he(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class bs{constructor(e,r,o){this.type=e,this.branches=r,this.otherwise=o}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const c=[];for(let d=1;d<e.length-1;d+=2){const m=r.parse(e[d],d,ot);if(!m)return null;const g=r.parse(e[d+1],d+1,o);if(!g)return null;c.push([m,g]),o=o||g.type}const h=r.parse(e[e.length-1],e.length-1,o);if(!h)return null;if(!o)throw new Error("Can't infer output type");return new bs(o,c,h)}evaluate(e){for(const[r,o]of this.branches)if(r.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,o]of this.branches)e(r),e(o);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class Fo{constructor(e,r,o,c){this.type=e,this.input=r,this.beginIndex=o,this.endIndex=c}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,rt),c=r.parse(e[2],2,Ie);if(!o||!c)return null;if(!Yr(o.type,[Ti(rt),lt,rt]))return r.error(`Expected first argument to be of type array or string, but found ${Pt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Ie);return h?new Fo(o.type,o,c,h):null}return new Fo(o.type,o,c)}evaluate(e){const r=this.input.evaluate(e),o=this.beginIndex.evaluate(e);if(!Qr(r,["string","array"]))throw new Le(`Expected first argument to be of type array or string, but found ${Pt(he(r))} instead.`);if(this.endIndex){const c=this.endIndex.evaluate(e);return r.slice(o,c)}return r.slice(o)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function wa(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Ta(i,e,r,o){return o.compare(e,r)===0}function Mn(i,e,r){const o=i!=="=="&&i!=="!=";return class np{constructor(h,d,m){this.type=ot,this.lhs=h,this.rhs=d,this.collator=m,this.hasUntypedArgument=h.type.kind==="value"||d.type.kind==="value"}static parse(h,d){if(h.length!==3&&h.length!==4)return d.error("Expected two or three arguments.");const m=h[0];let g=d.parse(h[1],1,rt);if(!g)return null;if(!wa(m,g.type))return d.concat(1).error(`"${m}" comparisons are not supported for type '${Pt(g.type)}'.`);let x=d.parse(h[2],2,rt);if(!x)return null;if(!wa(m,x.type))return d.concat(2).error(`"${m}" comparisons are not supported for type '${Pt(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${Pt(g.type)}' and '${Pt(x.type)}'.`);o&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new et(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new et(g.type,[x])));let T=null;if(h.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(T=d.parse(h[3],3,Sr),!T)return null}return new np(g,x,T)}evaluate(h){const d=this.lhs.evaluate(h),m=this.rhs.evaluate(h);if(o&&this.hasUntypedArgument){const g=he(d),x=he(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new Le(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${x.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const g=he(d),x=he(m);if(g.kind!=="string"||x.kind!=="string")return e(h,d,m)}return this.collator?r(h,d,m,this.collator.evaluate(h)):e(h,d,m)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}const Ll=Mn("==",function(i,e,r){return e===r},Ta),Rl=Mn("!=",function(i,e,r){return e!==r},function(i,e,r,o){return!Ta(0,e,r,o)}),Bl=Mn("<",function(i,e,r){return e<r},function(i,e,r,o){return o.compare(e,r)<0}),Fl=Mn(">",function(i,e,r){return e>r},function(i,e,r,o){return o.compare(e,r)>0}),Ol=Mn("<=",function(i,e,r){return e<=r},function(i,e,r,o){return o.compare(e,r)<=0}),$l=Mn(">=",function(i,e,r){return e>=r},function(i,e,r,o){return o.compare(e,r)>=0});class ws{constructor(e,r,o,c,h){this.type=lt,this.number=e,this.locale=r,this.currency=o,this.minFractionDigits=c,this.maxFractionDigits=h}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const o=r.parse(e[1],1,Ie);if(!o)return null;const c=e[2];if(typeof c!="object"||Array.isArray(c))return r.error("NumberFormat options argument must be an object.");let h=null;if(c.locale&&(h=r.parse(c.locale,1,lt),!h))return null;let d=null;if(c.currency&&(d=r.parse(c.currency,1,lt),!d))return null;let m=null;if(c["min-fraction-digits"]&&(m=r.parse(c["min-fraction-digits"],1,Ie),!m))return null;let g=null;return c["max-fraction-digits"]&&(g=r.parse(c["max-fraction-digits"],1,Ie),!g)?null:new ws(o,h,d,m,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Oo{constructor(e){this.type=oi,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[1];if(!Array.isArray(o)&&typeof o=="object")return r.error("First argument must be an image or text section.");const c=[];let h=!1;for(let d=1;d<=e.length-1;++d){const m=e[d];if(h&&typeof m=="object"&&!Array.isArray(m)){h=!1;let g=null;if(m["font-scale"]&&(g=r.parse(m["font-scale"],1,Ie),!g))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,Ti(lt)),!x))return null;let T=null;if(m["text-color"]&&(T=r.parse(m["text-color"],1,fi),!T))return null;const I=c[c.length-1];I.scale=g,I.font=x,I.textColor=T}else{const g=r.parse(e[d],1,rt);if(!g)return null;const x=g.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");h=!0,c.push({content:g,scale:null,font:null,textColor:null})}}return new Oo(c)}evaluate(e){return new W(this.sections.map(r=>{const o=r.content.evaluate(e);return he(o)===Yt?new K("",o,null,null,null):new K(Ve(o),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class Ts{constructor(e){this.type=Yt,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const o=r.parse(e[1],1,lt);return o?new Ts(o):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),o=J.fromString(r);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(r)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class Es{constructor(e){this.type=Ie,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=r.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${Pt(o.type)} instead.`):new Es(o):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Le(`Expected value to be of type string or array, but found ${Pt(he(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Pn={"==":Ll,"!=":Rl,">":Fl,"<":Bl,">=":$l,"<=":Ol,array:et,at:ys,boolean:et,case:bs,coalesce:Lo,collator:si,format:Oo,image:Ts,in:xs,"index-of":Bo,interpolate:Ui,"interpolate-hcl":Ui,"interpolate-lab":Ui,length:Es,let:Ro,literal:Ge,match:vs,number:et,"number-format":ws,object:et,slice:Fo,step:Yn,string:et,"to-boolean":it,"to-color":it,"to-number":it,"to-string":it,var:zo,within:tn};function Ea(i,[e,r,o,c]){e=e.evaluate(i),r=r.evaluate(i),o=o.evaluate(i);const h=c?c.evaluate(i):1,d=pe(e,r,o,h);if(d)throw new Le(d);return new B(e/255*h,r/255*h,o/255*h,h)}function Sa(i,e){return i in e}function $o(i,e){const r=e[i];return r===void 0?null:r}function rn(i){return{type:i}}function Ia(i){return{result:"success",value:i}}function zn(i){return{result:"error",value:i}}function Ft(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Ca(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function mt(i){return!!i.expression&&i.expression.interpolated}function It(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Bt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Vt(i){return i}function io(i,e){const r=e.type==="color",o=i.stops&&typeof i.stops[0][0]=="object",c=o||!(o||i.property!==void 0),h=i.type||(mt(e)?"exponential":"interval");if(r||e.type==="padding"){const x=r?B.parse:X.parse;(i=ir({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],x(T[1])])),i.default=x(i.default?i.default:e.default)}if(i.colorSpace&&i.colorSpace!=="rgb"&&!ba[i.colorSpace])throw new Error(`Unknown color space: ${i.colorSpace}`);let d,m,g;if(h==="exponential")d=Aa;else if(h==="interval")d=Vl;else if(h==="categorical"){d=Ul,m=Object.create(null);for(const x of i.stops)m[x[0]]=x[1];g=typeof i.stops[0][0]}else{if(h!=="identity")throw new Error(`Unknown function type "${h}"`);d=Nl}if(o){const x={},T=[];for(let D=0;D<i.stops.length;D++){const L=i.stops[D],Z=L[0].zoom;x[Z]===void 0&&(x[Z]={zoom:Z,type:i.type,property:i.property,default:i.default,stops:[]},T.push(Z)),x[Z].stops.push([L[0].value,L[1]])}const I=[];for(const D of T)I.push([x[D].zoom,io(x[D],e)]);const P={name:"linear"};return{kind:"composite",interpolationType:P,interpolationFactor:Ui.interpolationFactor.bind(void 0,P),zoomStops:I.map(D=>D[0]),evaluate:({zoom:D},L)=>Aa({stops:I,base:i.base},e,D).evaluate(D,L)}}if(c){const x=h==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:x,interpolationFactor:Ui.interpolationFactor.bind(void 0,x),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>d(i,e,T,m,g)}}return{kind:"source",evaluate(x,T){const I=T&&T.properties?T.properties[i.property]:void 0;return I===void 0?kn(i.default,e.default):d(i,e,I,m,g)}}}function kn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Ul(i,e,r,o,c){return kn(typeof r===c?o[r]:void 0,i.default,e.default)}function Vl(i,e,r){if(It(r)!=="number")return kn(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const c=ko(i.stops.map(h=>h[0]),r);return i.stops[c][1]}function Aa(i,e,r){const o=i.base!==void 0?i.base:1;if(It(r)!=="number")return kn(i.default,e.default);const c=i.stops.length;if(c===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[c-1][0])return i.stops[c-1][1];const h=ko(i.stops.map(T=>T[0]),r),d=function(T,I,P,D){const L=D-P,Z=T-P;return L===0?0:I===1?Z/L:(Math.pow(I,Z)-1)/(Math.pow(I,L)-1)}(r,o,i.stops[h][0],i.stops[h+1][0]),m=i.stops[h][1],g=i.stops[h+1][1];let x=Qn[e.type]||Vt;if(i.colorSpace&&i.colorSpace!=="rgb"){const T=ba[i.colorSpace];x=(I,P)=>T.reverse(T.interpolate(T.forward(I),T.forward(P),d))}return typeof m.evaluate=="function"?{evaluate(...T){const I=m.evaluate.apply(void 0,T),P=g.evaluate.apply(void 0,T);if(I!==void 0&&P!==void 0)return x(I,P,d)}}:x(m,g,d)}function Nl(i,e,r){switch(e.type){case"color":r=B.parse(r);break;case"formatted":r=W.fromString(r.toString());break;case"resolvedImage":r=J.fromString(r.toString());break;case"padding":r=X.parse(r);break;default:It(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return kn(r,i.default,e.default)}kt.register(Pn,{error:[{kind:"error"},[lt],(i,[e])=>{throw new Le(e.evaluate(i))}],typeof:[lt,[rt],(i,[e])=>Pt(he(e.evaluate(i)))],"to-rgba":[Ti(Ie,4),[fi],(i,[e])=>e.evaluate(i).toArray()],rgb:[fi,[Ie,Ie,Ie],Ea],rgba:[fi,[Ie,Ie,Ie,Ie],Ea],has:{type:ot,overloads:[[[lt],(i,[e])=>Sa(e.evaluate(i),i.properties())],[[lt,Ur],(i,[e,r])=>Sa(e.evaluate(i),r.evaluate(i))]]},get:{type:rt,overloads:[[[lt],(i,[e])=>$o(e.evaluate(i),i.properties())],[[lt,Ur],(i,[e,r])=>$o(e.evaluate(i),r.evaluate(i))]]},"feature-state":[rt,[lt],(i,[e])=>$o(e.evaluate(i),i.featureState||{})],properties:[Ur,[],i=>i.properties()],"geometry-type":[lt,[],i=>i.geometryType()],id:[rt,[],i=>i.id()],zoom:[Ie,[],i=>i.globals.zoom],"heatmap-density":[Ie,[],i=>i.globals.heatmapDensity||0],"line-progress":[Ie,[],i=>i.globals.lineProgress||0],accumulated:[rt,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Ie,rn(Ie),(i,e)=>{let r=0;for(const o of e)r+=o.evaluate(i);return r}],"*":[Ie,rn(Ie),(i,e)=>{let r=1;for(const o of e)r*=o.evaluate(i);return r}],"-":{type:Ie,overloads:[[[Ie,Ie],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Ie],(i,[e])=>-e.evaluate(i)]]},"/":[Ie,[Ie,Ie],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Ie,[Ie,Ie],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Ie,[],()=>Math.LN2],pi:[Ie,[],()=>Math.PI],e:[Ie,[],()=>Math.E],"^":[Ie,[Ie,Ie],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Ie,[Ie],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Ie,[Ie],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Ie,[Ie],(i,[e])=>Math.log(e.evaluate(i))],log2:[Ie,[Ie],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Ie,[Ie],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Ie,[Ie],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Ie,[Ie],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Ie,[Ie],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Ie,[Ie],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Ie,[Ie],(i,[e])=>Math.atan(e.evaluate(i))],min:[Ie,rn(Ie),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Ie,rn(Ie),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Ie,[Ie],(i,[e])=>Math.abs(e.evaluate(i))],round:[Ie,[Ie],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ie,[Ie],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Ie,[Ie],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[ot,[lt,rt],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[ot,[rt],(i,[e])=>i.id()===e.value],"filter-type-==":[ot,[lt],(i,[e])=>i.geometryType()===e.value],"filter-<":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<c}],"filter-id-<":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<o}],"filter->":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>c}],"filter-id->":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>o}],"filter-<=":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<=c}],"filter-id-<=":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<=o}],"filter->=":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>=c}],"filter-id->=":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>=o}],"filter-has":[ot,[rt],(i,[e])=>e.value in i.properties()],"filter-has-id":[ot,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[ot,[Ti(lt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[ot,[Ti(rt)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[ot,[lt,Ti(rt)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[ot,[lt,Ti(rt)],(i,[e,r])=>function(o,c,h,d){for(;h<=d;){const m=h+d>>1;if(c[m]===o)return!0;c[m]>o?d=m-1:h=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:ot,overloads:[[[ot,ot],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[rn(ot),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:ot,overloads:[[[ot,ot],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[rn(ot),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[ot,[ot],(i,[e])=>!e.evaluate(i)],"is-supported-script":[ot,[lt],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[lt,[lt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[lt,[lt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[lt,rn(rt),(i,e)=>e.map(r=>Ve(r.evaluate(i))).join("")],"resolved-locale":[lt,[Sr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Uo{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new bt,this._defaultValue=r?function(o){return o.type==="color"&&Bt(o.default)?new B(0,0,0,0):o.type==="color"?B.parse(o.default)||null:o.type==="padding"?X.parse(o.default)||null:o.default===void 0?null:o.default}(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,o,c,h,d){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=o,this._evaluator.canonical=c,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,r,o,c,h,d){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=o||null,this._evaluator.canonical=c,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=d||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Le(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console!="undefined"&&console.warn(m.message)),this._defaultValue}}}function ro(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Pn}function no(i,e){const r=new An(Pn,[],e?function(c){const h={color:fi,string:lt,number:Ie,enum:lt,boolean:ot,formatted:oi,padding:Tn,resolvedImage:Yt};return c.type==="array"?Ti(h[c.value]||rt,c.length):h[c.type]}(e):void 0),o=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?Ia(new Uo(o,e)):zn(r.errors)}class oo{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!Cn(r.expression)}evaluateWithoutErrorHandling(e,r,o,c,h,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,d)}evaluate(e,r,o,c,h,d){return this._styleExpression.evaluate(e,r,o,c,h,d)}}class Ss{constructor(e,r,o,c){this.kind=e,this.zoomStops=o,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!Cn(r.expression),this.interpolationType=c}evaluateWithoutErrorHandling(e,r,o,c,h,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,d)}evaluate(e,r,o,c,h,d){return this._styleExpression.evaluate(e,r,o,c,h,d)}interpolationFactor(e,r,o){return this.interpolationType?Ui.interpolationFactor(this.interpolationType,e,r,o):0}}function Ma(i,e){const r=no(i,e);if(r.result==="error")return r;const o=r.value.expression,c=Jn(o);if(!c&&!Ft(e))return zn([new Oi("","data expressions not supported")]);const h=Po(o,["zoom"]);if(!h&&!Ca(e))return zn([new Oi("","zoom expressions not supported")]);const d=No(o);return d||h?d instanceof Oi?zn([d]):d instanceof Ui&&!mt(e)?zn([new Oi("",'"interpolate" expressions cannot be used with this property')]):Ia(d?new Ss(c?"camera":"composite",r.value,d.labels,d instanceof Ui?d.interpolation:void 0):new oo(c?"constant":"source",r.value)):zn([new Oi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Vo{constructor(e,r){this._parameters=e,this._specification=r,ir(this,io(this._parameters,this._specification))}static deserialize(e){return new Vo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function No(i){let e=null;if(i instanceof Ro)e=No(i.result);else if(i instanceof Lo){for(const r of i.args)if(e=No(r),e)break}else(i instanceof Yn||i instanceof Ui)&&i.input instanceof kt&&i.input.name==="zoom"&&(e=i);return e instanceof Oi||i.eachChild(r=>{const o=No(r);o instanceof Oi?e=o:!e&&o?e=new Oi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new Oi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function rr(i){const e=i.key,r=i.value,o=i.valueSpec||{},c=i.objectElementValidators||{},h=i.style,d=i.styleSpec;let m=[];const g=It(r);if(g!=="object")return[new Me(e,r,`object expected, ${g} found`)];for(const x in r){const T=x.split(".")[0],I=o[T]||o["*"];let P;if(c[T])P=c[T];else if(o[T])P=Ni;else if(c["*"])P=c["*"];else{if(!o["*"]){m.push(new Me(e,r[x],`unknown property "${x}"`));continue}P=Ni}m=m.concat(P({key:(e&&`${e}.`)+x,value:r[x],valueSpec:I,style:h,styleSpec:d,object:r,objectKey:x},r))}for(const x in o)c[x]||o[x].required&&o[x].default===void 0&&r[x]===void 0&&m.push(new Me(e,r,`missing required property "${x}"`));return m}function Pa(i){const e=i.value,r=i.valueSpec,o=i.style,c=i.styleSpec,h=i.key,d=i.arrayElementValidator||Ni;if(It(e)!=="array")return[new Me(h,e,`array expected, ${It(e)} found`)];if(r.length&&e.length!==r.length)return[new Me(h,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new Me(h,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let m={type:r.value,values:r.values};c.$version<7&&(m.function=r.function),It(r.value)==="object"&&(m=r.value);let g=[];for(let x=0;x<e.length;x++)g=g.concat(d({array:e,arrayIndex:x,value:e[x],valueSpec:m,style:o,styleSpec:c,key:`${h}[${x}]`}));return g}function Is(i){const e=i.key,r=i.value,o=i.valueSpec;let c=It(r);return c==="number"&&r!=r&&(c="NaN"),c!=="number"?[new Me(e,r,`number expected, ${c} found`)]:"minimum"in o&&r<o.minimum?[new Me(e,r,`${r} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&r>o.maximum?[new Me(e,r,`${r} is greater than the maximum value ${o.maximum}`)]:[]}function za(i){const e=i.valueSpec,r=xt(i.value.type);let o,c,h,d={};const m=r!=="categorical"&&i.value.property===void 0,g=!m,x=It(i.value.stops)==="array"&&It(i.value.stops[0])==="array"&&It(i.value.stops[0][0])==="object",T=rr({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(D){if(r==="identity")return[new Me(D.key,D.value,'identity function may not have a "stops" property')];let L=[];const Z=D.value;return L=L.concat(Pa({key:D.key,value:Z,valueSpec:D.valueSpec,style:D.style,styleSpec:D.styleSpec,arrayElementValidator:I})),It(Z)==="array"&&Z.length===0&&L.push(new Me(D.key,Z,"array must have at least one stop")),L},default:function(D){return Ni({key:D.key,value:D.value,valueSpec:e,style:D.style,styleSpec:D.styleSpec})}}});return r==="identity"&&m&&T.push(new Me(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||T.push(new Me(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!mt(i.valueSpec)&&T.push(new Me(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!Ft(i.valueSpec)?T.push(new Me(i.key,i.value,"property functions not supported")):m&&!Ca(i.valueSpec)&&T.push(new Me(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||T.push(new Me(i.key,i.value,'"property" property is required')),T;function I(D){let L=[];const Z=D.value,q=D.key;if(It(Z)!=="array")return[new Me(q,Z,`array expected, ${It(Z)} found`)];if(Z.length!==2)return[new Me(q,Z,`array length 2 expected, length ${Z.length} found`)];if(x){if(It(Z[0])!=="object")return[new Me(q,Z,`object expected, ${It(Z[0])} found`)];if(Z[0].zoom===void 0)return[new Me(q,Z,"object stop key must have zoom")];if(Z[0].value===void 0)return[new Me(q,Z,"object stop key must have value")];if(h&&h>xt(Z[0].zoom))return[new Me(q,Z[0].zoom,"stop zoom values must appear in ascending order")];xt(Z[0].zoom)!==h&&(h=xt(Z[0].zoom),c=void 0,d={}),L=L.concat(rr({key:`${q}[0]`,value:Z[0],valueSpec:{zoom:{}},style:D.style,styleSpec:D.styleSpec,objectElementValidators:{zoom:Is,value:P}}))}else L=L.concat(P({key:`${q}[0]`,value:Z[0],valueSpec:{},style:D.style,styleSpec:D.styleSpec},Z));return ro(Ki(Z[1]))?L.concat([new Me(`${q}[1]`,Z[1],"expressions are not allowed in function stops.")]):L.concat(Ni({key:`${q}[1]`,value:Z[1],valueSpec:e,style:D.style,styleSpec:D.styleSpec}))}function P(D,L){const Z=It(D.value),q=xt(D.value),re=D.value!==null?D.value:L;if(o){if(Z!==o)return[new Me(D.key,re,`${Z} stop domain type must match previous stop domain type ${o}`)]}else o=Z;if(Z!=="number"&&Z!=="string"&&Z!=="boolean")return[new Me(D.key,re,"stop domain value must be a number, string, or boolean")];if(Z!=="number"&&r!=="categorical"){let ce=`number expected, ${Z} found`;return Ft(e)&&r===void 0&&(ce+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Me(D.key,re,ce)]}return r!=="categorical"||Z!=="number"||isFinite(q)&&Math.floor(q)===q?r!=="categorical"&&Z==="number"&&c!==void 0&&q<c?[new Me(D.key,re,"stop domain values must appear in ascending order")]:(c=q,r==="categorical"&&q in d?[new Me(D.key,re,"stop domain values must be unique")]:(d[q]=!0,[])):[new Me(D.key,re,`integer expected, found ${q}`)]}}function nn(i){const e=(i.expressionContext==="property"?Ma:no)(Ki(i.value),i.valueSpec);if(e.result==="error")return e.value.map(o=>new Me(`${i.key}${o.key}`,i.value,o.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new Me(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Cn(r))return[new Me(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Cn(r))return[new Me(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Po(r,["zoom","feature-state"]))return[new Me(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Jn(r))return[new Me(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function so(i){const e=i.key,r=i.value,o=i.valueSpec,c=[];return Array.isArray(o.values)?o.values.indexOf(xt(r))===-1&&c.push(new Me(e,r,`expected one of [${o.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(o.values).indexOf(xt(r))===-1&&c.push(new Me(e,r,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(r)} found`)),c}function Dn(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Dn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Gl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Go(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Dn(i)||(i=ao(i));const e=no(i,Gl);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,o,c)=>e.value.evaluate(r,o,{},c),needGeometry:Da(i)}}function ka(i,e){return i<e?-1:i>e?1:0}function Da(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Da(i[e]))return!0;return!1}function ao(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?Cs(i[1],i[2],"=="):e==="!="?Ln(Cs(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Cs(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(ao))):e==="all"?["all"].concat(i.slice(1).map(ao)):e==="none"?["all"].concat(i.slice(1).map(ao).map(Ln)):e==="in"?qo(i[1],i.slice(2)):e==="!in"?Ln(qo(i[1],i.slice(2))):e==="has"?lo(i[1]):e==="!has"?Ln(lo(i[1])):e!=="within"||i;var r}function Cs(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function qo(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(ka)]]:["filter-in-small",i,["literal",e]]}}function lo(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ln(i){return["!",i]}function co(i){return Dn(Ki(i.value))?nn(ir({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):La(i)}function La(i){const e=i.value,r=i.key;if(It(e)!=="array")return[new Me(r,e,`array expected, ${It(e)} found`)];const o=i.styleSpec;let c,h=[];if(e.length<1)return[new Me(r,e,"filter array must have at least 1 element")];switch(h=h.concat(so({key:`${r}[0]`,value:e[0],valueSpec:o.filter_operator,style:i.style,styleSpec:i.styleSpec})),xt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&xt(e[1])==="$type"&&h.push(new Me(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&h.push(new Me(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(c=It(e[1]),c!=="string"&&h.push(new Me(`${r}[1]`,e[1],`string expected, ${c} found`)));for(let d=2;d<e.length;d++)c=It(e[d]),xt(e[1])==="$type"?h=h.concat(so({key:`${r}[${d}]`,value:e[d],valueSpec:o.geometry_type,style:i.style,styleSpec:i.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&h.push(new Me(`${r}[${d}]`,e[d],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let d=1;d<e.length;d++)h=h.concat(La({key:`${r}[${d}]`,value:e[d],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":c=It(e[1]),e.length!==2?h.push(new Me(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="string"&&h.push(new Me(`${r}[1]`,e[1],`string expected, ${c} found`));break;case"within":c=It(e[1]),e.length!==2?h.push(new Me(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="object"&&h.push(new Me(`${r}[1]`,e[1],`object expected, ${c} found`))}return h}function uo(i,e){const r=i.key,o=i.style,c=i.styleSpec,h=i.value,d=i.objectKey,m=c[`${e}_${i.layerType}`];if(!m)return[];const g=d.match(/^(.*)-transition$/);if(e==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return Ni({key:r,value:h,valueSpec:c.transition,style:o,styleSpec:c});const x=i.valueSpec||m[d];if(!x)return[new Me(r,h,`unknown property "${d}"`)];let T;if(It(h)==="string"&&Ft(x)&&!x.tokens&&(T=/^{([^}]+)}$/.exec(h)))return[new Me(r,h,`"${d}" does not support interpolation syntax
|
|
1
|
+
import{R as Tf,r as Te,$ as jh,a as Xh,b as nt,j as Se,s as El,_ as Ef,c as Wh,d as Sf,i as Co,u as la,e as Sl,f as qc,g as Zc,h as If,k as Zt,t as Et,F as Il,l as Ri,m as Lc,n as os,o as jc,p as wl,q as Sh,v as ca,w as cr,x as Hh,y as Cf,U as Kh,z as Jh,L as Cl,A as tr,S as Ih,B as Af,C as oa,D as xl,E as Mf,T as Pf,G as zf,H as kf}from"./index.a0f74ea9.js";var sa=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};const Df=Tf["useId".toString()]||(()=>{});let Lf=0;function Yh(w){const[E,A]=Te.exports.useState(Df());return jh(()=>{w||A(z=>z!=null?z:String(Lf++))},[w]),w||(E?`radix-${E}`:"")}function Xc({prop:w,defaultProp:E,onChange:A=()=>{}}){const[z,F]=Rf({defaultProp:E,onChange:A}),N=w!==void 0,oe=N?w:z,a=Xh(A),ee=Te.exports.useCallback(te=>{if(N){const ue=typeof te=="function"?te(w):te;ue!==w&&a(ue)}else F(te)},[N,w,F,a]);return[oe,ee]}function Rf({defaultProp:w,onChange:E}){const A=Te.exports.useState(w),[z]=A,F=Te.exports.useRef(z),N=Xh(E);return Te.exports.useEffect(()=>{F.current!==z&&(N(z),F.current=z)},[z,F,N]),A}const Qh=nt.createContext({}),Zn=()=>Te.exports.useContext(Qh),Bf=(w,E)=>{switch(E.type){case"CATEGORY":return{...w,activeCategory:E.value};case"SCORE":{const A=El.find(z=>E.value===""?z.value===w.activeCategory:z.scores.includes(E.value)).value;return{activeCategory:A,activeScoreByCategory:{...w.activeScoreByCategory,[A]:E.value}}}}},Ff=({children:w})=>{const[E,A]=Te.exports.useState(!1),[z,F]=Te.exports.useReducer(Bf,{activeCategory:"commute",activeScoreByCategory:{commute:"pedestrian_friendly",amenities:"groceries",character:"vibrant",nature:"parks",education:"high_schools"}}),[N,oe]=Te.exports.useState(),[a,ee]=Te.exports.useState(),{activeCategory:te}=z,fe=z.activeScoreByCategory[te],ue=Ue=>{F({type:"SCORE",value:Ue})},ie=Ue=>{F({type:"CATEGORY",value:Ue})},qe=Te.exports.useMemo(()=>({activeScore:fe,setActiveScore:ue,activeCategory:te,setActiveCategory:ie,activePOI:N,setActivePOI:oe,hoveredPOI:a,setHoveredPOI:ee,showMobileList:E,setShowMobileList:A}),[fe,ue,te,ie,N,oe,a,ee,E,A]);return Se(Qh.Provider,{value:qe,children:w})},Of=Te.exports.createContext(null);function $f(w){const E=w.clone();return E.pixelsToGLUnits=w.pixelsToGLUnits,E}function Ch(w){return{longitude:w.center.lng,latitude:w.center.lat,zoom:w.zoom,pitch:w.pitch,bearing:w.bearing,padding:w.padding}}function Ah(w,E){const A=E.viewState||E;let z=!1;if("longitude"in A&&"latitude"in A){const F=w.center;w.center=new F.constructor(A.longitude,A.latitude),z=z||F!==w.center}if("zoom"in A){const F=w.zoom;w.zoom=A.zoom,z=z||F!==w.zoom}if("bearing"in A){const F=w.bearing;w.bearing=A.bearing,z=z||F!==w.bearing}if("pitch"in A){const F=w.pitch;w.pitch=A.pitch,z=z||F!==w.pitch}return A.padding&&!w.isPaddingEqual(A.padding)&&(z=!0,w.padding=A.padding),z}const Uf=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Mh(w){if(!w)return null;if(typeof w=="string"||("toJS"in w&&(w=w.toJS()),!w.layers))return w;const E={};for(const z of w.layers)E[z.id]=z;const A=w.layers.map(z=>{const F=E[z.ref];let N=null;if("interactive"in z&&(N={...z},delete N.interactive),F){N=N||{...z},delete N.ref;for(const oe of Uf)oe in F&&(N[oe]=F[oe])}return N||z});return{...w,layers:A}}function Vf(w,E){const A=Array.isArray(w)?w[0]:w?w.x:0,z=Array.isArray(w)?w[1]:w?w.y:0,F=Array.isArray(E)?E[0]:E?E.x:0,N=Array.isArray(E)?E[1]:E?E.y:0;return A===F&&z===N}function qn(w,E){if(w===E)return!0;if(!w||!E)return!1;if(Array.isArray(w)){if(!Array.isArray(E)||w.length!==E.length)return!1;for(let A=0;A<w.length;A++)if(!qn(w[A],E[A]))return!1;return!0}else if(Array.isArray(E))return!1;if(typeof w=="object"&&typeof E=="object"){const A=Object.keys(w),z=Object.keys(E);if(A.length!==z.length)return!1;for(const F of A)if(!E.hasOwnProperty(F)||!qn(w[F],E[F]))return!1;return!0}return!1}const Ph={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Rc={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},zh={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Nf=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Gf=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class ss{constructor(E,A,z){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=F=>{const N=this.props[zh[F.type]];N&&N(F)},this._onPointerEvent=F=>{(F.type==="mousemove"||F.type==="mouseout")&&this._updateHover(F);const N=this.props[Ph[F.type]];if(N){if(this.props.interactiveLayerIds&&F.type!=="mouseover"&&F.type!=="mouseout"){const oe=this._hoveredFeatures||this._map.queryRenderedFeatures(F.point,{layers:this.props.interactiveLayerIds});F.features=oe}N(F),delete F.features}},this._onCameraEvent=F=>{if(!this._internalUpdate){const N=this.props[Rc[F.type]];N&&N(F)}F.type in this._deferredEvents&&(this._deferredEvents[F.type]=!1)},this._MapClass=E,this.props=A,this._initialize(z)}get map(){return this._map}get transform(){return this._renderTransform}setProps(E){const A=this.props;this.props=E;const z=this._updateSettings(E,A);z&&this._createShadowTransform(this._map);const F=this._updateSize(E),N=this._updateViewState(E,!0);this._updateStyle(E,A),this._updateStyleComponents(E,A),this._updateHandlers(E,A),(z||F||N&&!this._map.isMoving())&&this.redraw()}static reuse(E,A){const z=ss.savedMaps.pop();if(!z)return null;const F=z.map,N=F.getContainer();for(A.className=N.className;N.childNodes.length>0;)A.appendChild(N.childNodes[0]);F._container=A,z.setProps({...E,styleDiffing:!1}),F.resize();const{initialViewState:oe}=E;return oe&&(oe.bounds?F.fitBounds(oe.bounds,{...oe.fitBoundsOptions,duration:0}):z._updateViewState(oe,!1)),F.isStyleLoaded()?F.fire("load"):F.once("styledata",()=>F.fire("load")),z}_initialize(E){const{props:A}=this,z={...A,...A.initialViewState,accessToken:A.mapboxAccessToken||qf()||null,container:E,style:Mh(A.mapStyle)},F=z.initialViewState||z.viewState||z;if(Object.assign(z,{center:[F.longitude||0,F.latitude||0],zoom:F.zoom||0,pitch:F.pitch||0,bearing:F.bearing||0}),A.gl){const te=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=te,A.gl)}const N=new this._MapClass(z);F.padding&&N.setPadding(F.padding),A.cursor&&(N.getCanvas().style.cursor=A.cursor),this._createShadowTransform(N);const oe=N._render;N._render=te=>{this._inRender=!0,oe.call(N,te),this._inRender=!1};const a=N._renderTaskQueue.run;N._renderTaskQueue.run=te=>{a.call(N._renderTaskQueue,te),this._onBeforeRepaint()},N.on("render",()=>this._onAfterRepaint());const ee=N.fire;N.fire=this._fireEvent.bind(this,ee),N.on("resize",()=>{this._renderTransform.resize(N.transform.width,N.transform.height)}),N.on("styledata",()=>this._updateStyleComponents(this.props,{})),N.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const te in Ph)N.on(te,this._onPointerEvent);for(const te in Rc)N.on(te,this._onCameraEvent);for(const te in zh)N.on(te,this._onEvent);this._map=N}recycle(){ss.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const E=this._map;!this._inRender&&E.style&&(E._frame&&(E._frame.cancel(),E._frame=null),E._render())}_createShadowTransform(E){const A=$f(E.transform);E.painter.transform=A,this._renderTransform=A}_updateSize(E){const{viewState:A}=E;if(A){const z=this._map;if(A.width!==z.transform.width||A.height!==z.transform.height)return z.resize(),!0}return!1}_updateViewState(E,A){if(this._internalUpdate)return!1;const z=this._map,F=this._renderTransform,{zoom:N,pitch:oe,bearing:a}=F,ee=z.isMoving();ee&&(F.cameraElevationReference="sea");const te=Ah(F,{...Ch(z.transform),...E});if(ee&&(F.cameraElevationReference="ground"),te&&A){const fe=this._deferredEvents;fe.move=!0,fe.zoom||(fe.zoom=N!==F.zoom),fe.rotate||(fe.rotate=a!==F.bearing),fe.pitch||(fe.pitch=oe!==F.pitch)}return ee||Ah(z.transform,E),te}_updateSettings(E,A){const z=this._map;let F=!1;for(const N of Nf)N in E&&!qn(E[N],A[N])&&(F=!0,z[`set${N[0].toUpperCase()}${N.slice(1)}`](E[N]));return F}_updateStyle(E,A){if(E.cursor!==A.cursor&&(this._map.getCanvas().style.cursor=E.cursor),E.mapStyle!==A.mapStyle){const z={diff:E.styleDiffing};return"localIdeographFontFamily"in E&&(z.localIdeographFontFamily=E.localIdeographFontFamily),this._map.setStyle(Mh(E.mapStyle),z),!0}return!1}_updateStyleComponents(E,A){const z=this._map;let F=!1;return z.style.loaded()&&("light"in E&&!qn(E.light,A.light)&&(F=!0,z.setLight(E.light)),"fog"in E&&!qn(E.fog,A.fog)&&(F=!0,z.setFog(E.fog)),"terrain"in E&&!qn(E.terrain,A.terrain)&&(!E.terrain||z.getSource(E.terrain.source))&&(F=!0,z.setTerrain(E.terrain))),F}_updateHandlers(E,A){const z=this._map;let F=!1;for(const N of Gf){const oe=E[N];qn(oe,A[N])||(F=!0,oe?z[N].enable(oe):z[N].disable())}return F}_updateHover(E){var A;const{props:z}=this;if(z.interactiveLayerIds&&(z.onMouseMove||z.onMouseEnter||z.onMouseLeave)){const N=E.type,oe=((A=this._hoveredFeatures)===null||A===void 0?void 0:A.length)>0;let a;if(N==="mousemove")try{a=this._map.queryRenderedFeatures(E.point,{layers:z.interactiveLayerIds})}catch{a=[]}else a=[];const ee=a.length>0;!ee&&oe&&(E.type="mouseleave",this._onPointerEvent(E)),this._hoveredFeatures=a,ee&&!oe&&(E.type="mouseenter",this._onPointerEvent(E)),E.type=N}else this._hoveredFeatures=null}_fireEvent(E,A,z){const F=this._map,N=F.transform,oe=typeof A=="string"?A:A.type;return oe==="move"&&this._updateViewState(this.props,!1),oe in Rc&&(typeof A=="object"&&(A.viewState=Ch(N)),this._map.isMoving())?(F.transform=this._renderTransform,E.call(F,A,z),F.transform=N,F):(E.call(F,A,z),F)}_onBeforeRepaint(){const E=this._map;this._internalUpdate=!0;for(const z in this._deferredEvents)this._deferredEvents[z]&&E.fire(z);this._internalUpdate=!1;const A=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=A}}}ss.savedMaps=[];function qf(){let w=null;if(typeof location!="undefined"){const E=/access_token=([^&\/]*)/.exec(location.search);w=E&&E[1]}try{w=w||{}.MapboxAccessToken}catch{}try{w=w||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return w}const Zf=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function jf(w,E){if(!w)return null;const A=w.map,z={getMap:()=>A,getCenter:()=>w.transform.center,getZoom:()=>w.transform.zoom,getBearing:()=>w.transform.bearing,getPitch:()=>w.transform.pitch,getPadding:()=>w.transform.padding,getBounds:()=>w.transform.getBounds(),project:F=>w.transform.locationPoint(E.LngLat.convert(F)),unproject:F=>w.transform.pointLocation(E.Point.convert(F)),queryTerrainElevation:(F,N)=>{const oe=A.transform;A.transform=w.transform;const a=A.queryTerrainElevation(F,N);return A.transform=oe,a}};for(const F of Xf(A))!(F in z)&&!Zf.includes(F)&&(z[F]=A[F].bind(A));return z}function Xf(w){const E=new Set;let A=w;for(;A;){for(const z of Object.getOwnPropertyNames(A))z[0]!=="_"&&typeof w[z]=="function"&&z!=="fire"&&z!=="setEventedParent"&&E.add(z);A=Object.getPrototypeOf(A)}return Array.from(E)}const Wf=typeof document!="undefined"?Te.exports.useLayoutEffect:Te.exports.useEffect,Hf=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Kf(w,E){for(const A of Hf)A in E&&(w[A]=E[A]);E.RTLTextPlugin&&w.getRTLTextPluginStatus&&w.getRTLTextPluginStatus()==="unavailable"&&w.setRTLTextPlugin(E.RTLTextPlugin,A=>{A&&console.error(A)},!1)}const Al=Te.exports.createContext(null),Jf={minZoom:0,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,mapStyle:{version:8,sources:{},layers:[]},styleDiffing:!0,projection:"mercator",renderWorldCopies:!0,onError:w=>console.error(w.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},Wc=Te.exports.forwardRef((w,E)=>{const A=Te.exports.useContext(Of),[z,F]=Te.exports.useState(null),N=Te.exports.useRef(),{current:oe}=Te.exports.useRef({mapLib:null,map:null});Te.exports.useEffect(()=>{const ee=w.mapLib;let te=!0,fe;return Promise.resolve(ee||Ef(()=>import("./index.c629d6a1.js").then(function(ue){return ue.i}),[])).then(ue=>{if(!!te){if(ue.Map||(ue=ue.default),!ue||!ue.Map)throw new Error("Invalid mapLib");if(ue.supported(w))Kf(ue,w),w.reuseMaps&&(fe=ss.reuse(w,N.current)),fe||(fe=new ss(ue.Map,w,N.current)),oe.map=jf(fe,ue),oe.mapLib=ue,F(fe),A==null||A.onMapMount(oe.map,w.id);else throw new Error("Map is not supported by this browser")}}).catch(ue=>{w.onError({type:"error",target:null,originalEvent:null,error:ue})}),()=>{te=!1,fe&&(A==null||A.onMapUnmount(w.id),w.reuseMaps?fe.recycle():fe.destroy())}},[]),Wf(()=>{z&&z.setProps(w)}),Te.exports.useImperativeHandle(E,()=>oe.map,[z]);const a=Te.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...w.style}),[w.style]);return Te.exports.createElement("div",{id:w.id,ref:N,style:a},z&&Te.exports.createElement(Al.Provider,{value:oe},w.children))});Wc.displayName="Map";Wc.defaultProps=Jf;const Yf=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ao(w,E){if(!w||!E)return;const A=w.style;for(const z in E){const F=E[z];Number.isFinite(F)&&!Yf.test(z)?A[z]=`${F}px`:A[z]=F}}const Qf={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function ep(w){const{map:E,mapLib:A}=Te.exports.useContext(Al),z=Te.exports.useRef({props:w});z.current.props=w;const F=Te.exports.useMemo(()=>{let N=!1;Te.exports.Children.forEach(w.children,ee=>{ee&&(N=!0)});const oe={...w,element:N?document.createElement("div"):null},a=new A.Marker(oe).setLngLat([w.longitude,w.latitude]);return a.getElement().addEventListener("click",ee=>{var te,fe;(fe=(te=z.current.props).onClick)===null||fe===void 0||fe.call(te,{type:"click",target:a,originalEvent:ee})}),a.on("dragstart",ee=>{var te,fe;const ue=ee;ue.lngLat=F.getLngLat(),(fe=(te=z.current.props).onDragStart)===null||fe===void 0||fe.call(te,ue)}),a.on("drag",ee=>{var te,fe;const ue=ee;ue.lngLat=F.getLngLat(),(fe=(te=z.current.props).onDrag)===null||fe===void 0||fe.call(te,ue)}),a.on("dragend",ee=>{var te,fe;const ue=ee;ue.lngLat=F.getLngLat(),(fe=(te=z.current.props).onDragEnd)===null||fe===void 0||fe.call(te,ue)}),a},[]);return Te.exports.useEffect(()=>(F.addTo(E.getMap()),()=>{F.remove()}),[]),Te.exports.useEffect(()=>{Ao(F.getElement(),w.style)},[w.style]),(F.getLngLat().lng!==w.longitude||F.getLngLat().lat!==w.latitude)&&F.setLngLat([w.longitude,w.latitude]),w.offset&&!Vf(F.getOffset(),w.offset)&&F.setOffset(w.offset),F.isDraggable()!==w.draggable&&F.setDraggable(w.draggable),F.getRotation()!==w.rotation&&F.setRotation(w.rotation),F.getRotationAlignment()!==w.rotationAlignment&&F.setRotationAlignment(w.rotationAlignment),F.getPitchAlignment()!==w.pitchAlignment&&F.setPitchAlignment(w.pitchAlignment),F.getPopup()!==w.popup&&F.setPopup(w.popup),Wh.exports.createPortal(w.children,F.getElement())}ep.defaultProps=Qf;var $c=Te.exports.memo(ep);function kh(w){return new Set(w?w.trim().split(/\s+/):[])}function em(w){const{map:E,mapLib:A}=Te.exports.useContext(Al),z=Te.exports.useMemo(()=>document.createElement("div"),[]),F=Te.exports.useRef({props:w});F.current.props=w;const N=Te.exports.useMemo(()=>{const oe={...w},a=new A.Popup(oe).setLngLat([w.longitude,w.latitude]);return a.once("open",ee=>{var te,fe;(fe=(te=F.current.props).onOpen)===null||fe===void 0||fe.call(te,ee)}),a},[]);if(Te.exports.useEffect(()=>{const oe=a=>{var ee,te;(te=(ee=F.current.props).onClose)===null||te===void 0||te.call(ee,a)};return N.on("close",oe),N.setDOMContent(z).addTo(E.getMap()),()=>{N.off("close",oe),N.isOpen()&&N.remove()}},[]),Te.exports.useEffect(()=>{Ao(N.getElement(),w.style)},[w.style]),N.isOpen()&&((N.getLngLat().lng!==w.longitude||N.getLngLat().lat!==w.latitude)&&N.setLngLat([w.longitude,w.latitude]),w.offset&&!qn(N.options.offset,w.offset)&&N.setOffset(w.offset),(N.options.anchor!==w.anchor||N.options.maxWidth!==w.maxWidth)&&(N.options.anchor=w.anchor,N.setMaxWidth(w.maxWidth)),N.options.className!==w.className)){const oe=kh(N.options.className),a=kh(w.className);for(const ee of oe)a.has(ee)||N.removeClassName(ee);for(const ee of a)oe.has(ee)||N.addClassName(ee);N.options.className=w.className}return Wh.exports.createPortal(w.children,z)}Te.exports.memo(em);function ua(w,E,A,z){const F=Te.exports.useContext(Al),N=Te.exports.useMemo(()=>w(F),[]);return Te.exports.useEffect(()=>{const oe=z||A||E,a=typeof E=="function"&&typeof A=="function"?E:null,ee=typeof A=="function"?A:typeof E=="function"?E:null,{map:te}=F;return te.hasControl(N)||(te.addControl(N,oe==null?void 0:oe.position),a&&a(F)),()=>{ee&&ee(F),te.hasControl(N)&&te.removeControl(N)}},[]),N}function tm(w){const E=ua(({mapLib:A})=>new A.AttributionControl(w),{position:w.position});return Te.exports.useEffect(()=>{Ao(E._container,w.style)},[w.style]),null}Te.exports.memo(tm);function im(w){const E=ua(({mapLib:A})=>new A.FullscreenControl({container:w.containerId&&document.getElementById(w.containerId)}),{position:w.position});return Te.exports.useEffect(()=>{Ao(E._controlContainer,w.style)},[w.style]),null}Te.exports.memo(im);const tp=Te.exports.forwardRef((w,E)=>{const A=Te.exports.useRef({props:w}),z=ua(({mapLib:F})=>{const N=new F.GeolocateControl(w),oe=N._setupUI;return N._setupUI=a=>{N._container.hasChildNodes()||oe(a)},N.on("geolocate",a=>{var ee,te;(te=(ee=A.current.props).onGeolocate)===null||te===void 0||te.call(ee,a)}),N.on("error",a=>{var ee,te;(te=(ee=A.current.props).onError)===null||te===void 0||te.call(ee,a)}),N.on("outofmaxbounds",a=>{var ee,te;(te=(ee=A.current.props).onOutOfMaxBounds)===null||te===void 0||te.call(ee,a)}),N.on("trackuserlocationstart",a=>{var ee,te;(te=(ee=A.current.props).onTrackUserLocationStart)===null||te===void 0||te.call(ee,a)}),N.on("trackuserlocationend",a=>{var ee,te;(te=(ee=A.current.props).onTrackUserLocationEnd)===null||te===void 0||te.call(ee,a)}),N},{position:w.position});return A.current.props=w,Te.exports.useImperativeHandle(E,()=>({trigger:()=>z.trigger()}),[]),Te.exports.useEffect(()=>{Ao(z._container,w.style)},[w.style]),null});tp.displayName="GeolocateControl";Te.exports.memo(tp);function rm(w){const E=ua(({mapLib:A})=>new A.NavigationControl(w),{position:w.position});return Te.exports.useEffect(()=>{Ao(E._container,w.style)},[w.style]),null}var nm=Te.exports.memo(rm);const om={unit:"metric",maxWidth:100};function ip(w){const E=ua(({mapLib:A})=>new A.ScaleControl(w),{position:w.position});return(E.options.unit!==w.unit||E.options.maxWidth!==w.maxWidth)&&(E.options.maxWidth=w.maxWidth,E.setUnit(w.unit)),Te.exports.useEffect(()=>{Ao(E._container,w.style)},[w.style]),null}ip.defaultProps=om;Te.exports.memo(ip);var rp={exports:{}};(function(w,E){(function(A,z){w.exports=z()})(sa,function(){var A,z,F;function N(a,ee){if(!A)A=ee;else if(!z)z=ee;else{var te="var sharedChunk = {}; ("+A+")(sharedChunk); ("+z+")(sharedChunk);",fe={};A(fe),F=ee(fe),typeof window!="undefined"&&(F.workerUrl=window.URL.createObjectURL(new Blob([te],{type:"text/javascript"})))}}N(["exports"],function(a){var ee=te;function te(i,e,r,o){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=o}function fe(i,e,r,o){const c=new ee(i,e,r,o);return function(h){return c.solve(h)}}te.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,o=0;o<8;o++){var c=this.sampleCurveX(r)-i;if(Math.abs(c)<e)return r;var h=this.sampleCurveDerivativeX(r);if(Math.abs(h)<1e-6)break;r-=c/h}var d=0,m=1;for(r=i,o=0;o<20&&(c=this.sampleCurveX(r),!(Math.abs(c-i)<e));o++)i>c?d=r:m=r,r=.5*(m-d)+d;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};const ue=fe(.25,.1,.25,1);function ie(i,e,r){return Math.min(r,Math.max(e,i))}function qe(i,e,r){const o=r-e,c=((i-e)%o+o)%o+e;return c===e?r:c}function Ue(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}let $e=1;function tt(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Ye(i,e,r){const o={};for(const c in i)o[c]=e.call(r||this,i[c],c,i);return o}function Qe(i,e,r){const o={};for(const c in i)e.call(r||this,i[c],c,i)&&(o[c]=i[c]);return o}function dt(i){return Array.isArray(i)?i.map(dt):typeof i=="object"&&i?Ye(i,dt):i}const gt={};function at(i){gt[i]||(typeof console!="undefined"&&console.warn(i),gt[i]=!0)}function Tt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function Ht(i){let e=0;for(let r,o,c=0,h=i.length,d=h-1;c<h;d=c++)r=i[c],o=i[d],e+=(o.x-r.x)*(r.y+o.y);return e}function Jt(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}function vr(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,o,c,h)=>{const d=c||h;return e[o]=!d||d.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let Wi,ur,Hi=null;function Rt(i){if(Hi==null){const e=i.navigator?i.navigator.userAgent:null;Hi=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Hi}function pi(i){return typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap}const di={now:typeof performance!="undefined"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){const r=window.document.createElement("canvas"),o=r.getContext("2d");if(!o)throw new Error("failed to create canvas 2d context");return r.width=i.width,r.height=i.height,o.drawImage(i,0,0,i.width,i.height),o.getImageData(-e,-e,i.width+2*e,i.height+2*e)},resolveURL:i=>(Wi||(Wi=document.createElement("a")),Wi.href=i,Wi.href),hardwareConcurrency:typeof navigator!="undefined"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(ur==null&&(ur=matchMedia("(prefers-reduced-motion: reduce)")),ur.matches)}};var Xe=Bi;function Bi(i,e){this.x=i,this.y=e}Bi.prototype={clone:function(){return new Bi(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),o=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=o,this},_rotateAround:function(i,e){var r=Math.cos(i),o=Math.sin(i),c=e.y+o*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-o*(this.y-e.y),this.y=c,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Bi.convert=function(i){return i instanceof Bi?i:Array.isArray(i)?new Bi(i[0],i[1]):i};const wi={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},Ci="mapbox-tiles";let Ai,Kr,gn=500,_n=50;function yn(){typeof caches=="undefined"||Ai||(Ai=caches.open(Ci))}let hr=1/0;const Dr={supported:!1,testSupport:function(i){!Mi&&Rr&&(xn?jn(i):Lr=i)}};let Lr,Rr,Mi=!1,xn=!1;function jn(i){const e=i.createTexture();i.bindTexture(i.TEXTURE_2D,e);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,Rr),i.isContextLost())return;Dr.supported=!0}catch{}i.deleteTexture(e),Mi=!0}typeof document!="undefined"&&(Rr=document.createElement("img"),Rr.onload=function(){Lr&&jn(Lr),Lr=null,xn=!0},Rr.onerror=function(){Mi=!0,Lr=null},Rr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const br={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(br);class Fi extends Error{constructor(e,r,o,c){super(`AJAXError: ${r} (${e}): ${o}`),this.status=e,this.statusText=r,this.url=o,this.body=c}}const Xn=Jt()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function Br(i,e){const r=new AbortController,o=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:Xn(),signal:r.signal});let c=!1,h=!1;return i.type==="json"&&o.headers.set("Accept","application/json"),((d,m,g)=>{if(h)return;const x=Date.now();fetch(o).then(T=>T.ok?((I,P,D)=>{(i.type==="arrayBuffer"?I.arrayBuffer():i.type==="json"?I.json():I.text()).then(L=>{h||(P&&D&&function(Z,q,re){if(yn(),!Ai)return;const ce={status:q.status,statusText:q.statusText,headers:new Headers};q.headers.forEach((ae,xe)=>ce.headers.set(xe,ae));const Q=vr(q.headers.get("Cache-Control")||"");Q["no-store"]||(Q["max-age"]&&ce.headers.set("Expires",new Date(re+1e3*Q["max-age"]).toUTCString()),new Date(ce.headers.get("Expires")).getTime()-re<42e4||function(ae,xe){if(Kr===void 0)try{new Response(new ReadableStream),Kr=!0}catch{Kr=!1}Kr?xe(ae.body):ae.blob().then(xe)}(q,ae=>{const xe=new Response(ae,ce);yn(),Ai&&Ai.then(ye=>ye.put(function(Fe){const Ne=Fe.indexOf("?");return Ne<0?Fe:Fe.slice(0,Ne)}(Z.url),xe)).catch(ye=>at(ye.message))}))}(o,P,D),c=!0,e(null,L,I.headers.get("Cache-Control"),I.headers.get("Expires")))}).catch(L=>{h||e(new Error(L.message))})})(T,null,x):T.blob().then(I=>e(new Fi(T.status,T.statusText,i.url,I)))).catch(T=>{T.code!==20&&e(new Error(T.message))})})(),{cancel:()=>{h=!0,c||r.abort()}}}const vn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Jt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Jt()){const o=i.url.substring(0,i.url.indexOf("://"));return(wi.REGISTERED_PROTOCOLS[o]||Br)(i,e)}}if(!(/^file:/.test(r=i.url)||/^file:/.test(Xn())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Br(i,e);if(Jt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(o,c){const h=new XMLHttpRequest;h.open(o.method||"GET",o.url,!0),o.type==="arrayBuffer"&&(h.responseType="arraybuffer");for(const d in o.headers)h.setRequestHeader(d,o.headers[d]);return o.type==="json"&&(h.responseType="text",h.setRequestHeader("Accept","application/json")),h.withCredentials=o.credentials==="include",h.onerror=()=>{c(new Error(h.statusText))},h.onload=()=>{if((h.status>=200&&h.status<300||h.status===0)&&h.response!==null){let d=h.response;if(o.type==="json")try{d=JSON.parse(h.response)}catch(m){return c(m)}c(null,d,h.getResponseHeader("Cache-Control"),h.getResponseHeader("Expires"))}else{const d=new Blob([h.response],{type:h.getResponseHeader("Content-Type")});c(new Fi(h.status,h.statusText,o.url,d))}},h.send(o.body),{cancel:()=>h.abort()}}(i,e)},bn=function(i,e){return vn(Ue(i,{type:"arrayBuffer"}),e)};function Wn(i){const e=window.document.createElement("a");return e.href=i,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}const yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let pr,Fr;pr=[],Fr=0;const Or=function(i,e){if(Dr.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),Fr>=wi.MAX_PARALLEL_IMAGE_REQUESTS){const h={requestParameters:i,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return pr.push(h),h}Fr++;let r=!1;const o=()=>{if(!r)for(r=!0,Fr--;pr.length&&Fr<wi.MAX_PARALLEL_IMAGE_REQUESTS;){const h=pr.shift(),{requestParameters:d,callback:m,cancelled:g}=h;g||(h.cancel=Or(d,m).cancel)}},c=bn(i,(h,d,m,g)=>{o(),h?e(h):d&&function(x,T){typeof createImageBitmap=="function"?function(I,P){const D=new Blob([new Uint8Array(I)],{type:"image/png"});createImageBitmap(D).then(L=>{P(null,L)}).catch(L=>{P(new Error(`Could not load image because of ${L.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(x,T):function(I,P){const D=new Image;D.onload=()=>{P(null,D),URL.revokeObjectURL(D.src),D.onload=null,window.requestAnimationFrame(()=>{D.src=yt})},D.onerror=()=>P(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const L=new Blob([new Uint8Array(I)],{type:"image/png"});D.src=I.byteLength?URL.createObjectURL(L):yt}(x,T)}(d,(x,T)=>{x!=null?e(x):T!=null&&e(null,T,{cacheControl:m,expires:g})})});return{cancel:()=>{c.cancel(),o()}}};function Hn(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function wr(i,e,r){if(r&&r[i]){const o=r[i].indexOf(e);o!==-1&&r[i].splice(o,1)}}class Tr{constructor(e,r={}){Ue(this,r),this.type=e}}class wn extends Tr{constructor(e,r={}){super("error",Ue({error:e},r))}}class Er{on(e,r){return this._listeners=this._listeners||{},Hn(e,r,this._listeners),this}off(e,r){return wr(e,r,this._listeners),wr(e,r,this._oneTimeListeners),this}once(e,r){return this._oneTimeListeners=this._oneTimeListeners||{},Hn(e,r,this._oneTimeListeners),this}fire(e,r){typeof e=="string"&&(e=new Tr(e,r||{}));const o=e.type;if(this.listens(o)){e.target=this;const c=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(const m of c)m.call(this,e);const h=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(const m of h)wr(o,m,this._oneTimeListeners),m.call(this,e);const d=this._eventedParent;d&&(Ue(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof wn&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var _e={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Me{constructor(e,r,o,c){this.message=(e?`${e}: `:"")+o,c&&(this.identifier=c),r!=null&&r.__line__&&(this.line=r.__line__)}}function Jr(i){const e=i.value;return e?[new Me(i.key,e,"constants have been deprecated as of v8")]:[]}function ir(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}function xt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Ki(i){if(Array.isArray(i))return i.map(Ki);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Ki(i[r]);return e}return xt(i)}class Oi extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class $i{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[o,c]of r)this.bindings[o]=c}concat(e){return new $i(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const $r={kind:"null"},Ie={kind:"number"},lt={kind:"string"},ot={kind:"boolean"},fi={kind:"color"},Ur={kind:"object"},rt={kind:"value"},Sr={kind:"collator"},oi={kind:"formatted"},Tn={kind:"padding"},Yt={kind:"resolvedImage"};function Ti(i,e){return{kind:"array",itemType:i,N:e}}function Pt(i){if(i.kind==="array"){const e=Pt(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const En=[$r,Ie,lt,ot,fi,oi,Ur,Ti(rt),Tn,Yt];function dr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!dr(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of En)if(!dr(r,e))return null}}return`Expected ${Pt(i)} but found ${Pt(e)} instead.`}function Yr(i,e){return e.some(r=>r.kind===i.kind)}function Qr(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}var Sn,en={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function O(i){return(i=Math.round(i))<0?0:i>255?255:i}function b(i){return O(i[i.length-1]==="%"?parseFloat(i)/100*255:parseInt(i))}function C(i){return(e=i[i.length-1]==="%"?parseFloat(i)/100:parseFloat(i))<0?0:e>1?1:e;var e}function R(i,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?i+(e-i)*r*6:2*r<1?e:3*r<2?i+(e-i)*(2/3-r)*6:i}try{Sn={}.parseCSSColor=function(i){var e,r=i.replace(/ /g,"").toLowerCase();if(r in en)return en[r].slice();if(r[0]==="#")return r.length===4?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:r.length===7&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var o=r.indexOf("("),c=r.indexOf(")");if(o!==-1&&c+1===r.length){var h=r.substr(0,o),d=r.substr(o+1,c-(o+1)).split(","),m=1;switch(h){case"rgba":if(d.length!==4)return null;m=C(d.pop());case"rgb":return d.length!==3?null:[b(d[0]),b(d[1]),b(d[2]),m];case"hsla":if(d.length!==4)return null;m=C(d.pop());case"hsl":if(d.length!==3)return null;var g=(parseFloat(d[0])%360+360)%360/360,x=C(d[1]),T=C(d[2]),I=T<=.5?T*(x+1):T+x-T*x,P=2*T-I;return[O(255*R(P,I,g+1/3)),O(255*R(P,I,g)),O(255*R(P,I,g-1/3)),m];default:return null}}return null}}catch{}class B{constructor(e,r,o,c=1){this.r=e,this.g=r,this.b=o,this.a=c}static parse(e){if(!e)return;if(e instanceof B)return e;if(typeof e!="string")return;const r=Sn(e);return r?new B(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,r,o,c]=this.toArray();return`rgba(${Math.round(e)},${Math.round(r)},${Math.round(o)},${c})`}toArray(){const{r:e,g:r,b:o,a:c}=this;return c===0?[0,0,0,0]:[255*e/c,255*r/c,255*o/c,c]}}B.black=new B(0,0,0,1),B.white=new B(1,1,1,1),B.transparent=new B(0,0,0,0),B.red=new B(1,0,0,1);class j{constructor(e,r,o){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class K{constructor(e,r,o,c,h){this.text=e,this.image=r,this.scale=o,this.fontStack=c,this.textColor=h}}class W{constructor(e){this.sections=e}static fromString(e){return new W([new K(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof W?e:W.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class X{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof X)return e;if(typeof e=="number")return new X([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new X(e)}}toString(){return JSON.stringify(this.values)}}class J{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new J({name:e,available:!1}):null}}function pe(i,e,r,o){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[i,e,r,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[i,e,r,o]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ve(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof B||i instanceof j||i instanceof W||i instanceof X||i instanceof J)return!0;if(Array.isArray(i)){for(const e of i)if(!ve(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!ve(i[e]))return!1;return!0}return!1}function he(i){if(i===null)return $r;if(typeof i=="string")return lt;if(typeof i=="boolean")return ot;if(typeof i=="number")return Ie;if(i instanceof B)return fi;if(i instanceof j)return Sr;if(i instanceof W)return oi;if(i instanceof X)return Tn;if(i instanceof J)return Yt;if(Array.isArray(i)){const e=i.length;let r;for(const o of i){const c=he(o);if(r){if(r===c)continue;r=rt;break}r=c}return Ti(r||rt,e)}return Ur}function Ve(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof B||i instanceof W||i instanceof X||i instanceof J?i.toString():JSON.stringify(i)}class Ge{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ve(e[1]))return r.error("invalid value");const o=e[1];let c=he(o);const h=r.expectedType;return c.kind!=="array"||c.N!==0||!h||h.kind!=="array"||typeof h.N=="number"&&h.N!==0||(c=h),new Ge(c,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Le{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Ke={string:lt,number:Ie,boolean:ot,object:Ur};class et{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let o,c=1;const h=e[0];if(h==="array"){let m,g;if(e.length>2){const x=e[1];if(typeof x!="string"||!(x in Ke)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=Ke[x],c++}else m=rt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=e[2],c++}o=Ti(m,g)}else{if(!Ke[h])throw new Error(`Types doesn't contain name = ${h}`);o=Ke[h]}const d=[];for(;c<e.length;c++){const m=r.parse(e[c],c,rt);if(!m)return null;d.push(m)}return new et(o,d)}evaluate(e){for(let r=0;r<this.args.length;r++){const o=this.args[r].evaluate(e);if(!dr(this.type,he(o)))return o;if(r===this.args.length-1)throw new Le(`Expected value to be of type ${Pt(this.type)}, but found ${Pt(he(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const vt={"to-boolean":ot,"to-color":fi,"to-number":Ie,"to-string":lt};class it{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[0];if(!vt[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if((o==="to-boolean"||o==="to-string")&&e.length!==2)return r.error("Expected one argument.");const c=vt[o],h=[];for(let d=1;d<e.length;d++){const m=r.parse(e[d],d,rt);if(!m)return null;h.push(m)}return new it(c,h)}evaluate(e){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(e));if(this.type.kind==="color"){let r,o;for(const c of this.args){if(r=c.evaluate(e),o=null,r instanceof B)return r;if(typeof r=="string"){const h=e.parseColor(r);if(h)return h}else if(Array.isArray(r)&&(o=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:pe(r[0],r[1],r[2],r[3]),!o))return new B(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Le(o||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="padding"){let r;for(const o of this.args){r=o.evaluate(e);const c=X.parse(r);if(c)return c}throw new Le(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="number"){let r=null;for(const o of this.args){if(r=o.evaluate(e),r===null)return 0;const c=Number(r);if(!isNaN(c))return c}throw new Le(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?W.fromString(Ve(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?J.fromString(Ve(this.args[0].evaluate(e))):Ve(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ct=["Unknown","Point","LineString","Polygon"];class bt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?ct[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=B.parse(e)),r}}class kt{constructor(e,r,o,c){this.name=e,this.type=r,this._evaluate=o,this.args=c}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const o=e[0],c=kt.definitions[o];if(!c)return r.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const h=Array.isArray(c)?c[0]:c.type,d=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,m=d.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let g=null;for(const[x,T]of m){g=new An(r.registry,r.path,null,r.scope);const I=[];let P=!1;for(let D=1;D<e.length;D++){const L=e[D],Z=Array.isArray(x)?x[D-1]:x.type,q=g.parse(L,1+I.length,Z);if(!q){P=!0;break}I.push(q)}if(!P)if(Array.isArray(x)&&x.length!==I.length)g.error(`Expected ${x.length} arguments, but found ${I.length} instead.`);else{for(let D=0;D<I.length;D++){const L=Array.isArray(x)?x[D]:x.type,Z=I[D];g.concat(D+1).checkSubtype(L,Z.type)}if(g.errors.length===0)return new kt(o,h,T,I)}}if(m.length===1)r.errors.push(...g.errors);else{const x=(m.length?m:d).map(([I])=>{return P=I,Array.isArray(P)?`(${P.map(Pt).join(", ")})`:`(${Pt(P.type)}...)`;var P}).join(" | "),T=[];for(let I=1;I<e.length;I++){const P=r.parse(e[I],1+T.length);if(!P)return null;T.push(Pt(P.type))}r.error(`Expected arguments of type ${x}, but found (${T.join(", ")}) instead.`)}return null}static register(e,r){kt.definitions=r;for(const o in r)e[o]=kt}}class si{constructor(e,r,o){this.type=Sr,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const o=e[1];if(typeof o!="object"||Array.isArray(o))return r.error("Collator options argument must be an object.");const c=r.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,ot);if(!c)return null;const h=r.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,ot);if(!h)return null;let d=null;return o.locale&&(d=r.parse(o.locale,1,lt),!d)?null:new si(c,h,d)}evaluate(e){return new j(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const $t=8192;function _i(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function In(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Kn(i,e){const r=(180+i[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,c=Math.pow(2,e.z);return[Math.round(r*c*$t),Math.round(o*c*$t)]}function Dt(i,e,r){const o=i[0]-e[0],c=i[1]-e[1],h=i[0]-r[0],d=i[1]-r[1];return o*d-h*c==0&&o*h<=0&&c*d<=0}function as(i,e){let r=!1;for(let d=0,m=e.length;d<m;d++){const g=e[d];for(let x=0,T=g.length;x<T-1;x++){if(Dt(i,g[x],g[x+1]))return!1;(c=g[x])[1]>(o=i)[1]!=(h=g[x+1])[1]>o[1]&&o[0]<(h[0]-c[0])*(o[1]-c[1])/(h[1]-c[1])+c[0]&&(r=!r)}}var o,c,h;return r}function ls(i,e){for(let r=0;r<e.length;r++)if(as(i,e[r]))return!0;return!1}function pa(i,e,r,o){const c=o[0]-r[0],h=o[1]-r[1],d=(i[0]-r[0])*h-c*(i[1]-r[1]),m=(e[0]-r[0])*h-c*(e[1]-r[1]);return d>0&&m<0||d<0&&m>0}function da(i,e,r){for(const x of r)for(let T=0;T<x.length-1;++T)if((m=[(d=x[T+1])[0]-(h=x[T])[0],d[1]-h[1]])[0]*(g=[(c=e)[0]-(o=i)[0],c[1]-o[1]])[1]-m[1]*g[0]!=0&&pa(o,c,h,d)&&pa(h,d,o,c))return!0;var o,c,h,d,m,g;return!1}function cs(i,e){for(let r=0;r<i.length;++r)if(!as(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(da(i[r],i[r+1],e))return!1;return!0}function Pl(i,e){for(let r=0;r<e.length;r++)if(cs(i,e[r]))return!0;return!1}function Mo(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=[];for(let d=0;d<i[c].length;d++){const m=Kn(i[c][d],r);_i(e,m),h.push(m)}o.push(h)}return o}function us(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=Mo(i[c],e,r);o.push(h)}return o}function fa(i,e,r,o){if(i[0]<r[0]||i[0]>r[2]){const c=.5*o;let h=i[0]-r[0]>c?-o:r[0]-i[0]>c?o:0;h===0&&(h=i[0]-r[2]>c?-o:r[2]-i[0]>c?o:0),i[0]+=h}_i(e,i)}function ma(i,e,r,o){const c=Math.pow(2,o.z)*$t,h=[o.x*$t,o.y*$t],d=[];for(const m of i)for(const g of m){const x=[g.x+h[0],g.y+h[1]];fa(x,e,r,c),d.push(x)}return d}function ga(i,e,r,o){const c=Math.pow(2,o.z)*$t,h=[o.x*$t,o.y*$t],d=[];for(const g of i){const x=[];for(const T of g){const I=[T.x+h[0],T.y+h[1]];_i(e,I),x.push(I)}d.push(x)}if(e[2]-e[0]<=c/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const g of d)for(const x of g)fa(x,e,r,c)}var m;return d}class tn{constructor(e,r){this.type=ot,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ve(e[1])){const o=e[1];if(o.type==="FeatureCollection")for(let c=0;c<o.features.length;++c){const h=o.features[c].geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new tn(o,o.features[c].geometry)}else if(o.type==="Feature"){const c=o.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new tn(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new tn(o,o)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,o){const c=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(o.type==="Polygon"){const m=Mo(o.coordinates,h,d),g=ma(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!as(x,m))return!1}if(o.type==="MultiPolygon"){const m=us(o.coordinates,h,d),g=ma(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!ls(x,m))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,o){const c=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(o.type==="Polygon"){const m=Mo(o.coordinates,h,d),g=ga(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!cs(x,m))return!1}if(o.type==="MultiPolygon"){const m=us(o.coordinates,h,d),g=ga(r.geometry(),c,h,d);if(!In(c,h))return!1;for(const x of g)if(!Pl(x,m))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function Jn(i){if(i instanceof kt&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof tn)return!1;let e=!0;return i.eachChild(r=>{e&&!Jn(r)&&(e=!1)}),e}function Cn(i){if(i instanceof kt&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!Cn(r)&&(e=!1)}),e}function Po(i,e){if(i instanceof kt&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(o=>{r&&!Po(o,e)&&(r=!1)}),r}class zo{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const o=e[1];return r.scope.has(o)?new zo(o,r.scope.get(o)):r.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class An{constructor(e,r=[],o,c=new $i,h=[]){this.registry=e,this.path=r,this.key=r.map(d=>`[${d}]`).join(""),this.scope=c,this.errors=h,this.expectedType=o}parse(e,r,o,c,h={}){return r?this.concat(r,o,c)._parse(e,h):this._parse(e,h)}_parse(e,r){function o(c,h,d){return d==="assert"?new et(h,[c]):d==="coerce"?new it(h,[c]):c}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const c=e[0];if(typeof c!="string")return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const h=this.registry[c];if(h){let d=h.parse(e,this);if(!d)return null;if(this.expectedType){const m=this.expectedType,g=d.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||g.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(m.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array"){if(this.checkSubtype(m,g))return null}else d=o(d,m,r.typeAnnotation||"coerce");else d=o(d,m,r.typeAnnotation||"coerce");else d=o(d,m,r.typeAnnotation||"assert")}if(!(d instanceof Ge)&&d.type.kind!=="resolvedImage"&&hs(d)){const m=new bt;try{d=new Ge(d.type,d.evaluate(m))}catch(g){return this.error(g.message),null}}return d}return this.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,o){const c=typeof e=="number"?this.path.concat(e):this.path,h=o?this.scope.concat(o):this.scope;return new An(this.registry,c,r||null,h,this.errors)}error(e,...r){const o=`${this.key}${r.map(c=>`[${c}]`).join("")}`;this.errors.push(new Oi(o,e))}checkSubtype(e,r){const o=dr(e,r);return o&&this.error(o),o}}function hs(i){if(i instanceof zo)return hs(i.boundExpression);if(i instanceof kt&&i.name==="error"||i instanceof si||i instanceof tn)return!1;const e=i instanceof it||i instanceof et;let r=!0;return i.eachChild(o=>{r=e?r&&hs(o):r&&o instanceof Ge}),!!r&&Jn(i)&&Po(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ko(i,e){const r=i.length-1;let o,c,h=0,d=r,m=0;for(;h<=d;)if(m=Math.floor((h+d)/2),o=i[m],c=i[m+1],o<=e){if(m===r||e<c)return m;h=m+1}else{if(!(o>e))throw new Le("Input is not a number.");d=m-1}return 0}class Yn{constructor(e,r,o){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[c,h]of o)this.labels.push(c),this.outputs.push(h)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const o=r.parse(e[1],1,Ie);if(!o)return null;const c=[];let h=null;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);for(let d=1;d<e.length;d+=2){const m=d===1?-1/0:e[d],g=e[d+1],x=d,T=d+1;if(typeof m!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(c.length&&c[c.length-1][0]>=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const I=r.parse(g,T,h);if(!I)return null;h=h||I.type,c.push([m,I])}return new Yn(h,o,c)}evaluate(e){const r=this.labels,o=this.outputs;if(r.length===1)return o[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return o[0].evaluate(e);const h=r.length;return c>=r[h-1]?o[h-1].evaluate(e):o[ko(r,c)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ut(i,e,r){return i*(1-r)+e*r}var Qn=Object.freeze({__proto__:null,number:Ut,color:function(i,e,r){return new B(Ut(i.r,e.r,r),Ut(i.g,e.g,r),Ut(i.b,e.b,r),Ut(i.a,e.a,r))},array:function(i,e,r){return i.map((o,c)=>Ut(o,e[c],r))},padding:function(i,e,r){const o=i.values,c=e.values;return new X([Ut(o[0],c[0],r),Ut(o[1],c[1],r),Ut(o[2],c[2],r),Ut(o[3],c[3],r)])}});const _a=.95047,ya=1.08883,ps=4/29,Do=6/29,xa=3*Do*Do,zl=Math.PI/180,kl=180/Math.PI;function ds(i){return i>.008856451679035631?Math.pow(i,1/3):i/xa+ps}function fs(i){return i>Do?i*i*i:xa*(i-ps)}function ms(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function gs(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function St(i){const e=gs(i.r),r=gs(i.g),o=gs(i.b),c=ds((.4124564*e+.3575761*r+.1804375*o)/_a),h=ds((.2126729*e+.7151522*r+.072175*o)/1);return{l:116*h-16,a:500*(c-h),b:200*(h-ds((.0193339*e+.119192*r+.9503041*o)/ya)),alpha:i.a}}function va(i){let e=(i.l+16)/116,r=isNaN(i.a)?e:e+i.a/500,o=isNaN(i.b)?e:e-i.b/200;return e=1*fs(e),r=_a*fs(r),o=ya*fs(o),new B(ms(3.2404542*r-1.5371385*e-.4985314*o),ms(-.969266*r+1.8760108*e+.041556*o),ms(.0556434*r-.2040259*e+1.0572252*o),i.alpha)}function Dl(i,e,r){const o=e-i;return i+r*(o>180||o<-180?o-360*Math.round(o/360):o)}const eo={forward:St,reverse:va,interpolate:function(i,e,r){return{l:Ut(i.l,e.l,r),a:Ut(i.a,e.a,r),b:Ut(i.b,e.b,r),alpha:Ut(i.alpha,e.alpha,r)}}},to={forward:function(i){const{l:e,a:r,b:o}=St(i),c=Math.atan2(o,r)*kl;return{h:c<0?c+360:c,c:Math.sqrt(r*r+o*o),l:e,alpha:i.a}},reverse:function(i){const e=i.h*zl,r=i.c;return va({l:i.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:i.alpha})},interpolate:function(i,e,r){return{h:Dl(i.h,e.h,r),c:Ut(i.c,e.c,r),l:Ut(i.l,e.l,r),alpha:Ut(i.alpha,e.alpha,r)}}};var ba=Object.freeze({__proto__:null,lab:eo,hcl:to});class Ui{constructor(e,r,o,c,h){this.type=e,this.operator=r,this.interpolation=o,this.input=c,this.labels=[],this.outputs=[];for(const[d,m]of h)this.labels.push(d),this.outputs.push(m)}static interpolationFactor(e,r,o,c){let h=0;if(e.name==="exponential")h=_s(r,e.base,o,c);else if(e.name==="linear")h=_s(r,1,o,c);else if(e.name==="cubic-bezier"){const d=e.controlPoints;h=new ee(d[0],d[1],d[2],d[3]).solve(_s(r,1,o,c))}return h}static parse(e,r){let[o,c,h,...d]=e;if(!Array.isArray(c)||c.length===0)return r.error("Expected an interpolation type expression.",1);if(c[0]==="linear")c={name:"linear"};else if(c[0]==="exponential"){const x=c[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);c={name:"exponential",base:x}}else{if(c[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(c[0])}`,1,0);{const x=c.slice(1);if(x.length!==4||x.some(T=>typeof T!="number"||T<0||T>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:x}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(h=r.parse(h,2,Ie),!h)return null;const m=[];let g=null;o==="interpolate-hcl"||o==="interpolate-lab"?g=fi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let x=0;x<d.length;x+=2){const T=d[x],I=d[x+1],P=x+3,D=x+4;if(typeof T!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',P);if(m.length&&m[m.length-1][0]>=T)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',P);const L=r.parse(I,D,g);if(!L)return null;g=g||L.type,m.push([T,L])}return g.kind==="number"||g.kind==="color"||g.kind==="padding"||g.kind==="array"&&g.itemType.kind==="number"&&typeof g.N=="number"?new Ui(g,o,c,h,m):r.error(`Type ${Pt(g)} is not interpolatable.`)}evaluate(e){const r=this.labels,o=this.outputs;if(r.length===1)return o[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return o[0].evaluate(e);const h=r.length;if(c>=r[h-1])return o[h-1].evaluate(e);const d=ko(r,c),m=Ui.interpolationFactor(this.interpolation,c,r[d],r[d+1]),g=o[d].evaluate(e),x=o[d+1].evaluate(e);return this.operator==="interpolate"?Qn[this.type.kind.toLowerCase()](g,x,m):this.operator==="interpolate-hcl"?to.reverse(to.interpolate(to.forward(g),to.forward(x),m)):eo.reverse(eo.interpolate(eo.forward(g),eo.forward(x),m))}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function _s(i,e,r,o){const c=o-r,h=i-r;return c===0?0:e===1?h/c:(Math.pow(e,h)-1)/(Math.pow(e,c)-1)}class Lo{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let o=null;const c=r.expectedType;c&&c.kind!=="value"&&(o=c);const h=[];for(const m of e.slice(1)){const g=r.parse(m,1+h.length,o,void 0,{typeAnnotation:"omit"});if(!g)return null;o=o||g.type,h.push(g)}if(!o)throw new Error("No output type");const d=c&&h.some(m=>dr(c,m.type));return new Lo(d?rt:o,h)}evaluate(e){let r,o=null,c=0;for(const h of this.args)if(c++,o=h.evaluate(e),o&&o instanceof J&&!o.available&&(r||(r=o.name),o=null,c===this.args.length&&(o=r)),o!==null)break;return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ro{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const o=[];for(let h=1;h<e.length-1;h+=2){const d=e[h];if(typeof d!="string")return r.error(`Expected string, but found ${typeof d} instead.`,h);if(/[^a-zA-Z0-9_]/.test(d))return r.error("Variable names must contain only alphanumeric characters or '_'.",h);const m=r.parse(e[h+1],h+1);if(!m)return null;o.push([d,m])}const c=r.parse(e[e.length-1],e.length-1,r.expectedType,o);return c?new Ro(o,c):null}outputDefined(){return this.result.outputDefined()}}class ys{constructor(e,r,o){this.type=e,this.index=r,this.input=o}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,Ie),c=r.parse(e[2],2,Ti(r.expectedType||rt));return o&&c?new ys(c.type.itemType,o,c):null}evaluate(e){const r=this.index.evaluate(e),o=this.input.evaluate(e);if(r<0)throw new Le(`Array index out of bounds: ${r} < 0.`);if(r>=o.length)throw new Le(`Array index out of bounds: ${r} > ${o.length-1}.`);if(r!==Math.floor(r))throw new Le(`Array index must be an integer, but found ${r} instead.`);return o[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class xs{constructor(e,r){this.type=ot,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,rt),c=r.parse(e[2],2,rt);return o&&c?Yr(o.type,[ot,lt,Ie,$r,rt])?new xs(o,c):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(o.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!Qr(r,["boolean","string","number","null"]))throw new Le(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(he(r))} instead.`);if(!Qr(o,["string","array"]))throw new Le(`Expected second argument to be of type array or string, but found ${Pt(he(o))} instead.`);return o.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Bo{constructor(e,r,o){this.type=Ie,this.needle=e,this.haystack=r,this.fromIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,rt),c=r.parse(e[2],2,rt);if(!o||!c)return null;if(!Yr(o.type,[ot,lt,Ie,$r,rt]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Ie);return h?new Bo(o,c,h):null}return new Bo(o,c)}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!Qr(r,["boolean","string","number","null"]))throw new Le(`Expected first argument to be of type boolean, string, number or null, but found ${Pt(he(r))} instead.`);if(!Qr(o,["string","array"]))throw new Le(`Expected second argument to be of type array or string, but found ${Pt(he(o))} instead.`);if(this.fromIndex){const c=this.fromIndex.evaluate(e);return o.indexOf(r,c)}return o.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class vs{constructor(e,r,o,c,h,d){this.inputType=e,this.type=r,this.input=o,this.cases=c,this.outputs=h,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let o,c;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);const h={},d=[];for(let x=2;x<e.length-1;x+=2){let T=e[x];const I=e[x+1];Array.isArray(T)||(T=[T]);const P=r.concat(x);if(T.length===0)return P.error("Expected at least one branch label.");for(const L of T){if(typeof L!="number"&&typeof L!="string")return P.error("Branch labels must be numbers or strings.");if(typeof L=="number"&&Math.abs(L)>Number.MAX_SAFE_INTEGER)return P.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof L=="number"&&Math.floor(L)!==L)return P.error("Numeric branch labels must be integer values.");if(o){if(P.checkSubtype(o,he(L)))return null}else o=he(L);if(h[String(L)]!==void 0)return P.error("Branch labels must be unique.");h[String(L)]=d.length}const D=r.parse(I,x,c);if(!D)return null;c=c||D.type,d.push(D)}const m=r.parse(e[1],1,rt);if(!m)return null;const g=r.parse(e[e.length-1],e.length-1,c);return g?m.type.kind!=="value"&&r.concat(1).checkSubtype(o,m.type)?null:new vs(o,c,m,h,d,g):null}evaluate(e){const r=this.input.evaluate(e);return(he(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class bs{constructor(e,r,o){this.type=e,this.branches=r,this.otherwise=o}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const c=[];for(let d=1;d<e.length-1;d+=2){const m=r.parse(e[d],d,ot);if(!m)return null;const g=r.parse(e[d+1],d+1,o);if(!g)return null;c.push([m,g]),o=o||g.type}const h=r.parse(e[e.length-1],e.length-1,o);if(!h)return null;if(!o)throw new Error("Can't infer output type");return new bs(o,c,h)}evaluate(e){for(const[r,o]of this.branches)if(r.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,o]of this.branches)e(r),e(o);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class Fo{constructor(e,r,o,c){this.type=e,this.input=r,this.beginIndex=o,this.endIndex=c}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,rt),c=r.parse(e[2],2,Ie);if(!o||!c)return null;if(!Yr(o.type,[Ti(rt),lt,rt]))return r.error(`Expected first argument to be of type array or string, but found ${Pt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Ie);return h?new Fo(o.type,o,c,h):null}return new Fo(o.type,o,c)}evaluate(e){const r=this.input.evaluate(e),o=this.beginIndex.evaluate(e);if(!Qr(r,["string","array"]))throw new Le(`Expected first argument to be of type array or string, but found ${Pt(he(r))} instead.`);if(this.endIndex){const c=this.endIndex.evaluate(e);return r.slice(o,c)}return r.slice(o)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function wa(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Ta(i,e,r,o){return o.compare(e,r)===0}function Mn(i,e,r){const o=i!=="=="&&i!=="!=";return class np{constructor(h,d,m){this.type=ot,this.lhs=h,this.rhs=d,this.collator=m,this.hasUntypedArgument=h.type.kind==="value"||d.type.kind==="value"}static parse(h,d){if(h.length!==3&&h.length!==4)return d.error("Expected two or three arguments.");const m=h[0];let g=d.parse(h[1],1,rt);if(!g)return null;if(!wa(m,g.type))return d.concat(1).error(`"${m}" comparisons are not supported for type '${Pt(g.type)}'.`);let x=d.parse(h[2],2,rt);if(!x)return null;if(!wa(m,x.type))return d.concat(2).error(`"${m}" comparisons are not supported for type '${Pt(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${Pt(g.type)}' and '${Pt(x.type)}'.`);o&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new et(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new et(g.type,[x])));let T=null;if(h.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(T=d.parse(h[3],3,Sr),!T)return null}return new np(g,x,T)}evaluate(h){const d=this.lhs.evaluate(h),m=this.rhs.evaluate(h);if(o&&this.hasUntypedArgument){const g=he(d),x=he(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new Le(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${x.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const g=he(d),x=he(m);if(g.kind!=="string"||x.kind!=="string")return e(h,d,m)}return this.collator?r(h,d,m,this.collator.evaluate(h)):e(h,d,m)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}const Ll=Mn("==",function(i,e,r){return e===r},Ta),Rl=Mn("!=",function(i,e,r){return e!==r},function(i,e,r,o){return!Ta(0,e,r,o)}),Bl=Mn("<",function(i,e,r){return e<r},function(i,e,r,o){return o.compare(e,r)<0}),Fl=Mn(">",function(i,e,r){return e>r},function(i,e,r,o){return o.compare(e,r)>0}),Ol=Mn("<=",function(i,e,r){return e<=r},function(i,e,r,o){return o.compare(e,r)<=0}),$l=Mn(">=",function(i,e,r){return e>=r},function(i,e,r,o){return o.compare(e,r)>=0});class ws{constructor(e,r,o,c,h){this.type=lt,this.number=e,this.locale=r,this.currency=o,this.minFractionDigits=c,this.maxFractionDigits=h}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const o=r.parse(e[1],1,Ie);if(!o)return null;const c=e[2];if(typeof c!="object"||Array.isArray(c))return r.error("NumberFormat options argument must be an object.");let h=null;if(c.locale&&(h=r.parse(c.locale,1,lt),!h))return null;let d=null;if(c.currency&&(d=r.parse(c.currency,1,lt),!d))return null;let m=null;if(c["min-fraction-digits"]&&(m=r.parse(c["min-fraction-digits"],1,Ie),!m))return null;let g=null;return c["max-fraction-digits"]&&(g=r.parse(c["max-fraction-digits"],1,Ie),!g)?null:new ws(o,h,d,m,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Oo{constructor(e){this.type=oi,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[1];if(!Array.isArray(o)&&typeof o=="object")return r.error("First argument must be an image or text section.");const c=[];let h=!1;for(let d=1;d<=e.length-1;++d){const m=e[d];if(h&&typeof m=="object"&&!Array.isArray(m)){h=!1;let g=null;if(m["font-scale"]&&(g=r.parse(m["font-scale"],1,Ie),!g))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,Ti(lt)),!x))return null;let T=null;if(m["text-color"]&&(T=r.parse(m["text-color"],1,fi),!T))return null;const I=c[c.length-1];I.scale=g,I.font=x,I.textColor=T}else{const g=r.parse(e[d],1,rt);if(!g)return null;const x=g.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");h=!0,c.push({content:g,scale:null,font:null,textColor:null})}}return new Oo(c)}evaluate(e){return new W(this.sections.map(r=>{const o=r.content.evaluate(e);return he(o)===Yt?new K("",o,null,null,null):new K(Ve(o),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class Ts{constructor(e){this.type=Yt,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const o=r.parse(e[1],1,lt);return o?new Ts(o):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),o=J.fromString(r);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(r)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class Es{constructor(e){this.type=Ie,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=r.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${Pt(o.type)} instead.`):new Es(o):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Le(`Expected value to be of type string or array, but found ${Pt(he(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Pn={"==":Ll,"!=":Rl,">":Fl,"<":Bl,">=":$l,"<=":Ol,array:et,at:ys,boolean:et,case:bs,coalesce:Lo,collator:si,format:Oo,image:Ts,in:xs,"index-of":Bo,interpolate:Ui,"interpolate-hcl":Ui,"interpolate-lab":Ui,length:Es,let:Ro,literal:Ge,match:vs,number:et,"number-format":ws,object:et,slice:Fo,step:Yn,string:et,"to-boolean":it,"to-color":it,"to-number":it,"to-string":it,var:zo,within:tn};function Ea(i,[e,r,o,c]){e=e.evaluate(i),r=r.evaluate(i),o=o.evaluate(i);const h=c?c.evaluate(i):1,d=pe(e,r,o,h);if(d)throw new Le(d);return new B(e/255*h,r/255*h,o/255*h,h)}function Sa(i,e){return i in e}function $o(i,e){const r=e[i];return r===void 0?null:r}function rn(i){return{type:i}}function Ia(i){return{result:"success",value:i}}function zn(i){return{result:"error",value:i}}function Ft(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Ca(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function mt(i){return!!i.expression&&i.expression.interpolated}function It(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Bt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Vt(i){return i}function io(i,e){const r=e.type==="color",o=i.stops&&typeof i.stops[0][0]=="object",c=o||!(o||i.property!==void 0),h=i.type||(mt(e)?"exponential":"interval");if(r||e.type==="padding"){const x=r?B.parse:X.parse;(i=ir({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],x(T[1])])),i.default=x(i.default?i.default:e.default)}if(i.colorSpace&&i.colorSpace!=="rgb"&&!ba[i.colorSpace])throw new Error(`Unknown color space: ${i.colorSpace}`);let d,m,g;if(h==="exponential")d=Aa;else if(h==="interval")d=Vl;else if(h==="categorical"){d=Ul,m=Object.create(null);for(const x of i.stops)m[x[0]]=x[1];g=typeof i.stops[0][0]}else{if(h!=="identity")throw new Error(`Unknown function type "${h}"`);d=Nl}if(o){const x={},T=[];for(let D=0;D<i.stops.length;D++){const L=i.stops[D],Z=L[0].zoom;x[Z]===void 0&&(x[Z]={zoom:Z,type:i.type,property:i.property,default:i.default,stops:[]},T.push(Z)),x[Z].stops.push([L[0].value,L[1]])}const I=[];for(const D of T)I.push([x[D].zoom,io(x[D],e)]);const P={name:"linear"};return{kind:"composite",interpolationType:P,interpolationFactor:Ui.interpolationFactor.bind(void 0,P),zoomStops:I.map(D=>D[0]),evaluate:({zoom:D},L)=>Aa({stops:I,base:i.base},e,D).evaluate(D,L)}}if(c){const x=h==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:x,interpolationFactor:Ui.interpolationFactor.bind(void 0,x),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>d(i,e,T,m,g)}}return{kind:"source",evaluate(x,T){const I=T&&T.properties?T.properties[i.property]:void 0;return I===void 0?kn(i.default,e.default):d(i,e,I,m,g)}}}function kn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Ul(i,e,r,o,c){return kn(typeof r===c?o[r]:void 0,i.default,e.default)}function Vl(i,e,r){if(It(r)!=="number")return kn(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const c=ko(i.stops.map(h=>h[0]),r);return i.stops[c][1]}function Aa(i,e,r){const o=i.base!==void 0?i.base:1;if(It(r)!=="number")return kn(i.default,e.default);const c=i.stops.length;if(c===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[c-1][0])return i.stops[c-1][1];const h=ko(i.stops.map(T=>T[0]),r),d=function(T,I,P,D){const L=D-P,Z=T-P;return L===0?0:I===1?Z/L:(Math.pow(I,Z)-1)/(Math.pow(I,L)-1)}(r,o,i.stops[h][0],i.stops[h+1][0]),m=i.stops[h][1],g=i.stops[h+1][1];let x=Qn[e.type]||Vt;if(i.colorSpace&&i.colorSpace!=="rgb"){const T=ba[i.colorSpace];x=(I,P)=>T.reverse(T.interpolate(T.forward(I),T.forward(P),d))}return typeof m.evaluate=="function"?{evaluate(...T){const I=m.evaluate.apply(void 0,T),P=g.evaluate.apply(void 0,T);if(I!==void 0&&P!==void 0)return x(I,P,d)}}:x(m,g,d)}function Nl(i,e,r){switch(e.type){case"color":r=B.parse(r);break;case"formatted":r=W.fromString(r.toString());break;case"resolvedImage":r=J.fromString(r.toString());break;case"padding":r=X.parse(r);break;default:It(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return kn(r,i.default,e.default)}kt.register(Pn,{error:[{kind:"error"},[lt],(i,[e])=>{throw new Le(e.evaluate(i))}],typeof:[lt,[rt],(i,[e])=>Pt(he(e.evaluate(i)))],"to-rgba":[Ti(Ie,4),[fi],(i,[e])=>e.evaluate(i).toArray()],rgb:[fi,[Ie,Ie,Ie],Ea],rgba:[fi,[Ie,Ie,Ie,Ie],Ea],has:{type:ot,overloads:[[[lt],(i,[e])=>Sa(e.evaluate(i),i.properties())],[[lt,Ur],(i,[e,r])=>Sa(e.evaluate(i),r.evaluate(i))]]},get:{type:rt,overloads:[[[lt],(i,[e])=>$o(e.evaluate(i),i.properties())],[[lt,Ur],(i,[e,r])=>$o(e.evaluate(i),r.evaluate(i))]]},"feature-state":[rt,[lt],(i,[e])=>$o(e.evaluate(i),i.featureState||{})],properties:[Ur,[],i=>i.properties()],"geometry-type":[lt,[],i=>i.geometryType()],id:[rt,[],i=>i.id()],zoom:[Ie,[],i=>i.globals.zoom],"heatmap-density":[Ie,[],i=>i.globals.heatmapDensity||0],"line-progress":[Ie,[],i=>i.globals.lineProgress||0],accumulated:[rt,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Ie,rn(Ie),(i,e)=>{let r=0;for(const o of e)r+=o.evaluate(i);return r}],"*":[Ie,rn(Ie),(i,e)=>{let r=1;for(const o of e)r*=o.evaluate(i);return r}],"-":{type:Ie,overloads:[[[Ie,Ie],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Ie],(i,[e])=>-e.evaluate(i)]]},"/":[Ie,[Ie,Ie],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Ie,[Ie,Ie],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Ie,[],()=>Math.LN2],pi:[Ie,[],()=>Math.PI],e:[Ie,[],()=>Math.E],"^":[Ie,[Ie,Ie],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Ie,[Ie],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Ie,[Ie],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Ie,[Ie],(i,[e])=>Math.log(e.evaluate(i))],log2:[Ie,[Ie],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Ie,[Ie],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Ie,[Ie],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Ie,[Ie],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Ie,[Ie],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Ie,[Ie],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Ie,[Ie],(i,[e])=>Math.atan(e.evaluate(i))],min:[Ie,rn(Ie),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Ie,rn(Ie),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Ie,[Ie],(i,[e])=>Math.abs(e.evaluate(i))],round:[Ie,[Ie],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ie,[Ie],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Ie,[Ie],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[ot,[lt,rt],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[ot,[rt],(i,[e])=>i.id()===e.value],"filter-type-==":[ot,[lt],(i,[e])=>i.geometryType()===e.value],"filter-<":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<c}],"filter-id-<":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<o}],"filter->":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>c}],"filter-id->":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>o}],"filter-<=":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<=c}],"filter-id-<=":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<=o}],"filter->=":[ot,[lt,rt],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>=c}],"filter-id->=":[ot,[rt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>=o}],"filter-has":[ot,[rt],(i,[e])=>e.value in i.properties()],"filter-has-id":[ot,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[ot,[Ti(lt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[ot,[Ti(rt)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[ot,[lt,Ti(rt)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[ot,[lt,Ti(rt)],(i,[e,r])=>function(o,c,h,d){for(;h<=d;){const m=h+d>>1;if(c[m]===o)return!0;c[m]>o?d=m-1:h=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:ot,overloads:[[[ot,ot],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[rn(ot),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:ot,overloads:[[[ot,ot],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[rn(ot),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[ot,[ot],(i,[e])=>!e.evaluate(i)],"is-supported-script":[ot,[lt],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[lt,[lt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[lt,[lt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[lt,rn(rt),(i,e)=>e.map(r=>Ve(r.evaluate(i))).join("")],"resolved-locale":[lt,[Sr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Uo{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new bt,this._defaultValue=r?function(o){return o.type==="color"&&Bt(o.default)?new B(0,0,0,0):o.type==="color"?B.parse(o.default)||null:o.type==="padding"?X.parse(o.default)||null:o.default===void 0?null:o.default}(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,o,c,h,d){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=o,this._evaluator.canonical=c,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,r,o,c,h,d){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=o||null,this._evaluator.canonical=c,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=d||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Le(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console!="undefined"&&console.warn(m.message)),this._defaultValue}}}function ro(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Pn}function no(i,e){const r=new An(Pn,[],e?function(c){const h={color:fi,string:lt,number:Ie,enum:lt,boolean:ot,formatted:oi,padding:Tn,resolvedImage:Yt};return c.type==="array"?Ti(h[c.value]||rt,c.length):h[c.type]}(e):void 0),o=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?Ia(new Uo(o,e)):zn(r.errors)}class oo{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!Cn(r.expression)}evaluateWithoutErrorHandling(e,r,o,c,h,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,d)}evaluate(e,r,o,c,h,d){return this._styleExpression.evaluate(e,r,o,c,h,d)}}class Ss{constructor(e,r,o,c){this.kind=e,this.zoomStops=o,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!Cn(r.expression),this.interpolationType=c}evaluateWithoutErrorHandling(e,r,o,c,h,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,d)}evaluate(e,r,o,c,h,d){return this._styleExpression.evaluate(e,r,o,c,h,d)}interpolationFactor(e,r,o){return this.interpolationType?Ui.interpolationFactor(this.interpolationType,e,r,o):0}}function Ma(i,e){const r=no(i,e);if(r.result==="error")return r;const o=r.value.expression,c=Jn(o);if(!c&&!Ft(e))return zn([new Oi("","data expressions not supported")]);const h=Po(o,["zoom"]);if(!h&&!Ca(e))return zn([new Oi("","zoom expressions not supported")]);const d=No(o);return d||h?d instanceof Oi?zn([d]):d instanceof Ui&&!mt(e)?zn([new Oi("",'"interpolate" expressions cannot be used with this property')]):Ia(d?new Ss(c?"camera":"composite",r.value,d.labels,d instanceof Ui?d.interpolation:void 0):new oo(c?"constant":"source",r.value)):zn([new Oi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Vo{constructor(e,r){this._parameters=e,this._specification=r,ir(this,io(this._parameters,this._specification))}static deserialize(e){return new Vo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function No(i){let e=null;if(i instanceof Ro)e=No(i.result);else if(i instanceof Lo){for(const r of i.args)if(e=No(r),e)break}else(i instanceof Yn||i instanceof Ui)&&i.input instanceof kt&&i.input.name==="zoom"&&(e=i);return e instanceof Oi||i.eachChild(r=>{const o=No(r);o instanceof Oi?e=o:!e&&o?e=new Oi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new Oi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function rr(i){const e=i.key,r=i.value,o=i.valueSpec||{},c=i.objectElementValidators||{},h=i.style,d=i.styleSpec;let m=[];const g=It(r);if(g!=="object")return[new Me(e,r,`object expected, ${g} found`)];for(const x in r){const T=x.split(".")[0],I=o[T]||o["*"];let P;if(c[T])P=c[T];else if(o[T])P=Ni;else if(c["*"])P=c["*"];else{if(!o["*"]){m.push(new Me(e,r[x],`unknown property "${x}"`));continue}P=Ni}m=m.concat(P({key:(e&&`${e}.`)+x,value:r[x],valueSpec:I,style:h,styleSpec:d,object:r,objectKey:x},r))}for(const x in o)c[x]||o[x].required&&o[x].default===void 0&&r[x]===void 0&&m.push(new Me(e,r,`missing required property "${x}"`));return m}function Pa(i){const e=i.value,r=i.valueSpec,o=i.style,c=i.styleSpec,h=i.key,d=i.arrayElementValidator||Ni;if(It(e)!=="array")return[new Me(h,e,`array expected, ${It(e)} found`)];if(r.length&&e.length!==r.length)return[new Me(h,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new Me(h,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let m={type:r.value,values:r.values};c.$version<7&&(m.function=r.function),It(r.value)==="object"&&(m=r.value);let g=[];for(let x=0;x<e.length;x++)g=g.concat(d({array:e,arrayIndex:x,value:e[x],valueSpec:m,style:o,styleSpec:c,key:`${h}[${x}]`}));return g}function Is(i){const e=i.key,r=i.value,o=i.valueSpec;let c=It(r);return c==="number"&&r!=r&&(c="NaN"),c!=="number"?[new Me(e,r,`number expected, ${c} found`)]:"minimum"in o&&r<o.minimum?[new Me(e,r,`${r} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&r>o.maximum?[new Me(e,r,`${r} is greater than the maximum value ${o.maximum}`)]:[]}function za(i){const e=i.valueSpec,r=xt(i.value.type);let o,c,h,d={};const m=r!=="categorical"&&i.value.property===void 0,g=!m,x=It(i.value.stops)==="array"&&It(i.value.stops[0])==="array"&&It(i.value.stops[0][0])==="object",T=rr({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(D){if(r==="identity")return[new Me(D.key,D.value,'identity function may not have a "stops" property')];let L=[];const Z=D.value;return L=L.concat(Pa({key:D.key,value:Z,valueSpec:D.valueSpec,style:D.style,styleSpec:D.styleSpec,arrayElementValidator:I})),It(Z)==="array"&&Z.length===0&&L.push(new Me(D.key,Z,"array must have at least one stop")),L},default:function(D){return Ni({key:D.key,value:D.value,valueSpec:e,style:D.style,styleSpec:D.styleSpec})}}});return r==="identity"&&m&&T.push(new Me(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||T.push(new Me(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!mt(i.valueSpec)&&T.push(new Me(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!Ft(i.valueSpec)?T.push(new Me(i.key,i.value,"property functions not supported")):m&&!Ca(i.valueSpec)&&T.push(new Me(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||T.push(new Me(i.key,i.value,'"property" property is required')),T;function I(D){let L=[];const Z=D.value,q=D.key;if(It(Z)!=="array")return[new Me(q,Z,`array expected, ${It(Z)} found`)];if(Z.length!==2)return[new Me(q,Z,`array length 2 expected, length ${Z.length} found`)];if(x){if(It(Z[0])!=="object")return[new Me(q,Z,`object expected, ${It(Z[0])} found`)];if(Z[0].zoom===void 0)return[new Me(q,Z,"object stop key must have zoom")];if(Z[0].value===void 0)return[new Me(q,Z,"object stop key must have value")];if(h&&h>xt(Z[0].zoom))return[new Me(q,Z[0].zoom,"stop zoom values must appear in ascending order")];xt(Z[0].zoom)!==h&&(h=xt(Z[0].zoom),c=void 0,d={}),L=L.concat(rr({key:`${q}[0]`,value:Z[0],valueSpec:{zoom:{}},style:D.style,styleSpec:D.styleSpec,objectElementValidators:{zoom:Is,value:P}}))}else L=L.concat(P({key:`${q}[0]`,value:Z[0],valueSpec:{},style:D.style,styleSpec:D.styleSpec},Z));return ro(Ki(Z[1]))?L.concat([new Me(`${q}[1]`,Z[1],"expressions are not allowed in function stops.")]):L.concat(Ni({key:`${q}[1]`,value:Z[1],valueSpec:e,style:D.style,styleSpec:D.styleSpec}))}function P(D,L){const Z=It(D.value),q=xt(D.value),re=D.value!==null?D.value:L;if(o){if(Z!==o)return[new Me(D.key,re,`${Z} stop domain type must match previous stop domain type ${o}`)]}else o=Z;if(Z!=="number"&&Z!=="string"&&Z!=="boolean")return[new Me(D.key,re,"stop domain value must be a number, string, or boolean")];if(Z!=="number"&&r!=="categorical"){let ce=`number expected, ${Z} found`;return Ft(e)&&r===void 0&&(ce+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Me(D.key,re,ce)]}return r!=="categorical"||Z!=="number"||isFinite(q)&&Math.floor(q)===q?r!=="categorical"&&Z==="number"&&c!==void 0&&q<c?[new Me(D.key,re,"stop domain values must appear in ascending order")]:(c=q,r==="categorical"&&q in d?[new Me(D.key,re,"stop domain values must be unique")]:(d[q]=!0,[])):[new Me(D.key,re,`integer expected, found ${q}`)]}}function nn(i){const e=(i.expressionContext==="property"?Ma:no)(Ki(i.value),i.valueSpec);if(e.result==="error")return e.value.map(o=>new Me(`${i.key}${o.key}`,i.value,o.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new Me(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Cn(r))return[new Me(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Cn(r))return[new Me(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Po(r,["zoom","feature-state"]))return[new Me(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Jn(r))return[new Me(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function so(i){const e=i.key,r=i.value,o=i.valueSpec,c=[];return Array.isArray(o.values)?o.values.indexOf(xt(r))===-1&&c.push(new Me(e,r,`expected one of [${o.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(o.values).indexOf(xt(r))===-1&&c.push(new Me(e,r,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(r)} found`)),c}function Dn(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Dn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Gl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Go(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Dn(i)||(i=ao(i));const e=no(i,Gl);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,o,c)=>e.value.evaluate(r,o,{},c),needGeometry:Da(i)}}function ka(i,e){return i<e?-1:i>e?1:0}function Da(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Da(i[e]))return!0;return!1}function ao(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?Cs(i[1],i[2],"=="):e==="!="?Ln(Cs(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Cs(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(ao))):e==="all"?["all"].concat(i.slice(1).map(ao)):e==="none"?["all"].concat(i.slice(1).map(ao).map(Ln)):e==="in"?qo(i[1],i.slice(2)):e==="!in"?Ln(qo(i[1],i.slice(2))):e==="has"?lo(i[1]):e==="!has"?Ln(lo(i[1])):e!=="within"||i;var r}function Cs(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function qo(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(ka)]]:["filter-in-small",i,["literal",e]]}}function lo(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ln(i){return["!",i]}function co(i){return Dn(Ki(i.value))?nn(ir({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):La(i)}function La(i){const e=i.value,r=i.key;if(It(e)!=="array")return[new Me(r,e,`array expected, ${It(e)} found`)];const o=i.styleSpec;let c,h=[];if(e.length<1)return[new Me(r,e,"filter array must have at least 1 element")];switch(h=h.concat(so({key:`${r}[0]`,value:e[0],valueSpec:o.filter_operator,style:i.style,styleSpec:i.styleSpec})),xt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&xt(e[1])==="$type"&&h.push(new Me(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&h.push(new Me(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(c=It(e[1]),c!=="string"&&h.push(new Me(`${r}[1]`,e[1],`string expected, ${c} found`)));for(let d=2;d<e.length;d++)c=It(e[d]),xt(e[1])==="$type"?h=h.concat(so({key:`${r}[${d}]`,value:e[d],valueSpec:o.geometry_type,style:i.style,styleSpec:i.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&h.push(new Me(`${r}[${d}]`,e[d],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let d=1;d<e.length;d++)h=h.concat(La({key:`${r}[${d}]`,value:e[d],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":c=It(e[1]),e.length!==2?h.push(new Me(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="string"&&h.push(new Me(`${r}[1]`,e[1],`string expected, ${c} found`));break;case"within":c=It(e[1]),e.length!==2?h.push(new Me(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="object"&&h.push(new Me(`${r}[1]`,e[1],`object expected, ${c} found`))}return h}function uo(i,e){const r=i.key,o=i.style,c=i.styleSpec,h=i.value,d=i.objectKey,m=c[`${e}_${i.layerType}`];if(!m)return[];const g=d.match(/^(.*)-transition$/);if(e==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return Ni({key:r,value:h,valueSpec:c.transition,style:o,styleSpec:c});const x=i.valueSpec||m[d];if(!x)return[new Me(r,h,`unknown property "${d}"`)];let T;if(It(h)==="string"&&Ft(x)&&!x.tokens&&(T=/^{([^}]+)}$/.exec(h)))return[new Me(r,h,`"${d}" does not support interpolation syntax
|
|
2
2
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(T[1])} }\`.`)];const I=[];return i.layerType==="symbol"&&(d==="text-field"&&o&&!o.glyphs&&I.push(new Me(r,h,'use of "text-field" requires a style "glyphs" property')),d==="text-font"&&Bt(Ki(h))&&xt(h.type)==="identity"&&I.push(new Me(r,h,'"text-font" does not support identity functions'))),I.concat(Ni({key:i.key,value:h,valueSpec:x,style:o,styleSpec:c,expressionContext:"property",propertyType:e,propertyKey:d}))}function Ra(i){return uo(i,"paint")}function Ba(i){return uo(i,"layout")}function Fa(i){let e=[];const r=i.value,o=i.key,c=i.style,h=i.styleSpec;r.type||r.ref||e.push(new Me(o,r,'either "type" or "ref" is required'));let d=xt(r.type);const m=xt(r.ref);if(r.id){const g=xt(r.id);for(let x=0;x<i.arrayIndex;x++){const T=c.layers[x];xt(T.id)===g&&e.push(new Me(o,r.id,`duplicate layer id "${r.id}", previously used at line ${T.id.__line__}`))}}if("ref"in r){let g;["type","source","source-layer","filter","layout"].forEach(x=>{x in r&&e.push(new Me(o,r[x],`"${x}" is prohibited for ref layers`))}),c.layers.forEach(x=>{xt(x.id)===m&&(g=x)}),g?g.ref?e.push(new Me(o,r.ref,"ref cannot reference another ref layer")):d=xt(g.type):e.push(new Me(o,r.ref,`ref layer "${m}" not found`))}else if(d!=="background")if(r.source){const g=c.sources&&c.sources[r.source],x=g&&xt(g.type);g?x==="vector"&&d==="raster"?e.push(new Me(o,r.source,`layer "${r.id}" requires a raster source`)):x==="raster"&&d!=="raster"?e.push(new Me(o,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?e.push(new Me(o,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&g.lineMetrics||e.push(new Me(o,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Me(o,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Me(o,r.source,`source "${r.source}" not found`))}else e.push(new Me(o,r,'missing required property "source"'));return e=e.concat(rr({key:o,value:r,valueSpec:h.layer,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Ni({key:`${o}.type`,value:r.type,valueSpec:h.layer.type,style:i.style,styleSpec:i.styleSpec,object:r,objectKey:"type"}),filter:co,layout:g=>rr({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{"*":x=>Ba(ir({layerType:d},x))}}),paint:g=>rr({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{"*":x=>Ra(ir({layerType:d},x))}})}})),e}function Rn(i){const e=i.value,r=i.key,o=It(e);return o!=="string"?[new Me(r,e,`string expected, ${o} found`)]:[]}const Oa={promoteId:function({key:i,value:e}){if(It(e)==="string")return Rn({key:i,value:e});{const r=[];for(const o in e)r.push(...Rn({key:`${i}.${o}`,value:e[o]}));return r}}};function ho(i){const e=i.value,r=i.key,o=i.styleSpec,c=i.style;if(!e.type)return[new Me(r,e,'"type" is required')];const h=xt(e.type);let d;switch(h){case"vector":case"raster":case"raster-dem":return d=rr({key:r,value:e,valueSpec:o[`source_${h.replace("-","_")}`],style:i.style,styleSpec:o,objectElementValidators:Oa}),d;case"geojson":if(d=rr({key:r,value:e,valueSpec:o.source_geojson,style:c,styleSpec:o,objectElementValidators:Oa}),e.cluster)for(const m in e.clusterProperties){const[g,x]=e.clusterProperties[m],T=typeof g=="string"?[g,["accumulated"],["get",m]]:g;d.push(...nn({key:`${r}.${m}.map`,value:x,expressionContext:"cluster-map"})),d.push(...nn({key:`${r}.${m}.reduce`,value:T,expressionContext:"cluster-reduce"}))}return d;case"video":return rr({key:r,value:e,valueSpec:o.source_video,style:c,styleSpec:o});case"image":return rr({key:r,value:e,valueSpec:o.source_image,style:c,styleSpec:o});case"canvas":return[new Me(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return so({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:c,styleSpec:o})}}function po(i){const e=i.value,r=i.styleSpec,o=r.light,c=i.style;let h=[];const d=It(e);if(e===void 0)return h;if(d!=="object")return h=h.concat([new Me("light",e,`object expected, ${d} found`)]),h;for(const m in e){const g=m.match(/^(.*)-transition$/);h=h.concat(g&&o[g[1]]&&o[g[1]].transition?Ni({key:m,value:e[m],valueSpec:r.transition,style:c,styleSpec:r}):o[m]?Ni({key:m,value:e[m],valueSpec:o[m],style:c,styleSpec:r}):[new Me(m,e[m],`unknown property "${m}"`)])}return h}function Vi(i){const e=i.value,r=i.styleSpec,o=r.terrain,c=i.style;let h=[];const d=It(e);if(e===void 0)return h;if(d!=="object")return h=h.concat([new Me("terrain",e,`object expected, ${d} found`)]),h;for(const m in e)h=h.concat(o[m]?Ni({key:m,value:e[m],valueSpec:o[m],style:c,styleSpec:r}):[new Me(m,e[m],`unknown property "${m}"`)]);return h}const fo={"*":()=>[],array:Pa,boolean:function(i){const e=i.value,r=i.key,o=It(e);return o!=="boolean"?[new Me(r,e,`boolean expected, ${o} found`)]:[]},number:Is,color:function(i){const e=i.key,r=i.value,o=It(r);return o!=="string"?[new Me(e,r,`color expected, ${o} found`)]:Sn(r)===null?[new Me(e,r,`color expected, "${r}" found`)]:[]},constants:Jr,enum:so,filter:co,function:za,layer:Fa,object:rr,source:ho,light:po,terrain:Vi,string:Rn,formatted:function(i){return Rn(i).length===0?[]:nn(i)},resolvedImage:function(i){return Rn(i).length===0?[]:nn(i)},padding:function(i){const e=i.key,r=i.value;if(It(r)==="array"){if(r.length<1||r.length>4)return[new Me(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const o={type:"number"};let c=[];for(let h=0;h<r.length;h++)c=c.concat(Ni({key:`${e}[${h}]`,value:r[h],valueSpec:o}));return c}return Is({key:e,value:r,valueSpec:{}})}};function Ni(i){const e=i.value,r=i.valueSpec,o=i.styleSpec;return r.expression&&Bt(xt(e))?za(i):r.expression&&ro(Ki(e))?nn(i):r.type&&fo[r.type]?fo[r.type](i):rr(ir({},i,{valueSpec:r.type?o[r.type]:r}))}function ql(i){const e=i.value,r=i.key,o=Rn(i);return o.length||(e.indexOf("{fontstack}")===-1&&o.push(new Me(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new Me(r,e,'"glyphs" url must include a "{range}" token'))),o}function Vr(i,e=_e){let r=[];return r=r.concat(Ni({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,objectElementValidators:{glyphs:ql,"*":()=>[]}})),i.constants&&(r=r.concat(Jr({key:"constants",value:i.constants,style:i,styleSpec:e}))),$a(r)}function $a(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Ir(i){return function(...e){return $a(i.apply(this,e))}}Vr.source=Ir(ho),Vr.light=Ir(po),Vr.terrain=Ir(Vi),Vr.layer=Ir(Fa),Vr.filter=Ir(co),Vr.paintProperty=Ir(Ra),Vr.layoutProperty=Ir(Ba);const mo=Vr,As=mo.light,Zl=mo.paintProperty,jl=mo.layoutProperty;function Zo(i,e){let r=!1;if(e&&e.length)for(const o of e)i.fire(new wn(new Error(o.message))),r=!0;return r}class go{constructor(e,r,o){const c=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const d=new Int32Array(this.arrayBuffer);e=d[0],this.d=(r=d[1])+2*(o=d[2]);for(let g=0;g<this.d*this.d;g++){const x=d[3+g],T=d[3+g+1];c.push(x===T?null:d.subarray(x,T))}const m=d[3+c.length+1];this.keys=d.subarray(d[3+c.length],m),this.bboxes=d.subarray(m),this.insert=this._insertReadonly}else{this.d=r+2*o;for(let d=0;d<this.d*this.d;d++)c.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=o,this.scale=r/e,this.uid=0;const h=o/r*e;this.min=-h,this.max=e+h}insert(e,r,o,c,h){this._forEachCell(r,o,c,h,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(o),this.bboxes.push(c),this.bboxes.push(h)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,o,c,h,d){this.cells[h].push(d)}query(e,r,o,c,h){const d=this.min,m=this.max;if(e<=d&&r<=d&&m<=o&&m<=c&&!h)return Array.prototype.slice.call(this.keys);{const g=[];return this._forEachCell(e,r,o,c,this._queryCell,g,{},h),g}}_queryCell(e,r,o,c,h,d,m,g){const x=this.cells[h];if(x!==null){const T=this.keys,I=this.bboxes;for(let P=0;P<x.length;P++){const D=x[P];if(m[D]===void 0){const L=4*D;(g?g(I[L+0],I[L+1],I[L+2],I[L+3]):e<=I[L+2]&&r<=I[L+3]&&o>=I[L+0]&&c>=I[L+1])?(m[D]=!0,d.push(T[D])):m[D]=!1}}}}_forEachCell(e,r,o,c,h,d,m,g){const x=this._convertToCellCoord(e),T=this._convertToCellCoord(r),I=this._convertToCellCoord(o),P=this._convertToCellCoord(c);for(let D=x;D<=I;D++)for(let L=T;L<=P;L++){const Z=this.d*L+D;if((!g||g(this._convertFromCellCoord(D),this._convertFromCellCoord(L),this._convertFromCellCoord(D+1),this._convertFromCellCoord(L+1)))&&h.call(this,e,r,o,c,Z,d,m,g))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let o=0;for(let d=0;d<this.cells.length;d++)o+=this.cells[d].length;const c=new Int32Array(r+o+this.keys.length+this.bboxes.length);c[0]=this.extent,c[1]=this.n,c[2]=this.padding;let h=r;for(let d=0;d<e.length;d++){const m=e[d];c[3+d]=h,c.set(m,h),h+=m.length}return c[3+e.length]=h,c.set(this.keys,h),h+=this.keys.length,c[3+e.length+1]=h,c.set(this.bboxes,h),h+=this.bboxes.length,c.buffer}static serialize(e,r){const o=e.toArrayBuffer();return r&&r.push(o),{buffer:o}}static deserialize(e){return new go(e.buffer)}}const Cr={};function Oe(i,e,r={}){if(Cr[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),Cr[i]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}Oe("Object",Object),Oe("TransferableGridIndex",go),Oe("Color",B),Oe("Error",Error),Oe("AJAXError",Fi),Oe("ResolvedImage",J),Oe("StylePropertyFunction",Vo),Oe("StyleExpression",Uo,{omit:["_evaluator"]}),Oe("ZoomDependentExpression",Ss),Oe("ZoomConstantExpression",oo),Oe("CompoundExpression",kt,{omit:["_evaluate"]});for(const i in Pn)Pn[i]._classRegistryKey||Oe(`Expression_${i}`,Pn[i]);function Ua(i){return i&&typeof ArrayBuffer!="undefined"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function on(i,e){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob)return i;if(Ua(i)||pi(i))return e&&e.push(i),i;if(ArrayBuffer.isView(i)){const r=i;return e&&e.push(r.buffer),r}if(i instanceof ImageData)return e&&e.push(i.data.buffer),i;if(Array.isArray(i)){const r=[];for(const o of i)r.push(on(o,e));return r}if(typeof i=="object"){const r=i.constructor,o=r._classRegistryKey;if(!o)throw new Error("can't serialize object of unregistered class");if(!Cr[o])throw new Error(`${o} is not registered.`);const c=r.serialize?r.serialize(i,e):{};if(r.serialize){if(e&&c===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const h in i){if(!i.hasOwnProperty(h)||Cr[o].omit.indexOf(h)>=0)continue;const d=i[h];c[h]=Cr[o].shallow.indexOf(h)>=0?d:on(d,e)}i instanceof Error&&(c.message=i.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return o!=="Object"&&(c.$name=o),c}throw new Error("can't serialize object of type "+typeof i)}function Nr(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Ua(i)||pi(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Nr);if(typeof i=="object"){const e=i.$name||"Object";if(!Cr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Cr[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const o=Object.create(r.prototype);for(const c of Object.keys(i)){if(c==="$name")continue;const h=i[c];o[c]=Cr[e].shallow.indexOf(c)>=0?h:Nr(h)}return o}throw new Error("can't deserialize object of type "+typeof i)}class Ms{constructor(){this.first=!0}update(e,r){const o=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=o,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=o,!0):(this.lastFloorZoom>o?(this.lastIntegerZoom=o+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<o&&(this.lastIntegerZoom=o,this.lastIntegerZoomTime=r),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=o,!0))}}const ze={"Latin-1 Supplement":i=>i>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function jo(i){for(const e of i)if(zs(e.charCodeAt(0)))return!0;return!1}function Xl(i){for(const e of i)if(!Ps(e.charCodeAt(0)))return!1;return!0}function Ps(i){return!(ze.Arabic(i)||ze["Arabic Supplement"](i)||ze["Arabic Extended-A"](i)||ze["Arabic Presentation Forms-A"](i)||ze["Arabic Presentation Forms-B"](i))}function zs(i){return!(i!==746&&i!==747&&(i<4352||!(ze["Bopomofo Extended"](i)||ze.Bopomofo(i)||ze["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||ze["CJK Compatibility Ideographs"](i)||ze["CJK Compatibility"](i)||ze["CJK Radicals Supplement"](i)||ze["CJK Strokes"](i)||!(!ze["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||ze["CJK Unified Ideographs Extension A"](i)||ze["CJK Unified Ideographs"](i)||ze["Enclosed CJK Letters and Months"](i)||ze["Hangul Compatibility Jamo"](i)||ze["Hangul Jamo Extended-A"](i)||ze["Hangul Jamo Extended-B"](i)||ze["Hangul Jamo"](i)||ze["Hangul Syllables"](i)||ze.Hiragana(i)||ze["Ideographic Description Characters"](i)||ze.Kanbun(i)||ze["Kangxi Radicals"](i)||ze["Katakana Phonetic Extensions"](i)||ze.Katakana(i)&&i!==12540||!(!ze["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!ze["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||ze["Unified Canadian Aboriginal Syllabics"](i)||ze["Unified Canadian Aboriginal Syllabics Extended"](i)||ze["Vertical Forms"](i)||ze["Yijing Hexagram Symbols"](i)||ze["Yi Syllables"](i)||ze["Yi Radicals"](i))))}function Va(i){return!(zs(i)||function(e){return!!(ze["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||ze["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||ze["Letterlike Symbols"](e)||ze["Number Forms"](e)||ze["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||ze["Control Pictures"](e)&&e!==9251||ze["Optical Character Recognition"](e)||ze["Enclosed Alphanumerics"](e)||ze["Geometric Shapes"](e)||ze["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ze["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ze["CJK Symbols and Punctuation"](e)||ze.Katakana(e)||ze["Private Use Area"](e)||ze["CJK Compatibility Forms"](e)||ze["Small Form Variants"](e)||ze["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function Na(i){return i>=1424&&i<=2303||ze["Arabic Presentation Forms-A"](i)||ze["Arabic Presentation Forms-B"](i)}function Wl(i,e){return!(!e&&Na(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||ze.Khmer(i))}function Ga(i){for(const e of i)if(Na(e.charCodeAt(0)))return!0;return!1}const ks="deferred",Ds="loading",Ls="loaded";let Rs=null,Pi="unavailable",Gr=null;const qa=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(Pi="error"),Rs&&Rs(i)};function Bn(){Bs.fire(new Tr("pluginStateChange",{pluginStatus:Pi,pluginURL:Gr}))}const Bs=new Er,_o=function(){return Pi},Za=function(){if(Pi!==ks||!Gr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Pi=Ds,Bn(),Gr&&bn({url:Gr},i=>{i?qa(i):(Pi=Ls,Bn())})},Ji={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Pi===Ls||Ji.applyArabicShaping!=null,isLoading:()=>Pi===Ds,setState(i){if(!Jt())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Pi=i.pluginStatus,Gr=i.pluginURL},isParsed(){if(!Jt())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ji.applyArabicShaping!=null&&Ji.processBidirectionalText!=null&&Ji.processStyledBidirectionalText!=null},getPluginURL(){if(!Jt())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Gr}};class Nt{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ms,this.transition={})}isSupportedScript(e){return function(r,o){for(const c of r)if(!Wl(c.charCodeAt(0),o))return!1;return!0}(e,Ji.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),o=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*o}:{fromScale:.5,toScale:1,t:1-(1-o)*r}}}class yo{constructor(e,r){this.property=e,this.value=r,this.expression=function(o,c){if(Bt(o))return new Vo(o,c);if(ro(o)){const h=Ma(o,c);if(h.result==="error")throw new Error(h.value.map(d=>`${d.key}: ${d.message}`).join(", "));return h.value}{let h=o;return c.type==="color"&&typeof o=="string"?h=B.parse(o):c.type!=="padding"||typeof o!="number"&&!Array.isArray(o)||(h=X.parse(o)),{kind:"constant",evaluate:()=>h}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,o){return this.property.possiblyEvaluate(this,e,r,o)}}class Xo{constructor(e){this.property=e,this.value=new yo(e,void 0)}transitioned(e,r){return new Xa(this.property,this.value,r,Ue({},e.transition,this.transition),e.now)}untransitioned(){return new Xa(this.property,this.value,null,{},0)}}class ja{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return dt(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Xo(this._values[e].property)),this._values[e].value=new yo(this._values[e].property,r===null?void 0:dt(r))}getTransition(e){return dt(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Xo(this._values[e].property)),this._values[e].transition=dt(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const o=this.getValue(r);o!==void 0&&(e[r]=o);const c=this.getTransition(r);c!==void 0&&(e[`${r}-transition`]=c)}return e}transitioned(e,r){const o=new Wa(this._properties);for(const c of Object.keys(this._values))o._values[c]=this._values[c].transitioned(e,r._values[c]);return o}untransitioned(){const e=new Wa(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Xa{constructor(e,r,o,c,h){this.property=e,this.value=r,this.begin=h+c.delay||0,this.end=this.begin+c.duration||0,e.specification.transition&&(c.delay||c.duration)&&(this.prior=o)}possiblyEvaluate(e,r,o){const c=e.now||0,h=this.value.possiblyEvaluate(e,r,o),d=this.prior;if(d){if(c>this.end)return this.prior=null,h;if(this.value.isDataDriven())return this.prior=null,h;if(c<this.begin)return d.possiblyEvaluate(e,r,o);{const m=(c-this.begin)/(this.end-this.begin);return this.property.interpolate(d.possiblyEvaluate(e,r,o),h,function(g){if(g<=0)return 0;if(g>=1)return 1;const x=g*g,T=x*g;return 4*(g<.5?T:3*(g-x)+T-.75)}(m))}}return h}}class Wa{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,o){const c=new xo(this._properties);for(const h of Object.keys(this._values))c._values[h]=this._values[h].possiblyEvaluate(e,r,o);return c}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Hl{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return dt(this._values[e].value)}setValue(e,r){this._values[e]=new yo(this._values[e].property,r===null?void 0:dt(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const o=this.getValue(r);o!==void 0&&(e[r]=o)}return e}possiblyEvaluate(e,r,o){const c=new xo(this._properties);for(const h of Object.keys(this._values))c._values[h]=this._values[h].possiblyEvaluate(e,r,o);return c}}class fr{constructor(e,r,o){this.property=e,this.value=r,this.parameters=o}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,o,c){return this.property.evaluate(this.value,this.parameters,e,r,o,c)}}class xo{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ze{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,o){const c=Qn[this.specification.type];return c?c(e,r,o):e}}class Je{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,o,c){return new fr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},o,c)}:e.expression,r)}interpolate(e,r,o){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new fr(this,{kind:"constant",value:void 0},e.parameters);const c=Qn[this.specification.type];return c?new fr(this,{kind:"constant",value:c(e.value.value,r.value.value,o)},e.parameters):e}evaluate(e,r,o,c,h,d){return e.kind==="constant"?e.value:e.evaluate(r,o,c,h,d)}}class Fn extends Je{possiblyEvaluate(e,r,o,c){if(e.value===void 0)return new fr(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const h=e.expression.evaluate(r,null,{},o,c),d=e.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,m=this._calculate(d,d,d,r);return new fr(this,{kind:"constant",value:m},r)}if(e.expression.kind==="camera"){const h=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new fr(this,{kind:"constant",value:h},r)}return new fr(this,e.expression,r)}evaluate(e,r,o,c,h,d){if(e.kind==="source"){const m=e.evaluate(r,o,c,h,d);return this._calculate(m,m,m,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},o,c),e.evaluate({zoom:Math.floor(r.zoom)},o,c),e.evaluate({zoom:Math.floor(r.zoom)+1},o,c),r):e.value}_calculate(e,r,o,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:o,to:r}}interpolate(e){return e}}class Fs{constructor(e){this.specification=e}possiblyEvaluate(e,r,o,c){if(e.value!==void 0){if(e.expression.kind==="constant"){const h=e.expression.evaluate(r,null,{},o,c);return this._calculate(h,h,h,r)}return this._calculate(e.expression.evaluate(new Nt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new Nt(Math.floor(r.zoom),r)),e.expression.evaluate(new Nt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,o,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:o,to:r}}interpolate(e){return e}}class qr{constructor(e){this.specification=e}possiblyEvaluate(e,r,o,c){return!!e.expression.evaluate(r,null,{},o,c)}interpolate(){return!1}}class mi{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const o=e[r];o.specification.overridable&&this.overridableProperties.push(r);const c=this.defaultPropertyValues[r]=new yo(o,void 0),h=this.defaultTransitionablePropertyValues[r]=new Xo(o);this.defaultTransitioningPropertyValues[r]=h.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=c.possiblyEvaluate({})}}}Oe("DataDrivenProperty",Je),Oe("DataConstantProperty",Ze),Oe("CrossFadedDataDrivenProperty",Fn),Oe("CrossFadedProperty",Fs),Oe("ColorRampProperty",qr);const Zr="-transition";class mr extends Er{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Hl(r.layout)),r.paint)){this._transitionablePaint=new ja(r.paint);for(const o in e.paint)this.setPaintProperty(o,e.paint[o],{validate:!1});for(const o in e.layout)this.setLayoutProperty(o,e.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new xo(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,o={}){r!=null&&this._validate(jl,`layers.${this.id}.layout.${e}`,e,r,o)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Zr)?this._transitionablePaint.getTransition(e.slice(0,-Zr.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,o={}){if(r!=null&&this._validate(Zl,`layers.${this.id}.paint.${e}`,e,r,o))return!1;if(e.endsWith(Zr))return this._transitionablePaint.setTransition(e.slice(0,-Zr.length),r||void 0),!1;{const c=this._transitionablePaint._values[e],h=c.property.specification["property-type"]==="cross-faded-data-driven",d=c.value.isDataDriven(),m=c.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const g=this._transitionablePaint._values[e].value;return g.isDataDriven()||d||h||this._handleOverridablePaintPropertyUpdate(e,m,g)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,o){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Qe(e,(r,o)=>!(r===void 0||o==="layout"&&!Object.keys(r).length||o==="paint"&&!Object.keys(r).length))}_validate(e,r,o,c,h={}){return(!h||h.validate!==!1)&&Zo(this,e.call(mo,{key:r,layerType:this.type,objectKey:o,value:c,styleSpec:_e,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof fr&&Ft(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Ha={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class jr{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Xt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Qt(i,e=1){let r=0,o=0;return{members:i.map(c=>{const h=Ha[c.type].BYTES_PER_ELEMENT,d=r=Os(r,Math.max(e,h)),m=c.components||1;return o=Math.max(o,h),r+=h*m,{name:c.name,type:c.type,components:m,offset:d}}),size:Os(r,Math.max(o,e)),alignment:e}}function Os(i,e){return Math.ceil(i/e)*e}class sn extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const c=2*e;return this.int16[c+0]=r,this.int16[c+1]=o,e}}sn.prototype.bytesPerElement=4,Oe("StructArrayLayout2i4",sn);class l extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,o,c)}emplace(e,r,o,c,h){const d=4*e;return this.int16[d+0]=r,this.int16[d+1]=o,this.int16[d+2]=c,this.int16[d+3]=h,e}}l.prototype.bytesPerElement=8,Oe("StructArrayLayout4i8",l);class t extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,o,c,h,d)}emplace(e,r,o,c,h,d,m){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=o,this.int16[g+2]=c,this.int16[g+3]=h,this.int16[g+4]=d,this.int16[g+5]=m,e}}t.prototype.bytesPerElement=12,Oe("StructArrayLayout2i4i12",t);class n extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,o,c,h,d)}emplace(e,r,o,c,h,d,m){const g=4*e,x=8*e;return this.int16[g+0]=r,this.int16[g+1]=o,this.uint8[x+4]=c,this.uint8[x+5]=h,this.uint8[x+6]=d,this.uint8[x+7]=m,e}}n.prototype.bytesPerElement=8,Oe("StructArrayLayout2i4ub8",n);class s extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const c=2*e;return this.float32[c+0]=r,this.float32[c+1]=o,e}}s.prototype.bytesPerElement=8,Oe("StructArrayLayout2f8",s);class u extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d,m,g,x,T){const I=this.length;return this.resize(I+1),this.emplace(I,e,r,o,c,h,d,m,g,x,T)}emplace(e,r,o,c,h,d,m,g,x,T,I){const P=10*e;return this.uint16[P+0]=r,this.uint16[P+1]=o,this.uint16[P+2]=c,this.uint16[P+3]=h,this.uint16[P+4]=d,this.uint16[P+5]=m,this.uint16[P+6]=g,this.uint16[P+7]=x,this.uint16[P+8]=T,this.uint16[P+9]=I,e}}u.prototype.bytesPerElement=20,Oe("StructArrayLayout10ui20",u);class p extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d,m,g,x,T,I,P){const D=this.length;return this.resize(D+1),this.emplace(D,e,r,o,c,h,d,m,g,x,T,I,P)}emplace(e,r,o,c,h,d,m,g,x,T,I,P,D){const L=12*e;return this.int16[L+0]=r,this.int16[L+1]=o,this.int16[L+2]=c,this.int16[L+3]=h,this.uint16[L+4]=d,this.uint16[L+5]=m,this.uint16[L+6]=g,this.uint16[L+7]=x,this.int16[L+8]=T,this.int16[L+9]=I,this.int16[L+10]=P,this.int16[L+11]=D,e}}p.prototype.bytesPerElement=24,Oe("StructArrayLayout4i4ui4i24",p);class f extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o)}emplace(e,r,o,c){const h=3*e;return this.float32[h+0]=r,this.float32[h+1]=o,this.float32[h+2]=c,e}}f.prototype.bytesPerElement=12,Oe("StructArrayLayout3f12",f);class _ extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}_.prototype.bytesPerElement=4,Oe("StructArrayLayout1ul4",_);class y extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d,m,g,x){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,o,c,h,d,m,g,x)}emplace(e,r,o,c,h,d,m,g,x,T){const I=10*e,P=5*e;return this.int16[I+0]=r,this.int16[I+1]=o,this.int16[I+2]=c,this.int16[I+3]=h,this.int16[I+4]=d,this.int16[I+5]=m,this.uint32[P+3]=g,this.uint16[I+8]=x,this.uint16[I+9]=T,e}}y.prototype.bytesPerElement=20,Oe("StructArrayLayout6i1ul2ui20",y);class v extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,o,c,h,d)}emplace(e,r,o,c,h,d,m){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=o,this.int16[g+2]=c,this.int16[g+3]=h,this.int16[g+4]=d,this.int16[g+5]=m,e}}v.prototype.bytesPerElement=12,Oe("StructArrayLayout2i2i2i12",v);class S extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,o,c,h)}emplace(e,r,o,c,h,d){const m=4*e,g=8*e;return this.float32[m+0]=r,this.float32[m+1]=o,this.float32[m+2]=c,this.int16[g+6]=h,this.int16[g+7]=d,e}}S.prototype.bytesPerElement=16,Oe("StructArrayLayout2f1f2i16",S);class M extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,o,c)}emplace(e,r,o,c,h){const d=12*e,m=3*e;return this.uint8[d+0]=r,this.uint8[d+1]=o,this.float32[m+1]=c,this.float32[m+2]=h,e}}M.prototype.bytesPerElement=12,Oe("StructArrayLayout2ub2f12",M);class k extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o)}emplace(e,r,o,c){const h=3*e;return this.uint16[h+0]=r,this.uint16[h+1]=o,this.uint16[h+2]=c,e}}k.prototype.bytesPerElement=6,Oe("StructArrayLayout3ui6",k);class V extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d,m,g,x,T,I,P,D,L,Z,q,re){const ce=this.length;return this.resize(ce+1),this.emplace(ce,e,r,o,c,h,d,m,g,x,T,I,P,D,L,Z,q,re)}emplace(e,r,o,c,h,d,m,g,x,T,I,P,D,L,Z,q,re,ce){const Q=24*e,ae=12*e,xe=48*e;return this.int16[Q+0]=r,this.int16[Q+1]=o,this.uint16[Q+2]=c,this.uint16[Q+3]=h,this.uint32[ae+2]=d,this.uint32[ae+3]=m,this.uint32[ae+4]=g,this.uint16[Q+10]=x,this.uint16[Q+11]=T,this.uint16[Q+12]=I,this.float32[ae+7]=P,this.float32[ae+8]=D,this.uint8[xe+36]=L,this.uint8[xe+37]=Z,this.uint8[xe+38]=q,this.uint32[ae+10]=re,this.int16[Q+22]=ce,e}}V.prototype.bytesPerElement=48,Oe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",V);class $ extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,d,m,g,x,T,I,P,D,L,Z,q,re,ce,Q,ae,xe,ye,Fe,Ne,ke,Ae,Ee,De){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,e,r,o,c,h,d,m,g,x,T,I,P,D,L,Z,q,re,ce,Q,ae,xe,ye,Fe,Ne,ke,Ae,Ee,De)}emplace(e,r,o,c,h,d,m,g,x,T,I,P,D,L,Z,q,re,ce,Q,ae,xe,ye,Fe,Ne,ke,Ae,Ee,De,Pe){const we=34*e,He=17*e;return this.int16[we+0]=r,this.int16[we+1]=o,this.int16[we+2]=c,this.int16[we+3]=h,this.int16[we+4]=d,this.int16[we+5]=m,this.int16[we+6]=g,this.int16[we+7]=x,this.uint16[we+8]=T,this.uint16[we+9]=I,this.uint16[we+10]=P,this.uint16[we+11]=D,this.uint16[we+12]=L,this.uint16[we+13]=Z,this.uint16[we+14]=q,this.uint16[we+15]=re,this.uint16[we+16]=ce,this.uint16[we+17]=Q,this.uint16[we+18]=ae,this.uint16[we+19]=xe,this.uint16[we+20]=ye,this.uint16[we+21]=Fe,this.uint16[we+22]=Ne,this.uint32[He+12]=ke,this.float32[He+13]=Ae,this.float32[He+14]=Ee,this.float32[He+15]=De,this.float32[He+16]=Pe,e}}$.prototype.bytesPerElement=68,Oe("StructArrayLayout8i15ui1ul4f68",$);class U extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}U.prototype.bytesPerElement=4,Oe("StructArrayLayout1f4",U);class H extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o)}emplace(e,r,o,c){const h=3*e;return this.int16[h+0]=r,this.int16[h+1]=o,this.int16[h+2]=c,e}}H.prototype.bytesPerElement=6,Oe("StructArrayLayout3i6",H);class Y extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,o)}emplace(e,r,o,c){const h=4*e;return this.uint32[2*e+0]=r,this.uint16[h+2]=o,this.uint16[h+3]=c,e}}Y.prototype.bytesPerElement=8,Oe("StructArrayLayout1ul2ui8",Y);class ne extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const c=2*e;return this.uint16[c+0]=r,this.uint16[c+1]=o,e}}ne.prototype.bytesPerElement=4,Oe("StructArrayLayout2ui4",ne);class G extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}G.prototype.bytesPerElement=2,Oe("StructArrayLayout1ui2",G);class le extends Xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,o,c)}emplace(e,r,o,c,h){const d=4*e;return this.float32[d+0]=r,this.float32[d+1]=o,this.float32[d+2]=c,this.float32[d+3]=h,e}}le.prototype.bytesPerElement=16,Oe("StructArrayLayout4f16",le);class se extends jr{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Xe(this.anchorPointX,this.anchorPointY)}}se.prototype.size=20;class me extends y{get(e){return new se(this,e)}}Oe("CollisionBoxArray",me);class ge extends jr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ge.prototype.size=48;class be extends V{get(e){return new ge(this,e)}}Oe("PlacedSymbolArray",be);class de extends jr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}de.prototype.size=68;class Re extends ${get(e){return new de(this,e)}}Oe("SymbolInstanceArray",Re);class Ce extends U{getoffsetX(e){return this.float32[1*e+0]}}Oe("GlyphOffsetArray",Ce);class Be extends H{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Oe("SymbolLineVertexArray",Be);class st extends jr{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}st.prototype.size=8;class ut extends Y{get(e){return new st(this,e)}}Oe("FeatureIndexArray",ut);class We extends sn{}class At extends sn{}class Mt extends sn{}class _t extends t{}class wt extends n{}class zt extends s{}class ai extends u{}class gr extends p{}class nr extends f{}class _r extends _{}class Xr extends v{}class Yi extends M{}class zi extends k{}class Ar extends ne{}const Wo=Qt([{name:"a_pos",components:2,type:"Int16"}],4),{members:ii}=Wo;class pt{constructor(e=[]){this.segments=e}prepareSegment(e,r,o,c){let h=this.segments[this.segments.length-1];return e>pt.MAX_VERTEX_ARRAY_LENGTH&&at(`Max vertices per segment is ${pt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!h||h.vertexLength+e>pt.MAX_VERTEX_ARRAY_LENGTH||h.sortKey!==c)&&(h={vertexOffset:r.length,primitiveOffset:o.length,vertexLength:0,primitiveLength:0},c!==void 0&&(h.sortKey=c),this.segments.push(h)),h}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,o,c){return new pt([{vertexOffset:e,primitiveOffset:r,vertexLength:o,primitiveLength:c,vaos:{},sortKey:0}])}}function Ct(i,e){return 256*(i=ie(Math.floor(i),0,255))+ie(Math.floor(e),0,255)}pt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Oe("SegmentVector",pt);const li=Qt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ci={exports:{}},Gt={exports:{}};Gt.exports=function(i,e){var r,o,c,h,d,m,g,x;for(o=i.length-(r=3&i.length),c=e,d=3432918353,m=461845907,x=0;x<o;)g=255&i.charCodeAt(x)|(255&i.charCodeAt(++x))<<8|(255&i.charCodeAt(++x))<<16|(255&i.charCodeAt(++x))<<24,++x,c=27492+(65535&(h=5*(65535&(c=(c^=g=(65535&(g=(g=(65535&g)*d+(((g>>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*m+(((g>>>16)*m&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(g=0,r){case 3:g^=(255&i.charCodeAt(x+2))<<16;case 2:g^=(255&i.charCodeAt(x+1))<<8;case 1:c^=g=(65535&(g=(g=(65535&(g^=255&i.charCodeAt(x)))*d+(((g>>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*m+(((g>>>16)*m&65535)<<16)&4294967295}return c^=i.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0};var Qi={exports:{}};Qi.exports=function(i,e){for(var r,o=i.length,c=e^o,h=0;o>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24))+((1540483477*(r>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),o-=4,++h;switch(o){case 3:c^=(255&i.charCodeAt(h+2))<<16;case 2:c^=(255&i.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&i.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0};var an=Gt.exports,$s=Qi.exports;ci.exports=an,ci.exports.murmur3=an,ci.exports.murmur2=$s;class On{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,o,c){this.ids.push(Ka(e)),this.positions.push(r,o,c)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Ka(e);let o=0,c=this.ids.length-1;for(;o<c;){const d=o+c>>1;this.ids[d]>=r?c=d:o=d+1}const h=[];for(;this.ids[o]===r;)h.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return h}static serialize(e,r){const o=new Float64Array(e.ids),c=new Uint32Array(e.positions);return Us(o,c,0,o.length-1),r&&r.push(o.buffer,c.buffer),{ids:o,positions:c}}static deserialize(e){const r=new On;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Ka(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ci.exports(String(i))}function Us(i,e,r,o){for(;r<o;){const c=i[r+o>>1];let h=r-1,d=o+1;for(;;){do h++;while(i[h]<c);do d--;while(i[d]>c);if(h>=d)break;Wr(i,h,d),Wr(e,3*h,3*d),Wr(e,3*h+1,3*d+1),Wr(e,3*h+2,3*d+2)}d-r<o-d?(Us(i,e,r,d),r=d+1):(Us(i,e,d+1,o),o=d)}}function Wr(i,e,r){const o=i[e];i[e]=i[r],i[r]=o}Oe("FeaturePositionMap",On);class ln{constructor(e,r){this.gl=e.gl,this.location=r}}class cn extends ln{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Ho extends ln{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class ru extends ln{constructor(e,r){super(e,r),this.current=B.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Lp=new Float32Array(16);function Kl(i){return[Ct(255*i.r,255*i.g),Ct(255*i.b,255*i.a)]}class Vs{constructor(e,r,o){this.value=e,this.uniformNames=r.map(c=>`u_${c}`),this.type=o}setUniform(e,r,o){e.set(o.constantOr(this.value))}getBinding(e,r,o){return this.type==="color"?new ru(e,r):new cn(e,r)}}class Ko{constructor(e,r){this.uniformNames=r.map(o=>`u_${o}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,o,c){const h=c==="u_pattern_to"?this.patternTo:c==="u_pattern_from"?this.patternFrom:c==="u_pixel_ratio_to"?this.pixelRatioTo:c==="u_pixel_ratio_from"?this.pixelRatioFrom:null;h&&e.set(h)}getBinding(e,r,o){return o.substr(0,9)==="u_pattern"?new Ho(e,r):new cn(e,r)}}class un{constructor(e,r,o,c){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=r.map(h=>({name:`a_${h}`,type:"Float32",components:o==="color"?2:1,offset:0})),this.paintVertexArray=new c}populatePaintArray(e,r,o,c,h){const d=this.paintVertexArray.length,m=this.expression.evaluate(new Nt(0),r,{},c,[],h);this.paintVertexArray.resize(e),this._setPaintValue(d,e,m)}updatePaintArray(e,r,o,c){const h=this.expression.evaluate({zoom:0},o,c);this._setPaintValue(e,r,h)}_setPaintValue(e,r,o){if(this.type==="color"){const c=Kl(o);for(let h=e;h<r;h++)this.paintVertexArray.emplace(h,c[0],c[1])}else{for(let c=e;c<r;c++)this.paintVertexArray.emplace(c,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Mr{constructor(e,r,o,c,h,d){this.expression=e,this.uniformNames=r.map(m=>`u_${m}_t`),this.type=o,this.useIntegerZoom=c,this.zoom=h,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:o==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(e,r,o,c,h){const d=this.expression.evaluate(new Nt(this.zoom),r,{},c,[],h),m=this.expression.evaluate(new Nt(this.zoom+1),r,{},c,[],h),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,d,m)}updatePaintArray(e,r,o,c){const h=this.expression.evaluate({zoom:this.zoom},o,c),d=this.expression.evaluate({zoom:this.zoom+1},o,c);this._setPaintValue(e,r,h,d)}_setPaintValue(e,r,o,c){if(this.type==="color"){const h=Kl(o),d=Kl(c);for(let m=e;m<r;m++)this.paintVertexArray.emplace(m,h[0],h[1],d[0],d[1])}else{for(let h=e;h<r;h++)this.paintVertexArray.emplace(h,o,c);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(c))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,c=ie(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(c)}getBinding(e,r,o){return new cn(e,r)}}class $n{constructor(e,r,o,c,h,d){this.expression=e,this.type=r,this.useIntegerZoom=o,this.zoom=c,this.layerId=d,this.zoomInPaintVertexArray=new h,this.zoomOutPaintVertexArray=new h}populatePaintArray(e,r,o){const c=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(c,e,r.patterns&&r.patterns[this.layerId],o)}updatePaintArray(e,r,o,c,h){this._setPaintValues(e,r,o.patterns&&o.patterns[this.layerId],h)}_setPaintValues(e,r,o,c){if(!c||!o)return;const{min:h,mid:d,max:m}=o,g=c[h],x=c[d],T=c[m];if(g&&x&&T)for(let I=e;I<r;I++)this.zoomInPaintVertexArray.emplace(I,x.tl[0],x.tl[1],x.br[0],x.br[1],g.tl[0],g.tl[1],g.br[0],g.br[1],x.pixelRatio,g.pixelRatio),this.zoomOutPaintVertexArray.emplace(I,x.tl[0],x.tl[1],x.br[0],x.br[1],T.tl[0],T.tl[1],T.br[0],T.br[1],x.pixelRatio,T.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,li.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,li.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class nu{constructor(e,r,o){this.binders={},this._buffers=[];const c=[];for(const h in e.paint._values){if(!o(h))continue;const d=e.paint.get(h);if(!(d instanceof fr&&Ft(d.property.specification)))continue;const m=Rp(h,e.type),g=d.value,x=d.property.specification.type,T=d.property.useIntegerZoom,I=d.property.specification["property-type"],P=I==="cross-faded"||I==="cross-faded-data-driven";if(g.kind==="constant")this.binders[h]=P?new Ko(g.value,m):new Vs(g.value,m,x),c.push(`/u_${h}`);else if(g.kind==="source"||P){const D=ou(h,x,"source");this.binders[h]=P?new $n(g,x,T,r,D,e.id):new un(g,m,x,D),c.push(`/a_${h}`)}else{const D=ou(h,x,"composite");this.binders[h]=new Mr(g,m,x,T,r,D),c.push(`/z_${h}`)}}this.cacheKey=c.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof un||r instanceof Mr?r.maxValue:0}populatePaintArrays(e,r,o,c,h){for(const d in this.binders){const m=this.binders[d];(m instanceof un||m instanceof Mr||m instanceof $n)&&m.populatePaintArray(e,r,o,c,h)}}setConstantPatternPositions(e,r){for(const o in this.binders){const c=this.binders[o];c instanceof Ko&&c.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,o,c,h){let d=!1;for(const m in e){const g=r.getPositions(m);for(const x of g){const T=o.feature(x.index);for(const I in this.binders){const P=this.binders[I];if((P instanceof un||P instanceof Mr||P instanceof $n)&&P.expression.isStateDependent===!0){const D=c.paint.get(I);P.expression=D.value,P.updatePaintArray(x.start,x.end,T,e[m],h),d=!0}}}}return d}defines(){const e=[];for(const r in this.binders){const o=this.binders[r];(o instanceof Vs||o instanceof Ko)&&e.push(...o.uniformNames.map(c=>`#define HAS_UNIFORM_${c}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const o=this.binders[r];if(o instanceof un||o instanceof Mr)for(let c=0;c<o.paintVertexAttributes.length;c++)e.push(o.paintVertexAttributes[c].name);else if(o instanceof $n)for(let c=0;c<li.members.length;c++)e.push(li.members[c].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const o=this.binders[r];if(o instanceof Vs||o instanceof Ko||o instanceof Mr)for(const c of o.uniformNames)e.push(c)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){const o=[];for(const c in this.binders){const h=this.binders[c];if(h instanceof Vs||h instanceof Ko||h instanceof Mr){for(const d of h.uniformNames)if(r[d]){const m=h.getBinding(e,r[d],d);o.push({name:d,property:c,binding:m})}}}return o}setUniforms(e,r,o,c){for(const{name:h,property:d,binding:m}of r)this.binders[d].setUniform(m,c,o.get(d),h)}updatePaintBuffers(e){this._buffers=[];for(const r in this.binders){const o=this.binders[r];if(e&&o instanceof $n){const c=e.fromScale===2?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;c&&this._buffers.push(c)}else(o instanceof un||o instanceof Mr)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(e){for(const r in this.binders){const o=this.binders[r];(o instanceof un||o instanceof Mr||o instanceof $n)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof un||r instanceof Mr||r instanceof $n)&&r.destroy()}}}class vo{constructor(e,r,o=()=>!0){this.programConfigurations={};for(const c of e)this.programConfigurations[c.id]=new nu(c,r,o);this.needsUpload=!1,this._featureMap=new On,this._bufferOffset=0}populatePaintArrays(e,r,o,c,h,d){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,c,h,d);r.id!==void 0&&this._featureMap.add(r.id,o,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,o,c){for(const h of o)this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,r,h,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Rp(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function ou(i,e,r){const o={color:{source:s,composite:le},number:{source:U,composite:s}},c=function(h){return{"line-pattern":{source:ai,composite:ai},"fill-pattern":{source:ai,composite:ai},"fill-extrusion-pattern":{source:ai,composite:ai}}[h]}(i);return c&&c[r]||o[e][r]}Oe("ConstantBinder",Vs),Oe("CrossFadedConstantBinder",Ko),Oe("SourceExpressionBinder",un),Oe("CrossFadedCompositeBinder",$n),Oe("CompositeExpressionBinder",Mr),Oe("ProgramConfiguration",nu,{omit:["_buffers"]}),Oe("ProgramConfigurationSet",vo);var ri=8192;const Jl=Math.pow(2,14)-1,su=-Jl-1;function bo(i){const e=ri/i.extent,r=i.loadGeometry();for(let o=0;o<r.length;o++){const c=r[o];for(let h=0;h<c.length;h++){const d=c[h],m=Math.round(d.x*e),g=Math.round(d.y*e);d.x=ie(m,su,Jl),d.y=ie(g,su,Jl),(m<d.x||m>d.x+1||g<d.y||g>d.y+1)&&at("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function wo(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?bo(i):[]}}function Ja(i,e,r,o,c){i.emplaceBack(2*e+(o+1)/2,2*r+(c+1)/2)}class Yl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new At,this.indexArray=new zi,this.segments=new pt,this.programConfigurations=new vo(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){const c=this.layers[0],h=[];let d=null,m=!1;c.type==="circle"&&(d=c.layout.get("circle-sort-key"),m=!d.isConstant());for(const{feature:g,id:x,index:T,sourceLayerIndex:I}of e){const P=this.layers[0]._featureFilter.needGeometry,D=wo(g,P);if(!this.layers[0]._featureFilter.filter(new Nt(this.zoom),D,o))continue;const L=m?d.evaluate(D,{},o):void 0,Z={id:x,properties:g.properties,type:g.type,sourceLayerIndex:I,index:T,geometry:P?D.geometry:bo(g),patterns:{},sortKey:L};h.push(Z)}m&&h.sort((g,x)=>g.sortKey-x.sortKey);for(const g of h){const{geometry:x,index:T,sourceLayerIndex:I}=g,P=e[T].feature;this.addFeature(g,x,T,o),r.featureIndex.insert(P,x,T,I,this.index)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ii),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,o,c){for(const h of r)for(const d of h){const m=d.x,g=d.y;if(m<0||m>=ri||g<0||g>=ri)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),T=x.vertexLength;Ja(this.layoutVertexArray,m,g,-1,-1),Ja(this.layoutVertexArray,m,g,1,-1),Ja(this.layoutVertexArray,m,g,1,1),Ja(this.layoutVertexArray,m,g,-1,1),this.indexArray.emplaceBack(T,T+1,T+2),this.indexArray.emplaceBack(T,T+3,T+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{},c)}}function au(i,e){for(let r=0;r<i.length;r++)if(Jo(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Jo(i,e[r]))return!0;return!!Ql(i,e)}function Bp(i,e,r){return!!Jo(i,e)||!!ec(e,i,r)}function lu(i,e){if(i.length===1)return uu(e,i[0]);for(let r=0;r<e.length;r++){const o=e[r];for(let c=0;c<o.length;c++)if(Jo(i,o[c]))return!0}for(let r=0;r<i.length;r++)if(uu(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Ql(i,e[r]))return!0;return!1}function Fp(i,e,r){if(i.length>1){if(Ql(i,e))return!0;for(let o=0;o<e.length;o++)if(ec(e[o],i,r))return!0}for(let o=0;o<i.length;o++)if(ec(i[o],e,r))return!0;return!1}function Ql(i,e){if(i.length===0||e.length===0)return!1;for(let r=0;r<i.length-1;r++){const o=i[r],c=i[r+1];for(let h=0;h<e.length-1;h++)if(Op(o,c,e[h],e[h+1]))return!0}return!1}function Op(i,e,r,o){return Tt(i,r,o)!==Tt(e,r,o)&&Tt(i,e,r)!==Tt(i,e,o)}function ec(i,e,r){const o=r*r;if(e.length===1)return i.distSqr(e[0])<o;for(let c=1;c<e.length;c++)if(cu(i,e[c-1],e[c])<o)return!0;return!1}function cu(i,e,r){const o=e.distSqr(r);if(o===0)return i.distSqr(e);const c=((i.x-e.x)*(r.x-e.x)+(i.y-e.y)*(r.y-e.y))/o;return i.distSqr(c<0?e:c>1?r:r.sub(e)._mult(c)._add(e))}function uu(i,e){let r,o,c,h=!1;for(let d=0;d<i.length;d++){r=i[d];for(let m=0,g=r.length-1;m<r.length;g=m++)o=r[m],c=r[g],o.y>e.y!=c.y>e.y&&e.x<(c.x-o.x)*(e.y-o.y)/(c.y-o.y)+o.x&&(h=!h)}return h}function Jo(i,e){let r=!1;for(let o=0,c=i.length-1;o<i.length;c=o++){const h=i[o],d=i[c];h.y>e.y!=d.y>e.y&&e.x<(d.x-h.x)*(e.y-h.y)/(d.y-h.y)+h.x&&(r=!r)}return r}function $p(i,e,r){const o=r[0],c=r[2];if(i.x<o.x&&e.x<o.x||i.x>c.x&&e.x>c.x||i.y<o.y&&e.y<o.y||i.y>c.y&&e.y>c.y)return!1;const h=Tt(i,e,r[0]);return h!==Tt(i,e,r[1])||h!==Tt(i,e,r[2])||h!==Tt(i,e,r[3])}function Ns(i,e,r){const o=e.paint.get(i).value;return o.kind==="constant"?o.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Ya(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Qa(i,e,r,o,c){if(!e[0]&&!e[1])return i;const h=Xe.convert(e)._mult(c);r==="viewport"&&h._rotate(-o);const d=[];for(let m=0;m<i.length;m++)d.push(i[m].sub(h));return d}Oe("CircleBucket",Yl,{omit:["layers"]});const Up=new mi({"circle-sort-key":new Je(_e.layout_circle["circle-sort-key"])});var Vp={paint:new mi({"circle-radius":new Je(_e.paint_circle["circle-radius"]),"circle-color":new Je(_e.paint_circle["circle-color"]),"circle-blur":new Je(_e.paint_circle["circle-blur"]),"circle-opacity":new Je(_e.paint_circle["circle-opacity"]),"circle-translate":new Ze(_e.paint_circle["circle-translate"]),"circle-translate-anchor":new Ze(_e.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ze(_e.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ze(_e.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Je(_e.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Je(_e.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Je(_e.paint_circle["circle-stroke-opacity"])}),layout:Up},ki=1e-6,Di=typeof Float32Array!="undefined"?Float32Array:Array;function hu(){var i=new Di(9);return Di!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i}function tc(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function pu(i,e,r){var o=e[0],c=e[1],h=e[2],d=e[3],m=e[4],g=e[5],x=e[6],T=e[7],I=e[8],P=e[9],D=e[10],L=e[11],Z=e[12],q=e[13],re=e[14],ce=e[15],Q=r[0],ae=r[1],xe=r[2],ye=r[3];return i[0]=Q*o+ae*m+xe*I+ye*Z,i[1]=Q*c+ae*g+xe*P+ye*q,i[2]=Q*h+ae*x+xe*D+ye*re,i[3]=Q*d+ae*T+xe*L+ye*ce,i[4]=(Q=r[4])*o+(ae=r[5])*m+(xe=r[6])*I+(ye=r[7])*Z,i[5]=Q*c+ae*g+xe*P+ye*q,i[6]=Q*h+ae*x+xe*D+ye*re,i[7]=Q*d+ae*T+xe*L+ye*ce,i[8]=(Q=r[8])*o+(ae=r[9])*m+(xe=r[10])*I+(ye=r[11])*Z,i[9]=Q*c+ae*g+xe*P+ye*q,i[10]=Q*h+ae*x+xe*D+ye*re,i[11]=Q*d+ae*T+xe*L+ye*ce,i[12]=(Q=r[12])*o+(ae=r[13])*m+(xe=r[14])*I+(ye=r[15])*Z,i[13]=Q*c+ae*g+xe*P+ye*q,i[14]=Q*h+ae*x+xe*D+ye*re,i[15]=Q*d+ae*T+xe*L+ye*ce,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var Gs,Np=pu;function du(){var i=new Di(3);return Di!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function fu(i,e,r){var o=new Di(3);return o[0]=i,o[1]=e,o[2]=r,o}function el(i,e,r){var o=e[0],c=e[1],h=e[2],d=e[3];return i[0]=r[0]*o+r[4]*c+r[8]*h+r[12]*d,i[1]=r[1]*o+r[5]*c+r[9]*h+r[13]*d,i[2]=r[2]*o+r[6]*c+r[10]*h+r[14]*d,i[3]=r[3]*o+r[7]*c+r[11]*h+r[15]*d,i}function mu(){var i=new Di(4);return Di!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i[3]=1,i}function gu(i,e){const r=el([],[i.x,i.y,0,1],e);return new Xe(r[0]/r[3],r[1]/r[3])}du(),Gs=new Di(4),Di!=Float32Array&&(Gs[0]=0,Gs[1]=0,Gs[2]=0,Gs[3]=0),du(),fu(1,0,0),fu(0,1,0),mu(),mu(),hu(),function(){var i;i=new Di(2),Di!=Float32Array&&(i[0]=0,i[1]=0)}();class _u extends Yl{}Oe("HeatmapBucket",_u,{omit:["layers"]});var Gp={paint:new mi({"heatmap-radius":new Je(_e.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Je(_e.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ze(_e.paint_heatmap["heatmap-intensity"]),"heatmap-color":new qr(_e.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ze(_e.paint_heatmap["heatmap-opacity"])})};function ic(i,{width:e,height:r},o,c){if(c){if(c instanceof Uint8ClampedArray)c=new Uint8Array(c.buffer);else if(c.length!==e*r*o)throw new RangeError(`mismatched image size. expected: ${c.length} but got: ${e*r*o}`)}else c=new Uint8Array(e*r*o);return i.width=e,i.height=r,i.data=c,i}function yu(i,{width:e,height:r},o){if(e===i.width&&r===i.height)return;const c=ic({},{width:e,height:r},o);rc(i,c,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},o),i.width=e,i.height=r,i.data=c.data}function rc(i,e,r,o,c,h){if(c.width===0||c.height===0)return e;if(c.width>i.width||c.height>i.height||r.x>i.width-c.width||r.y>i.height-c.height)throw new RangeError("out of range source coordinates for image copy");if(c.width>e.width||c.height>e.height||o.x>e.width-c.width||o.y>e.height-c.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,m=e.data;if(d===m)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g<c.height;g++){const x=((r.y+g)*i.width+r.x)*h,T=((o.y+g)*e.width+o.x)*h;for(let I=0;I<c.width*h;I++)m[T+I]=d[x+I]}return e}class qs{constructor(e,r){ic(this,e,1,r)}resize(e){yu(this,e,1)}clone(){return new qs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,c,h){rc(e,r,o,c,h,1)}}class or{constructor(e,r){ic(this,e,4,r)}resize(e){yu(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new or({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,c,h){rc(e,r,o,c,h,4)}}function xu(i){const e={},r=i.resolution||256,o=i.clips?i.clips.length:1,c=i.image||new or({width:r,height:o});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const h=(d,m,g)=>{e[i.evaluationKey]=g;const x=i.expression.evaluate(e);c.data[d+m+0]=Math.floor(255*x.r/x.a),c.data[d+m+1]=Math.floor(255*x.g/x.a),c.data[d+m+2]=Math.floor(255*x.b/x.a),c.data[d+m+3]=Math.floor(255*x.a)};if(i.clips)for(let d=0,m=0;d<o;++d,m+=4*r)for(let g=0,x=0;g<r;g++,x+=4){const T=g/(r-1),{start:I,end:P}=i.clips[d];h(m,x,I*(1-T)+P*T)}else for(let d=0,m=0;d<r;d++,m+=4)h(0,m,d/(r-1));return c}Oe("AlphaImage",qs),Oe("RGBAImage",or);var qp={paint:new mi({"hillshade-illumination-direction":new Ze(_e.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ze(_e.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ze(_e.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ze(_e.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ze(_e.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ze(_e.paint_hillshade["hillshade-accent-color"])})};const Zp=Qt([{name:"a_pos",components:2,type:"Int16"}],4),{members:jp}=Zp;var tl={exports:{}};function il(i,e,r){r=r||2;var o,c,h,d,m,g,x,T=e&&e.length,I=T?e[0]*r:i.length,P=vu(i,0,I,r,!0),D=[];if(!P||P.next===P.prev)return D;if(T&&(P=function(Z,q,re,ce){var Q,ae,xe,ye=[];for(Q=0,ae=q.length;Q<ae;Q++)(xe=vu(Z,q[Q]*ce,Q<ae-1?q[Q+1]*ce:Z.length,ce,!1))===xe.next&&(xe.steiner=!0),ye.push(ed(xe));for(ye.sort(Jp),Q=0;Q<ye.length;Q++)re=Yp(ye[Q],re);return re}(i,e,P,r)),i.length>80*r){o=h=i[0],c=d=i[1];for(var L=r;L<I;L+=r)(m=i[L])<o&&(o=m),(g=i[L+1])<c&&(c=g),m>h&&(h=m),g>d&&(d=g);x=(x=Math.max(h-o,d-c))!==0?32767/x:0}return Zs(P,D,r,o,c,x,0),D}function vu(i,e,r,o,c){var h,d;if(c===sc(i,e,r,o)>0)for(h=e;h<r;h+=o)d=Tu(h,i[h],i[h+1],d);else for(h=r-o;h>=e;h-=o)d=Tu(h,i[h],i[h+1],d);return d&&rl(d,d.next)&&(Xs(d),d=d.next),d}function To(i,e){if(!i)return i;e||(e=i);var r,o=i;do if(r=!1,o.steiner||!rl(o,o.next)&&Kt(o.prev,o,o.next)!==0)o=o.next;else{if(Xs(o),(o=e=o.prev)===o.next)break;r=!0}while(r||o!==e);return e}function Zs(i,e,r,o,c,h,d){if(i){!d&&h&&function(T,I,P,D){var L=T;do L.z===0&&(L.z=nc(L.x,L.y,I,P,D)),L.prevZ=L.prev,L.nextZ=L.next,L=L.next;while(L!==T);L.prevZ.nextZ=null,L.prevZ=null,function(Z){var q,re,ce,Q,ae,xe,ye,Fe,Ne=1;do{for(re=Z,Z=null,ae=null,xe=0;re;){for(xe++,ce=re,ye=0,q=0;q<Ne&&(ye++,ce=ce.nextZ);q++);for(Fe=Ne;ye>0||Fe>0&&ce;)ye!==0&&(Fe===0||!ce||re.z<=ce.z)?(Q=re,re=re.nextZ,ye--):(Q=ce,ce=ce.nextZ,Fe--),ae?ae.nextZ=Q:Z=Q,Q.prevZ=ae,ae=Q;re=ce}ae.nextZ=null,Ne*=2}while(xe>1)}(L)}(i,o,c,h);for(var m,g,x=i;i.prev!==i.next;)if(m=i.prev,g=i.next,h?Wp(i,o,c,h):Xp(i))e.push(m.i/r|0),e.push(i.i/r|0),e.push(g.i/r|0),Xs(i),i=g.next,x=g.next;else if((i=g)===x){d?d===1?Zs(i=Hp(To(i),e,r),e,r,o,c,h,2):d===2&&Kp(i,e,r,o,c,h):Zs(To(i),e,r,o,c,h,1);break}}}function Xp(i){var e=i.prev,r=i,o=i.next;if(Kt(e,r,o)>=0)return!1;for(var c=e.x,h=r.x,d=o.x,m=e.y,g=r.y,x=o.y,T=c<h?c<d?c:d:h<d?h:d,I=m<g?m<x?m:x:g<x?g:x,P=c>h?c>d?c:d:h>d?h:d,D=m>g?m>x?m:x:g>x?g:x,L=o.next;L!==e;){if(L.x>=T&&L.x<=P&&L.y>=I&&L.y<=D&&Yo(c,m,h,g,d,x,L.x,L.y)&&Kt(L.prev,L,L.next)>=0)return!1;L=L.next}return!0}function Wp(i,e,r,o){var c=i.prev,h=i,d=i.next;if(Kt(c,h,d)>=0)return!1;for(var m=c.x,g=h.x,x=d.x,T=c.y,I=h.y,P=d.y,D=m<g?m<x?m:x:g<x?g:x,L=T<I?T<P?T:P:I<P?I:P,Z=m>g?m>x?m:x:g>x?g:x,q=T>I?T>P?T:P:I>P?I:P,re=nc(D,L,e,r,o),ce=nc(Z,q,e,r,o),Q=i.prevZ,ae=i.nextZ;Q&&Q.z>=re&&ae&&ae.z<=ce;){if(Q.x>=D&&Q.x<=Z&&Q.y>=L&&Q.y<=q&&Q!==c&&Q!==d&&Yo(m,T,g,I,x,P,Q.x,Q.y)&&Kt(Q.prev,Q,Q.next)>=0||(Q=Q.prevZ,ae.x>=D&&ae.x<=Z&&ae.y>=L&&ae.y<=q&&ae!==c&&ae!==d&&Yo(m,T,g,I,x,P,ae.x,ae.y)&&Kt(ae.prev,ae,ae.next)>=0))return!1;ae=ae.nextZ}for(;Q&&Q.z>=re;){if(Q.x>=D&&Q.x<=Z&&Q.y>=L&&Q.y<=q&&Q!==c&&Q!==d&&Yo(m,T,g,I,x,P,Q.x,Q.y)&&Kt(Q.prev,Q,Q.next)>=0)return!1;Q=Q.prevZ}for(;ae&&ae.z<=ce;){if(ae.x>=D&&ae.x<=Z&&ae.y>=L&&ae.y<=q&&ae!==c&&ae!==d&&Yo(m,T,g,I,x,P,ae.x,ae.y)&&Kt(ae.prev,ae,ae.next)>=0)return!1;ae=ae.nextZ}return!0}function Hp(i,e,r){var o=i;do{var c=o.prev,h=o.next.next;!rl(c,h)&&bu(c,o,o.next,h)&&js(c,h)&&js(h,c)&&(e.push(c.i/r|0),e.push(o.i/r|0),e.push(h.i/r|0),Xs(o),Xs(o.next),o=i=h),o=o.next}while(o!==i);return To(o)}function Kp(i,e,r,o,c,h){var d=i;do{for(var m=d.next.next;m!==d.prev;){if(d.i!==m.i&&td(d,m)){var g=wu(d,m);return d=To(d,d.next),g=To(g,g.next),Zs(d,e,r,o,c,h,0),void Zs(g,e,r,o,c,h,0)}m=m.next}d=d.next}while(d!==i)}function Jp(i,e){return i.x-e.x}function Yp(i,e){var r=function(c,h){var d,m=h,g=c.x,x=c.y,T=-1/0;do{if(x<=m.y&&x>=m.next.y&&m.next.y!==m.y){var I=m.x+(x-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(I<=g&&I>T&&(T=I,d=m.x<m.next.x?m:m.next,I===g))return d}m=m.next}while(m!==h);if(!d)return null;var P,D=d,L=d.x,Z=d.y,q=1/0;m=d;do g>=m.x&&m.x>=L&&g!==m.x&&Yo(x<Z?g:T,x,L,Z,x<Z?T:g,x,m.x,m.y)&&(P=Math.abs(x-m.y)/(g-m.x),js(m,c)&&(P<q||P===q&&(m.x>d.x||m.x===d.x&&Qp(d,m)))&&(d=m,q=P)),m=m.next;while(m!==D);return d}(i,e);if(!r)return e;var o=wu(r,i);return To(o,o.next),To(r,r.next)}function Qp(i,e){return Kt(i.prev,i,e.prev)<0&&Kt(e.next,i,i.next)<0}function nc(i,e,r,o,c){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*c|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*c|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ed(i){var e=i,r=i;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==i);return r}function Yo(i,e,r,o,c,h,d,m){return(c-d)*(e-m)>=(i-d)*(h-m)&&(i-d)*(o-m)>=(r-d)*(e-m)&&(r-d)*(h-m)>=(c-d)*(o-m)}function td(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,o){var c=r;do{if(c.i!==r.i&&c.next.i!==r.i&&c.i!==o.i&&c.next.i!==o.i&&bu(c,c.next,r,o))return!0;c=c.next}while(c!==r);return!1}(i,e)&&(js(i,e)&&js(e,i)&&function(r,o){var c=r,h=!1,d=(r.x+o.x)/2,m=(r.y+o.y)/2;do c.y>m!=c.next.y>m&&c.next.y!==c.y&&d<(c.next.x-c.x)*(m-c.y)/(c.next.y-c.y)+c.x&&(h=!h),c=c.next;while(c!==r);return h}(i,e)&&(Kt(i.prev,i,e.prev)||Kt(i,e.prev,e))||rl(i,e)&&Kt(i.prev,i,i.next)>0&&Kt(e.prev,e,e.next)>0)}function Kt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function rl(i,e){return i.x===e.x&&i.y===e.y}function bu(i,e,r,o){var c=ol(Kt(i,e,r)),h=ol(Kt(i,e,o)),d=ol(Kt(r,o,i)),m=ol(Kt(r,o,e));return c!==h&&d!==m||!(c!==0||!nl(i,r,e))||!(h!==0||!nl(i,o,e))||!(d!==0||!nl(r,i,o))||!(m!==0||!nl(r,e,o))}function nl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function ol(i){return i>0?1:i<0?-1:0}function js(i,e){return Kt(i.prev,i,i.next)<0?Kt(i,e,i.next)>=0&&Kt(i,i.prev,e)>=0:Kt(i,e,i.prev)<0||Kt(i,i.next,e)<0}function wu(i,e){var r=new oc(i.i,i.x,i.y),o=new oc(e.i,e.x,e.y),c=i.next,h=e.prev;return i.next=e,e.prev=i,r.next=c,c.prev=r,o.next=r,r.prev=o,h.next=o,o.prev=h,o}function Tu(i,e,r,o){var c=new oc(i,e,r);return o?(c.next=o.next,c.prev=o,o.next.prev=c,o.next=c):(c.prev=c,c.next=c),c}function Xs(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function oc(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function sc(i,e,r,o){for(var c=0,h=e,d=r-o;h<r;h+=o)c+=(i[d]-i[h])*(i[h+1]+i[d+1]),d=h;return c}function id(i,e,r,o,c){Eu(i,e,r||0,o||i.length-1,c||rd)}function Eu(i,e,r,o,c){for(;o>r;){if(o-r>600){var h=o-r+1,d=e-r+1,m=Math.log(h),g=.5*Math.exp(2*m/3),x=.5*Math.sqrt(m*g*(h-g)/h)*(d-h/2<0?-1:1);Eu(i,e,Math.max(r,Math.floor(e-d*g/h+x)),Math.min(o,Math.floor(e+(h-d)*g/h+x)),c)}var T=i[e],I=r,P=o;for(Ws(i,r,e),c(i[o],T)>0&&Ws(i,r,o);I<P;){for(Ws(i,I,P),I++,P--;c(i[I],T)<0;)I++;for(;c(i[P],T)>0;)P--}c(i[r],T)===0?Ws(i,r,P):Ws(i,++P,o),P<=e&&(r=P+1),e<=P&&(o=P-1)}}function Ws(i,e,r){var o=i[e];i[e]=i[r],i[r]=o}function rd(i,e){return i<e?-1:i>e?1:0}function ac(i,e){const r=i.length;if(r<=1)return[i];const o=[];let c,h;for(let d=0;d<r;d++){const m=Ht(i[d]);m!==0&&(i[d].area=Math.abs(m),h===void 0&&(h=m<0),h===m<0?(c&&o.push(c),c=[i[d]]):c.push(i[d]))}if(c&&o.push(c),e>1)for(let d=0;d<o.length;d++)o[d].length<=e||(id(o[d],e,1,o[d].length-1,nd),o[d]=o[d].slice(0,e));return o}function nd(i,e){return e.area-i.area}function lc(i,e,r){const o=r.patternDependencies;let c=!1;for(const h of e){const d=h.paint.get(`${i}-pattern`);d.isConstant()||(c=!0);const m=d.constantOr(null);m&&(c=!0,o[m.to]=!0,o[m.from]=!0)}return c}function cc(i,e,r,o,c){const h=c.patternDependencies;for(const d of e){const m=d.paint.get(`${i}-pattern`).value;if(m.kind!=="constant"){let g=m.evaluate({zoom:o-1},r,{},c.availableImages),x=m.evaluate({zoom:o},r,{},c.availableImages),T=m.evaluate({zoom:o+1},r,{},c.availableImages);g=g&&g.name?g.name:g,x=x&&x.name?x.name:x,T=T&&T.name?T.name:T,h[g]=!0,h[x]=!0,h[T]=!0,r.patterns[d.id]={min:g,mid:x,max:T}}}return r}tl.exports=il,tl.exports.default=il,il.deviation=function(i,e,r,o){var c=e&&e.length,h=Math.abs(sc(i,0,c?e[0]*r:i.length,r));if(c)for(var d=0,m=e.length;d<m;d++)h-=Math.abs(sc(i,e[d]*r,d<m-1?e[d+1]*r:i.length,r));var g=0;for(d=0;d<o.length;d+=3){var x=o[d]*r,T=o[d+1]*r,I=o[d+2]*r;g+=Math.abs((i[x]-i[I])*(i[T+1]-i[x+1])-(i[x]-i[T])*(i[I+1]-i[x+1]))}return h===0&&g===0?0:Math.abs((g-h)/h)},il.flatten=function(i){for(var e=i[0][0].length,r={vertices:[],holes:[],dimensions:e},o=0,c=0;c<i.length;c++){for(var h=0;h<i[c].length;h++)for(var d=0;d<e;d++)r.vertices.push(i[c][h][d]);c>0&&r.holes.push(o+=i[c-1].length)}return r};class uc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Mt,this.indexArray=new zi,this.indexArray2=new Ar,this.programConfigurations=new vo(e.layers,e.zoom),this.segments=new pt,this.segments2=new pt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.hasPattern=lc("fill",this.layers,r);const c=this.layers[0].layout.get("fill-sort-key"),h=!c.isConstant(),d=[];for(const{feature:m,id:g,index:x,sourceLayerIndex:T}of e){const I=this.layers[0]._featureFilter.needGeometry,P=wo(m,I);if(!this.layers[0]._featureFilter.filter(new Nt(this.zoom),P,o))continue;const D=h?c.evaluate(P,{},o,r.availableImages):void 0,L={id:g,properties:m.properties,type:m.type,sourceLayerIndex:T,index:x,geometry:I?P.geometry:bo(m),patterns:{},sortKey:D};d.push(L)}h&&d.sort((m,g)=>m.sortKey-g.sortKey);for(const m of d){const{geometry:g,index:x,sourceLayerIndex:T}=m;if(this.hasPattern){const I=cc("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(I)}else this.addFeature(m,g,x,o,{});r.featureIndex.insert(e[x].feature,g,x,T,this.index)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}addFeatures(e,r,o){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,r,o)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,jp),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,o,c,h){for(const d of ac(r,500)){let m=0;for(const D of d)m+=D.length;const g=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=g.vertexLength,T=[],I=[];for(const D of d){if(D.length===0)continue;D!==d[0]&&I.push(T.length/2);const L=this.segments2.prepareSegment(D.length,this.layoutVertexArray,this.indexArray2),Z=L.vertexLength;this.layoutVertexArray.emplaceBack(D[0].x,D[0].y),this.indexArray2.emplaceBack(Z+D.length-1,Z),T.push(D[0].x),T.push(D[0].y);for(let q=1;q<D.length;q++)this.layoutVertexArray.emplaceBack(D[q].x,D[q].y),this.indexArray2.emplaceBack(Z+q-1,Z+q),T.push(D[q].x),T.push(D[q].y);L.vertexLength+=D.length,L.primitiveLength+=D.length}const P=tl.exports(T,I);for(let D=0;D<P.length;D+=3)this.indexArray.emplaceBack(x+P[D],x+P[D+1],x+P[D+2]);g.vertexLength+=m,g.primitiveLength+=P.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,c)}}Oe("FillBucket",uc,{omit:["layers","patternFeatures"]});const od=new mi({"fill-sort-key":new Je(_e.layout_fill["fill-sort-key"])});var sd={paint:new mi({"fill-antialias":new Ze(_e.paint_fill["fill-antialias"]),"fill-opacity":new Je(_e.paint_fill["fill-opacity"]),"fill-color":new Je(_e.paint_fill["fill-color"]),"fill-outline-color":new Je(_e.paint_fill["fill-outline-color"]),"fill-translate":new Ze(_e.paint_fill["fill-translate"]),"fill-translate-anchor":new Ze(_e.paint_fill["fill-translate-anchor"]),"fill-pattern":new Fn(_e.paint_fill["fill-pattern"])}),layout:od};const ad=Qt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),ld=Qt([{name:"a_centroid",components:2,type:"Int16"}],4),{members:cd}=ad;var Un={},ud=Xe,Su=Qo;function Qo(i,e,r,o,c){this.properties={},this.extent=r,this.type=0,this._pbf=i,this._geometry=-1,this._keys=o,this._values=c,i.readFields(hd,this,e)}function hd(i,e,r){i==1?e.id=r.readVarint():i==2?function(o,c){for(var h=o.readVarint()+o.pos;o.pos<h;){var d=c._keys[o.readVarint()],m=c._values[o.readVarint()];c.properties[d]=m}}(r,e):i==3?e.type=r.readVarint():i==4&&(e._geometry=r.pos)}function pd(i){for(var e,r,o=0,c=0,h=i.length,d=h-1;c<h;d=c++)o+=((r=i[d]).x-(e=i[c]).x)*(e.y+r.y);return o}Qo.types=["Unknown","Point","LineString","Polygon"],Qo.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var e,r=i.readVarint()+i.pos,o=1,c=0,h=0,d=0,m=[];i.pos<r;){if(c<=0){var g=i.readVarint();o=7&g,c=g>>3}if(c--,o===1||o===2)h+=i.readSVarint(),d+=i.readSVarint(),o===1&&(e&&m.push(e),e=[]),e.push(new ud(h,d));else{if(o!==7)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}}return e&&m.push(e),m},Qo.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,o=0,c=0,h=0,d=1/0,m=-1/0,g=1/0,x=-1/0;i.pos<e;){if(o<=0){var T=i.readVarint();r=7&T,o=T>>3}if(o--,r===1||r===2)(c+=i.readSVarint())<d&&(d=c),c>m&&(m=c),(h+=i.readSVarint())<g&&(g=h),h>x&&(x=h);else if(r!==7)throw new Error("unknown command "+r)}return[d,g,m,x]},Qo.prototype.toGeoJSON=function(i,e,r){var o,c,h=this.extent*Math.pow(2,r),d=this.extent*i,m=this.extent*e,g=this.loadGeometry(),x=Qo.types[this.type];function T(D){for(var L=0;L<D.length;L++){var Z=D[L];D[L]=[360*(Z.x+d)/h-180,360/Math.PI*Math.atan(Math.exp((180-360*(Z.y+m)/h)*Math.PI/180))-90]}}switch(this.type){case 1:var I=[];for(o=0;o<g.length;o++)I[o]=g[o][0];T(g=I);break;case 2:for(o=0;o<g.length;o++)T(g[o]);break;case 3:for(g=function(D){var L=D.length;if(L<=1)return[D];for(var Z,q,re=[],ce=0;ce<L;ce++){var Q=pd(D[ce]);Q!==0&&(q===void 0&&(q=Q<0),q===Q<0?(Z&&re.push(Z),Z=[D[ce]]):Z.push(D[ce]))}return Z&&re.push(Z),re}(g),o=0;o<g.length;o++)for(c=0;c<g[o].length;c++)T(g[o][c])}g.length===1?g=g[0]:x="Multi"+x;var P={type:"Feature",geometry:{type:x,coordinates:g},properties:this.properties};return"id"in this&&(P.id=this.id),P};var dd=Su,Iu=Cu;function Cu(i,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(fd,this,e),this.length=this._features.length}function fd(i,e,r){i===15?e.version=r.readVarint():i===1?e.name=r.readString():i===5?e.extent=r.readVarint():i===2?e._features.push(r.pos):i===3?e._keys.push(r.readString()):i===4&&e._values.push(function(o){for(var c=null,h=o.readVarint()+o.pos;o.pos<h;){var d=o.readVarint()>>3;c=d===1?o.readString():d===2?o.readFloat():d===3?o.readDouble():d===4?o.readVarint64():d===5?o.readVarint():d===6?o.readSVarint():d===7?o.readBoolean():null}return c}(r))}Cu.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new dd(this._pbf,e,this.extent,this._keys,this._values)};var md=Iu;function gd(i,e,r){if(i===3){var o=new md(r,r.readVarint()+r.pos);o.length&&(e[o.name]=o)}}Un.VectorTile=function(i,e){this.layers=i.readFields(gd,{},e)},Un.VectorTileFeature=Su,Un.VectorTileLayer=Iu;const _d=Un.VectorTileFeature.types,hc=Math.pow(2,13);function Hs(i,e,r,o,c,h,d,m){i.emplaceBack(e,r,2*Math.floor(o*hc)+d,c*hc*2,h*hc*2,Math.round(m))}class pc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new _t,this.centroidVertexArray=new We,this.indexArray=new zi,this.programConfigurations=new vo(e.layers,e.zoom),this.segments=new pt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.features=[],this.hasPattern=lc("fill-extrusion",this.layers,r);for(const{feature:c,id:h,index:d,sourceLayerIndex:m}of e){const g=this.layers[0]._featureFilter.needGeometry,x=wo(c,g);if(!this.layers[0]._featureFilter.filter(new Nt(this.zoom),x,o))continue;const T={id:h,sourceLayerIndex:m,index:d,geometry:g?x.geometry:bo(c),properties:c.properties,type:c.type,patterns:{}};this.hasPattern?this.features.push(cc("fill-extrusion",this.layers,T,this.zoom,r)):this.addFeature(T,T.geometry,d,o,{}),r.featureIndex.insert(c,T.geometry,d,m,this.index,!0)}}addFeatures(e,r,o){for(const c of this.features){const{geometry:h}=c;this.addFeature(c,h,c.index,r,o)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cd),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,ld.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,o,c,h){const d={x:0,y:0,vertexCount:0};for(const m of ac(r,500)){let g=0;for(const L of m)g+=L.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const L of m){if(L.length===0||xd(L))continue;let Z=0;for(let q=0;q<L.length;q++){const re=L[q];if(q>=1){const ce=L[q-1];if(!yd(re,ce)){x.vertexLength+4>pt.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Q=re.sub(ce)._perp()._unit(),ae=ce.dist(re);Z+ae>32768&&(Z=0),Hs(this.layoutVertexArray,re.x,re.y,Q.x,Q.y,0,0,Z),Hs(this.layoutVertexArray,re.x,re.y,Q.x,Q.y,0,1,Z),d.x+=2*re.x,d.y+=2*re.y,d.vertexCount+=2,Z+=ae,Hs(this.layoutVertexArray,ce.x,ce.y,Q.x,Q.y,0,0,Z),Hs(this.layoutVertexArray,ce.x,ce.y,Q.x,Q.y,0,1,Z),d.x+=2*ce.x,d.y+=2*ce.y,d.vertexCount+=2;const xe=x.vertexLength;this.indexArray.emplaceBack(xe,xe+2,xe+1),this.indexArray.emplaceBack(xe+1,xe+2,xe+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+g>pt.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),_d[e.type]!=="Polygon")continue;const T=[],I=[],P=x.vertexLength;for(const L of m)if(L.length!==0){L!==m[0]&&I.push(T.length/2);for(let Z=0;Z<L.length;Z++){const q=L[Z];Hs(this.layoutVertexArray,q.x,q.y,0,0,1,1,0),d.x+=q.x,d.y+=q.y,d.vertexCount+=1,T.push(q.x),T.push(q.y)}}const D=tl.exports(T,I);for(let L=0;L<D.length;L+=3)this.indexArray.emplaceBack(P+D[L],P+D[L+2],P+D[L+1]);x.primitiveLength+=D.length/3,x.vertexLength+=g}for(let m=0;m<d.vertexCount;m++)this.centroidVertexArray.emplaceBack(Math.floor(d.x/d.vertexCount),Math.floor(d.y/d.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,c)}}function yd(i,e){return i.x===e.x&&(i.x<0||i.x>ri)||i.y===e.y&&(i.y<0||i.y>ri)}function xd(i){return i.every(e=>e.x<0)||i.every(e=>e.x>ri)||i.every(e=>e.y<0)||i.every(e=>e.y>ri)}Oe("FillExtrusionBucket",pc,{omit:["layers","features"]});var vd={paint:new mi({"fill-extrusion-opacity":new Ze(_e["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Je(_e["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ze(_e["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ze(_e["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Fn(_e["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Je(_e["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Je(_e["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ze(_e["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Ks(i,e){return i.x*e.x+i.y*e.y}function Au(i,e){if(i.length===1){let r=0;const o=e[r++];let c;for(;!c||o.equals(c);)if(c=e[r++],!c)return 1/0;for(;r<e.length;r++){const h=e[r],d=i[0],m=c.sub(o),g=h.sub(o),x=d.sub(o),T=Ks(m,m),I=Ks(m,g),P=Ks(g,g),D=Ks(x,m),L=Ks(x,g),Z=T*P-I*I,q=(P*D-I*L)/Z,re=(T*L-I*D)/Z,ce=o.z*(1-q-re)+c.z*q+h.z*re;if(isFinite(ce))return ce}return 1/0}{let r=1/0;for(const o of e)r=Math.min(r,o.z);return r}}const bd=Qt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:wd}=bd,Td=Qt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Ed}=Td,Sd=Un.VectorTileFeature.types,Id=Math.cos(Math.PI/180*37.5),Mu=Math.pow(2,14)/.5;class dc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new wt,this.layoutVertexArray2=new zt,this.indexArray=new zi,this.programConfigurations=new vo(e.layers,e.zoom),this.segments=new pt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.hasPattern=lc("line",this.layers,r);const c=this.layers[0].layout.get("line-sort-key"),h=!c.isConstant(),d=[];for(const{feature:m,id:g,index:x,sourceLayerIndex:T}of e){const I=this.layers[0]._featureFilter.needGeometry,P=wo(m,I);if(!this.layers[0]._featureFilter.filter(new Nt(this.zoom),P,o))continue;const D=h?c.evaluate(P,{},o):void 0,L={id:g,properties:m.properties,type:m.type,sourceLayerIndex:T,index:x,geometry:I?P.geometry:bo(m),patterns:{},sortKey:D};d.push(L)}h&&d.sort((m,g)=>m.sortKey-g.sortKey);for(const m of d){const{geometry:g,index:x,sourceLayerIndex:T}=m;if(this.hasPattern){const I=cc("line",this.layers,m,this.zoom,r);this.patternFeatures.push(I)}else this.addFeature(m,g,x,o,{});r.featureIndex.insert(e[x].feature,g,x,T,this.index)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}addFeatures(e,r,o){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,r,o)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Ed)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wd),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,o,c,h){const d=this.layers[0].layout,m=d.get("line-join").evaluate(e,{}),g=d.get("line-cap"),x=d.get("line-miter-limit"),T=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const I of r)this.addLine(I,e,m,g,x,T);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,c)}addLine(e,r,o,c,h,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let re=0;re<e.length-1;re++)this.totalDistance+=e[re].dist(e[re+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const m=Sd[r.type]==="Polygon";let g=e.length;for(;g>=2&&e[g-1].equals(e[g-2]);)g--;let x=0;for(;x<g-1&&e[x].equals(e[x+1]);)x++;if(g<(m?3:2))return;o==="bevel"&&(h=1.05);const T=this.overscaling<=16?122880/(512*this.overscaling):0,I=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray);let P,D,L,Z,q;this.e1=this.e2=-1,m&&(P=e[g-2],q=e[x].sub(P)._unit()._perp());for(let re=x;re<g;re++){if(L=re===g-1?m?e[x+1]:void 0:e[re+1],L&&e[re].equals(L))continue;q&&(Z=q),P&&(D=P),P=e[re],q=L?L.sub(P)._unit()._perp():Z,Z=Z||q;let ce=Z.add(q);ce.x===0&&ce.y===0||ce._unit();const Q=Z.x*q.x+Z.y*q.y,ae=ce.x*q.x+ce.y*q.y,xe=ae!==0?1/ae:1/0,ye=2*Math.sqrt(2-2*ae),Fe=ae<Id&&D&&L,Ne=Z.x*q.y-Z.y*q.x>0;if(Fe&&re>x){const Ee=P.dist(D);if(Ee>2*T){const De=P.sub(P.sub(D)._mult(T/Ee)._round());this.updateDistance(D,De),this.addCurrentVertex(De,Z,0,0,I),D=De}}const ke=D&&L;let Ae=ke?o:m?"butt":c;if(ke&&Ae==="round"&&(xe<d?Ae="miter":xe<=2&&(Ae="fakeround")),Ae==="miter"&&xe>h&&(Ae="bevel"),Ae==="bevel"&&(xe>2&&(Ae="flipbevel"),xe<h&&(Ae="miter")),D&&this.updateDistance(D,P),Ae==="miter")ce._mult(xe),this.addCurrentVertex(P,ce,0,0,I);else if(Ae==="flipbevel"){if(xe>100)ce=q.mult(-1);else{const Ee=xe*Z.add(q).mag()/Z.sub(q).mag();ce._perp()._mult(Ee*(Ne?-1:1))}this.addCurrentVertex(P,ce,0,0,I),this.addCurrentVertex(P,ce.mult(-1),0,0,I)}else if(Ae==="bevel"||Ae==="fakeround"){const Ee=-Math.sqrt(xe*xe-1),De=Ne?Ee:0,Pe=Ne?0:Ee;if(D&&this.addCurrentVertex(P,Z,De,Pe,I),Ae==="fakeround"){const we=Math.round(180*ye/Math.PI/20);for(let He=1;He<we;He++){let je=He/we;if(je!==.5){const Ot=je-.5;je+=je*Ot*(je-1)*((1.0904+Q*(Q*(3.55645-1.43519*Q)-3.2452))*Ot*Ot+(.848013+Q*(.215638*Q-1.06021)))}const ht=q.sub(Z)._mult(je)._add(Z)._unit()._mult(Ne?-1:1);this.addHalfVertex(P,ht.x,ht.y,!1,Ne,0,I)}}L&&this.addCurrentVertex(P,q,-De,-Pe,I)}else if(Ae==="butt")this.addCurrentVertex(P,ce,0,0,I);else if(Ae==="square"){const Ee=D?1:-1;this.addCurrentVertex(P,ce,Ee,Ee,I)}else Ae==="round"&&(D&&(this.addCurrentVertex(P,Z,0,0,I),this.addCurrentVertex(P,Z,1,1,I,!0)),L&&(this.addCurrentVertex(P,q,-1,-1,I,!0),this.addCurrentVertex(P,q,0,0,I)));if(Fe&&re<g-1){const Ee=P.dist(L);if(Ee>2*T){const De=P.add(L.sub(P)._mult(T/Ee)._round());this.updateDistance(P,De),this.addCurrentVertex(De,q,0,0,I),P=De}}}}addCurrentVertex(e,r,o,c,h,d=!1){const m=r.y*c-r.x,g=-r.y-r.x*c;this.addHalfVertex(e,r.x+r.y*o,r.y-r.x*o,d,!1,o,h),this.addHalfVertex(e,m,g,d,!0,-c,h),this.distance>Mu/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,r,o,c,h,d))}addHalfVertex({x:e,y:r},o,c,h,d,m,g){const x=.5*(this.lineClips?this.scaledDistance*(Mu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(h?1:0),(r<<1)+(d?1:0),Math.round(63*o)+128,Math.round(63*c)+128,1+(m===0?0:m<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const T=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,T),g.primitiveLength++),d?this.e2=T:this.e1=T}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}Oe("LineBucket",dc,{omit:["layers","patternFeatures"]});const Cd=new mi({"line-cap":new Ze(_e.layout_line["line-cap"]),"line-join":new Je(_e.layout_line["line-join"]),"line-miter-limit":new Ze(_e.layout_line["line-miter-limit"]),"line-round-limit":new Ze(_e.layout_line["line-round-limit"]),"line-sort-key":new Je(_e.layout_line["line-sort-key"])});var Pu={paint:new mi({"line-opacity":new Je(_e.paint_line["line-opacity"]),"line-color":new Je(_e.paint_line["line-color"]),"line-translate":new Ze(_e.paint_line["line-translate"]),"line-translate-anchor":new Ze(_e.paint_line["line-translate-anchor"]),"line-width":new Je(_e.paint_line["line-width"]),"line-gap-width":new Je(_e.paint_line["line-gap-width"]),"line-offset":new Je(_e.paint_line["line-offset"]),"line-blur":new Je(_e.paint_line["line-blur"]),"line-dasharray":new Fs(_e.paint_line["line-dasharray"]),"line-pattern":new Fn(_e.paint_line["line-pattern"]),"line-gradient":new qr(_e.paint_line["line-gradient"])}),layout:Cd};const zu=new class extends Je{possiblyEvaluate(i,e){return e=new Nt(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(i,e)}evaluate(i,e,r,o){return e=Ue({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(i,e,r,o)}}(Pu.paint.properties["line-width"].specification);function ku(i,e){return e>0?e+2*i:i}zu.useIntegerZoom=!0;const Ad=Qt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Md=Qt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Qt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Pd=Qt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Qt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Du=Qt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),zd=Qt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function kd(i,e,r){return i.sections.forEach(o=>{o.text=function(c,h,d){const m=h.layout.get("text-transform").evaluate(d,{});return m==="uppercase"?c=c.toLocaleUpperCase():m==="lowercase"&&(c=c.toLocaleLowerCase()),Ji.applyArabicShaping&&(c=Ji.applyArabicShaping(c)),c}(o.text,e,r)}),i}Qt([{name:"triangle",components:3,type:"Uint16"}]),Qt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Qt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qt([{type:"Float32",name:"offsetX"}]),Qt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const Js={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var gi=24,fc=Lt,Lu=function(i,e,r,o,c){var h,d,m=8*c-o-1,g=(1<<m)-1,x=g>>1,T=-7,I=r?c-1:0,P=r?-1:1,D=i[e+I];for(I+=P,h=D&(1<<-T)-1,D>>=-T,T+=m;T>0;h=256*h+i[e+I],I+=P,T-=8);for(d=h&(1<<-T)-1,h>>=-T,T+=o;T>0;d=256*d+i[e+I],I+=P,T-=8);if(h===0)h=1-x;else{if(h===g)return d?NaN:1/0*(D?-1:1);d+=Math.pow(2,o),h-=x}return(D?-1:1)*d*Math.pow(2,h-o)},Ru=function(i,e,r,o,c,h){var d,m,g,x=8*h-c-1,T=(1<<x)-1,I=T>>1,P=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=o?0:h-1,L=o?1:-1,Z=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,d=T):(d=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-d))<1&&(d--,g*=2),(e+=d+I>=1?P/g:P*Math.pow(2,1-I))*g>=2&&(d++,g/=2),d+I>=T?(m=0,d=T):d+I>=1?(m=(e*g-1)*Math.pow(2,c),d+=I):(m=e*Math.pow(2,I-1)*Math.pow(2,c),d=0));c>=8;i[r+D]=255&m,D+=L,m/=256,c-=8);for(d=d<<c|m,x+=c;x>0;i[r+D]=255&d,D+=L,d/=256,x-=8);i[r+D-L]|=128*Z};function Lt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Lt.Varint=0,Lt.Fixed64=1,Lt.Bytes=2,Lt.Fixed32=5;var Vn,mc=4294967296,Bu=1/mc,Fu=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function hn(i){return i.type===Lt.Bytes?i.readVarint()+i.pos:i.pos+1}function es(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Ou(i,e,r){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(o);for(var c=r.pos-1;c>=i;c--)r.buf[c+o]=r.buf[c]}function Dd(i,e){for(var r=0;r<i.length;r++)e.writeVarint(i[r])}function Ld(i,e){for(var r=0;r<i.length;r++)e.writeSVarint(i[r])}function Rd(i,e){for(var r=0;r<i.length;r++)e.writeFloat(i[r])}function Bd(i,e){for(var r=0;r<i.length;r++)e.writeDouble(i[r])}function Fd(i,e){for(var r=0;r<i.length;r++)e.writeBoolean(i[r])}function Od(i,e){for(var r=0;r<i.length;r++)e.writeFixed32(i[r])}function $d(i,e){for(var r=0;r<i.length;r++)e.writeSFixed32(i[r])}function Ud(i,e){for(var r=0;r<i.length;r++)e.writeFixed64(i[r])}function Vd(i,e){for(var r=0;r<i.length;r++)e.writeSFixed64(i[r])}function sl(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function ts(i,e,r){i[r]=e,i[r+1]=e>>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function $u(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}function Nd(i,e,r){i===1&&r.readMessage(Gd,e)}function Gd(i,e,r){if(i===3){const{id:o,bitmap:c,width:h,height:d,left:m,top:g,advance:x}=r.readMessage(qd,{});e.push({id:o,bitmap:new qs({width:h+6,height:d+6},c),metrics:{width:h,height:d,left:m,top:g,advance:x}})}}function qd(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}function Uu(i){let e=0,r=0;for(const d of i)e+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,m)=>m.h-d.h);const o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let c=0,h=0;for(const d of i)for(let m=o.length-1;m>=0;m--){const g=o[m];if(!(d.w>g.w||d.h>g.h)){if(d.x=g.x,d.y=g.y,h=Math.max(h,d.y+d.h),c=Math.max(c,d.x+d.w),d.w===g.w&&d.h===g.h){const x=o.pop();m<o.length&&(o[m]=x)}else d.h===g.h?(g.x+=d.w,g.w-=d.w):d.w===g.w?(g.y+=d.h,g.h-=d.h):(o.push({x:g.x+d.w,y:g.y,w:g.w-d.w,h:d.h}),g.y+=d.h,g.h-=d.h);break}}return{w:c,h,fill:e/(c*h)||0}}Lt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos<r;){var o=this.readVarint(),c=o>>3,h=this.pos;this.type=7&o,i(c,e,this),this.pos===h&&this.skip(o)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=sl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=$u(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=sl(this.buf,this.pos)+sl(this.buf,this.pos+4)*mc;return this.pos+=8,i},readSFixed64:function(){var i=sl(this.buf,this.pos)+$u(this.buf,this.pos+4)*mc;return this.pos+=8,i},readFloat:function(){var i=Lu(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Lu(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,o=this.buf;return e=127&(r=o[this.pos++]),r<128?e:(e|=(127&(r=o[this.pos++]))<<7,r<128?e:(e|=(127&(r=o[this.pos++]))<<14,r<128?e:(e|=(127&(r=o[this.pos++]))<<21,r<128?e:function(c,h,d){var m,g,x=d.buf;if(m=(112&(g=x[d.pos++]))>>4,g<128||(m|=(127&(g=x[d.pos++]))<<3,g<128)||(m|=(127&(g=x[d.pos++]))<<10,g<128)||(m|=(127&(g=x[d.pos++]))<<17,g<128)||(m|=(127&(g=x[d.pos++]))<<24,g<128)||(m|=(1&(g=x[d.pos++]))<<31,g<128))return es(c,m,h);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=o[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&Fu?function(r,o,c){return Fu.decode(r.subarray(o,c))}(this.buf,e,i):function(r,o,c){for(var h="",d=o;d<c;){var m,g,x,T=r[d],I=null,P=T>239?4:T>223?3:T>191?2:1;if(d+P>c)break;P===1?T<128&&(I=T):P===2?(192&(m=r[d+1]))==128&&(I=(31&T)<<6|63&m)<=127&&(I=null):P===3?(g=r[d+2],(192&(m=r[d+1]))==128&&(192&g)==128&&((I=(15&T)<<12|(63&m)<<6|63&g)<=2047||I>=55296&&I<=57343)&&(I=null)):P===4&&(g=r[d+2],x=r[d+3],(192&(m=r[d+1]))==128&&(192&g)==128&&(192&x)==128&&((I=(15&T)<<18|(63&m)<<12|(63&g)<<6|63&x)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,P=1):I>65535&&(I-=65536,h+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),h+=String.fromCharCode(I),d+=P}return h}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==Lt.Bytes)return i.push(this.readVarint(e));var r=hn(this);for(i=i||[];this.pos<r;)i.push(this.readVarint(e));return i},readPackedSVarint:function(i){if(this.type!==Lt.Bytes)return i.push(this.readSVarint());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==Lt.Bytes)return i.push(this.readBoolean());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==Lt.Bytes)return i.push(this.readFloat());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==Lt.Bytes)return i.push(this.readDouble());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==Lt.Bytes)return i.push(this.readFixed32());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==Lt.Bytes)return i.push(this.readSFixed32());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==Lt.Bytes)return i.push(this.readFixed64());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==Lt.Bytes)return i.push(this.readSFixed64());var e=hn(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===Lt.Varint)for(;this.buf[this.pos++]>127;);else if(e===Lt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Lt.Fixed32)this.pos+=4;else{if(e!==Lt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e<this.pos+i;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),ts(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),ts(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),ts(this.buf,-1&i,this.pos),ts(this.buf,Math.floor(i*Bu),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),ts(this.buf,-1&i,this.pos),ts(this.buf,Math.floor(i*Bu),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(e,r){var o,c;if(e>=0?(o=e%4294967296|0,c=e/4294967296|0):(c=~(-e/4294967296),4294967295^(o=~(-e%4294967296))?o=o+1|0:(o=0,c=c+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(h,d,m){m.buf[m.pos++]=127&h|128,h>>>=7,m.buf[m.pos++]=127&h|128,h>>>=7,m.buf[m.pos++]=127&h|128,h>>>=7,m.buf[m.pos++]=127&h|128,m.buf[m.pos]=127&(h>>>=7)}(o,0,r),function(h,d){var m=(7&h)<<4;d.buf[d.pos++]|=m|((h>>>=3)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h)))))}(c,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(Boolean(i))},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(o,c,h){for(var d,m,g=0;g<c.length;g++){if((d=c.charCodeAt(g))>55295&&d<57344){if(!m){d>56319||g+1===c.length?(o[h++]=239,o[h++]=191,o[h++]=189):m=d;continue}if(d<56320){o[h++]=239,o[h++]=191,o[h++]=189,m=d;continue}d=m-55296<<10|d-56320|65536,m=null}else m&&(o[h++]=239,o[h++]=191,o[h++]=189,m=null);d<128?o[h++]=d:(d<2048?o[h++]=d>>6|192:(d<65536?o[h++]=d>>12|224:(o[h++]=d>>18|240,o[h++]=d>>12&63|128),o[h++]=d>>6&63|128),o[h++]=63&d|128)}return h}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&Ou(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Ru(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Ru(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=i[r]},writeRawMessage:function(i,e){this.pos++;var r=this.pos;i(e,this);var o=this.pos-r;o>=128&&Ou(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o},writeMessage:function(i,e,r){this.writeTag(i,Lt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Dd,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Ld,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Fd,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Rd,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Bd,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Od,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,$d,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Ud,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Vd,e)},writeBytesField:function(i,e){this.writeTag(i,Lt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Lt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Lt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Lt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Lt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Lt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Lt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Lt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Lt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Lt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,Boolean(e))}};class gc{constructor(e,{pixelRatio:r,version:o,stretchX:c,stretchY:h,content:d}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=c,this.stretchY=h,this.content=d,this.version=o}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Vu{constructor(e,r){const o={},c={};this.haveRenderCallbacks=[];const h=[];this.addImages(e,o,h),this.addImages(r,c,h);const{w:d,h:m}=Uu(h),g=new or({width:d||1,height:m||1});for(const x in e){const T=e[x],I=o[x].paddedRect;or.copy(T.data,g,{x:0,y:0},{x:I.x+1,y:I.y+1},T.data)}for(const x in r){const T=r[x],I=c[x].paddedRect,P=I.x+1,D=I.y+1,L=T.data.width,Z=T.data.height;or.copy(T.data,g,{x:0,y:0},{x:P,y:D},T.data),or.copy(T.data,g,{x:0,y:Z-1},{x:P,y:D-1},{width:L,height:1}),or.copy(T.data,g,{x:0,y:0},{x:P,y:D+Z},{width:L,height:1}),or.copy(T.data,g,{x:L-1,y:0},{x:P-1,y:D},{width:1,height:Z}),or.copy(T.data,g,{x:0,y:0},{x:P+L,y:D},{width:1,height:Z})}this.image=g,this.iconPositions=o,this.patternPositions=c}addImages(e,r,o){for(const c in e){const h=e[c],d={x:0,y:0,w:h.data.width+2,h:h.data.height+2};o.push(d),r[c]=new gc(d,h),h.hasRenderCallback&&this.haveRenderCallbacks.push(c)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const o in e.updatedImages)this.patchUpdatedImage(this.iconPositions[o],e.getImage(o),r),this.patchUpdatedImage(this.patternPositions[o],e.getImage(o),r)}patchUpdatedImage(e,r,o){if(!e||!r||e.version===r.version)return;e.version=r.version;const[c,h]=e.tl;o.update(r.data,void 0,{x:c,y:h})}}Oe("ImagePosition",gc),Oe("ImageAtlas",Vu),a.WritingMode=void 0,(Vn=a.WritingMode||(a.WritingMode={}))[Vn.none=0]="none",Vn[Vn.horizontal=1]="horizontal",Vn[Vn.vertical=2]="vertical",Vn[Vn.horizontalOnly=3]="horizontalOnly";const al=-17;class Ys{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){const o=new Ys;return o.scale=e||1,o.fontStack=r,o}static forImage(e){const r=new Ys;return r.imageName=e,r}}class is{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const o=new is;for(let c=0;c<e.sections.length;c++){const h=e.sections[c];h.image?o.addImageSection(h):o.addTextSection(h,r)}return o}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let r="";for(let o=0;o<e.length;o++){const c=e.charCodeAt(o+1)||null,h=e.charCodeAt(o-1)||null;r+=c&&Va(c)&&!Js[e[o+1]]||h&&Va(h)&&!Js[e[o-1]]||!Js[e[o]]?e[o]:Js[e[o]]}return r}(this.text)}trim(){let e=0;for(let o=0;o<this.text.length&&cl[this.text.charCodeAt(o)];o++)e++;let r=this.text.length;for(let o=this.text.length-1;o>=0&&o>=e&&cl[this.text.charCodeAt(o)];o--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const o=new is;return o.text=this.text.substring(e,r),o.sectionIndex=this.sectionIndex.slice(e,r),o.sections=this.sections,o}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(Ys.forText(e.scale,e.fontStack||r));const o=this.sections.length-1;for(let c=0;c<e.text.length;++c)this.sectionIndex.push(o)}addImageSection(e){const r=e.image?e.image.name:"";if(r.length===0)return void at("Can't add FormattedSection with an empty image.");const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push(Ys.forImage(r)),this.sectionIndex.push(this.sections.length-1)):at("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function ll(i,e,r,o,c,h,d,m,g,x,T,I,P,D,L,Z){const q=is.fromFeature(i,c);let re;I===a.WritingMode.vertical&&q.verticalizePunctuation();const{processBidirectionalText:ce,processStyledBidirectionalText:Q}=Ji;if(ce&&q.sections.length===1){re=[];const ye=ce(q.toString(),_c(q,x,h,e,o,D,L));for(const Fe of ye){const Ne=new is;Ne.text=Fe,Ne.sections=q.sections;for(let ke=0;ke<Fe.length;ke++)Ne.sectionIndex.push(0);re.push(Ne)}}else if(Q){re=[];const ye=Q(q.text,q.sectionIndex,_c(q,x,h,e,o,D,L));for(const Fe of ye){const Ne=new is;Ne.text=Fe[0],Ne.sectionIndex=Fe[1],Ne.sections=q.sections,re.push(Ne)}}else re=function(ye,Fe){const Ne=[],ke=ye.text;let Ae=0;for(const Ee of Fe)Ne.push(ye.substring(Ae,Ee)),Ae=Ee;return Ae<ke.length&&Ne.push(ye.substring(Ae,ke.length)),Ne}(q,_c(q,x,h,e,o,D,L));const ae=[],xe={positionedLines:ae,text:q.toString(),top:T[1],bottom:T[1],left:T[0],right:T[0],writingMode:I,iconsInText:!1,verticalizable:!1};return function(ye,Fe,Ne,ke,Ae,Ee,De,Pe,we,He,je,ht){let Ot=0,qt=al,ni=0,ar=0;const yi=Pe==="right"?1:Pe==="left"?0:.5;let ei=0;for(const ti of Ae){ti.trim();const vi=ti.getMaxScale(),Si=(vi-1)*gi,Li={positionedGlyphs:[],lineOffset:0};ye.positionedLines[ei]=Li;const qi=Li.positionedGlyphs;let Zi=0;if(!ti.length()){qt+=Ee,++ei;continue}for(let hi=0;hi<ti.length();hi++){const ft=ti.getSection(hi),er=ti.getSectionIndex(hi),bi=ti.getCharCode(hi);let Ii=0,yr=null,Pr=null,zr=null,dn=gi;const xr=!(we===a.WritingMode.horizontal||!je&&!zs(bi)||je&&(cl[bi]||(ui=bi,ze.Arabic(ui)||ze["Arabic Supplement"](ui)||ze["Arabic Extended-A"](ui)||ze["Arabic Presentation Forms-A"](ui)||ze["Arabic Presentation Forms-B"](ui))));if(ft.imageName){const lr=ke[ft.imageName];if(!lr)continue;zr=ft.imageName,ye.iconsInText=ye.iconsInText||!0,Pr=lr.paddedRect;const ji=lr.displaySize;ft.scale=ft.scale*gi/ht,yr={width:ji[0],height:ji[1],left:1,top:-3,advance:xr?ji[1]:ji[0]},Ii=Si+(gi-ji[1]*ft.scale),dn=yr.advance;const fn=xr?ji[0]*ft.scale-gi*vi:ji[1]*ft.scale-gi*vi;fn>0&&fn>Zi&&(Zi=fn)}else{const lr=Ne[ft.fontStack],ji=lr&&lr[bi];if(ji&&ji.rect)Pr=ji.rect,yr=ji.metrics;else{const fn=Fe[ft.fontStack],ta=fn&&fn[bi];if(!ta)continue;yr=ta.metrics}Ii=(vi-ft.scale)*gi}xr?(ye.verticalizable=!0,qi.push({glyph:bi,imageName:zr,x:Ot,y:qt+Ii,vertical:xr,scale:ft.scale,fontStack:ft.fontStack,sectionIndex:er,metrics:yr,rect:Pr}),Ot+=dn*ft.scale+He):(qi.push({glyph:bi,imageName:zr,x:Ot,y:qt+Ii,vertical:xr,scale:ft.scale,fontStack:ft.fontStack,sectionIndex:er,metrics:yr,rect:Pr}),Ot+=yr.advance*ft.scale+He)}qi.length!==0&&(ni=Math.max(Ot-He,ni),Xd(qi,0,qi.length-1,yi,Zi)),Ot=0;const jt=Ee*vi+Zi;Li.lineOffset=Math.max(Zi,Si),qt+=jt,ar=Math.max(jt,ar),++ei}var ui;const xi=qt-al,{horizontalAlign:Ei,verticalAlign:Gi}=yc(De);(function(ti,vi,Si,Li,qi,Zi,jt,hi,ft){const er=(vi-Si)*qi;let bi=0;bi=Zi!==jt?-hi*Li-al:(-Li*ft+.5)*jt;for(const Ii of ti)for(const yr of Ii.positionedGlyphs)yr.x+=er,yr.y+=bi})(ye.positionedLines,yi,Ei,Gi,ni,ar,Ee,xi,Ae.length),ye.top+=-Gi*xi,ye.bottom=ye.top+xi,ye.left+=-Ei*ni,ye.right=ye.left+ni}(xe,e,r,o,re,d,m,g,I,x,P,Z),!function(ye){for(const Fe of ye)if(Fe.positionedGlyphs.length!==0)return!1;return!0}(ae)&&xe}const cl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Zd={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Nu(i,e,r,o,c,h){if(e.imageName){const d=o[e.imageName];return d?d.displaySize[0]*e.scale*gi/h+c:0}{const d=r[e.fontStack],m=d&&d[i];return m?m.metrics.advance*e.scale+c:0}}function Gu(i,e,r,o){const c=Math.pow(i-e,2);return o?i<e?c/2:2*c:c+Math.abs(r)*r}function jd(i,e,r){let o=0;return i===10&&(o-=1e4),r&&(o+=150),i!==40&&i!==65288||(o+=50),e!==41&&e!==65289||(o+=50),o}function qu(i,e,r,o,c,h){let d=null,m=Gu(e,r,c,h);for(const g of o){const x=Gu(e-g.x,r,c,h)+g.badness;x<=m&&(d=g,m=x)}return{index:i,x:e,priorBreak:d,badness:m}}function Zu(i){return i?Zu(i.priorBreak).concat(i.index):[]}function _c(i,e,r,o,c,h,d){if(h!=="point")return[];if(!i)return[];const m=[],g=function(P,D,L,Z,q,re){let ce=0;for(let Q=0;Q<P.length();Q++){const ae=P.getSection(Q);ce+=Nu(P.getCharCode(Q),ae,Z,q,D,re)}return ce/Math.max(1,Math.ceil(ce/L))}(i,e,r,o,c,d),x=i.text.indexOf("\u200B")>=0;let T=0;for(let P=0;P<i.length();P++){const D=i.getSection(P),L=i.getCharCode(P);if(cl[L]||(T+=Nu(L,D,o,c,e,d)),P<i.length()-1){const Z=!((I=L)<11904||!(ze["Bopomofo Extended"](I)||ze.Bopomofo(I)||ze["CJK Compatibility Forms"](I)||ze["CJK Compatibility Ideographs"](I)||ze["CJK Compatibility"](I)||ze["CJK Radicals Supplement"](I)||ze["CJK Strokes"](I)||ze["CJK Symbols and Punctuation"](I)||ze["CJK Unified Ideographs Extension A"](I)||ze["CJK Unified Ideographs"](I)||ze["Enclosed CJK Letters and Months"](I)||ze["Halfwidth and Fullwidth Forms"](I)||ze.Hiragana(I)||ze["Ideographic Description Characters"](I)||ze["Kangxi Radicals"](I)||ze["Katakana Phonetic Extensions"](I)||ze.Katakana(I)||ze["Vertical Forms"](I)||ze["Yi Radicals"](I)||ze["Yi Syllables"](I)));(Zd[L]||Z||D.imageName)&&m.push(qu(P+1,T,g,m,jd(L,i.getCharCode(P+1),Z&&x),!1))}}var I;return Zu(qu(i.length(),T,g,m,0,!0))}function yc(i){let e=.5,r=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Xd(i,e,r,o,c){if(!o&&!c)return;const h=i[r],d=(i[r].x+h.metrics.advance*h.scale)*o;for(let m=e;m<=r;m++)i[m].x-=d,i[m].y+=c}function Wd(i,e,r){const{horizontalAlign:o,verticalAlign:c}=yc(r),h=e[0]-i.displaySize[0]*o,d=e[1]-i.displaySize[1]*c;return{image:i,top:d,bottom:d+i.displaySize[1],left:h,right:h+i.displaySize[0]}}function ju(i,e,r,o,c,h){const d=i.image;let m;if(d.content){const q=d.content,re=d.pixelRatio||1;m=[q[0]/re,q[1]/re,d.displaySize[0]-q[2]/re,d.displaySize[1]-q[3]/re]}const g=e.left*h,x=e.right*h;let T,I,P,D;r==="width"||r==="both"?(D=c[0]+g-o[3],I=c[0]+x+o[1]):(D=c[0]+(g+x-d.displaySize[0])/2,I=D+d.displaySize[0]);const L=e.top*h,Z=e.bottom*h;return r==="height"||r==="both"?(T=c[1]+L-o[0],P=c[1]+Z+o[2]):(T=c[1]+(L+Z-d.displaySize[1])/2,P=T+d.displaySize[1]),{image:d,top:T,right:I,bottom:P,left:D,collisionPadding:m}}const pn=128;function Xu(i,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Nt(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:o,interpolationType:c}=r;let h=0;for(;h<o.length&&o[h]<=i;)h++;h=Math.max(0,h-1);let d=h;for(;d<o.length&&o[d]<i+1;)d++;d=Math.min(o.length-1,d);const m=o[h],g=o[d];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:c}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new Nt(m)),maxSize:r.evaluate(new Nt(g)),interpolationType:c}}}class Nn extends Xe{constructor(e,r,o,c){super(e,r),this.angle=o,c!==void 0&&(this.segment=c)}clone(){return new Nn(this.x,this.y,this.angle,this.segment)}}function Wu(i,e,r,o,c){if(e.segment===void 0)return!0;let h=e,d=e.segment+1,m=0;for(;m>-r/2;){if(d--,d<0)return!1;m-=i[d].dist(h),h=i[d]}m+=i[d].dist(i[d+1]),d++;const g=[];let x=0;for(;m<r/2;){const T=i[d],I=i[d+1];if(!I)return!1;let P=i[d-1].angleTo(T)-T.angleTo(I);for(P=Math.abs((P+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:P}),x+=P;m-g[0].distance>o;)x-=g.shift().angleDelta;if(x>c)return!1;d++,m+=T.dist(I)}return!0}function Hu(i){let e=0;for(let r=0;r<i.length-1;r++)e+=i[r].dist(i[r+1]);return e}function Ku(i,e,r){return i?.6*e*r:0}function Ju(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function Hd(i,e,r,o,c,h){const d=Ku(r,c,h),m=Ju(r,o)*h;let g=0;const x=Hu(i)/2;for(let T=0;T<i.length-1;T++){const I=i[T],P=i[T+1],D=I.dist(P);if(g+D>x){const L=(x-g)/D,Z=Ut(I.x,P.x,L),q=Ut(I.y,P.y,L),re=new Nn(Z,q,P.angleTo(I),T);return re._round(),!d||Wu(i,re,m,d,e)?re:void 0}g+=D}}function Kd(i,e,r,o,c,h,d,m,g){const x=Ku(o,h,d),T=Ju(o,c),I=T*d,P=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return e-I<e/4&&(e=I+e/4),Yu(i,P?e/2*m%e:(T/2+2*h)*d*m%e,e,x,r,I,P,!1,g)}function Yu(i,e,r,o,c,h,d,m,g){const x=h/2,T=Hu(i);let I=0,P=e-r,D=[];for(let L=0;L<i.length-1;L++){const Z=i[L],q=i[L+1],re=Z.dist(q),ce=q.angleTo(Z);for(;P+r<I+re;){P+=r;const Q=(P-I)/re,ae=Ut(Z.x,q.x,Q),xe=Ut(Z.y,q.y,Q);if(ae>=0&&ae<g&&xe>=0&&xe<g&&P-x>=0&&P+x<=T){const ye=new Nn(ae,xe,ce,L);ye._round(),o&&!Wu(i,ye,h,o,c)||D.push(ye)}}I+=re}return m||D.length||d||(D=Yu(i,I/2,r,o,c,h,d,!0,g)),D}function Qu(i,e,r,o,c){const h=[];for(let d=0;d<i.length;d++){const m=i[d];let g;for(let x=0;x<m.length-1;x++){let T=m[x],I=m[x+1];T.x<e&&I.x<e||(T.x<e?T=new Xe(e,T.y+(e-T.x)/(I.x-T.x)*(I.y-T.y))._round():I.x<e&&(I=new Xe(e,T.y+(e-T.x)/(I.x-T.x)*(I.y-T.y))._round()),T.y<r&&I.y<r||(T.y<r?T=new Xe(T.x+(r-T.y)/(I.y-T.y)*(I.x-T.x),r)._round():I.y<r&&(I=new Xe(T.x+(r-T.y)/(I.y-T.y)*(I.x-T.x),r)._round()),T.x>=o&&I.x>=o||(T.x>=o?T=new Xe(o,T.y+(o-T.x)/(I.x-T.x)*(I.y-T.y))._round():I.x>=o&&(I=new Xe(o,T.y+(o-T.x)/(I.x-T.x)*(I.y-T.y))._round()),T.y>=c&&I.y>=c||(T.y>=c?T=new Xe(T.x+(c-T.y)/(I.y-T.y)*(I.x-T.x),c)._round():I.y>=c&&(I=new Xe(T.x+(c-T.y)/(I.y-T.y)*(I.x-T.x),c)._round()),g&&T.equals(g[g.length-1])||(g=[T],h.push(g)),g.push(I)))))}}return h}function eh(i,e,r,o){const c=[],h=i.image,d=h.pixelRatio,m=h.paddedRect.w-2,g=h.paddedRect.h-2,x=i.right-i.left,T=i.bottom-i.top,I=h.stretchX||[[0,m]],P=h.stretchY||[[0,g]],D=(Ee,De)=>Ee+De[1]-De[0],L=I.reduce(D,0),Z=P.reduce(D,0),q=m-L,re=g-Z;let ce=0,Q=L,ae=0,xe=Z,ye=0,Fe=q,Ne=0,ke=re;if(h.content&&o){const Ee=h.content;ce=ul(I,0,Ee[0]),ae=ul(P,0,Ee[1]),Q=ul(I,Ee[0],Ee[2]),xe=ul(P,Ee[1],Ee[3]),ye=Ee[0]-ce,Ne=Ee[1]-ae,Fe=Ee[2]-Ee[0]-Q,ke=Ee[3]-Ee[1]-xe}const Ae=(Ee,De,Pe,we)=>{const He=hl(Ee.stretch-ce,Q,x,i.left),je=pl(Ee.fixed-ye,Fe,Ee.stretch,L),ht=hl(De.stretch-ae,xe,T,i.top),Ot=pl(De.fixed-Ne,ke,De.stretch,Z),qt=hl(Pe.stretch-ce,Q,x,i.left),ni=pl(Pe.fixed-ye,Fe,Pe.stretch,L),ar=hl(we.stretch-ae,xe,T,i.top),yi=pl(we.fixed-Ne,ke,we.stretch,Z),ei=new Xe(He,ht),ui=new Xe(qt,ht),xi=new Xe(qt,ar),Ei=new Xe(He,ar),Gi=new Xe(je/d,Ot/d),ti=new Xe(ni/d,yi/d),vi=e*Math.PI/180;if(vi){const qi=Math.sin(vi),Zi=Math.cos(vi),jt=[Zi,-qi,qi,Zi];ei._matMult(jt),ui._matMult(jt),Ei._matMult(jt),xi._matMult(jt)}const Si=Ee.stretch+Ee.fixed,Li=De.stretch+De.fixed;return{tl:ei,tr:ui,bl:Ei,br:xi,tex:{x:h.paddedRect.x+1+Si,y:h.paddedRect.y+1+Li,w:Pe.stretch+Pe.fixed-Si,h:we.stretch+we.fixed-Li},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Gi,pixelOffsetBR:ti,minFontScaleX:Fe/d/x,minFontScaleY:ke/d/T,isSDF:r}};if(o&&(h.stretchX||h.stretchY)){const Ee=th(I,q,L),De=th(P,re,Z);for(let Pe=0;Pe<Ee.length-1;Pe++){const we=Ee[Pe],He=Ee[Pe+1];for(let je=0;je<De.length-1;je++)c.push(Ae(we,De[je],He,De[je+1]))}}else c.push(Ae({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:g+1}));return c}function ul(i,e,r){let o=0;for(const c of i)o+=Math.max(e,Math.min(r,c[1]))-Math.max(e,Math.min(r,c[0]));return o}function th(i,e,r){const o=[{fixed:-1,stretch:0}];for(const[c,h]of i){const d=o[o.length-1];o.push({fixed:c-d.stretch,stretch:d.stretch}),o.push({fixed:c-d.stretch,stretch:d.stretch+(h-c)})}return o.push({fixed:e+1,stretch:r}),o}function hl(i,e,r,o){return i/e*r+o}function pl(i,e,r,o){return i-e*r/o}Oe("Anchor",Nn);class dl{constructor(e,r,o,c,h,d,m,g,x,T){if(this.boxStartIndex=e.length,x){let I=d.top,P=d.bottom;const D=d.collisionPadding;D&&(I-=D[1],P+=D[3]);let L=P-I;L>0&&(L=Math.max(10,L),this.circleDiameter=L)}else{let I=d.top*m-g[0],P=d.bottom*m+g[2],D=d.left*m-g[3],L=d.right*m+g[1];const Z=d.collisionPadding;if(Z&&(D-=Z[0]*m,I-=Z[1]*m,L+=Z[2]*m,P+=Z[3]*m),T){const q=new Xe(D,I),re=new Xe(L,I),ce=new Xe(D,P),Q=new Xe(L,P),ae=T*Math.PI/180;q._rotate(ae),re._rotate(ae),ce._rotate(ae),Q._rotate(ae),D=Math.min(q.x,re.x,ce.x,Q.x),L=Math.max(q.x,re.x,ce.x,Q.x),I=Math.min(q.y,re.y,ce.y,Q.y),P=Math.max(q.y,re.y,ce.y,Q.y)}e.emplaceBack(r.x,r.y,D,I,L,P,o,c,h)}this.boxEndIndex=e.length}}class Jd{constructor(e=[],r=Yd){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:o}=this,c=r[e];for(;e>0;){const h=e-1>>1,d=r[h];if(o(c,d)>=0)break;r[e]=d,e=h}r[e]=c}_down(e){const{data:r,compare:o}=this,c=this.length>>1,h=r[e];for(;e<c;){let d=1+(e<<1),m=r[d];const g=d+1;if(g<this.length&&o(r[g],m)<0&&(d=g,m=r[g]),o(m,h)>=0)break;r[e]=m,e=d}r[e]=h}}function Yd(i,e){return i<e?-1:i>e?1:0}function Qd(i,e=1,r=!1){let o=1/0,c=1/0,h=-1/0,d=-1/0;const m=i[0];for(let D=0;D<m.length;D++){const L=m[D];(!D||L.x<o)&&(o=L.x),(!D||L.y<c)&&(c=L.y),(!D||L.x>h)&&(h=L.x),(!D||L.y>d)&&(d=L.y)}const g=Math.min(h-o,d-c);let x=g/2;const T=new Jd([],ef);if(g===0)return new Xe(o,c);for(let D=o;D<h;D+=g)for(let L=c;L<d;L+=g)T.push(new rs(D+x,L+x,x,i));let I=function(D){let L=0,Z=0,q=0;const re=D[0];for(let ce=0,Q=re.length,ae=Q-1;ce<Q;ae=ce++){const xe=re[ce],ye=re[ae],Fe=xe.x*ye.y-ye.x*xe.y;Z+=(xe.x+ye.x)*Fe,q+=(xe.y+ye.y)*Fe,L+=3*Fe}return new rs(Z/L,q/L,0,D)}(i),P=T.length;for(;T.length;){const D=T.pop();(D.d>I.d||!I.d)&&(I=D,r&&console.log("found best %d after %d probes",Math.round(1e4*D.d)/1e4,P)),D.max-I.d<=e||(x=D.h/2,T.push(new rs(D.p.x-x,D.p.y-x,x,i)),T.push(new rs(D.p.x+x,D.p.y-x,x,i)),T.push(new rs(D.p.x-x,D.p.y+x,x,i)),T.push(new rs(D.p.x+x,D.p.y+x,x,i)),P+=4)}return r&&(console.log(`num probes: ${P}`),console.log(`best distance: ${I.d}`)),I.p}function ef(i,e){return e.max-i.max}function rs(i,e,r,o){this.p=new Xe(i,e),this.h=r,this.d=function(c,h){let d=!1,m=1/0;for(let g=0;g<h.length;g++){const x=h[g];for(let T=0,I=x.length,P=I-1;T<I;P=T++){const D=x[T],L=x[P];D.y>c.y!=L.y>c.y&&c.x<(L.x-D.x)*(c.y-D.y)/(L.y-D.y)+D.x&&(d=!d),m=Math.min(m,cu(c,D,L))}}return(d?1:-1)*Math.sqrt(m)}(this.p,o),this.max=this.d+this.h*Math.SQRT2}const xc=Number.POSITIVE_INFINITY;function ih(i,e){return e[1]!==xc?function(r,o,c){let h=0,d=0;switch(o=Math.abs(o),c=Math.abs(c),r){case"top-right":case"top-left":case"top":d=c-7;break;case"bottom-right":case"bottom-left":case"bottom":d=7-c}switch(r){case"top-right":case"bottom-right":case"right":h=-o;break;case"top-left":case"bottom-left":case"left":h=o}return[h,d]}(i,e[0],e[1]):function(r,o){let c=0,h=0;o<0&&(o=0);const d=o/Math.sqrt(2);switch(r){case"top-right":case"top-left":h=d-7;break;case"bottom-right":case"bottom-left":h=7-d;break;case"bottom":h=7-o;break;case"top":h=o-7}switch(r){case"top-right":case"bottom-right":c=-d;break;case"top-left":case"bottom-left":c=d;break;case"left":c=o;break;case"right":c=-o}return[c,h]}(i,e[0])}function vc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function tf(i,e,r,o,c,h,d,m,g,x,T){let I=h.textMaxSize.evaluate(e,{});I===void 0&&(I=d);const P=i.layers[0].layout,D=P.get("icon-offset").evaluate(e,{},T),L=nh(r.horizontal),Z=d/24,q=i.tilePixelRatio*Z,re=i.tilePixelRatio*I/24,ce=i.tilePixelRatio*m,Q=i.tilePixelRatio*P.get("symbol-spacing"),ae=P.get("text-padding")*i.tilePixelRatio,xe=function(we,He,je,ht=1){const Ot=we.get("icon-padding").evaluate(He,{},je),qt=Ot&&Ot.values;return[qt[0]*ht,qt[1]*ht,qt[2]*ht,qt[3]*ht]}(P,e,T,i.tilePixelRatio),ye=P.get("text-max-angle")/180*Math.PI,Fe=P.get("text-rotation-alignment")!=="viewport"&&P.get("symbol-placement")!=="point",Ne=P.get("icon-rotation-alignment")==="map"&&P.get("symbol-placement")!=="point",ke=P.get("symbol-placement"),Ae=Q/2,Ee=P.get("icon-text-fit");let De;o&&Ee!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(De=ju(o,r.vertical,Ee,P.get("icon-text-fit-padding"),D,Z)),L&&(o=ju(o,L,Ee,P.get("icon-text-fit-padding"),D,Z)));const Pe=(we,He)=>{He.x<0||He.x>=ri||He.y<0||He.y>=ri||function(je,ht,Ot,qt,ni,ar,yi,ei,ui,xi,Ei,Gi,ti,vi,Si,Li,qi,Zi,jt,hi,ft,er,bi,Ii,yr){const Pr=je.addToLineVertexArray(ht,Ot);let zr,dn,xr,lr,ji=0,fn=0,ta=0,vh=0,Pc=-1,zc=-1;const mn={};let bh=ci.exports(""),kc=0,Dc=0;if(ei._unevaluatedLayout.getValue("text-radial-offset")===void 0?[kc,Dc]=ei.layout.get("text-offset").evaluate(ft,{},Ii).map(Xi=>Xi*gi):(kc=ei.layout.get("text-radial-offset").evaluate(ft,{},Ii)*gi,Dc=xc),je.allowVerticalPlacement&&qt.vertical){const Xi=ei.layout.get("text-rotate").evaluate(ft,{},Ii)+90;xr=new dl(ui,ht,xi,Ei,Gi,qt.vertical,ti,vi,Si,Xi),yi&&(lr=new dl(ui,ht,xi,Ei,Gi,yi,qi,Zi,Si,Xi))}if(ni){const Xi=ei.layout.get("icon-rotate").evaluate(ft,{}),Hr=ei.layout.get("icon-text-fit")!=="none",ia=eh(ni,Xi,bi,Hr),ra=yi?eh(yi,Xi,bi,Hr):void 0;dn=new dl(ui,ht,xi,Ei,Gi,ni,qi,Zi,!1,Xi),ji=4*ia.length;const Eh=je.iconSizeData;let So=null;Eh.kind==="source"?(So=[pn*ei.layout.get("icon-size").evaluate(ft,{})],So[0]>Gn&&at(`${je.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Eh.kind==="composite"&&(So=[pn*er.compositeIconSizes[0].evaluate(ft,{},Ii),pn*er.compositeIconSizes[1].evaluate(ft,{},Ii)],(So[0]>Gn||So[1]>Gn)&&at(`${je.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),je.addSymbols(je.icon,ia,So,hi,jt,ft,a.WritingMode.none,ht,Pr.lineStartIndex,Pr.lineLength,-1,Ii),Pc=je.icon.placedSymbolArray.length-1,ra&&(fn=4*ra.length,je.addSymbols(je.icon,ra,So,hi,jt,ft,a.WritingMode.vertical,ht,Pr.lineStartIndex,Pr.lineLength,-1,Ii),zc=je.icon.placedSymbolArray.length-1)}const wh=Object.keys(qt.horizontal);for(const Xi of wh){const Hr=qt.horizontal[Xi];if(!zr){bh=ci.exports(Hr.text);const ra=ei.layout.get("text-rotate").evaluate(ft,{},Ii);zr=new dl(ui,ht,xi,Ei,Gi,Hr,ti,vi,Si,ra)}const ia=Hr.positionedLines.length===1;if(ta+=rh(je,ht,Hr,ar,ei,Si,ft,Li,Pr,qt.vertical?a.WritingMode.horizontal:a.WritingMode.horizontalOnly,ia?wh:[Xi],mn,Pc,er,Ii),ia)break}qt.vertical&&(vh+=rh(je,ht,qt.vertical,ar,ei,Si,ft,Li,Pr,a.WritingMode.vertical,["vertical"],mn,zc,er,Ii));const mf=zr?zr.boxStartIndex:je.collisionBoxArray.length,gf=zr?zr.boxEndIndex:je.collisionBoxArray.length,_f=xr?xr.boxStartIndex:je.collisionBoxArray.length,yf=xr?xr.boxEndIndex:je.collisionBoxArray.length,xf=dn?dn.boxStartIndex:je.collisionBoxArray.length,vf=dn?dn.boxEndIndex:je.collisionBoxArray.length,bf=lr?lr.boxStartIndex:je.collisionBoxArray.length,wf=lr?lr.boxEndIndex:je.collisionBoxArray.length;let kr=-1;const yl=(Xi,Hr)=>Xi&&Xi.circleDiameter?Math.max(Xi.circleDiameter,Hr):Hr;kr=yl(zr,kr),kr=yl(xr,kr),kr=yl(dn,kr),kr=yl(lr,kr);const Th=kr>-1?1:0;Th&&(kr*=yr/gi),je.glyphOffsetArray.length>=ns.MAX_GLYPHS&&at("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ft.sortKey!==void 0&&je.addToSortKeyRanges(je.symbolInstances.length,ft.sortKey),je.symbolInstances.emplaceBack(ht.x,ht.y,mn.right>=0?mn.right:-1,mn.center>=0?mn.center:-1,mn.left>=0?mn.left:-1,mn.vertical||-1,Pc,zc,bh,mf,gf,_f,yf,xf,vf,bf,wf,xi,ta,vh,ji,fn,Th,0,ti,kc,Dc,kr)}(i,He,we,r,o,c,De,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,q,[ae,ae,ae,ae],Fe,g,ce,xe,Ne,D,e,h,x,T,d)};if(ke==="line")for(const we of Qu(e.geometry,0,0,ri,ri)){const He=Kd(we,Q,ye,r.vertical||L,o,24,re,i.overscaling,ri);for(const je of He){const ht=L;ht&&rf(i,ht.text,Ae,je)||Pe(we,je)}}else if(ke==="line-center"){for(const we of e.geometry)if(we.length>1){const He=Hd(we,ye,r.vertical||L,o,24,re);He&&Pe(we,He)}}else if(e.type==="Polygon")for(const we of ac(e.geometry,0)){const He=Qd(we,16);Pe(we[0],new Nn(He.x,He.y,0))}else if(e.type==="LineString")for(const we of e.geometry)Pe(we,new Nn(we[0].x,we[0].y,0));else if(e.type==="Point")for(const we of e.geometry)for(const He of we)Pe([He],new Nn(He.x,He.y,0))}const Gn=32640;function rh(i,e,r,o,c,h,d,m,g,x,T,I,P,D,L){const Z=function(ce,Q,ae,xe,ye,Fe,Ne,ke){const Ae=xe.layout.get("text-rotate").evaluate(Fe,{})*Math.PI/180,Ee=[];for(const De of Q.positionedLines)for(const Pe of De.positionedGlyphs){if(!Pe.rect)continue;const we=Pe.rect||{};let He=4,je=!0,ht=1,Ot=0;const qt=(ye||ke)&&Pe.vertical,ni=Pe.metrics.advance*Pe.scale/2;if(ke&&Q.verticalizable){const jt=(Pe.scale-1)*gi,hi=(gi-Pe.metrics.width*Pe.scale)/2;Ot=De.lineOffset/2-(Pe.imageName?-hi:jt)}if(Pe.imageName){const jt=Ne[Pe.imageName];je=jt.sdf,ht=jt.pixelRatio,He=1/ht}const ar=ye?[Pe.x+ni,Pe.y]:[0,0];let yi=ye?[0,0]:[Pe.x+ni+ae[0],Pe.y+ae[1]-Ot],ei=[0,0];qt&&(ei=yi,yi=[0,0]);const ui=(Pe.metrics.left-He)*Pe.scale-ni+yi[0],xi=(-Pe.metrics.top-He)*Pe.scale+yi[1],Ei=ui+we.w*Pe.scale/ht,Gi=xi+we.h*Pe.scale/ht,ti=new Xe(ui,xi),vi=new Xe(Ei,xi),Si=new Xe(ui,Gi),Li=new Xe(Ei,Gi);if(qt){const jt=new Xe(-ni,ni-al),hi=-Math.PI/2,ft=12-ni,er=new Xe(22-ft,-(Pe.imageName?ft:0)),bi=new Xe(...ei);ti._rotateAround(hi,jt)._add(er)._add(bi),vi._rotateAround(hi,jt)._add(er)._add(bi),Si._rotateAround(hi,jt)._add(er)._add(bi),Li._rotateAround(hi,jt)._add(er)._add(bi)}if(Ae){const jt=Math.sin(Ae),hi=Math.cos(Ae),ft=[hi,-jt,jt,hi];ti._matMult(ft),vi._matMult(ft),Si._matMult(ft),Li._matMult(ft)}const qi=new Xe(0,0),Zi=new Xe(0,0);Ee.push({tl:ti,tr:vi,bl:Si,br:Li,tex:we,writingMode:Q.writingMode,glyphOffset:ar,sectionIndex:Pe.sectionIndex,isSDF:je,pixelOffsetTL:qi,pixelOffsetBR:Zi,minFontScaleX:0,minFontScaleY:0})}return Ee}(0,r,m,c,h,d,o,i.allowVerticalPlacement),q=i.textSizeData;let re=null;q.kind==="source"?(re=[pn*c.layout.get("text-size").evaluate(d,{})],re[0]>Gn&&at(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):q.kind==="composite"&&(re=[pn*D.compositeTextSizes[0].evaluate(d,{},L),pn*D.compositeTextSizes[1].evaluate(d,{},L)],(re[0]>Gn||re[1]>Gn)&&at(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),i.addSymbols(i.text,Z,re,m,h,d,x,e,g.lineStartIndex,g.lineLength,P,L);for(const ce of T)I[ce]=i.text.placedSymbolArray.length-1;return 4*Z.length}function nh(i){for(const e in i)return i[e];return null}function rf(i,e,r,o){const c=i.compareText;if(e in c){const h=c[e];for(let d=h.length-1;d>=0;d--)if(o.dist(h[d])<r)return!0}else c[e]=[];return c[e].push(o),!1}const nf=Un.VectorTileFeature.types,of=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function fl(i,e,r,o,c,h,d,m,g,x,T,I,P){const D=m?Math.min(Gn,Math.round(m[0])):0,L=m?Math.min(Gn,Math.round(m[1])):0;i.emplaceBack(e,r,Math.round(32*o),Math.round(32*c),h,d,(D<<1)+(g?1:0),L,16*x,16*T,256*I,256*P)}function bc(i,e,r){i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r)}function sf(i){for(const e of i.sections)if(Ga(e.text))return!0;return!1}class wc{constructor(e){this.layoutVertexArray=new gr,this.indexArray=new zi,this.programConfigurations=e,this.segments=new pt,this.dynamicLayoutVertexArray=new nr,this.opacityVertexArray=new _r,this.placedSymbolArray=new be}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,o,c){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ad.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Md.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,of,!0),this.opacityVertexBuffer.itemSize=1),(o||c)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Oe("SymbolBuffers",wc);class Tc{constructor(e,r,o){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new o,this.segments=new pt,this.collisionVertexArray=new Yi}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Pd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Oe("CollisionBuffers",Tc);class ns{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(d=>d.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=tc([]),this.placementViewportMatrix=tc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Xu(this.zoom,r["text-size"]),this.iconSizeData=Xu(this.zoom,r["icon-size"]);const o=this.layers[0].layout,c=o.get("symbol-sort-key"),h=o.get("symbol-z-order");this.canOverlap=Sc(o,"text-overlap","text-allow-overlap")!=="never"||Sc(o,"icon-overlap","icon-allow-overlap")!=="never"||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=h!=="viewport-y"&&!c.isConstant(),this.sortFeaturesByY=(h==="viewport-y"||h==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,o.get("symbol-placement")==="point"&&(this.writingModes=o.get("text-writing-mode").map(d=>a.WritingMode[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=e.sourceID}createArrays(){this.text=new wc(new vo(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new wc(new vo(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ce,this.lineVertexArray=new Be,this.symbolInstances=new Re}calculateGlyphDependencies(e,r,o,c,h){for(let d=0;d<e.length;d++)if(r[e.charCodeAt(d)]=!0,(o||c)&&h){const m=Js[e.charAt(d)];m&&(r[m.charCodeAt(0)]=!0)}}populate(e,r,o){const c=this.layers[0],h=c.layout,d=h.get("text-font"),m=h.get("text-field"),g=h.get("icon-image"),x=(m.value.kind!=="constant"||m.value.value instanceof W&&!m.value.value.isEmpty()||m.value.value.toString().length>0)&&(d.value.kind!=="constant"||d.value.value.length>0),T=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,I=h.get("symbol-sort-key");if(this.features=[],!x&&!T)return;const P=r.iconDependencies,D=r.glyphDependencies,L=r.availableImages,Z=new Nt(this.zoom);for(const{feature:q,id:re,index:ce,sourceLayerIndex:Q}of e){const ae=c._featureFilter.needGeometry,xe=wo(q,ae);if(!c._featureFilter.filter(Z,xe,o))continue;let ye,Fe;if(ae||(xe.geometry=bo(q)),x){const ke=c.getValueAndResolveTokens("text-field",xe,o,L),Ae=W.factory(ke);sf(Ae)&&(this.hasRTLText=!0),(!this.hasRTLText||_o()==="unavailable"||this.hasRTLText&&Ji.isParsed())&&(ye=kd(Ae,c,xe))}if(T){const ke=c.getValueAndResolveTokens("icon-image",xe,o,L);Fe=ke instanceof J?ke:J.fromString(ke)}if(!ye&&!Fe)continue;const Ne=this.sortFeaturesByKey?I.evaluate(xe,{},o):void 0;if(this.features.push({id:re,text:ye,icon:Fe,index:ce,sourceLayerIndex:Q,geometry:xe.geometry,properties:q.properties,type:nf[q.type],sortKey:Ne}),Fe&&(P[Fe.name]=!0),ye){const ke=d.evaluate(xe,{},o).join(","),Ae=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(a.WritingMode.vertical)>=0;for(const Ee of ye.sections)if(Ee.image)P[Ee.image.name]=!0;else{const De=jo(ye.toString()),Pe=Ee.fontStack||ke,we=D[Pe]=D[Pe]||{};this.calculateGlyphDependencies(Ee.text,we,Ae,this.allowVerticalPlacement,De)}}}h.get("symbol-placement")==="line"&&(this.features=function(q){const re={},ce={},Q=[];let ae=0;function xe(ke){Q.push(q[ke]),ae++}function ye(ke,Ae,Ee){const De=ce[ke];return delete ce[ke],ce[Ae]=De,Q[De].geometry[0].pop(),Q[De].geometry[0]=Q[De].geometry[0].concat(Ee[0]),De}function Fe(ke,Ae,Ee){const De=re[Ae];return delete re[Ae],re[ke]=De,Q[De].geometry[0].shift(),Q[De].geometry[0]=Ee[0].concat(Q[De].geometry[0]),De}function Ne(ke,Ae,Ee){const De=Ee?Ae[0][Ae[0].length-1]:Ae[0][0];return`${ke}:${De.x}:${De.y}`}for(let ke=0;ke<q.length;ke++){const Ae=q[ke],Ee=Ae.geometry,De=Ae.text?Ae.text.toString():null;if(!De){xe(ke);continue}const Pe=Ne(De,Ee),we=Ne(De,Ee,!0);if(Pe in ce&&we in re&&ce[Pe]!==re[we]){const He=Fe(Pe,we,Ee),je=ye(Pe,we,Q[He].geometry);delete re[Pe],delete ce[we],ce[Ne(De,Q[je].geometry,!0)]=je,Q[He].geometry=null}else Pe in ce?ye(Pe,we,Ee):we in re?Fe(Pe,we,Ee):(xe(ke),re[Pe]=ae-1,ce[we]=ae-1)}return Q.filter(ke=>ke.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((q,re)=>q.sortKey-re.sortKey)}update(e,r,o){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,o),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,o))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const o=this.lineVertexArray.length;if(e.segment!==void 0){let c=e.dist(r[e.segment+1]),h=e.dist(r[e.segment]);const d={};for(let m=e.segment+1;m<r.length;m++)d[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:c},m<r.length-1&&(c+=r[m+1].dist(r[m]));for(let m=e.segment||0;m>=0;m--)d[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:h},m>0&&(h+=r[m-1].dist(r[m]));for(let m=0;m<r.length;m++){const g=d[m];this.lineVertexArray.emplaceBack(g.x,g.y,g.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,r,o,c,h,d,m,g,x,T,I,P){const D=e.indexArray,L=e.layoutVertexArray,Z=e.segments.prepareSegment(4*r.length,L,D,this.canOverlap?d.sortKey:void 0),q=this.glyphOffsetArray.length,re=Z.vertexLength,ce=this.allowVerticalPlacement&&m===a.WritingMode.vertical?Math.PI/2:0,Q=d.text&&d.text.sections;for(let ae=0;ae<r.length;ae++){const{tl:xe,tr:ye,bl:Fe,br:Ne,tex:ke,pixelOffsetTL:Ae,pixelOffsetBR:Ee,minFontScaleX:De,minFontScaleY:Pe,glyphOffset:we,isSDF:He,sectionIndex:je}=r[ae],ht=Z.vertexLength,Ot=we[1];fl(L,g.x,g.y,xe.x,Ot+xe.y,ke.x,ke.y,o,He,Ae.x,Ae.y,De,Pe),fl(L,g.x,g.y,ye.x,Ot+ye.y,ke.x+ke.w,ke.y,o,He,Ee.x,Ae.y,De,Pe),fl(L,g.x,g.y,Fe.x,Ot+Fe.y,ke.x,ke.y+ke.h,o,He,Ae.x,Ee.y,De,Pe),fl(L,g.x,g.y,Ne.x,Ot+Ne.y,ke.x+ke.w,ke.y+ke.h,o,He,Ee.x,Ee.y,De,Pe),bc(e.dynamicLayoutVertexArray,g,ce),D.emplaceBack(ht,ht+1,ht+2),D.emplaceBack(ht+1,ht+2,ht+3),Z.vertexLength+=4,Z.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(we[0]),ae!==r.length-1&&je===r[ae+1].sectionIndex||e.programConfigurations.populatePaintArrays(L.length,d,d.index,{},P,Q&&Q[je])}e.placedSymbolArray.emplaceBack(g.x,g.y,q,this.glyphOffsetArray.length-q,re,x,T,g.segment,o?o[0]:0,o?o[1]:0,c[0],c[1],m,0,!1,0,I)}_addCollisionDebugVertex(e,r,o,c,h,d){return r.emplaceBack(0,0),e.emplaceBack(o.x,o.y,c,h,Math.round(d.x),Math.round(d.y))}addCollisionDebugVertices(e,r,o,c,h,d,m){const g=h.segments.prepareSegment(4,h.layoutVertexArray,h.indexArray),x=g.vertexLength,T=h.layoutVertexArray,I=h.collisionVertexArray,P=m.anchorX,D=m.anchorY;this._addCollisionDebugVertex(T,I,d,P,D,new Xe(e,r)),this._addCollisionDebugVertex(T,I,d,P,D,new Xe(o,r)),this._addCollisionDebugVertex(T,I,d,P,D,new Xe(o,c)),this._addCollisionDebugVertex(T,I,d,P,D,new Xe(e,c)),g.vertexLength+=4;const L=h.indexArray;L.emplaceBack(x,x+1),L.emplaceBack(x+1,x+2),L.emplaceBack(x+2,x+3),L.emplaceBack(x+3,x),g.primitiveLength+=4}addDebugCollisionBoxes(e,r,o,c){for(let h=e;h<r;h++){const d=this.collisionBoxArray.get(h);this.addCollisionDebugVertices(d.x1,d.y1,d.x2,d.y2,c?this.textCollisionBox:this.iconCollisionBox,d.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Tc(Xr,Du.members,Ar),this.iconCollisionBox=new Tc(Xr,Du.members,Ar);for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,o,c,h,d,m,g,x){const T={};for(let I=r;I<o;I++){const P=e.get(I);T.textBox={x1:P.x1,y1:P.y1,x2:P.x2,y2:P.y2,anchorPointX:P.anchorPointX,anchorPointY:P.anchorPointY},T.textFeatureIndex=P.featureIndex;break}for(let I=c;I<h;I++){const P=e.get(I);T.verticalTextBox={x1:P.x1,y1:P.y1,x2:P.x2,y2:P.y2,anchorPointX:P.anchorPointX,anchorPointY:P.anchorPointY},T.verticalTextFeatureIndex=P.featureIndex;break}for(let I=d;I<m;I++){const P=e.get(I);T.iconBox={x1:P.x1,y1:P.y1,x2:P.x2,y2:P.y2,anchorPointX:P.anchorPointX,anchorPointY:P.anchorPointY},T.iconFeatureIndex=P.featureIndex;break}for(let I=g;I<x;I++){const P=e.get(I);T.verticalIconBox={x1:P.x1,y1:P.y1,x2:P.x2,y2:P.y2,anchorPointX:P.anchorPointX,anchorPointY:P.anchorPointY},T.verticalIconFeatureIndex=P.featureIndex;break}return T}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const o=e.placedSymbolArray.get(r),c=o.vertexStartIndex+4*o.numGlyphs;for(let h=o.vertexStartIndex;h<c;h+=4)e.indexArray.emplaceBack(h,h+1,h+2),e.indexArray.emplaceBack(h+1,h+2,h+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(e),o=Math.cos(e),c=[],h=[],d=[];for(let m=0;m<this.symbolInstances.length;++m){d.push(m);const g=this.symbolInstances.get(m);c.push(0|Math.round(r*g.anchorX+o*g.anchorY)),h.push(g.featureIndex)}return d.sort((m,g)=>c[m]-c[g]||h[g]-h[m]),d}addToSortKeyRanges(e,r){const o=this.sortKeyRanges[this.sortKeyRanges.length-1];o&&o.sortKey===r?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const o=this.symbolInstances.get(r);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((c,h,d)=>{c>=0&&d.indexOf(c)===h&&this.addIndicesForPlacedSymbol(this.text,c)}),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Oe("SymbolBucket",ns,{omit:["layers","collisionBoxArray","features","compareText"]}),ns.MAX_GLYPHS=65535,ns.addDynamicAttributes=bc;const af=new mi({"symbol-placement":new Ze(_e.layout_symbol["symbol-placement"]),"symbol-spacing":new Ze(_e.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ze(_e.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Je(_e.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ze(_e.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ze(_e.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ze(_e.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ze(_e.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ze(_e.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ze(_e.layout_symbol["icon-rotation-alignment"]),"icon-size":new Je(_e.layout_symbol["icon-size"]),"icon-text-fit":new Ze(_e.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ze(_e.layout_symbol["icon-text-fit-padding"]),"icon-image":new Je(_e.layout_symbol["icon-image"]),"icon-rotate":new Je(_e.layout_symbol["icon-rotate"]),"icon-padding":new Je(_e.layout_symbol["icon-padding"]),"icon-keep-upright":new Ze(_e.layout_symbol["icon-keep-upright"]),"icon-offset":new Je(_e.layout_symbol["icon-offset"]),"icon-anchor":new Je(_e.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ze(_e.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ze(_e.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ze(_e.layout_symbol["text-rotation-alignment"]),"text-field":new Je(_e.layout_symbol["text-field"]),"text-font":new Je(_e.layout_symbol["text-font"]),"text-size":new Je(_e.layout_symbol["text-size"]),"text-max-width":new Je(_e.layout_symbol["text-max-width"]),"text-line-height":new Ze(_e.layout_symbol["text-line-height"]),"text-letter-spacing":new Je(_e.layout_symbol["text-letter-spacing"]),"text-justify":new Je(_e.layout_symbol["text-justify"]),"text-radial-offset":new Je(_e.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ze(_e.layout_symbol["text-variable-anchor"]),"text-anchor":new Je(_e.layout_symbol["text-anchor"]),"text-max-angle":new Ze(_e.layout_symbol["text-max-angle"]),"text-writing-mode":new Ze(_e.layout_symbol["text-writing-mode"]),"text-rotate":new Je(_e.layout_symbol["text-rotate"]),"text-padding":new Ze(_e.layout_symbol["text-padding"]),"text-keep-upright":new Ze(_e.layout_symbol["text-keep-upright"]),"text-transform":new Je(_e.layout_symbol["text-transform"]),"text-offset":new Je(_e.layout_symbol["text-offset"]),"text-allow-overlap":new Ze(_e.layout_symbol["text-allow-overlap"]),"text-overlap":new Ze(_e.layout_symbol["text-overlap"]),"text-ignore-placement":new Ze(_e.layout_symbol["text-ignore-placement"]),"text-optional":new Ze(_e.layout_symbol["text-optional"])});var Ec={paint:new mi({"icon-opacity":new Je(_e.paint_symbol["icon-opacity"]),"icon-color":new Je(_e.paint_symbol["icon-color"]),"icon-halo-color":new Je(_e.paint_symbol["icon-halo-color"]),"icon-halo-width":new Je(_e.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Je(_e.paint_symbol["icon-halo-blur"]),"icon-translate":new Ze(_e.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ze(_e.paint_symbol["icon-translate-anchor"]),"text-opacity":new Je(_e.paint_symbol["text-opacity"]),"text-color":new Je(_e.paint_symbol["text-color"],{runtimeType:fi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Je(_e.paint_symbol["text-halo-color"]),"text-halo-width":new Je(_e.paint_symbol["text-halo-width"]),"text-halo-blur":new Je(_e.paint_symbol["text-halo-blur"]),"text-translate":new Ze(_e.paint_symbol["text-translate"]),"text-translate-anchor":new Ze(_e.paint_symbol["text-translate-anchor"])}),layout:af};class oh{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:$r,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Oe("FormatSectionOverride",oh,{omit:["defaultValue"]});class ml extends mr{constructor(e){super(e,Ec)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const o=this.layout.get("text-writing-mode");if(o){const c=[];for(const h of o)c.indexOf(h)<0&&c.push(h);this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,o,c){const h=this.layout.get(e).evaluate(r,{},o,c),d=this._unevaluatedLayout._values[e];return d.isDataDriven()||ro(d.value)||!h?h:function(m,g){return g.replace(/{([^{}]+)}/g,(x,T)=>T in m?String(m[T]):"")}(r.properties,h)}createBucket(e){return new ns(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Ec.paint.overridableProperties){if(!ml.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),o=new oh(r),c=new Uo(o,r.property.specification);let h=null;h=r.value.kind==="constant"||r.value.kind==="source"?new oo("source",c):new Ss("composite",c,r.value.zoomStops),this.paint._values[e]=new fr(r.property,h,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,o){return!(!this.layout||r.isDataDriven()||o.isDataDriven())&&ml.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const o=e.get("text-field"),c=Ec.paint.properties[r];let h=!1;const d=m=>{for(const g of m)if(c.overrides&&c.overrides.hasOverride(g))return void(h=!0)};if(o.value.kind==="constant"&&o.value.value instanceof W)d(o.value.value.sections);else if(o.value.kind==="source"){const m=x=>{h||(x instanceof Ge&&he(x.value)===oi?d(x.value.sections):x instanceof Oo?d(x.sections):x.eachChild(m))},g=o.value;g._styleExpression&&m(g._styleExpression.expression)}return h}}function Sc(i,e,r){let o="never";const c=i.get(e);return c?o=c:i.get(r)&&(o="always"),o}var lf={paint:new mi({"background-color":new Ze(_e.paint_background["background-color"]),"background-pattern":new Fs(_e.paint_background["background-pattern"]),"background-opacity":new Ze(_e.paint_background["background-opacity"])})},cf={paint:new mi({"raster-opacity":new Ze(_e.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ze(_e.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ze(_e.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ze(_e.paint_raster["raster-brightness-max"]),"raster-saturation":new Ze(_e.paint_raster["raster-saturation"]),"raster-contrast":new Ze(_e.paint_raster["raster-contrast"]),"raster-resampling":new Ze(_e.paint_raster["raster-resampling"]),"raster-fade-duration":new Ze(_e.paint_raster["raster-fade-duration"])})};class uf extends mr{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const hf={circle:class extends mr{constructor(i){super(i,Vp)}createBucket(i){return new Yl(i)}queryRadius(i){const e=i;return Ns("circle-radius",this,e)+Ns("circle-stroke-width",this,e)+Ya(this.paint.get("circle-translate"))}queryIntersectsFeature(i,e,r,o,c,h,d,m){const g=Qa(i,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),h.angle,d),x=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),T=this.paint.get("circle-pitch-alignment")==="map",I=T?g:function(D,L){return D.map(Z=>gu(Z,L))}(g,m),P=T?x*d:x;for(const D of o)for(const L of D){const Z=T?L:gu(L,m);let q=P;const re=el([],[L.x,L.y,0,1],m);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?q*=re[3]/h.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(q*=h.cameraToCenterDistance/re[3]),Bp(I,Z,q))return!0}return!1}},heatmap:class extends mr{constructor(i){super(i,Gp),this._updateColorRamp()}createBucket(i){return new _u(i)}_handleSpecialPaintPropertyUpdate(i){i==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=xu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends mr{constructor(i){super(i,qp)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends mr{constructor(i){super(i,sd)}recalculate(i,e){super.recalculate(i,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(i){return new uc(i)}queryRadius(){return Ya(this.paint.get("fill-translate"))}queryIntersectsFeature(i,e,r,o,c,h,d){return lu(Qa(i,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),h.angle,d),o)}isTileClipped(){return!0}},"fill-extrusion":class extends mr{constructor(i){super(i,vd)}createBucket(i){return new pc(i)}queryRadius(){return Ya(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,e,r,o,c,h,d,m){const g=Qa(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),h.angle,d),x=this.paint.get("fill-extrusion-height").evaluate(e,r),T=this.paint.get("fill-extrusion-base").evaluate(e,r),I=function(D,L,Z,q){const re=[];for(const ce of D){const Q=[ce.x,ce.y,0,1];el(Q,Q,L),re.push(new Xe(Q[0]/Q[3],Q[1]/Q[3]))}return re}(g,m),P=function(D,L,Z,q){const re=[],ce=[],Q=q[8]*L,ae=q[9]*L,xe=q[10]*L,ye=q[11]*L,Fe=q[8]*Z,Ne=q[9]*Z,ke=q[10]*Z,Ae=q[11]*Z;for(const Ee of D){const De=[],Pe=[];for(const we of Ee){const He=we.x,je=we.y,ht=q[0]*He+q[4]*je+q[12],Ot=q[1]*He+q[5]*je+q[13],qt=q[2]*He+q[6]*je+q[14],ni=q[3]*He+q[7]*je+q[15],ar=qt+xe,yi=ni+ye,ei=ht+Fe,ui=Ot+Ne,xi=qt+ke,Ei=ni+Ae,Gi=new Xe((ht+Q)/yi,(Ot+ae)/yi);Gi.z=ar/yi,De.push(Gi);const ti=new Xe(ei/Ei,ui/Ei);ti.z=xi/Ei,Pe.push(ti)}re.push(De),ce.push(Pe)}return[re,ce]}(o,T,x,m);return function(D,L,Z){let q=1/0;lu(Z,L)&&(q=Au(Z,L[0]));for(let re=0;re<L.length;re++){const ce=L[re],Q=D[re];for(let ae=0;ae<ce.length-1;ae++){const xe=ce[ae],ye=[xe,ce[ae+1],Q[ae+1],Q[ae],xe];au(Z,ye)&&(q=Math.min(q,Au(Z,ye)))}}return q!==1/0&&q}(P[0],P[1],I)}},line:class extends mr{constructor(i){super(i,Pu),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(i){i==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Yn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(i,e){super.recalculate(i,e),this.paint._values["line-floorwidth"]=zu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,i)}createBucket(i){return new dc(i)}queryRadius(i){const e=i,r=ku(Ns("line-width",this,e),Ns("line-gap-width",this,e)),o=Ns("line-offset",this,e);return r/2+Math.abs(o)+Ya(this.paint.get("line-translate"))}queryIntersectsFeature(i,e,r,o,c,h,d){const m=Qa(i,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),h.angle,d),g=d/2*ku(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),x=this.paint.get("line-offset").evaluate(e,r);return x&&(o=function(T,I){const P=[];for(let D=0;D<T.length;D++){const L=T[D],Z=[];for(let q=0;q<L.length;q++){const re=L[q-1],ce=L[q],Q=L[q+1],ae=q===0?new Xe(0,0):ce.sub(re)._unit()._perp(),xe=q===L.length-1?new Xe(0,0):Q.sub(ce)._unit()._perp(),ye=ae._add(xe)._unit(),Fe=ye.x*xe.x+ye.y*xe.y;Fe!==0&&ye._mult(1/Fe),Z.push(ye._mult(I)._add(ce))}P.push(Z)}return P}(o,x*d)),function(T,I,P){for(let D=0;D<I.length;D++){const L=I[D];if(T.length>=3){for(let Z=0;Z<L.length;Z++)if(Jo(T,L[Z]))return!0}if(Fp(T,L,P))return!0}return!1}(m,o,g)}isTileClipped(){return!0}},symbol:ml,background:class extends mr{constructor(i){super(i,lf)}},raster:class extends mr{constructor(i){super(i,cf)}}};class pf{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel!="undefined"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const sh=63710088e-1;class Wt{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Wt(qe(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,o=this.lat*r,c=e.lat*r,h=Math.sin(o)*Math.sin(c)+Math.cos(o)*Math.cos(c)*Math.cos((e.lng-this.lng)*r);return sh*Math.acos(Math.min(h,1))}toBounds(e=0){const r=360*e/40075017,o=r/Math.cos(Math.PI/180*this.lat);return new Eo(new Wt(this.lng-o,this.lat-r),new Wt(this.lng+o,this.lat+r))}static convert(e){if(e instanceof Wt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Wt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Wt(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class Eo{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Wt?new Wt(e.lng,e.lat):Wt.convert(e),this}setSouthWest(e){return this._sw=e instanceof Wt?new Wt(e.lng,e.lat):Wt.convert(e),this}extend(e){const r=this._sw,o=this._ne;let c,h;if(e instanceof Wt)c=e,h=e;else{if(!(e instanceof Eo))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Eo.convert(e)):this.extend(Wt.convert(e)):this;if(c=e._sw,h=e._ne,!c||!h)return this}return r||o?(r.lng=Math.min(c.lng,r.lng),r.lat=Math.min(c.lat,r.lat),o.lng=Math.max(h.lng,o.lng),o.lat=Math.max(h.lat,o.lat)):(this._sw=new Wt(c.lng,c.lat),this._ne=new Wt(h.lng,h.lat)),this}getCenter(){return new Wt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Wt(this.getWest(),this.getNorth())}getSouthEast(){return new Wt(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:r,lat:o}=Wt.convert(e);let c=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&c}static convert(e){return e instanceof Eo?e:e&&new Eo(e)}}const ah=2*Math.PI*sh;function lh(i){return ah*Math.cos(i*Math.PI/180)}function ch(i){return(180+i)/360}function uh(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function hh(i,e){return i/lh(e)}function Ic(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class gl{constructor(e,r,o=0){this.x=+e,this.y=+r,this.z=+o}static fromLngLat(e,r=0){const o=Wt.convert(e);return new gl(ch(o.lng),uh(o.lat),hh(r,o.lat))}toLngLat(){return new Wt(360*this.x-180,Ic(this.y))}toAltitude(){return this.z*lh(Ic(this.y))}meterInMercatorCoordinateUnits(){return 1/ah*(e=Ic(this.y),1/Math.cos(e*Math.PI/180));var e}}function ph(i,e,r){var o=2*Math.PI*6378137/256/Math.pow(2,r);return[i*o-2*Math.PI*6378137/2,e*o-2*Math.PI*6378137/2]}class Cc{constructor(e,r,o){if(e<0||e>25||o<0||o>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${o}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=o,this.key=Qs(0,e,e,r,o)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,o){const c=(d=this.y,m=this.z,g=ph(256*(h=this.x),256*(d=Math.pow(2,m)-d-1),m),x=ph(256*(h+1),256*(d+1),m),g[0]+","+g[1]+","+x[0]+","+x[1]);var h,d,m,g,x;const T=function(I,P,D){let L,Z="";for(let q=I;q>0;q--)L=1<<q-1,Z+=(P&L?1:0)+(D&L?2:0);return Z}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(o==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,T).replace(/{bbox-epsg-3857}/g,c)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new Xe((e.x*r-this.x)*ri,(e.y*r-this.y)*ri)}toString(){return`${this.z}/${this.x}/${this.y}`}}class dh{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Qs(e,r.z,r.z,r.x,r.y)}}class sr{constructor(e,r,o,c,h){if(e<o)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${o}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Cc(o,+c,+h),this.key=Qs(r,e,o,c,h)}clone(){return new sr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new sr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new sr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const o=this.canonical.z-e;return e>this.canonical.z?Qs(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Qs(this.wrap*+r,e,e,this.canonical.x>>o,this.canonical.y>>o)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new sr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,o=2*this.canonical.x,c=2*this.canonical.y;return[new sr(r,this.wrap,r,o,c),new sr(r,this.wrap,r,o+1,c),new sr(r,this.wrap,r,o,c+1),new sr(r,this.wrap,r,o+1,c+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new sr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new sr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new dh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new gl(e.x-this.wrap,e.y))}}function Qs(i,e,r,o,c){(i*=2)<0&&(i=-1*i-1);const h=1<<r;return(h*h*i+h*c+o).toString(36)+r.toString(36)+e.toString(36)}Oe("CanonicalTileID",Cc),Oe("OverscaledTileID",sr,{omit:["posMatrix"]});class fh{constructor(e,r,o){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(o&&o!=="mapbox"&&o!=="terrarium")return void at(`"${o}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=r.height;const c=this.dim=r.height-2;this.data=new Uint32Array(r.data.buffer),this.encoding=o||"mapbox";for(let h=0;h<c;h++)this.data[this._idx(-1,h)]=this.data[this._idx(0,h)],this.data[this._idx(c,h)]=this.data[this._idx(c-1,h)],this.data[this._idx(h,-1)]=this.data[this._idx(h,0)],this.data[this._idx(h,c)]=this.data[this._idx(h,c-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(c,-1)]=this.data[this._idx(c-1,0)],this.data[this._idx(-1,c)]=this.data[this._idx(0,c-1)],this.data[this._idx(c,c)]=this.data[this._idx(c-1,c-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let h=0;h<c;h++)for(let d=0;d<c;d++){const m=this.get(h,d);m>this.max&&(this.max=m),m<this.min&&(this.min=m)}}get(e,r){const o=new Uint8Array(this.data.buffer),c=4*this._idx(e,r);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(o[c],o[c+1],o[c+2])}getUnpackVector(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}_unpackMapbox(e,r,o){return(256*e*256+256*r+o)/10-1e4}_unpackTerrarium(e,r,o){return 256*e+r+o/256-32768}getPixels(){return new or({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let c=r*this.dim,h=r*this.dim+this.dim,d=o*this.dim,m=o*this.dim+this.dim;switch(r){case-1:c=h-1;break;case 1:h=c+1}switch(o){case-1:d=m-1;break;case 1:m=d+1}const g=-r*this.dim,x=-o*this.dim;for(let T=d;T<m;T++)for(let I=c;I<h;I++)this.data[this._idx(I,T)]=e.data[this._idx(I+g,T+x)]}}Oe("DEMData",fh);class mh{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const o=e[r];this._stringToNumber[o]=r,this._numberToString[r]=o}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class gh{constructor(e,r,o,c,h){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=o,e._y=c,this.properties=e.properties,this.id=h}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class _h{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new go(ri,16,0),this.grid3D=new go(ri,16,0),this.featureIndexArray=new ut,this.promoteId=r}insert(e,r,o,c,h,d){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,c,h);const g=d?this.grid3D:this.grid;for(let x=0;x<r.length;x++){const T=r[x],I=[1/0,1/0,-1/0,-1/0];for(let P=0;P<T.length;P++){const D=T[P];I[0]=Math.min(I[0],D.x),I[1]=Math.min(I[1],D.y),I[2]=Math.max(I[2],D.x),I[3]=Math.max(I[3],D.y)}I[0]<ri&&I[1]<ri&&I[2]>=0&&I[3]>=0&&g.insert(m,I[0],I[1],I[2],I[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Un.VectorTile(new fc(this.rawTileData)).layers,this.sourceLayerCoder=new mh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,o,c){this.loadVTLayers();const h=e.params||{},d=ri/e.tileSize/e.scale,m=Go(h.filter),g=e.queryGeometry,x=e.queryPadding*d,T=xh(g),I=this.grid.query(T.minX-x,T.minY-x,T.maxX+x,T.maxY+x),P=xh(e.cameraQueryGeometry),D=this.grid3D.query(P.minX-x,P.minY-x,P.maxX+x,P.maxY+x,(q,re,ce,Q)=>function(ae,xe,ye,Fe,Ne){for(const Ae of ae)if(xe<=Ae.x&&ye<=Ae.y&&Fe>=Ae.x&&Ne>=Ae.y)return!0;const ke=[new Xe(xe,ye),new Xe(xe,Ne),new Xe(Fe,Ne),new Xe(Fe,ye)];if(ae.length>2){for(const Ae of ke)if(Jo(ae,Ae))return!0}for(let Ae=0;Ae<ae.length-1;Ae++)if($p(ae[Ae],ae[Ae+1],ke))return!0;return!1}(e.cameraQueryGeometry,q-x,re-x,ce+x,Q+x));for(const q of D)I.push(q);I.sort(df);const L={};let Z;for(let q=0;q<I.length;q++){const re=I[q];if(re===Z)continue;Z=re;const ce=this.featureIndexArray.get(re);let Q=null;this.loadMatchingFeature(L,ce.bucketIndex,ce.sourceLayerIndex,ce.featureIndex,m,h.layers,h.availableImages,r,o,c,(ae,xe,ye)=>(Q||(Q=bo(ae)),xe.queryIntersectsFeature(g,ae,ye,Q,this.z,e.transform,d,e.pixelPosMatrix)))}return L}loadMatchingFeature(e,r,o,c,h,d,m,g,x,T,I){const P=this.bucketLayerIDs[r];if(d&&!function(q,re){for(let ce=0;ce<q.length;ce++)if(re.indexOf(q[ce])>=0)return!0;return!1}(d,P))return;const D=this.sourceLayerCoder.decode(o),L=this.vtLayers[D].feature(c);if(h.needGeometry){const q=wo(L,!0);if(!h.filter(new Nt(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!h.filter(new Nt(this.tileID.overscaledZ),L))return;const Z=this.getId(L,D);for(let q=0;q<P.length;q++){const re=P[q];if(d&&d.indexOf(re)<0)continue;const ce=g[re];if(!ce)continue;let Q={};Z&&T&&(Q=T.getState(ce.sourceLayer||"_geojsonTileLayer",Z));const ae=Ue({},x[re]);ae.paint=yh(ae.paint,ce.paint,L,Q,m),ae.layout=yh(ae.layout,ce.layout,L,Q,m);const xe=!I||I(L,ce,Q);if(!xe)continue;const ye=new gh(L,this.z,this.x,this.y,Z);ye.layer=ae;let Fe=e[re];Fe===void 0&&(Fe=e[re]=[]),Fe.push({featureIndex:c,feature:ye,intersectionZ:xe})}}lookupSymbolFeatures(e,r,o,c,h,d,m,g){const x={};this.loadVTLayers();const T=Go(h);for(const I of e)this.loadMatchingFeature(x,o,c,I,T,d,m,g,r);return x}hasLayer(e){for(const r of this.bucketLayerIDs)for(const o of r)if(e===o)return!0;return!1}getId(e,r){let o=e.id;return this.promoteId&&(o=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[r]],typeof o=="boolean"&&(o=Number(o))),o}}function yh(i,e,r,o,c){return Ye(i,(h,d)=>{const m=e instanceof xo?e.get(d):null;return m&&m.evaluate?m.evaluate(r,o,c):m})}function xh(i){let e=1/0,r=1/0,o=-1/0,c=-1/0;for(const h of i)e=Math.min(e,h.x),r=Math.min(r,h.y),o=Math.max(o,h.x),c=Math.max(c,h.y);return{minX:e,minY:r,maxX:o,maxY:c}}function df(i,e){return e-i}var Ac;Oe("FeatureIndex",_h,{omit:["rawTileData","sourceLayerCoder"]}),a.PerformanceMarkers=void 0,(Ac=a.PerformanceMarkers||(a.PerformanceMarkers={})).create="create",Ac.load="load",Ac.fullLoad="fullLoad";let _l=null,ea=[];const Mc=1e3/30,ff={mark(i){performance.mark(i)},frame(i){const e=i;_l!=null&&ea.push(e-_l),_l=e},clearMetrics(){_l=null,ea=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const i in a.PerformanceMarkers)performance.clearMarks(a.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure("loadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.load),performance.measure("fullLoadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.fullLoad);const i=performance.getEntriesByName("loadTime")[0].duration,e=performance.getEntriesByName("fullLoadTime")[0].duration,r=ea.length,o=1/(ea.reduce((h,d)=>h+d,0)/r/1e3),c=ea.filter(h=>h>Mc).reduce((h,d)=>h+(d-Mc)/Mc,0);return{loadTime:i,fullLoadTime:e,fps:o,percentDroppedFrames:c/(r+c)*100}}};a.AJAXError=Fi,a.ARRAY_TYPE=Di,a.Actor=class{constructor(i,e,r){this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},tt(["receive","process"],this),this.invoker=new pf(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Jt()?i:window}send(i,e,r,o,c=!1){const h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);const d=Rt(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:i,hasCallback:!!r,targetMapId:o,mustQueue:c,sourceMapId:this.mapId,data:on(e,d)},d),{cancel:()=>{r&&delete this.callbacks[h],this.target.postMessage({id:h,type:"<cancel>",targetMapId:o,sourceMapId:this.mapId})}}}receive(i){const e=i.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type==="<cancel>"){delete this.tasks[r];const o=this.cancelCallbacks[r];delete this.cancelCallbacks[r],o&&o()}else Jt()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(!this.taskQueue.length)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){if(e.type==="<response>"){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Nr(e.error)):r(null,Nr(e.data)))}else{let r=!1;const o=Rt(this.globalScope)?void 0:[],c=e.hasCallback?(m,g)=>{r=!0,delete this.cancelCallbacks[i],this.target.postMessage({id:i,type:"<response>",sourceMapId:this.mapId,error:m?on(m):null,data:on(g,o)},o)}:m=>{r=!0};let h=null;const d=Nr(e.data);if(this.parent[e.type])h=this.parent[e.type](e.sourceMapId,d,c);else if(this.parent.getWorkerSource){const m=e.type.split(".");h=this.parent.getWorkerSource(e.sourceMapId,m[0],d.source)[m[1]](d,c)}else c(new Error(`Could not find function ${e.type}`));!r&&h&&h.cancel&&(this.cancelCallbacks[i]=h.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.AlphaImage=qs,a.CanonicalTileID=Cc,a.CollisionBoxArray=me,a.CollisionCircleLayoutArray=class extends S{},a.Color=B,a.DEMData=fh,a.DataConstantProperty=Ze,a.DictionaryCoder=mh,a.EXTENT=ri,a.ErrorEvent=wn,a.EvaluationParameters=Nt,a.Event=Tr,a.Evented=Er,a.FeatureIndex=_h,a.FillBucket=uc,a.FillExtrusionBucket=pc,a.GeoJSONFeature=gh,a.ImageAtlas=Vu,a.ImagePosition=gc,a.LineBucket=dc,a.LineStripIndexArray=class extends G{},a.LngLat=Wt,a.LngLatBounds=Eo,a.MercatorCoordinate=gl,a.ONE_EM=gi,a.OverscaledTileID=sr,a.PerformanceUtils=ff,a.PosArray=We,a.Properties=mi,a.QuadTriangleArray=class extends k{},a.RGBAImage=or,a.RasterBoundsArray=class extends l{},a.RequestPerformance=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},a.ResourceType=br,a.SegmentVector=pt,a.SymbolBucket=ns,a.Transitionable=ja,a.TriangleIndexArray=zi,a.Uniform1f=cn,a.Uniform1i=class extends ln{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},a.Uniform2f=class extends ln{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},a.Uniform3f=class extends ln{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},a.Uniform4f=Ho,a.UniformColor=ru,a.UniformMatrix4f=class extends ln{constructor(i,e){super(i,e),this.current=Lp}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},a.UnwrappedTileID=dh,a.ValidationError=Me,a.ZoomHistory=Ms,a.add=function(i,e,r){return i[0]=e[0]+r[0],i[1]=e[1]+r[1],i[2]=e[2]+r[2],i},a.addDynamicAttributes=bc,a.asyncAll=function(i,e,r){if(!i.length)return r(null,[]);let o=i.length;const c=new Array(i.length);let h=null;i.forEach((d,m)=>{e(d,(g,x)=>{g&&(h=g),c[m]=x,--o==0&&r(h,c)})})},a.bezier=fe,a.bindAll=tt,a.cacheEntryPossiblyAdded=function(i){hr++,hr>_n&&(i.getActor().send("enforceCacheSizeLimit",gn),hr=0)},a.clamp=ie,a.clearTileCache=function(i){const e=caches.delete(Ci);i&&e.catch(i).then(()=>i())},a.clipLine=Qu,a.clone=function(i){var e=new Di(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},a.clone$1=dt,a.clone$2=function(i){var e=new Di(3);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e},a.collisionCircleLayout=zd,a.config=wi,a.copy=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},a.create=function(){var i=new Di(16);return Di!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},a.create$1=hu,a.createExpression=no,a.createFilter=Go,a.createLayout=Qt,a.createStyleLayer=function(i){return i.type==="custom"?new uf(i):new hf[i.type](i)},a.cross=function(i,e,r){var o=e[0],c=e[1],h=e[2],d=r[0],m=r[1],g=r[2];return i[0]=c*g-h*m,i[1]=h*d-o*g,i[2]=o*m-c*d,i},a.dot=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]},a.dot$1=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},a.ease=ue,a.emitValidationErrors=Zo,a.enforceCacheSizeLimit=function(i){yn(),Ai&&Ai.then(e=>{e.keys().then(r=>{for(let o=0;o<r.length-i;o++)e.delete(r[o])})})},a.equals=function(i,e){var r=i[0],o=i[1],c=i[2],h=i[3],d=i[4],m=i[5],g=i[6],x=i[7],T=i[8],I=i[9],P=i[10],D=i[11],L=i[12],Z=i[13],q=i[14],re=i[15],ce=e[0],Q=e[1],ae=e[2],xe=e[3],ye=e[4],Fe=e[5],Ne=e[6],ke=e[7],Ae=e[8],Ee=e[9],De=e[10],Pe=e[11],we=e[12],He=e[13],je=e[14],ht=e[15];return Math.abs(r-ce)<=ki*Math.max(1,Math.abs(r),Math.abs(ce))&&Math.abs(o-Q)<=ki*Math.max(1,Math.abs(o),Math.abs(Q))&&Math.abs(c-ae)<=ki*Math.max(1,Math.abs(c),Math.abs(ae))&&Math.abs(h-xe)<=ki*Math.max(1,Math.abs(h),Math.abs(xe))&&Math.abs(d-ye)<=ki*Math.max(1,Math.abs(d),Math.abs(ye))&&Math.abs(m-Fe)<=ki*Math.max(1,Math.abs(m),Math.abs(Fe))&&Math.abs(g-Ne)<=ki*Math.max(1,Math.abs(g),Math.abs(Ne))&&Math.abs(x-ke)<=ki*Math.max(1,Math.abs(x),Math.abs(ke))&&Math.abs(T-Ae)<=ki*Math.max(1,Math.abs(T),Math.abs(Ae))&&Math.abs(I-Ee)<=ki*Math.max(1,Math.abs(I),Math.abs(Ee))&&Math.abs(P-De)<=ki*Math.max(1,Math.abs(P),Math.abs(De))&&Math.abs(D-Pe)<=ki*Math.max(1,Math.abs(D),Math.abs(Pe))&&Math.abs(L-we)<=ki*Math.max(1,Math.abs(L),Math.abs(we))&&Math.abs(Z-He)<=ki*Math.max(1,Math.abs(Z),Math.abs(He))&&Math.abs(q-je)<=ki*Math.max(1,Math.abs(q),Math.abs(je))&&Math.abs(re-ht)<=ki*Math.max(1,Math.abs(re),Math.abs(ht))},a.evaluateSizeForFeature=function(i,{uSize:e,uSizeT:r},{lowerSize:o,upperSize:c}){return i.kind==="source"?o/pn:i.kind==="composite"?Ut(o/pn,c/pn,r):e},a.evaluateSizeForZoom=function(i,e){let r=0,o=0;if(i.kind==="constant")o=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:c,minZoom:h,maxZoom:d}=i,m=c?ie(Ui.interpolationFactor(c,e,h,d),0,1):0;i.kind==="camera"?o=Ut(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:o}},a.evaluateVariableOffset=ih,a.evented=Bs,a.exported=di,a.exported$1=Dr,a.extend=Ue,a.filterObject=Qe,a.fromRotation=function(i,e){var r=Math.sin(e),o=Math.cos(e);return i[0]=o,i[1]=r,i[2]=0,i[3]=-r,i[4]=o,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i},a.fromScaling=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},a.getAnchorAlignment=yc,a.getAnchorJustification=vc,a.getArrayBuffer=bn,a.getImage=Or,a.getJSON=function(i,e){return vn(Ue(i,{type:"json"}),e)},a.getOverlapMode=Sc,a.getRTLTextPluginStatus=_o,a.getReferrer=Xn,a.getVideo=function(i,e){const r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(let o=0;o<i.length;o++){const c=window.document.createElement("source");Wn(i[o])||(r.crossOrigin="Anonymous"),c.src=i[o],r.appendChild(c)}return{cancel:()=>{}}},a.identity=tc,a.invert=function(i,e){var r=e[0],o=e[1],c=e[2],h=e[3],d=e[4],m=e[5],g=e[6],x=e[7],T=e[8],I=e[9],P=e[10],D=e[11],L=e[12],Z=e[13],q=e[14],re=e[15],ce=r*m-o*d,Q=r*g-c*d,ae=r*x-h*d,xe=o*g-c*m,ye=o*x-h*m,Fe=c*x-h*g,Ne=T*Z-I*L,ke=T*q-P*L,Ae=T*re-D*L,Ee=I*q-P*Z,De=I*re-D*Z,Pe=P*re-D*q,we=ce*Pe-Q*De+ae*Ee+xe*Ae-ye*ke+Fe*Ne;return we?(i[0]=(m*Pe-g*De+x*Ee)*(we=1/we),i[1]=(c*De-o*Pe-h*Ee)*we,i[2]=(Z*Fe-q*ye+re*xe)*we,i[3]=(P*ye-I*Fe-D*xe)*we,i[4]=(g*Ae-d*Pe-x*ke)*we,i[5]=(r*Pe-c*Ae+h*ke)*we,i[6]=(q*ae-L*Fe-re*Q)*we,i[7]=(T*Fe-P*ae+D*Q)*we,i[8]=(d*De-m*Ae+x*Ne)*we,i[9]=(o*Ae-r*De-h*Ne)*we,i[10]=(L*ye-Z*ae+re*ce)*we,i[11]=(I*ae-T*ye-D*ce)*we,i[12]=(m*ke-d*Ee-g*Ne)*we,i[13]=(r*Ee-o*ke+c*Ne)*we,i[14]=(Z*Q-L*xe-q*ce)*we,i[15]=(T*xe-I*Q+P*ce)*we,i):null},a.isImageBitmap=pi,a.isSafari=Rt,a.isWorker=Jt,a.keysDifference=function(i,e){const r=[];for(const o in i)o in e||r.push(o);return r},a.lazyLoadRTLTextPlugin=function(){Ji.isLoading()||Ji.isLoaded()||_o()!=="deferred"||Za()},a.makeRequest=vn,a.mapObject=Ye,a.mercatorXfromLng=ch,a.mercatorYfromLat=uh,a.mercatorZfromAltitude=hh,a.mul=Np,a.mul$1=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},a.multiply=pu,a.nextPowerOfTwo=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},a.normalize=function(i,e){var r=e[0],o=e[1],c=e[2],h=r*r+o*o+c*c;return h>0&&(h=1/Math.sqrt(h)),i[0]=e[0]*h,i[1]=e[1]*h,i[2]=e[2]*h,i},a.number=Ut,a.ortho=function(i,e,r,o,c,h,d){var m=1/(e-r),g=1/(o-c),x=1/(h-d);return i[0]=-2*m,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*g,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*x,i[11]=0,i[12]=(e+r)*m,i[13]=(c+o)*g,i[14]=(d+h)*x,i[15]=1,i},a.parseCacheControl=vr,a.parseGlyphPbf=function(i){return new fc(i).readFields(Nd,[])},a.pbf=fc,a.performSymbolLayout=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=ri/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0].layout,r=i.bucket.layers[0]._unevaluatedLayout._values,o={layoutIconSize:r["icon-size"].possiblyEvaluate(new Nt(i.bucket.zoom+1),i.canonical),layoutTextSize:r["text-size"].possiblyEvaluate(new Nt(i.bucket.zoom+1),i.canonical),textMaxSize:r["text-size"].possiblyEvaluate(new Nt(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:g,maxZoom:x}=i.bucket.textSizeData;o.compositeTextSizes=[r["text-size"].possiblyEvaluate(new Nt(g),i.canonical),r["text-size"].possiblyEvaluate(new Nt(x),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:g,maxZoom:x}=i.bucket.iconSizeData;o.compositeIconSizes=[r["icon-size"].possiblyEvaluate(new Nt(g),i.canonical),r["icon-size"].possiblyEvaluate(new Nt(x),i.canonical)]}const c=e.get("text-line-height")*gi,h=e.get("text-rotation-alignment")!=="viewport"&&e.get("symbol-placement")!=="point",d=e.get("text-keep-upright"),m=e.get("text-size");for(const g of i.bucket.features){const x=e.get("text-font").evaluate(g,{},i.canonical).join(","),T=m.evaluate(g,{},i.canonical),I=o.layoutTextSize.evaluate(g,{},i.canonical),P=o.layoutIconSize.evaluate(g,{},i.canonical),D={horizontal:{},vertical:void 0},L=g.text;let Z,q=[0,0];if(L){const Q=L.toString(),ae=e.get("text-letter-spacing").evaluate(g,{},i.canonical)*gi,xe=Xl(Q)?ae:0,ye=e.get("text-anchor").evaluate(g,{},i.canonical),Fe=e.get("text-variable-anchor");if(!Fe){const De=e.get("text-radial-offset").evaluate(g,{},i.canonical);q=De?ih(ye,[De*gi,xc]):e.get("text-offset").evaluate(g,{},i.canonical).map(Pe=>Pe*gi)}let Ne=h?"center":e.get("text-justify").evaluate(g,{},i.canonical);const ke=e.get("symbol-placement"),Ae=ke==="point"?e.get("text-max-width").evaluate(g,{},i.canonical)*gi:0,Ee=()=>{i.bucket.allowVerticalPlacement&&jo(Q)&&(D.vertical=ll(L,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,ye,"left",xe,q,a.WritingMode.vertical,!0,ke,I,T))};if(!h&&Fe){const De=Ne==="auto"?Fe.map(we=>vc(we)):[Ne];let Pe=!1;for(let we=0;we<De.length;we++){const He=De[we];if(!D.horizontal[He])if(Pe)D.horizontal[He]=D.horizontal[0];else{const je=ll(L,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,"center",He,xe,q,a.WritingMode.horizontal,!1,ke,I,T);je&&(D.horizontal[He]=je,Pe=je.positionedLines.length===1)}}Ee()}else{Ne==="auto"&&(Ne=vc(ye));const De=ll(L,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,ye,Ne,xe,q,a.WritingMode.horizontal,!1,ke,I,T);De&&(D.horizontal[Ne]=De),Ee(),jo(Q)&&h&&d&&(D.vertical=ll(L,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,ye,Ne,xe,q,a.WritingMode.vertical,!1,ke,I,T))}}let re=!1;if(g.icon&&g.icon.name){const Q=i.imageMap[g.icon.name];Q&&(Z=Wd(i.imagePositions[g.icon.name],e.get("icon-offset").evaluate(g,{},i.canonical),e.get("icon-anchor").evaluate(g,{},i.canonical)),re=!!Q.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=re:i.bucket.sdfIcons!==re&&at("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Q.pixelRatio!==i.bucket.pixelRatio||e.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const ce=nh(D.horizontal)||D.vertical;i.bucket.iconsInText=!!ce&&ce.iconsInText,(ce||Z)&&tf(i.bucket,g,D,Z,i.imageMap,o,I,P,q,re,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},a.perspective=function(i,e,r,o,c){var h,d=1/Math.tan(e/2);return i[0]=d/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,c!=null&&c!==1/0?(i[10]=(c+o)*(h=1/(o-c)),i[14]=2*c*o*h):(i[10]=-1,i[14]=-2*o),i},a.pick=function(i,e){const r={};for(let o=0;o<e.length;o++){const c=e[o];c in i&&(r[c]=i[c])}return r},a.plugin=Ji,a.pointGeometry=Xe,a.polygonIntersectsPolygon=au,a.potpack=Uu,a.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],a.register=Oe,a.registerForPluginStateChange=function(i){return i({pluginStatus:Pi,pluginURL:Gr}),Bs.on("pluginStateChange",i),i},a.renderColorRamp=xu,a.rotateX=function(i,e,r){var o=Math.sin(r),c=Math.cos(r),h=e[4],d=e[5],m=e[6],g=e[7],x=e[8],T=e[9],I=e[10],P=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=h*c+x*o,i[5]=d*c+T*o,i[6]=m*c+I*o,i[7]=g*c+P*o,i[8]=x*c-h*o,i[9]=T*c-d*o,i[10]=I*c-m*o,i[11]=P*c-g*o,i},a.rotateZ=function(i,e,r){var o=Math.sin(r),c=Math.cos(r),h=e[0],d=e[1],m=e[2],g=e[3],x=e[4],T=e[5],I=e[6],P=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=h*c+x*o,i[1]=d*c+T*o,i[2]=m*c+I*o,i[3]=g*c+P*o,i[4]=x*c-h*o,i[5]=T*c-d*o,i[6]=I*c-m*o,i[7]=P*c-g*o,i},a.scale=function(i,e,r){var o=r[0],c=r[1],h=r[2];return i[0]=e[0]*o,i[1]=e[1]*o,i[2]=e[2]*o,i[3]=e[3]*o,i[4]=e[4]*c,i[5]=e[5]*c,i[6]=e[6]*c,i[7]=e[7]*c,i[8]=e[8]*h,i[9]=e[9]*h,i[10]=e[10]*h,i[11]=e[11]*h,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},a.scale$1=function(i,e,r){return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i},a.setCacheLimits=function(i,e){gn=i,_n=e},a.setRTLTextPlugin=function(i,e,r=!1){if(Pi===ks||Pi===Ds||Pi===Ls)throw new Error("setRTLTextPlugin cannot be called multiple times.");Gr=di.resolveURL(i),Pi=ks,Rs=e,Bn(),r||Za()},a.spec=_e,a.sphericalToCartesian=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}},a.sqrLen=function(i){var e=i[0],r=i[1];return e*e+r*r},a.sub=function(i,e,r){return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],i},a.toEvaluationFeature=wo,a.transformMat3=function(i,e,r){var o=e[0],c=e[1],h=e[2];return i[0]=o*r[0]+c*r[3]+h*r[6],i[1]=o*r[1]+c*r[4]+h*r[7],i[2]=o*r[2]+c*r[5]+h*r[8],i},a.transformMat4=el,a.transformMat4$1=function(i,e,r){var o=e[0],c=e[1];return i[0]=r[0]*o+r[4]*c+r[12],i[1]=r[1]*o+r[5]*c+r[13],i},a.translate=function(i,e,r){var o,c,h,d,m,g,x,T,I,P,D,L,Z=r[0],q=r[1],re=r[2];return e===i?(i[12]=e[0]*Z+e[4]*q+e[8]*re+e[12],i[13]=e[1]*Z+e[5]*q+e[9]*re+e[13],i[14]=e[2]*Z+e[6]*q+e[10]*re+e[14],i[15]=e[3]*Z+e[7]*q+e[11]*re+e[15]):(c=e[1],h=e[2],d=e[3],m=e[4],g=e[5],x=e[6],T=e[7],I=e[8],P=e[9],D=e[10],L=e[11],i[0]=o=e[0],i[1]=c,i[2]=h,i[3]=d,i[4]=m,i[5]=g,i[6]=x,i[7]=T,i[8]=I,i[9]=P,i[10]=D,i[11]=L,i[12]=o*Z+m*q+I*re+e[12],i[13]=c*Z+g*q+P*re+e[13],i[14]=h*Z+x*q+D*re+e[14],i[15]=d*Z+T*q+L*re+e[15]),i},a.triggerPluginCompletionEvent=qa,a.unicodeBlockLookup=ze,a.uniqueId=function(){return $e++},a.validateCustomStyleLayer=function(i){const e=[],r=i.id;return r===void 0&&e.push({message:`layers.${r}: missing required property "id"`}),i.render===void 0&&e.push({message:`layers.${r}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},a.validateLight=As,a.validateStyle=mo,a.vectorTile=Un,a.warnOnce=at,a.wrap=qe}),N(["./shared"],function(a){function ee(O){const b=typeof O;if(b==="number"||b==="boolean"||b==="string"||O==null)return JSON.stringify(O);if(Array.isArray(O)){let B="[";for(const j of O)B+=`${ee(j)},`;return`${B}]`}const C=Object.keys(O).sort();let R="{";for(let B=0;B<C.length;B++)R+=`${JSON.stringify(C[B])}:${ee(O[C[B]])},`;return`${R}}`}function te(O){let b="";for(const C of a.refProperties)b+=`/${ee(O[C])}`;return b}class fe{constructor(b){this.keyCache={},b&&this.replace(b)}replace(b){this._layerConfigs={},this._layers={},this.update(b,[])}update(b,C){for(const B of b){this._layerConfigs[B.id]=B;const j=this._layers[B.id]=a.createStyleLayer(B);j._featureFilter=a.createFilter(j.filter),this.keyCache[B.id]&&delete this.keyCache[B.id]}for(const B of C)delete this.keyCache[B],delete this._layerConfigs[B],delete this._layers[B];this.familiesBySource={};const R=function(B,j){const K={};for(let X=0;X<B.length;X++){const J=j&&j[B[X].id]||te(B[X]);j&&(j[B[X].id]=J);let pe=K[J];pe||(pe=K[J]=[]),pe.push(B[X])}const W=[];for(const X in K)W.push(K[X]);return W}(Object.values(this._layerConfigs),this.keyCache);for(const B of R){const j=B.map(ve=>this._layers[ve.id]),K=j[0];if(K.visibility==="none")continue;const W=K.source||"";let X=this.familiesBySource[W];X||(X=this.familiesBySource[W]={});const J=K.sourceLayer||"_geojsonTileLayer";let pe=X[J];pe||(pe=X[J]=[]),pe.push(j)}}}class ue{constructor(b){const C={},R=[];for(const W in b){const X=b[W],J=C[W]={};for(const pe in X){const ve=X[+pe];if(!ve||ve.bitmap.width===0||ve.bitmap.height===0)continue;const he={x:0,y:0,w:ve.bitmap.width+2,h:ve.bitmap.height+2};R.push(he),J[pe]={rect:he,metrics:ve.metrics}}}const{w:B,h:j}=a.potpack(R),K=new a.AlphaImage({width:B||1,height:j||1});for(const W in b){const X=b[W];for(const J in X){const pe=X[+J];if(!pe||pe.bitmap.width===0||pe.bitmap.height===0)continue;const ve=C[W][J].rect;a.AlphaImage.copy(pe.bitmap,K,{x:0,y:0},{x:ve.x+1,y:ve.y+1},pe.bitmap)}}this.image=K,this.positions=C}}a.register("GlyphAtlas",ue);class ie{constructor(b){this.tileID=new a.OverscaledTileID(b.tileID.overscaledZ,b.tileID.wrap,b.tileID.canonical.z,b.tileID.canonical.x,b.tileID.canonical.y),this.uid=b.uid,this.zoom=b.zoom,this.pixelRatio=b.pixelRatio,this.tileSize=b.tileSize,this.source=b.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=b.showCollisionBoxes,this.collectResourceTiming=!!b.collectResourceTiming,this.returnDependencies=!!b.returnDependencies,this.promoteId=b.promoteId}parse(b,C,R,B,j){this.status="parsing",this.data=b,this.collisionBoxArray=new a.CollisionBoxArray;const K=new a.DictionaryCoder(Object.keys(b.layers).sort()),W=new a.FeatureIndex(this.tileID,this.promoteId);W.bucketLayerIDs=[];const X={},J={featureIndex:W,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:R},pe=C.familiesBySource[this.source];for(const it in pe){const ct=b.layers[it];if(!ct)continue;ct.version===1&&a.warnOnce(`Vector tile source "${this.source}" layer "${it}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const bt=K.encode(it),kt=[];for(let si=0;si<ct.length;si++){const $t=ct.feature(si),_i=W.getId($t,it);kt.push({feature:$t,id:_i,index:si,sourceLayerIndex:bt})}for(const si of pe[it]){const $t=si[0];$t.source!==this.source&&a.warnOnce(`layer.source = ${$t.source} does not equal this.source = ${this.source}`),$t.minzoom&&this.zoom<Math.floor($t.minzoom)||$t.maxzoom&&this.zoom>=$t.maxzoom||$t.visibility!=="none"&&(qe(si,this.zoom,R),(X[$t.id]=$t.createBucket({index:W.bucketLayerIDs.length,layers:si,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:bt,sourceID:this.source})).populate(kt,J,this.tileID.canonical),W.bucketLayerIDs.push(si.map(_i=>_i.id)))}}let ve,he,Ve,Ge;const Le=a.mapObject(J.glyphDependencies,it=>Object.keys(it).map(Number));Object.keys(Le).length?B.send("getGlyphs",{uid:this.uid,stacks:Le},(it,ct)=>{ve||(ve=it,he=ct,vt.call(this))}):he={};const Ke=Object.keys(J.iconDependencies);Ke.length?B.send("getImages",{icons:Ke,source:this.source,tileID:this.tileID,type:"icons"},(it,ct)=>{ve||(ve=it,Ve=ct,vt.call(this))}):Ve={};const et=Object.keys(J.patternDependencies);function vt(){if(ve)return j(ve);if(he&&Ve&&Ge){const it=new ue(he),ct=new a.ImageAtlas(Ve,Ge);for(const bt in X){const kt=X[bt];kt instanceof a.SymbolBucket?(qe(kt.layers,this.zoom,R),a.performSymbolLayout({bucket:kt,glyphMap:he,glyphPositions:it.positions,imageMap:Ve,imagePositions:ct.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):kt.hasPattern&&(kt instanceof a.LineBucket||kt instanceof a.FillBucket||kt instanceof a.FillExtrusionBucket)&&(qe(kt.layers,this.zoom,R),kt.addFeatures(J,this.tileID.canonical,ct.patternPositions))}this.status="done",j(null,{buckets:Object.values(X).filter(bt=>!bt.isEmpty()),featureIndex:W,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:it.image,imageAtlas:ct,glyphMap:this.returnDependencies?he:null,iconMap:this.returnDependencies?Ve:null,glyphPositions:this.returnDependencies?it.positions:null})}}et.length?B.send("getImages",{icons:et,source:this.source,tileID:this.tileID,type:"patterns"},(it,ct)=>{ve||(ve=it,Ge=ct,vt.call(this))}):Ge={},vt.call(this)}}function qe(O,b,C){const R=new a.EvaluationParameters(b);for(const B of O)B.recalculate(R,C)}function Ue(O,b){const C=a.getArrayBuffer(O.request,(R,B,j,K)=>{R?b(R):B&&b(null,{vectorTile:new a.vectorTile.VectorTile(new a.pbf(B)),rawData:B,cacheControl:j,expires:K})});return()=>{C.cancel(),b()}}class $e{constructor(b,C,R,B){this.actor=b,this.layerIndex=C,this.availableImages=R,this.loadVectorData=B||Ue,this.loading={},this.loaded={}}loadTile(b,C){const R=b.uid;this.loading||(this.loading={});const B=!!(b&&b.request&&b.request.collectResourceTiming)&&new a.RequestPerformance(b.request),j=this.loading[R]=new ie(b);j.abort=this.loadVectorData(b,(K,W)=>{if(delete this.loading[R],K||!W)return j.status="done",this.loaded[R]=j,C(K);const X=W.rawData,J={};W.expires&&(J.expires=W.expires),W.cacheControl&&(J.cacheControl=W.cacheControl);const pe={};if(B){const ve=B.finish();ve&&(pe.resourceTiming=JSON.parse(JSON.stringify(ve)))}j.vectorTile=W.vectorTile,j.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,(ve,he)=>{if(ve||!he)return C(ve);C(null,a.extend({rawTileData:X.slice(0)},he,J,pe))}),this.loaded=this.loaded||{},this.loaded[R]=j})}reloadTile(b,C){const R=this.loaded,B=b.uid,j=this;if(R&&R[B]){const K=R[B];K.showCollisionBoxes=b.showCollisionBoxes;const W=(X,J)=>{const pe=K.reloadCallback;pe&&(delete K.reloadCallback,K.parse(K.vectorTile,j.layerIndex,this.availableImages,j.actor,pe)),C(X,J)};K.status==="parsing"?K.reloadCallback=W:K.status==="done"&&(K.vectorTile?K.parse(K.vectorTile,this.layerIndex,this.availableImages,this.actor,W):W())}}abortTile(b,C){const R=this.loading,B=b.uid;R&&R[B]&&R[B].abort&&(R[B].abort(),delete R[B]),C()}removeTile(b,C){const R=this.loaded,B=b.uid;R&&R[B]&&delete R[B],C()}}class tt{constructor(){this.loaded={}}loadTile(b,C){const{uid:R,encoding:B,rawImageData:j}=b,K=a.isImageBitmap(j)?this.getImageData(j):j,W=new a.DEMData(R,K,B);this.loaded=this.loaded||{},this.loaded[R]=W,C(null,W)}getImageData(b){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(b.width,b.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=b.width,this.offscreenCanvas.height=b.height,this.offscreenCanvasContext.drawImage(b,0,0,b.width,b.height);const C=this.offscreenCanvasContext.getImageData(-1,-1,b.width+2,b.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new a.RGBAImage({width:C.width,height:C.height},C.data)}removeTile(b){const C=this.loaded,R=b.uid;C&&C[R]&&delete C[R]}}var Ye=function O(b,C){var R,B=b&&b.type;if(B==="FeatureCollection")for(R=0;R<b.features.length;R++)O(b.features[R],C);else if(B==="GeometryCollection")for(R=0;R<b.geometries.length;R++)O(b.geometries[R],C);else if(B==="Feature")O(b.geometry,C);else if(B==="Polygon")Qe(b.coordinates,C);else if(B==="MultiPolygon")for(R=0;R<b.coordinates.length;R++)Qe(b.coordinates[R],C);return b};function Qe(O,b){if(O.length!==0){dt(O[0],b);for(var C=1;C<O.length;C++)dt(O[C],!b)}}function dt(O,b){for(var C=0,R=0,B=0,j=O.length,K=j-1;B<j;K=B++){var W=(O[B][0]-O[K][0])*(O[K][1]+O[B][1]),X=C+W;R+=Math.abs(C)>=Math.abs(W)?C-X+W:W-X+C,C=X}C+R>=0!=!!b&&O.reverse()}const gt=a.vectorTile.VectorTileFeature.prototype.toGeoJSON;class at{constructor(b){this._feature=b,this.extent=a.EXTENT,this.type=b.type,this.properties=b.tags,"id"in b&&!isNaN(b.id)&&(this.id=parseInt(b.id,10))}loadGeometry(){if(this._feature.type===1){const b=[];for(const C of this._feature.geometry)b.push([new a.pointGeometry(C[0],C[1])]);return b}{const b=[];for(const C of this._feature.geometry){const R=[];for(const B of C)R.push(new a.pointGeometry(B[0],B[1]));b.push(R)}return b}}toGeoJSON(b,C,R){return gt.call(this,b,C,R)}}class Tt{constructor(b){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=a.EXTENT,this.length=b.length,this._features=b}feature(b){return new at(this._features[b])}}var Ht={exports:{}},Jt=a.pointGeometry,vr=a.vectorTile.VectorTileFeature,Wi=ur;function ur(O,b){this.options=b||{},this.features=O,this.length=O.length}function Hi(O,b){this.id=typeof O.id=="number"?O.id:void 0,this.type=O.type,this.rawGeometry=O.type===1?[O.geometry]:O.geometry,this.properties=O.tags,this.extent=b||4096}ur.prototype.feature=function(O){return new Hi(this.features[O],this.options.extent)},Hi.prototype.loadGeometry=function(){var O=this.rawGeometry;this.geometry=[];for(var b=0;b<O.length;b++){for(var C=O[b],R=[],B=0;B<C.length;B++)R.push(new Jt(C[B][0],C[B][1]));this.geometry.push(R)}return this.geometry},Hi.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var O=this.geometry,b=1/0,C=-1/0,R=1/0,B=-1/0,j=0;j<O.length;j++)for(var K=O[j],W=0;W<K.length;W++){var X=K[W];b=Math.min(b,X.x),C=Math.max(C,X.x),R=Math.min(R,X.y),B=Math.max(B,X.y)}return[b,R,C,B]},Hi.prototype.toGeoJSON=vr.prototype.toGeoJSON;var Rt=a.pbf,pi=Wi;function di(O){var b=new Rt;return function(C,R){for(var B in C.layers)R.writeMessage(3,Xe,C.layers[B])}(O,b),b.finish()}function Xe(O,b){var C;b.writeVarintField(15,O.version||1),b.writeStringField(1,O.name||""),b.writeVarintField(5,O.extent||4096);var R={keys:[],values:[],keycache:{},valuecache:{}};for(C=0;C<O.length;C++)R.feature=O.feature(C),b.writeMessage(2,Bi,R);var B=R.keys;for(C=0;C<B.length;C++)b.writeStringField(3,B[C]);var j=R.values;for(C=0;C<j.length;C++)b.writeMessage(4,gn,j[C])}function Bi(O,b){var C=O.feature;C.id!==void 0&&b.writeVarintField(1,C.id),b.writeMessage(2,wi,O),b.writeVarintField(3,C.type),b.writeMessage(4,Kr,C)}function wi(O,b){var C=O.feature,R=O.keys,B=O.values,j=O.keycache,K=O.valuecache;for(var W in C.properties){var X=C.properties[W],J=j[W];if(X!==null){J===void 0&&(R.push(W),j[W]=J=R.length-1),b.writeVarint(J);var pe=typeof X;pe!=="string"&&pe!=="boolean"&&pe!=="number"&&(X=JSON.stringify(X));var ve=pe+":"+X,he=K[ve];he===void 0&&(B.push(X),K[ve]=he=B.length-1),b.writeVarint(he)}}}function Ci(O,b){return(b<<3)+(7&O)}function Ai(O){return O<<1^O>>31}function Kr(O,b){for(var C=O.loadGeometry(),R=O.type,B=0,j=0,K=C.length,W=0;W<K;W++){var X=C[W],J=1;R===1&&(J=X.length),b.writeVarint(Ci(1,J));for(var pe=R===3?X.length-1:X.length,ve=0;ve<pe;ve++){ve===1&&R!==1&&b.writeVarint(Ci(2,pe-1));var he=X[ve].x-B,Ve=X[ve].y-j;b.writeVarint(Ai(he)),b.writeVarint(Ai(Ve)),B+=he,j+=Ve}R===3&&b.writeVarint(Ci(7,1))}}function gn(O,b){var C=typeof O;C==="string"?b.writeStringField(1,O):C==="boolean"?b.writeBooleanField(7,O):C==="number"&&(O%1!=0?b.writeDoubleField(3,O):O<0?b.writeSVarintField(6,O):b.writeVarintField(5,O))}function _n(O,b,C,R,B,j){if(B-R<=C)return;const K=R+B>>1;yn(O,b,K,R,B,j%2),_n(O,b,C,R,K-1,j+1),_n(O,b,C,K+1,B,j+1)}function yn(O,b,C,R,B,j){for(;B>R;){if(B-R>600){const J=B-R+1,pe=C-R+1,ve=Math.log(J),he=.5*Math.exp(2*ve/3),Ve=.5*Math.sqrt(ve*he*(J-he)/J)*(pe-J/2<0?-1:1);yn(O,b,C,Math.max(R,Math.floor(C-pe*he/J+Ve)),Math.min(B,Math.floor(C+(J-pe)*he/J+Ve)),j)}const K=b[2*C+j];let W=R,X=B;for(hr(O,b,R,C),b[2*B+j]>K&&hr(O,b,R,B);W<X;){for(hr(O,b,W,X),W++,X--;b[2*W+j]<K;)W++;for(;b[2*X+j]>K;)X--}b[2*R+j]===K?hr(O,b,R,X):(X++,hr(O,b,X,B)),X<=C&&(R=X+1),C<=X&&(B=X-1)}}function hr(O,b,C,R){Dr(O,C,R),Dr(b,2*C,2*R),Dr(b,2*C+1,2*R+1)}function Dr(O,b,C){const R=O[b];O[b]=O[C],O[C]=R}function Lr(O,b,C,R){const B=O-C,j=b-R;return B*B+j*j}Ht.exports=di,Ht.exports.fromVectorTileJs=di,Ht.exports.fromGeojsonVt=function(O,b){b=b||{};var C={};for(var R in O)C[R]=new pi(O[R].features,b),C[R].name=R,C[R].version=b.version,C[R].extent=b.extent;return di({layers:C})},Ht.exports.GeoJSONWrapper=pi;const Rr=O=>O[0],Mi=O=>O[1];class xn{constructor(b,C=Rr,R=Mi,B=64,j=Float64Array){this.nodeSize=B,this.points=b;const K=b.length<65536?Uint16Array:Uint32Array,W=this.ids=new K(b.length),X=this.coords=new j(2*b.length);for(let J=0;J<b.length;J++)W[J]=J,X[2*J]=C(b[J]),X[2*J+1]=R(b[J]);_n(W,X,B,0,W.length-1,0)}range(b,C,R,B){return function(j,K,W,X,J,pe,ve){const he=[0,j.length-1,0],Ve=[];let Ge,Le;for(;he.length;){const Ke=he.pop(),et=he.pop(),vt=he.pop();if(et-vt<=ve){for(let bt=vt;bt<=et;bt++)Ge=K[2*bt],Le=K[2*bt+1],Ge>=W&&Ge<=J&&Le>=X&&Le<=pe&&Ve.push(j[bt]);continue}const it=Math.floor((vt+et)/2);Ge=K[2*it],Le=K[2*it+1],Ge>=W&&Ge<=J&&Le>=X&&Le<=pe&&Ve.push(j[it]);const ct=(Ke+1)%2;(Ke===0?W<=Ge:X<=Le)&&(he.push(vt),he.push(it-1),he.push(ct)),(Ke===0?J>=Ge:pe>=Le)&&(he.push(it+1),he.push(et),he.push(ct))}return Ve}(this.ids,this.coords,b,C,R,B,this.nodeSize)}within(b,C,R){return function(B,j,K,W,X,J){const pe=[0,B.length-1,0],ve=[],he=X*X;for(;pe.length;){const Ve=pe.pop(),Ge=pe.pop(),Le=pe.pop();if(Ge-Le<=J){for(let ct=Le;ct<=Ge;ct++)Lr(j[2*ct],j[2*ct+1],K,W)<=he&&ve.push(B[ct]);continue}const Ke=Math.floor((Le+Ge)/2),et=j[2*Ke],vt=j[2*Ke+1];Lr(et,vt,K,W)<=he&&ve.push(B[Ke]);const it=(Ve+1)%2;(Ve===0?K-X<=et:W-X<=vt)&&(pe.push(Le),pe.push(Ke-1),pe.push(it)),(Ve===0?K+X>=et:W+X>=vt)&&(pe.push(Ke+1),pe.push(Ge),pe.push(it))}return ve}(this.ids,this.coords,b,C,R,this.nodeSize)}}const jn={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:O=>O},br=Math.fround||(Fi=new Float32Array(1),O=>(Fi[0]=+O,Fi[0]));var Fi;class Xn{constructor(b){this.options=Or(Object.create(jn),b),this.trees=new Array(this.options.maxZoom+1)}load(b){const{log:C,minZoom:R,maxZoom:B,nodeSize:j}=this.options;C&&console.time("total time");const K=`prepare ${b.length} points`;C&&console.time(K),this.points=b;let W=[];for(let X=0;X<b.length;X++)b[X].geometry&&W.push(vn(b[X],X));this.trees[B+1]=new xn(W,Hn,wr,j,Float32Array),C&&console.timeEnd(K);for(let X=B;X>=R;X--){const J=+Date.now();W=this._cluster(W,X),this.trees[X]=new xn(W,Hn,wr,j,Float32Array),C&&console.log("z%d: %d clusters in %dms",X,W.length,+Date.now()-J)}return C&&console.timeEnd("total time"),this}getClusters(b,C){let R=((b[0]+180)%360+360)%360-180;const B=Math.max(-90,Math.min(90,b[1]));let j=b[2]===180?180:((b[2]+180)%360+360)%360-180;const K=Math.max(-90,Math.min(90,b[3]));if(b[2]-b[0]>=360)R=-180,j=180;else if(R>j){const pe=this.getClusters([R,B,180,K],C),ve=this.getClusters([-180,B,j,K],C);return pe.concat(ve)}const W=this.trees[this._limitZoom(C)],X=W.range(yt(R),pr(K),yt(j),pr(B)),J=[];for(const pe of X){const ve=W.points[pe];J.push(ve.numPoints?bn(ve):this.points[ve.index])}return J}getChildren(b){const C=this._getOriginId(b),R=this._getOriginZoom(b),B="No cluster with the specified id.",j=this.trees[R];if(!j)throw new Error(B);const K=j.points[C];if(!K)throw new Error(B);const W=this.options.radius/(this.options.extent*Math.pow(2,R-1)),X=j.within(K.x,K.y,W),J=[];for(const pe of X){const ve=j.points[pe];ve.parentId===b&&J.push(ve.numPoints?bn(ve):this.points[ve.index])}if(J.length===0)throw new Error(B);return J}getLeaves(b,C,R){const B=[];return this._appendLeaves(B,b,C=C||10,R=R||0,0),B}getTile(b,C,R){const B=this.trees[this._limitZoom(b)],j=Math.pow(2,b),{extent:K,radius:W}=this.options,X=W/K,J=(R-X)/j,pe=(R+1+X)/j,ve={features:[]};return this._addTileFeatures(B.range((C-X)/j,J,(C+1+X)/j,pe),B.points,C,R,j,ve),C===0&&this._addTileFeatures(B.range(1-X/j,J,1,pe),B.points,j,R,j,ve),C===j-1&&this._addTileFeatures(B.range(0,J,X/j,pe),B.points,-1,R,j,ve),ve.features.length?ve:null}getClusterExpansionZoom(b){let C=this._getOriginZoom(b)-1;for(;C<=this.options.maxZoom;){const R=this.getChildren(b);if(C++,R.length!==1)break;b=R[0].properties.cluster_id}return C}_appendLeaves(b,C,R,B,j){const K=this.getChildren(C);for(const W of K){const X=W.properties;if(X&&X.cluster?j+X.point_count<=B?j+=X.point_count:j=this._appendLeaves(b,X.cluster_id,R,B,j):j<B?j++:b.push(W),b.length===R)break}return j}_addTileFeatures(b,C,R,B,j,K){for(const W of b){const X=C[W],J=X.numPoints;let pe,ve,he;if(J)pe=Wn(X),ve=X.x,he=X.y;else{const Le=this.points[X.index];pe=Le.properties,ve=yt(Le.geometry.coordinates[0]),he=pr(Le.geometry.coordinates[1])}const Ve={type:1,geometry:[[Math.round(this.options.extent*(ve*j-R)),Math.round(this.options.extent*(he*j-B))]],tags:pe};let Ge;J?Ge=X.id:this.options.generateId?Ge=X.index:this.points[X.index].id&&(Ge=this.points[X.index].id),Ge!==void 0&&(Ve.id=Ge),K.features.push(Ve)}}_limitZoom(b){return Math.max(this.options.minZoom,Math.min(Math.floor(+b),this.options.maxZoom+1))}_cluster(b,C){const R=[],{radius:B,extent:j,reduce:K,minPoints:W}=this.options,X=B/(j*Math.pow(2,C));for(let J=0;J<b.length;J++){const pe=b[J];if(pe.zoom<=C)continue;pe.zoom=C;const ve=this.trees[C+1],he=ve.within(pe.x,pe.y,X),Ve=pe.numPoints||1;let Ge=Ve;for(const Le of he){const Ke=ve.points[Le];Ke.zoom>C&&(Ge+=Ke.numPoints||1)}if(Ge>Ve&&Ge>=W){let Le=pe.x*Ve,Ke=pe.y*Ve,et=K&&Ve>1?this._map(pe,!0):null;const vt=(J<<5)+(C+1)+this.points.length;for(const it of he){const ct=ve.points[it];if(ct.zoom<=C)continue;ct.zoom=C;const bt=ct.numPoints||1;Le+=ct.x*bt,Ke+=ct.y*bt,ct.parentId=vt,K&&(et||(et=this._map(pe,!0)),K(et,this._map(ct)))}pe.parentId=vt,R.push(Br(Le/Ge,Ke/Ge,vt,Ge,et))}else if(R.push(pe),Ge>1)for(const Le of he){const Ke=ve.points[Le];Ke.zoom<=C||(Ke.zoom=C,R.push(Ke))}}return R}_getOriginId(b){return b-this.points.length>>5}_getOriginZoom(b){return(b-this.points.length)%32}_map(b,C){if(b.numPoints)return C?Or({},b.properties):b.properties;const R=this.points[b.index].properties,B=this.options.map(R);return C&&B===R?Or({},B):B}}function Br(O,b,C,R,B){return{x:br(O),y:br(b),zoom:1/0,id:C,parentId:-1,numPoints:R,properties:B}}function vn(O,b){const[C,R]=O.geometry.coordinates;return{x:br(yt(C)),y:br(pr(R)),zoom:1/0,index:b,parentId:-1}}function bn(O){return{type:"Feature",id:O.id,properties:Wn(O),geometry:{type:"Point",coordinates:[(b=O.x,360*(b-.5)),Fr(O.y)]}};var b}function Wn(O){const b=O.numPoints,C=b>=1e4?`${Math.round(b/1e3)}k`:b>=1e3?Math.round(b/100)/10+"k":b;return Or(Or({},O.properties),{cluster:!0,cluster_id:O.id,point_count:b,point_count_abbreviated:C})}function yt(O){return O/360+.5}function pr(O){const b=Math.sin(O*Math.PI/180),C=.5-.25*Math.log((1+b)/(1-b))/Math.PI;return C<0?0:C>1?1:C}function Fr(O){const b=(180-360*O)*Math.PI/180;return 360*Math.atan(Math.exp(b))/Math.PI-90}function Or(O,b){for(const C in b)O[C]=b[C];return O}function Hn(O){return O.x}function wr(O){return O.y}function Tr(O,b,C,R){for(var B,j=R,K=C-b>>1,W=C-b,X=O[b],J=O[b+1],pe=O[C],ve=O[C+1],he=b+3;he<C;he+=3){var Ve=wn(O[he],O[he+1],X,J,pe,ve);if(Ve>j)B=he,j=Ve;else if(Ve===j){var Ge=Math.abs(he-K);Ge<W&&(B=he,W=Ge)}}j>R&&(B-b>3&&Tr(O,b,B,R),O[B+2]=j,C-B>3&&Tr(O,B,C,R))}function wn(O,b,C,R,B,j){var K=B-C,W=j-R;if(K!==0||W!==0){var X=((O-C)*K+(b-R)*W)/(K*K+W*W);X>1?(C=B,R=j):X>0&&(C+=K*X,R+=W*X)}return(K=O-C)*K+(W=b-R)*W}function Er(O,b,C,R){var B={id:O===void 0?null:O,type:b,geometry:C,tags:R,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(j){var K=j.geometry,W=j.type;if(W==="Point"||W==="MultiPoint"||W==="LineString")_e(j,K);else if(W==="Polygon"||W==="MultiLineString")for(var X=0;X<K.length;X++)_e(j,K[X]);else if(W==="MultiPolygon")for(X=0;X<K.length;X++)for(var J=0;J<K[X].length;J++)_e(j,K[X][J])}(B),B}function _e(O,b){for(var C=0;C<b.length;C+=3)O.minX=Math.min(O.minX,b[C]),O.minY=Math.min(O.minY,b[C+1]),O.maxX=Math.max(O.maxX,b[C]),O.maxY=Math.max(O.maxY,b[C+1])}function Me(O,b,C,R){if(b.geometry){var B=b.geometry.coordinates,j=b.geometry.type,K=Math.pow(C.tolerance/((1<<C.maxZoom)*C.extent),2),W=[],X=b.id;if(C.promoteId?X=b.properties[C.promoteId]:C.generateId&&(X=R||0),j==="Point")Jr(B,W);else if(j==="MultiPoint")for(var J=0;J<B.length;J++)Jr(B[J],W);else if(j==="LineString")ir(B,W,K,!1);else if(j==="MultiLineString"){if(C.lineMetrics){for(J=0;J<B.length;J++)ir(B[J],W=[],K,!1),O.push(Er(X,"LineString",W,b.properties));return}xt(B,W,K,!1)}else if(j==="Polygon")xt(B,W,K,!0);else{if(j!=="MultiPolygon"){if(j==="GeometryCollection"){for(J=0;J<b.geometry.geometries.length;J++)Me(O,{id:X,geometry:b.geometry.geometries[J],properties:b.properties},C,R);return}throw new Error("Input data is not a valid GeoJSON object.")}for(J=0;J<B.length;J++){var pe=[];xt(B[J],pe,K,!0),W.push(pe)}}O.push(Er(X,j,W,b.properties))}}function Jr(O,b){b.push(Ki(O[0])),b.push(Oi(O[1])),b.push(0)}function ir(O,b,C,R){for(var B,j,K=0,W=0;W<O.length;W++){var X=Ki(O[W][0]),J=Oi(O[W][1]);b.push(X),b.push(J),b.push(0),W>0&&(K+=R?(B*J-X*j)/2:Math.sqrt(Math.pow(X-B,2)+Math.pow(J-j,2))),B=X,j=J}var pe=b.length-3;b[2]=1,Tr(b,0,pe,C),b[pe+2]=1,b.size=Math.abs(K),b.start=0,b.end=b.size}function xt(O,b,C,R){for(var B=0;B<O.length;B++){var j=[];ir(O[B],j,C,R),b.push(j)}}function Ki(O){return O/360+.5}function Oi(O){var b=Math.sin(O*Math.PI/180),C=.5-.25*Math.log((1+b)/(1-b))/Math.PI;return C<0?0:C>1?1:C}function $i(O,b,C,R,B,j,K,W){if(R/=b,j>=(C/=b)&&K<R)return O;if(K<C||j>=R)return null;for(var X=[],J=0;J<O.length;J++){var pe=O[J],ve=pe.geometry,he=pe.type,Ve=B===0?pe.minX:pe.minY,Ge=B===0?pe.maxX:pe.maxY;if(Ve>=C&&Ge<R)X.push(pe);else if(!(Ge<C||Ve>=R)){var Le=[];if(he==="Point"||he==="MultiPoint")$r(ve,Le,C,R,B);else if(he==="LineString")Ie(ve,Le,C,R,B,!1,W.lineMetrics);else if(he==="MultiLineString")ot(ve,Le,C,R,B,!1);else if(he==="Polygon")ot(ve,Le,C,R,B,!0);else if(he==="MultiPolygon")for(var Ke=0;Ke<ve.length;Ke++){var et=[];ot(ve[Ke],et,C,R,B,!0),et.length&&Le.push(et)}if(Le.length){if(W.lineMetrics&&he==="LineString"){for(Ke=0;Ke<Le.length;Ke++)X.push(Er(pe.id,he,Le[Ke],pe.tags));continue}he!=="LineString"&&he!=="MultiLineString"||(Le.length===1?(he="LineString",Le=Le[0]):he="MultiLineString"),he!=="Point"&&he!=="MultiPoint"||(he=Le.length===3?"Point":"MultiPoint"),X.push(Er(pe.id,he,Le,pe.tags))}}}return X.length?X:null}function $r(O,b,C,R,B){for(var j=0;j<O.length;j+=3){var K=O[j+B];K>=C&&K<=R&&(b.push(O[j]),b.push(O[j+1]),b.push(O[j+2]))}}function Ie(O,b,C,R,B,j,K){for(var W,X,J=lt(O),pe=B===0?Ur:rt,ve=O.start,he=0;he<O.length-3;he+=3){var Ve=O[he],Ge=O[he+1],Le=O[he+2],Ke=O[he+3],et=O[he+4],vt=B===0?Ve:Ge,it=B===0?Ke:et,ct=!1;K&&(W=Math.sqrt(Math.pow(Ve-Ke,2)+Math.pow(Ge-et,2))),vt<C?it>C&&(X=pe(J,Ve,Ge,Ke,et,C),K&&(J.start=ve+W*X)):vt>R?it<R&&(X=pe(J,Ve,Ge,Ke,et,R),K&&(J.start=ve+W*X)):fi(J,Ve,Ge,Le),it<C&&vt>=C&&(X=pe(J,Ve,Ge,Ke,et,C),ct=!0),it>R&&vt<=R&&(X=pe(J,Ve,Ge,Ke,et,R),ct=!0),!j&&ct&&(K&&(J.end=ve+W*X),b.push(J),J=lt(O)),K&&(ve+=W)}var bt=O.length-3;Ve=O[bt],Ge=O[bt+1],Le=O[bt+2],(vt=B===0?Ve:Ge)>=C&&vt<=R&&fi(J,Ve,Ge,Le),bt=J.length-3,j&&bt>=3&&(J[bt]!==J[0]||J[bt+1]!==J[1])&&fi(J,J[0],J[1],J[2]),J.length&&b.push(J)}function lt(O){var b=[];return b.size=O.size,b.start=O.start,b.end=O.end,b}function ot(O,b,C,R,B,j){for(var K=0;K<O.length;K++)Ie(O[K],b,C,R,B,j,!1)}function fi(O,b,C,R){O.push(b),O.push(C),O.push(R)}function Ur(O,b,C,R,B,j){var K=(j-b)/(R-b);return O.push(j),O.push(C+(B-C)*K),O.push(1),K}function rt(O,b,C,R,B,j){var K=(j-C)/(B-C);return O.push(b+(R-b)*K),O.push(j),O.push(1),K}function Sr(O,b){for(var C=[],R=0;R<O.length;R++){var B,j=O[R],K=j.type;if(K==="Point"||K==="MultiPoint"||K==="LineString")B=oi(j.geometry,b);else if(K==="MultiLineString"||K==="Polygon"){B=[];for(var W=0;W<j.geometry.length;W++)B.push(oi(j.geometry[W],b))}else if(K==="MultiPolygon")for(B=[],W=0;W<j.geometry.length;W++){for(var X=[],J=0;J<j.geometry[W].length;J++)X.push(oi(j.geometry[W][J],b));B.push(X)}C.push(Er(j.id,K,B,j.tags))}return C}function oi(O,b){var C=[];C.size=O.size,O.start!==void 0&&(C.start=O.start,C.end=O.end);for(var R=0;R<O.length;R+=3)C.push(O[R]+b,O[R+1],O[R+2]);return C}function Tn(O,b){if(O.transformed)return O;var C,R,B,j=1<<O.z,K=O.x,W=O.y;for(C=0;C<O.features.length;C++){var X=O.features[C],J=X.geometry,pe=X.type;if(X.geometry=[],pe===1)for(R=0;R<J.length;R+=2)X.geometry.push(Yt(J[R],J[R+1],b,j,K,W));else for(R=0;R<J.length;R++){var ve=[];for(B=0;B<J[R].length;B+=2)ve.push(Yt(J[R][B],J[R][B+1],b,j,K,W));X.geometry.push(ve)}}return O.transformed=!0,O}function Yt(O,b,C,R,B,j){return[Math.round(C*(O*R-B)),Math.round(C*(b*R-j))]}function Ti(O,b,C,R,B){for(var j=b===B.maxZoom?0:B.tolerance/((1<<b)*B.extent),K={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:C,y:R,z:b,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},W=0;W<O.length;W++){K.numFeatures++,Pt(K,O[W],j,B);var X=O[W].minX,J=O[W].minY,pe=O[W].maxX,ve=O[W].maxY;X<K.minX&&(K.minX=X),J<K.minY&&(K.minY=J),pe>K.maxX&&(K.maxX=pe),ve>K.maxY&&(K.maxY=ve)}return K}function Pt(O,b,C,R){var B=b.geometry,j=b.type,K=[];if(j==="Point"||j==="MultiPoint")for(var W=0;W<B.length;W+=3)K.push(B[W]),K.push(B[W+1]),O.numPoints++,O.numSimplified++;else if(j==="LineString")En(K,B,O,C,!1,!1);else if(j==="MultiLineString"||j==="Polygon")for(W=0;W<B.length;W++)En(K,B[W],O,C,j==="Polygon",W===0);else if(j==="MultiPolygon")for(var X=0;X<B.length;X++){var J=B[X];for(W=0;W<J.length;W++)En(K,J[W],O,C,!0,W===0)}if(K.length){var pe=b.tags||null;if(j==="LineString"&&R.lineMetrics){for(var ve in pe={},b.tags)pe[ve]=b.tags[ve];pe.mapbox_clip_start=B.start/B.size,pe.mapbox_clip_end=B.end/B.size}var he={geometry:K,type:j==="Polygon"||j==="MultiPolygon"?3:j==="LineString"||j==="MultiLineString"?2:1,tags:pe};b.id!==null&&(he.id=b.id),O.features.push(he)}}function En(O,b,C,R,B,j){var K=R*R;if(R>0&&b.size<(B?K:R))C.numPoints+=b.length/3;else{for(var W=[],X=0;X<b.length;X+=3)(R===0||b[X+2]>K)&&(C.numSimplified++,W.push(b[X]),W.push(b[X+1])),C.numPoints++;B&&function(J,pe){for(var ve=0,he=0,Ve=J.length,Ge=Ve-2;he<Ve;Ge=he,he+=2)ve+=(J[he]-J[Ge])*(J[he+1]+J[Ge+1]);if(ve>0===pe)for(he=0,Ve=J.length;he<Ve/2;he+=2){var Le=J[he],Ke=J[he+1];J[he]=J[Ve-2-he],J[he+1]=J[Ve-1-he],J[Ve-2-he]=Le,J[Ve-1-he]=Ke}}(W,j),O.push(W)}}function dr(O,b){var C=(b=this.options=function(B,j){for(var K in j)B[K]=j[K];return B}(Object.create(this.options),b)).debug;if(C&&console.time("preprocess data"),b.maxZoom<0||b.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(b.promoteId&&b.generateId)throw new Error("promoteId and generateId cannot be used together.");var R=function(B,j){var K=[];if(B.type==="FeatureCollection")for(var W=0;W<B.features.length;W++)Me(K,B.features[W],j,W);else Me(K,B.type==="Feature"?B:{geometry:B},j);return K}(O,b);this.tiles={},this.tileCoords=[],C&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",b.indexMaxZoom,b.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),R=function(B,j){var K=j.buffer/j.extent,W=B,X=$i(B,1,-1-K,K,0,-1,2,j),J=$i(B,1,1-K,2+K,0,-1,2,j);return(X||J)&&(W=$i(B,1,-K,1+K,0,-1,2,j)||[],X&&(W=Sr(X,1).concat(W)),J&&(W=W.concat(Sr(J,-1)))),W}(R,b),R.length&&this.splitTile(R,0,0,0),C&&(R.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Yr(O,b,C){return 32*((1<<O)*C+b)+O}function Qr(O,b){const C=O.tileID.canonical;if(!this._geoJSONIndex)return b(null,null);const R=this._geoJSONIndex.getTile(C.z,C.x,C.y);if(!R)return b(null,null);const B=new Tt(R.features);let j=Ht.exports(B);j.byteOffset===0&&j.byteLength===j.buffer.byteLength||(j=new Uint8Array(j)),b(null,{vectorTile:B,rawData:j.buffer})}dr.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},dr.prototype.splitTile=function(O,b,C,R,B,j,K){for(var W=[O,b,C,R],X=this.options,J=X.debug;W.length;){R=W.pop(),C=W.pop(),b=W.pop(),O=W.pop();var pe=1<<b,ve=Yr(b,C,R),he=this.tiles[ve];if(!he&&(J>1&&console.time("creation"),he=this.tiles[ve]=Ti(O,b,C,R,X),this.tileCoords.push({z:b,x:C,y:R}),J)){J>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",b,C,R,he.numFeatures,he.numPoints,he.numSimplified),console.timeEnd("creation"));var Ve="z"+b;this.stats[Ve]=(this.stats[Ve]||0)+1,this.total++}if(he.source=O,B){if(b===X.maxZoom||b===B)continue;var Ge=1<<B-b;if(C!==Math.floor(j/Ge)||R!==Math.floor(K/Ge))continue}else if(b===X.indexMaxZoom||he.numPoints<=X.indexMaxPoints)continue;if(he.source=null,O.length!==0){J>1&&console.time("clipping");var Le,Ke,et,vt,it,ct,bt=.5*X.buffer/X.extent,kt=.5-bt,si=.5+bt,$t=1+bt;Le=Ke=et=vt=null,it=$i(O,pe,C-bt,C+si,0,he.minX,he.maxX,X),ct=$i(O,pe,C+kt,C+$t,0,he.minX,he.maxX,X),O=null,it&&(Le=$i(it,pe,R-bt,R+si,1,he.minY,he.maxY,X),Ke=$i(it,pe,R+kt,R+$t,1,he.minY,he.maxY,X),it=null),ct&&(et=$i(ct,pe,R-bt,R+si,1,he.minY,he.maxY,X),vt=$i(ct,pe,R+kt,R+$t,1,he.minY,he.maxY,X),ct=null),J>1&&console.timeEnd("clipping"),W.push(Le||[],b+1,2*C,2*R),W.push(Ke||[],b+1,2*C,2*R+1),W.push(et||[],b+1,2*C+1,2*R),W.push(vt||[],b+1,2*C+1,2*R+1)}}},dr.prototype.getTile=function(O,b,C){var R=this.options,B=R.extent,j=R.debug;if(O<0||O>24)return null;var K=1<<O,W=Yr(O,b=(b%K+K)%K,C);if(this.tiles[W])return Tn(this.tiles[W],B);j>1&&console.log("drilling down to z%d-%d-%d",O,b,C);for(var X,J=O,pe=b,ve=C;!X&&J>0;)J--,pe=Math.floor(pe/2),ve=Math.floor(ve/2),X=this.tiles[Yr(J,pe,ve)];return X&&X.source?(j>1&&console.log("found parent tile z%d-%d-%d",J,pe,ve),j>1&&console.time("drilling down"),this.splitTile(X.source,J,pe,ve,O,b,C),j>1&&console.timeEnd("drilling down"),this.tiles[W]?Tn(this.tiles[W],B):null):null};class Sn extends $e{constructor(b,C,R,B){super(b,C,R,Qr),B&&(this.loadGeoJSON=B)}loadData(b,C){var R;(R=this._pendingRequest)===null||R===void 0||R.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const B=!!(b&&b.request&&b.request.collectResourceTiming)&&new a.RequestPerformance(b.request);this._pendingCallback=C,this._pendingRequest=this.loadGeoJSON(b,(j,K)=>{if(delete this._pendingCallback,delete this._pendingRequest,j||!K)return C(j);if(typeof K!="object")return C(new Error(`Input data given to '${b.source}' is not a valid GeoJSON object.`));{Ye(K,!0);try{if(b.filter){const X=a.createExpression(b.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(X.result==="error")throw new Error(X.value.map(pe=>`${pe.key}: ${pe.message}`).join(", "));const J=K.features.filter(pe=>X.value.evaluate({zoom:0},pe));K={type:"FeatureCollection",features:J}}this._geoJSONIndex=b.cluster?new Xn(function({superclusterOptions:X,clusterProperties:J}){if(!J||!X)return X;const pe={},ve={},he={accumulated:null,zoom:0},Ve={properties:null},Ge=Object.keys(J);for(const Le of Ge){const[Ke,et]=J[Le],vt=a.createExpression(et),it=a.createExpression(typeof Ke=="string"?[Ke,["accumulated"],["get",Le]]:Ke);pe[Le]=vt.value,ve[Le]=it.value}return X.map=Le=>{Ve.properties=Le;const Ke={};for(const et of Ge)Ke[et]=pe[et].evaluate(he,Ve);return Ke},X.reduce=(Le,Ke)=>{Ve.properties=Ke;for(const et of Ge)he.accumulated=Le[et],Le[et]=ve[et].evaluate(he,Ve)},X}(b)).load(K.features):function(X,J){return new dr(X,J)}(K,b.geojsonVtOptions)}catch(X){return C(X)}this.loaded={};const W={};if(B){const X=B.finish();X&&(W.resourceTiming={},W.resourceTiming[b.source]=JSON.parse(JSON.stringify(X)))}C(null,W)}})}reloadTile(b,C){const R=this.loaded;return R&&R[b.uid]?super.reloadTile(b,C):this.loadTile(b,C)}loadGeoJSON(b,C){if(b.request)return a.getJSON(b.request,C);if(typeof b.data=="string")try{C(null,JSON.parse(b.data))}catch{C(new Error(`Input data given to '${b.source}' is not a valid GeoJSON object.`))}else C(new Error(`Input data given to '${b.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(b,C){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),C()}getClusterExpansionZoom(b,C){try{C(null,this._geoJSONIndex.getClusterExpansionZoom(b.clusterId))}catch(R){C(R)}}getClusterChildren(b,C){try{C(null,this._geoJSONIndex.getChildren(b.clusterId))}catch(R){C(R)}}getClusterLeaves(b,C){try{C(null,this._geoJSONIndex.getLeaves(b.clusterId,b.limit,b.offset))}catch(R){C(R)}}}class en{constructor(b){this.self=b,this.actor=new a.Actor(b,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:$e,geojson:Sn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(C,R)=>{if(this.workerSourceTypes[C])throw new Error(`Worker source with name "${C}" already registered.`);this.workerSourceTypes[C]=R},this.self.registerRTLTextPlugin=C=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=C.applyArabicShaping,a.plugin.processBidirectionalText=C.processBidirectionalText,a.plugin.processStyledBidirectionalText=C.processStyledBidirectionalText}}setReferrer(b,C){this.referrer=C}setImages(b,C,R){this.availableImages[b]=C;for(const B in this.workerSources[b]){const j=this.workerSources[b][B];for(const K in j)j[K].availableImages=C}R()}setLayers(b,C,R){this.getLayerIndex(b).replace(C),R()}updateLayers(b,C,R){this.getLayerIndex(b).update(C.layers,C.removedIds),R()}loadTile(b,C,R){this.getWorkerSource(b,C.type,C.source).loadTile(C,R)}loadDEMTile(b,C,R){this.getDEMWorkerSource(b,C.source).loadTile(C,R)}reloadTile(b,C,R){this.getWorkerSource(b,C.type,C.source).reloadTile(C,R)}abortTile(b,C,R){this.getWorkerSource(b,C.type,C.source).abortTile(C,R)}removeTile(b,C,R){this.getWorkerSource(b,C.type,C.source).removeTile(C,R)}removeDEMTile(b,C){this.getDEMWorkerSource(b,C.source).removeTile(C)}removeSource(b,C,R){if(!this.workerSources[b]||!this.workerSources[b][C.type]||!this.workerSources[b][C.type][C.source])return;const B=this.workerSources[b][C.type][C.source];delete this.workerSources[b][C.type][C.source],B.removeSource!==void 0?B.removeSource(C,R):R()}loadWorkerSource(b,C,R){try{this.self.importScripts(C.url),R()}catch(B){R(B.toString())}}syncRTLPluginState(b,C,R){try{a.plugin.setState(C);const B=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&B!=null){this.self.importScripts(B);const j=a.plugin.isParsed();R(j?void 0:new Error(`RTL Text Plugin failed to import scripts from ${B}`),j)}}catch(B){R(B.toString())}}getAvailableImages(b){let C=this.availableImages[b];return C||(C=[]),C}getLayerIndex(b){let C=this.layerIndexes[b];return C||(C=this.layerIndexes[b]=new fe),C}getWorkerSource(b,C,R){if(this.workerSources[b]||(this.workerSources[b]={}),this.workerSources[b][C]||(this.workerSources[b][C]={}),!this.workerSources[b][C][R]){const B={send:(j,K,W)=>{this.actor.send(j,K,W,b)}};this.workerSources[b][C][R]=new this.workerSourceTypes[C](B,this.getLayerIndex(b),this.getAvailableImages(b))}return this.workerSources[b][C][R]}getDEMWorkerSource(b,C){return this.demWorkerSources[b]||(this.demWorkerSources[b]={}),this.demWorkerSources[b][C]||(this.demWorkerSources[b][C]=new tt),this.demWorkerSources[b][C]}enforceCacheSizeLimit(b,C){a.enforceCacheSizeLimit(C)}}return a.isWorker()&&(self.worker=new en(self)),en}),N(["./shared"],function(a){var ee=te;function te(l){return!function(t){return typeof window=="undefined"||typeof document=="undefined"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var s,u,p=new Blob([""],{type:"text/javascript"}),f=URL.createObjectURL(p);try{u=new Worker(f),s=!0}catch{s=!1}return u&&u.terminate(),URL.revokeObjectURL(f),s}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var s=document.createElement("canvas");s.width=s.height=1;var u=s.getContext("2d");if(!u)return!1;var p=u.getImageData(0,0,1,1);return p&&p.width===s.width}()?(fe[n=t&&t.failIfMajorPerformanceCaveat]===void 0&&(fe[n]=function(s){var u,p=function(f){var _=document.createElement("canvas"),y=Object.create(te.webGLContextAttributes);return y.failIfMajorPerformanceCaveat=f,_.getContext("webgl",y)||_.getContext("experimental-webgl",y)}(s);if(!p)return!1;try{u=p.createShader(p.VERTEX_SHADER)}catch{return!1}return!(!u||p.isContextLost())&&(p.shaderSource(u,"void main() {}"),p.compileShader(u),p.getShaderParameter(u,p.COMPILE_STATUS)===!0)}(n)),fe[n]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var n}(l)}var fe={};function ue(l,t){if(Array.isArray(l)){if(!Array.isArray(t)||l.length!==t.length)return!1;for(let n=0;n<l.length;n++)if(!ue(l[n],t[n]))return!1;return!0}if(typeof l=="object"&&l!==null&&t!==null){if(typeof t!="object"||Object.keys(l).length!==Object.keys(t).length)return!1;for(const n in l)if(!ue(l[n],t[n]))return!1;return!0}return l===t}te.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class ie{static testProp(t){if(!ie.docStyle)return t[0];for(let n=0;n<t.length;n++)if(t[n]in ie.docStyle)return t[n];return t[0]}static create(t,n,s){const u=window.document.createElement(t);return n!==void 0&&(u.className=n),s&&s.appendChild(u),u}static createNS(t,n){return window.document.createElementNS(t,n)}static disableDrag(){ie.docStyle&&ie.selectProp&&(ie.userSelect=ie.docStyle[ie.selectProp],ie.docStyle[ie.selectProp]="none")}static enableDrag(){ie.docStyle&&ie.selectProp&&(ie.docStyle[ie.selectProp]=ie.userSelect)}static setTransform(t,n){t.style[ie.transformProp]=n}static addEventListener(t,n,s,u={}){t.addEventListener(n,s,"passive"in u?u:u.capture)}static removeEventListener(t,n,s,u={}){t.removeEventListener(n,s,"passive"in u?u:u.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",ie.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ie.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",ie.suppressClickInternal,!0)},0)}static mousePos(t,n){const s=t.getBoundingClientRect();return new a.pointGeometry(n.clientX-s.left-t.clientLeft,n.clientY-s.top-t.clientTop)}static touchPos(t,n){const s=t.getBoundingClientRect(),u=[];for(let p=0;p<n.length;p++)u.push(new a.pointGeometry(n[p].clientX-s.left-t.clientLeft,n[p].clientY-s.top-t.clientTop));return u}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}ie.docStyle=typeof window!="undefined"&&window.document&&window.document.documentElement.style,ie.selectProp=ie.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),ie.transformProp=ie.testProp(["transform","WebkitTransform"]);class qe{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,s){const u=function(p){const f=p.match(Ue);if(!f)throw new Error(`Unable to parse URL "${p}"`);return{protocol:f[1],authority:f[2],path:f[3]||"/",params:f[4]?f[4].split("&"):[]}}(t);return u.path+=`${n}${s}`,function(p){const f=p.params.length?`?${p.params.join("&")}`:"";return`${p.protocol}://${p.authority}${p.path}${f}`}(u)}setTransformRequest(t){this._transformRequestFn=t}}const Ue=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;class $e{constructor(t,n,s,u){this.context=t,this.format=s,this.texture=t.gl.createTexture(),this.update(n,u)}update(t,n,s){const{width:u,height:p}=t,f=!(this.size&&this.size[0]===u&&this.size[1]===p||s),{context:_}=this,{gl:y}=_;if(this.useMipmap=Boolean(n&&n.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),_.pixelStoreUnpackFlipY.set(!1),_.pixelStoreUnpack.set(1),_.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!n||n.premultiply!==!1)),f)this.size=[u,p],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||a.isImageBitmap(t)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,t):y.texImage2D(y.TEXTURE_2D,0,this.format,u,p,0,this.format,y.UNSIGNED_BYTE,t.data);else{const{x:v,y:S}=s||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||a.isImageBitmap(t)?y.texSubImage2D(y.TEXTURE_2D,0,v,S,y.RGBA,y.UNSIGNED_BYTE,t):y.texSubImage2D(y.TEXTURE_2D,0,v,S,u,p,y.RGBA,y.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(t,n,s){const{context:u}=this,{gl:p}=u;p.bindTexture(p.TEXTURE_2D,this.texture),s!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=p.LINEAR),t!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,t),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,s||t),this.filter=t),n!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,n),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function tt(l){const{userImage:t}=l;return!!(t&&t.render&&t.render())&&(l.data.replace(new Uint8Array(t.data.buffer)),!0)}class Ye extends a.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,callback:s}of this.requestors)this._notify(n,s);this.requestors=[]}}getImage(t){return this.images[t]}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let s=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new a.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new a.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new a.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),s=!1),s}_validateStretch(t,n){if(!t)return!0;let s=0;for(const u of t){if(u[0]<s||u[1]<u[0]||n<u[1])return!1;s=u[1]}return!0}_validateContent(t,n){return!(t&&(t.length!==4||t[0]<0||n.data.width<t[0]||t[1]<0||n.data.height<t[1]||t[2]<0||n.data.width<t[2]||t[3]<0||n.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))}updateImage(t,n){const s=this.images[t];if(s.data.width!==n.data.width||s.data.height!==n.data.height)throw new Error(`size mismatch between old image (${s.data.width}x${s.data.height}) and new image (${n.data.width}x${n.data.height}).`);n.version=s.version+1,this.images[t]=n,this.updatedImages[t]=!0}removeImage(t){const n=this.images[t];delete this.images[t],delete this.patterns[t],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,n){let s=!0;if(!this.isLoaded())for(const u of t)this.images[u]||(s=!1);this.isLoaded()||s?this._notify(t,n):this.requestors.push({ids:t,callback:n})}_notify(t,n){const s={};for(const u of t){this.images[u]||this.fire(new a.Event("styleimagemissing",{id:u}));const p=this.images[u];p?s[u]={data:p.data.clone(),pixelRatio:p.pixelRatio,sdf:p.sdf,version:p.version,stretchX:p.stretchX,stretchY:p.stretchY,content:p.content,hasRenderCallback:Boolean(p.userImage&&p.userImage.render)}:a.warnOnce(`Image "${u}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}n(null,s)}getPixelSize(){const{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){const n=this.patterns[t],s=this.getImage(t);if(!s)return null;if(n&&n.position.version===s.version)return n.position;if(n)n.position.version=s.version;else{const u={w:s.data.width+2,h:s.data.height+2,x:0,y:0},p=new a.ImagePosition(u,s);this.patterns[t]={bin:u,position:p}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new $e(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const p in this.patterns)t.push(this.patterns[p].bin);const{w:n,h:s}=a.potpack(t),u=this.atlasImage;u.resize({width:n||1,height:s||1});for(const p in this.patterns){const{bin:f}=this.patterns[p],_=f.x+1,y=f.y+1,v=this.images[p].data,S=v.width,M=v.height;a.RGBAImage.copy(v,u,{x:0,y:0},{x:_,y},{width:S,height:M}),a.RGBAImage.copy(v,u,{x:0,y:M-1},{x:_,y:y-1},{width:S,height:1}),a.RGBAImage.copy(v,u,{x:0,y:0},{x:_,y:y+M},{width:S,height:1}),a.RGBAImage.copy(v,u,{x:S-1,y:0},{x:_-1,y},{width:1,height:M}),a.RGBAImage.copy(v,u,{x:0,y:0},{x:_+S,y},{width:1,height:M})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const s=this.images[n];s||a.warnOnce(`Image with ID: "${n}" was not found`),tt(s)&&this.updateImage(n,s)}}}const Qe=1e20;function dt(l,t,n,s,u,p,f,_,y){for(let v=t;v<t+s;v++)gt(l,n*p+v,p,u,f,_,y);for(let v=n;v<n+u;v++)gt(l,v*p+t,1,s,f,_,y)}function gt(l,t,n,s,u,p,f){p[0]=0,f[0]=-Qe,f[1]=Qe,u[0]=l[t];for(let _=1,y=0,v=0;_<s;_++){u[_]=l[t+_*n];const S=_*_;do{const M=p[y];v=(u[_]-u[M]+S-M*M)/(_-M)/2}while(v<=f[y]&&--y>-1);y++,p[y]=_,f[y]=v,f[y+1]=Qe}for(let _=0,y=0;_<s;_++){for(;f[y+1]<_;)y++;const v=p[y],S=_-v;l[t+_*n]=u[v]+S*S}}class at{constructor(t,n){this.requestManager=t,this.localIdeographFontFamily=n,this.entries={}}setURL(t){this.url=t}getGlyphs(t,n){const s=[];for(const u in t)for(const p of t[u])s.push({stack:u,id:p});a.asyncAll(s,({stack:u,id:p},f)=>{let _=this.entries[u];_||(_=this.entries[u]={glyphs:{},requests:{},ranges:{}});let y=_.glyphs[p];if(y!==void 0)return void f(null,{stack:u,id:p,glyph:y});if(y=this._tinySDF(_,u,p),y)return _.glyphs[p]=y,void f(null,{stack:u,id:p,glyph:y});const v=Math.floor(p/256);if(256*v>65535)return void f(new Error("glyphs > 65535 not supported"));if(_.ranges[v])return void f(null,{stack:u,id:p,glyph:y});let S=_.requests[v];S||(S=_.requests[v]=[],at.loadGlyphRange(u,v,this.url,this.requestManager,(M,k)=>{if(k){for(const V in k)this._doesCharSupportLocalGlyph(+V)||(_.glyphs[+V]=k[+V]);_.ranges[v]=!0}for(const V of S)V(M,k);delete _.requests[v]})),S.push((M,k)=>{M?f(M):k&&f(null,{stack:u,id:p,glyph:k[p]||null})})},(u,p)=>{if(u)n(u);else if(p){const f={};for(const{stack:_,id:y,glyph:v}of p)(f[_]||(f[_]={}))[y]=v&&{id:v.id,bitmap:v.bitmap.clone(),metrics:v.metrics};n(null,f)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(a.unicodeBlockLookup["CJK Unified Ideographs"](t)||a.unicodeBlockLookup["Hangul Syllables"](t)||a.unicodeBlockLookup.Hiragana(t)||a.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,s){const u=this.localIdeographFontFamily;if(!u||!this._doesCharSupportLocalGlyph(s))return;let p=t.tinySDF;if(!p){let _="400";/bold/i.test(n)?_="900":/medium/i.test(n)?_="500":/light/i.test(n)&&(_="200"),p=t.tinySDF=new at.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:u,fontWeight:_})}const f=p.draw(String.fromCharCode(s));return{id:s,bitmap:new a.AlphaImage({width:f.width||30,height:f.height||30},f.data),metrics:{width:f.glyphWidth||24,height:f.glyphHeight||24,left:f.glyphLeft||0,top:f.glyphTop-27||-8,advance:f.glyphAdvance||24}}}}at.loadGlyphRange=function(l,t,n,s,u){const p=256*t,f=p+255,_=s.transformRequest(n.replace("{fontstack}",l).replace("{range}",`${p}-${f}`),a.ResourceType.Glyphs);a.getArrayBuffer(_,(y,v)=>{if(y)u(y);else if(v){const S={};for(const M of a.parseGlyphPbf(v))S[M.id]=M;u(null,S)}})},at.TinySDF=class{constructor({fontSize:l=24,buffer:t=3,radius:n=8,cutoff:s=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:f="normal"}={}){this.buffer=t,this.cutoff=s,this.radius=n;const _=this.size=l+4*t,y=this._createCanvas(_),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${f} ${p} ${l}px ${u}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(_*_),this.gridInner=new Float64Array(_*_),this.f=new Float64Array(_),this.z=new Float64Array(_+1),this.v=new Uint16Array(_)}_createCanvas(l){const t=document.createElement("canvas");return t.width=t.height=l,t}draw(l){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(l),f=Math.ceil(n),_=Math.min(this.size-this.buffer,Math.ceil(p-u)),y=Math.min(this.size-this.buffer,f+Math.ceil(s)),v=_+2*this.buffer,S=y+2*this.buffer,M=Math.max(v*S,0),k=new Uint8ClampedArray(M),V={data:k,width:v,height:S,glyphWidth:_,glyphHeight:y,glyphTop:f,glyphLeft:0,glyphAdvance:t};if(_===0||y===0)return V;const{ctx:$,buffer:U,gridInner:H,gridOuter:Y}=this;$.clearRect(U,U,_,y),$.fillText(l,U,U+f);const ne=$.getImageData(U,U,_,y);Y.fill(Qe,0,M),H.fill(0,0,M);for(let G=0;G<y;G++)for(let le=0;le<_;le++){const se=ne.data[4*(G*_+le)+3]/255;if(se===0)continue;const me=(G+U)*v+le+U;if(se===1)Y[me]=0,H[me]=Qe;else{const ge=.5-se;Y[me]=ge>0?ge*ge:0,H[me]=ge<0?ge*ge:0}}dt(Y,0,0,v,S,v,this.f,this.v,this.z),dt(H,U,U,_,y,v,this.f,this.v,this.z);for(let G=0;G<M;G++){const le=Math.sqrt(Y[G])-Math.sqrt(H[G]);k[G]=Math.round(255-255*(le/this.radius+this.cutoff))}return V}};const Tt=new a.Properties({anchor:new a.DataConstantProperty(a.spec.light.anchor),position:new class{constructor(){this.specification=a.spec.light.position}possiblyEvaluate(l,t){return a.sphericalToCartesian(l.expression.evaluate(t))}interpolate(l,t,n){return{x:a.number(l.x,t.x,n),y:a.number(l.y,t.y,n),z:a.number(l.z,t.z,n)}}},color:new a.DataConstantProperty(a.spec.light.color),intensity:new a.DataConstantProperty(a.spec.light.intensity)}),Ht="-transition";class Jt extends a.Evented{constructor(t){super(),this._transitionable=new a.Transitionable(Tt),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}){if(!this._validate(a.validateLight,t,n))for(const s in t){const u=t[s];s.endsWith(Ht)?this._transitionable.setTransition(s.slice(0,-Ht.length),u):this._transitionable.setValue(s,u)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,n,s){return(!s||s.validate!==!1)&&a.emitValidationErrors(this,t.call(a.validateStyle,a.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:a.spec})))}}class vr{constructor(t,n){this.width=t,this.height=n,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,n){const s=t.join(",")+String(n);return this.dashEntry[s]||(this.dashEntry[s]=this.addDash(t,n)),this.dashEntry[s]}getDashRanges(t,n,s){const u=[];let p=t.length%2==1?-t[t.length-1]*s:0,f=t[0]*s,_=!0;u.push({left:p,right:f,isDash:_,zeroLength:t[0]===0});let y=t[0];for(let v=1;v<t.length;v++){_=!_;const S=t[v];p=y*s,y+=S,f=y*s,u.push({left:p,right:f,isDash:_,zeroLength:S===0})}return u}addRoundDash(t,n,s){const u=n/2;for(let p=-s;p<=s;p++){const f=this.width*(this.nextRow+s+p);let _=0,y=t[_];for(let v=0;v<this.width;v++){v/y.right>1&&(y=t[++_]);const S=Math.abs(v-y.left),M=Math.abs(v-y.right),k=Math.min(S,M);let V;const $=p/s*(u+1);if(y.isDash){const U=u-Math.abs($);V=Math.sqrt(k*k+U*U)}else V=u-Math.sqrt(k*k+$*$);this.data[f+v]=Math.max(0,Math.min(255,V+128))}}}addRegularDash(t){for(let _=t.length-1;_>=0;--_){const y=t[_],v=t[_+1];y.zeroLength?t.splice(_,1):v&&v.isDash===y.isDash&&(v.left=y.left,t.splice(_,1))}const n=t[0],s=t[t.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const u=this.width*this.nextRow;let p=0,f=t[p];for(let _=0;_<this.width;_++){_/f.right>1&&(f=t[++p]);const y=Math.abs(_-f.left),v=Math.abs(_-f.right),S=Math.min(y,v);this.data[u+_]=Math.max(0,Math.min(255,(f.isDash?S:-S)+128))}}addDash(t,n){const s=n?7:0,u=2*s+1;if(this.nextRow+u>this.height)return a.warnOnce("LineAtlas out of space"),null;let p=0;for(let _=0;_<t.length;_++)p+=t[_];if(p!==0){const _=this.width/p,y=this.getDashRanges(t,this.width,_);n?this.addRoundDash(y,_,s):this.addRegularDash(y)}const f={y:(this.nextRow+s+.5)/this.height,height:2*s/this.height,width:p};return this.nextRow+=u,this.dirty=!0,f}bind(t){const n=t.gl;this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.ALPHA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,this.width,this.height,0,n.ALPHA,n.UNSIGNED_BYTE,this.data))}}class Wi{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=a.uniqueId();const s=this.workerPool.acquire(this.id);for(let u=0;u<s.length;u++){const p=new Wi.Actor(s[u],n,this.id);p.name=`Worker ${u}`,this.actors.push(p)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,n,s){a.asyncAll(this.actors,(u,p)=>{u.send(t,n,p)},s=s||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(t=>{t.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ur(l,t,n){const s=function(u,p){if(u)return n(u);if(p){const f=a.pick(a.extend(p,l),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);p.vector_layers&&(f.vectorLayers=p.vector_layers,f.vectorLayerIds=f.vectorLayers.map(_=>_.id)),n(null,f)}};return l.url?a.getJSON(t.transformRequest(l.url,a.ResourceType.Source),s):a.exported.frame(()=>s(null,l))}Wi.Actor=a.Actor;class Hi{constructor(t,n,s){this.bounds=a.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=s||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),s=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*n),u=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*n),p=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*n),f=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=s&&t.x<p&&t.y>=u&&t.y<f}}class Rt extends a.Evented{constructor(t,n,s,u){if(super(),this.id=t,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,a.extend(this,a.pick(n,["url","scheme","tileSize","promoteId"])),this._options=a.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(u)}load(){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ur(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new a.ErrorEvent(t)):n&&(a.extend(this,n),n.bounds&&(this.tileBounds=new Hi(n.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),u={request:this.map._requestManager.transformRequest(s,a.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function p(f,_){return delete t.request,t.aborted?n(null):f&&f.status!==404?n(f):(_&&_.resourceTiming&&(t.resourceTiming=_.resourceTiming),this.map._refreshExpiredTiles&&_&&t.setExpiryData(_),t.loadVectorData(_,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}u.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",u,p.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",u,p.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class pi extends a.Evented{constructor(t,n,s,u){super(),this.id=t,this.dispatcher=s,this.setEventedParent(u),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},n),a.extend(this,a.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ur(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new a.ErrorEvent(t)):n&&(a.extend(this,n),n.bounds&&(this.tileBounds=new Hi(n.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=a.getImage(this.map._requestManager.transformRequest(s,a.ResourceType.Tile),(u,p,f)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(u)t.state="errored",n(u);else if(p){this.map._refreshExpiredTiles&&t.setExpiryData(f);const _=this.map.painter.context,y=_.gl;t.texture=this.map.painter.getTileTexture(p.width),t.texture?t.texture.update(p,{useMipmap:!0}):(t.texture=new $e(_,p,y.RGBA,{useMipmap:!0}),t.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),_.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax)),t.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),n(null)}})}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}let di;class Xe extends pi{constructor(t,n,s,u){super(t,n,s,u),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function u(p,f){p&&(t.state="errored",n(p)),f&&(t.dem=f,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.request=a.getImage(this.map._requestManager.transformRequest(s,a.ResourceType.Tile),function(p,f){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(p)t.state="errored",n(p);else if(f){this.map._refreshExpiredTiles&&t.setExpiryData(f),delete f.cacheControl,delete f.expires;const _=a.isImageBitmap(f)&&(di==null&&(di=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),di)?f:a.exported.getImageData(f,1),y={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:_,encoding:this.encoding};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",y,u.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}_getNeighboringTiles(t){const n=t.canonical,s=Math.pow(2,n.z),u=(n.x-1+s)%s,p=n.x===0?t.wrap-1:t.wrap,f=(n.x+1+s)%s,_=n.x+1===s?t.wrap+1:t.wrap,y={};return y[new a.OverscaledTileID(t.overscaledZ,p,n.z,u,n.y).key]={backfilled:!1},y[new a.OverscaledTileID(t.overscaledZ,_,n.z,f,n.y).key]={backfilled:!1},n.y>0&&(y[new a.OverscaledTileID(t.overscaledZ,p,n.z,u,n.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(t.overscaledZ,_,n.z,f,n.y-1).key]={backfilled:!1}),n.y+1<s&&(y[new a.OverscaledTileID(t.overscaledZ,p,n.z,u,n.y+1).key]={backfilled:!1},y[new a.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},y[new a.OverscaledTileID(t.overscaledZ,_,n.z,f,n.y+1).key]={backfilled:!1}),y}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})}}class Bi extends a.Evented{constructor(t,n,s,u){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=s.getActor(),this.setEventedParent(u),this._data=n.data,this._options=a.extend({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const p=a.EXTENT/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer!==void 0?n.buffer:128)*p,tolerance:(n.tolerance!==void 0?n.tolerance:.375)*p,extent:a.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:n.clusterMaxZoom!==void 0?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:a.EXTENT,radius:(n.clusterRadius||50)*p,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}load(){this._updateWorkerData("metadata")}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData("content"),this}getClusterExpansionZoom(t,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},n),this}getClusterChildren(t,n){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},n),this}getClusterLeaves(t,n,s,u){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:n,offset:s},u),this}_updateWorkerData(t){const n=a.extend({},this.workerOptions),s=this._data;typeof s=="string"?(n.request=this.map._requestManager.transformRequest(a.exported.resolveURL(s),a.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(s),this._pendingLoads++,this.fire(new a.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,(u,p)=>{if(this._pendingLoads--,this._removed||p&&p.abandoned)return void this.fire(new a.Event("dataabort",{dataType:"source",sourceDataType:t}));let f=null;if(p&&p.resourceTiming&&p.resourceTiming[this.id]&&(f=p.resourceTiming[this.id].slice(0)),u)return void this.fire(new a.ErrorEvent(u));const _={dataType:"source",sourceDataType:t};this._collectResourceTiming&&f&&f.length>0&&a.extend(_,{resourceTiming:f}),this.fire(new a.Event("data",_))})}loaded(){return this._pendingLoads===0}loadTile(t,n){const s=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const u={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(s,u,(p,f)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):p?n(p):(t.loadVectorData(f,this.map.painter,s==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var wi=a.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ci extends a.Evented{constructor(t,n,s,u){super(),this.id=t,this.dispatcher=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(u),this.options=n}load(t,n){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(s,u)=>{this._loaded=!0,s?this.fire(new a.ErrorEvent(s)):u&&(this.image=u,t&&(this.coordinates=t),n&&n(),this._finishLoading())})}loaded(){return this._loaded}updateImage(t){return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}setCoordinates(t){this.coordinates=t;const n=t.map(a.MercatorCoordinate.fromLngLat);this.tileID=function(u){let p=1/0,f=1/0,_=-1/0,y=-1/0;for(const k of u)p=Math.min(p,k.x),f=Math.min(f,k.y),_=Math.max(_,k.x),y=Math.max(y,k.y);const v=Math.max(_-p,y-f),S=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),M=Math.pow(2,S);return new a.CanonicalTileID(S,Math.floor((p+_)/2*M),Math.floor((f+y)/2*M))}(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map(u=>this.tileID.getTilePoint(u)._round());return this._boundsArray=new a.RasterBoundsArray,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,a.EXTENT,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,a.EXTENT),this._boundsArray.emplaceBack(s[2].x,s[2].y,a.EXTENT,a.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,wi.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new $e(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));for(const s in this.tiles){const u=this.tiles[s];u.state!=="loaded"&&(u.state="loaded",u.texture=this.texture)}}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Ai extends Ci{constructor(t,n,s,u){super(t,n,s,u),this.roundZoom=!0,this.type="video",this.options=n}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,a.ResourceType.Source).url);a.getVideo(this.urls,(n,s)=>{this._loaded=!0,n?this.fire(new a.ErrorEvent(n)):s&&(this.video=s,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;t<n.start(0)||t>n.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,wi.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new $e(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));for(const s in this.tiles){const u=this.tiles[s];u.state!=="loaded"&&(u.state="loaded",u.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Kr extends Ci{constructor(t,n,s,u){super(t,n,s,u),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(f=>typeof f!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,s=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,wi.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new $e(n,this.canvas,s.RGBA,{premultiply:!0});for(const u in this.tiles){const p=this.tiles[u];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const gn={vector:Rt,raster:pi,"raster-dem":Xe,geojson:Bi,video:Ai,image:Ci,canvas:Kr};function _n(l,t){const n=a.create();return a.translate(n,n,[1,1,0]),a.scale(n,n,[.5*l.width,.5*l.height,1]),a.multiply(n,n,l.calculatePosMatrix(t.toUnwrapped()))}function yn(l,t,n,s,u,p){const f=function(M,k,V){if(M)for(const $ of M){const U=k[$];if(U&&U.source===V&&U.type==="fill-extrusion")return!0}else for(const $ in k){const U=k[$];if(U.source===V&&U.type==="fill-extrusion")return!0}return!1}(u&&u.layers,t,l.id),_=p.maxPitchScaleFactor(),y=l.tilesIn(s,_,f);y.sort(hr);const v=[];for(const M of y)v.push({wrappedTileID:M.tileID.wrapped().key,queryResults:M.tile.queryRenderedFeatures(t,n,l._state,M.queryGeometry,M.cameraQueryGeometry,M.scale,u,p,_,_n(l.transform,M.tileID))});const S=function(M){const k={},V={};for(const $ of M){const U=$.queryResults,H=$.wrappedTileID,Y=V[H]=V[H]||{};for(const ne in U){const G=U[ne],le=Y[ne]=Y[ne]||{},se=k[ne]=k[ne]||[];for(const me of G)le[me.featureIndex]||(le[me.featureIndex]=!0,se.push(me))}}return k}(v);for(const M in S)S[M].forEach(k=>{const V=k.feature,$=l.getFeatureState(V.layer["source-layer"],V.id);V.source=V.layer.source,V.layer["source-layer"]&&(V.sourceLayer=V.layer["source-layer"]),V.state=$});return S}function hr(l,t){const n=l.tileID,s=t.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}class Dr{constructor(t,n){this.tileID=t,this.uid=a.uniqueId(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const n=t+this.timeAdded;n<a.exported.now()||this.fadeEndTime&&n<this.fadeEndTime||(this.fadeEndTime=n)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.textures.forEach(n=>t.saveTileTexture(n)),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(t,n,s){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(u,p){const f={};if(!p)return f;for(const _ of u){const y=_.layerIds.map(v=>p.getLayer(v)).filter(Boolean);if(y.length!==0){_.layers=y,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(v=>y.filter(S=>S.id===v)[0]));for(const v of y)f[v.id]=_}}return f}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof a.SymbolBucket){if(this.hasSymbolBuckets=!0,!s)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof a.SymbolBucket&&p.hasRTLText){this.hasRTLText=!0,a.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(u).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new a.CollisionBoxArray}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const s in this.buckets){const u=this.buckets[s];u.uploadPending()&&u.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new $e(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new $e(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,s,u,p,f,_,y,v,S){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:u,cameraQueryGeometry:p,scale:f,tileSize:this.tileSize,pixelPosMatrix:S,transform:y,params:_,queryPadding:this.queryPadding*v},t,n,s):{}}querySourceFeatures(t,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const u=s.loadVTLayers(),p=n?n.sourceLayer:"",f=u._geojsonTileLayer||u[p];if(!f)return;const _=a.createFilter(n&&n.filter),{z:y,x:v,y:S}=this.tileID.canonical,M={z:y,x:v,y:S};for(let k=0;k<f.length;k++){const V=f.feature(k);if(_.needGeometry){const H=a.toEvaluationFeature(V,!0);if(!_.filter(new a.EvaluationParameters(this.tileID.overscaledZ),H,this.tileID.canonical))continue}else if(!_.filter(new a.EvaluationParameters(this.tileID.overscaledZ),V))continue;const $=s.getId(V,p),U=new a.GeoJSONFeature(V,y,v,S,$);U.tile=M,t.push(U)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const n=this.expirationTime;if(t.cacheControl){const s=a.parseCacheControl(t.cacheControl);s["max-age"]&&(this.expirationTime=Date.now()+1e3*s["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const s=Date.now();let u=!1;if(this.expirationTime>s)u=!1;else if(n)if(this.expirationTime<n)u=!0;else{const p=this.expirationTime-n;p?this.expirationTime=s+Math.max(p,3e4):u=!0}else u=!0;u?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(t,n){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;const s=this.latestFeatureIndex.loadVTLayers();for(const u in this.buckets){if(!n.style.hasLayer(u))continue;const p=this.buckets[u],f=p.layers[0].sourceLayer||"_geojsonTileLayer",_=s[f],y=t[f];if(!_||!y||Object.keys(y).length===0)continue;p.update(y,_,this.imageAtlas&&this.imageAtlas.patternPositions||{});const v=n&&n.style&&n.style.getLayer(u);v&&(this.queryPadding=Math.max(this.queryPadding,v.queryRadius(p)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=a.exported.now()+t}setDependencies(t,n){const s={};for(const u of n)s[u]=!0;this.dependencies[t]=s}hasDependency(t,n){for(const s of t){const u=this.dependencies[s];if(u){for(const p of n)if(u[p])return!0}}return!1}}class Lr{constructor(t,n){this.max=t,this.onRemove=n,this.reset()}reset(){for(const t in this.data)for(const n of this.data[t])n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value);return this.data={},this.order=[],this}add(t,n,s){const u=t.wrapped().key;this.data[u]===void 0&&(this.data[u]=[]);const p={value:n,timeout:void 0};if(s!==void 0&&(p.timeout=setTimeout(()=>{this.remove(t,p)},s)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const s=t.wrapped().key,u=n===void 0?0:this.data[s].indexOf(n),p=this.data[s][u];return this.data[s].splice(u,1),p.timeout&&clearTimeout(p.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(p.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const s in this.data)for(const u of this.data[s])t(u.value)||n.push(u);for(const s of n)this.remove(s.value.tileID,s)}}class Rr{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,s){const u=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][u]=this.stateChanges[t][u]||{},a.extend(this.stateChanges[t][u],s),this.deletedStates[t]===null){this.deletedStates[t]={};for(const p in this.state[t])p!==u&&(this.deletedStates[t][p]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][u]===null){this.deletedStates[t][u]={};for(const p in this.state[t][u])s[p]||(this.deletedStates[t][u][p]=null)}else for(const p in s)this.deletedStates[t]&&this.deletedStates[t][u]&&this.deletedStates[t][u][p]===null&&delete this.deletedStates[t][u][p]}removeFeatureState(t,n,s){if(this.deletedStates[t]===null)return;const u=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},s&&n!==void 0)this.deletedStates[t][u]!==null&&(this.deletedStates[t][u]=this.deletedStates[t][u]||{},this.deletedStates[t][u][s]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][u])for(s in this.deletedStates[t][u]={},this.stateChanges[t][u])this.deletedStates[t][u][s]=null;else this.deletedStates[t][u]=null;else this.deletedStates[t]=null}getState(t,n){const s=String(n),u=a.extend({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const p=this.deletedStates[t][n];if(p===null)return{};for(const f in p)delete u[f]}return u}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const s={};for(const u in this.stateChanges){this.state[u]=this.state[u]||{};const p={};for(const f in this.stateChanges[u])this.state[u][f]||(this.state[u][f]={}),a.extend(this.state[u][f],this.stateChanges[u][f]),p[f]=this.state[u][f];s[u]=p}for(const u in this.deletedStates){this.state[u]=this.state[u]||{};const p={};if(this.deletedStates[u]===null)for(const f in this.state[u])p[f]={},this.state[u][f]={};else for(const f in this.deletedStates[u]){if(this.deletedStates[u][f]===null)this.state[u][f]={};else for(const _ of Object.keys(this.deletedStates[u][f]))delete this.state[u][f][_];p[f]=this.state[u][f]}s[u]=s[u]||{},a.extend(s[u],p)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(const u in t)t[u].setFeatureState(s,n)}}class Mi extends a.Evented{constructor(t,n,s){super(),this.id=t,this.dispatcher=s,this.on("data",u=>{u.dataType==="source"&&u.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&u.dataType==="source"&&u.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(u,p,f,_){const y=new gn[p.type](u,p,f,_);if(y.id!==u)throw new Error(`Expected Source id to be ${u} instead of ${y.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],y),y}(t,n,s,this),this._tiles={},this._cache=new Lr(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Rr}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new a.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const s=this._tiles[n];s.upload(t),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(xn).map(t=>t.key)}getRenderableIds(t){const n=[];for(const s in this._tiles)this._isIdRenderable(s,t)&&n.push(this._tiles[s]);return t?n.sort((s,u)=>{const p=s.tileID,f=u.tileID,_=new a.pointGeometry(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),y=new a.pointGeometry(f.canonical.x,f.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-f.overscaledZ||y.y-_.y||y.x-_.x}).map(s=>s.tileID.key):n.map(s=>s.tileID).sort(xn).map(s=>s.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){const s=this._tiles[t];s&&(s.state!=="loading"&&(s.state=n),this._loadTile(s,this._tileLoaded.bind(this,s,t,n)))}_tileLoaded(t,n,s,u){if(u)return t.state="errored",void(u.status!==404?this._source.fire(new a.ErrorEvent(u,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=a.exported.now(),s==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new a.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let u=0;u<n.length;u++){const p=n[u];if(t.neighboringTiles&&t.neighboringTiles[p]){const f=this.getTileByID(p);s(t,f),s(f,t)}}function s(u,p){u.needsHillshadePrepare=!0,u.needsTerrainPrepare=!0;let f=p.tileID.canonical.x-u.tileID.canonical.x;const _=p.tileID.canonical.y-u.tileID.canonical.y,y=Math.pow(2,u.tileID.canonical.z),v=p.tileID.key;f===0&&_===0||Math.abs(_)>1||(Math.abs(f)>1&&(Math.abs(f+y)===1?f+=y:Math.abs(f-y)===1&&(f-=y)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,f,_),u.neighboringTiles&&u.neighboringTiles[v]&&(u.neighboringTiles[v].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,s,u){for(const p in this._tiles){let f=this._tiles[p];if(u[p]||!f.hasData()||f.tileID.overscaledZ<=n||f.tileID.overscaledZ>s)continue;let _=f.tileID;for(;f&&f.tileID.overscaledZ>n+1;){const v=f.tileID.scaledTo(f.tileID.overscaledZ-1);f=this._tiles[v.key],f&&f.hasData()&&(_=v)}let y=_;for(;y.overscaledZ>n;)if(y=y.scaledTo(y.overscaledZ-1),t[y.key]){u[_.key]=_;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const s=this._loadedParentTiles[t.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=t.overscaledZ-1;s>=n;s--){const u=t.scaledTo(s),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,u=Math.floor(n*s*5),p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(p)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const s={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+n),s[p.tileID.key]=p}this._tiles=s;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(u,this._tiles[u])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let s;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(v=>new a.OverscaledTileID(v.canonical.z,v.wrap,v.canonical.z,v.canonical.x,v.canonical.y)):(s=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(s=s.filter(v=>this._source.hasTile(v)))):s=[];const u=t.coveringZoomLevel(this._source),p=Math.max(u-Mi.maxOverzooming,this._source.minzoom),f=Math.max(u+Mi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const v={};for(const S of s)if(S.canonical.z>this._source.minzoom){const M=S.scaledTo(S.canonical.z-1);v[M.key]=M;const k=S.scaledTo(Math.max(this._source.minzoom,Math.min(S.canonical.z,5)));v[k.key]=k}s=s.concat(Object.values(v))}const _=this._updateRetainedTiles(s,u);if(jn(this._source.type)){const v={},S={},M=Object.keys(_);for(const k of M){const V=_[k],$=this._tiles[k];if(!$||$.fadeEndTime&&$.fadeEndTime<=a.exported.now())continue;const U=this.findLoadedParent(V,p);U&&(this._addTile(U.tileID),v[U.tileID.key]=U.tileID),S[k]=V}this._retainLoadedChildren(S,u,f,_);for(const k in v)_[k]||(this._coveredTiles[k]=!0,_[k]=v[k]);if(n){const k={},V={};for(const $ of s)this._tiles[$.key].hasData()?k[$.key]=$:V[$.key]=$;for(const $ in V){const U=V[$].children(this._source.maxzoom);this._tiles[U[0].key]&&this._tiles[U[1].key]&&this._tiles[U[2].key]&&this._tiles[U[3].key]&&(k[U[0].key]=_[U[0].key]=U[0],k[U[1].key]=_[U[1].key]=U[1],k[U[2].key]=_[U[2].key]=U[2],k[U[3].key]=_[U[3].key]=U[3],delete V[$])}for(const $ in V){const U=this.findLoadedParent(V[$],this._source.minzoom);if(U){k[U.tileID.key]=_[U.tileID.key]=U.tileID;for(const H in k)k[H].isChildOf(U.tileID)&&delete k[H]}}for(const $ in this._tiles)k[$]||(this._coveredTiles[$]=!0)}}for(const v in _)this._tiles[v].clearFadeHold();const y=a.keysDifference(this._tiles,_);for(const v of y){const S=this._tiles[v];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(v)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const s={},u={},p=Math.max(n-Mi.maxOverzooming,this._source.minzoom),f=Math.max(n+Mi.maxUnderzooming,this._source.minzoom),_={};for(const y of t){const v=this._addTile(y);s[y.key]=y,v.hasData()||n<this._source.maxzoom&&(_[y.key]=y)}this._retainLoadedChildren(_,n,f,s);for(const y of t){let v=this._tiles[y.key];if(v.hasData())continue;if(n+1>this._source.maxzoom){const M=y.children(this._source.maxzoom)[0],k=this.getTile(M);if(k&&k.hasData()){s[M.key]=M;continue}}else{const M=y.children(this._source.maxzoom);if(s[M[0].key]&&s[M[1].key]&&s[M[2].key]&&s[M[3].key])continue}let S=v.wasRequested();for(let M=y.overscaledZ-1;M>=p;--M){const k=y.scaledTo(M);if(u[k.key]||(u[k.key]=!0,v=this.getTile(k),!v&&S&&(v=this._addTile(k)),v&&(s[k.key]=k,S=v.wasRequested(),v.hasData())))break}}return s}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let s,u=this._tiles[t].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){s=this._loadedParentTiles[u.key];break}n.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(s=this._getLoadedTile(p),s)break;u=p}for(const p of n)this._loadedParentTiles[p]=s}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const s=n;return n||(n=new Dr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,s||this._source.fire(new a.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const s=n.getExpiryTimeout();s&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},s))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,s){const u=[],p=this.transform;if(!p)return u;const f=s?p.getCameraQueryGeometry(t):t,_=t.map($=>p.pointCoordinate($,this.terrain)),y=f.map($=>p.pointCoordinate($,this.terrain)),v=this.getIds();let S=1/0,M=1/0,k=-1/0,V=-1/0;for(const $ of y)S=Math.min(S,$.x),M=Math.min(M,$.y),k=Math.max(k,$.x),V=Math.max(V,$.y);for(let $=0;$<v.length;$++){const U=this._tiles[v[$]];if(U.holdingForFade())continue;const H=U.tileID,Y=Math.pow(2,p.zoom-U.tileID.overscaledZ),ne=n*U.queryPadding*a.EXTENT/U.tileSize/Y,G=[H.getTilePoint(new a.MercatorCoordinate(S,M)),H.getTilePoint(new a.MercatorCoordinate(k,V))];if(G[0].x-ne<a.EXTENT&&G[0].y-ne<a.EXTENT&&G[1].x+ne>=0&&G[1].y+ne>=0){const le=_.map(me=>H.getTilePoint(me)),se=y.map(me=>H.getTilePoint(me));u.push({tile:U,tileID:H,queryGeometry:le,cameraQueryGeometry:se,scale:Y})}}return u}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(s=>this._tiles[s].tileID);for(const s of n)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(jn(this._source.type))for(const t in this._tiles){const n=this._tiles[t];if(n.fadeEndTime!==void 0&&n.fadeEndTime>=a.exported.now())return!0}return!1}setFeatureState(t,n,s){this._state.updateState(t=t||"_geojsonTileLayer",n,s)}removeFeatureState(t,n,s){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,s)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,s){const u=this._tiles[t];u&&u.setDependencies(n,s)}reloadTilesForDependencies(t,n){for(const s in this._tiles)this._tiles[s].hasDependency(t,n)&&this._reloadTile(s,"reloading");this._cache.filter(s=>!s.hasDependency(t,n))}}function xn(l,t){const n=Math.abs(2*l.wrap)-+(l.wrap<0),s=Math.abs(2*t.wrap)-+(t.wrap<0);return l.overscaledZ-t.overscaledZ||s-n||t.canonical.y-l.canonical.y||t.canonical.x-l.canonical.x}function jn(l){return l==="raster"||l==="image"||l==="video"}Mi.maxOverzooming=10,Mi.maxUnderzooming=3;const br="mapboxgl_preloaded_worker_pool";class Fi{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Fi.workerCount;)this.workers.push(new Worker(sn.workerUrl));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach(n=>{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[br]}numActive(){return Object.keys(this.active).length}}const Xn=Math.floor(a.exported.hardwareConcurrency/2);let Br;function vn(){return Br||(Br=new Fi),Br}function bn(l,t){const n={};for(const s in l)s!=="ref"&&(n[s]=l[s]);return a.refProperties.forEach(s=>{s in t&&(n[s]=t[s])}),n}function Wn(l){l=l.slice();const t=Object.create(null);for(let n=0;n<l.length;n++)t[l[n].id]=l[n];for(let n=0;n<l.length;n++)"ref"in l[n]&&(l[n]=bn(l[n],t[l[n].ref]));return l}Fi.workerCount=Math.max(Math.min(Xn,6),1);const yt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function pr(l,t,n){n.push({command:yt.addSource,args:[l,t[l]]})}function Fr(l,t,n){t.push({command:yt.removeSource,args:[l]}),n[l]=!0}function Or(l,t,n,s){Fr(l,n,s),pr(l,t,n)}function Hn(l,t,n){let s;for(s in l[n])if(Object.prototype.hasOwnProperty.call(l[n],s)&&s!=="data"&&!ue(l[n][s],t[n][s]))return!1;for(s in t[n])if(Object.prototype.hasOwnProperty.call(t[n],s)&&s!=="data"&&!ue(l[n][s],t[n][s]))return!1;return!0}function wr(l,t,n,s,u,p){let f;for(f in t=t||{},l=l||{})Object.prototype.hasOwnProperty.call(l,f)&&(ue(l[f],t[f])||n.push({command:p,args:[s,f,t[f],u]}));for(f in t)Object.prototype.hasOwnProperty.call(t,f)&&!Object.prototype.hasOwnProperty.call(l,f)&&(ue(l[f],t[f])||n.push({command:p,args:[s,f,t[f],u]}))}function Tr(l){return l.id}function wn(l,t){return l[t.id]=t,l}class Er{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let s=1;s<this.points.length;s++)this._distances[s]=this._distances[s-1]+this.points[s].dist(this.points[s-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=a.clamp(t,0,1);let n=1,s=this._distances[n];const u=t*this.paddedLength+this.padding;for(;s<u&&n<this._distances.length;)s=this._distances[++n];const p=n-1,f=this._distances[p],_=s-f,y=_>0?(u-f)/_:0;return this.points[p].mult(1-y).add(this.points[n].mult(y))}}function _e(l,t){let n=!0;return l==="always"||l!=="never"&&t!=="never"||(n=!1),n}class Me{constructor(t,n,s){const u=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(t/s),this.yCellCount=Math.ceil(n/s);for(let f=0;f<this.xCellCount*this.yCellCount;f++)u.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=n,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,n,s,u,p){this._forEachCell(n,s,u,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(u),this.bboxes.push(p)}insertCircle(t,n,s,u){this._forEachCell(n-u,s-u,n+u,s+u,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(n),this.circles.push(s),this.circles.push(u)}_insertBoxCell(t,n,s,u,p,f){this.boxCells[p].push(f)}_insertCircleCell(t,n,s,u,p,f){this.circleCells[p].push(f)}_query(t,n,s,u,p,f,_){if(s<0||t>this.width||u<0||n>this.height)return[];const y=[];if(t<=0&&n<=0&&this.width<=s&&this.height<=u){if(p)return[{key:null,x1:t,y1:n,x2:s,y2:u}];for(let v=0;v<this.boxKeys.length;v++)y.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(let v=0;v<this.circleKeys.length;v++){const S=this.circles[3*v],M=this.circles[3*v+1],k=this.circles[3*v+2];y.push({key:this.circleKeys[v],x1:S-k,y1:M-k,x2:S+k,y2:M+k})}}else this._forEachCell(t,n,s,u,this._queryCell,y,{hitTest:p,overlapMode:f,seenUids:{box:{},circle:{}}},_);return y}query(t,n,s,u){return this._query(t,n,s,u,!1,null)}hitTest(t,n,s,u,p,f){return this._query(t,n,s,u,!0,p,f).length>0}hitTestCircle(t,n,s,u,p){const f=t-s,_=t+s,y=n-s,v=n+s;if(_<0||f>this.width||v<0||y>this.height)return!1;const S=[];return this._forEachCell(f,y,_,v,this._queryCellCircle,S,{hitTest:!0,overlapMode:u,circle:{x:t,y:n,radius:s},seenUids:{box:{},circle:{}}},p),S.length>0}_queryCell(t,n,s,u,p,f,_,y){const{seenUids:v,hitTest:S,overlapMode:M}=_,k=this.boxCells[p];if(k!==null){const $=this.bboxes;for(const U of k)if(!v.box[U]){v.box[U]=!0;const H=4*U,Y=this.boxKeys[U];if(t<=$[H+2]&&n<=$[H+3]&&s>=$[H+0]&&u>=$[H+1]&&(!y||y(Y))&&(!S||!_e(M,Y.overlapMode))&&(f.push({key:Y,x1:$[H],y1:$[H+1],x2:$[H+2],y2:$[H+3]}),S))return!0}}const V=this.circleCells[p];if(V!==null){const $=this.circles;for(const U of V)if(!v.circle[U]){v.circle[U]=!0;const H=3*U,Y=this.circleKeys[U];if(this._circleAndRectCollide($[H],$[H+1],$[H+2],t,n,s,u)&&(!y||y(Y))&&(!S||!_e(M,Y.overlapMode))){const ne=$[H],G=$[H+1],le=$[H+2];if(f.push({key:Y,x1:ne-le,y1:G-le,x2:ne+le,y2:G+le}),S)return!0}}}return!1}_queryCellCircle(t,n,s,u,p,f,_,y){const{circle:v,seenUids:S,overlapMode:M}=_,k=this.boxCells[p];if(k!==null){const $=this.bboxes;for(const U of k)if(!S.box[U]){S.box[U]=!0;const H=4*U,Y=this.boxKeys[U];if(this._circleAndRectCollide(v.x,v.y,v.radius,$[H+0],$[H+1],$[H+2],$[H+3])&&(!y||y(Y))&&!_e(M,Y.overlapMode))return f.push(!0),!0}}const V=this.circleCells[p];if(V!==null){const $=this.circles;for(const U of V)if(!S.circle[U]){S.circle[U]=!0;const H=3*U,Y=this.circleKeys[U];if(this._circlesCollide($[H],$[H+1],$[H+2],v.x,v.y,v.radius)&&(!y||y(Y))&&!_e(M,Y.overlapMode))return f.push(!0),!0}}}_forEachCell(t,n,s,u,p,f,_,y){const v=this._convertToXCellCoord(t),S=this._convertToYCellCoord(n),M=this._convertToXCellCoord(s),k=this._convertToYCellCoord(u);for(let V=v;V<=M;V++)for(let $=S;$<=k;$++)if(p.call(this,t,n,s,u,this.xCellCount*$+V,f,_,y))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,s,u,p,f){const _=u-t,y=p-n,v=s+f;return v*v>_*_+y*y}_circleAndRectCollide(t,n,s,u,p,f,_){const y=(f-u)/2,v=Math.abs(t-(u+y));if(v>y+s)return!1;const S=(_-p)/2,M=Math.abs(n-(p+S));if(M>S+s)return!1;if(v<=y||M<=S)return!0;const k=v-y,V=M-S;return k*k+V*V<=s*s}}function Jr(l,t,n,s,u){const p=a.create();return t?(a.scale(p,p,[1/u,1/u,1]),n||a.rotateZ(p,p,s.angle)):a.multiply(p,s.labelPlaneMatrix,l),p}function ir(l,t,n,s,u){if(t){const p=a.clone(l);return a.scale(p,p,[u,u,1]),n||a.rotateZ(p,p,-s.angle),p}return s.glCoordMatrix}function xt(l,t,n){let s;n?(s=[l.x,l.y,n(l.x,l.y),1],a.transformMat4(s,s,t)):(s=[l.x,l.y,0,1],Sr(s,s,t));const u=s[3];return{point:new a.pointGeometry(s[0]/u,s[1]/u),signedDistanceFromCamera:u}}function Ki(l,t){return .5+l/t*.5}function Oi(l,t){const n=l[0]/l[3],s=l[1]/l[3];return n>=-t[0]&&n<=t[0]&&s>=-t[1]&&s<=t[1]}function $i(l,t,n,s,u,p,f,_,y,v){const S=s?l.textSizeData:l.iconSizeData,M=a.evaluateSizeForZoom(S,n.transform.zoom),k=[256/n.width*2+1,256/n.height*2+1],V=s?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;V.clear();const $=l.lineVertexArray,U=s?l.text.placedSymbolArray:l.icon.placedSymbolArray,H=n.transform.width/n.transform.height;let Y=!1;for(let ne=0;ne<U.length;ne++){const G=U.get(ne);if(G.hidden||G.writingMode===a.WritingMode.vertical&&!Y){rt(G.numGlyphs,V);continue}let le;if(Y=!1,v?(le=[G.anchorX,G.anchorY,v(G.anchorX,G.anchorY),1],a.transformMat4(le,le,t)):(le=[G.anchorX,G.anchorY,0,1],Sr(le,le,t)),!Oi(le,k)){rt(G.numGlyphs,V);continue}const se=Ki(n.transform.cameraToCenterDistance,le[3]),me=a.evaluateSizeForFeature(S,M,G),ge=f?me/se:me*se,be=new a.pointGeometry(G.anchorX,G.anchorY),de=xt(be,u,v).point,Re={},Ce=lt(G,ge,!1,_,t,u,p,l.glyphOffsetArray,$,V,de,be,Re,H,y,v);Y=Ce.useVertical,(Ce.notEnoughRoom||Y||Ce.needsFlipping&<(G,ge,!0,_,t,u,p,l.glyphOffsetArray,$,V,de,be,Re,H,y,v).notEnoughRoom)&&rt(G.numGlyphs,V)}s?l.text.dynamicLayoutVertexBuffer.updateData(V):l.icon.dynamicLayoutVertexBuffer.updateData(V)}function $r(l,t,n,s,u,p,f,_,y,v,S,M,k){const V=_.glyphStartIndex+_.numGlyphs,$=_.lineStartIndex,U=_.lineStartIndex+_.lineLength,H=t.getoffsetX(_.glyphStartIndex),Y=t.getoffsetX(V-1),ne=fi(l*H,n,s,u,p,f,_.segment,$,U,y,v,S,M,k);if(!ne)return null;const G=fi(l*Y,n,s,u,p,f,_.segment,$,U,y,v,S,M,k);return G?{first:ne,last:G}:null}function Ie(l,t,n,s){return l===a.WritingMode.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*s?{useVertical:!0}:(l===a.WritingMode.vertical?t.y<n.y:t.x>n.x)?{needsFlipping:!0}:null}function lt(l,t,n,s,u,p,f,_,y,v,S,M,k,V,$,U){const H=t/24,Y=l.lineOffsetX*H,ne=l.lineOffsetY*H;let G;if(l.numGlyphs>1){const le=l.glyphStartIndex+l.numGlyphs,se=l.lineStartIndex,me=l.lineStartIndex+l.lineLength,ge=$r(H,_,Y,ne,n,S,M,l,y,p,k,$,U);if(!ge)return{notEnoughRoom:!0};const be=xt(ge.first.point,f,U).point,de=xt(ge.last.point,f,U).point;if(s&&!n){const Re=Ie(l.writingMode,be,de,V);if(Re)return Re}G=[ge.first];for(let Re=l.glyphStartIndex+1;Re<le-1;Re++)G.push(fi(H*_.getoffsetX(Re),Y,ne,n,S,M,l.segment,se,me,y,p,k,$,U));G.push(ge.last)}else{if(s&&!n){const se=xt(M,u,U).point,me=l.lineStartIndex+l.segment+1,ge=new a.pointGeometry(y.getx(me),y.gety(me)),be=xt(ge,u,U),de=be.signedDistanceFromCamera>0?be.point:ot(M,ge,se,1,u,U),Re=Ie(l.writingMode,se,de,V);if(Re)return Re}const le=fi(H*_.getoffsetX(l.glyphStartIndex),Y,ne,n,S,M,l.segment,l.lineStartIndex,l.lineStartIndex+l.lineLength,y,p,k,$,U);if(!le)return{notEnoughRoom:!0};G=[le]}for(const le of G)a.addDynamicAttributes(v,le.point,le.angle);return{}}function ot(l,t,n,s,u,p){const f=xt(l.add(l.sub(t)._unit()),u,p).point,_=n.sub(f);return n.add(_._mult(s/_.mag()))}function fi(l,t,n,s,u,p,f,_,y,v,S,M,k,V){const $=s?l-t:l+t;let U=$>0?1:-1,H=0;s&&(U*=-1,H=Math.PI),U<0&&(H+=Math.PI);let Y=U>0?_+f:_+f+1,ne=u,G=u,le=0,se=0;const me=Math.abs($),ge=[];for(;le+se<=me;){if(Y+=U,Y<_||Y>=y)return null;if(G=ne,ge.push(ne),ne=M[Y],ne===void 0){const Be=new a.pointGeometry(v.getx(Y),v.gety(Y)),st=xt(Be,S,V);if(st.signedDistanceFromCamera>0)ne=M[Y]=st.point;else{const ut=Y-U;ne=ot(le===0?p:new a.pointGeometry(v.getx(ut),v.gety(ut)),Be,G,me-le+1,S,V)}}le+=se,se=G.dist(ne)}const be=(me-le)/se,de=ne.sub(G),Re=de.mult(be)._add(G);Re._add(de._unit()._perp()._mult(n*U));const Ce=H+Math.atan2(ne.y-G.y,ne.x-G.x);return ge.push(Re),{point:Re,angle:k?Ce:0,path:ge}}const Ur=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function rt(l,t){for(let n=0;n<l;n++){const s=t.length;t.resize(s+4),t.float32.set(Ur,3*s)}}function Sr(l,t,n){const s=t[0],u=t[1];return l[0]=n[0]*s+n[4]*u+n[12],l[1]=n[1]*s+n[5]*u+n[13],l[3]=n[3]*s+n[7]*u+n[15],l}const oi=100;class Tn{constructor(t,n=new Me(t.width+200,t.height+200,25),s=new Me(t.width+200,t.height+200,25)){this.transform=t,this.grid=n,this.ignoredGrid=s,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+oi,this.screenBottomBoundary=t.height+oi,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,n,s,u,p,f){const _=this.projectAndGetPerspectiveRatio(u,t.anchorPointX,t.anchorPointY,f),y=s*_.perspectiveRatio,v=t.x1*y+_.point.x,S=t.y1*y+_.point.y,M=t.x2*y+_.point.x,k=t.y2*y+_.point.y;return!this.isInsideGrid(v,S,M,k)||n!=="always"&&this.grid.hitTest(v,S,M,k,n,p)||_.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[v,S,M,k],offscreen:this.isOffscreen(v,S,M,k)}}placeCollisionCircles(t,n,s,u,p,f,_,y,v,S,M,k,V,$){const U=[],H=new a.pointGeometry(n.anchorX,n.anchorY),Y=xt(H,f,$),ne=Ki(this.transform.cameraToCenterDistance,Y.signedDistanceFromCamera),G=(S?p/ne:p*ne)/a.ONE_EM,le=xt(H,_,$).point,se=$r(G,u,n.lineOffsetX*G,n.lineOffsetY*G,!1,le,H,n,s,_,{},!1,$);let me=!1,ge=!1,be=!0;if(se){const de=.5*k*ne+V,Re=new a.pointGeometry(-100,-100),Ce=new a.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),Be=new Er,st=se.first,ut=se.last;let We=[];for(let _t=st.path.length-1;_t>=1;_t--)We.push(st.path[_t]);for(let _t=1;_t<ut.path.length;_t++)We.push(ut.path[_t]);const At=2.5*de;if(y){const _t=We.map(wt=>xt(wt,y,$));We=_t.some(wt=>wt.signedDistanceFromCamera<=0)?[]:_t.map(wt=>wt.point)}let Mt=[];if(We.length>0){const _t=We[0].clone(),wt=We[0].clone();for(let zt=1;zt<We.length;zt++)_t.x=Math.min(_t.x,We[zt].x),_t.y=Math.min(_t.y,We[zt].y),wt.x=Math.max(wt.x,We[zt].x),wt.y=Math.max(wt.y,We[zt].y);Mt=_t.x>=Re.x&&wt.x<=Ce.x&&_t.y>=Re.y&&wt.y<=Ce.y?[We]:wt.x<Re.x||_t.x>Ce.x||wt.y<Re.y||_t.y>Ce.y?[]:a.clipLine([We],Re.x,Re.y,Ce.x,Ce.y)}for(const _t of Mt){Be.reset(_t,.25*de);let wt=0;wt=Be.length<=.5*de?1:Math.ceil(Be.paddedLength/At)+1;for(let zt=0;zt<wt;zt++){const ai=zt/Math.max(wt-1,1),gr=Be.lerp(ai),nr=gr.x+oi,_r=gr.y+oi;U.push(nr,_r,de,0);const Xr=nr-de,Yi=_r-de,zi=nr+de,Ar=_r+de;if(be=be&&this.isOffscreen(Xr,Yi,zi,Ar),ge=ge||this.isInsideGrid(Xr,Yi,zi,Ar),t!=="always"&&this.grid.hitTestCircle(nr,_r,de,t,M)&&(me=!0,!v))return{circles:[],offscreen:!1,collisionDetected:me}}}}return{circles:!v&&me||!ge||ne<this.perspectiveRatioCutoff?[]:U,offscreen:be,collisionDetected:me}}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[];let s=1/0,u=1/0,p=-1/0,f=-1/0;for(const S of t){const M=new a.pointGeometry(S.x+oi,S.y+oi);s=Math.min(s,M.x),u=Math.min(u,M.y),p=Math.max(p,M.x),f=Math.max(f,M.y),n.push(M)}const _=this.grid.query(s,u,p,f).concat(this.ignoredGrid.query(s,u,p,f)),y={},v={};for(const S of _){const M=S.key;if(y[M.bucketInstanceId]===void 0&&(y[M.bucketInstanceId]={}),y[M.bucketInstanceId][M.featureIndex])continue;const k=[new a.pointGeometry(S.x1,S.y1),new a.pointGeometry(S.x2,S.y1),new a.pointGeometry(S.x2,S.y2),new a.pointGeometry(S.x1,S.y2)];a.polygonIntersectsPolygon(n,k)&&(y[M.bucketInstanceId][M.featureIndex]=!0,v[M.bucketInstanceId]===void 0&&(v[M.bucketInstanceId]=[]),v[M.bucketInstanceId].push(M.featureIndex))}return v}insertCollisionBox(t,n,s,u,p,f){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:u,featureIndex:p,collisionGroupID:f,overlapMode:n},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,n,s,u,p,f){const _=s?this.ignoredGrid:this.grid,y={bucketInstanceId:u,featureIndex:p,collisionGroupID:f,overlapMode:n};for(let v=0;v<t.length;v+=4)_.insertCircle(y,t[v],t[v+1],t[v+2])}projectAndGetPerspectiveRatio(t,n,s,u){let p;return u?(p=[n,s,u(n,s),1],a.transformMat4(p,p,t)):(p=[n,s,0,1],Sr(p,p,t)),{point:new a.pointGeometry((p[0]/p[3]+1)/2*this.transform.width+oi,(-p[1]/p[3]+1)/2*this.transform.height+oi),perspectiveRatio:.5+this.transform.cameraToCenterDistance/p[3]*.5}}isOffscreen(t,n,s,u){return s<oi||t>=this.screenRightBoundary||u<oi||n>this.screenBottomBoundary}isInsideGrid(t,n,s,u){return s>=0&&t<this.gridRightBoundary&&u>=0&&n<this.gridBottomBoundary}getViewportMatrix(){const t=a.identity([]);return a.translate(t,t,[-100,-100,0]),t}}function Yt(l,t,n){return t*(a.EXTENT/(l.tileSize*Math.pow(2,n-l.tileID.overscaledZ)))}class Ti{constructor(t,n,s,u){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?n:-n))):u&&s?1:0,this.placed=s}isHidden(){return this.opacity===0&&!this.placed}}class Pt{constructor(t,n,s,u,p){this.text=new Ti(t?t.text:null,n,s,p),this.icon=new Ti(t?t.icon:null,n,u,p)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class En{constructor(t,n,s){this.text=t,this.icon=n,this.skipFade=s}}class dr{constructor(){this.invProjMatrix=a.create(),this.viewportMatrix=a.create(),this.circles=[]}}class Yr{constructor(t,n,s,u,p){this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=s,this.bucketIndex=u,this.tileID=p}}class Qr{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const n=++this.maxGroupID;this.collisionGroups[t]={ID:n,predicate:s=>s.collisionGroupID===n}}return this.collisionGroups[t]}}function Sn(l,t,n,s,u){const{horizontalAlign:p,verticalAlign:f}=a.getAnchorAlignment(l),_=-(p-.5)*t,y=-(f-.5)*n,v=a.evaluateVariableOffset(l,s);return new a.pointGeometry(_+v[0]*u,y+v[1]*u)}function en(l,t,n,s,u,p){const{x1:f,x2:_,y1:y,y2:v,anchorPointX:S,anchorPointY:M}=l,k=new a.pointGeometry(t,n);return s&&k._rotate(u?p:-p),{x1:f+k.x,y1:y+k.y,x2:_+k.x,y2:v+k.y,anchorPointX:S,anchorPointY:M}}class O{constructor(t,n,s,u,p){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new Tn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new Qr(u),this.collisionCircleArrays={},this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,s,u){const p=s.getBucket(n),f=s.latestFeatureIndex;if(!p||!f||n.id!==p.layerIds[0])return;const _=s.collisionBoxArray,y=p.layers[0].layout,v=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),S=s.tileSize/a.EXTENT,M=this.transform.calculatePosMatrix(s.tileID.toUnwrapped()),k=y.get("text-pitch-alignment")==="map",V=y.get("text-rotation-alignment")==="map",$=Yt(s,1,this.transform.zoom),U=Jr(M,k,V,this.transform,$);let H=null;if(k){const ne=ir(M,k,V,this.transform,$);H=a.multiply([],this.transform.labelPlaneMatrix,ne)}this.retainedQueryData[p.bucketInstanceId]=new Yr(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,s.tileID);const Y={bucket:p,layout:y,posMatrix:M,textLabelPlaneMatrix:U,labelToScreenMatrix:H,scale:v,textPixelRatio:S,holdingForFade:s.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(u)for(const ne of p.sortKeyRanges){const{sortKey:G,symbolInstanceStart:le,symbolInstanceEnd:se}=ne;t.push({sortKey:G,symbolInstanceStart:le,symbolInstanceEnd:se,parameters:Y})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:Y})}attemptAnchorPlacement(t,n,s,u,p,f,_,y,v,S,M,k,V,$,U,H){const Y=[k.textOffset0,k.textOffset1],ne=Sn(t,s,u,Y,p),G=this.collisionIndex.placeCollisionBox(en(n,ne.x,ne.y,f,_,this.transform.angle),M,y,v,S.predicate,H);if((!U||this.collisionIndex.placeCollisionBox(en(U,ne.x,ne.y,f,_,this.transform.angle),M,y,v,S.predicate,H).box.length!==0)&&G.box.length>0){let le;if(this.prevPlacement&&this.prevPlacement.variableOffsets[k.crossTileID]&&this.prevPlacement.placements[k.crossTileID]&&this.prevPlacement.placements[k.crossTileID].text&&(le=this.prevPlacement.variableOffsets[k.crossTileID].anchor),k.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[k.crossTileID]={textOffset:Y,width:s,height:u,anchor:t,textBoxScale:p,prevAnchor:le},this.markUsedJustification(V,t,k,$),V.allowVerticalPlacement&&(this.markUsedOrientation(V,$,k),this.placedOrientations[k.crossTileID]=$),{shift:ne,placedGlyphBoxes:G}}}placeLayerBucketPart(t,n,s){const{bucket:u,layout:p,posMatrix:f,textLabelPlaneMatrix:_,labelToScreenMatrix:y,textPixelRatio:v,holdingForFade:S,collisionBoxArray:M,partiallyEvaluatedTextSize:k,collisionGroup:V}=t.parameters,$=p.get("text-optional"),U=p.get("icon-optional"),H=a.getOverlapMode(p,"text-overlap","text-allow-overlap"),Y=H==="always",ne=a.getOverlapMode(p,"icon-overlap","icon-allow-overlap"),G=ne==="always",le=p.get("text-rotation-alignment")==="map",se=p.get("text-pitch-alignment")==="map",me=p.get("icon-text-fit")!=="none",ge=p.get("symbol-z-order")==="viewport-y",be=Y&&(G||!u.hasIconData()||U),de=G&&(Y||!u.hasTextData()||$);!u.collisionArrays&&M&&u.deserializeCollisionBoxes(M);const Re=(Ce,Be)=>{if(n[Ce.crossTileID])return;if(S)return void(this.placements[Ce.crossTileID]=new En(!1,!1,!1));let st=!1,ut=!1,We=!0,At=null,Mt={box:null,offscreen:null},_t={box:null,offscreen:null},wt=null,zt=null,ai=null,gr=0,nr=0,_r=0;Be.textFeatureIndex?gr=Be.textFeatureIndex:Ce.useRuntimeCollisionCircles&&(gr=Ce.featureIndex),Be.verticalTextFeatureIndex&&(nr=Be.verticalTextFeatureIndex);const Xr=this.retainedQueryData[u.bucketInstanceId].tileID,Yi=this.terrain?(ii,pt)=>this.terrain.getElevation(Xr,ii,pt):null;for(const ii of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const pt=Be[ii];pt&&(pt.elevation=Yi?Yi(pt.anchorPointX,pt.anchorPointY):0)}const zi=Be.textBox;if(zi){const ii=Ct=>{let li=a.WritingMode.horizontal;if(u.allowVerticalPlacement&&!Ct&&this.prevPlacement){const ci=this.prevPlacement.placedOrientations[Ce.crossTileID];ci&&(this.placedOrientations[Ce.crossTileID]=ci,li=ci,this.markUsedOrientation(u,li,Ce))}return li},pt=(Ct,li)=>{if(u.allowVerticalPlacement&&Ce.numVerticalGlyphVertices>0&&Be.verticalTextBox){for(const ci of u.writingModes)if(ci===a.WritingMode.vertical?(Mt=li(),_t=Mt):Mt=Ct(),Mt&&Mt.box&&Mt.box.length)break}else Mt=Ct()};if(p.get("text-variable-anchor")){let Ct=p.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Ce.crossTileID]){const Gt=this.prevPlacement.variableOffsets[Ce.crossTileID];Ct.indexOf(Gt.anchor)>0&&(Ct=Ct.filter(Qi=>Qi!==Gt.anchor),Ct.unshift(Gt.anchor))}const li=(Gt,Qi,an)=>{const $s=Gt.x2-Gt.x1,On=Gt.y2-Gt.y1,Ka=Ce.textBoxScale,Us=me&&ne==="never"?Qi:null;let Wr={box:[],offscreen:!1};const ln=H!=="never"?2*Ct.length:Ct.length;for(let cn=0;cn<ln;++cn){const Ho=this.attemptAnchorPlacement(Ct[cn%Ct.length],Gt,$s,On,Ka,le,se,v,f,V,cn>=Ct.length?H:"never",Ce,u,an,Us,Yi);if(Ho&&(Wr=Ho.placedGlyphBoxes,Wr&&Wr.box&&Wr.box.length)){st=!0,At=Ho.shift;break}}return Wr};pt(()=>li(zi,Be.iconBox,a.WritingMode.horizontal),()=>{const Gt=Be.verticalTextBox;return u.allowVerticalPlacement&&!(Mt&&Mt.box&&Mt.box.length)&&Ce.numVerticalGlyphVertices>0&&Gt?li(Gt,Be.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null}}),Mt&&(st=Mt.box,We=Mt.offscreen);const ci=ii(Mt&&Mt.box);if(!st&&this.prevPlacement){const Gt=this.prevPlacement.variableOffsets[Ce.crossTileID];Gt&&(this.variableOffsets[Ce.crossTileID]=Gt,this.markUsedJustification(u,Gt.anchor,Ce,ci))}}else{const Ct=(li,ci)=>{const Gt=this.collisionIndex.placeCollisionBox(li,H,v,f,V.predicate,Yi);return Gt&&Gt.box&&Gt.box.length&&(this.markUsedOrientation(u,ci,Ce),this.placedOrientations[Ce.crossTileID]=ci),Gt};pt(()=>Ct(zi,a.WritingMode.horizontal),()=>{const li=Be.verticalTextBox;return u.allowVerticalPlacement&&Ce.numVerticalGlyphVertices>0&&li?Ct(li,a.WritingMode.vertical):{box:null,offscreen:null}}),ii(Mt&&Mt.box&&Mt.box.length)}}if(wt=Mt,st=wt&&wt.box&&wt.box.length>0,We=wt&&wt.offscreen,Ce.useRuntimeCollisionCircles){const ii=u.text.placedSymbolArray.get(Ce.centerJustifiedTextSymbolIndex),pt=a.evaluateSizeForFeature(u.textSizeData,k,ii),Ct=p.get("text-padding");zt=this.collisionIndex.placeCollisionCircles(H,ii,u.lineVertexArray,u.glyphOffsetArray,pt,f,_,y,s,se,V.predicate,Ce.collisionCircleDiameter,Ct,Yi),zt.circles.length&&zt.collisionDetected&&!s&&a.warnOnce("Collisions detected, but collision boxes are not shown"),st=Y||zt.circles.length>0&&!zt.collisionDetected,We=We&&zt.offscreen}if(Be.iconFeatureIndex&&(_r=Be.iconFeatureIndex),Be.iconBox){const ii=pt=>{const Ct=me&&At?en(pt,At.x,At.y,le,se,this.transform.angle):pt;return this.collisionIndex.placeCollisionBox(Ct,ne,v,f,V.predicate,Yi)};_t&&_t.box&&_t.box.length&&Be.verticalIconBox?(ai=ii(Be.verticalIconBox),ut=ai.box.length>0):(ai=ii(Be.iconBox),ut=ai.box.length>0),We=We&&ai.offscreen}const Ar=$||Ce.numHorizontalGlyphVertices===0&&Ce.numVerticalGlyphVertices===0,Wo=U||Ce.numIconVertices===0;if(Ar||Wo?Wo?Ar||(ut=ut&&st):st=ut&&st:ut=st=ut&&st,st&&wt&&wt.box&&this.collisionIndex.insertCollisionBox(wt.box,H,p.get("text-ignore-placement"),u.bucketInstanceId,_t&&_t.box&&nr?nr:gr,V.ID),ut&&ai&&this.collisionIndex.insertCollisionBox(ai.box,ne,p.get("icon-ignore-placement"),u.bucketInstanceId,_r,V.ID),zt&&(st&&this.collisionIndex.insertCollisionCircles(zt.circles,H,p.get("text-ignore-placement"),u.bucketInstanceId,gr,V.ID),s)){const ii=u.bucketInstanceId;let pt=this.collisionCircleArrays[ii];pt===void 0&&(pt=this.collisionCircleArrays[ii]=new dr);for(let Ct=0;Ct<zt.circles.length;Ct+=4)pt.circles.push(zt.circles[Ct+0]),pt.circles.push(zt.circles[Ct+1]),pt.circles.push(zt.circles[Ct+2]),pt.circles.push(zt.collisionDetected?1:0)}if(Ce.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(u.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Ce.crossTileID]=new En(st||be,ut||de,We||u.justReloaded),n[Ce.crossTileID]=!0};if(ge){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Ce=u.getSortedSymbolIndexes(this.transform.angle);for(let Be=Ce.length-1;Be>=0;--Be){const st=Ce[Be];Re(u.symbolInstances.get(st),u.collisionArrays[st])}}else for(let Ce=t.symbolInstanceStart;Ce<t.symbolInstanceEnd;Ce++)Re(u.symbolInstances.get(Ce),u.collisionArrays[Ce]);if(s&&u.bucketInstanceId in this.collisionCircleArrays){const Ce=this.collisionCircleArrays[u.bucketInstanceId];a.invert(Ce.invProjMatrix,f),Ce.viewportMatrix=this.collisionIndex.getViewportMatrix()}u.justReloaded=!1}markUsedJustification(t,n,s,u){let p;p=u===a.WritingMode.vertical?s.verticalPlacedTextSymbolIndex:{left:s.leftJustifiedTextSymbolIndex,center:s.centerJustifiedTextSymbolIndex,right:s.rightJustifiedTextSymbolIndex}[a.getAnchorJustification(n)];const f=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex,s.verticalPlacedTextSymbolIndex];for(const _ of f)_>=0&&(t.text.placedSymbolArray.get(_).crossTileID=p>=0&&_!==p?0:s.crossTileID)}markUsedOrientation(t,n,s){const u=n===a.WritingMode.horizontal||n===a.WritingMode.horizontalOnly?n:0,p=n===a.WritingMode.vertical?n:0,f=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const _ of f)t.text.placedSymbolArray.get(_).placedOrientation=u;s.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=p)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const u=n?n.symbolFadeChange(t):1,p=n?n.opacities:{},f=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],S=p[y];S?(this.opacities[y]=new Pt(S,u,v.text,v.icon),s=s||v.text!==S.text.placed||v.icon!==S.icon.placed):(this.opacities[y]=new Pt(null,u,v.text,v.icon,v.skipFade),s=s||v.text||v.icon)}for(const y in p){const v=p[y];if(!this.opacities[y]){const S=new Pt(v,u,!1,!1);S.isHidden()||(this.opacities[y]=S,s=s||v.text.placed||v.icon.placed)}}for(const y in f)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=f[y]);for(const y in _)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=_[y]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const s={};for(const u of n){const p=u.getBucket(t);p&&u.latestFeatureIndex&&t.id===p.layerIds[0]&&this.updateBucketOpacities(p,s,u.collisionBoxArray)}}updateBucketOpacities(t,n,s){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const u=t.layers[0].layout,p=new Pt(null,0,!1,!1,!0),f=u.get("text-allow-overlap"),_=u.get("icon-allow-overlap"),y=u.get("text-variable-anchor"),v=u.get("text-rotation-alignment")==="map",S=u.get("text-pitch-alignment")==="map",M=u.get("icon-text-fit")!=="none",k=new Pt(null,0,f&&(_||!t.hasIconData()||u.get("icon-optional")),_&&(f||!t.hasTextData()||u.get("text-optional")),!0);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);const V=($,U,H)=>{for(let Y=0;Y<U/4;Y++)$.opacityVertexArray.emplaceBack(H)};for(let $=0;$<t.symbolInstances.length;$++){const U=t.symbolInstances.get($),{numHorizontalGlyphVertices:H,numVerticalGlyphVertices:Y,crossTileID:ne}=U;let G=this.opacities[ne];n[ne]?G=p:G||(G=k,this.opacities[ne]=G),n[ne]=!0;const le=U.numIconVertices>0,se=this.placedOrientations[U.crossTileID],me=se===a.WritingMode.vertical,ge=se===a.WritingMode.horizontal||se===a.WritingMode.horizontalOnly;if(H>0||Y>0){const be=J(G.text);V(t.text,H,me?pe:be),V(t.text,Y,ge?pe:be);const de=G.text.isHidden();[U.rightJustifiedTextSymbolIndex,U.centerJustifiedTextSymbolIndex,U.leftJustifiedTextSymbolIndex].forEach(Be=>{Be>=0&&(t.text.placedSymbolArray.get(Be).hidden=de||me?1:0)}),U.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(U.verticalPlacedTextSymbolIndex).hidden=de||ge?1:0);const Re=this.variableOffsets[U.crossTileID];Re&&this.markUsedJustification(t,Re.anchor,U,se);const Ce=this.placedOrientations[U.crossTileID];Ce&&(this.markUsedJustification(t,"left",U,Ce),this.markUsedOrientation(t,Ce,U))}if(le){const be=J(G.icon),de=!(M&&U.verticalPlacedIconSymbolIndex&&me);U.placedIconSymbolIndex>=0&&(V(t.icon,U.numIconVertices,de?be:pe),t.icon.placedSymbolArray.get(U.placedIconSymbolIndex).hidden=G.icon.isHidden()),U.verticalPlacedIconSymbolIndex>=0&&(V(t.icon,U.numVerticalIconVertices,de?pe:be),t.icon.placedSymbolArray.get(U.verticalPlacedIconSymbolIndex).hidden=G.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const be=t.collisionArrays[$];if(be){let de=new a.pointGeometry(0,0);if(be.textBox||be.verticalTextBox){let Ce=!0;if(y){const Be=this.variableOffsets[ne];Be?(de=Sn(Be.anchor,Be.width,Be.height,Be.textOffset,Be.textBoxScale),v&&de._rotate(S?this.transform.angle:-this.transform.angle)):Ce=!1}be.textBox&&b(t.textCollisionBox.collisionVertexArray,G.text.placed,!Ce||me,de.x,de.y),be.verticalTextBox&&b(t.textCollisionBox.collisionVertexArray,G.text.placed,!Ce||ge,de.x,de.y)}const Re=Boolean(!ge&&be.verticalIconBox);be.iconBox&&b(t.iconCollisionBox.collisionVertexArray,G.icon.placed,Re,M?de.x:0,M?de.y:0),be.verticalIconBox&&b(t.iconCollisionBox.collisionVertexArray,G.icon.placed,!Re,M?de.x:0,M?de.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const $=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=$.invProjMatrix,t.placementViewportMatrix=$.viewportMatrix,t.collisionCircleArray=$.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,n){const s=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*s>t}setStale(){this.stale=!0}}function b(l,t,n,s,u){l.emplaceBack(t?1:0,n?1:0,s||0,u||0),l.emplaceBack(t?1:0,n?1:0,s||0,u||0),l.emplaceBack(t?1:0,n?1:0,s||0,u||0),l.emplaceBack(t?1:0,n?1:0,s||0,u||0)}const C=Math.pow(2,25),R=Math.pow(2,24),B=Math.pow(2,17),j=Math.pow(2,16),K=Math.pow(2,9),W=Math.pow(2,8),X=Math.pow(2,1);function J(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const t=l.placed?1:0,n=Math.floor(127*l.opacity);return n*C+t*R+n*B+t*j+n*K+t*W+n*X+t}const pe=0;class ve{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,s,u,p){const f=this._bucketParts;for(;this._currentTileIndex<t.length;)if(n.getBucketParts(f,u,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort((_,y)=>_.sortKey-y.sortKey));this._currentPartIndex<f.length;)if(n.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,s),this._currentPartIndex++,p())return!0;return!1}}class he{constructor(t,n,s,u,p,f,_,y){this.placement=new O(t,n,f,_,y),this._currentPlacementIndex=s.length-1,this._forceFullPlacement=u,this._showCollisionBoxes=p,this._done=!1}isDone(){return this._done}continuePlacement(t,n,s){const u=a.exported.now(),p=()=>{const f=a.exported.now()-u;return!this._forceFullPlacement&&f>2};for(;this._currentPlacementIndex>=0;){const f=n[t[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if(f.type==="symbol"&&(!f.minzoom||f.minzoom<=_)&&(!f.maxzoom||f.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new ve(f)),this._inProgressLayer.continuePlacement(s[f.source],this.placement,this._showCollisionBoxes,f,p))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Ve=512/a.EXTENT/2;class Ge{constructor(t,n,s){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=s;for(let u=0;u<n.length;u++){const p=n.get(u),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,t)})}}getScaledCoordinates(t,n){const s=Ve/Math.pow(2,n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*a.EXTENT+t.anchorX)*s),y:Math.floor((n.canonical.y*a.EXTENT+t.anchorY)*s)}}findMatches(t,n,s){const u=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let p=0;p<t.length;p++){const f=t.get(p);if(f.crossTileID)continue;const _=this.indexedSymbolInstances[f.key];if(!_)continue;const y=this.getScaledCoordinates(f,n);for(const v of _)if(Math.abs(v.coord.x-y.x)<=u&&Math.abs(v.coord.y-y.y)<=u&&!s[v.crossTileID]){s[v.crossTileID]=!0,f.crossTileID=v.crossTileID;break}}}}class Le{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ke{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const s in this.indexes){const u=this.indexes[s],p={};for(const f in u){const _=u[f];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+n),p[_.tileID.key]=_}this.indexes[s]=p}this.lng=t}addBucket(t,n,s){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let p=0;p<n.symbolInstances.length;p++)n.symbolInstances.get(p).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const u=this.usedCrossTileIDs[t.overscaledZ];for(const p in this.indexes){const f=this.indexes[p];if(Number(p)>t.overscaledZ)for(const _ in f){const y=f[_];y.tileID.isChildOf(t)&&y.findMatches(n.symbolInstances,t,u)}else{const _=f[t.scaledTo(Number(p)).key];_&&_.findMatches(n.symbolInstances,t,u)}}for(let p=0;p<n.symbolInstances.length;p++){const f=n.symbolInstances.get(p);f.crossTileID||(f.crossTileID=s.generate(),u[f.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ge(t,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(t,n){for(const s in n.indexedSymbolInstances)for(const u of n.indexedSymbolInstances[s])delete this.usedCrossTileIDs[t][u.crossTileID]}removeStaleBuckets(t){let n=!1;for(const s in this.indexes){const u=this.indexes[s];for(const p in u)t[u[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(s,u[p]),delete u[p],n=!0)}return n}}class et{constructor(){this.layerIndexes={},this.crossTileIDs=new Le,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,n,s){let u=this.layerIndexes[t.id];u===void 0&&(u=this.layerIndexes[t.id]=new Ke);let p=!1;const f={};u.handleWrapJump(s);for(const _ of n){const y=_.getBucket(t);y&&t.id===y.layerIds[0]&&(y.bucketInstanceId||(y.bucketInstanceId=++this.maxBucketInstanceId),u.addBucket(_.tileID,y,this.crossTileIDs)&&(p=!0),f[y.bucketInstanceId]=!0)}return u.removeStaleBuckets(f)&&(p=!0),p}pruneUnusedLayers(t){const n={};t.forEach(s=>{n[s]=!0});for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}var vt=a.createLayout([{name:"a_pos",type:"Int16",components:2}]);class it extends a.Evented{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=t._cache.max,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(const t in this._tiles){const n=this._tiles[t];n.textures.forEach(s=>s.destroy()),n.textures=[]}}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];for(const s of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))this._renderableTilesKeys.push(s.key),this._tiles[s.key]||(s.posMatrix=new Float64Array(16),a.ortho(s.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),this._tiles[s.key]=new Dr(s,this.tileSize))}removeOutdated(t){const n={};this.renderHistory=this.renderHistory.filter((s,u)=>this.renderHistory.indexOf(s)===u).slice(0,this.renderHistorySize);for(const s of this._renderableTilesKeys)n[s]=!0;for(const s of this.renderHistory)n[s]=!0;for(const s in this._tiles)n[s]||(this._tiles[s].clearTextures(t),delete this._tiles[s])}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const s of this._renderableTilesKeys){const u=this._tiles[s].tileID;if(u.canonical.equals(t.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16),a.ortho(p.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),n[s]=p}else if(u.canonical.isChildOf(t.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16);const f=u.canonical.z-t.canonical.z,_=u.canonical.x-(u.canonical.x>>f<<f),y=u.canonical.y-(u.canonical.y>>f<<f),v=a.EXTENT>>f;a.ortho(p.posMatrix,0,v,0,v,0,1),a.translate(p.posMatrix,p.posMatrix,[-_*v,-y*v,0]),n[s]=p}else if(t.canonical.isChildOf(u.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16);const f=t.canonical.z-u.canonical.z,_=t.canonical.x-(t.canonical.x>>f<<f),y=t.canonical.y-(t.canonical.y>>f<<f),v=a.EXTENT>>f;a.ortho(p.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),a.translate(p.posMatrix,p.posMatrix,[_*v,y*v,0]),a.scale(p.posMatrix,p.posMatrix,[1/2**f,1/2**f,0]),n[s]=p}}return n}getSourceTile(t,n){const s=this.sourceCache._source;let u=t.overscaledZ-this.deltaZoom;if(u>s.maxzoom&&(u=s.maxzoom),u<s.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(u).key);let p=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!p||!p.dem)&&n)for(;u>=s.minzoom&&(!p||!p.dem);)p=this.sourceCache.getTileByID(t.scaledTo(u--).key);return p}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeLoaded>=t)}}class ct{constructor(t,n,s){this.style=t,this.sourceCache=new it(n),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.elevationOffset=typeof s.elevationOffset=="number"?s.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(t,n,s,u=a.EXTENT){if(!(n>=0&&n<u&&s>=0&&s<u))return this.elevationOffset;let p=0;const f=this.getTerrainData(t);if(f.tile&&f.tile.dem){const _=a.transformMat4$1([],[n/u*a.EXTENT,s/u*a.EXTENT],f.u_terrain_matrix),y=[_[0]*f.tile.dem.dim,_[1]*f.tile.dem.dim],v=[Math.floor(y[0]),Math.floor(y[1])],S=f.tile.dem.get(v[0],v[1]),M=f.tile.dem.get(v[0],v[1]+1),k=f.tile.dem.get(v[0]+1,v[1]),V=f.tile.dem.get(v[0]+1,v[1]+1);p=a.number(a.number(S,M,y[0]-v[0]),a.number(k,V,y[0]-v[0]),y[1]-v[1])}return p}rememberForRerender(t,n){for(const s in this.sourceCache._tiles){const u=this.sourceCache._tiles[s];(u.tileID.equals(n)||u.tileID.isChildOf(n))&&(t===this.sourceCache.sourceCache.id&&(u.timeLoaded=Date.now()),this._rerender[t]=this._rerender[t]||{},this._rerender[t][u.tileID.key]=!0)}}needsRerender(t,n){return this._rerender[t]&&this._rerender[t][n.key]}clearRerenderCache(){this._rerender={}}getElevation(t,n,s,u=a.EXTENT){return(this.getDEMElevation(t,n,s,u)+this.elevationOffset)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const u=this.style.map.painter.context,p=new a.RGBAImage({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new $e(u,p,u.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new $e(u,new a.RGBAImage({width:1,height:1}),u.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=a.identity([])}const n=this.sourceCache.getSourceTile(t,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){const u=this.style.map.painter.context;n.demTexture=this.style.map.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new $e(u,n.dem.getPixels(),u.gl.RGBA,{premultiply:!1}),n.demTexture.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}const s=n&&n+n.tileID.key+t.key;if(s&&!this._demMatrixCache[s]){const u=this.sourceCache.sourceCache._source.maxzoom;let p=t.canonical.z-n.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=u?p=t.canonical.z-u:a.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const f=t.canonical.x-(t.canonical.x>>p<<p),_=t.canonical.y-(t.canonical.y>>p<<p),y=a.fromScaling(new Float64Array(16),[1/(a.EXTENT<<p),1/(a.EXTENT<<p),0]);a.translate(y,y,[f*a.EXTENT,_*a.EXTENT,0]),this._demMatrixCache[t.key]={matrix:y,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:s?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_offset:this.elevationOffset,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getRTTFramebuffer(){const t=this.style.map.painter;if(!this._rttFramebuffer){const n=this.sourceCache.tileSize*this.qualityFactor;this._rttFramebuffer=t.context.createFramebuffer(n,n,!0),this._rttFramebuffer.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,n,n))}return this._rttFramebuffer}getFramebuffer(t){const n=this.style.map.painter,s=n.width/devicePixelRatio,u=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===s&&this._fbo.height===u||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new $e(n.context,{width:s,height:u,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new $e(n.context,{width:s,height:u,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=n.context.createFramebuffer(s,u,!0),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,s,u))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.style.map.painter.context;if(this._coordsTexture)return this._coordsTexture;const n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let p=0,f=0;p<this._coordsTextureSize;p++)for(let _=0;_<this._coordsTextureSize;_++,f+=4)n[f+0]=255&_,n[f+1]=255&p,n[f+2]=_>>8<<4|p>>8,n[f+3]=0;const s=new a.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),u=new $e(t,s,t.gl.RGBA,{premultiply:!1});return u.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=u,u}pointCoordinate(t){const n=new Uint8Array(4),s=this.style.map.painter,u=s.context,p=u.gl;u.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),p.readPixels(t.x,s.height/devicePixelRatio-t.y-1,1,1,p.RGBA,p.UNSIGNED_BYTE,n),u.bindFramebuffer.set(null);const f=n[0]+(n[2]>>4<<8),_=n[1]+((15&n[2])<<8),y=this.coordsIndex[255-n[3]],v=y&&this.sourceCache.getTileByID(y);if(!v)return null;const S=this._coordsTextureSize,M=(1<<v.tileID.canonical.z)*S;return new a.MercatorCoordinate((v.tileID.canonical.x*S+f)/M,(v.tileID.canonical.y*S+_)/M,this.getElevation(v.tileID,f,_,S))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.style.map.painter.context,n=new a.PosArray,s=new a.TriangleIndexArray,u=this.meshSize,p=a.EXTENT/u,f=u*u;for(let _=0;_<=u;_++)for(let y=0;y<=u;y++)n.emplaceBack(y*p,_*p);for(let _=0;_<f;_+=u+1)for(let y=0;y<u;y++)s.emplaceBack(y+_,u+y+_+1,u+y+_+2),s.emplaceBack(y+_,u+y+_+2,y+_+1);return this._mesh={indexBuffer:t.createIndexBuffer(s),vertexBuffer:t.createVertexBuffer(n,vt.members),segments:a.SegmentVector.simpleSegment(0,0,n.length,s.length)},this._mesh}getMinMaxElevation(t){const n=this.getTerrainData(t).tile,s={minElevation:null,maxElevation:null};return n&&n.dem&&(s.minElevation=(n.dem.min+this.elevationOffset)*this.exaggeration,s.maxElevation=(n.dem.max+this.elevationOffset)*this.exaggeration),s}}const bt=(l,t)=>a.emitValidationErrors(l,t&&t.filter(n=>n.identifier!=="source.canvas")),kt=a.pick(yt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),si=a.pick(yt,["setCenter","setZoom","setBearing","setPitch"]),$t=function(){const l={},t=a.spec.$version;for(const n in a.spec.$root){const s=a.spec.$root[n];if(s.required){let u=null;u=n==="version"?t:s.type==="array"?[]:{},u!=null&&(l[n]=u)}}return l}();class _i extends a.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new Wi(vn(),this),this.imageManager=new Ye,this.imageManager.setEventedParent(this),this.glyphManager=new at(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new vr(256,512),this.crossTileSymbolIndex=new et,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new a.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());const s=this;this._rtlTextPluginCallback=_i.registerForPluginStateChange(u=>{s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:u.pluginStatus,pluginURL:u.pluginURL},(p,f)=>{if(a.triggerPluginCompletionEvent(p),f&&f.every(_=>_))for(const _ in s.sourceCaches)s.sourceCaches[_].reload()})}),this.on("data",u=>{if(u.dataType!=="source"||u.sourceDataType!=="metadata")return;const p=this.sourceCaches[u.sourceId];if(!p)return;const f=p.getSource();if(f&&f.vectorLayerIds)for(const _ in this._layers){const y=this._layers[_];y.source===f.id&&this._validateLayer(y)}})}loadURL(t,n={}){this.fire(new a.Event("dataloading",{dataType:"style"}));const s=typeof n.validate!="boolean"||n.validate,u=this.map._requestManager.transformRequest(t,a.ResourceType.Style);this._request=a.getJSON(u,(p,f)=>{this._request=null,p?this.fire(new a.ErrorEvent(p)):f&&this._load(f,s)})}loadJSON(t,n={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(t,n.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load($t,!1)}_load(t,n){if(n&&bt(this,a.validateStyle(t)))return;this._loaded=!0,this.stylesheet=t;for(const u in t.sources)this.addSource(u,t.sources[u],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);const s=Wn(this.stylesheet.layers);this._order=s.map(u=>u.id),this._layers={},this._serializedLayers={};for(let u of s)u=a.createStyleLayer(u),u.setEventedParent(this,{layer:{id:u.id}}),this._layers[u.id]=u,this._serializedLayers[u.id]=u.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Jt(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}_loadSprite(t){this._spriteRequest=function(n,s,u,p){let f,_,y;const v=u>1?"@2x":"";let S=a.getJSON(s.transformRequest(s.normalizeSpriteURL(n,v,".json"),a.ResourceType.SpriteJSON),(V,$)=>{S=null,y||(y=V,f=$,k())}),M=a.getImage(s.transformRequest(s.normalizeSpriteURL(n,v,".png"),a.ResourceType.SpriteImage),(V,$)=>{M=null,y||(y=V,_=$,k())});function k(){if(y)p(y);else if(f&&_){const V=a.exported.getImageData(_),$={};for(const U in f){const{width:H,height:Y,x:ne,y:G,sdf:le,pixelRatio:se,stretchX:me,stretchY:ge,content:be}=f[U],de=new a.RGBAImage({width:H,height:Y});a.RGBAImage.copy(V,de,{x:ne,y:G},{x:0,y:0},{width:H,height:Y}),$[U]={data:de,pixelRatio:se,sdf:le,stretchX:me,stretchY:ge,content:be}}p(null,$)}}return{cancel(){S&&(S.cancel(),S=null),M&&(M.cancel(),M=null)}}}(t,this.map._requestManager,this.map.getPixelRatio(),(n,s)=>{if(this._spriteRequest=null,n)this.fire(new a.ErrorEvent(n));else if(s)for(const u in s)this.imageManager.addImage(u,s[u]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const s=t.sourceLayer;if(!s)return;const u=n.getSource();(u.type==="geojson"||u.vectorLayerIds&&u.vectorLayerIds.indexOf(s)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${s}" does not exist on source "${u.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(t){const n=[];for(const s of t){const u=this._layers[s];u.type!=="custom"&&n.push(u.serialize())}return n}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const u=Object.keys(this._updatedLayers),p=Object.keys(this._removedLayers);(u.length||p.length)&&this._updateWorkerLayers(u,p);for(const f in this._updatedSources){const _=this._updatedSources[f];if(_==="reload")this._reloadSource(f);else{if(_!=="clear")throw new Error(`Invalid action ${_}`);this._clearSource(f)}}this._updateTilesForChangedImages();for(const f in this._updatedPaintProps)this._layers[f].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const s={};for(const u in this.sourceCaches){const p=this.sourceCaches[u];s[u]=p.used,p.used=!1}for(const u of this._order){const p=this._layers[u];p.recalculate(t,this._availableImages),!p.isHidden(t.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(const u in s){const p=this.sourceCaches[u];s[u]!==p.used&&p.fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:u}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(t){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),t){const n=this.sourceCaches[t.source];if(!n)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);this.terrain=new ct(this,n,t),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=s=>{s.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=s=>{s.tile&&(s.sourceId===t.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(s.sourceId,s.tile.tileID)):s.source.type==="geojson"&&this.terrain.rememberForRerender(s.sourceId,s.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new a.Event("terrain",{terrain:t}))}setState(t){if(this._checkLoaded(),bt(this,a.validateStyle(t)))return!1;(t=a.clone$1(t)).layers=Wn(t.layers);const n=function(u,p){if(!u)return[{command:yt.setStyle,args:[p]}];let f=[];try{if(!ue(u.version,p.version))return[{command:yt.setStyle,args:[p]}];ue(u.center,p.center)||f.push({command:yt.setCenter,args:[p.center]}),ue(u.zoom,p.zoom)||f.push({command:yt.setZoom,args:[p.zoom]}),ue(u.bearing,p.bearing)||f.push({command:yt.setBearing,args:[p.bearing]}),ue(u.pitch,p.pitch)||f.push({command:yt.setPitch,args:[p.pitch]}),ue(u.sprite,p.sprite)||f.push({command:yt.setSprite,args:[p.sprite]}),ue(u.glyphs,p.glyphs)||f.push({command:yt.setGlyphs,args:[p.glyphs]}),ue(u.transition,p.transition)||f.push({command:yt.setTransition,args:[p.transition]}),ue(u.light,p.light)||f.push({command:yt.setLight,args:[p.light]});const _={},y=[];(function(S,M,k,V){let $;for($ in M=M||{},S=S||{})Object.prototype.hasOwnProperty.call(S,$)&&(Object.prototype.hasOwnProperty.call(M,$)||Fr($,k,V));for($ in M)Object.prototype.hasOwnProperty.call(M,$)&&(Object.prototype.hasOwnProperty.call(S,$)?ue(S[$],M[$])||(S[$].type==="geojson"&&M[$].type==="geojson"&&Hn(S,M,$)?k.push({command:yt.setGeoJSONSourceData,args:[$,M[$].data]}):Or($,M,k,V)):pr($,M,k))})(u.sources,p.sources,y,_);const v=[];u.layers&&u.layers.forEach(S=>{_[S.source]?f.push({command:yt.removeLayer,args:[S.id]}):v.push(S)}),f=f.concat(y),function(S,M,k){M=M||[];const V=(S=S||[]).map(Tr),$=M.map(Tr),U=S.reduce(wn,{}),H=M.reduce(wn,{}),Y=V.slice(),ne=Object.create(null);let G,le,se,me,ge,be,de;for(G=0,le=0;G<V.length;G++)se=V[G],Object.prototype.hasOwnProperty.call(H,se)?le++:(k.push({command:yt.removeLayer,args:[se]}),Y.splice(Y.indexOf(se,le),1));for(G=0,le=0;G<$.length;G++)se=$[$.length-1-G],Y[Y.length-1-G]!==se&&(Object.prototype.hasOwnProperty.call(U,se)?(k.push({command:yt.removeLayer,args:[se]}),Y.splice(Y.lastIndexOf(se,Y.length-le),1)):le++,be=Y[Y.length-G],k.push({command:yt.addLayer,args:[H[se],be]}),Y.splice(Y.length-G,0,se),ne[se]=!0);for(G=0;G<$.length;G++)if(se=$[G],me=U[se],ge=H[se],!ne[se]&&!ue(me,ge))if(ue(me.source,ge.source)&&ue(me["source-layer"],ge["source-layer"])&&ue(me.type,ge.type)){for(de in wr(me.layout,ge.layout,k,se,null,yt.setLayoutProperty),wr(me.paint,ge.paint,k,se,null,yt.setPaintProperty),ue(me.filter,ge.filter)||k.push({command:yt.setFilter,args:[se,ge.filter]}),ue(me.minzoom,ge.minzoom)&&ue(me.maxzoom,ge.maxzoom)||k.push({command:yt.setLayerZoomRange,args:[se,ge.minzoom,ge.maxzoom]}),me)Object.prototype.hasOwnProperty.call(me,de)&&de!=="layout"&&de!=="paint"&&de!=="filter"&&de!=="metadata"&&de!=="minzoom"&&de!=="maxzoom"&&(de.indexOf("paint.")===0?wr(me[de],ge[de],k,se,de.slice(6),yt.setPaintProperty):ue(me[de],ge[de])||k.push({command:yt.setLayerProperty,args:[se,de,ge[de]]}));for(de in ge)Object.prototype.hasOwnProperty.call(ge,de)&&!Object.prototype.hasOwnProperty.call(me,de)&&de!=="layout"&&de!=="paint"&&de!=="filter"&&de!=="metadata"&&de!=="minzoom"&&de!=="maxzoom"&&(de.indexOf("paint.")===0?wr(me[de],ge[de],k,se,de.slice(6),yt.setPaintProperty):ue(me[de],ge[de])||k.push({command:yt.setLayerProperty,args:[se,de,ge[de]]}))}else k.push({command:yt.removeLayer,args:[se]}),be=Y[Y.lastIndexOf(se)+1],k.push({command:yt.addLayer,args:[ge,be]})}(v,p.layers,f)}catch(_){console.warn("Unable to compute style diff:",_),f=[{command:yt.setStyle,args:[p]}]}return f}(this.serialize(),t).filter(u=>!(u.command in si));if(n.length===0)return!1;const s=n.filter(u=>!(u.command in kt));if(s.length>0)throw new Error(`Unimplemented: ${s.map(u=>u.command).join(", ")}.`);return n.forEach(u=>{u.command!=="setTransition"&&this[u.command].apply(this,u.args)}),this.stylesheet=t,!0}addImage(t,n){if(this.getImage(t))return this.fire(new a.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new a.ErrorEvent(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,s={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(a.validateStyle.source,`sources.${t}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const u=this.sourceCaches[t]=new Mi(t,n,this.dispatcher);u.style=this,u.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:u.serialize(),sourceId:t})),u.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const s in this._layers)if(this._layers[s].source===t)return this.fire(new a.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${s}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const s=this.sourceCaches[t].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,s={}){this._checkLoaded();const u=t.id;if(this.getLayer(u))return void this.fire(new a.ErrorEvent(new Error(`Layer "${u}" already exists on this map.`)));let p;if(t.type==="custom"){if(bt(this,a.validateCustomStyleLayer(t)))return;p=a.createStyleLayer(t)}else{if(typeof t.source=="object"&&(this.addSource(u,t.source),t=a.clone$1(t),t=a.extend(t,{source:u})),this._validate(a.validateStyle.layer,`layers.${u}`,t,{arrayIndex:-1},s))return;p=a.createStyleLayer(t),this._validateLayer(p),p.setEventedParent(this,{layer:{id:u}}),this._serializedLayers[p.id]=p.serialize()}const f=n?this._order.indexOf(n):this._order.length;if(n&&f===-1)this.fire(new a.ErrorEvent(new Error(`Cannot add layer "${u}" before non-existing layer "${n}".`)));else{if(this._order.splice(f,0,u),this._layerOrderChanged=!0,this._layers[u]=p,this._removedLayers[u]&&p.source&&p.type!=="custom"){const _=this._removedLayers[u];delete this._removedLayers[u],_.type!==p.type?this._updatedSources[p.source]="clear":(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause())}this._updateLayer(p),p.onAdd&&p.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new a.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const s=this._order.indexOf(t);this._order.splice(s,1);const u=n?this._order.indexOf(n):this._order.length;n&&u===-1?this.fire(new a.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(u,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new a.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const s=this._order.indexOf(t);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,s){this._checkLoaded();const u=this.getLayer(t);u?u.minzoom===n&&u.maxzoom===s||(n!=null&&(u.minzoom=n),s!=null&&(u.maxzoom=s),this._updateLayer(u)):this.fire(new a.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,s={}){this._checkLoaded();const u=this.getLayer(t);if(u){if(!ue(u.filter,n))return n==null?(u.filter=void 0,void this._updateLayer(u)):void(this._validate(a.validateStyle.filter,`layers.${u.id}.filter`,n,null,s)||(u.filter=a.clone$1(n),this._updateLayer(u)))}else this.fire(new a.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return a.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,s,u={}){this._checkLoaded();const p=this.getLayer(t);p?ue(p.getLayoutProperty(n),s)||(p.setLayoutProperty(n,s,u),this._updateLayer(p)):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const s=this.getLayer(t);if(s)return s.getLayoutProperty(n);this.fire(new a.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,s,u={}){this._checkLoaded();const p=this.getLayer(t);p?ue(p.getPaintProperty(n),s)||(p.setPaintProperty(n,s,u)&&this._updateLayer(p),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const s=t.source,u=t.sourceLayer,p=this.sourceCaches[s];if(p===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${s}' does not exist in the map's style.`)));const f=p.getSource().type;f==="geojson"&&u?this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):f!=="vector"||u?(t.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),p.setFeatureState(u,t.id,n)):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const s=t.source,u=this.sourceCaches[s];if(u===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${s}' does not exist in the map's style.`)));const p=u.getSource().type,f=p==="vector"?t.sourceLayer:void 0;p!=="vector"||f?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):u.removeFeatureState(f,t.id,n):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,s=t.sourceLayer,u=this.sourceCaches[n];if(u!==void 0)return u.getSource().type!=="vector"||s?(t.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),u.getFeatureState(s,t.id)):void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new a.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:a.mapObject(this.sourceCaches,t=>t.serialize()),layers:this._serializeLayers(this._order)},t=>t!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=f=>this._layers[f].type==="fill-extrusion",s={},u=[];for(let f=this._order.length-1;f>=0;f--){const _=this._order[f];if(n(_)){s[_]=f;for(const y of t){const v=y[_];if(v)for(const S of v)u.push(S)}}}u.sort((f,_)=>_.intersectionZ-f.intersectionZ);const p=[];for(let f=this._order.length-1;f>=0;f--){const _=this._order[f];if(n(_))for(let y=u.length-1;y>=0;y--){const v=u[y].feature;if(s[v.layer.id]<f)break;p.push(v),u.pop()}else for(const y of t){const v=y[_];if(v)for(const S of v)p.push(S.feature)}}return p}queryRenderedFeatures(t,n,s){n&&n.filter&&this._validate(a.validateStyle.filter,"queryRenderedFeatures.filter",n.filter,null,n);const u={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new a.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const f of n.layers){const _=this._layers[f];if(!_)return this.fire(new a.ErrorEvent(new Error(`The layer '${f}' does not exist in the map's style and cannot be queried for features.`))),[];u[_.source]=!0}}const p=[];n.availableImages=this._availableImages;for(const f in this.sourceCaches)n.layers&&!u[f]||p.push(yn(this.sourceCaches[f],this._layers,this._serializedLayers,t,n,s));return this.placement&&p.push(function(f,_,y,v,S,M,k){const V={},$=M.queryRenderedSymbols(v),U=[];for(const H of Object.keys($).map(Number))U.push(k[H]);U.sort(hr);for(const H of U){const Y=H.featureIndex.lookupSymbolFeatures($[H.bucketInstanceId],_,H.bucketIndex,H.sourceLayerIndex,S.filter,S.layers,S.availableImages,f);for(const ne in Y){const G=V[ne]=V[ne]||[],le=Y[ne];le.sort((se,me)=>{const ge=H.featureSortOrder;if(ge){const be=ge.indexOf(se.featureIndex);return ge.indexOf(me.featureIndex)-be}return me.featureIndex-se.featureIndex});for(const se of le)G.push(se)}}for(const H in V)V[H].forEach(Y=>{const ne=Y.feature,G=y[f[H].source].getFeatureState(ne.layer["source-layer"],ne.id);ne.source=ne.layer.source,ne.layer["source-layer"]&&(ne.sourceLayer=ne.layer["source-layer"]),ne.state=G});return V}(this._layers,this._serializedLayers,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)}querySourceFeatures(t,n){n&&n.filter&&this._validate(a.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[t];return s?function(u,p){const f=u.getRenderableIds().map(v=>u.getTileByID(v)),_=[],y={};for(let v=0;v<f.length;v++){const S=f[v],M=S.tileID.canonical.key;y[M]||(y[M]=!0,S.querySourceFeatures(_,p))}return _}(s,n):[]}addSourceType(t,n,s){return _i.getSourceType(t)?s(new Error(`A source type called "${t}" already exists.`)):(_i.setSourceType(t,n),n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:n.workerSourceURL},s):s(null,null))}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();const s=this.light.getLight();let u=!1;for(const f in t)if(!ue(t[f],s[f])){u=!0;break}if(!u)return;const p={now:a.exported.now(),transition:a.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(p)}_validate(t,n,s,u,p={}){return(!p||p.validate!==!1)&&bt(this,t.call(a.validateStyle,a.extend({key:n,style:this.serialize(),value:s,styleSpec:a.spec},u)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.sourceCaches){const n=this.sourceCaches[t];n.setEventedParent(null),n.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const n in this.sourceCaches)this.sourceCaches[n].update(t,this.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,s,u,p=!1){let f=!1,_=!1;const y={};for(const v of this._order){const S=this._layers[v];if(S.type!=="symbol")continue;if(!y[S.source]){const k=this.sourceCaches[S.source];y[S.source]=k.getRenderableIds(!0).map(V=>k.getTileByID(V)).sort((V,$)=>$.tileID.overscaledZ-V.tileID.overscaledZ||(V.tileID.isLessThan($.tileID)?-1:1))}const M=this.crossTileSymbolIndex.addLayer(S,y[S.source],t.center.lng);f=f||M}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((p=p||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),t.zoom))&&(this.pauseablePlacement=new he(t,this.terrain,this._order,p,n,s,u,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),_=!0),f&&this.pauseablePlacement.placement.setStale()),_||f)for(const v of this._order){const S=this._layers[v];S.type==="symbol"&&this.placement.updateLayerOpacities(S,y[S.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,s){this.imageManager.getImages(n.icons,s),this._updateTilesForChangedImages();const u=this.sourceCaches[n.source];u&&u.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,s){this.glyphManager.getGlyphs(n.stacks,s)}getResource(t,n,s){return a.makeRequest(n,s)}}_i.getSourceType=function(l){return gn[l]},_i.setSourceType=function(l,t){gn[l]=t},_i.registerForPluginStateChange=a.registerForPluginStateChange;var In="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}";const Kn={prelude:Dt(`#ifdef GL_ES
|
|
3
3
|
precision mediump float;
|
|
4
4
|
#else
|