@local-logic/sdks-app 1.7.2 → 2.0.0

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.
Files changed (85) hide show
  1. package/dist/assets/{index-legacy.935e7346.js → index-legacy.5b5c89be.js} +1 -1
  2. package/dist/assets/{index-legacy.3a8c6aa8.js → index-legacy.6f7be327.js} +1 -1
  3. package/dist/assets/index-legacy.873d2f5f.js +1 -0
  4. package/dist/assets/{index-legacy.93d69255.js → index-legacy.8b48df8f.js} +1 -1
  5. package/dist/assets/index-legacy.a2e5122a.js +23 -0
  6. package/dist/assets/{index-legacy.46f64d17.js → index-legacy.b4a1ea09.js} +1 -1
  7. package/dist/assets/index-legacy.e333988e.js +106 -0
  8. package/dist/assets/index.1b34a15d.js +35 -0
  9. package/dist/assets/{index.71eb35ea.js → index.24661964.js} +17 -17
  10. package/dist/assets/index.3039bacf.js +161 -0
  11. package/dist/assets/index.3eec99ca.js +1318 -0
  12. package/dist/assets/index.77b51154.js +1 -0
  13. package/dist/assets/index.aae000f4.js +1 -0
  14. package/dist/assets/{index.10935833.js → index.d89a7cee.js} +1 -1
  15. package/dist/assets/polyfills-legacy.db2bc606.js +1 -0
  16. package/dist/assets/{useIsMobile-legacy.a1dad04e.js → useIsMobile-legacy.7fb572d8.js} +1 -1
  17. package/dist/assets/{useIsMobile.5dc7840d.js → useIsMobile.b5e8d9ad.js} +1 -1
  18. package/dist/assets/{useQuery-legacy.6ce02414.js → useQuery-legacy.7e93cb2c.js} +1 -1
  19. package/dist/assets/useQuery.19a6ca1c.js +9 -0
  20. package/dist/index.html +3 -3
  21. package/dist/types/context/languageProvider/data-explorer/locales/en/index.d.ts.map +1 -1
  22. package/dist/types/context/languageProvider/data-explorer/locales/en/index.js +2 -0
  23. package/dist/types/context/languageProvider/data-explorer/locales/en/index.js.map +1 -1
  24. package/dist/types/context/languageProvider/data-explorer/locales/fr/index.d.ts.map +1 -1
  25. package/dist/types/context/languageProvider/data-explorer/locales/fr/index.js +2 -0
  26. package/dist/types/context/languageProvider/data-explorer/locales/fr/index.js.map +1 -1
  27. package/dist/types/context/languageProvider/data-explorer/types.d.ts +2 -2
  28. package/dist/types/context/languageProvider/data-explorer/types.d.ts.map +1 -1
  29. package/dist/types/context/languageProvider/index.d.ts +2 -2
  30. package/dist/types/context/languageProvider/index.d.ts.map +1 -1
  31. package/dist/types/sdks/DataExplorer/components/Table/index.d.ts +4 -0
  32. package/dist/types/sdks/DataExplorer/components/Table/index.d.ts.map +1 -0
  33. package/dist/types/sdks/DataExplorer/components/Table/index.js +65 -0
  34. package/dist/types/sdks/DataExplorer/components/Table/index.js.map +1 -0
  35. package/dist/types/sdks/DataExplorer/components/Table/styles.d.ts +6 -0
  36. package/dist/types/sdks/DataExplorer/components/Table/styles.d.ts.map +1 -0
  37. package/dist/types/sdks/DataExplorer/components/Table/styles.js +27 -0
  38. package/dist/types/sdks/DataExplorer/components/Table/styles.js.map +1 -0
  39. package/dist/types/sdks/DataExplorer/context.d.ts +3 -0
  40. package/dist/types/sdks/DataExplorer/context.d.ts.map +1 -1
  41. package/dist/types/sdks/DataExplorer/context.js +3 -0
  42. package/dist/types/sdks/DataExplorer/context.js.map +1 -1
  43. package/dist/types/sdks/DataExplorer/index.d.ts.map +1 -1
  44. package/dist/types/sdks/DataExplorer/index.js +8 -0
  45. package/dist/types/sdks/DataExplorer/index.js.map +1 -1
  46. package/dist/types/sdks/Demographics/components/Content/Household/index.d.ts.map +1 -1
  47. package/dist/types/sdks/Demographics/components/Content/Household/index.js +2 -1
  48. package/dist/types/sdks/Demographics/components/Content/Household/index.js.map +1 -1
  49. package/dist/types/sdks/Demographics/components/Content/Household/styles.d.ts +3 -0
  50. package/dist/types/sdks/Demographics/components/Content/Household/styles.d.ts.map +1 -0
  51. package/dist/types/sdks/Demographics/components/Content/Household/styles.js +19 -0
  52. package/dist/types/sdks/Demographics/components/Content/Household/styles.js.map +1 -0
  53. package/dist/types/sdks/Demographics/components/Content/Housing/index.d.ts.map +1 -1
  54. package/dist/types/sdks/Demographics/components/Content/Housing/index.js +10 -7
  55. package/dist/types/sdks/Demographics/components/Content/Housing/index.js.map +1 -1
  56. package/dist/types/sdks/Demographics/components/Content/Housing/styles.d.ts +3 -0
  57. package/dist/types/sdks/Demographics/components/Content/Housing/styles.d.ts.map +1 -0
  58. package/dist/types/sdks/Demographics/components/Content/Housing/styles.js +12 -0
  59. package/dist/types/sdks/Demographics/components/Content/Housing/styles.js.map +1 -0
  60. package/dist/types/sdks/Demographics/components/Content/Languages/index.d.ts +3 -0
  61. package/dist/types/sdks/Demographics/components/Content/Languages/index.d.ts.map +1 -0
  62. package/dist/types/sdks/Demographics/components/Content/Languages/index.js +14 -0
  63. package/dist/types/sdks/Demographics/components/Content/Languages/index.js.map +1 -0
  64. package/dist/types/sdks/Demographics/components/Content/index.d.ts.map +1 -1
  65. package/dist/types/sdks/Demographics/components/Content/index.js +3 -0
  66. package/dist/types/sdks/Demographics/components/Content/index.js.map +1 -1
  67. package/dist/types/sdks/Demographics/components/Content/styles.js +1 -1
  68. package/dist/types/sdks/Demographics/components/Content/styles.js.map +1 -1
  69. package/dist/types/sdks/Demographics/context.d.ts +3 -0
  70. package/dist/types/sdks/Demographics/context.d.ts.map +1 -1
  71. package/dist/types/sdks/Demographics/context.js.map +1 -1
  72. package/dist/types/sdks/Demographics/styles.d.ts.map +1 -1
  73. package/dist/types/sdks/Demographics/styles.js +0 -1
  74. package/dist/types/sdks/Demographics/styles.js.map +1 -1
  75. package/package.json +4 -3
  76. package/dist/assets/index-legacy.128bbb90.js +0 -106
  77. package/dist/assets/index-legacy.60df4146.js +0 -1
  78. package/dist/assets/index-legacy.7c9f6b15.js +0 -1
  79. package/dist/assets/index.1df47f40.js +0 -28
  80. package/dist/assets/index.97d3a920.js +0 -1374
  81. package/dist/assets/index.d464e7cf.js +0 -1
  82. package/dist/assets/index.e63e2d64.js +0 -1
  83. package/dist/assets/index.ed99fd65.js +0 -120
  84. package/dist/assets/polyfills-legacy.147ba02d.js +0 -1
  85. package/dist/assets/useQuery.7c643982.js +0 -9
@@ -1,4 +1,4 @@
1
- import{r as ge,v as _p,j as Bi,x as bc,y as yp,R as lt,B as xp,z as Ei,$ as vp,s as es,m as sh,_ as vo,A as bp,a as wp,D as Ju,e as Tp,E as Ep,I as Yu}from"./index.97d3a920.js";import{u as ah}from"./useQuery.7c643982.js";const Sp=ge.exports.createContext(null);function Ip(P){const V=P.clone();return V.pixelsToGLUnits=P.pixelsToGLUnits,V}function Qu(P){return{longitude:P.center.lng,latitude:P.center.lat,zoom:P.zoom,pitch:P.pitch,bearing:P.bearing,padding:P.padding}}function eh(P,V){const q=V.viewState||V;let W=!1;if("longitude"in q&&"latitude"in q){const j=P.center;P.center=new j.constructor(q.longitude,q.latitude),W=W||j!==P.center}if("zoom"in q){const j=P.zoom;P.zoom=q.zoom,W=W||j!==P.zoom}if("bearing"in q){const j=P.bearing;P.bearing=q.bearing,W=W||j!==P.bearing}if("pitch"in q){const j=P.pitch;P.pitch=q.pitch,W=W||j!==P.pitch}return q.padding&&!P.isPaddingEqual(q.padding)&&(W=!0,P.padding=q.padding),W}const Ap=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function th(P){if(!P)return null;if(typeof P=="string"||("toJS"in P&&(P=P.toJS()),!P.layers))return P;const V={};for(const W of P.layers)V[W.id]=W;const q=P.layers.map(W=>{const j=V[W.ref];let Q=null;if("interactive"in W&&(Q={...W},delete Q.interactive),j){Q=Q||{...W},delete Q.ref;for(const xe of Ap)xe in j&&(Q[xe]=j[xe])}return Q||W});return{...P,layers:q}}function Cp(P,V){const q=Array.isArray(P)?P[0]:P?P.x:0,W=Array.isArray(P)?P[1]:P?P.y:0,j=Array.isArray(V)?V[0]:V?V.x:0,Q=Array.isArray(V)?V[1]:V?V.y:0;return q===j&&W===Q}function Un(P,V){if(P===V)return!0;if(!P||!V)return!1;if(Array.isArray(P)){if(!Array.isArray(V)||P.length!==V.length)return!1;for(let q=0;q<P.length;q++)if(!Un(P[q],V[q]))return!1;return!0}else if(Array.isArray(V))return!1;if(typeof P=="object"&&typeof V=="object"){const q=Object.keys(P),W=Object.keys(V);if(q.length!==W.length)return!1;for(const j of q)if(!V.hasOwnProperty(j)||!Un(P[j],V[j]))return!1;return!0}return!1}const ih={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"},yc={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"},rh={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"},Mp=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],zp=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class Qo{constructor(V,q,W){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=j=>{const Q=this.props[rh[j.type]];Q&&Q(j)},this._onPointerEvent=j=>{(j.type==="mousemove"||j.type==="mouseout")&&this._updateHover(j);const Q=this.props[ih[j.type]];if(Q){if(this.props.interactiveLayerIds&&j.type!=="mouseover"&&j.type!=="mouseout"){const xe=this._hoveredFeatures||this._map.queryRenderedFeatures(j.point,{layers:this.props.interactiveLayerIds});j.features=xe}Q(j),delete j.features}},this._onCameraEvent=j=>{if(!this._internalUpdate){const Q=this.props[yc[j.type]];Q&&Q(j)}j.type in this._deferredEvents&&(this._deferredEvents[j.type]=!1)},this._MapClass=V,this.props=q,this._initialize(W)}get map(){return this._map}get transform(){return this._renderTransform}setProps(V){const q=this.props;this.props=V;const W=this._updateSettings(V,q);W&&this._createShadowTransform(this._map);const j=this._updateSize(V),Q=this._updateViewState(V,!0);this._updateStyle(V,q),this._updateStyleComponents(V,q),this._updateHandlers(V,q),(W||j||Q&&!this._map.isMoving())&&this.redraw()}static reuse(V,q){const W=Qo.savedMaps.pop();if(!W)return null;const j=W.map,Q=j.getContainer();for(q.className=Q.className;Q.childNodes.length>0;)q.appendChild(Q.childNodes[0]);j._container=q,W.setProps({...V,styleDiffing:!1}),j.resize();const{initialViewState:xe}=V;return xe&&(xe.bounds?j.fitBounds(xe.bounds,{...xe.fitBoundsOptions,duration:0}):W._updateViewState(xe,!1)),j.isStyleLoaded()?j.fire("load"):j.once("styledata",()=>j.fire("load")),W}_initialize(V){const{props:q}=this,W={...q,...q.initialViewState,accessToken:q.mapboxAccessToken||Pp()||null,container:V,style:th(q.mapStyle)},j=W.initialViewState||W.viewState||W;if(Object.assign(W,{center:[j.longitude||0,j.latitude||0],zoom:j.zoom||0,pitch:j.pitch||0,bearing:j.bearing||0}),q.gl){const me=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=me,q.gl)}const Q=new this._MapClass(W);j.padding&&Q.setPadding(j.padding),q.cursor&&(Q.getCanvas().style.cursor=q.cursor),this._createShadowTransform(Q);const xe=Q._render;Q._render=me=>{this._inRender=!0,xe.call(Q,me),this._inRender=!1};const l=Q._renderTaskQueue.run;Q._renderTaskQueue.run=me=>{l.call(Q._renderTaskQueue,me),this._onBeforeRepaint()},Q.on("render",()=>this._onAfterRepaint());const ve=Q.fire;Q.fire=this._fireEvent.bind(this,ve),Q.on("resize",()=>{this._renderTransform.resize(Q.transform.width,Q.transform.height)}),Q.on("styledata",()=>this._updateStyleComponents(this.props,{})),Q.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const me in ih)Q.on(me,this._onPointerEvent);for(const me in yc)Q.on(me,this._onCameraEvent);for(const me in rh)Q.on(me,this._onEvent);this._map=Q}recycle(){Qo.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const V=this._map;!this._inRender&&V.style&&(V._frame&&(V._frame.cancel(),V._frame=null),V._render())}_createShadowTransform(V){const q=Ip(V.transform);V.painter.transform=q,this._renderTransform=q}_updateSize(V){const{viewState:q}=V;if(q){const W=this._map;if(q.width!==W.transform.width||q.height!==W.transform.height)return W.resize(),!0}return!1}_updateViewState(V,q){if(this._internalUpdate)return!1;const W=this._map,j=this._renderTransform,{zoom:Q,pitch:xe,bearing:l}=j,ve=W.isMoving();ve&&(j.cameraElevationReference="sea");const me=eh(j,{...Qu(W.transform),...V});if(ve&&(j.cameraElevationReference="ground"),me&&q){const Ee=this._deferredEvents;Ee.move=!0,Ee.zoom||(Ee.zoom=Q!==j.zoom),Ee.rotate||(Ee.rotate=l!==j.bearing),Ee.pitch||(Ee.pitch=xe!==j.pitch)}return ve||eh(W.transform,V),me}_updateSettings(V,q){const W=this._map;let j=!1;for(const Q of Mp)Q in V&&!Un(V[Q],q[Q])&&(j=!0,W[`set${Q[0].toUpperCase()}${Q.slice(1)}`](V[Q]));return j}_updateStyle(V,q){if(V.cursor!==q.cursor&&(this._map.getCanvas().style.cursor=V.cursor),V.mapStyle!==q.mapStyle){const W={diff:V.styleDiffing};return"localIdeographFontFamily"in V&&(W.localIdeographFontFamily=V.localIdeographFontFamily),this._map.setStyle(th(V.mapStyle),W),!0}return!1}_updateStyleComponents(V,q){const W=this._map;let j=!1;return W.style.loaded()&&("light"in V&&!Un(V.light,q.light)&&(j=!0,W.setLight(V.light)),"fog"in V&&!Un(V.fog,q.fog)&&(j=!0,W.setFog(V.fog)),"terrain"in V&&!Un(V.terrain,q.terrain)&&(!V.terrain||W.getSource(V.terrain.source))&&(j=!0,W.setTerrain(V.terrain))),j}_updateHandlers(V,q){const W=this._map;let j=!1;for(const Q of zp){const xe=V[Q];Un(xe,q[Q])||(j=!0,xe?W[Q].enable(xe):W[Q].disable())}return j}_updateHover(V){var q;const{props:W}=this;if(W.interactiveLayerIds&&(W.onMouseMove||W.onMouseEnter||W.onMouseLeave)){const Q=V.type,xe=((q=this._hoveredFeatures)===null||q===void 0?void 0:q.length)>0;let l;if(Q==="mousemove")try{l=this._map.queryRenderedFeatures(V.point,{layers:W.interactiveLayerIds})}catch(me){l=[]}else l=[];const ve=l.length>0;!ve&&xe&&(V.type="mouseleave",this._onPointerEvent(V)),this._hoveredFeatures=l,ve&&!xe&&(V.type="mouseenter",this._onPointerEvent(V)),V.type=Q}else this._hoveredFeatures=null}_fireEvent(V,q,W){const j=this._map,Q=j.transform,xe=typeof q=="string"?q:q.type;return xe==="move"&&this._updateViewState(this.props,!1),xe in yc&&(typeof q=="object"&&(q.viewState=Qu(Q)),this._map.isMoving())?(j.transform=this._renderTransform,V.call(j,q,W),j.transform=Q,j):(V.call(j,q,W),j)}_onBeforeRepaint(){const V=this._map;this._internalUpdate=!0;for(const W in this._deferredEvents)this._deferredEvents[W]&&V.fire(W);this._internalUpdate=!1;const q=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=q}}}Qo.savedMaps=[];function Pp(){let P=null;if(typeof location<"u"){const V=/access_token=([^&\/]*)/.exec(location.search);P=V&&V[1]}try{P=P||process.env.MapboxAccessToken}catch(V){}try{P=P||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch(V){}return P}const kp=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Dp(P,V){if(!P)return null;const q=P.map,W={getMap:()=>q,getCenter:()=>P.transform.center,getZoom:()=>P.transform.zoom,getBearing:()=>P.transform.bearing,getPitch:()=>P.transform.pitch,getPadding:()=>P.transform.padding,getBounds:()=>P.transform.getBounds(),project:j=>P.transform.locationPoint(V.LngLat.convert(j)),unproject:j=>P.transform.pointLocation(V.Point.convert(j)),queryTerrainElevation:(j,Q)=>{const xe=q.transform;q.transform=P.transform;const l=q.queryTerrainElevation(j,Q);return q.transform=xe,l}};for(const j of Lp(q))!(j in W)&&!kp.includes(j)&&(W[j]=q[j].bind(q));return W}function Lp(P){const V=new Set;let q=P;for(;q;){for(const W of Object.getOwnPropertyNames(q))W[0]!=="_"&&typeof P[W]=="function"&&W!=="fire"&&W!=="setEventedParent"&&V.add(W);q=Object.getPrototypeOf(q)}return Array.from(V)}const Rp=typeof document<"u"?ge.exports.useLayoutEffect:ge.exports.useEffect,Bp=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Fp(P,V){for(const q of Bp)q in V&&(P[q]=V[q]);V.RTLTextPlugin&&P.getRTLTextPluginStatus&&P.getRTLTextPluginStatus()==="unavailable"&&P.setRTLTextPlugin(V.RTLTextPlugin,q=>{q&&console.error(q)},!1)}const dl=ge.exports.createContext(null),Op={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:P=>console.error(P.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},lh=ge.exports.forwardRef((P,V)=>{const q=ge.exports.useContext(Sp),[W,j]=ge.exports.useState(null),Q=ge.exports.useRef(),{current:xe}=ge.exports.useRef({mapLib:null,map:null});ge.exports.useEffect(()=>{const ve=P.mapLib;let me=!0,Ee;return Promise.resolve(ve||_p(()=>import("./index.b70ba4b0.js").then(Te=>Te.i),[])).then(Te=>{if(!!me){if(Te.Map||(Te=Te.default),!Te||!Te.Map)throw new Error("Invalid mapLib");if(Te.supported(P))Fp(Te,P),P.reuseMaps&&(Ee=Qo.reuse(P,Q.current)),Ee||(Ee=new Qo(Te.Map,P,Q.current)),xe.map=Dp(Ee,Te),xe.mapLib=Te,j(Ee),q==null||q.onMapMount(xe.map,P.id);else throw new Error("Map is not supported by this browser")}}).catch(Te=>{P.onError({type:"error",target:null,originalEvent:null,error:Te})}),()=>{me=!1,Ee&&(q==null||q.onMapUnmount(P.id),P.reuseMaps?Ee.recycle():Ee.destroy())}},[]),Rp(()=>{W&&W.setProps(P)}),ge.exports.useImperativeHandle(V,()=>xe.map,[W]);const l=ge.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...P.style}),[P.style]);return Bi("div",{id:P.id,ref:Q,style:l,children:W&&Bi(dl.Provider,{value:xe,children:P.children})})});lh.displayName="Map";lh.defaultProps=Op;const Up=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function bo(P,V){if(!P||!V)return;const q=P.style;for(const W in V){const j=V[W];Number.isFinite(j)&&!Up.test(W)?q[W]=`${j}px`:q[W]=j}}const $p={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function ch(P){const{map:V,mapLib:q}=ge.exports.useContext(dl),W=ge.exports.useRef({props:P});W.current.props=P;const j=ge.exports.useMemo(()=>{let Q=!1;ge.exports.Children.forEach(P.children,ve=>{ve&&(Q=!0)});const xe={...P,element:Q?document.createElement("div"):null},l=new q.Marker(xe).setLngLat([P.longitude,P.latitude]);return l.getElement().addEventListener("click",ve=>{var me,Ee;(Ee=(me=W.current.props).onClick)===null||Ee===void 0||Ee.call(me,{type:"click",target:l,originalEvent:ve})}),l.on("dragstart",ve=>{var me,Ee;const Te=ve;Te.lngLat=j.getLngLat(),(Ee=(me=W.current.props).onDragStart)===null||Ee===void 0||Ee.call(me,Te)}),l.on("drag",ve=>{var me,Ee;const Te=ve;Te.lngLat=j.getLngLat(),(Ee=(me=W.current.props).onDrag)===null||Ee===void 0||Ee.call(me,Te)}),l.on("dragend",ve=>{var me,Ee;const Te=ve;Te.lngLat=j.getLngLat(),(Ee=(me=W.current.props).onDragEnd)===null||Ee===void 0||Ee.call(me,Te)}),l},[]);return ge.exports.useEffect(()=>(j.addTo(V.getMap()),()=>{j.remove()}),[]),ge.exports.useEffect(()=>{bo(j.getElement(),P.style)},[P.style]),(j.getLngLat().lng!==P.longitude||j.getLngLat().lat!==P.latitude)&&j.setLngLat([P.longitude,P.latitude]),P.offset&&!Cp(j.getOffset(),P.offset)&&j.setOffset(P.offset),j.isDraggable()!==P.draggable&&j.setDraggable(P.draggable),j.getRotation()!==P.rotation&&j.setRotation(P.rotation),j.getRotationAlignment()!==P.rotationAlignment&&j.setRotationAlignment(P.rotationAlignment),j.getPitchAlignment()!==P.pitchAlignment&&j.setPitchAlignment(P.pitchAlignment),j.getPopup()!==P.popup&&j.setPopup(P.popup),bc.exports.createPortal(P.children,j.getElement())}ch.defaultProps=$p;const Vp=ge.exports.memo(ch);function nh(P){return new Set(P?P.trim().split(/\s+/):[])}function Np(P){const{map:V,mapLib:q}=ge.exports.useContext(dl),W=ge.exports.useMemo(()=>document.createElement("div"),[]),j=ge.exports.useRef({props:P});j.current.props=P;const Q=ge.exports.useMemo(()=>{const xe={...P},l=new q.Popup(xe).setLngLat([P.longitude,P.latitude]);return l.once("open",ve=>{var me,Ee;(Ee=(me=j.current.props).onOpen)===null||Ee===void 0||Ee.call(me,ve)}),l},[]);if(ge.exports.useEffect(()=>{const xe=l=>{var ve,me;(me=(ve=j.current.props).onClose)===null||me===void 0||me.call(ve,l)};return Q.on("close",xe),Q.setDOMContent(W).addTo(V.getMap()),()=>{Q.off("close",xe),Q.isOpen()&&Q.remove()}},[]),ge.exports.useEffect(()=>{bo(Q.getElement(),P.style)},[P.style]),Q.isOpen()&&((Q.getLngLat().lng!==P.longitude||Q.getLngLat().lat!==P.latitude)&&Q.setLngLat([P.longitude,P.latitude]),P.offset&&!Un(Q.options.offset,P.offset)&&Q.setOffset(P.offset),(Q.options.anchor!==P.anchor||Q.options.maxWidth!==P.maxWidth)&&(Q.options.anchor=P.anchor,Q.setMaxWidth(P.maxWidth)),Q.options.className!==P.className)){const xe=nh(Q.options.className),l=nh(P.className);for(const ve of xe)l.has(ve)||Q.removeClassName(ve);for(const ve of l)xe.has(ve)||Q.addClassName(ve);Q.options.className=P.className}return bc.exports.createPortal(P.children,W)}ge.exports.memo(Np);function Qs(P,V,q,W){const j=ge.exports.useContext(dl),Q=ge.exports.useMemo(()=>P(j),[]);return ge.exports.useEffect(()=>{const xe=W||q||V,l=typeof V=="function"&&typeof q=="function"?V:null,ve=typeof q=="function"?q:typeof V=="function"?V:null,{map:me}=j;return me.hasControl(Q)||(me.addControl(Q,xe==null?void 0:xe.position),l&&l(j)),()=>{ve&&ve(j),me.hasControl(Q)&&me.removeControl(Q)}},[]),Q}function Gp(P){const V=Qs(({mapLib:q})=>new q.AttributionControl(P),{position:P.position});return ge.exports.useEffect(()=>{bo(V._container,P.style)},[P.style]),null}const Jf=ge.exports.memo(Gp);function qp(P){const V=Qs(({mapLib:q})=>new q.FullscreenControl({container:P.containerId&&document.getElementById(P.containerId)}),{position:P.position});return ge.exports.useEffect(()=>{bo(V._controlContainer,P.style)},[P.style]),null}ge.exports.memo(qp);const uh=ge.exports.forwardRef((P,V)=>{const q=ge.exports.useRef({props:P}),W=Qs(({mapLib:j})=>{const Q=new j.GeolocateControl(P),xe=Q._setupUI;return Q._setupUI=l=>{Q._container.hasChildNodes()||xe(l)},Q.on("geolocate",l=>{var ve,me;(me=(ve=q.current.props).onGeolocate)===null||me===void 0||me.call(ve,l)}),Q.on("error",l=>{var ve,me;(me=(ve=q.current.props).onError)===null||me===void 0||me.call(ve,l)}),Q.on("outofmaxbounds",l=>{var ve,me;(me=(ve=q.current.props).onOutOfMaxBounds)===null||me===void 0||me.call(ve,l)}),Q.on("trackuserlocationstart",l=>{var ve,me;(me=(ve=q.current.props).onTrackUserLocationStart)===null||me===void 0||me.call(ve,l)}),Q.on("trackuserlocationend",l=>{var ve,me;(me=(ve=q.current.props).onTrackUserLocationEnd)===null||me===void 0||me.call(ve,l)}),Q},{position:P.position});return q.current.props=P,ge.exports.useImperativeHandle(V,()=>({trigger:()=>W.trigger()}),[]),ge.exports.useEffect(()=>{bo(W._container,P.style)},[P.style]),null});uh.displayName="GeolocateControl";ge.exports.memo(uh);function Zp(P){const V=Qs(({mapLib:q})=>new q.NavigationControl(P),{position:P.position});return ge.exports.useEffect(()=>{bo(V._container,P.style)},[P.style]),null}const Yf=ge.exports.memo(Zp),jp={unit:"metric",maxWidth:100};function hh(P){const V=Qs(({mapLib:q})=>new q.ScaleControl(P),{position:P.position});return(V.options.unit!==P.unit||V.options.maxWidth!==P.maxWidth)&&(V.options.maxWidth=P.maxWidth,V.setUnit(P.unit)),ge.exports.useEffect(()=>{bo(V._container,P.style)},[P.style]),null}hh.defaultProps=jp;ge.exports.memo(hh);var dh={exports:{}};(function(P,V){(function(q,W){P.exports=W()})(yp,function(){var q,W,j;function Q(l,ve){if(!q)q=ve;else if(!W)W=ve;else{var me="var sharedChunk = {}; ("+q+")(sharedChunk); ("+W+")(sharedChunk);",Ee={};q(Ee),j=ve(Ee),typeof window<"u"&&(j.workerUrl=window.URL.createObjectURL(new Blob([me],{type:"text/javascript"})))}}Q(["exports"],function(l){var ve=me;function me(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 Ee(i,e,r,o){const c=new ve(i,e,r,o);return function(h){return c.solve(h)}}me.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 p=0,m=1;for(r=i,o=0;o<20&&(c=this.sampleCurveX(r),!(Math.abs(c-i)<e));o++)i>c?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};const Te=Ee(.25,.1,.25,1);function se(i,e,r){return Math.min(r,Math.max(e,i))}function gt(i,e,r){const o=r-e,c=((i-e)%o+o)%o+e;return c===e?r:c}function nt(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}let He=1;function Ut(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Mt(i,e,r){const o={};for(const c in i)o[c]=e.call(r||this,i[c],c,i);return o}function ct(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 vt(i){return Array.isArray(i)?i.map(vt):typeof i=="object"&&i?Mt(i,vt):i}const Wt={};function $t(i){Wt[i]||(typeof console<"u"&&console.warn(i),Wt[i]=!0)}function Gi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function Fi(i){let e=0;for(let r,o,c=0,h=i.length,p=h-1;c<h;p=c++)r=i[c],o=i[p],e+=(o.x-r.x)*(r.y+o.y);return e}function pi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function wo(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,o,c,h)=>{const p=c||h;return e[o]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let lr,Gr,cr=null;function un(i){if(cr==null){const e=i.navigator?i.navigator.userAgent:null;cr=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return cr}function Er(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Sr={now:typeof performance<"u"&&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=>(lr||(lr=document.createElement("a")),lr.href=i,lr.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Gr==null&&(Gr=matchMedia("(prefers-reduced-motion: reduce)")),Gr.matches)}};var We=ur;function ur(i,e){this.x=i,this.y=e}ur.prototype={clone:function(){return new ur(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}},ur.convert=function(i){return i instanceof ur?i:Array.isArray(i)?new ur(i[0],i[1]):i};const hr={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},qi="mapbox-tiles";let Zi,qr,hn=500,dn=50;function pn(){typeof caches>"u"||Zi||(Zi=caches.open(qi))}let Qi=1/0;const Ir={supported:!1,testSupport:function(i){!yi&&Cr&&(fn?$n(i):Ar=i)}};let Ar,Cr,yi=!1,fn=!1;function $n(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,Cr),i.isContextLost())return;Ir.supported=!0}catch(r){}i.deleteTexture(e),yi=!0}typeof document<"u"&&(Cr=document.createElement("img"),Cr.onload=function(){Ar&&$n(Ar),Ar=null,fn=!0},Cr.onerror=function(){yi=!0,Ar=null},Cr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const dr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(dr);class Si 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 Vn=pi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function Mr(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:Vn(),signal:r.signal});let c=!1,h=!1;return i.type==="json"&&o.headers.set("Accept","application/json"),((p,m,g)=>{if(h)return;const x=Date.now();fetch(o).then(w=>w.ok?((E,A,M)=>{(i.type==="arrayBuffer"?E.arrayBuffer():i.type==="json"?E.json():E.text()).then(z=>{h||(A&&M&&function($,U,ee){if(pn(),!Zi)return;const oe={status:U.status,statusText:U.statusText,headers:new Headers};U.headers.forEach((re,fe)=>oe.headers.set(fe,re));const Y=wo(U.headers.get("Cache-Control")||"");Y["no-store"]||(Y["max-age"]&&oe.headers.set("Expires",new Date(ee+1e3*Y["max-age"]).toUTCString()),new Date(oe.headers.get("Expires")).getTime()-ee<42e4||function(re,fe){if(qr===void 0)try{new Response(new ReadableStream),qr=!0}catch(pe){qr=!1}qr?fe(re.body):re.blob().then(fe)}(U,re=>{const fe=new Response(re,oe);pn(),Zi&&Zi.then(pe=>pe.put(function(Be){const Ue=Be.indexOf("?");return Ue<0?Be:Be.slice(0,Ue)}($.url),fe)).catch(pe=>$t(pe.message))}))}(o,A,M),c=!0,e(null,z,E.headers.get("Cache-Control"),E.headers.get("Expires")))}).catch(z=>{h||e(new Error(z.message))})})(w,null,x):w.blob().then(E=>e(new Si(w.status,w.statusText,i.url,E)))).catch(w=>{w.code!==20&&e(new Error(w.message))})})(),{cancel:()=>{h=!0,c||r.abort()}}}const mn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(pi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!pi()){const o=i.url.substring(0,i.url.indexOf("://"));return(hr.REGISTERED_PROTOCOLS[o]||Mr)(i,e)}}if(!(/^file:/.test(r=i.url)||/^file:/.test(Vn())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Mr(i,e);if(pi()&&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 p in o.headers)h.setRequestHeader(p,o.headers[p]);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 p=h.response;if(o.type==="json")try{p=JSON.parse(h.response)}catch(m){return c(m)}c(null,p,h.getResponseHeader("Cache-Control"),h.getResponseHeader("Expires"))}else{const p=new Blob([h.response],{type:h.getResponseHeader("Content-Type")});c(new Si(h.status,h.statusText,o.url,p))}},h.send(o.body),{cancel:()=>h.abort()}}(i,e)},gn=function(i,e){return mn(nt(i,{type:"arrayBuffer"}),e)};function Nn(i){const e=window.document.createElement("a");return e.href=i,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}const ht="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let er,zr;er=[],zr=0;const Pr=function(i,e){if(Ir.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),zr>=hr.MAX_PARALLEL_IMAGE_REQUESTS){const h={requestParameters:i,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return er.push(h),h}zr++;let r=!1;const o=()=>{if(!r)for(r=!0,zr--;er.length&&zr<hr.MAX_PARALLEL_IMAGE_REQUESTS;){const h=er.shift(),{requestParameters:p,callback:m,cancelled:g}=h;g||(h.cancel=Pr(p,m).cancel)}},c=gn(i,(h,p,m,g)=>{o(),h?e(h):p&&function(x,w){typeof createImageBitmap=="function"?function(E,A){const M=new Blob([new Uint8Array(E)],{type:"image/png"});createImageBitmap(M).then(z=>{A(null,z)}).catch(z=>{A(new Error(`Could not load image because of ${z.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(x,w):function(E,A){const M=new Image;M.onload=()=>{A(null,M),URL.revokeObjectURL(M.src),M.onload=null,window.requestAnimationFrame(()=>{M.src=ht})},M.onerror=()=>A(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 z=new Blob([new Uint8Array(E)],{type:"image/png"});M.src=E.byteLength?URL.createObjectURL(z):ht}(x,w)}(p,(x,w)=>{x!=null?e(x):w!=null&&e(null,w,{cacheControl:m,expires:g})})});return{cancel:()=>{c.cancel(),o()}}};function Gn(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function pr(i,e,r){if(r&&r[i]){const o=r[i].indexOf(e);o!==-1&&r[i].splice(o,1)}}class fr{constructor(e,r={}){nt(this,r),this.type=e}}class _n extends fr{constructor(e,r={}){super("error",nt({error:e},r))}}class mr{on(e,r){return this._listeners=this._listeners||{},Gn(e,r,this._listeners),this}off(e,r){return pr(e,r,this._listeners),pr(e,r,this._oneTimeListeners),this}once(e,r){return this._oneTimeListeners=this._oneTimeListeners||{},Gn(e,r,this._oneTimeListeners),this}fire(e,r){typeof e=="string"&&(e=new fr(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)pr(o,m,this._oneTimeListeners),m.call(this,e);const p=this._eventedParent;p&&(nt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof _n&&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 de={$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 Ce{constructor(e,r,o,c){this.message=(e?`${e}: `:"")+o,c&&(this.identifier=c),r!=null&&r.__line__&&(this.line=r.__line__)}}function Zr(i){const e=i.value;return e?[new Ce(i.key,e,"constants have been deprecated as of v8")]:[]}function ji(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}function dt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Oi(i){if(Array.isArray(i))return i.map(Oi);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Oi(i[r]);return e}return dt(i)}class Ii extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Ai{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[o,c]of r)this.bindings[o]=c}concat(e){return new Ai(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 kr={kind:"null"},Se={kind:"number"},et={kind:"string"},Ye={kind:"boolean"},oi={kind:"color"},Dr={kind:"object"},Je={kind:"value"},gr={kind:"collator"},Yt={kind:"formatted"},yn={kind:"padding"},qt={kind:"resolvedImage"};function fi(i,e){return{kind:"array",itemType:i,N:e}}function Tt(i){if(i.kind==="array"){const e=Tt(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const xn=[kr,Se,et,Ye,oi,Yt,Dr,fi(Je),yn,qt];function tr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!tr(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 xn)if(!tr(r,e))return null}}return`Expected ${Tt(i)} but found ${Tt(e)} instead.`}function jr(i,e){return e.some(r=>r.kind===i.kind)}function Xr(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 vn,Wr={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 L(i){return(i=Math.round(i))<0?0:i>255?255:i}function b(i){return L(i[i.length-1]==="%"?parseFloat(i)/100*255:parseInt(i))}function S(i){return(e=i[i.length-1]==="%"?parseFloat(i)/100:parseFloat(i))<0?0:e>1?1:e;var e}function k(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{vn={}.parseCSSColor=function(i){var e,r=i.replace(/ /g,"").toLowerCase();if(r in Wr)return Wr[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),p=r.substr(o+1,c-(o+1)).split(","),m=1;switch(h){case"rgba":if(p.length!==4)return null;m=S(p.pop());case"rgb":return p.length!==3?null:[b(p[0]),b(p[1]),b(p[2]),m];case"hsla":if(p.length!==4)return null;m=S(p.pop());case"hsl":if(p.length!==3)return null;var g=(parseFloat(p[0])%360+360)%360/360,x=S(p[1]),w=S(p[2]),E=w<=.5?w*(x+1):w+x-w*x,A=2*w-E;return[L(255*k(A,E,g+1/3)),L(255*k(A,E,g)),L(255*k(A,E,g-1/3)),m];default:return null}}return null}}catch(i){}class D{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 D)return e;if(typeof e!="string")return;const r=vn(e);return r?new D(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]}}D.black=new D(0,0,0,1),D.white=new D(1,1,1,1),D.transparent=new D(0,0,0,0),D.red=new D(1,0,0,1);class N{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 H{constructor(e,r,o,c,h){this.text=e,this.image=r,this.scale=o,this.fontStack=c,this.textColor=h}}class Z{constructor(e){this.sections=e}static fromString(e){return new Z([new H(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 Z?e:Z.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class G{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof G)return e;if(typeof e=="number")return new G([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 G(e)}}toString(){return JSON.stringify(this.values)}}class K{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new K({name:e,available:!1}):null}}function le(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 _e(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof D||i instanceof N||i instanceof Z||i instanceof G||i instanceof K)return!0;if(Array.isArray(i)){for(const e of i)if(!_e(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!_e(i[e]))return!1;return!0}return!1}function ae(i){if(i===null)return kr;if(typeof i=="string")return et;if(typeof i=="boolean")return Ye;if(typeof i=="number")return Se;if(i instanceof D)return oi;if(i instanceof N)return gr;if(i instanceof Z)return Yt;if(i instanceof G)return yn;if(i instanceof K)return qt;if(Array.isArray(i)){const e=i.length;let r;for(const o of i){const c=ae(o);if(r){if(r===c)continue;r=Je;break}r=c}return fi(r||Je,e)}return Dr}function Oe(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof D||i instanceof Z||i instanceof G||i instanceof K?i.toString():JSON.stringify(i)}class $e{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(!_e(e[1]))return r.error("invalid value");const o=e[1];let c=ae(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 $e(c,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class De{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Ze={string:et,number:Se,boolean:Ye,object:Dr};class Xe{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");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 Ze)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=Ze[x],c++}else m=Je;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=fi(m,g)}else{if(!Ze[h])throw new Error(`Types doesn't contain name = ${h}`);o=Ze[h]}const p=[];for(;c<e.length;c++){const m=r.parse(e[c],c,Je);if(!m)return null;p.push(m)}return new Xe(o,p)}evaluate(e){for(let r=0;r<this.args.length;r++){const o=this.args[r].evaluate(e);if(!tr(this.type,ae(o)))return o;if(r===this.args.length-1)throw new De(`Expected value to be of type ${Tt(this.type)}, but found ${Tt(ae(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const pt={"to-boolean":Ye,"to-color":oi,"to-number":Se,"to-string":et};class Ke{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(!pt[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=pt[o],h=[];for(let p=1;p<e.length;p++){const m=r.parse(e[p],p,Je);if(!m)return null;h.push(m)}return new Ke(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 D)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.`:le(r[0],r[1],r[2],r[3]),!o))return new D(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new De(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=G.parse(r);if(c)return c}throw new De(`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 De(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?Z.fromString(Oe(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?K.fromString(Oe(this.args[0].evaluate(e))):Oe(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const tt=["Unknown","Point","LineString","Polygon"];class ft{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"?tt[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]=D.parse(e)),r}}class St{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=St.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,p=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,m=p.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let g=null;for(const[x,w]of m){g=new Tn(r.registry,r.path,null,r.scope);const E=[];let A=!1;for(let M=1;M<e.length;M++){const z=e[M],$=Array.isArray(x)?x[M-1]:x.type,U=g.parse(z,1+E.length,$);if(!U){A=!0;break}E.push(U)}if(!A)if(Array.isArray(x)&&x.length!==E.length)g.error(`Expected ${x.length} arguments, but found ${E.length} instead.`);else{for(let M=0;M<E.length;M++){const z=Array.isArray(x)?x[M]:x.type,$=E[M];g.concat(M+1).checkSubtype(z,$.type)}if(g.errors.length===0)return new St(o,h,w,E)}}if(m.length===1)r.errors.push(...g.errors);else{const x=(m.length?m:p).map(([E])=>{return A=E,Array.isArray(A)?`(${A.map(Tt).join(", ")})`:`(${Tt(A.type)}...)`;var A}).join(" | "),w=[];for(let E=1;E<e.length;E++){const A=r.parse(e[E],1+w.length);if(!A)return null;w.push(Tt(A.type))}r.error(`Expected arguments of type ${x}, but found (${w.join(", ")}) instead.`)}return null}static register(e,r){St.definitions=r;for(const o in r)e[o]=St}}class Qt{constructor(e,r,o){this.type=gr,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,Ye);if(!c)return null;const h=r.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,Ye);if(!h)return null;let p=null;return o.locale&&(p=r.parse(o.locale,1,et),!p)?null:new Qt(c,h,p)}evaluate(e){return new N(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 kt=8192;function li(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 bn(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function qn(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*kt),Math.round(o*c*kt)]}function It(i,e,r){const o=i[0]-e[0],c=i[1]-e[1],h=i[0]-r[0],p=i[1]-r[1];return o*p-h*c==0&&o*h<=0&&c*p<=0}function ts(i,e){let r=!1;for(let p=0,m=e.length;p<m;p++){const g=e[p];for(let x=0,w=g.length;x<w-1;x++){if(It(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 is(i,e){for(let r=0;r<e.length;r++)if(ts(i,e[r]))return!0;return!1}function ia(i,e,r,o){const c=o[0]-r[0],h=o[1]-r[1],p=(i[0]-r[0])*h-c*(i[1]-r[1]),m=(e[0]-r[0])*h-c*(e[1]-r[1]);return p>0&&m<0||p<0&&m>0}function ra(i,e,r){for(const x of r)for(let w=0;w<x.length-1;++w)if((m=[(p=x[w+1])[0]-(h=x[w])[0],p[1]-h[1]])[0]*(g=[(c=e)[0]-(o=i)[0],c[1]-o[1]])[1]-m[1]*g[0]!=0&&ia(o,c,h,p)&&ia(h,p,o,c))return!0;var o,c,h,p,m,g;return!1}function rs(i,e){for(let r=0;r<i.length;++r)if(!ts(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(ra(i[r],i[r+1],e))return!1;return!0}function fl(i,e){for(let r=0;r<e.length;r++)if(rs(i,e[r]))return!0;return!1}function To(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=[];for(let p=0;p<i[c].length;p++){const m=qn(i[c][p],r);li(e,m),h.push(m)}o.push(h)}return o}function ns(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=To(i[c],e,r);o.push(h)}return o}function na(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}li(e,i)}function oa(i,e,r,o){const c=Math.pow(2,o.z)*kt,h=[o.x*kt,o.y*kt],p=[];for(const m of i)for(const g of m){const x=[g.x+h[0],g.y+h[1]];na(x,e,r,c),p.push(x)}return p}function sa(i,e,r,o){const c=Math.pow(2,o.z)*kt,h=[o.x*kt,o.y*kt],p=[];for(const g of i){const x=[];for(const w of g){const E=[w.x+h[0],w.y+h[1]];li(e,E),x.push(E)}p.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 p)for(const x of g)na(x,e,r,c)}var m;return p}class Hr{constructor(e,r){this.type=Ye,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(_e(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 Hr(o,o.features[c].geometry)}else if(o.type==="Feature"){const c=o.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Hr(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new Hr(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],p=r.canonicalID();if(o.type==="Polygon"){const m=To(o.coordinates,h,p),g=oa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!ts(x,m))return!1}if(o.type==="MultiPolygon"){const m=ns(o.coordinates,h,p),g=oa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!is(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],p=r.canonicalID();if(o.type==="Polygon"){const m=To(o.coordinates,h,p),g=sa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!rs(x,m))return!1}if(o.type==="MultiPolygon"){const m=ns(o.coordinates,h,p),g=sa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!fl(x,m))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function Zn(i){if(i instanceof St&&(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 Hr)return!1;let e=!0;return i.eachChild(r=>{e&&!Zn(r)&&(e=!1)}),e}function wn(i){if(i instanceof St&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!wn(r)&&(e=!1)}),e}function Eo(i,e){if(i instanceof St&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(o=>{r&&!Eo(o,e)&&(r=!1)}),r}class So{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 So(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 Tn{constructor(e,r=[],o,c=new Ai,h=[]){this.registry=e,this.path=r,this.key=r.map(p=>`[${p}]`).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,p){return p==="assert"?new Xe(h,[c]):p==="coerce"?new Ke(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 p=h.parse(e,this);if(!p)return null;if(this.expectedType){const m=this.expectedType,g=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||g.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(m.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array"){if(this.checkSubtype(m,g))return null}else p=o(p,m,r.typeAnnotation||"coerce");else p=o(p,m,r.typeAnnotation||"coerce");else p=o(p,m,r.typeAnnotation||"assert")}if(!(p instanceof $e)&&p.type.kind!=="resolvedImage"&&os(p)){const m=new ft;try{p=new $e(p.type,p.evaluate(m))}catch(g){return this.error(g.message),null}}return p}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 Tn(this.registry,c,r||null,h,this.errors)}error(e,...r){const o=`${this.key}${r.map(c=>`[${c}]`).join("")}`;this.errors.push(new Ii(o,e))}checkSubtype(e,r){const o=tr(e,r);return o&&this.error(o),o}}function os(i){if(i instanceof So)return os(i.boundExpression);if(i instanceof St&&i.name==="error"||i instanceof Qt||i instanceof Hr)return!1;const e=i instanceof Ke||i instanceof Xe;let r=!0;return i.eachChild(o=>{r=e?r&&os(o):r&&o instanceof $e}),!!r&&Zn(i)&&Eo(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Io(i,e){const r=i.length-1;let o,c,h=0,p=r,m=0;for(;h<=p;)if(m=Math.floor((h+p)/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 De("Input is not a number.");p=m-1}return 0}class jn{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,Se);if(!o)return null;const c=[];let h=null;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);for(let p=1;p<e.length;p+=2){const m=p===1?-1/0:e[p],g=e[p+1],x=p,w=p+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 E=r.parse(g,w,h);if(!E)return null;h=h||E.type,c.push([m,E])}return new jn(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[Io(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 Dt(i,e,r){return i*(1-r)+e*r}var Xn=Object.freeze({__proto__:null,number:Dt,color:function(i,e,r){return new D(Dt(i.r,e.r,r),Dt(i.g,e.g,r),Dt(i.b,e.b,r),Dt(i.a,e.a,r))},array:function(i,e,r){return i.map((o,c)=>Dt(o,e[c],r))},padding:function(i,e,r){const o=i.values,c=e.values;return new G([Dt(o[0],c[0],r),Dt(o[1],c[1],r),Dt(o[2],c[2],r),Dt(o[3],c[3],r)])}});const aa=.95047,la=1.08883,ss=4/29,Ao=6/29,ca=3*Ao*Ao,ml=Math.PI/180,gl=180/Math.PI;function as(i){return i>.008856451679035631?Math.pow(i,1/3):i/ca+ss}function ls(i){return i>Ao?i*i*i:ca*(i-ss)}function cs(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function us(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function _t(i){const e=us(i.r),r=us(i.g),o=us(i.b),c=as((.4124564*e+.3575761*r+.1804375*o)/aa),h=as((.2126729*e+.7151522*r+.072175*o)/1);return{l:116*h-16,a:500*(c-h),b:200*(h-as((.0193339*e+.119192*r+.9503041*o)/la)),alpha:i.a}}function ua(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*ls(e),r=aa*ls(r),o=la*ls(o),new D(cs(3.2404542*r-1.5371385*e-.4985314*o),cs(-.969266*r+1.8760108*e+.041556*o),cs(.0556434*r-.2040259*e+1.0572252*o),i.alpha)}function _l(i,e,r){const o=e-i;return i+r*(o>180||o<-180?o-360*Math.round(o/360):o)}const Wn={forward:_t,reverse:ua,interpolate:function(i,e,r){return{l:Dt(i.l,e.l,r),a:Dt(i.a,e.a,r),b:Dt(i.b,e.b,r),alpha:Dt(i.alpha,e.alpha,r)}}},Hn={forward:function(i){const{l:e,a:r,b:o}=_t(i),c=Math.atan2(o,r)*gl;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*ml,r=i.c;return ua({l:i.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:i.alpha})},interpolate:function(i,e,r){return{h:_l(i.h,e.h,r),c:Dt(i.c,e.c,r),l:Dt(i.l,e.l,r),alpha:Dt(i.alpha,e.alpha,r)}}};var ha=Object.freeze({__proto__:null,lab:Wn,hcl:Hn});class Ci{constructor(e,r,o,c,h){this.type=e,this.operator=r,this.interpolation=o,this.input=c,this.labels=[],this.outputs=[];for(const[p,m]of h)this.labels.push(p),this.outputs.push(m)}static interpolationFactor(e,r,o,c){let h=0;if(e.name==="exponential")h=hs(r,e.base,o,c);else if(e.name==="linear")h=hs(r,1,o,c);else if(e.name==="cubic-bezier"){const p=e.controlPoints;h=new ve(p[0],p[1],p[2],p[3]).solve(hs(r,1,o,c))}return h}static parse(e,r){let[o,c,h,...p]=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(w=>typeof w!="number"||w<0||w>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);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,Se),!h)return null;const m=[];let g=null;o==="interpolate-hcl"||o==="interpolate-lab"?g=oi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let x=0;x<p.length;x+=2){const w=p[x],E=p[x+1],A=x+3,M=x+4;if(typeof w!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(m.length&&m[m.length-1][0]>=w)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',A);const z=r.parse(E,M,g);if(!z)return null;g=g||z.type,m.push([w,z])}return g.kind==="number"||g.kind==="color"||g.kind==="padding"||g.kind==="array"&&g.itemType.kind==="number"&&typeof g.N=="number"?new Ci(g,o,c,h,m):r.error(`Type ${Tt(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 p=Io(r,c),m=Ci.interpolationFactor(this.interpolation,c,r[p],r[p+1]),g=o[p].evaluate(e),x=o[p+1].evaluate(e);return this.operator==="interpolate"?Xn[this.type.kind.toLowerCase()](g,x,m):this.operator==="interpolate-hcl"?Hn.reverse(Hn.interpolate(Hn.forward(g),Hn.forward(x),m)):Wn.reverse(Wn.interpolate(Wn.forward(g),Wn.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 hs(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 Co{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 p=c&&h.some(m=>tr(c,m.type));return new Co(p?Je: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 K&&!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 Mo{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 p=e[h];if(typeof p!="string")return r.error(`Expected string, but found ${typeof p} instead.`,h);if(/[^a-zA-Z0-9_]/.test(p))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([p,m])}const c=r.parse(e[e.length-1],e.length-1,r.expectedType,o);return c?new Mo(o,c):null}outputDefined(){return this.result.outputDefined()}}class ds{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,Se),c=r.parse(e[2],2,fi(r.expectedType||Je));return o&&c?new ds(c.type.itemType,o,c):null}evaluate(e){const r=this.index.evaluate(e),o=this.input.evaluate(e);if(r<0)throw new De(`Array index out of bounds: ${r} < 0.`);if(r>=o.length)throw new De(`Array index out of bounds: ${r} > ${o.length-1}.`);if(r!==Math.floor(r))throw new De(`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 ps{constructor(e,r){this.type=Ye,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,Je),c=r.parse(e[2],2,Je);return o&&c?jr(o.type,[Ye,et,Se,kr,Je])?new ps(o,c):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(o.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!Xr(r,["boolean","string","number","null"]))throw new De(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(ae(r))} instead.`);if(!Xr(o,["string","array"]))throw new De(`Expected second argument to be of type array or string, but found ${Tt(ae(o))} instead.`);return o.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class zo{constructor(e,r,o){this.type=Se,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,Je),c=r.parse(e[2],2,Je);if(!o||!c)return null;if(!jr(o.type,[Ye,et,Se,kr,Je]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Se);return h?new zo(o,c,h):null}return new zo(o,c)}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!Xr(r,["boolean","string","number","null"]))throw new De(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(ae(r))} instead.`);if(!Xr(o,["string","array"]))throw new De(`Expected second argument to be of type array or string, but found ${Tt(ae(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 fs{constructor(e,r,o,c,h,p){this.inputType=e,this.type=r,this.input=o,this.cases=c,this.outputs=h,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let o,c;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);const h={},p=[];for(let x=2;x<e.length-1;x+=2){let w=e[x];const E=e[x+1];Array.isArray(w)||(w=[w]);const A=r.concat(x);if(w.length===0)return A.error("Expected at least one branch label.");for(const z of w){if(typeof z!="number"&&typeof z!="string")return A.error("Branch labels must be numbers or strings.");if(typeof z=="number"&&Math.abs(z)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof z=="number"&&Math.floor(z)!==z)return A.error("Numeric branch labels must be integer values.");if(o){if(A.checkSubtype(o,ae(z)))return null}else o=ae(z);if(h[String(z)]!==void 0)return A.error("Branch labels must be unique.");h[String(z)]=p.length}const M=r.parse(E,x,c);if(!M)return null;c=c||M.type,p.push(M)}const m=r.parse(e[1],1,Je);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 fs(o,c,m,h,p,g):null}evaluate(e){const r=this.input.evaluate(e);return(ae(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 ms{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 p=1;p<e.length-1;p+=2){const m=r.parse(e[p],p,Ye);if(!m)return null;const g=r.parse(e[p+1],p+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 ms(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 Po{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,Je),c=r.parse(e[2],2,Se);if(!o||!c)return null;if(!jr(o.type,[fi(Je),et,Je]))return r.error(`Expected first argument to be of type array or string, but found ${Tt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Se);return h?new Po(o.type,o,c,h):null}return new Po(o.type,o,c)}evaluate(e){const r=this.input.evaluate(e),o=this.beginIndex.evaluate(e);if(!Xr(r,["string","array"]))throw new De(`Expected first argument to be of type array or string, but found ${Tt(ae(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 da(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 pa(i,e,r,o){return o.compare(e,r)===0}function En(i,e,r){const o=i!=="=="&&i!=="!=";return class ph{constructor(h,p,m){this.type=Ye,this.lhs=h,this.rhs=p,this.collator=m,this.hasUntypedArgument=h.type.kind==="value"||p.type.kind==="value"}static parse(h,p){if(h.length!==3&&h.length!==4)return p.error("Expected two or three arguments.");const m=h[0];let g=p.parse(h[1],1,Je);if(!g)return null;if(!da(m,g.type))return p.concat(1).error(`"${m}" comparisons are not supported for type '${Tt(g.type)}'.`);let x=p.parse(h[2],2,Je);if(!x)return null;if(!da(m,x.type))return p.concat(2).error(`"${m}" comparisons are not supported for type '${Tt(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error(`Cannot compare types '${Tt(g.type)}' and '${Tt(x.type)}'.`);o&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new Xe(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new Xe(g.type,[x])));let w=null;if(h.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(w=p.parse(h[3],3,gr),!w)return null}return new ph(g,x,w)}evaluate(h){const p=this.lhs.evaluate(h),m=this.rhs.evaluate(h);if(o&&this.hasUntypedArgument){const g=ae(p),x=ae(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new De(`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=ae(p),x=ae(m);if(g.kind!=="string"||x.kind!=="string")return e(h,p,m)}return this.collator?r(h,p,m,this.collator.evaluate(h)):e(h,p,m)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}const yl=En("==",function(i,e,r){return e===r},pa),xl=En("!=",function(i,e,r){return e!==r},function(i,e,r,o){return!pa(0,e,r,o)}),vl=En("<",function(i,e,r){return e<r},function(i,e,r,o){return o.compare(e,r)<0}),bl=En(">",function(i,e,r){return e>r},function(i,e,r,o){return o.compare(e,r)>0}),wl=En("<=",function(i,e,r){return e<=r},function(i,e,r,o){return o.compare(e,r)<=0}),Tl=En(">=",function(i,e,r){return e>=r},function(i,e,r,o){return o.compare(e,r)>=0});class gs{constructor(e,r,o,c,h){this.type=et,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,Se);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,et),!h))return null;let p=null;if(c.currency&&(p=r.parse(c.currency,1,et),!p))return null;let m=null;if(c["min-fraction-digits"]&&(m=r.parse(c["min-fraction-digits"],1,Se),!m))return null;let g=null;return c["max-fraction-digits"]&&(g=r.parse(c["max-fraction-digits"],1,Se),!g)?null:new gs(o,h,p,m,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class ko{constructor(e){this.type=Yt,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 p=1;p<=e.length-1;++p){const m=e[p];if(h&&typeof m=="object"&&!Array.isArray(m)){h=!1;let g=null;if(m["font-scale"]&&(g=r.parse(m["font-scale"],1,Se),!g))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,fi(et)),!x))return null;let w=null;if(m["text-color"]&&(w=r.parse(m["text-color"],1,oi),!w))return null;const E=c[c.length-1];E.scale=g,E.font=x,E.textColor=w}else{const g=r.parse(e[p],1,Je);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 ko(c)}evaluate(e){return new Z(this.sections.map(r=>{const o=r.content.evaluate(e);return ae(o)===qt?new H("",o,null,null,null):new H(Oe(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 _s{constructor(e){this.type=qt,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const o=r.parse(e[1],1,et);return o?new _s(o):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),o=K.fromString(r);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(r)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class ys{constructor(e){this.type=Se,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 ${Tt(o.type)} instead.`):new ys(o):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new De(`Expected value to be of type string or array, but found ${Tt(ae(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Sn={"==":yl,"!=":xl,">":bl,"<":vl,">=":Tl,"<=":wl,array:Xe,at:ds,boolean:Xe,case:ms,coalesce:Co,collator:Qt,format:ko,image:_s,in:ps,"index-of":zo,interpolate:Ci,"interpolate-hcl":Ci,"interpolate-lab":Ci,length:ys,let:Mo,literal:$e,match:fs,number:Xe,"number-format":gs,object:Xe,slice:Po,step:jn,string:Xe,"to-boolean":Ke,"to-color":Ke,"to-number":Ke,"to-string":Ke,var:So,within:Hr};function fa(i,[e,r,o,c]){e=e.evaluate(i),r=r.evaluate(i),o=o.evaluate(i);const h=c?c.evaluate(i):1,p=le(e,r,o,h);if(p)throw new De(p);return new D(e/255*h,r/255*h,o/255*h,h)}function ma(i,e){return i in e}function Do(i,e){const r=e[i];return r===void 0?null:r}function Kr(i){return{type:i}}function ga(i){return{result:"success",value:i}}function In(i){return{result:"error",value:i}}function zt(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function _a(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function at(i){return!!i.expression&&i.expression.interpolated}function yt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Ct(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Lt(i){return i}function Kn(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||(at(e)?"exponential":"interval");if(r||e.type==="padding"){const x=r?D.parse:G.parse;(i=ji({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],x(w[1])])),i.default=x(i.default?i.default:e.default)}if(i.colorSpace&&i.colorSpace!=="rgb"&&!ha[i.colorSpace])throw new Error(`Unknown color space: ${i.colorSpace}`);let p,m,g;if(h==="exponential")p=ya;else if(h==="interval")p=Sl;else if(h==="categorical"){p=El,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}"`);p=Il}if(o){const x={},w=[];for(let M=0;M<i.stops.length;M++){const z=i.stops[M],$=z[0].zoom;x[$]===void 0&&(x[$]={zoom:$,type:i.type,property:i.property,default:i.default,stops:[]},w.push($)),x[$].stops.push([z[0].value,z[1]])}const E=[];for(const M of w)E.push([x[M].zoom,Kn(x[M],e)]);const A={name:"linear"};return{kind:"composite",interpolationType:A,interpolationFactor:Ci.interpolationFactor.bind(void 0,A),zoomStops:E.map(M=>M[0]),evaluate:({zoom:M},z)=>ya({stops:E,base:i.base},e,M).evaluate(M,z)}}if(c){const x=h==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:x,interpolationFactor:Ci.interpolationFactor.bind(void 0,x),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>p(i,e,w,m,g)}}return{kind:"source",evaluate(x,w){const E=w&&w.properties?w.properties[i.property]:void 0;return E===void 0?An(i.default,e.default):p(i,e,E,m,g)}}}function An(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function El(i,e,r,o,c){return An(typeof r===c?o[r]:void 0,i.default,e.default)}function Sl(i,e,r){if(yt(r)!=="number")return An(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=Io(i.stops.map(h=>h[0]),r);return i.stops[c][1]}function ya(i,e,r){const o=i.base!==void 0?i.base:1;if(yt(r)!=="number")return An(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=Io(i.stops.map(w=>w[0]),r),p=function(w,E,A,M){const z=M-A,$=w-A;return z===0?0:E===1?$/z:(Math.pow(E,$)-1)/(Math.pow(E,z)-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=Xn[e.type]||Lt;if(i.colorSpace&&i.colorSpace!=="rgb"){const w=ha[i.colorSpace];x=(E,A)=>w.reverse(w.interpolate(w.forward(E),w.forward(A),p))}return typeof m.evaluate=="function"?{evaluate(...w){const E=m.evaluate.apply(void 0,w),A=g.evaluate.apply(void 0,w);if(E!==void 0&&A!==void 0)return x(E,A,p)}}:x(m,g,p)}function Il(i,e,r){switch(e.type){case"color":r=D.parse(r);break;case"formatted":r=Z.fromString(r.toString());break;case"resolvedImage":r=K.fromString(r.toString());break;case"padding":r=G.parse(r);break;default:yt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return An(r,i.default,e.default)}St.register(Sn,{error:[{kind:"error"},[et],(i,[e])=>{throw new De(e.evaluate(i))}],typeof:[et,[Je],(i,[e])=>Tt(ae(e.evaluate(i)))],"to-rgba":[fi(Se,4),[oi],(i,[e])=>e.evaluate(i).toArray()],rgb:[oi,[Se,Se,Se],fa],rgba:[oi,[Se,Se,Se,Se],fa],has:{type:Ye,overloads:[[[et],(i,[e])=>ma(e.evaluate(i),i.properties())],[[et,Dr],(i,[e,r])=>ma(e.evaluate(i),r.evaluate(i))]]},get:{type:Je,overloads:[[[et],(i,[e])=>Do(e.evaluate(i),i.properties())],[[et,Dr],(i,[e,r])=>Do(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Je,[et],(i,[e])=>Do(e.evaluate(i),i.featureState||{})],properties:[Dr,[],i=>i.properties()],"geometry-type":[et,[],i=>i.geometryType()],id:[Je,[],i=>i.id()],zoom:[Se,[],i=>i.globals.zoom],"heatmap-density":[Se,[],i=>i.globals.heatmapDensity||0],"line-progress":[Se,[],i=>i.globals.lineProgress||0],accumulated:[Je,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Se,Kr(Se),(i,e)=>{let r=0;for(const o of e)r+=o.evaluate(i);return r}],"*":[Se,Kr(Se),(i,e)=>{let r=1;for(const o of e)r*=o.evaluate(i);return r}],"-":{type:Se,overloads:[[[Se,Se],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Se],(i,[e])=>-e.evaluate(i)]]},"/":[Se,[Se,Se],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Se,[Se,Se],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Se,[],()=>Math.LN2],pi:[Se,[],()=>Math.PI],e:[Se,[],()=>Math.E],"^":[Se,[Se,Se],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Se,[Se],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))],log2:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Se,[Se],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Se,[Se],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Se,[Se],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Se,[Se],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Se,[Se],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Se,[Se],(i,[e])=>Math.atan(e.evaluate(i))],min:[Se,Kr(Se),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Se,Kr(Se),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Se,[Se],(i,[e])=>Math.abs(e.evaluate(i))],round:[Se,[Se],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Se,[Se],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Se,[Se],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ye,[et,Je],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ye,[Je],(i,[e])=>i.id()===e.value],"filter-type-==":[Ye,[et],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<c}],"filter-id-<":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<o}],"filter->":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>c}],"filter-id->":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>o}],"filter-<=":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<=c}],"filter-id-<=":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<=o}],"filter->=":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>=c}],"filter-id->=":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>=o}],"filter-has":[Ye,[Je],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ye,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ye,[fi(et)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ye,[fi(Je)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ye,[et,fi(Je)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ye,[et,fi(Je)],(i,[e,r])=>function(o,c,h,p){for(;h<=p;){const m=h+p>>1;if(c[m]===o)return!0;c[m]>o?p=m-1:h=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Kr(Ye),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Kr(Ye),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ye,[Ye],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ye,[et],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[et,[et],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[et,[et],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[et,Kr(Je),(i,e)=>e.map(r=>Oe(r.evaluate(i))).join("")],"resolved-locale":[et,[gr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Lo{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new ft,this._defaultValue=r?function(o){return o.type==="color"&&Ct(o.default)?new D(0,0,0,0):o.type==="color"?D.parse(o.default)||null:o.type==="padding"?G.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,p){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=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,o,c,h,p){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=p||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new De(`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<"u"&&console.warn(m.message)),this._defaultValue}}}function Jn(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Sn}function Yn(i,e){const r=new Tn(Sn,[],e?function(c){const h={color:oi,string:et,number:Se,enum:et,boolean:Ye,formatted:Yt,padding:yn,resolvedImage:qt};return c.type==="array"?fi(h[c.value]||Je,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?ga(new Lo(o,e)):In(r.errors)}class Qn{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!wn(r.expression)}evaluateWithoutErrorHandling(e,r,o,c,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,p)}evaluate(e,r,o,c,h,p){return this._styleExpression.evaluate(e,r,o,c,h,p)}}class xs{constructor(e,r,o,c){this.kind=e,this.zoomStops=o,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!wn(r.expression),this.interpolationType=c}evaluateWithoutErrorHandling(e,r,o,c,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,p)}evaluate(e,r,o,c,h,p){return this._styleExpression.evaluate(e,r,o,c,h,p)}interpolationFactor(e,r,o){return this.interpolationType?Ci.interpolationFactor(this.interpolationType,e,r,o):0}}function xa(i,e){const r=Yn(i,e);if(r.result==="error")return r;const o=r.value.expression,c=Zn(o);if(!c&&!zt(e))return In([new Ii("","data expressions not supported")]);const h=Eo(o,["zoom"]);if(!h&&!_a(e))return In([new Ii("","zoom expressions not supported")]);const p=Bo(o);return p||h?p instanceof Ii?In([p]):p instanceof Ci&&!at(e)?In([new Ii("",'"interpolate" expressions cannot be used with this property')]):ga(p?new xs(c?"camera":"composite",r.value,p.labels,p instanceof Ci?p.interpolation:void 0):new Qn(c?"constant":"source",r.value)):In([new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ro{constructor(e,r){this._parameters=e,this._specification=r,ji(this,Kn(this._parameters,this._specification))}static deserialize(e){return new Ro(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Bo(i){let e=null;if(i instanceof Mo)e=Bo(i.result);else if(i instanceof Co){for(const r of i.args)if(e=Bo(r),e)break}else(i instanceof jn||i instanceof Ci)&&i.input instanceof St&&i.input.name==="zoom"&&(e=i);return e instanceof Ii||i.eachChild(r=>{const o=Bo(r);o instanceof Ii?e=o:!e&&o?e=new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new Ii("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Xi(i){const e=i.key,r=i.value,o=i.valueSpec||{},c=i.objectElementValidators||{},h=i.style,p=i.styleSpec;let m=[];const g=yt(r);if(g!=="object")return[new Ce(e,r,`object expected, ${g} found`)];for(const x in r){const w=x.split(".")[0],E=o[w]||o["*"];let A;if(c[w])A=c[w];else if(o[w])A=zi;else if(c["*"])A=c["*"];else{if(!o["*"]){m.push(new Ce(e,r[x],`unknown property "${x}"`));continue}A=zi}m=m.concat(A({key:(e&&`${e}.`)+x,value:r[x],valueSpec:E,style:h,styleSpec:p,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 Ce(e,r,`missing required property "${x}"`));return m}function va(i){const e=i.value,r=i.valueSpec,o=i.style,c=i.styleSpec,h=i.key,p=i.arrayElementValidator||zi;if(yt(e)!=="array")return[new Ce(h,e,`array expected, ${yt(e)} found`)];if(r.length&&e.length!==r.length)return[new Ce(h,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new Ce(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),yt(r.value)==="object"&&(m=r.value);let g=[];for(let x=0;x<e.length;x++)g=g.concat(p({array:e,arrayIndex:x,value:e[x],valueSpec:m,style:o,styleSpec:c,key:`${h}[${x}]`}));return g}function vs(i){const e=i.key,r=i.value,o=i.valueSpec;let c=yt(r);return c==="number"&&r!=r&&(c="NaN"),c!=="number"?[new Ce(e,r,`number expected, ${c} found`)]:"minimum"in o&&r<o.minimum?[new Ce(e,r,`${r} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&r>o.maximum?[new Ce(e,r,`${r} is greater than the maximum value ${o.maximum}`)]:[]}function ba(i){const e=i.valueSpec,r=dt(i.value.type);let o,c,h,p={};const m=r!=="categorical"&&i.value.property===void 0,g=!m,x=yt(i.value.stops)==="array"&&yt(i.value.stops[0])==="array"&&yt(i.value.stops[0][0])==="object",w=Xi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(M){if(r==="identity")return[new Ce(M.key,M.value,'identity function may not have a "stops" property')];let z=[];const $=M.value;return z=z.concat(va({key:M.key,value:$,valueSpec:M.valueSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:E})),yt($)==="array"&&$.length===0&&z.push(new Ce(M.key,$,"array must have at least one stop")),z},default:function(M){return zi({key:M.key,value:M.value,valueSpec:e,style:M.style,styleSpec:M.styleSpec})}}});return r==="identity"&&m&&w.push(new Ce(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||w.push(new Ce(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!at(i.valueSpec)&&w.push(new Ce(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!zt(i.valueSpec)?w.push(new Ce(i.key,i.value,"property functions not supported")):m&&!_a(i.valueSpec)&&w.push(new Ce(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||w.push(new Ce(i.key,i.value,'"property" property is required')),w;function E(M){let z=[];const $=M.value,U=M.key;if(yt($)!=="array")return[new Ce(U,$,`array expected, ${yt($)} found`)];if($.length!==2)return[new Ce(U,$,`array length 2 expected, length ${$.length} found`)];if(x){if(yt($[0])!=="object")return[new Ce(U,$,`object expected, ${yt($[0])} found`)];if($[0].zoom===void 0)return[new Ce(U,$,"object stop key must have zoom")];if($[0].value===void 0)return[new Ce(U,$,"object stop key must have value")];if(h&&h>dt($[0].zoom))return[new Ce(U,$[0].zoom,"stop zoom values must appear in ascending order")];dt($[0].zoom)!==h&&(h=dt($[0].zoom),c=void 0,p={}),z=z.concat(Xi({key:`${U}[0]`,value:$[0],valueSpec:{zoom:{}},style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:vs,value:A}}))}else z=z.concat(A({key:`${U}[0]`,value:$[0],valueSpec:{},style:M.style,styleSpec:M.styleSpec},$));return Jn(Oi($[1]))?z.concat([new Ce(`${U}[1]`,$[1],"expressions are not allowed in function stops.")]):z.concat(zi({key:`${U}[1]`,value:$[1],valueSpec:e,style:M.style,styleSpec:M.styleSpec}))}function A(M,z){const $=yt(M.value),U=dt(M.value),ee=M.value!==null?M.value:z;if(o){if($!==o)return[new Ce(M.key,ee,`${$} stop domain type must match previous stop domain type ${o}`)]}else o=$;if($!=="number"&&$!=="string"&&$!=="boolean")return[new Ce(M.key,ee,"stop domain value must be a number, string, or boolean")];if($!=="number"&&r!=="categorical"){let oe=`number expected, ${$} found`;return zt(e)&&r===void 0&&(oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ce(M.key,ee,oe)]}return r!=="categorical"||$!=="number"||isFinite(U)&&Math.floor(U)===U?r!=="categorical"&&$==="number"&&c!==void 0&&U<c?[new Ce(M.key,ee,"stop domain values must appear in ascending order")]:(c=U,r==="categorical"&&U in p?[new Ce(M.key,ee,"stop domain values must be unique")]:(p[U]=!0,[])):[new Ce(M.key,ee,`integer expected, found ${U}`)]}}function Jr(i){const e=(i.expressionContext==="property"?xa:Yn)(Oi(i.value),i.valueSpec);if(e.result==="error")return e.value.map(o=>new Ce(`${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 Ce(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"&&!wn(r))return[new Ce(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!wn(r))return[new Ce(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Eo(r,["zoom","feature-state"]))return[new Ce(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Zn(r))return[new Ce(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function eo(i){const e=i.key,r=i.value,o=i.valueSpec,c=[];return Array.isArray(o.values)?o.values.indexOf(dt(r))===-1&&c.push(new Ce(e,r,`expected one of [${o.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(o.values).indexOf(dt(r))===-1&&c.push(new Ce(e,r,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(r)} found`)),c}function Cn(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(!Cn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Al={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Fo(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Cn(i)||(i=to(i));const e=Yn(i,Al);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:Ta(i)}}function wa(i,e){return i<e?-1:i>e?1:0}function Ta(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Ta(i[e]))return!0;return!1}function to(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?bs(i[1],i[2],"=="):e==="!="?Mn(bs(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?bs(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(to))):e==="all"?["all"].concat(i.slice(1).map(to)):e==="none"?["all"].concat(i.slice(1).map(to).map(Mn)):e==="in"?Oo(i[1],i.slice(2)):e==="!in"?Mn(Oo(i[1],i.slice(2))):e==="has"?io(i[1]):e==="!has"?Mn(io(i[1])):e!=="within"||i;var r}function bs(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 Oo(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(wa)]]:["filter-in-small",i,["literal",e]]}}function io(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Mn(i){return["!",i]}function ro(i){return Cn(Oi(i.value))?Jr(ji({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ea(i)}function Ea(i){const e=i.value,r=i.key;if(yt(e)!=="array")return[new Ce(r,e,`array expected, ${yt(e)} found`)];const o=i.styleSpec;let c,h=[];if(e.length<1)return[new Ce(r,e,"filter array must have at least 1 element")];switch(h=h.concat(eo({key:`${r}[0]`,value:e[0],valueSpec:o.filter_operator,style:i.style,styleSpec:i.styleSpec})),dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&dt(e[1])==="$type"&&h.push(new Ce(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&h.push(new Ce(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(c=yt(e[1]),c!=="string"&&h.push(new Ce(`${r}[1]`,e[1],`string expected, ${c} found`)));for(let p=2;p<e.length;p++)c=yt(e[p]),dt(e[1])==="$type"?h=h.concat(eo({key:`${r}[${p}]`,value:e[p],valueSpec:o.geometry_type,style:i.style,styleSpec:i.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&h.push(new Ce(`${r}[${p}]`,e[p],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let p=1;p<e.length;p++)h=h.concat(Ea({key:`${r}[${p}]`,value:e[p],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":c=yt(e[1]),e.length!==2?h.push(new Ce(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="string"&&h.push(new Ce(`${r}[1]`,e[1],`string expected, ${c} found`));break;case"within":c=yt(e[1]),e.length!==2?h.push(new Ce(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="object"&&h.push(new Ce(`${r}[1]`,e[1],`object expected, ${c} found`))}return h}function no(i,e){const r=i.key,o=i.style,c=i.styleSpec,h=i.value,p=i.objectKey,m=c[`${e}_${i.layerType}`];if(!m)return[];const g=p.match(/^(.*)-transition$/);if(e==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return zi({key:r,value:h,valueSpec:c.transition,style:o,styleSpec:c});const x=i.valueSpec||m[p];if(!x)return[new Ce(r,h,`unknown property "${p}"`)];let w;if(yt(h)==="string"&&zt(x)&&!x.tokens&&(w=/^{([^}]+)}$/.exec(h)))return[new Ce(r,h,`"${p}" does not support interpolation syntax
1
+ import{r as ge,_ as _p,j as Bi,x as bc,y as yp,R as lt,Y as xp,z as Ei,$ as vp,s as es,m as sh,C as vo,A as bp,a as wp,B as Ju,e as Tp,H as Ep,I as Yu}from"./index.3eec99ca.js";import{u as ah}from"./useQuery.19a6ca1c.js";const Sp=ge.exports.createContext(null);function Ip(P){const V=P.clone();return V.pixelsToGLUnits=P.pixelsToGLUnits,V}function Qu(P){return{longitude:P.center.lng,latitude:P.center.lat,zoom:P.zoom,pitch:P.pitch,bearing:P.bearing,padding:P.padding}}function eh(P,V){const q=V.viewState||V;let W=!1;if("longitude"in q&&"latitude"in q){const j=P.center;P.center=new j.constructor(q.longitude,q.latitude),W=W||j!==P.center}if("zoom"in q){const j=P.zoom;P.zoom=q.zoom,W=W||j!==P.zoom}if("bearing"in q){const j=P.bearing;P.bearing=q.bearing,W=W||j!==P.bearing}if("pitch"in q){const j=P.pitch;P.pitch=q.pitch,W=W||j!==P.pitch}return q.padding&&!P.isPaddingEqual(q.padding)&&(W=!0,P.padding=q.padding),W}const Ap=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function th(P){if(!P)return null;if(typeof P=="string"||("toJS"in P&&(P=P.toJS()),!P.layers))return P;const V={};for(const W of P.layers)V[W.id]=W;const q=P.layers.map(W=>{const j=V[W.ref];let Q=null;if("interactive"in W&&(Q={...W},delete Q.interactive),j){Q=Q||{...W},delete Q.ref;for(const xe of Ap)xe in j&&(Q[xe]=j[xe])}return Q||W});return{...P,layers:q}}function Cp(P,V){const q=Array.isArray(P)?P[0]:P?P.x:0,W=Array.isArray(P)?P[1]:P?P.y:0,j=Array.isArray(V)?V[0]:V?V.x:0,Q=Array.isArray(V)?V[1]:V?V.y:0;return q===j&&W===Q}function Un(P,V){if(P===V)return!0;if(!P||!V)return!1;if(Array.isArray(P)){if(!Array.isArray(V)||P.length!==V.length)return!1;for(let q=0;q<P.length;q++)if(!Un(P[q],V[q]))return!1;return!0}else if(Array.isArray(V))return!1;if(typeof P=="object"&&typeof V=="object"){const q=Object.keys(P),W=Object.keys(V);if(q.length!==W.length)return!1;for(const j of q)if(!V.hasOwnProperty(j)||!Un(P[j],V[j]))return!1;return!0}return!1}const ih={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"},yc={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"},rh={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"},Mp=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],zp=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class Qo{constructor(V,q,W){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=j=>{const Q=this.props[rh[j.type]];Q&&Q(j)},this._onPointerEvent=j=>{(j.type==="mousemove"||j.type==="mouseout")&&this._updateHover(j);const Q=this.props[ih[j.type]];if(Q){if(this.props.interactiveLayerIds&&j.type!=="mouseover"&&j.type!=="mouseout"){const xe=this._hoveredFeatures||this._map.queryRenderedFeatures(j.point,{layers:this.props.interactiveLayerIds});j.features=xe}Q(j),delete j.features}},this._onCameraEvent=j=>{if(!this._internalUpdate){const Q=this.props[yc[j.type]];Q&&Q(j)}j.type in this._deferredEvents&&(this._deferredEvents[j.type]=!1)},this._MapClass=V,this.props=q,this._initialize(W)}get map(){return this._map}get transform(){return this._renderTransform}setProps(V){const q=this.props;this.props=V;const W=this._updateSettings(V,q);W&&this._createShadowTransform(this._map);const j=this._updateSize(V),Q=this._updateViewState(V,!0);this._updateStyle(V,q),this._updateStyleComponents(V,q),this._updateHandlers(V,q),(W||j||Q&&!this._map.isMoving())&&this.redraw()}static reuse(V,q){const W=Qo.savedMaps.pop();if(!W)return null;const j=W.map,Q=j.getContainer();for(q.className=Q.className;Q.childNodes.length>0;)q.appendChild(Q.childNodes[0]);j._container=q,W.setProps({...V,styleDiffing:!1}),j.resize();const{initialViewState:xe}=V;return xe&&(xe.bounds?j.fitBounds(xe.bounds,{...xe.fitBoundsOptions,duration:0}):W._updateViewState(xe,!1)),j.isStyleLoaded()?j.fire("load"):j.once("styledata",()=>j.fire("load")),W}_initialize(V){const{props:q}=this,W={...q,...q.initialViewState,accessToken:q.mapboxAccessToken||Pp()||null,container:V,style:th(q.mapStyle)},j=W.initialViewState||W.viewState||W;if(Object.assign(W,{center:[j.longitude||0,j.latitude||0],zoom:j.zoom||0,pitch:j.pitch||0,bearing:j.bearing||0}),q.gl){const me=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=me,q.gl)}const Q=new this._MapClass(W);j.padding&&Q.setPadding(j.padding),q.cursor&&(Q.getCanvas().style.cursor=q.cursor),this._createShadowTransform(Q);const xe=Q._render;Q._render=me=>{this._inRender=!0,xe.call(Q,me),this._inRender=!1};const l=Q._renderTaskQueue.run;Q._renderTaskQueue.run=me=>{l.call(Q._renderTaskQueue,me),this._onBeforeRepaint()},Q.on("render",()=>this._onAfterRepaint());const ve=Q.fire;Q.fire=this._fireEvent.bind(this,ve),Q.on("resize",()=>{this._renderTransform.resize(Q.transform.width,Q.transform.height)}),Q.on("styledata",()=>this._updateStyleComponents(this.props,{})),Q.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const me in ih)Q.on(me,this._onPointerEvent);for(const me in yc)Q.on(me,this._onCameraEvent);for(const me in rh)Q.on(me,this._onEvent);this._map=Q}recycle(){Qo.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const V=this._map;!this._inRender&&V.style&&(V._frame&&(V._frame.cancel(),V._frame=null),V._render())}_createShadowTransform(V){const q=Ip(V.transform);V.painter.transform=q,this._renderTransform=q}_updateSize(V){const{viewState:q}=V;if(q){const W=this._map;if(q.width!==W.transform.width||q.height!==W.transform.height)return W.resize(),!0}return!1}_updateViewState(V,q){if(this._internalUpdate)return!1;const W=this._map,j=this._renderTransform,{zoom:Q,pitch:xe,bearing:l}=j,ve=W.isMoving();ve&&(j.cameraElevationReference="sea");const me=eh(j,{...Qu(W.transform),...V});if(ve&&(j.cameraElevationReference="ground"),me&&q){const Ee=this._deferredEvents;Ee.move=!0,Ee.zoom||(Ee.zoom=Q!==j.zoom),Ee.rotate||(Ee.rotate=l!==j.bearing),Ee.pitch||(Ee.pitch=xe!==j.pitch)}return ve||eh(W.transform,V),me}_updateSettings(V,q){const W=this._map;let j=!1;for(const Q of Mp)Q in V&&!Un(V[Q],q[Q])&&(j=!0,W[`set${Q[0].toUpperCase()}${Q.slice(1)}`](V[Q]));return j}_updateStyle(V,q){if(V.cursor!==q.cursor&&(this._map.getCanvas().style.cursor=V.cursor),V.mapStyle!==q.mapStyle){const W={diff:V.styleDiffing};return"localIdeographFontFamily"in V&&(W.localIdeographFontFamily=V.localIdeographFontFamily),this._map.setStyle(th(V.mapStyle),W),!0}return!1}_updateStyleComponents(V,q){const W=this._map;let j=!1;return W.style.loaded()&&("light"in V&&!Un(V.light,q.light)&&(j=!0,W.setLight(V.light)),"fog"in V&&!Un(V.fog,q.fog)&&(j=!0,W.setFog(V.fog)),"terrain"in V&&!Un(V.terrain,q.terrain)&&(!V.terrain||W.getSource(V.terrain.source))&&(j=!0,W.setTerrain(V.terrain))),j}_updateHandlers(V,q){const W=this._map;let j=!1;for(const Q of zp){const xe=V[Q];Un(xe,q[Q])||(j=!0,xe?W[Q].enable(xe):W[Q].disable())}return j}_updateHover(V){var q;const{props:W}=this;if(W.interactiveLayerIds&&(W.onMouseMove||W.onMouseEnter||W.onMouseLeave)){const Q=V.type,xe=((q=this._hoveredFeatures)===null||q===void 0?void 0:q.length)>0;let l;if(Q==="mousemove")try{l=this._map.queryRenderedFeatures(V.point,{layers:W.interactiveLayerIds})}catch(me){l=[]}else l=[];const ve=l.length>0;!ve&&xe&&(V.type="mouseleave",this._onPointerEvent(V)),this._hoveredFeatures=l,ve&&!xe&&(V.type="mouseenter",this._onPointerEvent(V)),V.type=Q}else this._hoveredFeatures=null}_fireEvent(V,q,W){const j=this._map,Q=j.transform,xe=typeof q=="string"?q:q.type;return xe==="move"&&this._updateViewState(this.props,!1),xe in yc&&(typeof q=="object"&&(q.viewState=Qu(Q)),this._map.isMoving())?(j.transform=this._renderTransform,V.call(j,q,W),j.transform=Q,j):(V.call(j,q,W),j)}_onBeforeRepaint(){const V=this._map;this._internalUpdate=!0;for(const W in this._deferredEvents)this._deferredEvents[W]&&V.fire(W);this._internalUpdate=!1;const q=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=q}}}Qo.savedMaps=[];function Pp(){let P=null;if(typeof location<"u"){const V=/access_token=([^&\/]*)/.exec(location.search);P=V&&V[1]}try{P=P||process.env.MapboxAccessToken}catch(V){}try{P=P||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch(V){}return P}const kp=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Dp(P,V){if(!P)return null;const q=P.map,W={getMap:()=>q,getCenter:()=>P.transform.center,getZoom:()=>P.transform.zoom,getBearing:()=>P.transform.bearing,getPitch:()=>P.transform.pitch,getPadding:()=>P.transform.padding,getBounds:()=>P.transform.getBounds(),project:j=>P.transform.locationPoint(V.LngLat.convert(j)),unproject:j=>P.transform.pointLocation(V.Point.convert(j)),queryTerrainElevation:(j,Q)=>{const xe=q.transform;q.transform=P.transform;const l=q.queryTerrainElevation(j,Q);return q.transform=xe,l}};for(const j of Lp(q))!(j in W)&&!kp.includes(j)&&(W[j]=q[j].bind(q));return W}function Lp(P){const V=new Set;let q=P;for(;q;){for(const W of Object.getOwnPropertyNames(q))W[0]!=="_"&&typeof P[W]=="function"&&W!=="fire"&&W!=="setEventedParent"&&V.add(W);q=Object.getPrototypeOf(q)}return Array.from(V)}const Rp=typeof document<"u"?ge.exports.useLayoutEffect:ge.exports.useEffect,Bp=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Fp(P,V){for(const q of Bp)q in V&&(P[q]=V[q]);V.RTLTextPlugin&&P.getRTLTextPluginStatus&&P.getRTLTextPluginStatus()==="unavailable"&&P.setRTLTextPlugin(V.RTLTextPlugin,q=>{q&&console.error(q)},!1)}const dl=ge.exports.createContext(null),Op={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:P=>console.error(P.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},lh=ge.exports.forwardRef((P,V)=>{const q=ge.exports.useContext(Sp),[W,j]=ge.exports.useState(null),Q=ge.exports.useRef(),{current:xe}=ge.exports.useRef({mapLib:null,map:null});ge.exports.useEffect(()=>{const ve=P.mapLib;let me=!0,Ee;return Promise.resolve(ve||_p(()=>import("./index.b70ba4b0.js").then(Te=>Te.i),[])).then(Te=>{if(!!me){if(Te.Map||(Te=Te.default),!Te||!Te.Map)throw new Error("Invalid mapLib");if(Te.supported(P))Fp(Te,P),P.reuseMaps&&(Ee=Qo.reuse(P,Q.current)),Ee||(Ee=new Qo(Te.Map,P,Q.current)),xe.map=Dp(Ee,Te),xe.mapLib=Te,j(Ee),q==null||q.onMapMount(xe.map,P.id);else throw new Error("Map is not supported by this browser")}}).catch(Te=>{P.onError({type:"error",target:null,originalEvent:null,error:Te})}),()=>{me=!1,Ee&&(q==null||q.onMapUnmount(P.id),P.reuseMaps?Ee.recycle():Ee.destroy())}},[]),Rp(()=>{W&&W.setProps(P)}),ge.exports.useImperativeHandle(V,()=>xe.map,[W]);const l=ge.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...P.style}),[P.style]);return Bi("div",{id:P.id,ref:Q,style:l,children:W&&Bi(dl.Provider,{value:xe,children:P.children})})});lh.displayName="Map";lh.defaultProps=Op;const Up=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function bo(P,V){if(!P||!V)return;const q=P.style;for(const W in V){const j=V[W];Number.isFinite(j)&&!Up.test(W)?q[W]=`${j}px`:q[W]=j}}const $p={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function ch(P){const{map:V,mapLib:q}=ge.exports.useContext(dl),W=ge.exports.useRef({props:P});W.current.props=P;const j=ge.exports.useMemo(()=>{let Q=!1;ge.exports.Children.forEach(P.children,ve=>{ve&&(Q=!0)});const xe={...P,element:Q?document.createElement("div"):null},l=new q.Marker(xe).setLngLat([P.longitude,P.latitude]);return l.getElement().addEventListener("click",ve=>{var me,Ee;(Ee=(me=W.current.props).onClick)===null||Ee===void 0||Ee.call(me,{type:"click",target:l,originalEvent:ve})}),l.on("dragstart",ve=>{var me,Ee;const Te=ve;Te.lngLat=j.getLngLat(),(Ee=(me=W.current.props).onDragStart)===null||Ee===void 0||Ee.call(me,Te)}),l.on("drag",ve=>{var me,Ee;const Te=ve;Te.lngLat=j.getLngLat(),(Ee=(me=W.current.props).onDrag)===null||Ee===void 0||Ee.call(me,Te)}),l.on("dragend",ve=>{var me,Ee;const Te=ve;Te.lngLat=j.getLngLat(),(Ee=(me=W.current.props).onDragEnd)===null||Ee===void 0||Ee.call(me,Te)}),l},[]);return ge.exports.useEffect(()=>(j.addTo(V.getMap()),()=>{j.remove()}),[]),ge.exports.useEffect(()=>{bo(j.getElement(),P.style)},[P.style]),(j.getLngLat().lng!==P.longitude||j.getLngLat().lat!==P.latitude)&&j.setLngLat([P.longitude,P.latitude]),P.offset&&!Cp(j.getOffset(),P.offset)&&j.setOffset(P.offset),j.isDraggable()!==P.draggable&&j.setDraggable(P.draggable),j.getRotation()!==P.rotation&&j.setRotation(P.rotation),j.getRotationAlignment()!==P.rotationAlignment&&j.setRotationAlignment(P.rotationAlignment),j.getPitchAlignment()!==P.pitchAlignment&&j.setPitchAlignment(P.pitchAlignment),j.getPopup()!==P.popup&&j.setPopup(P.popup),bc.exports.createPortal(P.children,j.getElement())}ch.defaultProps=$p;const Vp=ge.exports.memo(ch);function nh(P){return new Set(P?P.trim().split(/\s+/):[])}function Np(P){const{map:V,mapLib:q}=ge.exports.useContext(dl),W=ge.exports.useMemo(()=>document.createElement("div"),[]),j=ge.exports.useRef({props:P});j.current.props=P;const Q=ge.exports.useMemo(()=>{const xe={...P},l=new q.Popup(xe).setLngLat([P.longitude,P.latitude]);return l.once("open",ve=>{var me,Ee;(Ee=(me=j.current.props).onOpen)===null||Ee===void 0||Ee.call(me,ve)}),l},[]);if(ge.exports.useEffect(()=>{const xe=l=>{var ve,me;(me=(ve=j.current.props).onClose)===null||me===void 0||me.call(ve,l)};return Q.on("close",xe),Q.setDOMContent(W).addTo(V.getMap()),()=>{Q.off("close",xe),Q.isOpen()&&Q.remove()}},[]),ge.exports.useEffect(()=>{bo(Q.getElement(),P.style)},[P.style]),Q.isOpen()&&((Q.getLngLat().lng!==P.longitude||Q.getLngLat().lat!==P.latitude)&&Q.setLngLat([P.longitude,P.latitude]),P.offset&&!Un(Q.options.offset,P.offset)&&Q.setOffset(P.offset),(Q.options.anchor!==P.anchor||Q.options.maxWidth!==P.maxWidth)&&(Q.options.anchor=P.anchor,Q.setMaxWidth(P.maxWidth)),Q.options.className!==P.className)){const xe=nh(Q.options.className),l=nh(P.className);for(const ve of xe)l.has(ve)||Q.removeClassName(ve);for(const ve of l)xe.has(ve)||Q.addClassName(ve);Q.options.className=P.className}return bc.exports.createPortal(P.children,W)}ge.exports.memo(Np);function Qs(P,V,q,W){const j=ge.exports.useContext(dl),Q=ge.exports.useMemo(()=>P(j),[]);return ge.exports.useEffect(()=>{const xe=W||q||V,l=typeof V=="function"&&typeof q=="function"?V:null,ve=typeof q=="function"?q:typeof V=="function"?V:null,{map:me}=j;return me.hasControl(Q)||(me.addControl(Q,xe==null?void 0:xe.position),l&&l(j)),()=>{ve&&ve(j),me.hasControl(Q)&&me.removeControl(Q)}},[]),Q}function Gp(P){const V=Qs(({mapLib:q})=>new q.AttributionControl(P),{position:P.position});return ge.exports.useEffect(()=>{bo(V._container,P.style)},[P.style]),null}const Jf=ge.exports.memo(Gp);function qp(P){const V=Qs(({mapLib:q})=>new q.FullscreenControl({container:P.containerId&&document.getElementById(P.containerId)}),{position:P.position});return ge.exports.useEffect(()=>{bo(V._controlContainer,P.style)},[P.style]),null}ge.exports.memo(qp);const uh=ge.exports.forwardRef((P,V)=>{const q=ge.exports.useRef({props:P}),W=Qs(({mapLib:j})=>{const Q=new j.GeolocateControl(P),xe=Q._setupUI;return Q._setupUI=l=>{Q._container.hasChildNodes()||xe(l)},Q.on("geolocate",l=>{var ve,me;(me=(ve=q.current.props).onGeolocate)===null||me===void 0||me.call(ve,l)}),Q.on("error",l=>{var ve,me;(me=(ve=q.current.props).onError)===null||me===void 0||me.call(ve,l)}),Q.on("outofmaxbounds",l=>{var ve,me;(me=(ve=q.current.props).onOutOfMaxBounds)===null||me===void 0||me.call(ve,l)}),Q.on("trackuserlocationstart",l=>{var ve,me;(me=(ve=q.current.props).onTrackUserLocationStart)===null||me===void 0||me.call(ve,l)}),Q.on("trackuserlocationend",l=>{var ve,me;(me=(ve=q.current.props).onTrackUserLocationEnd)===null||me===void 0||me.call(ve,l)}),Q},{position:P.position});return q.current.props=P,ge.exports.useImperativeHandle(V,()=>({trigger:()=>W.trigger()}),[]),ge.exports.useEffect(()=>{bo(W._container,P.style)},[P.style]),null});uh.displayName="GeolocateControl";ge.exports.memo(uh);function Zp(P){const V=Qs(({mapLib:q})=>new q.NavigationControl(P),{position:P.position});return ge.exports.useEffect(()=>{bo(V._container,P.style)},[P.style]),null}const Yf=ge.exports.memo(Zp),jp={unit:"metric",maxWidth:100};function hh(P){const V=Qs(({mapLib:q})=>new q.ScaleControl(P),{position:P.position});return(V.options.unit!==P.unit||V.options.maxWidth!==P.maxWidth)&&(V.options.maxWidth=P.maxWidth,V.setUnit(P.unit)),ge.exports.useEffect(()=>{bo(V._container,P.style)},[P.style]),null}hh.defaultProps=jp;ge.exports.memo(hh);var dh={exports:{}};(function(P,V){(function(q,W){P.exports=W()})(yp,function(){var q,W,j;function Q(l,ve){if(!q)q=ve;else if(!W)W=ve;else{var me="var sharedChunk = {}; ("+q+")(sharedChunk); ("+W+")(sharedChunk);",Ee={};q(Ee),j=ve(Ee),typeof window<"u"&&(j.workerUrl=window.URL.createObjectURL(new Blob([me],{type:"text/javascript"})))}}Q(["exports"],function(l){var ve=me;function me(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 Ee(i,e,r,o){const c=new ve(i,e,r,o);return function(h){return c.solve(h)}}me.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 p=0,m=1;for(r=i,o=0;o<20&&(c=this.sampleCurveX(r),!(Math.abs(c-i)<e));o++)i>c?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};const Te=Ee(.25,.1,.25,1);function se(i,e,r){return Math.min(r,Math.max(e,i))}function gt(i,e,r){const o=r-e,c=((i-e)%o+o)%o+e;return c===e?r:c}function nt(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}let He=1;function Ut(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Mt(i,e,r){const o={};for(const c in i)o[c]=e.call(r||this,i[c],c,i);return o}function ct(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 vt(i){return Array.isArray(i)?i.map(vt):typeof i=="object"&&i?Mt(i,vt):i}const Wt={};function $t(i){Wt[i]||(typeof console<"u"&&console.warn(i),Wt[i]=!0)}function Gi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function Fi(i){let e=0;for(let r,o,c=0,h=i.length,p=h-1;c<h;p=c++)r=i[c],o=i[p],e+=(o.x-r.x)*(r.y+o.y);return e}function pi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function wo(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,o,c,h)=>{const p=c||h;return e[o]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let lr,Gr,cr=null;function un(i){if(cr==null){const e=i.navigator?i.navigator.userAgent:null;cr=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return cr}function Er(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Sr={now:typeof performance<"u"&&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=>(lr||(lr=document.createElement("a")),lr.href=i,lr.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Gr==null&&(Gr=matchMedia("(prefers-reduced-motion: reduce)")),Gr.matches)}};var We=ur;function ur(i,e){this.x=i,this.y=e}ur.prototype={clone:function(){return new ur(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}},ur.convert=function(i){return i instanceof ur?i:Array.isArray(i)?new ur(i[0],i[1]):i};const hr={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},qi="mapbox-tiles";let Zi,qr,hn=500,dn=50;function pn(){typeof caches>"u"||Zi||(Zi=caches.open(qi))}let Qi=1/0;const Ir={supported:!1,testSupport:function(i){!yi&&Cr&&(fn?$n(i):Ar=i)}};let Ar,Cr,yi=!1,fn=!1;function $n(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,Cr),i.isContextLost())return;Ir.supported=!0}catch(r){}i.deleteTexture(e),yi=!0}typeof document<"u"&&(Cr=document.createElement("img"),Cr.onload=function(){Ar&&$n(Ar),Ar=null,fn=!0},Cr.onerror=function(){yi=!0,Ar=null},Cr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const dr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(dr);class Si 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 Vn=pi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function Mr(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:Vn(),signal:r.signal});let c=!1,h=!1;return i.type==="json"&&o.headers.set("Accept","application/json"),((p,m,g)=>{if(h)return;const x=Date.now();fetch(o).then(w=>w.ok?((E,A,M)=>{(i.type==="arrayBuffer"?E.arrayBuffer():i.type==="json"?E.json():E.text()).then(z=>{h||(A&&M&&function($,U,ee){if(pn(),!Zi)return;const oe={status:U.status,statusText:U.statusText,headers:new Headers};U.headers.forEach((re,fe)=>oe.headers.set(fe,re));const Y=wo(U.headers.get("Cache-Control")||"");Y["no-store"]||(Y["max-age"]&&oe.headers.set("Expires",new Date(ee+1e3*Y["max-age"]).toUTCString()),new Date(oe.headers.get("Expires")).getTime()-ee<42e4||function(re,fe){if(qr===void 0)try{new Response(new ReadableStream),qr=!0}catch(pe){qr=!1}qr?fe(re.body):re.blob().then(fe)}(U,re=>{const fe=new Response(re,oe);pn(),Zi&&Zi.then(pe=>pe.put(function(Be){const Ue=Be.indexOf("?");return Ue<0?Be:Be.slice(0,Ue)}($.url),fe)).catch(pe=>$t(pe.message))}))}(o,A,M),c=!0,e(null,z,E.headers.get("Cache-Control"),E.headers.get("Expires")))}).catch(z=>{h||e(new Error(z.message))})})(w,null,x):w.blob().then(E=>e(new Si(w.status,w.statusText,i.url,E)))).catch(w=>{w.code!==20&&e(new Error(w.message))})})(),{cancel:()=>{h=!0,c||r.abort()}}}const mn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(pi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!pi()){const o=i.url.substring(0,i.url.indexOf("://"));return(hr.REGISTERED_PROTOCOLS[o]||Mr)(i,e)}}if(!(/^file:/.test(r=i.url)||/^file:/.test(Vn())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Mr(i,e);if(pi()&&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 p in o.headers)h.setRequestHeader(p,o.headers[p]);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 p=h.response;if(o.type==="json")try{p=JSON.parse(h.response)}catch(m){return c(m)}c(null,p,h.getResponseHeader("Cache-Control"),h.getResponseHeader("Expires"))}else{const p=new Blob([h.response],{type:h.getResponseHeader("Content-Type")});c(new Si(h.status,h.statusText,o.url,p))}},h.send(o.body),{cancel:()=>h.abort()}}(i,e)},gn=function(i,e){return mn(nt(i,{type:"arrayBuffer"}),e)};function Nn(i){const e=window.document.createElement("a");return e.href=i,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}const ht="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let er,zr;er=[],zr=0;const Pr=function(i,e){if(Ir.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),zr>=hr.MAX_PARALLEL_IMAGE_REQUESTS){const h={requestParameters:i,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return er.push(h),h}zr++;let r=!1;const o=()=>{if(!r)for(r=!0,zr--;er.length&&zr<hr.MAX_PARALLEL_IMAGE_REQUESTS;){const h=er.shift(),{requestParameters:p,callback:m,cancelled:g}=h;g||(h.cancel=Pr(p,m).cancel)}},c=gn(i,(h,p,m,g)=>{o(),h?e(h):p&&function(x,w){typeof createImageBitmap=="function"?function(E,A){const M=new Blob([new Uint8Array(E)],{type:"image/png"});createImageBitmap(M).then(z=>{A(null,z)}).catch(z=>{A(new Error(`Could not load image because of ${z.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(x,w):function(E,A){const M=new Image;M.onload=()=>{A(null,M),URL.revokeObjectURL(M.src),M.onload=null,window.requestAnimationFrame(()=>{M.src=ht})},M.onerror=()=>A(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 z=new Blob([new Uint8Array(E)],{type:"image/png"});M.src=E.byteLength?URL.createObjectURL(z):ht}(x,w)}(p,(x,w)=>{x!=null?e(x):w!=null&&e(null,w,{cacheControl:m,expires:g})})});return{cancel:()=>{c.cancel(),o()}}};function Gn(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function pr(i,e,r){if(r&&r[i]){const o=r[i].indexOf(e);o!==-1&&r[i].splice(o,1)}}class fr{constructor(e,r={}){nt(this,r),this.type=e}}class _n extends fr{constructor(e,r={}){super("error",nt({error:e},r))}}class mr{on(e,r){return this._listeners=this._listeners||{},Gn(e,r,this._listeners),this}off(e,r){return pr(e,r,this._listeners),pr(e,r,this._oneTimeListeners),this}once(e,r){return this._oneTimeListeners=this._oneTimeListeners||{},Gn(e,r,this._oneTimeListeners),this}fire(e,r){typeof e=="string"&&(e=new fr(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)pr(o,m,this._oneTimeListeners),m.call(this,e);const p=this._eventedParent;p&&(nt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof _n&&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 de={$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 Ce{constructor(e,r,o,c){this.message=(e?`${e}: `:"")+o,c&&(this.identifier=c),r!=null&&r.__line__&&(this.line=r.__line__)}}function Zr(i){const e=i.value;return e?[new Ce(i.key,e,"constants have been deprecated as of v8")]:[]}function ji(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}function dt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Oi(i){if(Array.isArray(i))return i.map(Oi);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Oi(i[r]);return e}return dt(i)}class Ii extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Ai{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[o,c]of r)this.bindings[o]=c}concat(e){return new Ai(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 kr={kind:"null"},Se={kind:"number"},et={kind:"string"},Ye={kind:"boolean"},oi={kind:"color"},Dr={kind:"object"},Je={kind:"value"},gr={kind:"collator"},Yt={kind:"formatted"},yn={kind:"padding"},qt={kind:"resolvedImage"};function fi(i,e){return{kind:"array",itemType:i,N:e}}function Tt(i){if(i.kind==="array"){const e=Tt(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const xn=[kr,Se,et,Ye,oi,Yt,Dr,fi(Je),yn,qt];function tr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!tr(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 xn)if(!tr(r,e))return null}}return`Expected ${Tt(i)} but found ${Tt(e)} instead.`}function jr(i,e){return e.some(r=>r.kind===i.kind)}function Xr(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 vn,Wr={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 L(i){return(i=Math.round(i))<0?0:i>255?255:i}function b(i){return L(i[i.length-1]==="%"?parseFloat(i)/100*255:parseInt(i))}function S(i){return(e=i[i.length-1]==="%"?parseFloat(i)/100:parseFloat(i))<0?0:e>1?1:e;var e}function k(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{vn={}.parseCSSColor=function(i){var e,r=i.replace(/ /g,"").toLowerCase();if(r in Wr)return Wr[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),p=r.substr(o+1,c-(o+1)).split(","),m=1;switch(h){case"rgba":if(p.length!==4)return null;m=S(p.pop());case"rgb":return p.length!==3?null:[b(p[0]),b(p[1]),b(p[2]),m];case"hsla":if(p.length!==4)return null;m=S(p.pop());case"hsl":if(p.length!==3)return null;var g=(parseFloat(p[0])%360+360)%360/360,x=S(p[1]),w=S(p[2]),E=w<=.5?w*(x+1):w+x-w*x,A=2*w-E;return[L(255*k(A,E,g+1/3)),L(255*k(A,E,g)),L(255*k(A,E,g-1/3)),m];default:return null}}return null}}catch(i){}class D{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 D)return e;if(typeof e!="string")return;const r=vn(e);return r?new D(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]}}D.black=new D(0,0,0,1),D.white=new D(1,1,1,1),D.transparent=new D(0,0,0,0),D.red=new D(1,0,0,1);class N{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 H{constructor(e,r,o,c,h){this.text=e,this.image=r,this.scale=o,this.fontStack=c,this.textColor=h}}class Z{constructor(e){this.sections=e}static fromString(e){return new Z([new H(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 Z?e:Z.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class G{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof G)return e;if(typeof e=="number")return new G([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 G(e)}}toString(){return JSON.stringify(this.values)}}class K{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new K({name:e,available:!1}):null}}function le(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 _e(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof D||i instanceof N||i instanceof Z||i instanceof G||i instanceof K)return!0;if(Array.isArray(i)){for(const e of i)if(!_e(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!_e(i[e]))return!1;return!0}return!1}function ae(i){if(i===null)return kr;if(typeof i=="string")return et;if(typeof i=="boolean")return Ye;if(typeof i=="number")return Se;if(i instanceof D)return oi;if(i instanceof N)return gr;if(i instanceof Z)return Yt;if(i instanceof G)return yn;if(i instanceof K)return qt;if(Array.isArray(i)){const e=i.length;let r;for(const o of i){const c=ae(o);if(r){if(r===c)continue;r=Je;break}r=c}return fi(r||Je,e)}return Dr}function Oe(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof D||i instanceof Z||i instanceof G||i instanceof K?i.toString():JSON.stringify(i)}class $e{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(!_e(e[1]))return r.error("invalid value");const o=e[1];let c=ae(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 $e(c,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class De{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Ze={string:et,number:Se,boolean:Ye,object:Dr};class Xe{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");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 Ze)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=Ze[x],c++}else m=Je;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=fi(m,g)}else{if(!Ze[h])throw new Error(`Types doesn't contain name = ${h}`);o=Ze[h]}const p=[];for(;c<e.length;c++){const m=r.parse(e[c],c,Je);if(!m)return null;p.push(m)}return new Xe(o,p)}evaluate(e){for(let r=0;r<this.args.length;r++){const o=this.args[r].evaluate(e);if(!tr(this.type,ae(o)))return o;if(r===this.args.length-1)throw new De(`Expected value to be of type ${Tt(this.type)}, but found ${Tt(ae(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const pt={"to-boolean":Ye,"to-color":oi,"to-number":Se,"to-string":et};class Ke{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(!pt[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=pt[o],h=[];for(let p=1;p<e.length;p++){const m=r.parse(e[p],p,Je);if(!m)return null;h.push(m)}return new Ke(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 D)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.`:le(r[0],r[1],r[2],r[3]),!o))return new D(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new De(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=G.parse(r);if(c)return c}throw new De(`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 De(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?Z.fromString(Oe(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?K.fromString(Oe(this.args[0].evaluate(e))):Oe(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const tt=["Unknown","Point","LineString","Polygon"];class ft{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"?tt[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]=D.parse(e)),r}}class St{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=St.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,p=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,m=p.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let g=null;for(const[x,w]of m){g=new Tn(r.registry,r.path,null,r.scope);const E=[];let A=!1;for(let M=1;M<e.length;M++){const z=e[M],$=Array.isArray(x)?x[M-1]:x.type,U=g.parse(z,1+E.length,$);if(!U){A=!0;break}E.push(U)}if(!A)if(Array.isArray(x)&&x.length!==E.length)g.error(`Expected ${x.length} arguments, but found ${E.length} instead.`);else{for(let M=0;M<E.length;M++){const z=Array.isArray(x)?x[M]:x.type,$=E[M];g.concat(M+1).checkSubtype(z,$.type)}if(g.errors.length===0)return new St(o,h,w,E)}}if(m.length===1)r.errors.push(...g.errors);else{const x=(m.length?m:p).map(([E])=>{return A=E,Array.isArray(A)?`(${A.map(Tt).join(", ")})`:`(${Tt(A.type)}...)`;var A}).join(" | "),w=[];for(let E=1;E<e.length;E++){const A=r.parse(e[E],1+w.length);if(!A)return null;w.push(Tt(A.type))}r.error(`Expected arguments of type ${x}, but found (${w.join(", ")}) instead.`)}return null}static register(e,r){St.definitions=r;for(const o in r)e[o]=St}}class Qt{constructor(e,r,o){this.type=gr,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,Ye);if(!c)return null;const h=r.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,Ye);if(!h)return null;let p=null;return o.locale&&(p=r.parse(o.locale,1,et),!p)?null:new Qt(c,h,p)}evaluate(e){return new N(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 kt=8192;function li(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 bn(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function qn(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*kt),Math.round(o*c*kt)]}function It(i,e,r){const o=i[0]-e[0],c=i[1]-e[1],h=i[0]-r[0],p=i[1]-r[1];return o*p-h*c==0&&o*h<=0&&c*p<=0}function ts(i,e){let r=!1;for(let p=0,m=e.length;p<m;p++){const g=e[p];for(let x=0,w=g.length;x<w-1;x++){if(It(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 is(i,e){for(let r=0;r<e.length;r++)if(ts(i,e[r]))return!0;return!1}function ia(i,e,r,o){const c=o[0]-r[0],h=o[1]-r[1],p=(i[0]-r[0])*h-c*(i[1]-r[1]),m=(e[0]-r[0])*h-c*(e[1]-r[1]);return p>0&&m<0||p<0&&m>0}function ra(i,e,r){for(const x of r)for(let w=0;w<x.length-1;++w)if((m=[(p=x[w+1])[0]-(h=x[w])[0],p[1]-h[1]])[0]*(g=[(c=e)[0]-(o=i)[0],c[1]-o[1]])[1]-m[1]*g[0]!=0&&ia(o,c,h,p)&&ia(h,p,o,c))return!0;var o,c,h,p,m,g;return!1}function rs(i,e){for(let r=0;r<i.length;++r)if(!ts(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(ra(i[r],i[r+1],e))return!1;return!0}function fl(i,e){for(let r=0;r<e.length;r++)if(rs(i,e[r]))return!0;return!1}function To(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=[];for(let p=0;p<i[c].length;p++){const m=qn(i[c][p],r);li(e,m),h.push(m)}o.push(h)}return o}function ns(i,e,r){const o=[];for(let c=0;c<i.length;c++){const h=To(i[c],e,r);o.push(h)}return o}function na(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}li(e,i)}function oa(i,e,r,o){const c=Math.pow(2,o.z)*kt,h=[o.x*kt,o.y*kt],p=[];for(const m of i)for(const g of m){const x=[g.x+h[0],g.y+h[1]];na(x,e,r,c),p.push(x)}return p}function sa(i,e,r,o){const c=Math.pow(2,o.z)*kt,h=[o.x*kt,o.y*kt],p=[];for(const g of i){const x=[];for(const w of g){const E=[w.x+h[0],w.y+h[1]];li(e,E),x.push(E)}p.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 p)for(const x of g)na(x,e,r,c)}var m;return p}class Hr{constructor(e,r){this.type=Ye,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(_e(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 Hr(o,o.features[c].geometry)}else if(o.type==="Feature"){const c=o.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Hr(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new Hr(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],p=r.canonicalID();if(o.type==="Polygon"){const m=To(o.coordinates,h,p),g=oa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!ts(x,m))return!1}if(o.type==="MultiPolygon"){const m=ns(o.coordinates,h,p),g=oa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!is(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],p=r.canonicalID();if(o.type==="Polygon"){const m=To(o.coordinates,h,p),g=sa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!rs(x,m))return!1}if(o.type==="MultiPolygon"){const m=ns(o.coordinates,h,p),g=sa(r.geometry(),c,h,p);if(!bn(c,h))return!1;for(const x of g)if(!fl(x,m))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function Zn(i){if(i instanceof St&&(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 Hr)return!1;let e=!0;return i.eachChild(r=>{e&&!Zn(r)&&(e=!1)}),e}function wn(i){if(i instanceof St&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!wn(r)&&(e=!1)}),e}function Eo(i,e){if(i instanceof St&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(o=>{r&&!Eo(o,e)&&(r=!1)}),r}class So{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 So(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 Tn{constructor(e,r=[],o,c=new Ai,h=[]){this.registry=e,this.path=r,this.key=r.map(p=>`[${p}]`).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,p){return p==="assert"?new Xe(h,[c]):p==="coerce"?new Ke(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 p=h.parse(e,this);if(!p)return null;if(this.expectedType){const m=this.expectedType,g=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||g.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(m.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array"){if(this.checkSubtype(m,g))return null}else p=o(p,m,r.typeAnnotation||"coerce");else p=o(p,m,r.typeAnnotation||"coerce");else p=o(p,m,r.typeAnnotation||"assert")}if(!(p instanceof $e)&&p.type.kind!=="resolvedImage"&&os(p)){const m=new ft;try{p=new $e(p.type,p.evaluate(m))}catch(g){return this.error(g.message),null}}return p}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 Tn(this.registry,c,r||null,h,this.errors)}error(e,...r){const o=`${this.key}${r.map(c=>`[${c}]`).join("")}`;this.errors.push(new Ii(o,e))}checkSubtype(e,r){const o=tr(e,r);return o&&this.error(o),o}}function os(i){if(i instanceof So)return os(i.boundExpression);if(i instanceof St&&i.name==="error"||i instanceof Qt||i instanceof Hr)return!1;const e=i instanceof Ke||i instanceof Xe;let r=!0;return i.eachChild(o=>{r=e?r&&os(o):r&&o instanceof $e}),!!r&&Zn(i)&&Eo(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Io(i,e){const r=i.length-1;let o,c,h=0,p=r,m=0;for(;h<=p;)if(m=Math.floor((h+p)/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 De("Input is not a number.");p=m-1}return 0}class jn{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,Se);if(!o)return null;const c=[];let h=null;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);for(let p=1;p<e.length;p+=2){const m=p===1?-1/0:e[p],g=e[p+1],x=p,w=p+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 E=r.parse(g,w,h);if(!E)return null;h=h||E.type,c.push([m,E])}return new jn(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[Io(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 Dt(i,e,r){return i*(1-r)+e*r}var Xn=Object.freeze({__proto__:null,number:Dt,color:function(i,e,r){return new D(Dt(i.r,e.r,r),Dt(i.g,e.g,r),Dt(i.b,e.b,r),Dt(i.a,e.a,r))},array:function(i,e,r){return i.map((o,c)=>Dt(o,e[c],r))},padding:function(i,e,r){const o=i.values,c=e.values;return new G([Dt(o[0],c[0],r),Dt(o[1],c[1],r),Dt(o[2],c[2],r),Dt(o[3],c[3],r)])}});const aa=.95047,la=1.08883,ss=4/29,Ao=6/29,ca=3*Ao*Ao,ml=Math.PI/180,gl=180/Math.PI;function as(i){return i>.008856451679035631?Math.pow(i,1/3):i/ca+ss}function ls(i){return i>Ao?i*i*i:ca*(i-ss)}function cs(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function us(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function _t(i){const e=us(i.r),r=us(i.g),o=us(i.b),c=as((.4124564*e+.3575761*r+.1804375*o)/aa),h=as((.2126729*e+.7151522*r+.072175*o)/1);return{l:116*h-16,a:500*(c-h),b:200*(h-as((.0193339*e+.119192*r+.9503041*o)/la)),alpha:i.a}}function ua(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*ls(e),r=aa*ls(r),o=la*ls(o),new D(cs(3.2404542*r-1.5371385*e-.4985314*o),cs(-.969266*r+1.8760108*e+.041556*o),cs(.0556434*r-.2040259*e+1.0572252*o),i.alpha)}function _l(i,e,r){const o=e-i;return i+r*(o>180||o<-180?o-360*Math.round(o/360):o)}const Wn={forward:_t,reverse:ua,interpolate:function(i,e,r){return{l:Dt(i.l,e.l,r),a:Dt(i.a,e.a,r),b:Dt(i.b,e.b,r),alpha:Dt(i.alpha,e.alpha,r)}}},Hn={forward:function(i){const{l:e,a:r,b:o}=_t(i),c=Math.atan2(o,r)*gl;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*ml,r=i.c;return ua({l:i.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:i.alpha})},interpolate:function(i,e,r){return{h:_l(i.h,e.h,r),c:Dt(i.c,e.c,r),l:Dt(i.l,e.l,r),alpha:Dt(i.alpha,e.alpha,r)}}};var ha=Object.freeze({__proto__:null,lab:Wn,hcl:Hn});class Ci{constructor(e,r,o,c,h){this.type=e,this.operator=r,this.interpolation=o,this.input=c,this.labels=[],this.outputs=[];for(const[p,m]of h)this.labels.push(p),this.outputs.push(m)}static interpolationFactor(e,r,o,c){let h=0;if(e.name==="exponential")h=hs(r,e.base,o,c);else if(e.name==="linear")h=hs(r,1,o,c);else if(e.name==="cubic-bezier"){const p=e.controlPoints;h=new ve(p[0],p[1],p[2],p[3]).solve(hs(r,1,o,c))}return h}static parse(e,r){let[o,c,h,...p]=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(w=>typeof w!="number"||w<0||w>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);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,Se),!h)return null;const m=[];let g=null;o==="interpolate-hcl"||o==="interpolate-lab"?g=oi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let x=0;x<p.length;x+=2){const w=p[x],E=p[x+1],A=x+3,M=x+4;if(typeof w!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(m.length&&m[m.length-1][0]>=w)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',A);const z=r.parse(E,M,g);if(!z)return null;g=g||z.type,m.push([w,z])}return g.kind==="number"||g.kind==="color"||g.kind==="padding"||g.kind==="array"&&g.itemType.kind==="number"&&typeof g.N=="number"?new Ci(g,o,c,h,m):r.error(`Type ${Tt(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 p=Io(r,c),m=Ci.interpolationFactor(this.interpolation,c,r[p],r[p+1]),g=o[p].evaluate(e),x=o[p+1].evaluate(e);return this.operator==="interpolate"?Xn[this.type.kind.toLowerCase()](g,x,m):this.operator==="interpolate-hcl"?Hn.reverse(Hn.interpolate(Hn.forward(g),Hn.forward(x),m)):Wn.reverse(Wn.interpolate(Wn.forward(g),Wn.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 hs(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 Co{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 p=c&&h.some(m=>tr(c,m.type));return new Co(p?Je: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 K&&!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 Mo{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 p=e[h];if(typeof p!="string")return r.error(`Expected string, but found ${typeof p} instead.`,h);if(/[^a-zA-Z0-9_]/.test(p))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([p,m])}const c=r.parse(e[e.length-1],e.length-1,r.expectedType,o);return c?new Mo(o,c):null}outputDefined(){return this.result.outputDefined()}}class ds{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,Se),c=r.parse(e[2],2,fi(r.expectedType||Je));return o&&c?new ds(c.type.itemType,o,c):null}evaluate(e){const r=this.index.evaluate(e),o=this.input.evaluate(e);if(r<0)throw new De(`Array index out of bounds: ${r} < 0.`);if(r>=o.length)throw new De(`Array index out of bounds: ${r} > ${o.length-1}.`);if(r!==Math.floor(r))throw new De(`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 ps{constructor(e,r){this.type=Ye,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,Je),c=r.parse(e[2],2,Je);return o&&c?jr(o.type,[Ye,et,Se,kr,Je])?new ps(o,c):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(o.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!Xr(r,["boolean","string","number","null"]))throw new De(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(ae(r))} instead.`);if(!Xr(o,["string","array"]))throw new De(`Expected second argument to be of type array or string, but found ${Tt(ae(o))} instead.`);return o.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class zo{constructor(e,r,o){this.type=Se,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,Je),c=r.parse(e[2],2,Je);if(!o||!c)return null;if(!jr(o.type,[Ye,et,Se,kr,Je]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Se);return h?new zo(o,c,h):null}return new zo(o,c)}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!Xr(r,["boolean","string","number","null"]))throw new De(`Expected first argument to be of type boolean, string, number or null, but found ${Tt(ae(r))} instead.`);if(!Xr(o,["string","array"]))throw new De(`Expected second argument to be of type array or string, but found ${Tt(ae(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 fs{constructor(e,r,o,c,h,p){this.inputType=e,this.type=r,this.input=o,this.cases=c,this.outputs=h,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let o,c;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);const h={},p=[];for(let x=2;x<e.length-1;x+=2){let w=e[x];const E=e[x+1];Array.isArray(w)||(w=[w]);const A=r.concat(x);if(w.length===0)return A.error("Expected at least one branch label.");for(const z of w){if(typeof z!="number"&&typeof z!="string")return A.error("Branch labels must be numbers or strings.");if(typeof z=="number"&&Math.abs(z)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof z=="number"&&Math.floor(z)!==z)return A.error("Numeric branch labels must be integer values.");if(o){if(A.checkSubtype(o,ae(z)))return null}else o=ae(z);if(h[String(z)]!==void 0)return A.error("Branch labels must be unique.");h[String(z)]=p.length}const M=r.parse(E,x,c);if(!M)return null;c=c||M.type,p.push(M)}const m=r.parse(e[1],1,Je);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 fs(o,c,m,h,p,g):null}evaluate(e){const r=this.input.evaluate(e);return(ae(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 ms{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 p=1;p<e.length-1;p+=2){const m=r.parse(e[p],p,Ye);if(!m)return null;const g=r.parse(e[p+1],p+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 ms(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 Po{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,Je),c=r.parse(e[2],2,Se);if(!o||!c)return null;if(!jr(o.type,[fi(Je),et,Je]))return r.error(`Expected first argument to be of type array or string, but found ${Tt(o.type)} instead`);if(e.length===4){const h=r.parse(e[3],3,Se);return h?new Po(o.type,o,c,h):null}return new Po(o.type,o,c)}evaluate(e){const r=this.input.evaluate(e),o=this.beginIndex.evaluate(e);if(!Xr(r,["string","array"]))throw new De(`Expected first argument to be of type array or string, but found ${Tt(ae(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 da(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 pa(i,e,r,o){return o.compare(e,r)===0}function En(i,e,r){const o=i!=="=="&&i!=="!=";return class ph{constructor(h,p,m){this.type=Ye,this.lhs=h,this.rhs=p,this.collator=m,this.hasUntypedArgument=h.type.kind==="value"||p.type.kind==="value"}static parse(h,p){if(h.length!==3&&h.length!==4)return p.error("Expected two or three arguments.");const m=h[0];let g=p.parse(h[1],1,Je);if(!g)return null;if(!da(m,g.type))return p.concat(1).error(`"${m}" comparisons are not supported for type '${Tt(g.type)}'.`);let x=p.parse(h[2],2,Je);if(!x)return null;if(!da(m,x.type))return p.concat(2).error(`"${m}" comparisons are not supported for type '${Tt(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error(`Cannot compare types '${Tt(g.type)}' and '${Tt(x.type)}'.`);o&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new Xe(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new Xe(g.type,[x])));let w=null;if(h.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(w=p.parse(h[3],3,gr),!w)return null}return new ph(g,x,w)}evaluate(h){const p=this.lhs.evaluate(h),m=this.rhs.evaluate(h);if(o&&this.hasUntypedArgument){const g=ae(p),x=ae(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new De(`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=ae(p),x=ae(m);if(g.kind!=="string"||x.kind!=="string")return e(h,p,m)}return this.collator?r(h,p,m,this.collator.evaluate(h)):e(h,p,m)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}const yl=En("==",function(i,e,r){return e===r},pa),xl=En("!=",function(i,e,r){return e!==r},function(i,e,r,o){return!pa(0,e,r,o)}),vl=En("<",function(i,e,r){return e<r},function(i,e,r,o){return o.compare(e,r)<0}),bl=En(">",function(i,e,r){return e>r},function(i,e,r,o){return o.compare(e,r)>0}),wl=En("<=",function(i,e,r){return e<=r},function(i,e,r,o){return o.compare(e,r)<=0}),Tl=En(">=",function(i,e,r){return e>=r},function(i,e,r,o){return o.compare(e,r)>=0});class gs{constructor(e,r,o,c,h){this.type=et,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,Se);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,et),!h))return null;let p=null;if(c.currency&&(p=r.parse(c.currency,1,et),!p))return null;let m=null;if(c["min-fraction-digits"]&&(m=r.parse(c["min-fraction-digits"],1,Se),!m))return null;let g=null;return c["max-fraction-digits"]&&(g=r.parse(c["max-fraction-digits"],1,Se),!g)?null:new gs(o,h,p,m,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class ko{constructor(e){this.type=Yt,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 p=1;p<=e.length-1;++p){const m=e[p];if(h&&typeof m=="object"&&!Array.isArray(m)){h=!1;let g=null;if(m["font-scale"]&&(g=r.parse(m["font-scale"],1,Se),!g))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,fi(et)),!x))return null;let w=null;if(m["text-color"]&&(w=r.parse(m["text-color"],1,oi),!w))return null;const E=c[c.length-1];E.scale=g,E.font=x,E.textColor=w}else{const g=r.parse(e[p],1,Je);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 ko(c)}evaluate(e){return new Z(this.sections.map(r=>{const o=r.content.evaluate(e);return ae(o)===qt?new H("",o,null,null,null):new H(Oe(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 _s{constructor(e){this.type=qt,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const o=r.parse(e[1],1,et);return o?new _s(o):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),o=K.fromString(r);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(r)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class ys{constructor(e){this.type=Se,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 ${Tt(o.type)} instead.`):new ys(o):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new De(`Expected value to be of type string or array, but found ${Tt(ae(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Sn={"==":yl,"!=":xl,">":bl,"<":vl,">=":Tl,"<=":wl,array:Xe,at:ds,boolean:Xe,case:ms,coalesce:Co,collator:Qt,format:ko,image:_s,in:ps,"index-of":zo,interpolate:Ci,"interpolate-hcl":Ci,"interpolate-lab":Ci,length:ys,let:Mo,literal:$e,match:fs,number:Xe,"number-format":gs,object:Xe,slice:Po,step:jn,string:Xe,"to-boolean":Ke,"to-color":Ke,"to-number":Ke,"to-string":Ke,var:So,within:Hr};function fa(i,[e,r,o,c]){e=e.evaluate(i),r=r.evaluate(i),o=o.evaluate(i);const h=c?c.evaluate(i):1,p=le(e,r,o,h);if(p)throw new De(p);return new D(e/255*h,r/255*h,o/255*h,h)}function ma(i,e){return i in e}function Do(i,e){const r=e[i];return r===void 0?null:r}function Kr(i){return{type:i}}function ga(i){return{result:"success",value:i}}function In(i){return{result:"error",value:i}}function zt(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function _a(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function at(i){return!!i.expression&&i.expression.interpolated}function yt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Ct(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Lt(i){return i}function Kn(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||(at(e)?"exponential":"interval");if(r||e.type==="padding"){const x=r?D.parse:G.parse;(i=ji({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],x(w[1])])),i.default=x(i.default?i.default:e.default)}if(i.colorSpace&&i.colorSpace!=="rgb"&&!ha[i.colorSpace])throw new Error(`Unknown color space: ${i.colorSpace}`);let p,m,g;if(h==="exponential")p=ya;else if(h==="interval")p=Sl;else if(h==="categorical"){p=El,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}"`);p=Il}if(o){const x={},w=[];for(let M=0;M<i.stops.length;M++){const z=i.stops[M],$=z[0].zoom;x[$]===void 0&&(x[$]={zoom:$,type:i.type,property:i.property,default:i.default,stops:[]},w.push($)),x[$].stops.push([z[0].value,z[1]])}const E=[];for(const M of w)E.push([x[M].zoom,Kn(x[M],e)]);const A={name:"linear"};return{kind:"composite",interpolationType:A,interpolationFactor:Ci.interpolationFactor.bind(void 0,A),zoomStops:E.map(M=>M[0]),evaluate:({zoom:M},z)=>ya({stops:E,base:i.base},e,M).evaluate(M,z)}}if(c){const x=h==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:x,interpolationFactor:Ci.interpolationFactor.bind(void 0,x),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>p(i,e,w,m,g)}}return{kind:"source",evaluate(x,w){const E=w&&w.properties?w.properties[i.property]:void 0;return E===void 0?An(i.default,e.default):p(i,e,E,m,g)}}}function An(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function El(i,e,r,o,c){return An(typeof r===c?o[r]:void 0,i.default,e.default)}function Sl(i,e,r){if(yt(r)!=="number")return An(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=Io(i.stops.map(h=>h[0]),r);return i.stops[c][1]}function ya(i,e,r){const o=i.base!==void 0?i.base:1;if(yt(r)!=="number")return An(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=Io(i.stops.map(w=>w[0]),r),p=function(w,E,A,M){const z=M-A,$=w-A;return z===0?0:E===1?$/z:(Math.pow(E,$)-1)/(Math.pow(E,z)-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=Xn[e.type]||Lt;if(i.colorSpace&&i.colorSpace!=="rgb"){const w=ha[i.colorSpace];x=(E,A)=>w.reverse(w.interpolate(w.forward(E),w.forward(A),p))}return typeof m.evaluate=="function"?{evaluate(...w){const E=m.evaluate.apply(void 0,w),A=g.evaluate.apply(void 0,w);if(E!==void 0&&A!==void 0)return x(E,A,p)}}:x(m,g,p)}function Il(i,e,r){switch(e.type){case"color":r=D.parse(r);break;case"formatted":r=Z.fromString(r.toString());break;case"resolvedImage":r=K.fromString(r.toString());break;case"padding":r=G.parse(r);break;default:yt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return An(r,i.default,e.default)}St.register(Sn,{error:[{kind:"error"},[et],(i,[e])=>{throw new De(e.evaluate(i))}],typeof:[et,[Je],(i,[e])=>Tt(ae(e.evaluate(i)))],"to-rgba":[fi(Se,4),[oi],(i,[e])=>e.evaluate(i).toArray()],rgb:[oi,[Se,Se,Se],fa],rgba:[oi,[Se,Se,Se,Se],fa],has:{type:Ye,overloads:[[[et],(i,[e])=>ma(e.evaluate(i),i.properties())],[[et,Dr],(i,[e,r])=>ma(e.evaluate(i),r.evaluate(i))]]},get:{type:Je,overloads:[[[et],(i,[e])=>Do(e.evaluate(i),i.properties())],[[et,Dr],(i,[e,r])=>Do(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Je,[et],(i,[e])=>Do(e.evaluate(i),i.featureState||{})],properties:[Dr,[],i=>i.properties()],"geometry-type":[et,[],i=>i.geometryType()],id:[Je,[],i=>i.id()],zoom:[Se,[],i=>i.globals.zoom],"heatmap-density":[Se,[],i=>i.globals.heatmapDensity||0],"line-progress":[Se,[],i=>i.globals.lineProgress||0],accumulated:[Je,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Se,Kr(Se),(i,e)=>{let r=0;for(const o of e)r+=o.evaluate(i);return r}],"*":[Se,Kr(Se),(i,e)=>{let r=1;for(const o of e)r*=o.evaluate(i);return r}],"-":{type:Se,overloads:[[[Se,Se],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Se],(i,[e])=>-e.evaluate(i)]]},"/":[Se,[Se,Se],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Se,[Se,Se],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Se,[],()=>Math.LN2],pi:[Se,[],()=>Math.PI],e:[Se,[],()=>Math.E],"^":[Se,[Se,Se],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Se,[Se],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))],log2:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Se,[Se],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Se,[Se],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Se,[Se],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Se,[Se],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Se,[Se],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Se,[Se],(i,[e])=>Math.atan(e.evaluate(i))],min:[Se,Kr(Se),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Se,Kr(Se),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Se,[Se],(i,[e])=>Math.abs(e.evaluate(i))],round:[Se,[Se],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Se,[Se],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Se,[Se],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ye,[et,Je],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ye,[Je],(i,[e])=>i.id()===e.value],"filter-type-==":[Ye,[et],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<c}],"filter-id-<":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<o}],"filter->":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>c}],"filter-id->":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>o}],"filter-<=":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o<=c}],"filter-id-<=":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<=o}],"filter->=":[Ye,[et,Je],(i,[e,r])=>{const o=i.properties()[e.value],c=r.value;return typeof o==typeof c&&o>=c}],"filter-id->=":[Ye,[Je],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>=o}],"filter-has":[Ye,[Je],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ye,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ye,[fi(et)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ye,[fi(Je)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ye,[et,fi(Je)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ye,[et,fi(Je)],(i,[e,r])=>function(o,c,h,p){for(;h<=p;){const m=h+p>>1;if(c[m]===o)return!0;c[m]>o?p=m-1:h=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Kr(Ye),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Kr(Ye),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ye,[Ye],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ye,[et],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[et,[et],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[et,[et],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[et,Kr(Je),(i,e)=>e.map(r=>Oe(r.evaluate(i))).join("")],"resolved-locale":[et,[gr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Lo{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new ft,this._defaultValue=r?function(o){return o.type==="color"&&Ct(o.default)?new D(0,0,0,0):o.type==="color"?D.parse(o.default)||null:o.type==="padding"?G.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,p){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=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,o,c,h,p){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=p||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new De(`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<"u"&&console.warn(m.message)),this._defaultValue}}}function Jn(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Sn}function Yn(i,e){const r=new Tn(Sn,[],e?function(c){const h={color:oi,string:et,number:Se,enum:et,boolean:Ye,formatted:Yt,padding:yn,resolvedImage:qt};return c.type==="array"?fi(h[c.value]||Je,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?ga(new Lo(o,e)):In(r.errors)}class Qn{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!wn(r.expression)}evaluateWithoutErrorHandling(e,r,o,c,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,p)}evaluate(e,r,o,c,h,p){return this._styleExpression.evaluate(e,r,o,c,h,p)}}class xs{constructor(e,r,o,c){this.kind=e,this.zoomStops=o,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!wn(r.expression),this.interpolationType=c}evaluateWithoutErrorHandling(e,r,o,c,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,c,h,p)}evaluate(e,r,o,c,h,p){return this._styleExpression.evaluate(e,r,o,c,h,p)}interpolationFactor(e,r,o){return this.interpolationType?Ci.interpolationFactor(this.interpolationType,e,r,o):0}}function xa(i,e){const r=Yn(i,e);if(r.result==="error")return r;const o=r.value.expression,c=Zn(o);if(!c&&!zt(e))return In([new Ii("","data expressions not supported")]);const h=Eo(o,["zoom"]);if(!h&&!_a(e))return In([new Ii("","zoom expressions not supported")]);const p=Bo(o);return p||h?p instanceof Ii?In([p]):p instanceof Ci&&!at(e)?In([new Ii("",'"interpolate" expressions cannot be used with this property')]):ga(p?new xs(c?"camera":"composite",r.value,p.labels,p instanceof Ci?p.interpolation:void 0):new Qn(c?"constant":"source",r.value)):In([new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ro{constructor(e,r){this._parameters=e,this._specification=r,ji(this,Kn(this._parameters,this._specification))}static deserialize(e){return new Ro(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Bo(i){let e=null;if(i instanceof Mo)e=Bo(i.result);else if(i instanceof Co){for(const r of i.args)if(e=Bo(r),e)break}else(i instanceof jn||i instanceof Ci)&&i.input instanceof St&&i.input.name==="zoom"&&(e=i);return e instanceof Ii||i.eachChild(r=>{const o=Bo(r);o instanceof Ii?e=o:!e&&o?e=new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new Ii("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Xi(i){const e=i.key,r=i.value,o=i.valueSpec||{},c=i.objectElementValidators||{},h=i.style,p=i.styleSpec;let m=[];const g=yt(r);if(g!=="object")return[new Ce(e,r,`object expected, ${g} found`)];for(const x in r){const w=x.split(".")[0],E=o[w]||o["*"];let A;if(c[w])A=c[w];else if(o[w])A=zi;else if(c["*"])A=c["*"];else{if(!o["*"]){m.push(new Ce(e,r[x],`unknown property "${x}"`));continue}A=zi}m=m.concat(A({key:(e&&`${e}.`)+x,value:r[x],valueSpec:E,style:h,styleSpec:p,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 Ce(e,r,`missing required property "${x}"`));return m}function va(i){const e=i.value,r=i.valueSpec,o=i.style,c=i.styleSpec,h=i.key,p=i.arrayElementValidator||zi;if(yt(e)!=="array")return[new Ce(h,e,`array expected, ${yt(e)} found`)];if(r.length&&e.length!==r.length)return[new Ce(h,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new Ce(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),yt(r.value)==="object"&&(m=r.value);let g=[];for(let x=0;x<e.length;x++)g=g.concat(p({array:e,arrayIndex:x,value:e[x],valueSpec:m,style:o,styleSpec:c,key:`${h}[${x}]`}));return g}function vs(i){const e=i.key,r=i.value,o=i.valueSpec;let c=yt(r);return c==="number"&&r!=r&&(c="NaN"),c!=="number"?[new Ce(e,r,`number expected, ${c} found`)]:"minimum"in o&&r<o.minimum?[new Ce(e,r,`${r} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&r>o.maximum?[new Ce(e,r,`${r} is greater than the maximum value ${o.maximum}`)]:[]}function ba(i){const e=i.valueSpec,r=dt(i.value.type);let o,c,h,p={};const m=r!=="categorical"&&i.value.property===void 0,g=!m,x=yt(i.value.stops)==="array"&&yt(i.value.stops[0])==="array"&&yt(i.value.stops[0][0])==="object",w=Xi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(M){if(r==="identity")return[new Ce(M.key,M.value,'identity function may not have a "stops" property')];let z=[];const $=M.value;return z=z.concat(va({key:M.key,value:$,valueSpec:M.valueSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:E})),yt($)==="array"&&$.length===0&&z.push(new Ce(M.key,$,"array must have at least one stop")),z},default:function(M){return zi({key:M.key,value:M.value,valueSpec:e,style:M.style,styleSpec:M.styleSpec})}}});return r==="identity"&&m&&w.push(new Ce(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||w.push(new Ce(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!at(i.valueSpec)&&w.push(new Ce(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!zt(i.valueSpec)?w.push(new Ce(i.key,i.value,"property functions not supported")):m&&!_a(i.valueSpec)&&w.push(new Ce(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||w.push(new Ce(i.key,i.value,'"property" property is required')),w;function E(M){let z=[];const $=M.value,U=M.key;if(yt($)!=="array")return[new Ce(U,$,`array expected, ${yt($)} found`)];if($.length!==2)return[new Ce(U,$,`array length 2 expected, length ${$.length} found`)];if(x){if(yt($[0])!=="object")return[new Ce(U,$,`object expected, ${yt($[0])} found`)];if($[0].zoom===void 0)return[new Ce(U,$,"object stop key must have zoom")];if($[0].value===void 0)return[new Ce(U,$,"object stop key must have value")];if(h&&h>dt($[0].zoom))return[new Ce(U,$[0].zoom,"stop zoom values must appear in ascending order")];dt($[0].zoom)!==h&&(h=dt($[0].zoom),c=void 0,p={}),z=z.concat(Xi({key:`${U}[0]`,value:$[0],valueSpec:{zoom:{}},style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:vs,value:A}}))}else z=z.concat(A({key:`${U}[0]`,value:$[0],valueSpec:{},style:M.style,styleSpec:M.styleSpec},$));return Jn(Oi($[1]))?z.concat([new Ce(`${U}[1]`,$[1],"expressions are not allowed in function stops.")]):z.concat(zi({key:`${U}[1]`,value:$[1],valueSpec:e,style:M.style,styleSpec:M.styleSpec}))}function A(M,z){const $=yt(M.value),U=dt(M.value),ee=M.value!==null?M.value:z;if(o){if($!==o)return[new Ce(M.key,ee,`${$} stop domain type must match previous stop domain type ${o}`)]}else o=$;if($!=="number"&&$!=="string"&&$!=="boolean")return[new Ce(M.key,ee,"stop domain value must be a number, string, or boolean")];if($!=="number"&&r!=="categorical"){let oe=`number expected, ${$} found`;return zt(e)&&r===void 0&&(oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ce(M.key,ee,oe)]}return r!=="categorical"||$!=="number"||isFinite(U)&&Math.floor(U)===U?r!=="categorical"&&$==="number"&&c!==void 0&&U<c?[new Ce(M.key,ee,"stop domain values must appear in ascending order")]:(c=U,r==="categorical"&&U in p?[new Ce(M.key,ee,"stop domain values must be unique")]:(p[U]=!0,[])):[new Ce(M.key,ee,`integer expected, found ${U}`)]}}function Jr(i){const e=(i.expressionContext==="property"?xa:Yn)(Oi(i.value),i.valueSpec);if(e.result==="error")return e.value.map(o=>new Ce(`${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 Ce(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"&&!wn(r))return[new Ce(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!wn(r))return[new Ce(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Eo(r,["zoom","feature-state"]))return[new Ce(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Zn(r))return[new Ce(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function eo(i){const e=i.key,r=i.value,o=i.valueSpec,c=[];return Array.isArray(o.values)?o.values.indexOf(dt(r))===-1&&c.push(new Ce(e,r,`expected one of [${o.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(o.values).indexOf(dt(r))===-1&&c.push(new Ce(e,r,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(r)} found`)),c}function Cn(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(!Cn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Al={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Fo(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Cn(i)||(i=to(i));const e=Yn(i,Al);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:Ta(i)}}function wa(i,e){return i<e?-1:i>e?1:0}function Ta(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Ta(i[e]))return!0;return!1}function to(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?bs(i[1],i[2],"=="):e==="!="?Mn(bs(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?bs(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(to))):e==="all"?["all"].concat(i.slice(1).map(to)):e==="none"?["all"].concat(i.slice(1).map(to).map(Mn)):e==="in"?Oo(i[1],i.slice(2)):e==="!in"?Mn(Oo(i[1],i.slice(2))):e==="has"?io(i[1]):e==="!has"?Mn(io(i[1])):e!=="within"||i;var r}function bs(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 Oo(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(wa)]]:["filter-in-small",i,["literal",e]]}}function io(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Mn(i){return["!",i]}function ro(i){return Cn(Oi(i.value))?Jr(ji({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ea(i)}function Ea(i){const e=i.value,r=i.key;if(yt(e)!=="array")return[new Ce(r,e,`array expected, ${yt(e)} found`)];const o=i.styleSpec;let c,h=[];if(e.length<1)return[new Ce(r,e,"filter array must have at least 1 element")];switch(h=h.concat(eo({key:`${r}[0]`,value:e[0],valueSpec:o.filter_operator,style:i.style,styleSpec:i.styleSpec})),dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&dt(e[1])==="$type"&&h.push(new Ce(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&h.push(new Ce(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(c=yt(e[1]),c!=="string"&&h.push(new Ce(`${r}[1]`,e[1],`string expected, ${c} found`)));for(let p=2;p<e.length;p++)c=yt(e[p]),dt(e[1])==="$type"?h=h.concat(eo({key:`${r}[${p}]`,value:e[p],valueSpec:o.geometry_type,style:i.style,styleSpec:i.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&h.push(new Ce(`${r}[${p}]`,e[p],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let p=1;p<e.length;p++)h=h.concat(Ea({key:`${r}[${p}]`,value:e[p],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":c=yt(e[1]),e.length!==2?h.push(new Ce(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="string"&&h.push(new Ce(`${r}[1]`,e[1],`string expected, ${c} found`));break;case"within":c=yt(e[1]),e.length!==2?h.push(new Ce(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="object"&&h.push(new Ce(`${r}[1]`,e[1],`object expected, ${c} found`))}return h}function no(i,e){const r=i.key,o=i.style,c=i.styleSpec,h=i.value,p=i.objectKey,m=c[`${e}_${i.layerType}`];if(!m)return[];const g=p.match(/^(.*)-transition$/);if(e==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return zi({key:r,value:h,valueSpec:c.transition,style:o,styleSpec:c});const x=i.valueSpec||m[p];if(!x)return[new Ce(r,h,`unknown property "${p}"`)];let w;if(yt(h)==="string"&&zt(x)&&!x.tokens&&(w=/^{([^}]+)}$/.exec(h)))return[new Ce(r,h,`"${p}" does not support interpolation syntax
2
2
  Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(w[1])} }\`.`)];const E=[];return i.layerType==="symbol"&&(p==="text-field"&&o&&!o.glyphs&&E.push(new Ce(r,h,'use of "text-field" requires a style "glyphs" property')),p==="text-font"&&Ct(Oi(h))&&dt(h.type)==="identity"&&E.push(new Ce(r,h,'"text-font" does not support identity functions'))),E.concat(zi({key:i.key,value:h,valueSpec:x,style:o,styleSpec:c,expressionContext:"property",propertyType:e,propertyKey:p}))}function Sa(i){return no(i,"paint")}function Ia(i){return no(i,"layout")}function Aa(i){let e=[];const r=i.value,o=i.key,c=i.style,h=i.styleSpec;r.type||r.ref||e.push(new Ce(o,r,'either "type" or "ref" is required'));let p=dt(r.type);const m=dt(r.ref);if(r.id){const g=dt(r.id);for(let x=0;x<i.arrayIndex;x++){const w=c.layers[x];dt(w.id)===g&&e.push(new Ce(o,r.id,`duplicate layer id "${r.id}", previously used at line ${w.id.__line__}`))}}if("ref"in r){let g;["type","source","source-layer","filter","layout"].forEach(x=>{x in r&&e.push(new Ce(o,r[x],`"${x}" is prohibited for ref layers`))}),c.layers.forEach(x=>{dt(x.id)===m&&(g=x)}),g?g.ref?e.push(new Ce(o,r.ref,"ref cannot reference another ref layer")):p=dt(g.type):e.push(new Ce(o,r.ref,`ref layer "${m}" not found`))}else if(p!=="background")if(r.source){const g=c.sources&&c.sources[r.source],x=g&&dt(g.type);g?x==="vector"&&p==="raster"?e.push(new Ce(o,r.source,`layer "${r.id}" requires a raster source`)):x==="raster"&&p!=="raster"?e.push(new Ce(o,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&p!=="hillshade"?e.push(new Ce(o,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):p!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&g.lineMetrics||e.push(new Ce(o,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ce(o,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Ce(o,r.source,`source "${r.source}" not found`))}else e.push(new Ce(o,r,'missing required property "source"'));return e=e.concat(Xi({key:o,value:r,valueSpec:h.layer,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{"*":()=>[],type:()=>zi({key:`${o}.type`,value:r.type,valueSpec:h.layer.type,style:i.style,styleSpec:i.styleSpec,object:r,objectKey:"type"}),filter:ro,layout:g=>Xi({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{"*":x=>Ia(ji({layerType:p},x))}}),paint:g=>Xi({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{"*":x=>Sa(ji({layerType:p},x))}})}})),e}function zn(i){const e=i.value,r=i.key,o=yt(e);return o!=="string"?[new Ce(r,e,`string expected, ${o} found`)]:[]}const Ca={promoteId:function({key:i,value:e}){if(yt(e)==="string")return zn({key:i,value:e});{const r=[];for(const o in e)r.push(...zn({key:`${i}.${o}`,value:e[o]}));return r}}};function oo(i){const e=i.value,r=i.key,o=i.styleSpec,c=i.style;if(!e.type)return[new Ce(r,e,'"type" is required')];const h=dt(e.type);let p;switch(h){case"vector":case"raster":case"raster-dem":return p=Xi({key:r,value:e,valueSpec:o[`source_${h.replace("-","_")}`],style:i.style,styleSpec:o,objectElementValidators:Ca}),p;case"geojson":if(p=Xi({key:r,value:e,valueSpec:o.source_geojson,style:c,styleSpec:o,objectElementValidators:Ca}),e.cluster)for(const m in e.clusterProperties){const[g,x]=e.clusterProperties[m],w=typeof g=="string"?[g,["accumulated"],["get",m]]:g;p.push(...Jr({key:`${r}.${m}.map`,value:x,expressionContext:"cluster-map"})),p.push(...Jr({key:`${r}.${m}.reduce`,value:w,expressionContext:"cluster-reduce"}))}return p;case"video":return Xi({key:r,value:e,valueSpec:o.source_video,style:c,styleSpec:o});case"image":return Xi({key:r,value:e,valueSpec:o.source_image,style:c,styleSpec:o});case"canvas":return[new Ce(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return eo({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:c,styleSpec:o})}}function so(i){const e=i.value,r=i.styleSpec,o=r.light,c=i.style;let h=[];const p=yt(e);if(e===void 0)return h;if(p!=="object")return h=h.concat([new Ce("light",e,`object expected, ${p} found`)]),h;for(const m in e){const g=m.match(/^(.*)-transition$/);h=h.concat(g&&o[g[1]]&&o[g[1]].transition?zi({key:m,value:e[m],valueSpec:r.transition,style:c,styleSpec:r}):o[m]?zi({key:m,value:e[m],valueSpec:o[m],style:c,styleSpec:r}):[new Ce(m,e[m],`unknown property "${m}"`)])}return h}function Mi(i){const e=i.value,r=i.styleSpec,o=r.terrain,c=i.style;let h=[];const p=yt(e);if(e===void 0)return h;if(p!=="object")return h=h.concat([new Ce("terrain",e,`object expected, ${p} found`)]),h;for(const m in e)h=h.concat(o[m]?zi({key:m,value:e[m],valueSpec:o[m],style:c,styleSpec:r}):[new Ce(m,e[m],`unknown property "${m}"`)]);return h}const ao={"*":()=>[],array:va,boolean:function(i){const e=i.value,r=i.key,o=yt(e);return o!=="boolean"?[new Ce(r,e,`boolean expected, ${o} found`)]:[]},number:vs,color:function(i){const e=i.key,r=i.value,o=yt(r);return o!=="string"?[new Ce(e,r,`color expected, ${o} found`)]:vn(r)===null?[new Ce(e,r,`color expected, "${r}" found`)]:[]},constants:Zr,enum:eo,filter:ro,function:ba,layer:Aa,object:Xi,source:oo,light:so,terrain:Mi,string:zn,formatted:function(i){return zn(i).length===0?[]:Jr(i)},resolvedImage:function(i){return zn(i).length===0?[]:Jr(i)},padding:function(i){const e=i.key,r=i.value;if(yt(r)==="array"){if(r.length<1||r.length>4)return[new Ce(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(zi({key:`${e}[${h}]`,value:r[h],valueSpec:o}));return c}return vs({key:e,value:r,valueSpec:{}})}};function zi(i){const e=i.value,r=i.valueSpec,o=i.styleSpec;return r.expression&&Ct(dt(e))?ba(i):r.expression&&Jn(Oi(e))?Jr(i):r.type&&ao[r.type]?ao[r.type](i):Xi(ji({},i,{valueSpec:r.type?o[r.type]:r}))}function Cl(i){const e=i.value,r=i.key,o=zn(i);return o.length||(e.indexOf("{fontstack}")===-1&&o.push(new Ce(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new Ce(r,e,'"glyphs" url must include a "{range}" token'))),o}function Lr(i,e=de){let r=[];return r=r.concat(zi({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,objectElementValidators:{glyphs:Cl,"*":()=>[]}})),i.constants&&(r=r.concat(Zr({key:"constants",value:i.constants,style:i,styleSpec:e}))),Ma(r)}function Ma(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function _r(i){return function(...e){return Ma(i.apply(this,e))}}Lr.source=_r(oo),Lr.light=_r(so),Lr.terrain=_r(Mi),Lr.layer=_r(Aa),Lr.filter=_r(ro),Lr.paintProperty=_r(Sa),Lr.layoutProperty=_r(Ia);const lo=Lr,ws=lo.light,Ml=lo.paintProperty,zl=lo.layoutProperty;function Uo(i,e){let r=!1;if(e&&e.length)for(const o of e)i.fire(new _n(new Error(o.message))),r=!0;return r}class co{constructor(e,r,o){const c=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const p=new Int32Array(this.arrayBuffer);e=p[0],this.d=(r=p[1])+2*(o=p[2]);for(let g=0;g<this.d*this.d;g++){const x=p[3+g],w=p[3+g+1];c.push(x===w?null:p.subarray(x,w))}const m=p[3+c.length+1];this.keys=p.subarray(p[3+c.length],m),this.bboxes=p.subarray(m),this.insert=this._insertReadonly}else{this.d=r+2*o;for(let p=0;p<this.d*this.d;p++)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,p){this.cells[h].push(p)}query(e,r,o,c,h){const p=this.min,m=this.max;if(e<=p&&r<=p&&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,p,m,g){const x=this.cells[h];if(x!==null){const w=this.keys,E=this.bboxes;for(let A=0;A<x.length;A++){const M=x[A];if(m[M]===void 0){const z=4*M;(g?g(E[z+0],E[z+1],E[z+2],E[z+3]):e<=E[z+2]&&r<=E[z+3]&&o>=E[z+0]&&c>=E[z+1])?(m[M]=!0,p.push(w[M])):m[M]=!1}}}}_forEachCell(e,r,o,c,h,p,m,g){const x=this._convertToCellCoord(e),w=this._convertToCellCoord(r),E=this._convertToCellCoord(o),A=this._convertToCellCoord(c);for(let M=x;M<=E;M++)for(let z=w;z<=A;z++){const $=this.d*z+M;if((!g||g(this._convertFromCellCoord(M),this._convertFromCellCoord(z),this._convertFromCellCoord(M+1),this._convertFromCellCoord(z+1)))&&h.call(this,e,r,o,c,$,p,m,g))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let o=0;for(let p=0;p<this.cells.length;p++)o+=this.cells[p].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 p=0;p<e.length;p++){const m=e[p];c[3+p]=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 co(e.buffer)}}const yr={};function Fe(i,e,r={}){if(yr[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),yr[i]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}Fe("Object",Object),Fe("TransferableGridIndex",co),Fe("Color",D),Fe("Error",Error),Fe("AJAXError",Si),Fe("ResolvedImage",K),Fe("StylePropertyFunction",Ro),Fe("StyleExpression",Lo,{omit:["_evaluator"]}),Fe("ZoomDependentExpression",xs),Fe("ZoomConstantExpression",Qn),Fe("CompoundExpression",St,{omit:["_evaluate"]});for(const i in Sn)Sn[i]._classRegistryKey||Fe(`Expression_${i}`,Sn[i]);function za(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function Yr(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(za(i)||Er(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(Yr(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(!yr[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)||yr[o].omit.indexOf(h)>=0)continue;const p=i[h];c[h]=yr[o].shallow.indexOf(h)>=0?p:Yr(p,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 Rr(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||za(i)||Er(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Rr);if(typeof i=="object"){const e=i.$name||"Object";if(!yr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=yr[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]=yr[e].shallow.indexOf(c)>=0?h:Rr(h)}return o}throw new Error("can't deserialize object of type "+typeof i)}class Ts{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 $o(i){for(const e of i)if(Ss(e.charCodeAt(0)))return!0;return!1}function Pl(i){for(const e of i)if(!Es(e.charCodeAt(0)))return!1;return!0}function Es(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 Ss(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 Pa(i){return!(Ss(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 ka(i){return i>=1424&&i<=2303||ze["Arabic Presentation Forms-A"](i)||ze["Arabic Presentation Forms-B"](i)}function kl(i,e){return!(!e&&ka(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||ze.Khmer(i))}function Da(i){for(const e of i)if(ka(e.charCodeAt(0)))return!0;return!1}const Is="deferred",As="loading",Cs="loaded";let Ms=null,xi="unavailable",Br=null;const La=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(xi="error"),Ms&&Ms(i)};function Pn(){zs.fire(new fr("pluginStateChange",{pluginStatus:xi,pluginURL:Br}))}const zs=new mr,uo=function(){return xi},Ra=function(){if(xi!==Is||!Br)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");xi=As,Pn(),Br&&gn({url:Br},i=>{i?La(i):(xi=Cs,Pn())})},Ui={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>xi===Cs||Ui.applyArabicShaping!=null,isLoading:()=>xi===As,setState(i){if(!pi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");xi=i.pluginStatus,Br=i.pluginURL},isParsed(){if(!pi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ui.applyArabicShaping!=null&&Ui.processBidirectionalText!=null&&Ui.processStyledBidirectionalText!=null},getPluginURL(){if(!pi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Br}};class Rt{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 Ts,this.transition={})}isSupportedScript(e){return function(r,o){for(const c of r)if(!kl(c.charCodeAt(0),o))return!1;return!0}(e,Ui.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 ho{constructor(e,r){this.property=e,this.value=r,this.expression=function(o,c){if(Ct(o))return new Ro(o,c);if(Jn(o)){const h=xa(o,c);if(h.result==="error")throw new Error(h.value.map(p=>`${p.key}: ${p.message}`).join(", "));return h.value}{let h=o;return c.type==="color"&&typeof o=="string"?h=D.parse(o):c.type!=="padding"||typeof o!="number"&&!Array.isArray(o)||(h=G.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 Vo{constructor(e){this.property=e,this.value=new ho(e,void 0)}transitioned(e,r){return new Fa(this.property,this.value,r,nt({},e.transition,this.transition),e.now)}untransitioned(){return new Fa(this.property,this.value,null,{},0)}}class Ba{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return vt(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Vo(this._values[e].property)),this._values[e].value=new ho(this._values[e].property,r===null?void 0:vt(r))}getTransition(e){return vt(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Vo(this._values[e].property)),this._values[e].transition=vt(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 Oa(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 Oa(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Fa{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),p=this.prior;if(p){if(c>this.end)return this.prior=null,h;if(this.value.isDataDriven())return this.prior=null,h;if(c<this.begin)return p.possiblyEvaluate(e,r,o);{const m=(c-this.begin)/(this.end-this.begin);return this.property.interpolate(p.possiblyEvaluate(e,r,o),h,function(g){if(g<=0)return 0;if(g>=1)return 1;const x=g*g,w=x*g;return 4*(g<.5?w:3*(g-x)+w-.75)}(m))}}return h}}class Oa{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,o){const c=new po(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 Dl{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return vt(this._values[e].value)}setValue(e,r){this._values[e]=new ho(this._values[e].property,r===null?void 0:vt(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 po(this._properties);for(const h of Object.keys(this._values))c._values[h]=this._values[h].possiblyEvaluate(e,r,o);return c}}class ir{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 po{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ve{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=Xn[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 ir(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 ir(this,{kind:"constant",value:void 0},e.parameters);const c=Xn[this.specification.type];return c?new ir(this,{kind:"constant",value:c(e.value.value,r.value.value,o)},e.parameters):e}evaluate(e,r,o,c,h,p){return e.kind==="constant"?e.value:e.evaluate(r,o,c,h,p)}}class kn extends je{possiblyEvaluate(e,r,o,c){if(e.value===void 0)return new ir(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const h=e.expression.evaluate(r,null,{},o,c),p=e.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,m=this._calculate(p,p,p,r);return new ir(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 ir(this,{kind:"constant",value:h},r)}return new ir(this,e.expression,r)}evaluate(e,r,o,c,h,p){if(e.kind==="source"){const m=e.evaluate(r,o,c,h,p);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 Ps{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 Rt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new Rt(Math.floor(r.zoom),r)),e.expression.evaluate(new Rt(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 Fr{constructor(e){this.specification=e}possiblyEvaluate(e,r,o,c){return!!e.expression.evaluate(r,null,{},o,c)}interpolate(){return!1}}class si{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 ho(o,void 0),h=this.defaultTransitionablePropertyValues[r]=new Vo(o);this.defaultTransitioningPropertyValues[r]=h.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=c.possiblyEvaluate({})}}}Fe("DataDrivenProperty",je),Fe("DataConstantProperty",Ve),Fe("CrossFadedDataDrivenProperty",kn),Fe("CrossFadedProperty",Ps),Fe("ColorRampProperty",Fr);const Or="-transition";class rr extends mr{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 Dl(r.layout)),r.paint)){this._transitionablePaint=new Ba(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 po(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(zl,`layers.${this.id}.layout.${e}`,e,r,o)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Or)?this._transitionablePaint.getTransition(e.slice(0,-Or.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,o={}){if(r!=null&&this._validate(Ml,`layers.${this.id}.paint.${e}`,e,r,o))return!1;if(e.endsWith(Or))return this._transitionablePaint.setTransition(e.slice(0,-Or.length),r||void 0),!1;{const c=this._transitionablePaint._values[e],h=c.property.specification["property-type"]==="cross-faded-data-driven",p=c.value.isDataDriven(),m=c.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const g=this._transitionablePaint._values[e].value;return g.isDataDriven()||p||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),ct(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)&&Uo(this,e.call(lo,{key:r,layerType:this.type,objectKey:o,value:c,styleSpec:de,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 ir&&zt(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Ua={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ur{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 Vt{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 Zt(i,e=1){let r=0,o=0;return{members:i.map(c=>{const h=Ua[c.type].BYTES_PER_ELEMENT,p=r=ks(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:p}}),size:ks(r,Math.max(o,e)),alignment:e}}function ks(i,e){return Math.ceil(i/e)*e}class Qr extends Vt{_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}}Qr.prototype.bytesPerElement=4,Fe("StructArrayLayout2i4",Qr);class a extends Vt{_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 p=4*e;return this.int16[p+0]=r,this.int16[p+1]=o,this.int16[p+2]=c,this.int16[p+3]=h,e}}a.prototype.bytesPerElement=8,Fe("StructArrayLayout4i8",a);class t extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,o,c,h,p)}emplace(e,r,o,c,h,p,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]=p,this.int16[g+5]=m,e}}t.prototype.bytesPerElement=12,Fe("StructArrayLayout2i4i12",t);class n extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,o,c,h,p)}emplace(e,r,o,c,h,p,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]=p,this.uint8[x+7]=m,e}}n.prototype.bytesPerElement=8,Fe("StructArrayLayout2i4ub8",n);class s extends Vt{_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,Fe("StructArrayLayout2f8",s);class u extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,p,m,g,x,w){const E=this.length;return this.resize(E+1),this.emplace(E,e,r,o,c,h,p,m,g,x,w)}emplace(e,r,o,c,h,p,m,g,x,w,E){const A=10*e;return this.uint16[A+0]=r,this.uint16[A+1]=o,this.uint16[A+2]=c,this.uint16[A+3]=h,this.uint16[A+4]=p,this.uint16[A+5]=m,this.uint16[A+6]=g,this.uint16[A+7]=x,this.uint16[A+8]=w,this.uint16[A+9]=E,e}}u.prototype.bytesPerElement=20,Fe("StructArrayLayout10ui20",u);class d extends Vt{_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,p,m,g,x,w,E,A){const M=this.length;return this.resize(M+1),this.emplace(M,e,r,o,c,h,p,m,g,x,w,E,A)}emplace(e,r,o,c,h,p,m,g,x,w,E,A,M){const z=12*e;return this.int16[z+0]=r,this.int16[z+1]=o,this.int16[z+2]=c,this.int16[z+3]=h,this.uint16[z+4]=p,this.uint16[z+5]=m,this.uint16[z+6]=g,this.uint16[z+7]=x,this.int16[z+8]=w,this.int16[z+9]=E,this.int16[z+10]=A,this.int16[z+11]=M,e}}d.prototype.bytesPerElement=24,Fe("StructArrayLayout4i4ui4i24",d);class f extends Vt{_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,Fe("StructArrayLayout3f12",f);class _ extends Vt{_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,Fe("StructArrayLayout1ul4",_);class y extends Vt{_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,p,m,g,x){const w=this.length;return this.resize(w+1),this.emplace(w,e,r,o,c,h,p,m,g,x)}emplace(e,r,o,c,h,p,m,g,x,w){const E=10*e,A=5*e;return this.int16[E+0]=r,this.int16[E+1]=o,this.int16[E+2]=c,this.int16[E+3]=h,this.int16[E+4]=p,this.int16[E+5]=m,this.uint32[A+3]=g,this.uint16[E+8]=x,this.uint16[E+9]=w,e}}y.prototype.bytesPerElement=20,Fe("StructArrayLayout6i1ul2ui20",y);class v extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,c,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,o,c,h,p)}emplace(e,r,o,c,h,p,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]=p,this.int16[g+5]=m,e}}v.prototype.bytesPerElement=12,Fe("StructArrayLayout2i2i2i12",v);class T extends Vt{_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 p=this.length;return this.resize(p+1),this.emplace(p,e,r,o,c,h)}emplace(e,r,o,c,h,p){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]=p,e}}T.prototype.bytesPerElement=16,Fe("StructArrayLayout2f1f2i16",T);class I extends Vt{_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 p=12*e,m=3*e;return this.uint8[p+0]=r,this.uint8[p+1]=o,this.float32[m+1]=c,this.float32[m+2]=h,e}}I.prototype.bytesPerElement=12,Fe("StructArrayLayout2ub2f12",I);class C extends Vt{_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}}C.prototype.bytesPerElement=6,Fe("StructArrayLayout3ui6",C);class F extends Vt{_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,p,m,g,x,w,E,A,M,z,$,U,ee){const oe=this.length;return this.resize(oe+1),this.emplace(oe,e,r,o,c,h,p,m,g,x,w,E,A,M,z,$,U,ee)}emplace(e,r,o,c,h,p,m,g,x,w,E,A,M,z,$,U,ee,oe){const Y=24*e,re=12*e,fe=48*e;return this.int16[Y+0]=r,this.int16[Y+1]=o,this.uint16[Y+2]=c,this.uint16[Y+3]=h,this.uint32[re+2]=p,this.uint32[re+3]=m,this.uint32[re+4]=g,this.uint16[Y+10]=x,this.uint16[Y+11]=w,this.uint16[Y+12]=E,this.float32[re+7]=A,this.float32[re+8]=M,this.uint8[fe+36]=z,this.uint8[fe+37]=$,this.uint8[fe+38]=U,this.uint32[re+10]=ee,this.int16[Y+22]=oe,e}}F.prototype.bytesPerElement=48,Fe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",F);class R extends Vt{_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,p,m,g,x,w,E,A,M,z,$,U,ee,oe,Y,re,fe,pe,Be,Ue,Pe,Ae,we,ke){const Me=this.length;return this.resize(Me+1),this.emplace(Me,e,r,o,c,h,p,m,g,x,w,E,A,M,z,$,U,ee,oe,Y,re,fe,pe,Be,Ue,Pe,Ae,we,ke)}emplace(e,r,o,c,h,p,m,g,x,w,E,A,M,z,$,U,ee,oe,Y,re,fe,pe,Be,Ue,Pe,Ae,we,ke,Me){const be=34*e,qe=17*e;return this.int16[be+0]=r,this.int16[be+1]=o,this.int16[be+2]=c,this.int16[be+3]=h,this.int16[be+4]=p,this.int16[be+5]=m,this.int16[be+6]=g,this.int16[be+7]=x,this.uint16[be+8]=w,this.uint16[be+9]=E,this.uint16[be+10]=A,this.uint16[be+11]=M,this.uint16[be+12]=z,this.uint16[be+13]=$,this.uint16[be+14]=U,this.uint16[be+15]=ee,this.uint16[be+16]=oe,this.uint16[be+17]=Y,this.uint16[be+18]=re,this.uint16[be+19]=fe,this.uint16[be+20]=pe,this.uint16[be+21]=Be,this.uint16[be+22]=Ue,this.uint32[qe+12]=Pe,this.float32[qe+13]=Ae,this.float32[qe+14]=we,this.float32[qe+15]=ke,this.float32[qe+16]=Me,e}}R.prototype.bytesPerElement=68,Fe("StructArrayLayout8i15ui1ul4f68",R);class B extends Vt{_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}}B.prototype.bytesPerElement=4,Fe("StructArrayLayout1f4",B);class X extends Vt{_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}}X.prototype.bytesPerElement=6,Fe("StructArrayLayout3i6",X);class J extends Vt{_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}}J.prototype.bytesPerElement=8,Fe("StructArrayLayout1ul2ui8",J);class te extends Vt{_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}}te.prototype.bytesPerElement=4,Fe("StructArrayLayout2ui4",te);class O extends Vt{_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}}O.prototype.bytesPerElement=2,Fe("StructArrayLayout1ui2",O);class ne extends Vt{_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 p=4*e;return this.float32[p+0]=r,this.float32[p+1]=o,this.float32[p+2]=c,this.float32[p+3]=h,e}}ne.prototype.bytesPerElement=16,Fe("StructArrayLayout4f16",ne);class ie extends Ur{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 We(this.anchorPointX,this.anchorPointY)}}ie.prototype.size=20;class ue extends y{get(e){return new ie(this,e)}}Fe("CollisionBoxArray",ue);class he extends Ur{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]}}he.prototype.size=48;class ye extends F{get(e){return new he(this,e)}}Fe("PlacedSymbolArray",ye);class ce extends Ur{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]}}ce.prototype.size=68;class Le extends R{get(e){return new ce(this,e)}}Fe("SymbolInstanceArray",Le);class Ie extends B{getoffsetX(e){return this.float32[1*e+0]}}Fe("GlyphOffsetArray",Ie);class Re extends X{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Fe("SymbolLineVertexArray",Re);class Qe extends Ur{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]}}Qe.prototype.size=8;class it extends J{get(e){return new Qe(this,e)}}Fe("FeatureIndexArray",it);class Ge extends Qr{}class bt extends Qr{}class wt extends Qr{}class ut extends t{}class mt extends n{}class Et extends s{}class ei extends u{}class nr extends d{}class Wi extends f{}class or extends _{}class $r extends v{}class $i extends I{}class vi extends C{}class xr extends te{}const No=Zt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ht}=No;class ot{constructor(e=[]){this.segments=e}prepareSegment(e,r,o,c){let h=this.segments[this.segments.length-1];return e>ot.MAX_VERTEX_ARRAY_LENGTH&&$t(`Max vertices per segment is ${ot.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!h||h.vertexLength+e>ot.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 ot([{vertexOffset:e,primitiveOffset:r,vertexLength:o,primitiveLength:c,vaos:{},sortKey:0}])}}function xt(i,e){return 256*(i=se(Math.floor(i),0,255))+se(Math.floor(e),0,255)}ot.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Fe("SegmentVector",ot);const ti=Zt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ii={exports:{}},Bt={exports:{}};Bt.exports=function(i,e){var r,o,c,h,p,m,g,x;for(o=i.length-(r=3&i.length),c=e,p=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)*p+(((g>>>16)*p&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)))*p+(((g>>>16)*p&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 Vi={exports:{}};Vi.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 en=Bt.exports,Ds=Vi.exports;ii.exports=en,ii.exports.murmur3=en,ii.exports.murmur2=Ds;class Dn{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,o,c){this.ids.push($a(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=$a(e);let o=0,c=this.ids.length-1;for(;o<c;){const p=o+c>>1;this.ids[p]>=r?c=p:o=p+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 Ls(o,c,0,o.length-1),r&&r.push(o.buffer,c.buffer),{ids:o,positions:c}}static deserialize(e){const r=new Dn;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function $a(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ii.exports(String(i))}function Ls(i,e,r,o){for(;r<o;){const c=i[r+o>>1];let h=r-1,p=o+1;for(;;){do h++;while(i[h]<c);do p--;while(i[p]>c);if(h>=p)break;Vr(i,h,p),Vr(e,3*h,3*p),Vr(e,3*h+1,3*p+1),Vr(e,3*h+2,3*p+2)}p-r<o-p?(Ls(i,e,r,p),r=p+1):(Ls(i,e,p+1,o),o=p)}}function Vr(i,e,r){const o=i[e];i[e]=i[r],i[r]=o}Fe("FeaturePositionMap",Dn);class tn{constructor(e,r){this.gl=e.gl,this.location=r}}class rn extends tn{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Go extends tn{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 Mc extends tn{constructor(e,r){super(e,r),this.current=D.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 Mh=new Float32Array(16);function Ll(i){return[xt(255*i.r,255*i.g),xt(255*i.b,255*i.a)]}class Rs{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 Mc(e,r):new rn(e,r)}}class qo{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 Go(e,r):new rn(e,r)}}class nn{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 p=this.paintVertexArray.length,m=this.expression.evaluate(new Rt(0),r,{},c,[],h);this.paintVertexArray.resize(e),this._setPaintValue(p,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=Ll(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 vr{constructor(e,r,o,c,h,p){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 p}populatePaintArray(e,r,o,c,h){const p=this.expression.evaluate(new Rt(this.zoom),r,{},c,[],h),m=this.expression.evaluate(new Rt(this.zoom+1),r,{},c,[],h),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,p,m)}updatePaintArray(e,r,o,c){const h=this.expression.evaluate({zoom:this.zoom},o,c),p=this.expression.evaluate({zoom:this.zoom+1},o,c);this._setPaintValue(e,r,h,p)}_setPaintValue(e,r,o,c){if(this.type==="color"){const h=Ll(o),p=Ll(c);for(let m=e;m<r;m++)this.paintVertexArray.emplace(m,h[0],h[1],p[0],p[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=se(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(c)}getBinding(e,r,o){return new rn(e,r)}}class Ln{constructor(e,r,o,c,h,p){this.expression=e,this.type=r,this.useIntegerZoom=o,this.zoom=c,this.layerId=p,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:p,max:m}=o,g=c[h],x=c[p],w=c[m];if(g&&x&&w)for(let E=e;E<r;E++)this.zoomInPaintVertexArray.emplace(E,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(E,x.tl[0],x.tl[1],x.br[0],x.br[1],w.tl[0],w.tl[1],w.br[0],w.br[1],x.pixelRatio,w.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,ti.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,ti.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class zc{constructor(e,r,o){this.binders={},this._buffers=[];const c=[];for(const h in e.paint._values){if(!o(h))continue;const p=e.paint.get(h);if(!(p instanceof ir&&zt(p.property.specification)))continue;const m=zh(h,e.type),g=p.value,x=p.property.specification.type,w=p.property.useIntegerZoom,E=p.property.specification["property-type"],A=E==="cross-faded"||E==="cross-faded-data-driven";if(g.kind==="constant")this.binders[h]=A?new qo(g.value,m):new Rs(g.value,m,x),c.push(`/u_${h}`);else if(g.kind==="source"||A){const M=Pc(h,x,"source");this.binders[h]=A?new Ln(g,x,w,r,M,e.id):new nn(g,m,x,M),c.push(`/a_${h}`)}else{const M=Pc(h,x,"composite");this.binders[h]=new vr(g,m,x,w,r,M),c.push(`/z_${h}`)}}this.cacheKey=c.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof nn||r instanceof vr?r.maxValue:0}populatePaintArrays(e,r,o,c,h){for(const p in this.binders){const m=this.binders[p];(m instanceof nn||m instanceof vr||m instanceof Ln)&&m.populatePaintArray(e,r,o,c,h)}}setConstantPatternPositions(e,r){for(const o in this.binders){const c=this.binders[o];c instanceof qo&&c.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,o,c,h){let p=!1;for(const m in e){const g=r.getPositions(m);for(const x of g){const w=o.feature(x.index);for(const E in this.binders){const A=this.binders[E];if((A instanceof nn||A instanceof vr||A instanceof Ln)&&A.expression.isStateDependent===!0){const M=c.paint.get(E);A.expression=M.value,A.updatePaintArray(x.start,x.end,w,e[m],h),p=!0}}}}return p}defines(){const e=[];for(const r in this.binders){const o=this.binders[r];(o instanceof Rs||o instanceof qo)&&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 nn||o instanceof vr)for(let c=0;c<o.paintVertexAttributes.length;c++)e.push(o.paintVertexAttributes[c].name);else if(o instanceof Ln)for(let c=0;c<ti.members.length;c++)e.push(ti.members[c].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const o=this.binders[r];if(o instanceof Rs||o instanceof qo||o instanceof vr)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 Rs||h instanceof qo||h instanceof vr){for(const p of h.uniformNames)if(r[p]){const m=h.getBinding(e,r[p],p);o.push({name:p,property:c,binding:m})}}}return o}setUniforms(e,r,o,c){for(const{name:h,property:p,binding:m}of r)this.binders[p].setUniform(m,c,o.get(p),h)}updatePaintBuffers(e){this._buffers=[];for(const r in this.binders){const o=this.binders[r];if(e&&o instanceof Ln){const c=e.fromScale===2?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;c&&this._buffers.push(c)}else(o instanceof nn||o instanceof vr)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(e){for(const r in this.binders){const o=this.binders[r];(o instanceof nn||o instanceof vr||o instanceof Ln)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof nn||r instanceof vr||r instanceof Ln)&&r.destroy()}}}class fo{constructor(e,r,o=()=>!0){this.programConfigurations={};for(const c of e)this.programConfigurations[c.id]=new zc(c,r,o);this.needsUpload=!1,this._featureMap=new Dn,this._bufferOffset=0}populatePaintArrays(e,r,o,c,h,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,c,h,p);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 zh(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Pc(i,e,r){const o={color:{source:s,composite:ne},number:{source:B,composite:s}},c=function(h){return{"line-pattern":{source:ei,composite:ei},"fill-pattern":{source:ei,composite:ei},"fill-extrusion-pattern":{source:ei,composite:ei}}[h]}(i);return c&&c[r]||o[e][r]}Fe("ConstantBinder",Rs),Fe("CrossFadedConstantBinder",qo),Fe("SourceExpressionBinder",nn),Fe("CrossFadedCompositeBinder",Ln),Fe("CompositeExpressionBinder",vr),Fe("ProgramConfiguration",zc,{omit:["_buffers"]}),Fe("ProgramConfigurationSet",fo);var Kt=8192;const Rl=Math.pow(2,14)-1,kc=-Rl-1;function mo(i){const e=Kt/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 p=c[h],m=Math.round(p.x*e),g=Math.round(p.y*e);p.x=se(m,kc,Rl),p.y=se(g,kc,Rl),(m<p.x||m>p.x+1||g<p.y||g>p.y+1)&&$t("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function go(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?mo(i):[]}}function Va(i,e,r,o,c){i.emplaceBack(2*e+(o+1)/2,2*r+(c+1)/2)}class Bl{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 bt,this.indexArray=new vi,this.segments=new ot,this.programConfigurations=new fo(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 p=null,m=!1;c.type==="circle"&&(p=c.layout.get("circle-sort-key"),m=!p.isConstant());for(const{feature:g,id:x,index:w,sourceLayerIndex:E}of e){const A=this.layers[0]._featureFilter.needGeometry,M=go(g,A);if(!this.layers[0]._featureFilter.filter(new Rt(this.zoom),M,o))continue;const z=m?p.evaluate(M,{},o):void 0,$={id:x,properties:g.properties,type:g.type,sourceLayerIndex:E,index:w,geometry:A?M.geometry:mo(g),patterns:{},sortKey:z};h.push($)}m&&h.sort((g,x)=>g.sortKey-x.sortKey);for(const g of h){const{geometry:x,index:w,sourceLayerIndex:E}=g,A=e[w].feature;this.addFeature(g,x,w,o),r.featureIndex.insert(A,x,w,E,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,Ht),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 p of h){const m=p.x,g=p.y;if(m<0||m>=Kt||g<0||g>=Kt)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=x.vertexLength;Va(this.layoutVertexArray,m,g,-1,-1),Va(this.layoutVertexArray,m,g,1,-1),Va(this.layoutVertexArray,m,g,1,1),Va(this.layoutVertexArray,m,g,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+3,w+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{},c)}}function Dc(i,e){for(let r=0;r<i.length;r++)if(Zo(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Zo(i,e[r]))return!0;return!!Fl(i,e)}function Ph(i,e,r){return!!Zo(i,e)||!!Ol(e,i,r)}function Lc(i,e){if(i.length===1)return Bc(e,i[0]);for(let r=0;r<e.length;r++){const o=e[r];for(let c=0;c<o.length;c++)if(Zo(i,o[c]))return!0}for(let r=0;r<i.length;r++)if(Bc(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Fl(i,e[r]))return!0;return!1}function kh(i,e,r){if(i.length>1){if(Fl(i,e))return!0;for(let o=0;o<e.length;o++)if(Ol(e[o],i,r))return!0}for(let o=0;o<i.length;o++)if(Ol(i[o],e,r))return!0;return!1}function Fl(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(Dh(o,c,e[h],e[h+1]))return!0}return!1}function Dh(i,e,r,o){return Gi(i,r,o)!==Gi(e,r,o)&&Gi(i,e,r)!==Gi(i,e,o)}function Ol(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(Rc(i,e[c-1],e[c])<o)return!0;return!1}function Rc(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 Bc(i,e){let r,o,c,h=!1;for(let p=0;p<i.length;p++){r=i[p];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 Zo(i,e){let r=!1;for(let o=0,c=i.length-1;o<i.length;c=o++){const h=i[o],p=i[c];h.y>e.y!=p.y>e.y&&e.x<(p.x-h.x)*(e.y-h.y)/(p.y-h.y)+h.x&&(r=!r)}return r}function Lh(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=Gi(i,e,r[0]);return h!==Gi(i,e,r[1])||h!==Gi(i,e,r[2])||h!==Gi(i,e,r[3])}function Bs(i,e,r){const o=e.paint.get(i).value;return o.kind==="constant"?o.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Na(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Ga(i,e,r,o,c){if(!e[0]&&!e[1])return i;const h=We.convert(e)._mult(c);r==="viewport"&&h._rotate(-o);const p=[];for(let m=0;m<i.length;m++)p.push(i[m].sub(h));return p}Fe("CircleBucket",Bl,{omit:["layers"]});const Rh=new si({"circle-sort-key":new je(de.layout_circle["circle-sort-key"])});var Bh={paint:new si({"circle-radius":new je(de.paint_circle["circle-radius"]),"circle-color":new je(de.paint_circle["circle-color"]),"circle-blur":new je(de.paint_circle["circle-blur"]),"circle-opacity":new je(de.paint_circle["circle-opacity"]),"circle-translate":new Ve(de.paint_circle["circle-translate"]),"circle-translate-anchor":new Ve(de.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ve(de.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ve(de.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new je(de.paint_circle["circle-stroke-width"]),"circle-stroke-color":new je(de.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new je(de.paint_circle["circle-stroke-opacity"])}),layout:Rh},bi=1e-6,wi=typeof Float32Array<"u"?Float32Array:Array;function Fc(){var i=new wi(9);return wi!=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 Ul(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 Oc(i,e,r){var o=e[0],c=e[1],h=e[2],p=e[3],m=e[4],g=e[5],x=e[6],w=e[7],E=e[8],A=e[9],M=e[10],z=e[11],$=e[12],U=e[13],ee=e[14],oe=e[15],Y=r[0],re=r[1],fe=r[2],pe=r[3];return i[0]=Y*o+re*m+fe*E+pe*$,i[1]=Y*c+re*g+fe*A+pe*U,i[2]=Y*h+re*x+fe*M+pe*ee,i[3]=Y*p+re*w+fe*z+pe*oe,i[4]=(Y=r[4])*o+(re=r[5])*m+(fe=r[6])*E+(pe=r[7])*$,i[5]=Y*c+re*g+fe*A+pe*U,i[6]=Y*h+re*x+fe*M+pe*ee,i[7]=Y*p+re*w+fe*z+pe*oe,i[8]=(Y=r[8])*o+(re=r[9])*m+(fe=r[10])*E+(pe=r[11])*$,i[9]=Y*c+re*g+fe*A+pe*U,i[10]=Y*h+re*x+fe*M+pe*ee,i[11]=Y*p+re*w+fe*z+pe*oe,i[12]=(Y=r[12])*o+(re=r[13])*m+(fe=r[14])*E+(pe=r[15])*$,i[13]=Y*c+re*g+fe*A+pe*U,i[14]=Y*h+re*x+fe*M+pe*ee,i[15]=Y*p+re*w+fe*z+pe*oe,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var Fs,Fh=Oc;function Uc(){var i=new wi(3);return wi!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function $c(i,e,r){var o=new wi(3);return o[0]=i,o[1]=e,o[2]=r,o}function qa(i,e,r){var o=e[0],c=e[1],h=e[2],p=e[3];return i[0]=r[0]*o+r[4]*c+r[8]*h+r[12]*p,i[1]=r[1]*o+r[5]*c+r[9]*h+r[13]*p,i[2]=r[2]*o+r[6]*c+r[10]*h+r[14]*p,i[3]=r[3]*o+r[7]*c+r[11]*h+r[15]*p,i}function Vc(){var i=new wi(4);return wi!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i[3]=1,i}function Nc(i,e){const r=qa([],[i.x,i.y,0,1],e);return new We(r[0]/r[3],r[1]/r[3])}Uc(),Fs=new wi(4),wi!=Float32Array&&(Fs[0]=0,Fs[1]=0,Fs[2]=0,Fs[3]=0),Uc(),$c(1,0,0),$c(0,1,0),Vc(),Vc(),Fc(),function(){var i;i=new wi(2),wi!=Float32Array&&(i[0]=0,i[1]=0)}();class Gc extends Bl{}Fe("HeatmapBucket",Gc,{omit:["layers"]});var Oh={paint:new si({"heatmap-radius":new je(de.paint_heatmap["heatmap-radius"]),"heatmap-weight":new je(de.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ve(de.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Fr(de.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ve(de.paint_heatmap["heatmap-opacity"])})};function $l(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 qc(i,{width:e,height:r},o){if(e===i.width&&r===i.height)return;const c=$l({},{width:e,height:r},o);Vl(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 Vl(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 p=i.data,m=e.data;if(p===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,w=((o.y+g)*e.width+o.x)*h;for(let E=0;E<c.width*h;E++)m[w+E]=p[x+E]}return e}class Os{constructor(e,r){$l(this,e,1,r)}resize(e){qc(this,e,1)}clone(){return new Os({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,c,h){Vl(e,r,o,c,h,1)}}class Hi{constructor(e,r){$l(this,e,4,r)}resize(e){qc(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Hi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,c,h){Vl(e,r,o,c,h,4)}}function Zc(i){const e={},r=i.resolution||256,o=i.clips?i.clips.length:1,c=i.image||new Hi({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=(p,m,g)=>{e[i.evaluationKey]=g;const x=i.expression.evaluate(e);c.data[p+m+0]=Math.floor(255*x.r/x.a),c.data[p+m+1]=Math.floor(255*x.g/x.a),c.data[p+m+2]=Math.floor(255*x.b/x.a),c.data[p+m+3]=Math.floor(255*x.a)};if(i.clips)for(let p=0,m=0;p<o;++p,m+=4*r)for(let g=0,x=0;g<r;g++,x+=4){const w=g/(r-1),{start:E,end:A}=i.clips[p];h(m,x,E*(1-w)+A*w)}else for(let p=0,m=0;p<r;p++,m+=4)h(0,m,p/(r-1));return c}Fe("AlphaImage",Os),Fe("RGBAImage",Hi);var Uh={paint:new si({"hillshade-illumination-direction":new Ve(de.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ve(de.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ve(de.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ve(de.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ve(de.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ve(de.paint_hillshade["hillshade-accent-color"])})};const $h=Zt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Vh}=$h;var Za={exports:{}};function ja(i,e,r){r=r||2;var o,c,h,p,m,g,x,w=e&&e.length,E=w?e[0]*r:i.length,A=jc(i,0,E,r,!0),M=[];if(!A||A.next===A.prev)return M;if(w&&(A=function($,U,ee,oe){var Y,re,fe,pe=[];for(Y=0,re=U.length;Y<re;Y++)(fe=jc($,U[Y]*oe,Y<re-1?U[Y+1]*oe:$.length,oe,!1))===fe.next&&(fe.steiner=!0),pe.push(Hh(fe));for(pe.sort(jh),Y=0;Y<pe.length;Y++)ee=Xh(pe[Y],ee);return ee}(i,e,A,r)),i.length>80*r){o=h=i[0],c=p=i[1];for(var z=r;z<E;z+=r)(m=i[z])<o&&(o=m),(g=i[z+1])<c&&(c=g),m>h&&(h=m),g>p&&(p=g);x=(x=Math.max(h-o,p-c))!==0?32767/x:0}return Us(A,M,r,o,c,x,0),M}function jc(i,e,r,o,c){var h,p;if(c===ql(i,e,r,o)>0)for(h=e;h<r;h+=o)p=Hc(h,i[h],i[h+1],p);else for(h=r-o;h>=e;h-=o)p=Hc(h,i[h],i[h+1],p);return p&&Xa(p,p.next)&&(Vs(p),p=p.next),p}function _o(i,e){if(!i)return i;e||(e=i);var r,o=i;do if(r=!1,o.steiner||!Xa(o,o.next)&&Gt(o.prev,o,o.next)!==0)o=o.next;else{if(Vs(o),(o=e=o.prev)===o.next)break;r=!0}while(r||o!==e);return e}function Us(i,e,r,o,c,h,p){if(i){!p&&h&&function(w,E,A,M){var z=w;do z.z===0&&(z.z=Nl(z.x,z.y,E,A,M)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==w);z.prevZ.nextZ=null,z.prevZ=null,function($){var U,ee,oe,Y,re,fe,pe,Be,Ue=1;do{for(ee=$,$=null,re=null,fe=0;ee;){for(fe++,oe=ee,pe=0,U=0;U<Ue&&(pe++,oe=oe.nextZ);U++);for(Be=Ue;pe>0||Be>0&&oe;)pe!==0&&(Be===0||!oe||ee.z<=oe.z)?(Y=ee,ee=ee.nextZ,pe--):(Y=oe,oe=oe.nextZ,Be--),re?re.nextZ=Y:$=Y,Y.prevZ=re,re=Y;ee=oe}re.nextZ=null,Ue*=2}while(fe>1)}(z)}(i,o,c,h);for(var m,g,x=i;i.prev!==i.next;)if(m=i.prev,g=i.next,h?Gh(i,o,c,h):Nh(i))e.push(m.i/r|0),e.push(i.i/r|0),e.push(g.i/r|0),Vs(i),i=g.next,x=g.next;else if((i=g)===x){p?p===1?Us(i=qh(_o(i),e,r),e,r,o,c,h,2):p===2&&Zh(i,e,r,o,c,h):Us(_o(i),e,r,o,c,h,1);break}}}function Nh(i){var e=i.prev,r=i,o=i.next;if(Gt(e,r,o)>=0)return!1;for(var c=e.x,h=r.x,p=o.x,m=e.y,g=r.y,x=o.y,w=c<h?c<p?c:p:h<p?h:p,E=m<g?m<x?m:x:g<x?g:x,A=c>h?c>p?c:p:h>p?h:p,M=m>g?m>x?m:x:g>x?g:x,z=o.next;z!==e;){if(z.x>=w&&z.x<=A&&z.y>=E&&z.y<=M&&jo(c,m,h,g,p,x,z.x,z.y)&&Gt(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function Gh(i,e,r,o){var c=i.prev,h=i,p=i.next;if(Gt(c,h,p)>=0)return!1;for(var m=c.x,g=h.x,x=p.x,w=c.y,E=h.y,A=p.y,M=m<g?m<x?m:x:g<x?g:x,z=w<E?w<A?w:A:E<A?E:A,$=m>g?m>x?m:x:g>x?g:x,U=w>E?w>A?w:A:E>A?E:A,ee=Nl(M,z,e,r,o),oe=Nl($,U,e,r,o),Y=i.prevZ,re=i.nextZ;Y&&Y.z>=ee&&re&&re.z<=oe;){if(Y.x>=M&&Y.x<=$&&Y.y>=z&&Y.y<=U&&Y!==c&&Y!==p&&jo(m,w,g,E,x,A,Y.x,Y.y)&&Gt(Y.prev,Y,Y.next)>=0||(Y=Y.prevZ,re.x>=M&&re.x<=$&&re.y>=z&&re.y<=U&&re!==c&&re!==p&&jo(m,w,g,E,x,A,re.x,re.y)&&Gt(re.prev,re,re.next)>=0))return!1;re=re.nextZ}for(;Y&&Y.z>=ee;){if(Y.x>=M&&Y.x<=$&&Y.y>=z&&Y.y<=U&&Y!==c&&Y!==p&&jo(m,w,g,E,x,A,Y.x,Y.y)&&Gt(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}for(;re&&re.z<=oe;){if(re.x>=M&&re.x<=$&&re.y>=z&&re.y<=U&&re!==c&&re!==p&&jo(m,w,g,E,x,A,re.x,re.y)&&Gt(re.prev,re,re.next)>=0)return!1;re=re.nextZ}return!0}function qh(i,e,r){var o=i;do{var c=o.prev,h=o.next.next;!Xa(c,h)&&Xc(c,o,o.next,h)&&$s(c,h)&&$s(h,c)&&(e.push(c.i/r|0),e.push(o.i/r|0),e.push(h.i/r|0),Vs(o),Vs(o.next),o=i=h),o=o.next}while(o!==i);return _o(o)}function Zh(i,e,r,o,c,h){var p=i;do{for(var m=p.next.next;m!==p.prev;){if(p.i!==m.i&&Kh(p,m)){var g=Wc(p,m);return p=_o(p,p.next),g=_o(g,g.next),Us(p,e,r,o,c,h,0),void Us(g,e,r,o,c,h,0)}m=m.next}p=p.next}while(p!==i)}function jh(i,e){return i.x-e.x}function Xh(i,e){var r=function(c,h){var p,m=h,g=c.x,x=c.y,w=-1/0;do{if(x<=m.y&&x>=m.next.y&&m.next.y!==m.y){var E=m.x+(x-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(E<=g&&E>w&&(w=E,p=m.x<m.next.x?m:m.next,E===g))return p}m=m.next}while(m!==h);if(!p)return null;var A,M=p,z=p.x,$=p.y,U=1/0;m=p;do g>=m.x&&m.x>=z&&g!==m.x&&jo(x<$?g:w,x,z,$,x<$?w:g,x,m.x,m.y)&&(A=Math.abs(x-m.y)/(g-m.x),$s(m,c)&&(A<U||A===U&&(m.x>p.x||m.x===p.x&&Wh(p,m)))&&(p=m,U=A)),m=m.next;while(m!==M);return p}(i,e);if(!r)return e;var o=Wc(r,i);return _o(o,o.next),_o(r,r.next)}function Wh(i,e){return Gt(i.prev,i,e.prev)<0&&Gt(e.next,i,i.next)<0}function Nl(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 Hh(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 jo(i,e,r,o,c,h,p,m){return(c-p)*(e-m)>=(i-p)*(h-m)&&(i-p)*(o-m)>=(r-p)*(e-m)&&(r-p)*(h-m)>=(c-p)*(o-m)}function Kh(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&&Xc(c,c.next,r,o))return!0;c=c.next}while(c!==r);return!1}(i,e)&&($s(i,e)&&$s(e,i)&&function(r,o){var c=r,h=!1,p=(r.x+o.x)/2,m=(r.y+o.y)/2;do c.y>m!=c.next.y>m&&c.next.y!==c.y&&p<(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)&&(Gt(i.prev,i,e.prev)||Gt(i,e.prev,e))||Xa(i,e)&&Gt(i.prev,i,i.next)>0&&Gt(e.prev,e,e.next)>0)}function Gt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function Xa(i,e){return i.x===e.x&&i.y===e.y}function Xc(i,e,r,o){var c=Ha(Gt(i,e,r)),h=Ha(Gt(i,e,o)),p=Ha(Gt(r,o,i)),m=Ha(Gt(r,o,e));return c!==h&&p!==m||!(c!==0||!Wa(i,r,e))||!(h!==0||!Wa(i,o,e))||!(p!==0||!Wa(r,i,o))||!(m!==0||!Wa(r,e,o))}function Wa(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 Ha(i){return i>0?1:i<0?-1:0}function $s(i,e){return Gt(i.prev,i,i.next)<0?Gt(i,e,i.next)>=0&&Gt(i,i.prev,e)>=0:Gt(i,e,i.prev)<0||Gt(i,i.next,e)<0}function Wc(i,e){var r=new Gl(i.i,i.x,i.y),o=new Gl(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 Hc(i,e,r,o){var c=new Gl(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 Vs(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 Gl(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 ql(i,e,r,o){for(var c=0,h=e,p=r-o;h<r;h+=o)c+=(i[p]-i[h])*(i[h+1]+i[p+1]),p=h;return c}function Jh(i,e,r,o,c){Kc(i,e,r||0,o||i.length-1,c||Yh)}function Kc(i,e,r,o,c){for(;o>r;){if(o-r>600){var h=o-r+1,p=e-r+1,m=Math.log(h),g=.5*Math.exp(2*m/3),x=.5*Math.sqrt(m*g*(h-g)/h)*(p-h/2<0?-1:1);Kc(i,e,Math.max(r,Math.floor(e-p*g/h+x)),Math.min(o,Math.floor(e+(h-p)*g/h+x)),c)}var w=i[e],E=r,A=o;for(Ns(i,r,e),c(i[o],w)>0&&Ns(i,r,o);E<A;){for(Ns(i,E,A),E++,A--;c(i[E],w)<0;)E++;for(;c(i[A],w)>0;)A--}c(i[r],w)===0?Ns(i,r,A):Ns(i,++A,o),A<=e&&(r=A+1),e<=A&&(o=A-1)}}function Ns(i,e,r){var o=i[e];i[e]=i[r],i[r]=o}function Yh(i,e){return i<e?-1:i>e?1:0}function Zl(i,e){const r=i.length;if(r<=1)return[i];const o=[];let c,h;for(let p=0;p<r;p++){const m=Fi(i[p]);m!==0&&(i[p].area=Math.abs(m),h===void 0&&(h=m<0),h===m<0?(c&&o.push(c),c=[i[p]]):c.push(i[p]))}if(c&&o.push(c),e>1)for(let p=0;p<o.length;p++)o[p].length<=e||(Jh(o[p],e,1,o[p].length-1,Qh),o[p]=o[p].slice(0,e));return o}function Qh(i,e){return e.area-i.area}function jl(i,e,r){const o=r.patternDependencies;let c=!1;for(const h of e){const p=h.paint.get(`${i}-pattern`);p.isConstant()||(c=!0);const m=p.constantOr(null);m&&(c=!0,o[m.to]=!0,o[m.from]=!0)}return c}function Xl(i,e,r,o,c){const h=c.patternDependencies;for(const p of e){const m=p.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),w=m.evaluate({zoom:o+1},r,{},c.availableImages);g=g&&g.name?g.name:g,x=x&&x.name?x.name:x,w=w&&w.name?w.name:w,h[g]=!0,h[x]=!0,h[w]=!0,r.patterns[p.id]={min:g,mid:x,max:w}}}return r}Za.exports=ja,Za.exports.default=ja,ja.deviation=function(i,e,r,o){var c=e&&e.length,h=Math.abs(ql(i,0,c?e[0]*r:i.length,r));if(c)for(var p=0,m=e.length;p<m;p++)h-=Math.abs(ql(i,e[p]*r,p<m-1?e[p+1]*r:i.length,r));var g=0;for(p=0;p<o.length;p+=3){var x=o[p]*r,w=o[p+1]*r,E=o[p+2]*r;g+=Math.abs((i[x]-i[E])*(i[w+1]-i[x+1])-(i[x]-i[w])*(i[E+1]-i[x+1]))}return h===0&&g===0?0:Math.abs((g-h)/h)},ja.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 p=0;p<e;p++)r.vertices.push(i[c][h][p]);c>0&&r.holes.push(o+=i[c-1].length)}return r};class Wl{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 wt,this.indexArray=new vi,this.indexArray2=new xr,this.programConfigurations=new fo(e.layers,e.zoom),this.segments=new ot,this.segments2=new ot,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.hasPattern=jl("fill",this.layers,r);const c=this.layers[0].layout.get("fill-sort-key"),h=!c.isConstant(),p=[];for(const{feature:m,id:g,index:x,sourceLayerIndex:w}of e){const E=this.layers[0]._featureFilter.needGeometry,A=go(m,E);if(!this.layers[0]._featureFilter.filter(new Rt(this.zoom),A,o))continue;const M=h?c.evaluate(A,{},o,r.availableImages):void 0,z={id:g,properties:m.properties,type:m.type,sourceLayerIndex:w,index:x,geometry:E?A.geometry:mo(m),patterns:{},sortKey:M};p.push(z)}h&&p.sort((m,g)=>m.sortKey-g.sortKey);for(const m of p){const{geometry:g,index:x,sourceLayerIndex:w}=m;if(this.hasPattern){const E=Xl("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(E)}else this.addFeature(m,g,x,o,{});r.featureIndex.insert(e[x].feature,g,x,w,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,Vh),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 p of Zl(r,500)){let m=0;for(const M of p)m+=M.length;const g=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=g.vertexLength,w=[],E=[];for(const M of p){if(M.length===0)continue;M!==p[0]&&E.push(w.length/2);const z=this.segments2.prepareSegment(M.length,this.layoutVertexArray,this.indexArray2),$=z.vertexLength;this.layoutVertexArray.emplaceBack(M[0].x,M[0].y),this.indexArray2.emplaceBack($+M.length-1,$),w.push(M[0].x),w.push(M[0].y);for(let U=1;U<M.length;U++)this.layoutVertexArray.emplaceBack(M[U].x,M[U].y),this.indexArray2.emplaceBack($+U-1,$+U),w.push(M[U].x),w.push(M[U].y);z.vertexLength+=M.length,z.primitiveLength+=M.length}const A=Za.exports(w,E);for(let M=0;M<A.length;M+=3)this.indexArray.emplaceBack(x+A[M],x+A[M+1],x+A[M+2]);g.vertexLength+=m,g.primitiveLength+=A.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,c)}}Fe("FillBucket",Wl,{omit:["layers","patternFeatures"]});const ed=new si({"fill-sort-key":new je(de.layout_fill["fill-sort-key"])});var td={paint:new si({"fill-antialias":new Ve(de.paint_fill["fill-antialias"]),"fill-opacity":new je(de.paint_fill["fill-opacity"]),"fill-color":new je(de.paint_fill["fill-color"]),"fill-outline-color":new je(de.paint_fill["fill-outline-color"]),"fill-translate":new Ve(de.paint_fill["fill-translate"]),"fill-translate-anchor":new Ve(de.paint_fill["fill-translate-anchor"]),"fill-pattern":new kn(de.paint_fill["fill-pattern"])}),layout:ed};const id=Zt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),rd=Zt([{name:"a_centroid",components:2,type:"Int16"}],4),{members:nd}=id;var Rn={},od=We,Jc=Xo;function Xo(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(sd,this,e)}function sd(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 p=c._keys[o.readVarint()],m=c._values[o.readVarint()];c.properties[p]=m}}(r,e):i==3?e.type=r.readVarint():i==4&&(e._geometry=r.pos)}function ad(i){for(var e,r,o=0,c=0,h=i.length,p=h-1;c<h;p=c++)o+=((r=i[p]).x-(e=i[c]).x)*(e.y+r.y);return o}Xo.types=["Unknown","Point","LineString","Polygon"],Xo.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,p=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(),p+=i.readSVarint(),o===1&&(e&&m.push(e),e=[]),e.push(new od(h,p));else{if(o!==7)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}}return e&&m.push(e),m},Xo.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,p=1/0,m=-1/0,g=1/0,x=-1/0;i.pos<e;){if(o<=0){var w=i.readVarint();r=7&w,o=w>>3}if(o--,r===1||r===2)(c+=i.readSVarint())<p&&(p=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[p,g,m,x]},Xo.prototype.toGeoJSON=function(i,e,r){var o,c,h=this.extent*Math.pow(2,r),p=this.extent*i,m=this.extent*e,g=this.loadGeometry(),x=Xo.types[this.type];function w(M){for(var z=0;z<M.length;z++){var $=M[z];M[z]=[360*($.x+p)/h-180,360/Math.PI*Math.atan(Math.exp((180-360*($.y+m)/h)*Math.PI/180))-90]}}switch(this.type){case 1:var E=[];for(o=0;o<g.length;o++)E[o]=g[o][0];w(g=E);break;case 2:for(o=0;o<g.length;o++)w(g[o]);break;case 3:for(g=function(M){var z=M.length;if(z<=1)return[M];for(var $,U,ee=[],oe=0;oe<z;oe++){var Y=ad(M[oe]);Y!==0&&(U===void 0&&(U=Y<0),U===Y<0?($&&ee.push($),$=[M[oe]]):$.push(M[oe]))}return $&&ee.push($),ee}(g),o=0;o<g.length;o++)for(c=0;c<g[o].length;c++)w(g[o][c])}g.length===1?g=g[0]:x="Multi"+x;var A={type:"Feature",geometry:{type:x,coordinates:g},properties:this.properties};return"id"in this&&(A.id=this.id),A};var ld=Jc,Yc=Qc;function Qc(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(cd,this,e),this.length=this._features.length}function cd(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 p=o.readVarint()>>3;c=p===1?o.readString():p===2?o.readFloat():p===3?o.readDouble():p===4?o.readVarint64():p===5?o.readVarint():p===6?o.readSVarint():p===7?o.readBoolean():null}return c}(r))}Qc.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 ld(this._pbf,e,this.extent,this._keys,this._values)};var ud=Yc;function hd(i,e,r){if(i===3){var o=new ud(r,r.readVarint()+r.pos);o.length&&(e[o.name]=o)}}Rn.VectorTile=function(i,e){this.layers=i.readFields(hd,{},e)},Rn.VectorTileFeature=Jc,Rn.VectorTileLayer=Yc;const dd=Rn.VectorTileFeature.types,Hl=Math.pow(2,13);function Gs(i,e,r,o,c,h,p,m){i.emplaceBack(e,r,2*Math.floor(o*Hl)+p,c*Hl*2,h*Hl*2,Math.round(m))}class Kl{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 ut,this.centroidVertexArray=new Ge,this.indexArray=new vi,this.programConfigurations=new fo(e.layers,e.zoom),this.segments=new ot,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.features=[],this.hasPattern=jl("fill-extrusion",this.layers,r);for(const{feature:c,id:h,index:p,sourceLayerIndex:m}of e){const g=this.layers[0]._featureFilter.needGeometry,x=go(c,g);if(!this.layers[0]._featureFilter.filter(new Rt(this.zoom),x,o))continue;const w={id:h,sourceLayerIndex:m,index:p,geometry:g?x.geometry:mo(c),properties:c.properties,type:c.type,patterns:{}};this.hasPattern?this.features.push(Xl("fill-extrusion",this.layers,w,this.zoom,r)):this.addFeature(w,w.geometry,p,o,{}),r.featureIndex.insert(c,w.geometry,p,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,nd),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,rd.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 p={x:0,y:0,vertexCount:0};for(const m of Zl(r,500)){let g=0;for(const z of m)g+=z.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const z of m){if(z.length===0||fd(z))continue;let $=0;for(let U=0;U<z.length;U++){const ee=z[U];if(U>=1){const oe=z[U-1];if(!pd(ee,oe)){x.vertexLength+4>ot.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Y=ee.sub(oe)._perp()._unit(),re=oe.dist(ee);$+re>32768&&($=0),Gs(this.layoutVertexArray,ee.x,ee.y,Y.x,Y.y,0,0,$),Gs(this.layoutVertexArray,ee.x,ee.y,Y.x,Y.y,0,1,$),p.x+=2*ee.x,p.y+=2*ee.y,p.vertexCount+=2,$+=re,Gs(this.layoutVertexArray,oe.x,oe.y,Y.x,Y.y,0,0,$),Gs(this.layoutVertexArray,oe.x,oe.y,Y.x,Y.y,0,1,$),p.x+=2*oe.x,p.y+=2*oe.y,p.vertexCount+=2;const fe=x.vertexLength;this.indexArray.emplaceBack(fe,fe+2,fe+1),this.indexArray.emplaceBack(fe+1,fe+2,fe+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+g>ot.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),dd[e.type]!=="Polygon")continue;const w=[],E=[],A=x.vertexLength;for(const z of m)if(z.length!==0){z!==m[0]&&E.push(w.length/2);for(let $=0;$<z.length;$++){const U=z[$];Gs(this.layoutVertexArray,U.x,U.y,0,0,1,1,0),p.x+=U.x,p.y+=U.y,p.vertexCount+=1,w.push(U.x),w.push(U.y)}}const M=Za.exports(w,E);for(let z=0;z<M.length;z+=3)this.indexArray.emplaceBack(A+M[z],A+M[z+2],A+M[z+1]);x.primitiveLength+=M.length/3,x.vertexLength+=g}for(let m=0;m<p.vertexCount;m++)this.centroidVertexArray.emplaceBack(Math.floor(p.x/p.vertexCount),Math.floor(p.y/p.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,c)}}function pd(i,e){return i.x===e.x&&(i.x<0||i.x>Kt)||i.y===e.y&&(i.y<0||i.y>Kt)}function fd(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Kt)||i.every(e=>e.y<0)||i.every(e=>e.y>Kt)}Fe("FillExtrusionBucket",Kl,{omit:["layers","features"]});var md={paint:new si({"fill-extrusion-opacity":new Ve(de["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new je(de["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ve(de["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ve(de["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new kn(de["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new je(de["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new je(de["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ve(de["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function qs(i,e){return i.x*e.x+i.y*e.y}function eu(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],p=i[0],m=c.sub(o),g=h.sub(o),x=p.sub(o),w=qs(m,m),E=qs(m,g),A=qs(g,g),M=qs(x,m),z=qs(x,g),$=w*A-E*E,U=(A*M-E*z)/$,ee=(w*z-E*M)/$,oe=o.z*(1-U-ee)+c.z*U+h.z*ee;if(isFinite(oe))return oe}return 1/0}{let r=1/0;for(const o of e)r=Math.min(r,o.z);return r}}const gd=Zt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:_d}=gd,yd=Zt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:xd}=yd,vd=Rn.VectorTileFeature.types,bd=Math.cos(Math.PI/180*37.5),tu=Math.pow(2,14)/.5;class Jl{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 mt,this.layoutVertexArray2=new Et,this.indexArray=new vi,this.programConfigurations=new fo(e.layers,e.zoom),this.segments=new ot,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.hasPattern=jl("line",this.layers,r);const c=this.layers[0].layout.get("line-sort-key"),h=!c.isConstant(),p=[];for(const{feature:m,id:g,index:x,sourceLayerIndex:w}of e){const E=this.layers[0]._featureFilter.needGeometry,A=go(m,E);if(!this.layers[0]._featureFilter.filter(new Rt(this.zoom),A,o))continue;const M=h?c.evaluate(A,{},o):void 0,z={id:g,properties:m.properties,type:m.type,sourceLayerIndex:w,index:x,geometry:E?A.geometry:mo(m),patterns:{},sortKey:M};p.push(z)}h&&p.sort((m,g)=>m.sortKey-g.sortKey);for(const m of p){const{geometry:g,index:x,sourceLayerIndex:w}=m;if(this.hasPattern){const E=Xl("line",this.layers,m,this.zoom,r);this.patternFeatures.push(E)}else this.addFeature(m,g,x,o,{});r.featureIndex.insert(e[x].feature,g,x,w,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,xd)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_d),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 p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),g=p.get("line-cap"),x=p.get("line-miter-limit"),w=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const E of r)this.addLine(E,e,m,g,x,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,c)}addLine(e,r,o,c,h,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ee=0;ee<e.length-1;ee++)this.totalDistance+=e[ee].dist(e[ee+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const m=vd[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 w=this.overscaling<=16?122880/(512*this.overscaling):0,E=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray);let A,M,z,$,U;this.e1=this.e2=-1,m&&(A=e[g-2],U=e[x].sub(A)._unit()._perp());for(let ee=x;ee<g;ee++){if(z=ee===g-1?m?e[x+1]:void 0:e[ee+1],z&&e[ee].equals(z))continue;U&&($=U),A&&(M=A),A=e[ee],U=z?z.sub(A)._unit()._perp():$,$=$||U;let oe=$.add(U);oe.x===0&&oe.y===0||oe._unit();const Y=$.x*U.x+$.y*U.y,re=oe.x*U.x+oe.y*U.y,fe=re!==0?1/re:1/0,pe=2*Math.sqrt(2-2*re),Be=re<bd&&M&&z,Ue=$.x*U.y-$.y*U.x>0;if(Be&&ee>x){const we=A.dist(M);if(we>2*w){const ke=A.sub(A.sub(M)._mult(w/we)._round());this.updateDistance(M,ke),this.addCurrentVertex(ke,$,0,0,E),M=ke}}const Pe=M&&z;let Ae=Pe?o:m?"butt":c;if(Pe&&Ae==="round"&&(fe<p?Ae="miter":fe<=2&&(Ae="fakeround")),Ae==="miter"&&fe>h&&(Ae="bevel"),Ae==="bevel"&&(fe>2&&(Ae="flipbevel"),fe<h&&(Ae="miter")),M&&this.updateDistance(M,A),Ae==="miter")oe._mult(fe),this.addCurrentVertex(A,oe,0,0,E);else if(Ae==="flipbevel"){if(fe>100)oe=U.mult(-1);else{const we=fe*$.add(U).mag()/$.sub(U).mag();oe._perp()._mult(we*(Ue?-1:1))}this.addCurrentVertex(A,oe,0,0,E),this.addCurrentVertex(A,oe.mult(-1),0,0,E)}else if(Ae==="bevel"||Ae==="fakeround"){const we=-Math.sqrt(fe*fe-1),ke=Ue?we:0,Me=Ue?0:we;if(M&&this.addCurrentVertex(A,$,ke,Me,E),Ae==="fakeround"){const be=Math.round(180*pe/Math.PI/20);for(let qe=1;qe<be;qe++){let Ne=qe/be;if(Ne!==.5){const Pt=Ne-.5;Ne+=Ne*Pt*(Ne-1)*((1.0904+Y*(Y*(3.55645-1.43519*Y)-3.2452))*Pt*Pt+(.848013+Y*(.215638*Y-1.06021)))}const rt=U.sub($)._mult(Ne)._add($)._unit()._mult(Ue?-1:1);this.addHalfVertex(A,rt.x,rt.y,!1,Ue,0,E)}}z&&this.addCurrentVertex(A,U,-ke,-Me,E)}else if(Ae==="butt")this.addCurrentVertex(A,oe,0,0,E);else if(Ae==="square"){const we=M?1:-1;this.addCurrentVertex(A,oe,we,we,E)}else Ae==="round"&&(M&&(this.addCurrentVertex(A,$,0,0,E),this.addCurrentVertex(A,$,1,1,E,!0)),z&&(this.addCurrentVertex(A,U,-1,-1,E,!0),this.addCurrentVertex(A,U,0,0,E)));if(Be&&ee<g-1){const we=A.dist(z);if(we>2*w){const ke=A.add(z.sub(A)._mult(w/we)._round());this.updateDistance(A,ke),this.addCurrentVertex(ke,U,0,0,E),A=ke}}}}addCurrentVertex(e,r,o,c,h,p=!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,p,!1,o,h),this.addHalfVertex(e,m,g,p,!0,-c,h),this.distance>tu/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,r,o,c,h,p))}addHalfVertex({x:e,y:r},o,c,h,p,m,g){const x=.5*(this.lineClips?this.scaledDistance*(tu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(h?1:0),(r<<1)+(p?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 w=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,w),g.primitiveLength++),p?this.e2=w:this.e1=w}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}Fe("LineBucket",Jl,{omit:["layers","patternFeatures"]});const wd=new si({"line-cap":new Ve(de.layout_line["line-cap"]),"line-join":new je(de.layout_line["line-join"]),"line-miter-limit":new Ve(de.layout_line["line-miter-limit"]),"line-round-limit":new Ve(de.layout_line["line-round-limit"]),"line-sort-key":new je(de.layout_line["line-sort-key"])});var iu={paint:new si({"line-opacity":new je(de.paint_line["line-opacity"]),"line-color":new je(de.paint_line["line-color"]),"line-translate":new Ve(de.paint_line["line-translate"]),"line-translate-anchor":new Ve(de.paint_line["line-translate-anchor"]),"line-width":new je(de.paint_line["line-width"]),"line-gap-width":new je(de.paint_line["line-gap-width"]),"line-offset":new je(de.paint_line["line-offset"]),"line-blur":new je(de.paint_line["line-blur"]),"line-dasharray":new Ps(de.paint_line["line-dasharray"]),"line-pattern":new kn(de.paint_line["line-pattern"]),"line-gradient":new Fr(de.paint_line["line-gradient"])}),layout:wd};const ru=new class extends je{possiblyEvaluate(i,e){return e=new Rt(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=nt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(i,e,r,o)}}(iu.paint.properties["line-width"].specification);function nu(i,e){return e>0?e+2*i:i}ru.useIntegerZoom=!0;const Td=Zt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ed=Zt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Zt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Sd=Zt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Zt([{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 ou=Zt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Id=Zt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ad(i,e,r){return i.sections.forEach(o=>{o.text=function(c,h,p){const m=h.layout.get("text-transform").evaluate(p,{});return m==="uppercase"?c=c.toLocaleUpperCase():m==="lowercase"&&(c=c.toLocaleLowerCase()),Ui.applyArabicShaping&&(c=Ui.applyArabicShaping(c)),c}(o.text,e,r)}),i}Zt([{name:"triangle",components:3,type:"Uint16"}]),Zt([{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"}]),Zt([{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"}]),Zt([{type:"Float32",name:"offsetX"}]),Zt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const Zs={"!":"\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 ai=24,Yl=At,su=function(i,e,r,o,c){var h,p,m=8*c-o-1,g=(1<<m)-1,x=g>>1,w=-7,E=r?c-1:0,A=r?-1:1,M=i[e+E];for(E+=A,h=M&(1<<-w)-1,M>>=-w,w+=m;w>0;h=256*h+i[e+E],E+=A,w-=8);for(p=h&(1<<-w)-1,h>>=-w,w+=o;w>0;p=256*p+i[e+E],E+=A,w-=8);if(h===0)h=1-x;else{if(h===g)return p?NaN:1/0*(M?-1:1);p+=Math.pow(2,o),h-=x}return(M?-1:1)*p*Math.pow(2,h-o)},au=function(i,e,r,o,c,h){var p,m,g,x=8*h-c-1,w=(1<<x)-1,E=w>>1,A=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=o?0:h-1,z=o?1:-1,$=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,p=w):(p=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-p))<1&&(p--,g*=2),(e+=p+E>=1?A/g:A*Math.pow(2,1-E))*g>=2&&(p++,g/=2),p+E>=w?(m=0,p=w):p+E>=1?(m=(e*g-1)*Math.pow(2,c),p+=E):(m=e*Math.pow(2,E-1)*Math.pow(2,c),p=0));c>=8;i[r+M]=255&m,M+=z,m/=256,c-=8);for(p=p<<c|m,x+=c;x>0;i[r+M]=255&p,M+=z,p/=256,x-=8);i[r+M-z]|=128*$};function At(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}At.Varint=0,At.Fixed64=1,At.Bytes=2,At.Fixed32=5;var Bn,Ql=4294967296,lu=1/Ql,cu=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function on(i){return i.type===At.Bytes?i.readVarint()+i.pos:i.pos+1}function Wo(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function uu(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 Cd(i,e){for(var r=0;r<i.length;r++)e.writeVarint(i[r])}function Md(i,e){for(var r=0;r<i.length;r++)e.writeSVarint(i[r])}function zd(i,e){for(var r=0;r<i.length;r++)e.writeFloat(i[r])}function Pd(i,e){for(var r=0;r<i.length;r++)e.writeDouble(i[r])}function kd(i,e){for(var r=0;r<i.length;r++)e.writeBoolean(i[r])}function Dd(i,e){for(var r=0;r<i.length;r++)e.writeFixed32(i[r])}function Ld(i,e){for(var r=0;r<i.length;r++)e.writeSFixed32(i[r])}function Rd(i,e){for(var r=0;r<i.length;r++)e.writeFixed64(i[r])}function Bd(i,e){for(var r=0;r<i.length;r++)e.writeSFixed64(i[r])}function Ka(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function Ho(i,e,r){i[r]=e,i[r+1]=e>>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function hu(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}function Fd(i,e,r){i===1&&r.readMessage(Od,e)}function Od(i,e,r){if(i===3){const{id:o,bitmap:c,width:h,height:p,left:m,top:g,advance:x}=r.readMessage(Ud,{});e.push({id:o,bitmap:new Os({width:h+6,height:p+6},c),metrics:{width:h,height:p,left:m,top:g,advance:x}})}}function Ud(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 du(i){let e=0,r=0;for(const p of i)e+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,m)=>m.h-p.h);const 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 p of i)for(let m=o.length-1;m>=0;m--){const g=o[m];if(!(p.w>g.w||p.h>g.h)){if(p.x=g.x,p.y=g.y,h=Math.max(h,p.y+p.h),c=Math.max(c,p.x+p.w),p.w===g.w&&p.h===g.h){const x=o.pop();m<o.length&&(o[m]=x)}else p.h===g.h?(g.x+=p.w,g.w-=p.w):p.w===g.w?(g.y+=p.h,g.h-=p.h):(o.push({x:g.x+p.w,y:g.y,w:g.w-p.w,h:p.h}),g.y+=p.h,g.h-=p.h);break}}return{w:c,h,fill:e/(c*h)||0}}At.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=Ka(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=hu(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Ka(this.buf,this.pos)+Ka(this.buf,this.pos+4)*Ql;return this.pos+=8,i},readSFixed64:function(){var i=Ka(this.buf,this.pos)+hu(this.buf,this.pos+4)*Ql;return this.pos+=8,i},readFloat:function(){var i=su(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=su(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,p){var m,g,x=p.buf;if(m=(112&(g=x[p.pos++]))>>4,g<128||(m|=(127&(g=x[p.pos++]))<<3,g<128)||(m|=(127&(g=x[p.pos++]))<<10,g<128)||(m|=(127&(g=x[p.pos++]))<<17,g<128)||(m|=(127&(g=x[p.pos++]))<<24,g<128)||(m|=(1&(g=x[p.pos++]))<<31,g<128))return Wo(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&&cu?function(r,o,c){return cu.decode(r.subarray(o,c))}(this.buf,e,i):function(r,o,c){for(var h="",p=o;p<c;){var m,g,x,w=r[p],E=null,A=w>239?4:w>223?3:w>191?2:1;if(p+A>c)break;A===1?w<128&&(E=w):A===2?(192&(m=r[p+1]))==128&&(E=(31&w)<<6|63&m)<=127&&(E=null):A===3?(g=r[p+2],(192&(m=r[p+1]))==128&&(192&g)==128&&((E=(15&w)<<12|(63&m)<<6|63&g)<=2047||E>=55296&&E<=57343)&&(E=null)):A===4&&(g=r[p+2],x=r[p+3],(192&(m=r[p+1]))==128&&(192&g)==128&&(192&x)==128&&((E=(15&w)<<18|(63&m)<<12|(63&g)<<6|63&x)<=65535||E>=1114112)&&(E=null)),E===null?(E=65533,A=1):E>65535&&(E-=65536,h+=String.fromCharCode(E>>>10&1023|55296),E=56320|1023&E),h+=String.fromCharCode(E),p+=A}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!==At.Bytes)return i.push(this.readVarint(e));var r=on(this);for(i=i||[];this.pos<r;)i.push(this.readVarint(e));return i},readPackedSVarint:function(i){if(this.type!==At.Bytes)return i.push(this.readSVarint());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==At.Bytes)return i.push(this.readBoolean());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==At.Bytes)return i.push(this.readFloat());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==At.Bytes)return i.push(this.readDouble());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==At.Bytes)return i.push(this.readFixed32());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==At.Bytes)return i.push(this.readSFixed32());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==At.Bytes)return i.push(this.readFixed64());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==At.Bytes)return i.push(this.readSFixed64());var e=on(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===At.Varint)for(;this.buf[this.pos++]>127;);else if(e===At.Bytes)this.pos=this.readVarint()+this.pos;else if(e===At.Fixed32)this.pos+=4;else{if(e!==At.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),Ho(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),Ho(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),Ho(this.buf,-1&i,this.pos),Ho(this.buf,Math.floor(i*lu),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),Ho(this.buf,-1&i,this.pos),Ho(this.buf,Math.floor(i*lu),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,p,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,p){var m=(7&h)<<4;p.buf[p.pos++]|=m|((h>>>=3)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.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 p,m,g=0;g<c.length;g++){if((p=c.charCodeAt(g))>55295&&p<57344){if(!m){p>56319||g+1===c.length?(o[h++]=239,o[h++]=191,o[h++]=189):m=p;continue}if(p<56320){o[h++]=239,o[h++]=191,o[h++]=189,m=p;continue}p=m-55296<<10|p-56320|65536,m=null}else m&&(o[h++]=239,o[h++]=191,o[h++]=189,m=null);p<128?o[h++]=p:(p<2048?o[h++]=p>>6|192:(p<65536?o[h++]=p>>12|224:(o[h++]=p>>18|240,o[h++]=p>>12&63|128),o[h++]=p>>6&63|128),o[h++]=63&p|128)}return h}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&uu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),au(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),au(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&&uu(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o},writeMessage:function(i,e,r){this.writeTag(i,At.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Cd,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Md,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,kd,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,zd,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Pd,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Dd,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Ld,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Rd,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Bd,e)},writeBytesField:function(i,e){this.writeTag(i,At.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,At.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,At.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,At.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,At.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,At.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,At.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,At.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,At.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,At.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,Boolean(e))}};class ec{constructor(e,{pixelRatio:r,version:o,stretchX:c,stretchY:h,content:p}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=c,this.stretchY=h,this.content=p,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 pu{constructor(e,r){const o={},c={};this.haveRenderCallbacks=[];const h=[];this.addImages(e,o,h),this.addImages(r,c,h);const{w:p,h:m}=du(h),g=new Hi({width:p||1,height:m||1});for(const x in e){const w=e[x],E=o[x].paddedRect;Hi.copy(w.data,g,{x:0,y:0},{x:E.x+1,y:E.y+1},w.data)}for(const x in r){const w=r[x],E=c[x].paddedRect,A=E.x+1,M=E.y+1,z=w.data.width,$=w.data.height;Hi.copy(w.data,g,{x:0,y:0},{x:A,y:M},w.data),Hi.copy(w.data,g,{x:0,y:$-1},{x:A,y:M-1},{width:z,height:1}),Hi.copy(w.data,g,{x:0,y:0},{x:A,y:M+$},{width:z,height:1}),Hi.copy(w.data,g,{x:z-1,y:0},{x:A-1,y:M},{width:1,height:$}),Hi.copy(w.data,g,{x:0,y:0},{x:A+z,y:M},{width:1,height:$})}this.image=g,this.iconPositions=o,this.patternPositions=c}addImages(e,r,o){for(const c in e){const h=e[c],p={x:0,y:0,w:h.data.width+2,h:h.data.height+2};o.push(p),r[c]=new ec(p,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})}}Fe("ImagePosition",ec),Fe("ImageAtlas",pu),l.WritingMode=void 0,(Bn=l.WritingMode||(l.WritingMode={}))[Bn.none=0]="none",Bn[Bn.horizontal=1]="horizontal",Bn[Bn.vertical=2]="vertical",Bn[Bn.horizontalOnly=3]="horizontalOnly";const Ja=-17;class js{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){const o=new js;return o.scale=e||1,o.fontStack=r,o}static forImage(e){const r=new js;return r.imageName=e,r}}class Ko{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const o=new Ko;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&&Pa(c)&&!Zs[e[o+1]]||h&&Pa(h)&&!Zs[e[o-1]]||!Zs[e[o]]?e[o]:Zs[e[o]]}return r}(this.text)}trim(){let e=0;for(let o=0;o<this.text.length&&Qa[this.text.charCodeAt(o)];o++)e++;let r=this.text.length;for(let o=this.text.length-1;o>=0&&o>=e&&Qa[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 Ko;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(js.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 $t("Can't add FormattedSection with an empty image.");const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push(js.forImage(r)),this.sectionIndex.push(this.sections.length-1)):$t("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ya(i,e,r,o,c,h,p,m,g,x,w,E,A,M,z,$){const U=Ko.fromFeature(i,c);let ee;E===l.WritingMode.vertical&&U.verticalizePunctuation();const{processBidirectionalText:oe,processStyledBidirectionalText:Y}=Ui;if(oe&&U.sections.length===1){ee=[];const pe=oe(U.toString(),tc(U,x,h,e,o,M,z));for(const Be of pe){const Ue=new Ko;Ue.text=Be,Ue.sections=U.sections;for(let Pe=0;Pe<Be.length;Pe++)Ue.sectionIndex.push(0);ee.push(Ue)}}else if(Y){ee=[];const pe=Y(U.text,U.sectionIndex,tc(U,x,h,e,o,M,z));for(const Be of pe){const Ue=new Ko;Ue.text=Be[0],Ue.sectionIndex=Be[1],Ue.sections=U.sections,ee.push(Ue)}}else ee=function(pe,Be){const Ue=[],Pe=pe.text;let Ae=0;for(const we of Be)Ue.push(pe.substring(Ae,we)),Ae=we;return Ae<Pe.length&&Ue.push(pe.substring(Ae,Pe.length)),Ue}(U,tc(U,x,h,e,o,M,z));const re=[],fe={positionedLines:re,text:U.toString(),top:w[1],bottom:w[1],left:w[0],right:w[0],writingMode:E,iconsInText:!1,verticalizable:!1};return function(pe,Be,Ue,Pe,Ae,we,ke,Me,be,qe,Ne,rt){let Pt=0,Ft=Ja,Jt=0,Ji=0;const ci=Me==="right"?1:Me==="left"?0:.5;let jt=0;for(const Xt of Ae){Xt.trim();const hi=Xt.getMaxScale(),gi=(hi-1)*ai,Ti={positionedGlyphs:[],lineOffset:0};pe.positionedLines[jt]=Ti;const ki=Ti.positionedGlyphs;let Di=0;if(!Xt.length()){Ft+=we,++jt;continue}for(let ni=0;ni<Xt.length();ni++){const st=Xt.getSection(ni),Ni=Xt.getSectionIndex(ni),di=Xt.getCharCode(ni);let _i=0,sr=null,br=null,wr=null,an=ai;const ar=!(be===l.WritingMode.horizontal||!Ne&&!Ss(di)||Ne&&(Qa[di]||(ri=di,ze.Arabic(ri)||ze["Arabic Supplement"](ri)||ze["Arabic Extended-A"](ri)||ze["Arabic Presentation Forms-A"](ri)||ze["Arabic Presentation Forms-B"](ri))));if(st.imageName){const Yi=Pe[st.imageName];if(!Yi)continue;wr=st.imageName,pe.iconsInText=pe.iconsInText||!0,br=Yi.paddedRect;const Li=Yi.displaySize;st.scale=st.scale*ai/rt,sr={width:Li[0],height:Li[1],left:1,top:-3,advance:ar?Li[1]:Li[0]},_i=gi+(ai-Li[1]*st.scale),an=sr.advance;const ln=ar?Li[0]*st.scale-ai*hi:Li[1]*st.scale-ai*hi;ln>0&&ln>Di&&(Di=ln)}else{const Yi=Ue[st.fontStack],Li=Yi&&Yi[di];if(Li&&Li.rect)br=Li.rect,sr=Li.metrics;else{const ln=Be[st.fontStack],Hs=ln&&ln[di];if(!Hs)continue;sr=Hs.metrics}_i=(hi-st.scale)*ai}ar?(pe.verticalizable=!0,ki.push({glyph:di,imageName:wr,x:Pt,y:Ft+_i,vertical:ar,scale:st.scale,fontStack:st.fontStack,sectionIndex:Ni,metrics:sr,rect:br}),Pt+=an*st.scale+qe):(ki.push({glyph:di,imageName:wr,x:Pt,y:Ft+_i,vertical:ar,scale:st.scale,fontStack:st.fontStack,sectionIndex:Ni,metrics:sr,rect:br}),Pt+=sr.advance*st.scale+qe)}ki.length!==0&&(Jt=Math.max(Pt-qe,Jt),Nd(ki,0,ki.length-1,ci,Di)),Pt=0;const Ot=we*hi+Di;Ti.lineOffset=Math.max(Di,gi),Ft+=Ot,Ji=Math.max(Ot,Ji),++jt}var ri;const ui=Ft-Ja,{horizontalAlign:mi,verticalAlign:Pi}=ic(ke);(function(Xt,hi,gi,Ti,ki,Di,Ot,ni,st){const Ni=(hi-gi)*ki;let di=0;di=Di!==Ot?-ni*Ti-Ja:(-Ti*st+.5)*Ot;for(const _i of Xt)for(const sr of _i.positionedGlyphs)sr.x+=Ni,sr.y+=di})(pe.positionedLines,ci,mi,Pi,Jt,Ji,we,ui,Ae.length),pe.top+=-Pi*ui,pe.bottom=pe.top+ui,pe.left+=-mi*Jt,pe.right=pe.left+Jt}(fe,e,r,o,ee,p,m,g,E,x,A,$),!function(pe){for(const Be of pe)if(Be.positionedGlyphs.length!==0)return!1;return!0}(re)&&fe}const Qa={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},$d={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 fu(i,e,r,o,c,h){if(e.imageName){const p=o[e.imageName];return p?p.displaySize[0]*e.scale*ai/h+c:0}{const p=r[e.fontStack],m=p&&p[i];return m?m.metrics.advance*e.scale+c:0}}function mu(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 Vd(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 gu(i,e,r,o,c,h){let p=null,m=mu(e,r,c,h);for(const g of o){const x=mu(e-g.x,r,c,h)+g.badness;x<=m&&(p=g,m=x)}return{index:i,x:e,priorBreak:p,badness:m}}function _u(i){return i?_u(i.priorBreak).concat(i.index):[]}function tc(i,e,r,o,c,h,p){if(h!=="point")return[];if(!i)return[];const m=[],g=function(A,M,z,$,U,ee){let oe=0;for(let Y=0;Y<A.length();Y++){const re=A.getSection(Y);oe+=fu(A.getCharCode(Y),re,$,U,M,ee)}return oe/Math.max(1,Math.ceil(oe/z))}(i,e,r,o,c,p),x=i.text.indexOf("\u200B")>=0;let w=0;for(let A=0;A<i.length();A++){const M=i.getSection(A),z=i.getCharCode(A);if(Qa[z]||(w+=fu(z,M,o,c,e,p)),A<i.length()-1){const $=!((E=z)<11904||!(ze["Bopomofo Extended"](E)||ze.Bopomofo(E)||ze["CJK Compatibility Forms"](E)||ze["CJK Compatibility Ideographs"](E)||ze["CJK Compatibility"](E)||ze["CJK Radicals Supplement"](E)||ze["CJK Strokes"](E)||ze["CJK Symbols and Punctuation"](E)||ze["CJK Unified Ideographs Extension A"](E)||ze["CJK Unified Ideographs"](E)||ze["Enclosed CJK Letters and Months"](E)||ze["Halfwidth and Fullwidth Forms"](E)||ze.Hiragana(E)||ze["Ideographic Description Characters"](E)||ze["Kangxi Radicals"](E)||ze["Katakana Phonetic Extensions"](E)||ze.Katakana(E)||ze["Vertical Forms"](E)||ze["Yi Radicals"](E)||ze["Yi Syllables"](E)));($d[z]||$||M.imageName)&&m.push(gu(A+1,w,g,m,Vd(z,i.getCharCode(A+1),$&&x),!1))}}var E;return _u(gu(i.length(),w,g,m,0,!0))}function ic(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 Nd(i,e,r,o,c){if(!o&&!c)return;const h=i[r],p=(i[r].x+h.metrics.advance*h.scale)*o;for(let m=e;m<=r;m++)i[m].x-=p,i[m].y+=c}function Gd(i,e,r){const{horizontalAlign:o,verticalAlign:c}=ic(r),h=e[0]-i.displaySize[0]*o,p=e[1]-i.displaySize[1]*c;return{image:i,top:p,bottom:p+i.displaySize[1],left:h,right:h+i.displaySize[0]}}function yu(i,e,r,o,c,h){const p=i.image;let m;if(p.content){const U=p.content,ee=p.pixelRatio||1;m=[U[0]/ee,U[1]/ee,p.displaySize[0]-U[2]/ee,p.displaySize[1]-U[3]/ee]}const g=e.left*h,x=e.right*h;let w,E,A,M;r==="width"||r==="both"?(M=c[0]+g-o[3],E=c[0]+x+o[1]):(M=c[0]+(g+x-p.displaySize[0])/2,E=M+p.displaySize[0]);const z=e.top*h,$=e.bottom*h;return r==="height"||r==="both"?(w=c[1]+z-o[0],A=c[1]+$+o[2]):(w=c[1]+(z+$-p.displaySize[1])/2,A=w+p.displaySize[1]),{image:p,top:w,right:E,bottom:A,left:M,collisionPadding:m}}const sn=128;function xu(i,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Rt(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 p=h;for(;p<o.length&&o[p]<i+1;)p++;p=Math.min(o.length-1,p);const m=o[h],g=o[p];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:c}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new Rt(m)),maxSize:r.evaluate(new Rt(g)),interpolationType:c}}}class Fn extends We{constructor(e,r,o,c){super(e,r),this.angle=o,c!==void 0&&(this.segment=c)}clone(){return new Fn(this.x,this.y,this.angle,this.segment)}}function vu(i,e,r,o,c){if(e.segment===void 0)return!0;let h=e,p=e.segment+1,m=0;for(;m>-r/2;){if(p--,p<0)return!1;m-=i[p].dist(h),h=i[p]}m+=i[p].dist(i[p+1]),p++;const g=[];let x=0;for(;m<r/2;){const w=i[p],E=i[p+1];if(!E)return!1;let A=i[p-1].angleTo(w)-w.angleTo(E);for(A=Math.abs((A+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:A}),x+=A;m-g[0].distance>o;)x-=g.shift().angleDelta;if(x>c)return!1;p++,m+=w.dist(E)}return!0}function bu(i){let e=0;for(let r=0;r<i.length-1;r++)e+=i[r].dist(i[r+1]);return e}function wu(i,e,r){return i?.6*e*r:0}function Tu(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function qd(i,e,r,o,c,h){const p=wu(r,c,h),m=Tu(r,o)*h;let g=0;const x=bu(i)/2;for(let w=0;w<i.length-1;w++){const E=i[w],A=i[w+1],M=E.dist(A);if(g+M>x){const z=(x-g)/M,$=Dt(E.x,A.x,z),U=Dt(E.y,A.y,z),ee=new Fn($,U,A.angleTo(E),w);return ee._round(),!p||vu(i,ee,m,p,e)?ee:void 0}g+=M}}function Zd(i,e,r,o,c,h,p,m,g){const x=wu(o,h,p),w=Tu(o,c),E=w*p,A=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return e-E<e/4&&(e=E+e/4),Eu(i,A?e/2*m%e:(w/2+2*h)*p*m%e,e,x,r,E,A,!1,g)}function Eu(i,e,r,o,c,h,p,m,g){const x=h/2,w=bu(i);let E=0,A=e-r,M=[];for(let z=0;z<i.length-1;z++){const $=i[z],U=i[z+1],ee=$.dist(U),oe=U.angleTo($);for(;A+r<E+ee;){A+=r;const Y=(A-E)/ee,re=Dt($.x,U.x,Y),fe=Dt($.y,U.y,Y);if(re>=0&&re<g&&fe>=0&&fe<g&&A-x>=0&&A+x<=w){const pe=new Fn(re,fe,oe,z);pe._round(),o&&!vu(i,pe,h,o,c)||M.push(pe)}}E+=ee}return m||M.length||p||(M=Eu(i,E/2,r,o,c,h,p,!0,g)),M}function Su(i,e,r,o,c){const h=[];for(let p=0;p<i.length;p++){const m=i[p];let g;for(let x=0;x<m.length-1;x++){let w=m[x],E=m[x+1];w.x<e&&E.x<e||(w.x<e?w=new We(e,w.y+(e-w.x)/(E.x-w.x)*(E.y-w.y))._round():E.x<e&&(E=new We(e,w.y+(e-w.x)/(E.x-w.x)*(E.y-w.y))._round()),w.y<r&&E.y<r||(w.y<r?w=new We(w.x+(r-w.y)/(E.y-w.y)*(E.x-w.x),r)._round():E.y<r&&(E=new We(w.x+(r-w.y)/(E.y-w.y)*(E.x-w.x),r)._round()),w.x>=o&&E.x>=o||(w.x>=o?w=new We(o,w.y+(o-w.x)/(E.x-w.x)*(E.y-w.y))._round():E.x>=o&&(E=new We(o,w.y+(o-w.x)/(E.x-w.x)*(E.y-w.y))._round()),w.y>=c&&E.y>=c||(w.y>=c?w=new We(w.x+(c-w.y)/(E.y-w.y)*(E.x-w.x),c)._round():E.y>=c&&(E=new We(w.x+(c-w.y)/(E.y-w.y)*(E.x-w.x),c)._round()),g&&w.equals(g[g.length-1])||(g=[w],h.push(g)),g.push(E)))))}}return h}function Iu(i,e,r,o){const c=[],h=i.image,p=h.pixelRatio,m=h.paddedRect.w-2,g=h.paddedRect.h-2,x=i.right-i.left,w=i.bottom-i.top,E=h.stretchX||[[0,m]],A=h.stretchY||[[0,g]],M=(we,ke)=>we+ke[1]-ke[0],z=E.reduce(M,0),$=A.reduce(M,0),U=m-z,ee=g-$;let oe=0,Y=z,re=0,fe=$,pe=0,Be=U,Ue=0,Pe=ee;if(h.content&&o){const we=h.content;oe=el(E,0,we[0]),re=el(A,0,we[1]),Y=el(E,we[0],we[2]),fe=el(A,we[1],we[3]),pe=we[0]-oe,Ue=we[1]-re,Be=we[2]-we[0]-Y,Pe=we[3]-we[1]-fe}const Ae=(we,ke,Me,be)=>{const qe=tl(we.stretch-oe,Y,x,i.left),Ne=il(we.fixed-pe,Be,we.stretch,z),rt=tl(ke.stretch-re,fe,w,i.top),Pt=il(ke.fixed-Ue,Pe,ke.stretch,$),Ft=tl(Me.stretch-oe,Y,x,i.left),Jt=il(Me.fixed-pe,Be,Me.stretch,z),Ji=tl(be.stretch-re,fe,w,i.top),ci=il(be.fixed-Ue,Pe,be.stretch,$),jt=new We(qe,rt),ri=new We(Ft,rt),ui=new We(Ft,Ji),mi=new We(qe,Ji),Pi=new We(Ne/p,Pt/p),Xt=new We(Jt/p,ci/p),hi=e*Math.PI/180;if(hi){const ki=Math.sin(hi),Di=Math.cos(hi),Ot=[Di,-ki,ki,Di];jt._matMult(Ot),ri._matMult(Ot),mi._matMult(Ot),ui._matMult(Ot)}const gi=we.stretch+we.fixed,Ti=ke.stretch+ke.fixed;return{tl:jt,tr:ri,bl:mi,br:ui,tex:{x:h.paddedRect.x+1+gi,y:h.paddedRect.y+1+Ti,w:Me.stretch+Me.fixed-gi,h:be.stretch+be.fixed-Ti},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Pi,pixelOffsetBR:Xt,minFontScaleX:Be/p/x,minFontScaleY:Pe/p/w,isSDF:r}};if(o&&(h.stretchX||h.stretchY)){const we=Au(E,U,z),ke=Au(A,ee,$);for(let Me=0;Me<we.length-1;Me++){const be=we[Me],qe=we[Me+1];for(let Ne=0;Ne<ke.length-1;Ne++)c.push(Ae(be,ke[Ne],qe,ke[Ne+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 el(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 Au(i,e,r){const o=[{fixed:-1,stretch:0}];for(const[c,h]of i){const p=o[o.length-1];o.push({fixed:c-p.stretch,stretch:p.stretch}),o.push({fixed:c-p.stretch,stretch:p.stretch+(h-c)})}return o.push({fixed:e+1,stretch:r}),o}function tl(i,e,r,o){return i/e*r+o}function il(i,e,r,o){return i-e*r/o}Fe("Anchor",Fn);class rl{constructor(e,r,o,c,h,p,m,g,x,w){if(this.boxStartIndex=e.length,x){let E=p.top,A=p.bottom;const M=p.collisionPadding;M&&(E-=M[1],A+=M[3]);let z=A-E;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{let E=p.top*m-g[0],A=p.bottom*m+g[2],M=p.left*m-g[3],z=p.right*m+g[1];const $=p.collisionPadding;if($&&(M-=$[0]*m,E-=$[1]*m,z+=$[2]*m,A+=$[3]*m),w){const U=new We(M,E),ee=new We(z,E),oe=new We(M,A),Y=new We(z,A),re=w*Math.PI/180;U._rotate(re),ee._rotate(re),oe._rotate(re),Y._rotate(re),M=Math.min(U.x,ee.x,oe.x,Y.x),z=Math.max(U.x,ee.x,oe.x,Y.x),E=Math.min(U.y,ee.y,oe.y,Y.y),A=Math.max(U.y,ee.y,oe.y,Y.y)}e.emplaceBack(r.x,r.y,M,E,z,A,o,c,h)}this.boxEndIndex=e.length}}class jd{constructor(e=[],r=Xd){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,p=r[h];if(o(c,p)>=0)break;r[e]=p,e=h}r[e]=c}_down(e){const{data:r,compare:o}=this,c=this.length>>1,h=r[e];for(;e<c;){let p=1+(e<<1),m=r[p];const g=p+1;if(g<this.length&&o(r[g],m)<0&&(p=g,m=r[g]),o(m,h)>=0)break;r[e]=m,e=p}r[e]=h}}function Xd(i,e){return i<e?-1:i>e?1:0}function Wd(i,e=1,r=!1){let o=1/0,c=1/0,h=-1/0,p=-1/0;const m=i[0];for(let M=0;M<m.length;M++){const z=m[M];(!M||z.x<o)&&(o=z.x),(!M||z.y<c)&&(c=z.y),(!M||z.x>h)&&(h=z.x),(!M||z.y>p)&&(p=z.y)}const g=Math.min(h-o,p-c);let x=g/2;const w=new jd([],Hd);if(g===0)return new We(o,c);for(let M=o;M<h;M+=g)for(let z=c;z<p;z+=g)w.push(new Jo(M+x,z+x,x,i));let E=function(M){let z=0,$=0,U=0;const ee=M[0];for(let oe=0,Y=ee.length,re=Y-1;oe<Y;re=oe++){const fe=ee[oe],pe=ee[re],Be=fe.x*pe.y-pe.x*fe.y;$+=(fe.x+pe.x)*Be,U+=(fe.y+pe.y)*Be,z+=3*Be}return new Jo($/z,U/z,0,M)}(i),A=w.length;for(;w.length;){const M=w.pop();(M.d>E.d||!E.d)&&(E=M,r&&console.log("found best %d after %d probes",Math.round(1e4*M.d)/1e4,A)),M.max-E.d<=e||(x=M.h/2,w.push(new Jo(M.p.x-x,M.p.y-x,x,i)),w.push(new Jo(M.p.x+x,M.p.y-x,x,i)),w.push(new Jo(M.p.x-x,M.p.y+x,x,i)),w.push(new Jo(M.p.x+x,M.p.y+x,x,i)),A+=4)}return r&&(console.log(`num probes: ${A}`),console.log(`best distance: ${E.d}`)),E.p}function Hd(i,e){return e.max-i.max}function Jo(i,e,r,o){this.p=new We(i,e),this.h=r,this.d=function(c,h){let p=!1,m=1/0;for(let g=0;g<h.length;g++){const x=h[g];for(let w=0,E=x.length,A=E-1;w<E;A=w++){const M=x[w],z=x[A];M.y>c.y!=z.y>c.y&&c.x<(z.x-M.x)*(c.y-M.y)/(z.y-M.y)+M.x&&(p=!p),m=Math.min(m,Rc(c,M,z))}}return(p?1:-1)*Math.sqrt(m)}(this.p,o),this.max=this.d+this.h*Math.SQRT2}const rc=Number.POSITIVE_INFINITY;function Cu(i,e){return e[1]!==rc?function(r,o,c){let h=0,p=0;switch(o=Math.abs(o),c=Math.abs(c),r){case"top-right":case"top-left":case"top":p=c-7;break;case"bottom-right":case"bottom-left":case"bottom":p=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,p]}(i,e[0],e[1]):function(r,o){let c=0,h=0;o<0&&(o=0);const p=o/Math.sqrt(2);switch(r){case"top-right":case"top-left":h=p-7;break;case"bottom-right":case"bottom-left":h=7-p;break;case"bottom":h=7-o;break;case"top":h=o-7}switch(r){case"top-right":case"bottom-right":c=-p;break;case"top-left":case"bottom-left":c=p;break;case"left":c=o;break;case"right":c=-o}return[c,h]}(i,e[0])}function nc(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 Kd(i,e,r,o,c,h,p,m,g,x,w){let E=h.textMaxSize.evaluate(e,{});E===void 0&&(E=p);const A=i.layers[0].layout,M=A.get("icon-offset").evaluate(e,{},w),z=zu(r.horizontal),$=p/24,U=i.tilePixelRatio*$,ee=i.tilePixelRatio*E/24,oe=i.tilePixelRatio*m,Y=i.tilePixelRatio*A.get("symbol-spacing"),re=A.get("text-padding")*i.tilePixelRatio,fe=function(be,qe,Ne,rt=1){const Pt=be.get("icon-padding").evaluate(qe,{},Ne),Ft=Pt&&Pt.values;return[Ft[0]*rt,Ft[1]*rt,Ft[2]*rt,Ft[3]*rt]}(A,e,w,i.tilePixelRatio),pe=A.get("text-max-angle")/180*Math.PI,Be=A.get("text-rotation-alignment")!=="viewport"&&A.get("symbol-placement")!=="point",Ue=A.get("icon-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",Pe=A.get("symbol-placement"),Ae=Y/2,we=A.get("icon-text-fit");let ke;o&&we!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(ke=yu(o,r.vertical,we,A.get("icon-text-fit-padding"),M,$)),z&&(o=yu(o,z,we,A.get("icon-text-fit-padding"),M,$)));const Me=(be,qe)=>{qe.x<0||qe.x>=Kt||qe.y<0||qe.y>=Kt||function(Ne,rt,Pt,Ft,Jt,Ji,ci,jt,ri,ui,mi,Pi,Xt,hi,gi,Ti,ki,Di,Ot,ni,st,Ni,di,_i,sr){const br=Ne.addToLineVertexArray(rt,Pt);let wr,an,ar,Yi,Li=0,ln=0,Hs=0,ju=0,fc=-1,mc=-1;const cn={};let Xu=ii.exports(""),gc=0,_c=0;if(jt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[gc,_c]=jt.layout.get("text-offset").evaluate(st,{},_i).map(Ri=>Ri*ai):(gc=jt.layout.get("text-radial-offset").evaluate(st,{},_i)*ai,_c=rc),Ne.allowVerticalPlacement&&Ft.vertical){const Ri=jt.layout.get("text-rotate").evaluate(st,{},_i)+90;ar=new rl(ri,rt,ui,mi,Pi,Ft.vertical,Xt,hi,gi,Ri),ci&&(Yi=new rl(ri,rt,ui,mi,Pi,ci,ki,Di,gi,Ri))}if(Jt){const Ri=jt.layout.get("icon-rotate").evaluate(st,{}),Nr=jt.layout.get("icon-text-fit")!=="none",Ks=Iu(Jt,Ri,di,Nr),Js=ci?Iu(ci,Ri,di,Nr):void 0;an=new rl(ri,rt,ui,mi,Pi,Jt,ki,Di,!1,Ri),Li=4*Ks.length;const Ku=Ne.iconSizeData;let xo=null;Ku.kind==="source"?(xo=[sn*jt.layout.get("icon-size").evaluate(st,{})],xo[0]>On&&$t(`${Ne.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Ku.kind==="composite"&&(xo=[sn*Ni.compositeIconSizes[0].evaluate(st,{},_i),sn*Ni.compositeIconSizes[1].evaluate(st,{},_i)],(xo[0]>On||xo[1]>On)&&$t(`${Ne.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Ne.addSymbols(Ne.icon,Ks,xo,ni,Ot,st,l.WritingMode.none,rt,br.lineStartIndex,br.lineLength,-1,_i),fc=Ne.icon.placedSymbolArray.length-1,Js&&(ln=4*Js.length,Ne.addSymbols(Ne.icon,Js,xo,ni,Ot,st,l.WritingMode.vertical,rt,br.lineStartIndex,br.lineLength,-1,_i),mc=Ne.icon.placedSymbolArray.length-1)}const Wu=Object.keys(Ft.horizontal);for(const Ri of Wu){const Nr=Ft.horizontal[Ri];if(!wr){Xu=ii.exports(Nr.text);const Js=jt.layout.get("text-rotate").evaluate(st,{},_i);wr=new rl(ri,rt,ui,mi,Pi,Nr,Xt,hi,gi,Js)}const Ks=Nr.positionedLines.length===1;if(Hs+=Mu(Ne,rt,Nr,Ji,jt,gi,st,Ti,br,Ft.vertical?l.WritingMode.horizontal:l.WritingMode.horizontalOnly,Ks?Wu:[Ri],cn,fc,Ni,_i),Ks)break}Ft.vertical&&(ju+=Mu(Ne,rt,Ft.vertical,Ji,jt,gi,st,Ti,br,l.WritingMode.vertical,["vertical"],cn,mc,Ni,_i));const cp=wr?wr.boxStartIndex:Ne.collisionBoxArray.length,up=wr?wr.boxEndIndex:Ne.collisionBoxArray.length,hp=ar?ar.boxStartIndex:Ne.collisionBoxArray.length,dp=ar?ar.boxEndIndex:Ne.collisionBoxArray.length,pp=an?an.boxStartIndex:Ne.collisionBoxArray.length,fp=an?an.boxEndIndex:Ne.collisionBoxArray.length,mp=Yi?Yi.boxStartIndex:Ne.collisionBoxArray.length,gp=Yi?Yi.boxEndIndex:Ne.collisionBoxArray.length;let Tr=-1;const ll=(Ri,Nr)=>Ri&&Ri.circleDiameter?Math.max(Ri.circleDiameter,Nr):Nr;Tr=ll(wr,Tr),Tr=ll(ar,Tr),Tr=ll(an,Tr),Tr=ll(Yi,Tr);const Hu=Tr>-1?1:0;Hu&&(Tr*=sr/ai),Ne.glyphOffsetArray.length>=Yo.MAX_GLYPHS&&$t("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),st.sortKey!==void 0&&Ne.addToSortKeyRanges(Ne.symbolInstances.length,st.sortKey),Ne.symbolInstances.emplaceBack(rt.x,rt.y,cn.right>=0?cn.right:-1,cn.center>=0?cn.center:-1,cn.left>=0?cn.left:-1,cn.vertical||-1,fc,mc,Xu,cp,up,hp,dp,pp,fp,mp,gp,ui,Hs,ju,Li,ln,Hu,0,Xt,gc,_c,Tr)}(i,qe,be,r,o,c,ke,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,U,[re,re,re,re],Be,g,oe,fe,Ue,M,e,h,x,w,p)};if(Pe==="line")for(const be of Su(e.geometry,0,0,Kt,Kt)){const qe=Zd(be,Y,pe,r.vertical||z,o,24,ee,i.overscaling,Kt);for(const Ne of qe){const rt=z;rt&&Jd(i,rt.text,Ae,Ne)||Me(be,Ne)}}else if(Pe==="line-center"){for(const be of e.geometry)if(be.length>1){const qe=qd(be,pe,r.vertical||z,o,24,ee);qe&&Me(be,qe)}}else if(e.type==="Polygon")for(const be of Zl(e.geometry,0)){const qe=Wd(be,16);Me(be[0],new Fn(qe.x,qe.y,0))}else if(e.type==="LineString")for(const be of e.geometry)Me(be,new Fn(be[0].x,be[0].y,0));else if(e.type==="Point")for(const be of e.geometry)for(const qe of be)Me([qe],new Fn(qe.x,qe.y,0))}const On=32640;function Mu(i,e,r,o,c,h,p,m,g,x,w,E,A,M,z){const $=function(oe,Y,re,fe,pe,Be,Ue,Pe){const Ae=fe.layout.get("text-rotate").evaluate(Be,{})*Math.PI/180,we=[];for(const ke of Y.positionedLines)for(const Me of ke.positionedGlyphs){if(!Me.rect)continue;const be=Me.rect||{};let qe=4,Ne=!0,rt=1,Pt=0;const Ft=(pe||Pe)&&Me.vertical,Jt=Me.metrics.advance*Me.scale/2;if(Pe&&Y.verticalizable){const Ot=(Me.scale-1)*ai,ni=(ai-Me.metrics.width*Me.scale)/2;Pt=ke.lineOffset/2-(Me.imageName?-ni:Ot)}if(Me.imageName){const Ot=Ue[Me.imageName];Ne=Ot.sdf,rt=Ot.pixelRatio,qe=1/rt}const Ji=pe?[Me.x+Jt,Me.y]:[0,0];let ci=pe?[0,0]:[Me.x+Jt+re[0],Me.y+re[1]-Pt],jt=[0,0];Ft&&(jt=ci,ci=[0,0]);const ri=(Me.metrics.left-qe)*Me.scale-Jt+ci[0],ui=(-Me.metrics.top-qe)*Me.scale+ci[1],mi=ri+be.w*Me.scale/rt,Pi=ui+be.h*Me.scale/rt,Xt=new We(ri,ui),hi=new We(mi,ui),gi=new We(ri,Pi),Ti=new We(mi,Pi);if(Ft){const Ot=new We(-Jt,Jt-Ja),ni=-Math.PI/2,st=12-Jt,Ni=new We(22-st,-(Me.imageName?st:0)),di=new We(...jt);Xt._rotateAround(ni,Ot)._add(Ni)._add(di),hi._rotateAround(ni,Ot)._add(Ni)._add(di),gi._rotateAround(ni,Ot)._add(Ni)._add(di),Ti._rotateAround(ni,Ot)._add(Ni)._add(di)}if(Ae){const Ot=Math.sin(Ae),ni=Math.cos(Ae),st=[ni,-Ot,Ot,ni];Xt._matMult(st),hi._matMult(st),gi._matMult(st),Ti._matMult(st)}const ki=new We(0,0),Di=new We(0,0);we.push({tl:Xt,tr:hi,bl:gi,br:Ti,tex:be,writingMode:Y.writingMode,glyphOffset:Ji,sectionIndex:Me.sectionIndex,isSDF:Ne,pixelOffsetTL:ki,pixelOffsetBR:Di,minFontScaleX:0,minFontScaleY:0})}return we}(0,r,m,c,h,p,o,i.allowVerticalPlacement),U=i.textSizeData;let ee=null;U.kind==="source"?(ee=[sn*c.layout.get("text-size").evaluate(p,{})],ee[0]>On&&$t(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):U.kind==="composite"&&(ee=[sn*M.compositeTextSizes[0].evaluate(p,{},z),sn*M.compositeTextSizes[1].evaluate(p,{},z)],(ee[0]>On||ee[1]>On)&&$t(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),i.addSymbols(i.text,$,ee,m,h,p,x,e,g.lineStartIndex,g.lineLength,A,z);for(const oe of w)E[oe]=i.text.placedSymbolArray.length-1;return 4*$.length}function zu(i){for(const e in i)return i[e];return null}function Jd(i,e,r,o){const c=i.compareText;if(e in c){const h=c[e];for(let p=h.length-1;p>=0;p--)if(o.dist(h[p])<r)return!0}else c[e]=[];return c[e].push(o),!1}const Yd=Rn.VectorTileFeature.types,Qd=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function nl(i,e,r,o,c,h,p,m,g,x,w,E,A){const M=m?Math.min(On,Math.round(m[0])):0,z=m?Math.min(On,Math.round(m[1])):0;i.emplaceBack(e,r,Math.round(32*o),Math.round(32*c),h,p,(M<<1)+(g?1:0),z,16*x,16*w,256*E,256*A)}function oc(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 ep(i){for(const e of i.sections)if(Da(e.text))return!0;return!1}class sc{constructor(e){this.layoutVertexArray=new nr,this.indexArray=new vi,this.programConfigurations=e,this.segments=new ot,this.dynamicLayoutVertexArray=new Wi,this.opacityVertexArray=new or,this.placedSymbolArray=new ye}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,Td.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Ed.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Qd,!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())}}Fe("SymbolBuffers",sc);class ac{constructor(e,r,o){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new o,this.segments=new ot,this.collisionVertexArray=new $i}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Sd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Fe("CollisionBuffers",ac);class Yo{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(p=>p.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ul([]),this.placementViewportMatrix=Ul([]);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=cc(o,"text-overlap","text-allow-overlap")!=="never"||cc(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(p=>l.WritingMode[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=e.sourceID}createArrays(){this.text=new sc(new fo(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new sc(new fo(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ie,this.lineVertexArray=new Re,this.symbolInstances=new Le}calculateGlyphDependencies(e,r,o,c,h){for(let p=0;p<e.length;p++)if(r[e.charCodeAt(p)]=!0,(o||c)&&h){const m=Zs[e.charAt(p)];m&&(r[m.charCodeAt(0)]=!0)}}populate(e,r,o){const c=this.layers[0],h=c.layout,p=h.get("text-font"),m=h.get("text-field"),g=h.get("icon-image"),x=(m.value.kind!=="constant"||m.value.value instanceof Z&&!m.value.value.isEmpty()||m.value.value.toString().length>0)&&(p.value.kind!=="constant"||p.value.value.length>0),w=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,E=h.get("symbol-sort-key");if(this.features=[],!x&&!w)return;const A=r.iconDependencies,M=r.glyphDependencies,z=r.availableImages,$=new Rt(this.zoom);for(const{feature:U,id:ee,index:oe,sourceLayerIndex:Y}of e){const re=c._featureFilter.needGeometry,fe=go(U,re);if(!c._featureFilter.filter($,fe,o))continue;let pe,Be;if(re||(fe.geometry=mo(U)),x){const Pe=c.getValueAndResolveTokens("text-field",fe,o,z),Ae=Z.factory(Pe);ep(Ae)&&(this.hasRTLText=!0),(!this.hasRTLText||uo()==="unavailable"||this.hasRTLText&&Ui.isParsed())&&(pe=Ad(Ae,c,fe))}if(w){const Pe=c.getValueAndResolveTokens("icon-image",fe,o,z);Be=Pe instanceof K?Pe:K.fromString(Pe)}if(!pe&&!Be)continue;const Ue=this.sortFeaturesByKey?E.evaluate(fe,{},o):void 0;if(this.features.push({id:ee,text:pe,icon:Be,index:oe,sourceLayerIndex:Y,geometry:fe.geometry,properties:U.properties,type:Yd[U.type],sortKey:Ue}),Be&&(A[Be.name]=!0),pe){const Pe=p.evaluate(fe,{},o).join(","),Ae=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(l.WritingMode.vertical)>=0;for(const we of pe.sections)if(we.image)A[we.image.name]=!0;else{const ke=$o(pe.toString()),Me=we.fontStack||Pe,be=M[Me]=M[Me]||{};this.calculateGlyphDependencies(we.text,be,Ae,this.allowVerticalPlacement,ke)}}}h.get("symbol-placement")==="line"&&(this.features=function(U){const ee={},oe={},Y=[];let re=0;function fe(Pe){Y.push(U[Pe]),re++}function pe(Pe,Ae,we){const ke=oe[Pe];return delete oe[Pe],oe[Ae]=ke,Y[ke].geometry[0].pop(),Y[ke].geometry[0]=Y[ke].geometry[0].concat(we[0]),ke}function Be(Pe,Ae,we){const ke=ee[Ae];return delete ee[Ae],ee[Pe]=ke,Y[ke].geometry[0].shift(),Y[ke].geometry[0]=we[0].concat(Y[ke].geometry[0]),ke}function Ue(Pe,Ae,we){const ke=we?Ae[0][Ae[0].length-1]:Ae[0][0];return`${Pe}:${ke.x}:${ke.y}`}for(let Pe=0;Pe<U.length;Pe++){const Ae=U[Pe],we=Ae.geometry,ke=Ae.text?Ae.text.toString():null;if(!ke){fe(Pe);continue}const Me=Ue(ke,we),be=Ue(ke,we,!0);if(Me in oe&&be in ee&&oe[Me]!==ee[be]){const qe=Be(Me,be,we),Ne=pe(Me,be,Y[qe].geometry);delete ee[Me],delete oe[be],oe[Ue(ke,Y[Ne].geometry,!0)]=Ne,Y[qe].geometry=null}else Me in oe?pe(Me,be,we):be in ee?Be(Me,be,we):(fe(Pe),ee[Me]=re-1,oe[be]=re-1)}return Y.filter(Pe=>Pe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((U,ee)=>U.sortKey-ee.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 p={};for(let m=e.segment+1;m<r.length;m++)p[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--)p[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=p[m];this.lineVertexArray.emplaceBack(g.x,g.y,g.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,r,o,c,h,p,m,g,x,w,E,A){const M=e.indexArray,z=e.layoutVertexArray,$=e.segments.prepareSegment(4*r.length,z,M,this.canOverlap?p.sortKey:void 0),U=this.glyphOffsetArray.length,ee=$.vertexLength,oe=this.allowVerticalPlacement&&m===l.WritingMode.vertical?Math.PI/2:0,Y=p.text&&p.text.sections;for(let re=0;re<r.length;re++){const{tl:fe,tr:pe,bl:Be,br:Ue,tex:Pe,pixelOffsetTL:Ae,pixelOffsetBR:we,minFontScaleX:ke,minFontScaleY:Me,glyphOffset:be,isSDF:qe,sectionIndex:Ne}=r[re],rt=$.vertexLength,Pt=be[1];nl(z,g.x,g.y,fe.x,Pt+fe.y,Pe.x,Pe.y,o,qe,Ae.x,Ae.y,ke,Me),nl(z,g.x,g.y,pe.x,Pt+pe.y,Pe.x+Pe.w,Pe.y,o,qe,we.x,Ae.y,ke,Me),nl(z,g.x,g.y,Be.x,Pt+Be.y,Pe.x,Pe.y+Pe.h,o,qe,Ae.x,we.y,ke,Me),nl(z,g.x,g.y,Ue.x,Pt+Ue.y,Pe.x+Pe.w,Pe.y+Pe.h,o,qe,we.x,we.y,ke,Me),oc(e.dynamicLayoutVertexArray,g,oe),M.emplaceBack(rt,rt+1,rt+2),M.emplaceBack(rt+1,rt+2,rt+3),$.vertexLength+=4,$.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(be[0]),re!==r.length-1&&Ne===r[re+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,p,p.index,{},A,Y&&Y[Ne])}e.placedSymbolArray.emplaceBack(g.x,g.y,U,this.glyphOffsetArray.length-U,ee,x,w,g.segment,o?o[0]:0,o?o[1]:0,c[0],c[1],m,0,!1,0,E)}_addCollisionDebugVertex(e,r,o,c,h,p){return r.emplaceBack(0,0),e.emplaceBack(o.x,o.y,c,h,Math.round(p.x),Math.round(p.y))}addCollisionDebugVertices(e,r,o,c,h,p,m){const g=h.segments.prepareSegment(4,h.layoutVertexArray,h.indexArray),x=g.vertexLength,w=h.layoutVertexArray,E=h.collisionVertexArray,A=m.anchorX,M=m.anchorY;this._addCollisionDebugVertex(w,E,p,A,M,new We(e,r)),this._addCollisionDebugVertex(w,E,p,A,M,new We(o,r)),this._addCollisionDebugVertex(w,E,p,A,M,new We(o,c)),this._addCollisionDebugVertex(w,E,p,A,M,new We(e,c)),g.vertexLength+=4;const z=h.indexArray;z.emplaceBack(x,x+1),z.emplaceBack(x+1,x+2),z.emplaceBack(x+2,x+3),z.emplaceBack(x+3,x),g.primitiveLength+=4}addDebugCollisionBoxes(e,r,o,c){for(let h=e;h<r;h++){const p=this.collisionBoxArray.get(h);this.addCollisionDebugVertices(p.x1,p.y1,p.x2,p.y2,c?this.textCollisionBox:this.iconCollisionBox,p.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ac($r,ou.members,xr),this.iconCollisionBox=new ac($r,ou.members,xr);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,p,m,g,x){const w={};for(let E=r;E<o;E++){const A=e.get(E);w.textBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},w.textFeatureIndex=A.featureIndex;break}for(let E=c;E<h;E++){const A=e.get(E);w.verticalTextBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},w.verticalTextFeatureIndex=A.featureIndex;break}for(let E=p;E<m;E++){const A=e.get(E);w.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},w.iconFeatureIndex=A.featureIndex;break}for(let E=g;E<x;E++){const A=e.get(E);w.verticalIconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},w.verticalIconFeatureIndex=A.featureIndex;break}return w}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=[],p=[];for(let m=0;m<this.symbolInstances.length;++m){p.push(m);const g=this.symbolInstances.get(m);c.push(0|Math.round(r*g.anchorX+o*g.anchorY)),h.push(g.featureIndex)}return p.sort((m,g)=>c[m]-c[g]||h[g]-h[m]),p}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,p)=>{c>=0&&p.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)}}}Fe("SymbolBucket",Yo,{omit:["layers","collisionBoxArray","features","compareText"]}),Yo.MAX_GLYPHS=65535,Yo.addDynamicAttributes=oc;const tp=new si({"symbol-placement":new Ve(de.layout_symbol["symbol-placement"]),"symbol-spacing":new Ve(de.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ve(de.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new je(de.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ve(de.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ve(de.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ve(de.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ve(de.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ve(de.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ve(de.layout_symbol["icon-rotation-alignment"]),"icon-size":new je(de.layout_symbol["icon-size"]),"icon-text-fit":new Ve(de.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ve(de.layout_symbol["icon-text-fit-padding"]),"icon-image":new je(de.layout_symbol["icon-image"]),"icon-rotate":new je(de.layout_symbol["icon-rotate"]),"icon-padding":new je(de.layout_symbol["icon-padding"]),"icon-keep-upright":new Ve(de.layout_symbol["icon-keep-upright"]),"icon-offset":new je(de.layout_symbol["icon-offset"]),"icon-anchor":new je(de.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ve(de.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ve(de.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ve(de.layout_symbol["text-rotation-alignment"]),"text-field":new je(de.layout_symbol["text-field"]),"text-font":new je(de.layout_symbol["text-font"]),"text-size":new je(de.layout_symbol["text-size"]),"text-max-width":new je(de.layout_symbol["text-max-width"]),"text-line-height":new Ve(de.layout_symbol["text-line-height"]),"text-letter-spacing":new je(de.layout_symbol["text-letter-spacing"]),"text-justify":new je(de.layout_symbol["text-justify"]),"text-radial-offset":new je(de.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ve(de.layout_symbol["text-variable-anchor"]),"text-anchor":new je(de.layout_symbol["text-anchor"]),"text-max-angle":new Ve(de.layout_symbol["text-max-angle"]),"text-writing-mode":new Ve(de.layout_symbol["text-writing-mode"]),"text-rotate":new je(de.layout_symbol["text-rotate"]),"text-padding":new Ve(de.layout_symbol["text-padding"]),"text-keep-upright":new Ve(de.layout_symbol["text-keep-upright"]),"text-transform":new je(de.layout_symbol["text-transform"]),"text-offset":new je(de.layout_symbol["text-offset"]),"text-allow-overlap":new Ve(de.layout_symbol["text-allow-overlap"]),"text-overlap":new Ve(de.layout_symbol["text-overlap"]),"text-ignore-placement":new Ve(de.layout_symbol["text-ignore-placement"]),"text-optional":new Ve(de.layout_symbol["text-optional"])});var lc={paint:new si({"icon-opacity":new je(de.paint_symbol["icon-opacity"]),"icon-color":new je(de.paint_symbol["icon-color"]),"icon-halo-color":new je(de.paint_symbol["icon-halo-color"]),"icon-halo-width":new je(de.paint_symbol["icon-halo-width"]),"icon-halo-blur":new je(de.paint_symbol["icon-halo-blur"]),"icon-translate":new Ve(de.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ve(de.paint_symbol["icon-translate-anchor"]),"text-opacity":new je(de.paint_symbol["text-opacity"]),"text-color":new je(de.paint_symbol["text-color"],{runtimeType:oi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new je(de.paint_symbol["text-halo-color"]),"text-halo-width":new je(de.paint_symbol["text-halo-width"]),"text-halo-blur":new je(de.paint_symbol["text-halo-blur"]),"text-translate":new Ve(de.paint_symbol["text-translate"]),"text-translate-anchor":new Ve(de.paint_symbol["text-translate-anchor"])}),layout:tp};class Pu{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:kr,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}}Fe("FormatSectionOverride",Pu,{omit:["defaultValue"]});class ol extends rr{constructor(e){super(e,lc)}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),p=this._unevaluatedLayout._values[e];return p.isDataDriven()||Jn(p.value)||!h?h:function(m,g){return g.replace(/{([^{}]+)}/g,(x,w)=>w in m?String(m[w]):"")}(r.properties,h)}createBucket(e){return new Yo(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of lc.paint.overridableProperties){if(!ol.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),o=new Pu(r),c=new Lo(o,r.property.specification);let h=null;h=r.value.kind==="constant"||r.value.kind==="source"?new Qn("source",c):new xs("composite",c,r.value.zoomStops),this.paint._values[e]=new ir(r.property,h,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,o){return!(!this.layout||r.isDataDriven()||o.isDataDriven())&&ol.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const o=e.get("text-field"),c=lc.paint.properties[r];let h=!1;const p=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 Z)p(o.value.value.sections);else if(o.value.kind==="source"){const m=x=>{h||(x instanceof $e&&ae(x.value)===Yt?p(x.value.sections):x instanceof ko?p(x.sections):x.eachChild(m))},g=o.value;g._styleExpression&&m(g._styleExpression.expression)}return h}}function cc(i,e,r){let o="never";const c=i.get(e);return c?o=c:i.get(r)&&(o="always"),o}var ip={paint:new si({"background-color":new Ve(de.paint_background["background-color"]),"background-pattern":new Ps(de.paint_background["background-pattern"]),"background-opacity":new Ve(de.paint_background["background-opacity"])})},rp={paint:new si({"raster-opacity":new Ve(de.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ve(de.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ve(de.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ve(de.paint_raster["raster-brightness-max"]),"raster-saturation":new Ve(de.paint_raster["raster-saturation"]),"raster-contrast":new Ve(de.paint_raster["raster-contrast"]),"raster-resampling":new Ve(de.paint_raster["raster-resampling"]),"raster-fade-duration":new Ve(de.paint_raster["raster-fade-duration"])})};class np extends rr{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 op={circle:class extends rr{constructor(i){super(i,Bh)}createBucket(i){return new Bl(i)}queryRadius(i){const e=i;return Bs("circle-radius",this,e)+Bs("circle-stroke-width",this,e)+Na(this.paint.get("circle-translate"))}queryIntersectsFeature(i,e,r,o,c,h,p,m){const g=Ga(i,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),h.angle,p),x=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),w=this.paint.get("circle-pitch-alignment")==="map",E=w?g:function(M,z){return M.map($=>Nc($,z))}(g,m),A=w?x*p:x;for(const M of o)for(const z of M){const $=w?z:Nc(z,m);let U=A;const ee=qa([],[z.x,z.y,0,1],m);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?U*=ee[3]/h.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(U*=h.cameraToCenterDistance/ee[3]),Ph(E,$,U))return!0}return!1}},heatmap:class extends rr{constructor(i){super(i,Oh),this._updateColorRamp()}createBucket(i){return new Gc(i)}_handleSpecialPaintPropertyUpdate(i){i==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Zc({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 rr{constructor(i){super(i,Uh)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends rr{constructor(i){super(i,td)}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 Wl(i)}queryRadius(){return Na(this.paint.get("fill-translate"))}queryIntersectsFeature(i,e,r,o,c,h,p){return Lc(Ga(i,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),h.angle,p),o)}isTileClipped(){return!0}},"fill-extrusion":class extends rr{constructor(i){super(i,md)}createBucket(i){return new Kl(i)}queryRadius(){return Na(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,e,r,o,c,h,p,m){const g=Ga(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),h.angle,p),x=this.paint.get("fill-extrusion-height").evaluate(e,r),w=this.paint.get("fill-extrusion-base").evaluate(e,r),E=function(M,z,$,U){const ee=[];for(const oe of M){const Y=[oe.x,oe.y,0,1];qa(Y,Y,z),ee.push(new We(Y[0]/Y[3],Y[1]/Y[3]))}return ee}(g,m),A=function(M,z,$,U){const ee=[],oe=[],Y=U[8]*z,re=U[9]*z,fe=U[10]*z,pe=U[11]*z,Be=U[8]*$,Ue=U[9]*$,Pe=U[10]*$,Ae=U[11]*$;for(const we of M){const ke=[],Me=[];for(const be of we){const qe=be.x,Ne=be.y,rt=U[0]*qe+U[4]*Ne+U[12],Pt=U[1]*qe+U[5]*Ne+U[13],Ft=U[2]*qe+U[6]*Ne+U[14],Jt=U[3]*qe+U[7]*Ne+U[15],Ji=Ft+fe,ci=Jt+pe,jt=rt+Be,ri=Pt+Ue,ui=Ft+Pe,mi=Jt+Ae,Pi=new We((rt+Y)/ci,(Pt+re)/ci);Pi.z=Ji/ci,ke.push(Pi);const Xt=new We(jt/mi,ri/mi);Xt.z=ui/mi,Me.push(Xt)}ee.push(ke),oe.push(Me)}return[ee,oe]}(o,w,x,m);return function(M,z,$){let U=1/0;Lc($,z)&&(U=eu($,z[0]));for(let ee=0;ee<z.length;ee++){const oe=z[ee],Y=M[ee];for(let re=0;re<oe.length-1;re++){const fe=oe[re],pe=[fe,oe[re+1],Y[re+1],Y[re],fe];Dc($,pe)&&(U=Math.min(U,eu($,pe)))}}return U!==1/0&&U}(A[0],A[1],E)}},line:class extends rr{constructor(i){super(i,iu),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(i){i==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof jn,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"]=ru.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,i)}createBucket(i){return new Jl(i)}queryRadius(i){const e=i,r=nu(Bs("line-width",this,e),Bs("line-gap-width",this,e)),o=Bs("line-offset",this,e);return r/2+Math.abs(o)+Na(this.paint.get("line-translate"))}queryIntersectsFeature(i,e,r,o,c,h,p){const m=Ga(i,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),h.angle,p),g=p/2*nu(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(w,E){const A=[];for(let M=0;M<w.length;M++){const z=w[M],$=[];for(let U=0;U<z.length;U++){const ee=z[U-1],oe=z[U],Y=z[U+1],re=U===0?new We(0,0):oe.sub(ee)._unit()._perp(),fe=U===z.length-1?new We(0,0):Y.sub(oe)._unit()._perp(),pe=re._add(fe)._unit(),Be=pe.x*fe.x+pe.y*fe.y;Be!==0&&pe._mult(1/Be),$.push(pe._mult(E)._add(oe))}A.push($)}return A}(o,x*p)),function(w,E,A){for(let M=0;M<E.length;M++){const z=E[M];if(w.length>=3){for(let $=0;$<z.length;$++)if(Zo(w,z[$]))return!0}if(kh(w,z,A))return!0}return!1}(m,o,g)}isTileClipped(){return!0}},symbol:ol,background:class extends rr{constructor(i){super(i,ip)}},raster:class extends rr{constructor(i){super(i,rp)}}};class sp{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(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 ku=63710088e-1;class Nt{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 Nt(gt(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 ku*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 yo(new Nt(this.lng-o,this.lat-r),new Nt(this.lng+o,this.lat+r))}static convert(e){if(e instanceof Nt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Nt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Nt(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 yo{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 Nt?new Nt(e.lng,e.lat):Nt.convert(e),this}setSouthWest(e){return this._sw=e instanceof Nt?new Nt(e.lng,e.lat):Nt.convert(e),this}extend(e){const r=this._sw,o=this._ne;let c,h;if(e instanceof Nt)c=e,h=e;else{if(!(e instanceof yo))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(yo.convert(e)):this.extend(Nt.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 Nt(c.lng,c.lat),this._ne=new Nt(h.lng,h.lat)),this}getCenter(){return new Nt((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 Nt(this.getWest(),this.getNorth())}getSouthEast(){return new Nt(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}=Nt.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 yo?e:e&&new yo(e)}}const Du=2*Math.PI*ku;function Lu(i){return Du*Math.cos(i*Math.PI/180)}function Ru(i){return(180+i)/360}function Bu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Fu(i,e){return i/Lu(e)}function uc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class sl{constructor(e,r,o=0){this.x=+e,this.y=+r,this.z=+o}static fromLngLat(e,r=0){const o=Nt.convert(e);return new sl(Ru(o.lng),Bu(o.lat),Fu(r,o.lat))}toLngLat(){return new Nt(360*this.x-180,uc(this.y))}toAltitude(){return this.z*Lu(uc(this.y))}meterInMercatorCoordinateUnits(){return 1/Du*(e=uc(this.y),1/Math.cos(e*Math.PI/180));var e}}function Ou(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 hc{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=Xs(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=(p=this.y,m=this.z,g=Ou(256*(h=this.x),256*(p=Math.pow(2,m)-p-1),m),x=Ou(256*(h+1),256*(p+1),m),g[0]+","+g[1]+","+x[0]+","+x[1]);var h,p,m,g,x;const w=function(E,A,M){let z,$="";for(let U=E;U>0;U--)z=1<<U-1,$+=(A&z?1:0)+(M&z?2:0);return $}(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,w).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 We((e.x*r-this.x)*Kt,(e.y*r-this.y)*Kt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Uu{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Xs(e,r.z,r.z,r.x,r.y)}}class Ki{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 hc(o,+c,+h),this.key=Xs(r,e,o,c,h)}clone(){return new Ki(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new Ki(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ki(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const o=this.canonical.z-e;return e>this.canonical.z?Xs(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Xs(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 Ki(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 Ki(r,this.wrap,r,o,c),new Ki(r,this.wrap,r,o+1,c),new Ki(r,this.wrap,r,o,c+1),new Ki(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 Ki(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Ki(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 Uu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new sl(e.x-this.wrap,e.y))}}function Xs(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)}Fe("CanonicalTileID",hc),Fe("OverscaledTileID",Ki,{omit:["posMatrix"]});class $u{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 $t(`"${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 p=0;p<c;p++){const m=this.get(h,p);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 Hi({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,p=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:p=m-1;break;case 1:m=p+1}const g=-r*this.dim,x=-o*this.dim;for(let w=p;w<m;w++)for(let E=c;E<h;E++)this.data[this._idx(E,w)]=e.data[this._idx(E+g,w+x)]}}Fe("DEMData",$u);class Vu{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 Nu{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 Gu{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new co(Kt,16,0),this.grid3D=new co(Kt,16,0),this.featureIndexArray=new it,this.promoteId=r}insert(e,r,o,c,h,p){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,c,h);const g=p?this.grid3D:this.grid;for(let x=0;x<r.length;x++){const w=r[x],E=[1/0,1/0,-1/0,-1/0];for(let A=0;A<w.length;A++){const M=w[A];E[0]=Math.min(E[0],M.x),E[1]=Math.min(E[1],M.y),E[2]=Math.max(E[2],M.x),E[3]=Math.max(E[3],M.y)}E[0]<Kt&&E[1]<Kt&&E[2]>=0&&E[3]>=0&&g.insert(m,E[0],E[1],E[2],E[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Rn.VectorTile(new Yl(this.rawTileData)).layers,this.sourceLayerCoder=new Vu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,o,c){this.loadVTLayers();const h=e.params||{},p=Kt/e.tileSize/e.scale,m=Fo(h.filter),g=e.queryGeometry,x=e.queryPadding*p,w=Zu(g),E=this.grid.query(w.minX-x,w.minY-x,w.maxX+x,w.maxY+x),A=Zu(e.cameraQueryGeometry),M=this.grid3D.query(A.minX-x,A.minY-x,A.maxX+x,A.maxY+x,(U,ee,oe,Y)=>function(re,fe,pe,Be,Ue){for(const Ae of re)if(fe<=Ae.x&&pe<=Ae.y&&Be>=Ae.x&&Ue>=Ae.y)return!0;const Pe=[new We(fe,pe),new We(fe,Ue),new We(Be,Ue),new We(Be,pe)];if(re.length>2){for(const Ae of Pe)if(Zo(re,Ae))return!0}for(let Ae=0;Ae<re.length-1;Ae++)if(Lh(re[Ae],re[Ae+1],Pe))return!0;return!1}(e.cameraQueryGeometry,U-x,ee-x,oe+x,Y+x));for(const U of M)E.push(U);E.sort(ap);const z={};let $;for(let U=0;U<E.length;U++){const ee=E[U];if(ee===$)continue;$=ee;const oe=this.featureIndexArray.get(ee);let Y=null;this.loadMatchingFeature(z,oe.bucketIndex,oe.sourceLayerIndex,oe.featureIndex,m,h.layers,h.availableImages,r,o,c,(re,fe,pe)=>(Y||(Y=mo(re)),fe.queryIntersectsFeature(g,re,pe,Y,this.z,e.transform,p,e.pixelPosMatrix)))}return z}loadMatchingFeature(e,r,o,c,h,p,m,g,x,w,E){const A=this.bucketLayerIDs[r];if(p&&!function(U,ee){for(let oe=0;oe<U.length;oe++)if(ee.indexOf(U[oe])>=0)return!0;return!1}(p,A))return;const M=this.sourceLayerCoder.decode(o),z=this.vtLayers[M].feature(c);if(h.needGeometry){const U=go(z,!0);if(!h.filter(new Rt(this.tileID.overscaledZ),U,this.tileID.canonical))return}else if(!h.filter(new Rt(this.tileID.overscaledZ),z))return;const $=this.getId(z,M);for(let U=0;U<A.length;U++){const ee=A[U];if(p&&p.indexOf(ee)<0)continue;const oe=g[ee];if(!oe)continue;let Y={};$&&w&&(Y=w.getState(oe.sourceLayer||"_geojsonTileLayer",$));const re=nt({},x[ee]);re.paint=qu(re.paint,oe.paint,z,Y,m),re.layout=qu(re.layout,oe.layout,z,Y,m);const fe=!E||E(z,oe,Y);if(!fe)continue;const pe=new Nu(z,this.z,this.x,this.y,$);pe.layer=re;let Be=e[ee];Be===void 0&&(Be=e[ee]=[]),Be.push({featureIndex:c,feature:pe,intersectionZ:fe})}}lookupSymbolFeatures(e,r,o,c,h,p,m,g){const x={};this.loadVTLayers();const w=Fo(h);for(const E of e)this.loadMatchingFeature(x,o,c,E,w,p,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 qu(i,e,r,o,c){return Mt(i,(h,p)=>{const m=e instanceof po?e.get(p):null;return m&&m.evaluate?m.evaluate(r,o,c):m})}function Zu(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 ap(i,e){return e-i}var dc;Fe("FeatureIndex",Gu,{omit:["rawTileData","sourceLayerCoder"]}),l.PerformanceMarkers=void 0,(dc=l.PerformanceMarkers||(l.PerformanceMarkers={})).create="create",dc.load="load",dc.fullLoad="fullLoad";let al=null,Ws=[];const pc=1e3/30,lp={mark(i){performance.mark(i)},frame(i){const e=i;al!=null&&Ws.push(e-al),al=e},clearMetrics(){al=null,Ws=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const i in l.PerformanceMarkers)performance.clearMarks(l.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure("loadTime",l.PerformanceMarkers.create,l.PerformanceMarkers.load),performance.measure("fullLoadTime",l.PerformanceMarkers.create,l.PerformanceMarkers.fullLoad);const i=performance.getEntriesByName("loadTime")[0].duration,e=performance.getEntriesByName("fullLoadTime")[0].duration,r=Ws.length,o=1/(Ws.reduce((h,p)=>h+p,0)/r/1e3),c=Ws.filter(h=>h>pc).reduce((h,p)=>h+(p-pc)/pc,0);return{loadTime:i,fullLoadTime:e,fps:o,percentDroppedFrames:c/(r+c)*100}}};l.AJAXError=Si,l.ARRAY_TYPE=wi,l.Actor=class{constructor(i,e,r){this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Ut(["receive","process"],this),this.invoker=new sp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=pi()?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 p=un(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:i,hasCallback:!!r,targetMapId:o,mustQueue:c,sourceMapId:this.mapId,data:Yr(e,p)},p),{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 pi()||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(Rr(e.error)):r(null,Rr(e.data)))}else{let r=!1;const o=un(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?Yr(m):null,data:Yr(g,o)},o)}:m=>{r=!0};let h=null;const p=Rr(e.data);if(this.parent[e.type])h=this.parent[e.type](e.sourceMapId,p,c);else if(this.parent.getWorkerSource){const m=e.type.split(".");h=this.parent.getWorkerSource(e.sourceMapId,m[0],p.source)[m[1]](p,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)}},l.AlphaImage=Os,l.CanonicalTileID=hc,l.CollisionBoxArray=ue,l.CollisionCircleLayoutArray=class extends T{},l.Color=D,l.DEMData=$u,l.DataConstantProperty=Ve,l.DictionaryCoder=Vu,l.EXTENT=Kt,l.ErrorEvent=_n,l.EvaluationParameters=Rt,l.Event=fr,l.Evented=mr,l.FeatureIndex=Gu,l.FillBucket=Wl,l.FillExtrusionBucket=Kl,l.GeoJSONFeature=Nu,l.ImageAtlas=pu,l.ImagePosition=ec,l.LineBucket=Jl,l.LineStripIndexArray=class extends O{},l.LngLat=Nt,l.LngLatBounds=yo,l.MercatorCoordinate=sl,l.ONE_EM=ai,l.OverscaledTileID=Ki,l.PerformanceUtils=lp,l.PosArray=Ge,l.Properties=si,l.QuadTriangleArray=class extends C{},l.RGBAImage=Hi,l.RasterBoundsArray=class extends a{},l.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}},l.ResourceType=dr,l.SegmentVector=ot,l.SymbolBucket=Yo,l.Transitionable=Ba,l.TriangleIndexArray=vi,l.Uniform1f=rn,l.Uniform1i=class extends tn{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},l.Uniform2f=class extends tn{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]))}},l.Uniform3f=class extends tn{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]))}},l.Uniform4f=Go,l.UniformColor=Mc,l.UniformMatrix4f=class extends tn{constructor(i,e){super(i,e),this.current=Mh}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}}},l.UnwrappedTileID=Uu,l.ValidationError=Ce,l.ZoomHistory=Ts,l.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},l.addDynamicAttributes=oc,l.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((p,m)=>{e(p,(g,x)=>{g&&(h=g),c[m]=x,--o==0&&r(h,c)})})},l.bezier=Ee,l.bindAll=Ut,l.cacheEntryPossiblyAdded=function(i){Qi++,Qi>dn&&(i.getActor().send("enforceCacheSizeLimit",hn),Qi=0)},l.clamp=se,l.clearTileCache=function(i){const e=caches.delete(qi);i&&e.catch(i).then(()=>i())},l.clipLine=Su,l.clone=function(i){var e=new wi(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},l.clone$1=vt,l.clone$2=function(i){var e=new wi(3);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e},l.collisionCircleLayout=Id,l.config=hr,l.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},l.create=function(){var i=new wi(16);return wi!=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},l.create$1=Fc,l.createExpression=Yn,l.createFilter=Fo,l.createLayout=Zt,l.createStyleLayer=function(i){return i.type==="custom"?new np(i):new op[i.type](i)},l.cross=function(i,e,r){var o=e[0],c=e[1],h=e[2],p=r[0],m=r[1],g=r[2];return i[0]=c*g-h*m,i[1]=h*p-o*g,i[2]=o*m-c*p,i},l.dot=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]},l.dot$1=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},l.ease=Te,l.emitValidationErrors=Uo,l.enforceCacheSizeLimit=function(i){pn(),Zi&&Zi.then(e=>{e.keys().then(r=>{for(let o=0;o<r.length-i;o++)e.delete(r[o])})})},l.equals=function(i,e){var r=i[0],o=i[1],c=i[2],h=i[3],p=i[4],m=i[5],g=i[6],x=i[7],w=i[8],E=i[9],A=i[10],M=i[11],z=i[12],$=i[13],U=i[14],ee=i[15],oe=e[0],Y=e[1],re=e[2],fe=e[3],pe=e[4],Be=e[5],Ue=e[6],Pe=e[7],Ae=e[8],we=e[9],ke=e[10],Me=e[11],be=e[12],qe=e[13],Ne=e[14],rt=e[15];return Math.abs(r-oe)<=bi*Math.max(1,Math.abs(r),Math.abs(oe))&&Math.abs(o-Y)<=bi*Math.max(1,Math.abs(o),Math.abs(Y))&&Math.abs(c-re)<=bi*Math.max(1,Math.abs(c),Math.abs(re))&&Math.abs(h-fe)<=bi*Math.max(1,Math.abs(h),Math.abs(fe))&&Math.abs(p-pe)<=bi*Math.max(1,Math.abs(p),Math.abs(pe))&&Math.abs(m-Be)<=bi*Math.max(1,Math.abs(m),Math.abs(Be))&&Math.abs(g-Ue)<=bi*Math.max(1,Math.abs(g),Math.abs(Ue))&&Math.abs(x-Pe)<=bi*Math.max(1,Math.abs(x),Math.abs(Pe))&&Math.abs(w-Ae)<=bi*Math.max(1,Math.abs(w),Math.abs(Ae))&&Math.abs(E-we)<=bi*Math.max(1,Math.abs(E),Math.abs(we))&&Math.abs(A-ke)<=bi*Math.max(1,Math.abs(A),Math.abs(ke))&&Math.abs(M-Me)<=bi*Math.max(1,Math.abs(M),Math.abs(Me))&&Math.abs(z-be)<=bi*Math.max(1,Math.abs(z),Math.abs(be))&&Math.abs($-qe)<=bi*Math.max(1,Math.abs($),Math.abs(qe))&&Math.abs(U-Ne)<=bi*Math.max(1,Math.abs(U),Math.abs(Ne))&&Math.abs(ee-rt)<=bi*Math.max(1,Math.abs(ee),Math.abs(rt))},l.evaluateSizeForFeature=function(i,{uSize:e,uSizeT:r},{lowerSize:o,upperSize:c}){return i.kind==="source"?o/sn:i.kind==="composite"?Dt(o/sn,c/sn,r):e},l.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:p}=i,m=c?se(Ci.interpolationFactor(c,e,h,p),0,1):0;i.kind==="camera"?o=Dt(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:o}},l.evaluateVariableOffset=Cu,l.evented=zs,l.exported=Sr,l.exported$1=Ir,l.extend=nt,l.filterObject=ct,l.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},l.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},l.getAnchorAlignment=ic,l.getAnchorJustification=nc,l.getArrayBuffer=gn,l.getImage=Pr,l.getJSON=function(i,e){return mn(nt(i,{type:"json"}),e)},l.getOverlapMode=cc,l.getRTLTextPluginStatus=uo,l.getReferrer=Vn,l.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");Nn(i[o])||(r.crossOrigin="Anonymous"),c.src=i[o],r.appendChild(c)}return{cancel:()=>{}}},l.identity=Ul,l.invert=function(i,e){var r=e[0],o=e[1],c=e[2],h=e[3],p=e[4],m=e[5],g=e[6],x=e[7],w=e[8],E=e[9],A=e[10],M=e[11],z=e[12],$=e[13],U=e[14],ee=e[15],oe=r*m-o*p,Y=r*g-c*p,re=r*x-h*p,fe=o*g-c*m,pe=o*x-h*m,Be=c*x-h*g,Ue=w*$-E*z,Pe=w*U-A*z,Ae=w*ee-M*z,we=E*U-A*$,ke=E*ee-M*$,Me=A*ee-M*U,be=oe*Me-Y*ke+re*we+fe*Ae-pe*Pe+Be*Ue;return be?(i[0]=(m*Me-g*ke+x*we)*(be=1/be),i[1]=(c*ke-o*Me-h*we)*be,i[2]=($*Be-U*pe+ee*fe)*be,i[3]=(A*pe-E*Be-M*fe)*be,i[4]=(g*Ae-p*Me-x*Pe)*be,i[5]=(r*Me-c*Ae+h*Pe)*be,i[6]=(U*re-z*Be-ee*Y)*be,i[7]=(w*Be-A*re+M*Y)*be,i[8]=(p*ke-m*Ae+x*Ue)*be,i[9]=(o*Ae-r*ke-h*Ue)*be,i[10]=(z*pe-$*re+ee*oe)*be,i[11]=(E*re-w*pe-M*oe)*be,i[12]=(m*Pe-p*we-g*Ue)*be,i[13]=(r*we-o*Pe+c*Ue)*be,i[14]=($*Y-z*fe-U*oe)*be,i[15]=(w*fe-E*Y+A*oe)*be,i):null},l.isImageBitmap=Er,l.isSafari=un,l.isWorker=pi,l.keysDifference=function(i,e){const r=[];for(const o in i)o in e||r.push(o);return r},l.lazyLoadRTLTextPlugin=function(){Ui.isLoading()||Ui.isLoaded()||uo()!=="deferred"||Ra()},l.makeRequest=mn,l.mapObject=Mt,l.mercatorXfromLng=Ru,l.mercatorYfromLat=Bu,l.mercatorZfromAltitude=Fu,l.mul=Fh,l.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},l.multiply=Oc,l.nextPowerOfTwo=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},l.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},l.number=Dt,l.ortho=function(i,e,r,o,c,h,p){var m=1/(e-r),g=1/(o-c),x=1/(h-p);return i[0]=-2*m,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*g,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*x,i[11]=0,i[12]=(e+r)*m,i[13]=(c+o)*g,i[14]=(p+h)*x,i[15]=1,i},l.parseCacheControl=wo,l.parseGlyphPbf=function(i){return new Yl(i).readFields(Fd,[])},l.pbf=Yl,l.performSymbolLayout=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=Kt/(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 Rt(i.bucket.zoom+1),i.canonical),layoutTextSize:r["text-size"].possiblyEvaluate(new Rt(i.bucket.zoom+1),i.canonical),textMaxSize:r["text-size"].possiblyEvaluate(new Rt(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:g,maxZoom:x}=i.bucket.textSizeData;o.compositeTextSizes=[r["text-size"].possiblyEvaluate(new Rt(g),i.canonical),r["text-size"].possiblyEvaluate(new Rt(x),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:g,maxZoom:x}=i.bucket.iconSizeData;o.compositeIconSizes=[r["icon-size"].possiblyEvaluate(new Rt(g),i.canonical),r["icon-size"].possiblyEvaluate(new Rt(x),i.canonical)]}const c=e.get("text-line-height")*ai,h=e.get("text-rotation-alignment")!=="viewport"&&e.get("symbol-placement")!=="point",p=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(","),w=m.evaluate(g,{},i.canonical),E=o.layoutTextSize.evaluate(g,{},i.canonical),A=o.layoutIconSize.evaluate(g,{},i.canonical),M={horizontal:{},vertical:void 0},z=g.text;let $,U=[0,0];if(z){const Y=z.toString(),re=e.get("text-letter-spacing").evaluate(g,{},i.canonical)*ai,fe=Pl(Y)?re:0,pe=e.get("text-anchor").evaluate(g,{},i.canonical),Be=e.get("text-variable-anchor");if(!Be){const ke=e.get("text-radial-offset").evaluate(g,{},i.canonical);U=ke?Cu(pe,[ke*ai,rc]):e.get("text-offset").evaluate(g,{},i.canonical).map(Me=>Me*ai)}let Ue=h?"center":e.get("text-justify").evaluate(g,{},i.canonical);const Pe=e.get("symbol-placement"),Ae=Pe==="point"?e.get("text-max-width").evaluate(g,{},i.canonical)*ai:0,we=()=>{i.bucket.allowVerticalPlacement&&$o(Y)&&(M.vertical=Ya(z,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,pe,"left",fe,U,l.WritingMode.vertical,!0,Pe,E,w))};if(!h&&Be){const ke=Ue==="auto"?Be.map(be=>nc(be)):[Ue];let Me=!1;for(let be=0;be<ke.length;be++){const qe=ke[be];if(!M.horizontal[qe])if(Me)M.horizontal[qe]=M.horizontal[0];else{const Ne=Ya(z,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,"center",qe,fe,U,l.WritingMode.horizontal,!1,Pe,E,w);Ne&&(M.horizontal[qe]=Ne,Me=Ne.positionedLines.length===1)}}we()}else{Ue==="auto"&&(Ue=nc(pe));const ke=Ya(z,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,pe,Ue,fe,U,l.WritingMode.horizontal,!1,Pe,E,w);ke&&(M.horizontal[Ue]=ke),we(),$o(Y)&&h&&p&&(M.vertical=Ya(z,i.glyphMap,i.glyphPositions,i.imagePositions,x,Ae,c,pe,Ue,fe,U,l.WritingMode.vertical,!1,Pe,E,w))}}let ee=!1;if(g.icon&&g.icon.name){const Y=i.imageMap[g.icon.name];Y&&($=Gd(i.imagePositions[g.icon.name],e.get("icon-offset").evaluate(g,{},i.canonical),e.get("icon-anchor").evaluate(g,{},i.canonical)),ee=!!Y.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=ee:i.bucket.sdfIcons!==ee&&$t("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Y.pixelRatio!==i.bucket.pixelRatio||e.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const oe=zu(M.horizontal)||M.vertical;i.bucket.iconsInText=!!oe&&oe.iconsInText,(oe||$)&&Kd(i.bucket,g,M,$,i.imageMap,o,E,A,U,ee,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},l.perspective=function(i,e,r,o,c){var h,p=1/Math.tan(e/2);return i[0]=p/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,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},l.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},l.plugin=Ui,l.pointGeometry=We,l.polygonIntersectsPolygon=Dc,l.potpack=du,l.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],l.register=Fe,l.registerForPluginStateChange=function(i){return i({pluginStatus:xi,pluginURL:Br}),zs.on("pluginStateChange",i),i},l.renderColorRamp=Zc,l.rotateX=function(i,e,r){var o=Math.sin(r),c=Math.cos(r),h=e[4],p=e[5],m=e[6],g=e[7],x=e[8],w=e[9],E=e[10],A=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]=p*c+w*o,i[6]=m*c+E*o,i[7]=g*c+A*o,i[8]=x*c-h*o,i[9]=w*c-p*o,i[10]=E*c-m*o,i[11]=A*c-g*o,i},l.rotateZ=function(i,e,r){var o=Math.sin(r),c=Math.cos(r),h=e[0],p=e[1],m=e[2],g=e[3],x=e[4],w=e[5],E=e[6],A=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]=p*c+w*o,i[2]=m*c+E*o,i[3]=g*c+A*o,i[4]=x*c-h*o,i[5]=w*c-p*o,i[6]=E*c-m*o,i[7]=A*c-g*o,i},l.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},l.scale$1=function(i,e,r){return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i},l.setCacheLimits=function(i,e){hn=i,dn=e},l.setRTLTextPlugin=function(i,e,r=!1){if(xi===Is||xi===As||xi===Cs)throw new Error("setRTLTextPlugin cannot be called multiple times.");Br=Sr.resolveURL(i),xi=Is,Ms=e,Pn(),r||Ra()},l.spec=de,l.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)}},l.sqrLen=function(i){var e=i[0],r=i[1];return e*e+r*r},l.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},l.toEvaluationFeature=go,l.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},l.transformMat4=qa,l.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},l.translate=function(i,e,r){var o,c,h,p,m,g,x,w,E,A,M,z,$=r[0],U=r[1],ee=r[2];return e===i?(i[12]=e[0]*$+e[4]*U+e[8]*ee+e[12],i[13]=e[1]*$+e[5]*U+e[9]*ee+e[13],i[14]=e[2]*$+e[6]*U+e[10]*ee+e[14],i[15]=e[3]*$+e[7]*U+e[11]*ee+e[15]):(c=e[1],h=e[2],p=e[3],m=e[4],g=e[5],x=e[6],w=e[7],E=e[8],A=e[9],M=e[10],z=e[11],i[0]=o=e[0],i[1]=c,i[2]=h,i[3]=p,i[4]=m,i[5]=g,i[6]=x,i[7]=w,i[8]=E,i[9]=A,i[10]=M,i[11]=z,i[12]=o*$+m*U+E*ee+e[12],i[13]=c*$+g*U+A*ee+e[13],i[14]=h*$+x*U+M*ee+e[14],i[15]=p*$+w*U+z*ee+e[15]),i},l.triggerPluginCompletionEvent=La,l.unicodeBlockLookup=ze,l.uniqueId=function(){return He++},l.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},l.validateLight=ws,l.validateStyle=lo,l.vectorTile=Rn,l.warnOnce=$t,l.wrap=gt}),Q(["./shared"],function(l){function ve(L){const b=typeof L;if(b==="number"||b==="boolean"||b==="string"||L==null)return JSON.stringify(L);if(Array.isArray(L)){let D="[";for(const N of L)D+=`${ve(N)},`;return`${D}]`}const S=Object.keys(L).sort();let k="{";for(let D=0;D<S.length;D++)k+=`${JSON.stringify(S[D])}:${ve(L[S[D]])},`;return`${k}}`}function me(L){let b="";for(const S of l.refProperties)b+=`/${ve(L[S])}`;return b}class Ee{constructor(b){this.keyCache={},b&&this.replace(b)}replace(b){this._layerConfigs={},this._layers={},this.update(b,[])}update(b,S){for(const D of b){this._layerConfigs[D.id]=D;const N=this._layers[D.id]=l.createStyleLayer(D);N._featureFilter=l.createFilter(N.filter),this.keyCache[D.id]&&delete this.keyCache[D.id]}for(const D of S)delete this.keyCache[D],delete this._layerConfigs[D],delete this._layers[D];this.familiesBySource={};const k=function(D,N){const H={};for(let G=0;G<D.length;G++){const K=N&&N[D[G].id]||me(D[G]);N&&(N[D[G].id]=K);let le=H[K];le||(le=H[K]=[]),le.push(D[G])}const Z=[];for(const G in H)Z.push(H[G]);return Z}(Object.values(this._layerConfigs),this.keyCache);for(const D of k){const N=D.map(_e=>this._layers[_e.id]),H=N[0];if(H.visibility==="none")continue;const Z=H.source||"";let G=this.familiesBySource[Z];G||(G=this.familiesBySource[Z]={});const K=H.sourceLayer||"_geojsonTileLayer";let le=G[K];le||(le=G[K]=[]),le.push(N)}}}class Te{constructor(b){const S={},k=[];for(const Z in b){const G=b[Z],K=S[Z]={};for(const le in G){const _e=G[+le];if(!_e||_e.bitmap.width===0||_e.bitmap.height===0)continue;const ae={x:0,y:0,w:_e.bitmap.width+2,h:_e.bitmap.height+2};k.push(ae),K[le]={rect:ae,metrics:_e.metrics}}}const{w:D,h:N}=l.potpack(k),H=new l.AlphaImage({width:D||1,height:N||1});for(const Z in b){const G=b[Z];for(const K in G){const le=G[+K];if(!le||le.bitmap.width===0||le.bitmap.height===0)continue;const _e=S[Z][K].rect;l.AlphaImage.copy(le.bitmap,H,{x:0,y:0},{x:_e.x+1,y:_e.y+1},le.bitmap)}}this.image=H,this.positions=S}}l.register("GlyphAtlas",Te);class se{constructor(b){this.tileID=new l.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,S,k,D,N){this.status="parsing",this.data=b,this.collisionBoxArray=new l.CollisionBoxArray;const H=new l.DictionaryCoder(Object.keys(b.layers).sort()),Z=new l.FeatureIndex(this.tileID,this.promoteId);Z.bucketLayerIDs=[];const G={},K={featureIndex:Z,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:k},le=S.familiesBySource[this.source];for(const Ke in le){const tt=b.layers[Ke];if(!tt)continue;tt.version===1&&l.warnOnce(`Vector tile source "${this.source}" layer "${Ke}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ft=H.encode(Ke),St=[];for(let Qt=0;Qt<tt.length;Qt++){const kt=tt.feature(Qt),li=Z.getId(kt,Ke);St.push({feature:kt,id:li,index:Qt,sourceLayerIndex:ft})}for(const Qt of le[Ke]){const kt=Qt[0];kt.source!==this.source&&l.warnOnce(`layer.source = ${kt.source} does not equal this.source = ${this.source}`),kt.minzoom&&this.zoom<Math.floor(kt.minzoom)||kt.maxzoom&&this.zoom>=kt.maxzoom||kt.visibility!=="none"&&(gt(Qt,this.zoom,k),(G[kt.id]=kt.createBucket({index:Z.bucketLayerIDs.length,layers:Qt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ft,sourceID:this.source})).populate(St,K,this.tileID.canonical),Z.bucketLayerIDs.push(Qt.map(li=>li.id)))}}let _e,ae,Oe,$e;const De=l.mapObject(K.glyphDependencies,Ke=>Object.keys(Ke).map(Number));Object.keys(De).length?D.send("getGlyphs",{uid:this.uid,stacks:De},(Ke,tt)=>{_e||(_e=Ke,ae=tt,pt.call(this))}):ae={};const Ze=Object.keys(K.iconDependencies);Ze.length?D.send("getImages",{icons:Ze,source:this.source,tileID:this.tileID,type:"icons"},(Ke,tt)=>{_e||(_e=Ke,Oe=tt,pt.call(this))}):Oe={};const Xe=Object.keys(K.patternDependencies);function pt(){if(_e)return N(_e);if(ae&&Oe&&$e){const Ke=new Te(ae),tt=new l.ImageAtlas(Oe,$e);for(const ft in G){const St=G[ft];St instanceof l.SymbolBucket?(gt(St.layers,this.zoom,k),l.performSymbolLayout({bucket:St,glyphMap:ae,glyphPositions:Ke.positions,imageMap:Oe,imagePositions:tt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):St.hasPattern&&(St instanceof l.LineBucket||St instanceof l.FillBucket||St instanceof l.FillExtrusionBucket)&&(gt(St.layers,this.zoom,k),St.addFeatures(K,this.tileID.canonical,tt.patternPositions))}this.status="done",N(null,{buckets:Object.values(G).filter(ft=>!ft.isEmpty()),featureIndex:Z,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ke.image,imageAtlas:tt,glyphMap:this.returnDependencies?ae:null,iconMap:this.returnDependencies?Oe:null,glyphPositions:this.returnDependencies?Ke.positions:null})}}Xe.length?D.send("getImages",{icons:Xe,source:this.source,tileID:this.tileID,type:"patterns"},(Ke,tt)=>{_e||(_e=Ke,$e=tt,pt.call(this))}):$e={},pt.call(this)}}function gt(L,b,S){const k=new l.EvaluationParameters(b);for(const D of L)D.recalculate(k,S)}function nt(L,b){const S=l.getArrayBuffer(L.request,(k,D,N,H)=>{k?b(k):D&&b(null,{vectorTile:new l.vectorTile.VectorTile(new l.pbf(D)),rawData:D,cacheControl:N,expires:H})});return()=>{S.cancel(),b()}}class He{constructor(b,S,k,D){this.actor=b,this.layerIndex=S,this.availableImages=k,this.loadVectorData=D||nt,this.loading={},this.loaded={}}loadTile(b,S){const k=b.uid;this.loading||(this.loading={});const D=!!(b&&b.request&&b.request.collectResourceTiming)&&new l.RequestPerformance(b.request),N=this.loading[k]=new se(b);N.abort=this.loadVectorData(b,(H,Z)=>{if(delete this.loading[k],H||!Z)return N.status="done",this.loaded[k]=N,S(H);const G=Z.rawData,K={};Z.expires&&(K.expires=Z.expires),Z.cacheControl&&(K.cacheControl=Z.cacheControl);const le={};if(D){const _e=D.finish();_e&&(le.resourceTiming=JSON.parse(JSON.stringify(_e)))}N.vectorTile=Z.vectorTile,N.parse(Z.vectorTile,this.layerIndex,this.availableImages,this.actor,(_e,ae)=>{if(_e||!ae)return S(_e);S(null,l.extend({rawTileData:G.slice(0)},ae,K,le))}),this.loaded=this.loaded||{},this.loaded[k]=N})}reloadTile(b,S){const k=this.loaded,D=b.uid,N=this;if(k&&k[D]){const H=k[D];H.showCollisionBoxes=b.showCollisionBoxes;const Z=(G,K)=>{const le=H.reloadCallback;le&&(delete H.reloadCallback,H.parse(H.vectorTile,N.layerIndex,this.availableImages,N.actor,le)),S(G,K)};H.status==="parsing"?H.reloadCallback=Z:H.status==="done"&&(H.vectorTile?H.parse(H.vectorTile,this.layerIndex,this.availableImages,this.actor,Z):Z())}}abortTile(b,S){const k=this.loading,D=b.uid;k&&k[D]&&k[D].abort&&(k[D].abort(),delete k[D]),S()}removeTile(b,S){const k=this.loaded,D=b.uid;k&&k[D]&&delete k[D],S()}}class Ut{constructor(){this.loaded={}}loadTile(b,S){const{uid:k,encoding:D,rawImageData:N}=b,H=l.isImageBitmap(N)?this.getImageData(N):N,Z=new l.DEMData(k,H,D);this.loaded=this.loaded||{},this.loaded[k]=Z,S(null,Z)}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 S=this.offscreenCanvasContext.getImageData(-1,-1,b.width+2,b.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new l.RGBAImage({width:S.width,height:S.height},S.data)}removeTile(b){const S=this.loaded,k=b.uid;S&&S[k]&&delete S[k]}}var Mt=function L(b,S){var k,D=b&&b.type;if(D==="FeatureCollection")for(k=0;k<b.features.length;k++)L(b.features[k],S);else if(D==="GeometryCollection")for(k=0;k<b.geometries.length;k++)L(b.geometries[k],S);else if(D==="Feature")L(b.geometry,S);else if(D==="Polygon")ct(b.coordinates,S);else if(D==="MultiPolygon")for(k=0;k<b.coordinates.length;k++)ct(b.coordinates[k],S);return b};function ct(L,b){if(L.length!==0){vt(L[0],b);for(var S=1;S<L.length;S++)vt(L[S],!b)}}function vt(L,b){for(var S=0,k=0,D=0,N=L.length,H=N-1;D<N;H=D++){var Z=(L[D][0]-L[H][0])*(L[H][1]+L[D][1]),G=S+Z;k+=Math.abs(S)>=Math.abs(Z)?S-G+Z:Z-G+S,S=G}S+k>=0!=!!b&&L.reverse()}const Wt=l.vectorTile.VectorTileFeature.prototype.toGeoJSON;class $t{constructor(b){this._feature=b,this.extent=l.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 S of this._feature.geometry)b.push([new l.pointGeometry(S[0],S[1])]);return b}{const b=[];for(const S of this._feature.geometry){const k=[];for(const D of S)k.push(new l.pointGeometry(D[0],D[1]));b.push(k)}return b}}toGeoJSON(b,S,k){return Wt.call(this,b,S,k)}}class Gi{constructor(b){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.EXTENT,this.length=b.length,this._features=b}feature(b){return new $t(this._features[b])}}var Fi={exports:{}},pi=l.pointGeometry,wo=l.vectorTile.VectorTileFeature,lr=Gr;function Gr(L,b){this.options=b||{},this.features=L,this.length=L.length}function cr(L,b){this.id=typeof L.id=="number"?L.id:void 0,this.type=L.type,this.rawGeometry=L.type===1?[L.geometry]:L.geometry,this.properties=L.tags,this.extent=b||4096}Gr.prototype.feature=function(L){return new cr(this.features[L],this.options.extent)},cr.prototype.loadGeometry=function(){var L=this.rawGeometry;this.geometry=[];for(var b=0;b<L.length;b++){for(var S=L[b],k=[],D=0;D<S.length;D++)k.push(new pi(S[D][0],S[D][1]));this.geometry.push(k)}return this.geometry},cr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var L=this.geometry,b=1/0,S=-1/0,k=1/0,D=-1/0,N=0;N<L.length;N++)for(var H=L[N],Z=0;Z<H.length;Z++){var G=H[Z];b=Math.min(b,G.x),S=Math.max(S,G.x),k=Math.min(k,G.y),D=Math.max(D,G.y)}return[b,k,S,D]},cr.prototype.toGeoJSON=wo.prototype.toGeoJSON;var un=l.pbf,Er=lr;function Sr(L){var b=new un;return function(S,k){for(var D in S.layers)k.writeMessage(3,We,S.layers[D])}(L,b),b.finish()}function We(L,b){var S;b.writeVarintField(15,L.version||1),b.writeStringField(1,L.name||""),b.writeVarintField(5,L.extent||4096);var k={keys:[],values:[],keycache:{},valuecache:{}};for(S=0;S<L.length;S++)k.feature=L.feature(S),b.writeMessage(2,ur,k);var D=k.keys;for(S=0;S<D.length;S++)b.writeStringField(3,D[S]);var N=k.values;for(S=0;S<N.length;S++)b.writeMessage(4,hn,N[S])}function ur(L,b){var S=L.feature;S.id!==void 0&&b.writeVarintField(1,S.id),b.writeMessage(2,hr,L),b.writeVarintField(3,S.type),b.writeMessage(4,qr,S)}function hr(L,b){var S=L.feature,k=L.keys,D=L.values,N=L.keycache,H=L.valuecache;for(var Z in S.properties){var G=S.properties[Z],K=N[Z];if(G!==null){K===void 0&&(k.push(Z),N[Z]=K=k.length-1),b.writeVarint(K);var le=typeof G;le!=="string"&&le!=="boolean"&&le!=="number"&&(G=JSON.stringify(G));var _e=le+":"+G,ae=H[_e];ae===void 0&&(D.push(G),H[_e]=ae=D.length-1),b.writeVarint(ae)}}}function qi(L,b){return(b<<3)+(7&L)}function Zi(L){return L<<1^L>>31}function qr(L,b){for(var S=L.loadGeometry(),k=L.type,D=0,N=0,H=S.length,Z=0;Z<H;Z++){var G=S[Z],K=1;k===1&&(K=G.length),b.writeVarint(qi(1,K));for(var le=k===3?G.length-1:G.length,_e=0;_e<le;_e++){_e===1&&k!==1&&b.writeVarint(qi(2,le-1));var ae=G[_e].x-D,Oe=G[_e].y-N;b.writeVarint(Zi(ae)),b.writeVarint(Zi(Oe)),D+=ae,N+=Oe}k===3&&b.writeVarint(qi(7,1))}}function hn(L,b){var S=typeof L;S==="string"?b.writeStringField(1,L):S==="boolean"?b.writeBooleanField(7,L):S==="number"&&(L%1!=0?b.writeDoubleField(3,L):L<0?b.writeSVarintField(6,L):b.writeVarintField(5,L))}function dn(L,b,S,k,D,N){if(D-k<=S)return;const H=k+D>>1;pn(L,b,H,k,D,N%2),dn(L,b,S,k,H-1,N+1),dn(L,b,S,H+1,D,N+1)}function pn(L,b,S,k,D,N){for(;D>k;){if(D-k>600){const K=D-k+1,le=S-k+1,_e=Math.log(K),ae=.5*Math.exp(2*_e/3),Oe=.5*Math.sqrt(_e*ae*(K-ae)/K)*(le-K/2<0?-1:1);pn(L,b,S,Math.max(k,Math.floor(S-le*ae/K+Oe)),Math.min(D,Math.floor(S+(K-le)*ae/K+Oe)),N)}const H=b[2*S+N];let Z=k,G=D;for(Qi(L,b,k,S),b[2*D+N]>H&&Qi(L,b,k,D);Z<G;){for(Qi(L,b,Z,G),Z++,G--;b[2*Z+N]<H;)Z++;for(;b[2*G+N]>H;)G--}b[2*k+N]===H?Qi(L,b,k,G):(G++,Qi(L,b,G,D)),G<=S&&(k=G+1),S<=G&&(D=G-1)}}function Qi(L,b,S,k){Ir(L,S,k),Ir(b,2*S,2*k),Ir(b,2*S+1,2*k+1)}function Ir(L,b,S){const k=L[b];L[b]=L[S],L[S]=k}function Ar(L,b,S,k){const D=L-S,N=b-k;return D*D+N*N}Fi.exports=Sr,Fi.exports.fromVectorTileJs=Sr,Fi.exports.fromGeojsonVt=function(L,b){b=b||{};var S={};for(var k in L)S[k]=new Er(L[k].features,b),S[k].name=k,S[k].version=b.version,S[k].extent=b.extent;return Sr({layers:S})},Fi.exports.GeoJSONWrapper=Er;const Cr=L=>L[0],yi=L=>L[1];class fn{constructor(b,S=Cr,k=yi,D=64,N=Float64Array){this.nodeSize=D,this.points=b;const H=b.length<65536?Uint16Array:Uint32Array,Z=this.ids=new H(b.length),G=this.coords=new N(2*b.length);for(let K=0;K<b.length;K++)Z[K]=K,G[2*K]=S(b[K]),G[2*K+1]=k(b[K]);dn(Z,G,D,0,Z.length-1,0)}range(b,S,k,D){return function(N,H,Z,G,K,le,_e){const ae=[0,N.length-1,0],Oe=[];let $e,De;for(;ae.length;){const Ze=ae.pop(),Xe=ae.pop(),pt=ae.pop();if(Xe-pt<=_e){for(let ft=pt;ft<=Xe;ft++)$e=H[2*ft],De=H[2*ft+1],$e>=Z&&$e<=K&&De>=G&&De<=le&&Oe.push(N[ft]);continue}const Ke=Math.floor((pt+Xe)/2);$e=H[2*Ke],De=H[2*Ke+1],$e>=Z&&$e<=K&&De>=G&&De<=le&&Oe.push(N[Ke]);const tt=(Ze+1)%2;(Ze===0?Z<=$e:G<=De)&&(ae.push(pt),ae.push(Ke-1),ae.push(tt)),(Ze===0?K>=$e:le>=De)&&(ae.push(Ke+1),ae.push(Xe),ae.push(tt))}return Oe}(this.ids,this.coords,b,S,k,D,this.nodeSize)}within(b,S,k){return function(D,N,H,Z,G,K){const le=[0,D.length-1,0],_e=[],ae=G*G;for(;le.length;){const Oe=le.pop(),$e=le.pop(),De=le.pop();if($e-De<=K){for(let tt=De;tt<=$e;tt++)Ar(N[2*tt],N[2*tt+1],H,Z)<=ae&&_e.push(D[tt]);continue}const Ze=Math.floor((De+$e)/2),Xe=N[2*Ze],pt=N[2*Ze+1];Ar(Xe,pt,H,Z)<=ae&&_e.push(D[Ze]);const Ke=(Oe+1)%2;(Oe===0?H-G<=Xe:Z-G<=pt)&&(le.push(De),le.push(Ze-1),le.push(Ke)),(Oe===0?H+G>=Xe:Z+G>=pt)&&(le.push(Ze+1),le.push($e),le.push(Ke))}return _e}(this.ids,this.coords,b,S,k,this.nodeSize)}}const $n={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:L=>L},dr=Math.fround||(Si=new Float32Array(1),L=>(Si[0]=+L,Si[0]));var Si;class Vn{constructor(b){this.options=Pr(Object.create($n),b),this.trees=new Array(this.options.maxZoom+1)}load(b){const{log:S,minZoom:k,maxZoom:D,nodeSize:N}=this.options;S&&console.time("total time");const H=`prepare ${b.length} points`;S&&console.time(H),this.points=b;let Z=[];for(let G=0;G<b.length;G++)b[G].geometry&&Z.push(mn(b[G],G));this.trees[D+1]=new fn(Z,Gn,pr,N,Float32Array),S&&console.timeEnd(H);for(let G=D;G>=k;G--){const K=+Date.now();Z=this._cluster(Z,G),this.trees[G]=new fn(Z,Gn,pr,N,Float32Array),S&&console.log("z%d: %d clusters in %dms",G,Z.length,+Date.now()-K)}return S&&console.timeEnd("total time"),this}getClusters(b,S){let k=((b[0]+180)%360+360)%360-180;const D=Math.max(-90,Math.min(90,b[1]));let N=b[2]===180?180:((b[2]+180)%360+360)%360-180;const H=Math.max(-90,Math.min(90,b[3]));if(b[2]-b[0]>=360)k=-180,N=180;else if(k>N){const le=this.getClusters([k,D,180,H],S),_e=this.getClusters([-180,D,N,H],S);return le.concat(_e)}const Z=this.trees[this._limitZoom(S)],G=Z.range(ht(k),er(H),ht(N),er(D)),K=[];for(const le of G){const _e=Z.points[le];K.push(_e.numPoints?gn(_e):this.points[_e.index])}return K}getChildren(b){const S=this._getOriginId(b),k=this._getOriginZoom(b),D="No cluster with the specified id.",N=this.trees[k];if(!N)throw new Error(D);const H=N.points[S];if(!H)throw new Error(D);const Z=this.options.radius/(this.options.extent*Math.pow(2,k-1)),G=N.within(H.x,H.y,Z),K=[];for(const le of G){const _e=N.points[le];_e.parentId===b&&K.push(_e.numPoints?gn(_e):this.points[_e.index])}if(K.length===0)throw new Error(D);return K}getLeaves(b,S,k){const D=[];return this._appendLeaves(D,b,S=S||10,k=k||0,0),D}getTile(b,S,k){const D=this.trees[this._limitZoom(b)],N=Math.pow(2,b),{extent:H,radius:Z}=this.options,G=Z/H,K=(k-G)/N,le=(k+1+G)/N,_e={features:[]};return this._addTileFeatures(D.range((S-G)/N,K,(S+1+G)/N,le),D.points,S,k,N,_e),S===0&&this._addTileFeatures(D.range(1-G/N,K,1,le),D.points,N,k,N,_e),S===N-1&&this._addTileFeatures(D.range(0,K,G/N,le),D.points,-1,k,N,_e),_e.features.length?_e:null}getClusterExpansionZoom(b){let S=this._getOriginZoom(b)-1;for(;S<=this.options.maxZoom;){const k=this.getChildren(b);if(S++,k.length!==1)break;b=k[0].properties.cluster_id}return S}_appendLeaves(b,S,k,D,N){const H=this.getChildren(S);for(const Z of H){const G=Z.properties;if(G&&G.cluster?N+G.point_count<=D?N+=G.point_count:N=this._appendLeaves(b,G.cluster_id,k,D,N):N<D?N++:b.push(Z),b.length===k)break}return N}_addTileFeatures(b,S,k,D,N,H){for(const Z of b){const G=S[Z],K=G.numPoints;let le,_e,ae;if(K)le=Nn(G),_e=G.x,ae=G.y;else{const De=this.points[G.index];le=De.properties,_e=ht(De.geometry.coordinates[0]),ae=er(De.geometry.coordinates[1])}const Oe={type:1,geometry:[[Math.round(this.options.extent*(_e*N-k)),Math.round(this.options.extent*(ae*N-D))]],tags:le};let $e;K?$e=G.id:this.options.generateId?$e=G.index:this.points[G.index].id&&($e=this.points[G.index].id),$e!==void 0&&(Oe.id=$e),H.features.push(Oe)}}_limitZoom(b){return Math.max(this.options.minZoom,Math.min(Math.floor(+b),this.options.maxZoom+1))}_cluster(b,S){const k=[],{radius:D,extent:N,reduce:H,minPoints:Z}=this.options,G=D/(N*Math.pow(2,S));for(let K=0;K<b.length;K++){const le=b[K];if(le.zoom<=S)continue;le.zoom=S;const _e=this.trees[S+1],ae=_e.within(le.x,le.y,G),Oe=le.numPoints||1;let $e=Oe;for(const De of ae){const Ze=_e.points[De];Ze.zoom>S&&($e+=Ze.numPoints||1)}if($e>Oe&&$e>=Z){let De=le.x*Oe,Ze=le.y*Oe,Xe=H&&Oe>1?this._map(le,!0):null;const pt=(K<<5)+(S+1)+this.points.length;for(const Ke of ae){const tt=_e.points[Ke];if(tt.zoom<=S)continue;tt.zoom=S;const ft=tt.numPoints||1;De+=tt.x*ft,Ze+=tt.y*ft,tt.parentId=pt,H&&(Xe||(Xe=this._map(le,!0)),H(Xe,this._map(tt)))}le.parentId=pt,k.push(Mr(De/$e,Ze/$e,pt,$e,Xe))}else if(k.push(le),$e>1)for(const De of ae){const Ze=_e.points[De];Ze.zoom<=S||(Ze.zoom=S,k.push(Ze))}}return k}_getOriginId(b){return b-this.points.length>>5}_getOriginZoom(b){return(b-this.points.length)%32}_map(b,S){if(b.numPoints)return S?Pr({},b.properties):b.properties;const k=this.points[b.index].properties,D=this.options.map(k);return S&&D===k?Pr({},D):D}}function Mr(L,b,S,k,D){return{x:dr(L),y:dr(b),zoom:1/0,id:S,parentId:-1,numPoints:k,properties:D}}function mn(L,b){const[S,k]=L.geometry.coordinates;return{x:dr(ht(S)),y:dr(er(k)),zoom:1/0,index:b,parentId:-1}}function gn(L){return{type:"Feature",id:L.id,properties:Nn(L),geometry:{type:"Point",coordinates:[(b=L.x,360*(b-.5)),zr(L.y)]}};var b}function Nn(L){const b=L.numPoints,S=b>=1e4?`${Math.round(b/1e3)}k`:b>=1e3?Math.round(b/100)/10+"k":b;return Pr(Pr({},L.properties),{cluster:!0,cluster_id:L.id,point_count:b,point_count_abbreviated:S})}function ht(L){return L/360+.5}function er(L){const b=Math.sin(L*Math.PI/180),S=.5-.25*Math.log((1+b)/(1-b))/Math.PI;return S<0?0:S>1?1:S}function zr(L){const b=(180-360*L)*Math.PI/180;return 360*Math.atan(Math.exp(b))/Math.PI-90}function Pr(L,b){for(const S in b)L[S]=b[S];return L}function Gn(L){return L.x}function pr(L){return L.y}function fr(L,b,S,k){for(var D,N=k,H=S-b>>1,Z=S-b,G=L[b],K=L[b+1],le=L[S],_e=L[S+1],ae=b+3;ae<S;ae+=3){var Oe=_n(L[ae],L[ae+1],G,K,le,_e);if(Oe>N)D=ae,N=Oe;else if(Oe===N){var $e=Math.abs(ae-H);$e<Z&&(D=ae,Z=$e)}}N>k&&(D-b>3&&fr(L,b,D,k),L[D+2]=N,S-D>3&&fr(L,D,S,k))}function _n(L,b,S,k,D,N){var H=D-S,Z=N-k;if(H!==0||Z!==0){var G=((L-S)*H+(b-k)*Z)/(H*H+Z*Z);G>1?(S=D,k=N):G>0&&(S+=H*G,k+=Z*G)}return(H=L-S)*H+(Z=b-k)*Z}function mr(L,b,S,k){var D={id:L===void 0?null:L,type:b,geometry:S,tags:k,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(N){var H=N.geometry,Z=N.type;if(Z==="Point"||Z==="MultiPoint"||Z==="LineString")de(N,H);else if(Z==="Polygon"||Z==="MultiLineString")for(var G=0;G<H.length;G++)de(N,H[G]);else if(Z==="MultiPolygon")for(G=0;G<H.length;G++)for(var K=0;K<H[G].length;K++)de(N,H[G][K])}(D),D}function de(L,b){for(var S=0;S<b.length;S+=3)L.minX=Math.min(L.minX,b[S]),L.minY=Math.min(L.minY,b[S+1]),L.maxX=Math.max(L.maxX,b[S]),L.maxY=Math.max(L.maxY,b[S+1])}function Ce(L,b,S,k){if(b.geometry){var D=b.geometry.coordinates,N=b.geometry.type,H=Math.pow(S.tolerance/((1<<S.maxZoom)*S.extent),2),Z=[],G=b.id;if(S.promoteId?G=b.properties[S.promoteId]:S.generateId&&(G=k||0),N==="Point")Zr(D,Z);else if(N==="MultiPoint")for(var K=0;K<D.length;K++)Zr(D[K],Z);else if(N==="LineString")ji(D,Z,H,!1);else if(N==="MultiLineString"){if(S.lineMetrics){for(K=0;K<D.length;K++)ji(D[K],Z=[],H,!1),L.push(mr(G,"LineString",Z,b.properties));return}dt(D,Z,H,!1)}else if(N==="Polygon")dt(D,Z,H,!0);else{if(N!=="MultiPolygon"){if(N==="GeometryCollection"){for(K=0;K<b.geometry.geometries.length;K++)Ce(L,{id:G,geometry:b.geometry.geometries[K],properties:b.properties},S,k);return}throw new Error("Input data is not a valid GeoJSON object.")}for(K=0;K<D.length;K++){var le=[];dt(D[K],le,H,!0),Z.push(le)}}L.push(mr(G,N,Z,b.properties))}}function Zr(L,b){b.push(Oi(L[0])),b.push(Ii(L[1])),b.push(0)}function ji(L,b,S,k){for(var D,N,H=0,Z=0;Z<L.length;Z++){var G=Oi(L[Z][0]),K=Ii(L[Z][1]);b.push(G),b.push(K),b.push(0),Z>0&&(H+=k?(D*K-G*N)/2:Math.sqrt(Math.pow(G-D,2)+Math.pow(K-N,2))),D=G,N=K}var le=b.length-3;b[2]=1,fr(b,0,le,S),b[le+2]=1,b.size=Math.abs(H),b.start=0,b.end=b.size}function dt(L,b,S,k){for(var D=0;D<L.length;D++){var N=[];ji(L[D],N,S,k),b.push(N)}}function Oi(L){return L/360+.5}function Ii(L){var b=Math.sin(L*Math.PI/180),S=.5-.25*Math.log((1+b)/(1-b))/Math.PI;return S<0?0:S>1?1:S}function Ai(L,b,S,k,D,N,H,Z){if(k/=b,N>=(S/=b)&&H<k)return L;if(H<S||N>=k)return null;for(var G=[],K=0;K<L.length;K++){var le=L[K],_e=le.geometry,ae=le.type,Oe=D===0?le.minX:le.minY,$e=D===0?le.maxX:le.maxY;if(Oe>=S&&$e<k)G.push(le);else if(!($e<S||Oe>=k)){var De=[];if(ae==="Point"||ae==="MultiPoint")kr(_e,De,S,k,D);else if(ae==="LineString")Se(_e,De,S,k,D,!1,Z.lineMetrics);else if(ae==="MultiLineString")Ye(_e,De,S,k,D,!1);else if(ae==="Polygon")Ye(_e,De,S,k,D,!0);else if(ae==="MultiPolygon")for(var Ze=0;Ze<_e.length;Ze++){var Xe=[];Ye(_e[Ze],Xe,S,k,D,!0),Xe.length&&De.push(Xe)}if(De.length){if(Z.lineMetrics&&ae==="LineString"){for(Ze=0;Ze<De.length;Ze++)G.push(mr(le.id,ae,De[Ze],le.tags));continue}ae!=="LineString"&&ae!=="MultiLineString"||(De.length===1?(ae="LineString",De=De[0]):ae="MultiLineString"),ae!=="Point"&&ae!=="MultiPoint"||(ae=De.length===3?"Point":"MultiPoint"),G.push(mr(le.id,ae,De,le.tags))}}}return G.length?G:null}function kr(L,b,S,k,D){for(var N=0;N<L.length;N+=3){var H=L[N+D];H>=S&&H<=k&&(b.push(L[N]),b.push(L[N+1]),b.push(L[N+2]))}}function Se(L,b,S,k,D,N,H){for(var Z,G,K=et(L),le=D===0?Dr:Je,_e=L.start,ae=0;ae<L.length-3;ae+=3){var Oe=L[ae],$e=L[ae+1],De=L[ae+2],Ze=L[ae+3],Xe=L[ae+4],pt=D===0?Oe:$e,Ke=D===0?Ze:Xe,tt=!1;H&&(Z=Math.sqrt(Math.pow(Oe-Ze,2)+Math.pow($e-Xe,2))),pt<S?Ke>S&&(G=le(K,Oe,$e,Ze,Xe,S),H&&(K.start=_e+Z*G)):pt>k?Ke<k&&(G=le(K,Oe,$e,Ze,Xe,k),H&&(K.start=_e+Z*G)):oi(K,Oe,$e,De),Ke<S&&pt>=S&&(G=le(K,Oe,$e,Ze,Xe,S),tt=!0),Ke>k&&pt<=k&&(G=le(K,Oe,$e,Ze,Xe,k),tt=!0),!N&&tt&&(H&&(K.end=_e+Z*G),b.push(K),K=et(L)),H&&(_e+=Z)}var ft=L.length-3;Oe=L[ft],$e=L[ft+1],De=L[ft+2],(pt=D===0?Oe:$e)>=S&&pt<=k&&oi(K,Oe,$e,De),ft=K.length-3,N&&ft>=3&&(K[ft]!==K[0]||K[ft+1]!==K[1])&&oi(K,K[0],K[1],K[2]),K.length&&b.push(K)}function et(L){var b=[];return b.size=L.size,b.start=L.start,b.end=L.end,b}function Ye(L,b,S,k,D,N){for(var H=0;H<L.length;H++)Se(L[H],b,S,k,D,N,!1)}function oi(L,b,S,k){L.push(b),L.push(S),L.push(k)}function Dr(L,b,S,k,D,N){var H=(N-b)/(k-b);return L.push(N),L.push(S+(D-S)*H),L.push(1),H}function Je(L,b,S,k,D,N){var H=(N-S)/(D-S);return L.push(b+(k-b)*H),L.push(N),L.push(1),H}function gr(L,b){for(var S=[],k=0;k<L.length;k++){var D,N=L[k],H=N.type;if(H==="Point"||H==="MultiPoint"||H==="LineString")D=Yt(N.geometry,b);else if(H==="MultiLineString"||H==="Polygon"){D=[];for(var Z=0;Z<N.geometry.length;Z++)D.push(Yt(N.geometry[Z],b))}else if(H==="MultiPolygon")for(D=[],Z=0;Z<N.geometry.length;Z++){for(var G=[],K=0;K<N.geometry[Z].length;K++)G.push(Yt(N.geometry[Z][K],b));D.push(G)}S.push(mr(N.id,H,D,N.tags))}return S}function Yt(L,b){var S=[];S.size=L.size,L.start!==void 0&&(S.start=L.start,S.end=L.end);for(var k=0;k<L.length;k+=3)S.push(L[k]+b,L[k+1],L[k+2]);return S}function yn(L,b){if(L.transformed)return L;var S,k,D,N=1<<L.z,H=L.x,Z=L.y;for(S=0;S<L.features.length;S++){var G=L.features[S],K=G.geometry,le=G.type;if(G.geometry=[],le===1)for(k=0;k<K.length;k+=2)G.geometry.push(qt(K[k],K[k+1],b,N,H,Z));else for(k=0;k<K.length;k++){var _e=[];for(D=0;D<K[k].length;D+=2)_e.push(qt(K[k][D],K[k][D+1],b,N,H,Z));G.geometry.push(_e)}}return L.transformed=!0,L}function qt(L,b,S,k,D,N){return[Math.round(S*(L*k-D)),Math.round(S*(b*k-N))]}function fi(L,b,S,k,D){for(var N=b===D.maxZoom?0:D.tolerance/((1<<b)*D.extent),H={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:S,y:k,z:b,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Z=0;Z<L.length;Z++){H.numFeatures++,Tt(H,L[Z],N,D);var G=L[Z].minX,K=L[Z].minY,le=L[Z].maxX,_e=L[Z].maxY;G<H.minX&&(H.minX=G),K<H.minY&&(H.minY=K),le>H.maxX&&(H.maxX=le),_e>H.maxY&&(H.maxY=_e)}return H}function Tt(L,b,S,k){var D=b.geometry,N=b.type,H=[];if(N==="Point"||N==="MultiPoint")for(var Z=0;Z<D.length;Z+=3)H.push(D[Z]),H.push(D[Z+1]),L.numPoints++,L.numSimplified++;else if(N==="LineString")xn(H,D,L,S,!1,!1);else if(N==="MultiLineString"||N==="Polygon")for(Z=0;Z<D.length;Z++)xn(H,D[Z],L,S,N==="Polygon",Z===0);else if(N==="MultiPolygon")for(var G=0;G<D.length;G++){var K=D[G];for(Z=0;Z<K.length;Z++)xn(H,K[Z],L,S,!0,Z===0)}if(H.length){var le=b.tags||null;if(N==="LineString"&&k.lineMetrics){for(var _e in le={},b.tags)le[_e]=b.tags[_e];le.mapbox_clip_start=D.start/D.size,le.mapbox_clip_end=D.end/D.size}var ae={geometry:H,type:N==="Polygon"||N==="MultiPolygon"?3:N==="LineString"||N==="MultiLineString"?2:1,tags:le};b.id!==null&&(ae.id=b.id),L.features.push(ae)}}function xn(L,b,S,k,D,N){var H=k*k;if(k>0&&b.size<(D?H:k))S.numPoints+=b.length/3;else{for(var Z=[],G=0;G<b.length;G+=3)(k===0||b[G+2]>H)&&(S.numSimplified++,Z.push(b[G]),Z.push(b[G+1])),S.numPoints++;D&&function(K,le){for(var _e=0,ae=0,Oe=K.length,$e=Oe-2;ae<Oe;$e=ae,ae+=2)_e+=(K[ae]-K[$e])*(K[ae+1]+K[$e+1]);if(_e>0===le)for(ae=0,Oe=K.length;ae<Oe/2;ae+=2){var De=K[ae],Ze=K[ae+1];K[ae]=K[Oe-2-ae],K[ae+1]=K[Oe-1-ae],K[Oe-2-ae]=De,K[Oe-1-ae]=Ze}}(Z,N),L.push(Z)}}function tr(L,b){var S=(b=this.options=function(D,N){for(var H in N)D[H]=N[H];return D}(Object.create(this.options),b)).debug;if(S&&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 k=function(D,N){var H=[];if(D.type==="FeatureCollection")for(var Z=0;Z<D.features.length;Z++)Ce(H,D.features[Z],N,Z);else Ce(H,D.type==="Feature"?D:{geometry:D},N);return H}(L,b);this.tiles={},this.tileCoords=[],S&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",b.indexMaxZoom,b.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),k=function(D,N){var H=N.buffer/N.extent,Z=D,G=Ai(D,1,-1-H,H,0,-1,2,N),K=Ai(D,1,1-H,2+H,0,-1,2,N);return(G||K)&&(Z=Ai(D,1,-H,1+H,0,-1,2,N)||[],G&&(Z=gr(G,1).concat(Z)),K&&(Z=Z.concat(gr(K,-1)))),Z}(k,b),k.length&&this.splitTile(k,0,0,0),S&&(k.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 jr(L,b,S){return 32*((1<<L)*S+b)+L}function Xr(L,b){const S=L.tileID.canonical;if(!this._geoJSONIndex)return b(null,null);const k=this._geoJSONIndex.getTile(S.z,S.x,S.y);if(!k)return b(null,null);const D=new Gi(k.features);let N=Fi.exports(D);N.byteOffset===0&&N.byteLength===N.buffer.byteLength||(N=new Uint8Array(N)),b(null,{vectorTile:D,rawData:N.buffer})}tr.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},tr.prototype.splitTile=function(L,b,S,k,D,N,H){for(var Z=[L,b,S,k],G=this.options,K=G.debug;Z.length;){k=Z.pop(),S=Z.pop(),b=Z.pop(),L=Z.pop();var le=1<<b,_e=jr(b,S,k),ae=this.tiles[_e];if(!ae&&(K>1&&console.time("creation"),ae=this.tiles[_e]=fi(L,b,S,k,G),this.tileCoords.push({z:b,x:S,y:k}),K)){K>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",b,S,k,ae.numFeatures,ae.numPoints,ae.numSimplified),console.timeEnd("creation"));var Oe="z"+b;this.stats[Oe]=(this.stats[Oe]||0)+1,this.total++}if(ae.source=L,D){if(b===G.maxZoom||b===D)continue;var $e=1<<D-b;if(S!==Math.floor(N/$e)||k!==Math.floor(H/$e))continue}else if(b===G.indexMaxZoom||ae.numPoints<=G.indexMaxPoints)continue;if(ae.source=null,L.length!==0){K>1&&console.time("clipping");var De,Ze,Xe,pt,Ke,tt,ft=.5*G.buffer/G.extent,St=.5-ft,Qt=.5+ft,kt=1+ft;De=Ze=Xe=pt=null,Ke=Ai(L,le,S-ft,S+Qt,0,ae.minX,ae.maxX,G),tt=Ai(L,le,S+St,S+kt,0,ae.minX,ae.maxX,G),L=null,Ke&&(De=Ai(Ke,le,k-ft,k+Qt,1,ae.minY,ae.maxY,G),Ze=Ai(Ke,le,k+St,k+kt,1,ae.minY,ae.maxY,G),Ke=null),tt&&(Xe=Ai(tt,le,k-ft,k+Qt,1,ae.minY,ae.maxY,G),pt=Ai(tt,le,k+St,k+kt,1,ae.minY,ae.maxY,G),tt=null),K>1&&console.timeEnd("clipping"),Z.push(De||[],b+1,2*S,2*k),Z.push(Ze||[],b+1,2*S,2*k+1),Z.push(Xe||[],b+1,2*S+1,2*k),Z.push(pt||[],b+1,2*S+1,2*k+1)}}},tr.prototype.getTile=function(L,b,S){var k=this.options,D=k.extent,N=k.debug;if(L<0||L>24)return null;var H=1<<L,Z=jr(L,b=(b%H+H)%H,S);if(this.tiles[Z])return yn(this.tiles[Z],D);N>1&&console.log("drilling down to z%d-%d-%d",L,b,S);for(var G,K=L,le=b,_e=S;!G&&K>0;)K--,le=Math.floor(le/2),_e=Math.floor(_e/2),G=this.tiles[jr(K,le,_e)];return G&&G.source?(N>1&&console.log("found parent tile z%d-%d-%d",K,le,_e),N>1&&console.time("drilling down"),this.splitTile(G.source,K,le,_e,L,b,S),N>1&&console.timeEnd("drilling down"),this.tiles[Z]?yn(this.tiles[Z],D):null):null};class vn extends He{constructor(b,S,k,D){super(b,S,k,Xr),D&&(this.loadGeoJSON=D)}loadData(b,S){var k;(k=this._pendingRequest)===null||k===void 0||k.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const D=!!(b&&b.request&&b.request.collectResourceTiming)&&new l.RequestPerformance(b.request);this._pendingCallback=S,this._pendingRequest=this.loadGeoJSON(b,(N,H)=>{if(delete this._pendingCallback,delete this._pendingRequest,N||!H)return S(N);if(typeof H!="object")return S(new Error(`Input data given to '${b.source}' is not a valid GeoJSON object.`));{Mt(H,!0);try{if(b.filter){const G=l.createExpression(b.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(G.result==="error")throw new Error(G.value.map(le=>`${le.key}: ${le.message}`).join(", "));H={type:"FeatureCollection",features:H.features.filter(le=>G.value.evaluate({zoom:0},le))}}this._geoJSONIndex=b.cluster?new Vn(function({superclusterOptions:G,clusterProperties:K}){if(!K||!G)return G;const le={},_e={},ae={accumulated:null,zoom:0},Oe={properties:null},$e=Object.keys(K);for(const De of $e){const[Ze,Xe]=K[De],pt=l.createExpression(Xe),Ke=l.createExpression(typeof Ze=="string"?[Ze,["accumulated"],["get",De]]:Ze);le[De]=pt.value,_e[De]=Ke.value}return G.map=De=>{Oe.properties=De;const Ze={};for(const Xe of $e)Ze[Xe]=le[Xe].evaluate(ae,Oe);return Ze},G.reduce=(De,Ze)=>{Oe.properties=Ze;for(const Xe of $e)ae.accumulated=De[Xe],De[Xe]=_e[Xe].evaluate(ae,Oe)},G}(b)).load(H.features):function(G,K){return new tr(G,K)}(H,b.geojsonVtOptions)}catch(G){return S(G)}this.loaded={};const Z={};if(D){const G=D.finish();G&&(Z.resourceTiming={},Z.resourceTiming[b.source]=JSON.parse(JSON.stringify(G)))}S(null,Z)}})}reloadTile(b,S){const k=this.loaded;return k&&k[b.uid]?super.reloadTile(b,S):this.loadTile(b,S)}loadGeoJSON(b,S){if(b.request)return l.getJSON(b.request,S);if(typeof b.data=="string")try{S(null,JSON.parse(b.data))}catch(k){S(new Error(`Input data given to '${b.source}' is not a valid GeoJSON object.`))}else S(new Error(`Input data given to '${b.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(b,S){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),S()}getClusterExpansionZoom(b,S){try{S(null,this._geoJSONIndex.getClusterExpansionZoom(b.clusterId))}catch(k){S(k)}}getClusterChildren(b,S){try{S(null,this._geoJSONIndex.getChildren(b.clusterId))}catch(k){S(k)}}getClusterLeaves(b,S){try{S(null,this._geoJSONIndex.getLeaves(b.clusterId,b.limit,b.offset))}catch(k){S(k)}}}class Wr{constructor(b){this.self=b,this.actor=new l.Actor(b,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:He,geojson:vn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(S,k)=>{if(this.workerSourceTypes[S])throw new Error(`Worker source with name "${S}" already registered.`);this.workerSourceTypes[S]=k},this.self.registerRTLTextPlugin=S=>{if(l.plugin.isParsed())throw new Error("RTL text plugin already registered.");l.plugin.applyArabicShaping=S.applyArabicShaping,l.plugin.processBidirectionalText=S.processBidirectionalText,l.plugin.processStyledBidirectionalText=S.processStyledBidirectionalText}}setReferrer(b,S){this.referrer=S}setImages(b,S,k){this.availableImages[b]=S;for(const D in this.workerSources[b]){const N=this.workerSources[b][D];for(const H in N)N[H].availableImages=S}k()}setLayers(b,S,k){this.getLayerIndex(b).replace(S),k()}updateLayers(b,S,k){this.getLayerIndex(b).update(S.layers,S.removedIds),k()}loadTile(b,S,k){this.getWorkerSource(b,S.type,S.source).loadTile(S,k)}loadDEMTile(b,S,k){this.getDEMWorkerSource(b,S.source).loadTile(S,k)}reloadTile(b,S,k){this.getWorkerSource(b,S.type,S.source).reloadTile(S,k)}abortTile(b,S,k){this.getWorkerSource(b,S.type,S.source).abortTile(S,k)}removeTile(b,S,k){this.getWorkerSource(b,S.type,S.source).removeTile(S,k)}removeDEMTile(b,S){this.getDEMWorkerSource(b,S.source).removeTile(S)}removeSource(b,S,k){if(!this.workerSources[b]||!this.workerSources[b][S.type]||!this.workerSources[b][S.type][S.source])return;const D=this.workerSources[b][S.type][S.source];delete this.workerSources[b][S.type][S.source],D.removeSource!==void 0?D.removeSource(S,k):k()}loadWorkerSource(b,S,k){try{this.self.importScripts(S.url),k()}catch(D){k(D.toString())}}syncRTLPluginState(b,S,k){try{l.plugin.setState(S);const D=l.plugin.getPluginURL();if(l.plugin.isLoaded()&&!l.plugin.isParsed()&&D!=null){this.self.importScripts(D);const N=l.plugin.isParsed();k(N?void 0:new Error(`RTL Text Plugin failed to import scripts from ${D}`),N)}}catch(D){k(D.toString())}}getAvailableImages(b){let S=this.availableImages[b];return S||(S=[]),S}getLayerIndex(b){let S=this.layerIndexes[b];return S||(S=this.layerIndexes[b]=new Ee),S}getWorkerSource(b,S,k){if(this.workerSources[b]||(this.workerSources[b]={}),this.workerSources[b][S]||(this.workerSources[b][S]={}),!this.workerSources[b][S][k]){const D={send:(N,H,Z)=>{this.actor.send(N,H,Z,b)}};this.workerSources[b][S][k]=new this.workerSourceTypes[S](D,this.getLayerIndex(b),this.getAvailableImages(b))}return this.workerSources[b][S][k]}getDEMWorkerSource(b,S){return this.demWorkerSources[b]||(this.demWorkerSources[b]={}),this.demWorkerSources[b][S]||(this.demWorkerSources[b][S]=new Ut),this.demWorkerSources[b][S]}enforceCacheSizeLimit(b,S){l.enforceCacheSizeLimit(S)}}return l.isWorker()&&(self.worker=new Wr(self)),Wr}),Q(["./shared"],function(l){var ve=me;function me(a){return!function(t){return typeof window>"u"||typeof document>"u"?"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,d=new Blob([""],{type:"text/javascript"}),f=URL.createObjectURL(d);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 d=u.getImageData(0,0,1,1);return d&&d.width===s.width}()?(Ee[n=t&&t.failIfMajorPerformanceCaveat]===void 0&&(Ee[n]=function(s){var u,d=function(f){var _=document.createElement("canvas"),y=Object.create(me.webGLContextAttributes);return y.failIfMajorPerformanceCaveat=f,_.getContext("webgl",y)||_.getContext("experimental-webgl",y)}(s);if(!d)return!1;try{u=d.createShader(d.VERTEX_SHADER)}catch(f){return!1}return!(!u||d.isContextLost())&&(d.shaderSource(u,"void main() {}"),d.compileShader(u),d.getShaderParameter(u,d.COMPILE_STATUS)===!0)}(n)),Ee[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}(a)}var Ee={};function Te(a,t){if(Array.isArray(a)){if(!Array.isArray(t)||a.length!==t.length)return!1;for(let n=0;n<a.length;n++)if(!Te(a[n],t[n]))return!1;return!0}if(typeof a=="object"&&a!==null&&t!==null){if(typeof t!="object"||Object.keys(a).length!==Object.keys(t).length)return!1;for(const n in a)if(!Te(a[n],t[n]))return!1;return!0}return a===t}me.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class se{static testProp(t){if(!se.docStyle)return t[0];for(let n=0;n<t.length;n++)if(t[n]in se.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(){se.docStyle&&se.selectProp&&(se.userSelect=se.docStyle[se.selectProp],se.docStyle[se.selectProp]="none")}static enableDrag(){se.docStyle&&se.selectProp&&(se.docStyle[se.selectProp]=se.userSelect)}static setTransform(t,n){t.style[se.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",se.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",se.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",se.suppressClickInternal,!0)},0)}static mousePos(t,n){const s=t.getBoundingClientRect();return new l.pointGeometry(n.clientX-s.left-t.clientLeft,n.clientY-s.top-t.clientTop)}static touchPos(t,n){const s=t.getBoundingClientRect(),u=[];for(let d=0;d<n.length;d++)u.push(new l.pointGeometry(n[d].clientX-s.left-t.clientLeft,n[d].clientY-s.top-t.clientTop));return u}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}se.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,se.selectProp=se.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),se.transformProp=se.testProp(["transform","WebkitTransform"]);class gt{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,s){const u=function(d){const f=d.match(nt);if(!f)throw new Error(`Unable to parse URL "${d}"`);return{protocol:f[1],authority:f[2],path:f[3]||"/",params:f[4]?f[4].split("&"):[]}}(t);return u.path+=`${n}${s}`,function(d){const f=d.params.length?`?${d.params.join("&")}`:"";return`${d.protocol}://${d.authority}${d.path}${f}`}(u)}setTransformRequest(t){this._transformRequestFn=t}}const nt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;class He{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:d}=t,f=!(this.size&&this.size[0]===u&&this.size[1]===d||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,d],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.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,d,0,this.format,y.UNSIGNED_BYTE,t.data);else{const{x:v,y:T}=s||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.isImageBitmap(t)?y.texSubImage2D(y.TEXTURE_2D,0,v,T,y.RGBA,y.UNSIGNED_BYTE,t):y.texSubImage2D(y.TEXTURE_2D,0,v,T,u,d,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:d}=u;d.bindTexture(d.TEXTURE_2D,this.texture),s!==d.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=d.LINEAR),t!==this.filter&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,s||t),this.filter=t),n!==this.wrap&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,n),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function Ut(a){const{userImage:t}=a;return!!(t&&t.render&&t.render())&&(a.data.replace(new Uint8Array(t.data.buffer)),!0)}class Mt extends l.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.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 l.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new l.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new l.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 l.Event("styleimagemissing",{id:u}));const d=this.images[u];d?s[u]={data:d.data.clone(),pixelRatio:d.pixelRatio,sdf:d.sdf,version:d.version,stretchX:d.stretchX,stretchY:d.stretchY,content:d.content,hasRenderCallback:Boolean(d.userImage&&d.userImage.render)}:l.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},d=new l.ImagePosition(u,s);this.patterns[t]={bin:u,position:d}}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 He(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const d in this.patterns)t.push(this.patterns[d].bin);const{w:n,h:s}=l.potpack(t),u=this.atlasImage;u.resize({width:n||1,height:s||1});for(const d in this.patterns){const{bin:f}=this.patterns[d],_=f.x+1,y=f.y+1,v=this.images[d].data,T=v.width,I=v.height;l.RGBAImage.copy(v,u,{x:0,y:0},{x:_,y},{width:T,height:I}),l.RGBAImage.copy(v,u,{x:0,y:I-1},{x:_,y:y-1},{width:T,height:1}),l.RGBAImage.copy(v,u,{x:0,y:0},{x:_,y:y+I},{width:T,height:1}),l.RGBAImage.copy(v,u,{x:T-1,y:0},{x:_-1,y},{width:1,height:I}),l.RGBAImage.copy(v,u,{x:0,y:0},{x:_+T,y},{width:1,height:I})}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||l.warnOnce(`Image with ID: "${n}" was not found`),Ut(s)&&this.updateImage(n,s)}}}const ct=1e20;function vt(a,t,n,s,u,d,f,_,y){for(let v=t;v<t+s;v++)Wt(a,n*d+v,d,u,f,_,y);for(let v=n;v<n+u;v++)Wt(a,v*d+t,1,s,f,_,y)}function Wt(a,t,n,s,u,d,f){d[0]=0,f[0]=-ct,f[1]=ct,u[0]=a[t];for(let _=1,y=0,v=0;_<s;_++){u[_]=a[t+_*n];const T=_*_;do{const I=d[y];v=(u[_]-u[I]+T-I*I)/(_-I)/2}while(v<=f[y]&&--y>-1);y++,d[y]=_,f[y]=v,f[y+1]=ct}for(let _=0,y=0;_<s;_++){for(;f[y+1]<_;)y++;const v=d[y],T=_-v;a[t+_*n]=u[v]+T*T}}class $t{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 d of t[u])s.push({stack:u,id:d});l.asyncAll(s,({stack:u,id:d},f)=>{let _=this.entries[u];_||(_=this.entries[u]={glyphs:{},requests:{},ranges:{}});let y=_.glyphs[d];if(y!==void 0)return void f(null,{stack:u,id:d,glyph:y});if(y=this._tinySDF(_,u,d),y)return _.glyphs[d]=y,void f(null,{stack:u,id:d,glyph:y});const v=Math.floor(d/256);if(256*v>65535)return void f(new Error("glyphs > 65535 not supported"));if(_.ranges[v])return void f(null,{stack:u,id:d,glyph:y});let T=_.requests[v];T||(T=_.requests[v]=[],$t.loadGlyphRange(u,v,this.url,this.requestManager,(I,C)=>{if(C){for(const F in C)this._doesCharSupportLocalGlyph(+F)||(_.glyphs[+F]=C[+F]);_.ranges[v]=!0}for(const F of T)F(I,C);delete _.requests[v]})),T.push((I,C)=>{I?f(I):C&&f(null,{stack:u,id:d,glyph:C[d]||null})})},(u,d)=>{if(u)n(u);else if(d){const f={};for(const{stack:_,id:y,glyph:v}of d)(f[_]||(f[_]={}))[y]=v&&{id:v.id,bitmap:v.bitmap.clone(),metrics:v.metrics};n(null,f)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(l.unicodeBlockLookup["CJK Unified Ideographs"](t)||l.unicodeBlockLookup["Hangul Syllables"](t)||l.unicodeBlockLookup.Hiragana(t)||l.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,s){const u=this.localIdeographFontFamily;if(!u||!this._doesCharSupportLocalGlyph(s))return;let d=t.tinySDF;if(!d){let _="400";/bold/i.test(n)?_="900":/medium/i.test(n)?_="500":/light/i.test(n)&&(_="200"),d=t.tinySDF=new $t.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:u,fontWeight:_})}const f=d.draw(String.fromCharCode(s));return{id:s,bitmap:new l.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}}}}$t.loadGlyphRange=function(a,t,n,s,u){const d=256*t,f=d+255,_=s.transformRequest(n.replace("{fontstack}",a).replace("{range}",`${d}-${f}`),l.ResourceType.Glyphs);l.getArrayBuffer(_,(y,v)=>{if(y)u(y);else if(v){const T={};for(const I of l.parseGlyphPbf(v))T[I.id]=I;u(null,T)}})},$t.TinySDF=class{constructor({fontSize:a=24,buffer:t=3,radius:n=8,cutoff:s=.25,fontFamily:u="sans-serif",fontWeight:d="normal",fontStyle:f="normal"}={}){this.buffer=t,this.cutoff=s,this.radius=n;const _=this.size=a+4*t,y=this._createCanvas(_),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${f} ${d} ${a}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(a){const t=document.createElement("canvas");return t.width=t.height=a,t}draw(a){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:u,actualBoundingBoxRight:d}=this.ctx.measureText(a),f=Math.ceil(n),_=Math.min(this.size-this.buffer,Math.ceil(d-u)),y=Math.min(this.size-this.buffer,f+Math.ceil(s)),v=_+2*this.buffer,T=y+2*this.buffer,I=Math.max(v*T,0),C=new Uint8ClampedArray(I),F={data:C,width:v,height:T,glyphWidth:_,glyphHeight:y,glyphTop:f,glyphLeft:0,glyphAdvance:t};if(_===0||y===0)return F;const{ctx:R,buffer:B,gridInner:X,gridOuter:J}=this;R.clearRect(B,B,_,y),R.fillText(a,B,B+f);const te=R.getImageData(B,B,_,y);J.fill(ct,0,I),X.fill(0,0,I);for(let O=0;O<y;O++)for(let ne=0;ne<_;ne++){const ie=te.data[4*(O*_+ne)+3]/255;if(ie===0)continue;const ue=(O+B)*v+ne+B;if(ie===1)J[ue]=0,X[ue]=ct;else{const he=.5-ie;J[ue]=he>0?he*he:0,X[ue]=he<0?he*he:0}}vt(J,0,0,v,T,v,this.f,this.v,this.z),vt(X,B,B,_,y,v,this.f,this.v,this.z);for(let O=0;O<I;O++){const ne=Math.sqrt(J[O])-Math.sqrt(X[O]);C[O]=Math.round(255-255*(ne/this.radius+this.cutoff))}return F}};const Gi=new l.Properties({anchor:new l.DataConstantProperty(l.spec.light.anchor),position:new class{constructor(){this.specification=l.spec.light.position}possiblyEvaluate(a,t){return l.sphericalToCartesian(a.expression.evaluate(t))}interpolate(a,t,n){return{x:l.number(a.x,t.x,n),y:l.number(a.y,t.y,n),z:l.number(a.z,t.z,n)}}},color:new l.DataConstantProperty(l.spec.light.color),intensity:new l.DataConstantProperty(l.spec.light.intensity)}),Fi="-transition";class pi extends l.Evented{constructor(t){super(),this._transitionable=new l.Transitionable(Gi),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}){if(!this._validate(l.validateLight,t,n))for(const s in t){const u=t[s];s.endsWith(Fi)?this._transitionable.setTransition(s.slice(0,-Fi.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)&&l.emitValidationErrors(this,t.call(l.validateStyle,l.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:l.spec})))}}class wo{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 d=t.length%2==1?-t[t.length-1]*s:0,f=t[0]*s,_=!0;u.push({left:d,right:f,isDash:_,zeroLength:t[0]===0});let y=t[0];for(let v=1;v<t.length;v++){_=!_;const T=t[v];d=y*s,y+=T,f=y*s,u.push({left:d,right:f,isDash:_,zeroLength:T===0})}return u}addRoundDash(t,n,s){const u=n/2;for(let d=-s;d<=s;d++){const f=this.width*(this.nextRow+s+d);let _=0,y=t[_];for(let v=0;v<this.width;v++){v/y.right>1&&(y=t[++_]);const T=Math.abs(v-y.left),I=Math.abs(v-y.right),C=Math.min(T,I);let F;const R=d/s*(u+1);if(y.isDash){const B=u-Math.abs(R);F=Math.sqrt(C*C+B*B)}else F=u-Math.sqrt(C*C+R*R);this.data[f+v]=Math.max(0,Math.min(255,F+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 d=0,f=t[d];for(let _=0;_<this.width;_++){_/f.right>1&&(f=t[++d]);const y=Math.abs(_-f.left),v=Math.abs(_-f.right),T=Math.min(y,v);this.data[u+_]=Math.max(0,Math.min(255,(f.isDash?T:-T)+128))}}addDash(t,n){const s=n?7:0,u=2*s+1;if(this.nextRow+u>this.height)return l.warnOnce("LineAtlas out of space"),null;let d=0;for(let _=0;_<t.length;_++)d+=t[_];if(d!==0){const _=this.width/d,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:d};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 lr{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=l.uniqueId();const s=this.workerPool.acquire(this.id);for(let u=0;u<s.length;u++){const d=new lr.Actor(s[u],n,this.id);d.name=`Worker ${u}`,this.actors.push(d)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,n,s){l.asyncAll(this.actors,(u,d)=>{u.send(t,n,d)},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 Gr(a,t,n){const s=function(u,d){if(u)return n(u);if(d){const f=l.pick(l.extend(d,a),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);d.vector_layers&&(f.vectorLayers=d.vector_layers,f.vectorLayerIds=f.vectorLayers.map(_=>_.id)),n(null,f)}};return a.url?l.getJSON(t.transformRequest(a.url,l.ResourceType.Source),s):l.exported.frame(()=>s(null,a))}lr.Actor=l.Actor;class cr{constructor(t,n,s){this.bounds=l.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(l.mercatorXfromLng(this.bounds.getWest())*n),u=Math.floor(l.mercatorYfromLat(this.bounds.getNorth())*n),d=Math.ceil(l.mercatorXfromLng(this.bounds.getEast())*n),f=Math.ceil(l.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=s&&t.x<d&&t.y>=u&&t.y<f}}class un extends l.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,l.extend(this,l.pick(n,["url","scheme","tileSize","promoteId"])),this._options=l.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 l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Gr(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new l.ErrorEvent(t)):n&&(l.extend(this,n),n.bounds&&(this.tileBounds=new cr(n.bounds,this.minzoom,this.maxzoom)),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.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 l.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,l.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(f,_){return delete t.request,t.aborted?n(null):f&&f.status!==404?n(f):(_&&_.resourceTiming&&(t.resourceTiming=_.resourceTiming),this.map._refreshExpiredTiles&&_&&t.setExpiryData(_),t.loadVectorData(_,this.map.painter),l.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,d.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",u,d.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Er extends l.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=l.extend({type:"raster"},n),l.extend(this,l.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Gr(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new l.ErrorEvent(t)):n&&(l.extend(this,n),n.bounds&&(this.tileBounds=new cr(n.bounds,this.minzoom,this.maxzoom)),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.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 l.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=l.getImage(this.map._requestManager.transformRequest(s,l.ResourceType.Tile),(u,d,f)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(u)t.state="errored",n(u);else if(d){this.map._refreshExpiredTiles&&t.setExpiryData(f);const _=this.map.painter.context,y=_.gl;t.texture=this.map.painter.getTileTexture(d.width),t.texture?t.texture.update(d,{useMipmap:!0}):(t.texture=new He(_,d,y.RGBA,{useMipmap:!0}),t.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),_.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax)),t.state="loaded",l.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 Sr;class We extends Er{constructor(t,n,s,u){super(t,n,s,u),this.type="raster-dem",this.maxzoom=22,this._options=l.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(d,f){d&&(t.state="errored",n(d)),f&&(t.dem=f,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.request=l.getImage(this.map._requestManager.transformRequest(s,l.ResourceType.Tile),function(d,f){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(d)t.state="errored",n(d);else if(f){this.map._refreshExpiredTiles&&t.setExpiryData(f),delete f.cacheControl,delete f.expires;const _=l.isImageBitmap(f)&&(Sr==null&&(Sr=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Sr)?f:l.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,d=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 l.OverscaledTileID(t.overscaledZ,d,n.z,u,n.y).key]={backfilled:!1},y[new l.OverscaledTileID(t.overscaledZ,_,n.z,f,n.y).key]={backfilled:!1},n.y>0&&(y[new l.OverscaledTileID(t.overscaledZ,d,n.z,u,n.y-1).key]={backfilled:!1},y[new l.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new l.OverscaledTileID(t.overscaledZ,_,n.z,f,n.y-1).key]={backfilled:!1}),n.y+1<s&&(y[new l.OverscaledTileID(t.overscaledZ,d,n.z,u,n.y+1).key]={backfilled:!1},y[new l.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},y[new l.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 ur extends l.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=l.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 d=l.EXTENT/this.tileSize;this.workerOptions=l.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer!==void 0?n.buffer:128)*d,tolerance:(n.tolerance!==void 0?n.tolerance:.375)*d,extent:l.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:l.EXTENT,radius:(n.clusterRadius||50)*d,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=l.extend({},this.workerOptions),s=this._data;typeof s=="string"?(n.request=this.map._requestManager.transformRequest(l.exported.resolveURL(s),l.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(s),this._pendingLoads++,this.fire(new l.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,(u,d)=>{if(this._pendingLoads--,this._removed||d&&d.abandoned)return void this.fire(new l.Event("dataabort",{dataType:"source",sourceDataType:t}));let f=null;if(d&&d.resourceTiming&&d.resourceTiming[this.id]&&(f=d.resourceTiming[this.id].slice(0)),u)return void this.fire(new l.ErrorEvent(u));const _={dataType:"source",sourceDataType:t};this._collectResourceTiming&&f&&f.length>0&&l.extend(_,{resourceTiming:f}),this.fire(new l.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,(d,f)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):d?n(d):(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 l.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var hr=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class qi extends l.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 l.Event("dataloading",{dataType:"source"})),this.url=this.options.url,l.getImage(this.map._requestManager.transformRequest(this.url,l.ResourceType.Image),(s,u)=>{this._loaded=!0,s?this.fire(new l.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 l.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}setCoordinates(t){this.coordinates=t;const n=t.map(l.MercatorCoordinate.fromLngLat);this.tileID=function(u){let d=1/0,f=1/0,_=-1/0,y=-1/0;for(const C of u)d=Math.min(d,C.x),f=Math.min(f,C.y),_=Math.max(_,C.x),y=Math.max(y,C.y);const v=Math.max(_-d,y-f),T=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),I=Math.pow(2,T);return new l.CanonicalTileID(T,Math.floor((d+_)/2*I),Math.floor((f+y)/2*I))}(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map(u=>this.tileID.getTilePoint(u)._round());return this._boundsArray=new l.RasterBoundsArray,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,l.EXTENT,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,l.EXTENT),this._boundsArray.emplaceBack(s[2].x,s[2].y,l.EXTENT,l.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.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,hr.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new He(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 Zi extends qi{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,l.ResourceType.Source).url);l.getVideo(this.urls,(n,s)=>{this._loaded=!0,n?this.fire(new l.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 l.ErrorEvent(new l.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,hr.members)),this.boundsSegments||(this.boundsSegments=l.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 He(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 qr extends qi{constructor(t,n,s,u){super(t,n,s,u),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new l.ErrorEvent(new l.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.ErrorEvent(new l.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new l.ErrorEvent(new l.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 l.ErrorEvent(new l.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 l.ErrorEvent(new l.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 l.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,hr.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new He(n,this.canvas,s.RGBA,{premultiply:!0});for(const u in this.tiles){const d=this.tiles[u];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const hn={vector:un,raster:Er,"raster-dem":We,geojson:ur,video:Zi,image:qi,canvas:qr};function dn(a,t){const n=l.create();return l.translate(n,n,[1,1,0]),l.scale(n,n,[.5*a.width,.5*a.height,1]),l.multiply(n,n,a.calculatePosMatrix(t.toUnwrapped()))}function pn(a,t,n,s,u,d){const f=function(I,C,F){if(I)for(const R of I){const B=C[R];if(B&&B.source===F&&B.type==="fill-extrusion")return!0}else for(const R in C){const B=C[R];if(B.source===F&&B.type==="fill-extrusion")return!0}return!1}(u&&u.layers,t,a.id),_=d.maxPitchScaleFactor(),y=a.tilesIn(s,_,f);y.sort(Qi);const v=[];for(const I of y)v.push({wrappedTileID:I.tileID.wrapped().key,queryResults:I.tile.queryRenderedFeatures(t,n,a._state,I.queryGeometry,I.cameraQueryGeometry,I.scale,u,d,_,dn(a.transform,I.tileID))});const T=function(I){const C={},F={};for(const R of I){const B=R.queryResults,X=R.wrappedTileID,J=F[X]=F[X]||{};for(const te in B){const O=B[te],ne=J[te]=J[te]||{},ie=C[te]=C[te]||[];for(const ue of O)ne[ue.featureIndex]||(ne[ue.featureIndex]=!0,ie.push(ue))}}return C}(v);for(const I in T)T[I].forEach(C=>{const F=C.feature,R=a.getFeatureState(F.layer["source-layer"],F.id);F.source=F.layer.source,F.layer["source-layer"]&&(F.sourceLayer=F.layer["source-layer"]),F.state=R});return T}function Qi(a,t){const n=a.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 Ir{constructor(t,n){this.tileID=t,this.uid=l.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<l.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,d){const f={};if(!d)return f;for(const _ of u){const y=_.layerIds.map(v=>d.getLayer(v)).filter(Boolean);if(y.length!==0){_.layers=y,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(v=>y.filter(T=>T.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 d=this.buckets[u];if(d instanceof l.SymbolBucket){if(this.hasSymbolBuckets=!0,!s)break;d.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const d=this.buckets[u];if(d instanceof l.SymbolBucket&&d.hasRTLText){this.hasRTLText=!0,l.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const u in this.buckets){const d=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(u).queryRadius(d))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new l.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 He(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new He(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,s,u,d,f,_,y,v,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:u,cameraQueryGeometry:d,scale:f,tileSize:this.tileSize,pixelPosMatrix:T,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(),d=n?n.sourceLayer:"",f=u._geojsonTileLayer||u[d];if(!f)return;const _=l.createFilter(n&&n.filter),{z:y,x:v,y:T}=this.tileID.canonical,I={z:y,x:v,y:T};for(let C=0;C<f.length;C++){const F=f.feature(C);if(_.needGeometry){const X=l.toEvaluationFeature(F,!0);if(!_.filter(new l.EvaluationParameters(this.tileID.overscaledZ),X,this.tileID.canonical))continue}else if(!_.filter(new l.EvaluationParameters(this.tileID.overscaledZ),F))continue;const R=s.getId(F,d),B=new l.GeoJSONFeature(F,y,v,T,R);B.tile=I,t.push(B)}}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=l.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 d=this.expirationTime-n;d?this.expirationTime=s+Math.max(d,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 d=this.buckets[u],f=d.layers[0].sourceLayer||"_geojsonTileLayer",_=s[f],y=t[f];if(!_||!y||Object.keys(y).length===0)continue;d.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(d)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<l.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=l.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 d of n)if(u[d])return!0}}return!1}}class Ar{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 d={value:n,timeout:void 0};if(s!==void 0&&(d.timeout=setTimeout(()=>{this.remove(t,d)},s)),this.data[u].push(d),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),d=this.data[s][u];return this.data[s].splice(u,1),d.timeout&&clearTimeout(d.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(d.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 Cr{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]||{},l.extend(this.stateChanges[t][u],s),this.deletedStates[t]===null){this.deletedStates[t]={};for(const d in this.state[t])d!==u&&(this.deletedStates[t][d]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][u]===null){this.deletedStates[t][u]={};for(const d in this.state[t][u])s[d]||(this.deletedStates[t][u][d]=null)}else for(const d in s)this.deletedStates[t]&&this.deletedStates[t][u]&&this.deletedStates[t][u][d]===null&&delete this.deletedStates[t][u][d]}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=l.extend({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const d=this.deletedStates[t][n];if(d===null)return{};for(const f in d)delete 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 d={};for(const f in this.stateChanges[u])this.state[u][f]||(this.state[u][f]={}),l.extend(this.state[u][f],this.stateChanges[u][f]),d[f]=this.state[u][f];s[u]=d}for(const u in this.deletedStates){this.state[u]=this.state[u]||{};const d={};if(this.deletedStates[u]===null)for(const f in this.state[u])d[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][_];d[f]=this.state[u][f]}s[u]=s[u]||{},l.extend(s[u],d)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(const u in t)t[u].setFeatureState(s,n)}}class yi extends l.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,d,f,_){const y=new hn[d.type](u,d,f,_);if(y.id!==u)throw new Error(`Expected Source id to be ${u} instead of ${y.id}`);return l.bindAll(["load","abort","unload","serialize","prepare"],y),y}(t,n,s,this),this._tiles={},this._cache=new Ar(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Cr}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 l.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(fn).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 d=s.tileID,f=u.tileID,_=new l.pointGeometry(d.canonical.x,d.canonical.y)._rotate(this.transform.angle),y=new l.pointGeometry(f.canonical.x,f.canonical.y)._rotate(this.transform.angle);return d.overscaledZ-f.overscaledZ||y.y-_.y||y.x-_.x}).map(s=>s.tileID.key):n.map(s=>s.tileID).sort(fn).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 l.ErrorEvent(u,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=l.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 l.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let u=0;u<n.length;u++){const d=n[u];if(t.neighboringTiles&&t.neighboringTiles[d]){const f=this.getTileByID(d);s(t,f),s(f,t)}}function s(u,d){u.needsHillshadePrepare=!0,u.needsTerrainPrepare=!0;let f=d.tileID.canonical.x-u.tileID.canonical.x;const _=d.tileID.canonical.y-u.tileID.canonical.y,y=Math.pow(2,u.tileID.canonical.z),v=d.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)),d.dem&&u.dem&&(u.dem.backfillBorder(d.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 d in this._tiles){let f=this._tiles[d];if(u[d]||!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),d=this._getLoadedTile(u);if(d)return d}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,u=Math.floor(n*s*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(d)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const s={};for(const u in this._tiles){const d=this._tiles[u];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+n),s[d.tileID.key]=d}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 l.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),d=Math.max(u-yi.maxOverzooming,this._source.minzoom),f=Math.max(u+yi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const v={};for(const T of s)if(T.canonical.z>this._source.minzoom){const I=T.scaledTo(T.canonical.z-1);v[I.key]=I;const C=T.scaledTo(Math.max(this._source.minzoom,Math.min(T.canonical.z,5)));v[C.key]=C}s=s.concat(Object.values(v))}const _=this._updateRetainedTiles(s,u);if($n(this._source.type)){const v={},T={},I=Object.keys(_);for(const C of I){const F=_[C],R=this._tiles[C];if(!R||R.fadeEndTime&&R.fadeEndTime<=l.exported.now())continue;const B=this.findLoadedParent(F,d);B&&(this._addTile(B.tileID),v[B.tileID.key]=B.tileID),T[C]=F}this._retainLoadedChildren(T,u,f,_);for(const C in v)_[C]||(this._coveredTiles[C]=!0,_[C]=v[C]);if(n){const C={},F={};for(const R of s)this._tiles[R.key].hasData()?C[R.key]=R:F[R.key]=R;for(const R in F){const B=F[R].children(this._source.maxzoom);this._tiles[B[0].key]&&this._tiles[B[1].key]&&this._tiles[B[2].key]&&this._tiles[B[3].key]&&(C[B[0].key]=_[B[0].key]=B[0],C[B[1].key]=_[B[1].key]=B[1],C[B[2].key]=_[B[2].key]=B[2],C[B[3].key]=_[B[3].key]=B[3],delete F[R])}for(const R in F){const B=this.findLoadedParent(F[R],this._source.minzoom);if(B){C[B.tileID.key]=_[B.tileID.key]=B.tileID;for(const X in C)C[X].isChildOf(B.tileID)&&delete C[X]}}for(const R in this._tiles)C[R]||(this._coveredTiles[R]=!0)}}for(const v in _)this._tiles[v].clearFadeHold();const y=l.keysDifference(this._tiles,_);for(const v of y){const T=this._tiles[v];T.hasSymbolBuckets&&!T.holdingForFade()?T.setHoldDuration(this.map._fadeDuration):T.hasSymbolBuckets&&!T.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={},d=Math.max(n-yi.maxOverzooming,this._source.minzoom),f=Math.max(n+yi.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 I=y.children(this._source.maxzoom)[0],C=this.getTile(I);if(C&&C.hasData()){s[I.key]=I;continue}}else{const I=y.children(this._source.maxzoom);if(s[I[0].key]&&s[I[1].key]&&s[I[2].key]&&s[I[3].key])continue}let T=v.wasRequested();for(let I=y.overscaledZ-1;I>=d;--I){const C=y.scaledTo(I);if(u[C.key]||(u[C.key]=!0,v=this.getTile(C),!v&&T&&(v=this._addTile(C)),v&&(s[C.key]=C,T=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 d=u.scaledTo(u.overscaledZ-1);if(s=this._getLoadedTile(d),s)break;u=d}for(const d of n)this._loadedParentTiles[d]=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 Ir(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 l.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=[],d=this.transform;if(!d)return u;const f=s?d.getCameraQueryGeometry(t):t,_=t.map(R=>d.pointCoordinate(R,this.terrain)),y=f.map(R=>d.pointCoordinate(R,this.terrain)),v=this.getIds();let T=1/0,I=1/0,C=-1/0,F=-1/0;for(const R of y)T=Math.min(T,R.x),I=Math.min(I,R.y),C=Math.max(C,R.x),F=Math.max(F,R.y);for(let R=0;R<v.length;R++){const B=this._tiles[v[R]];if(B.holdingForFade())continue;const X=B.tileID,J=Math.pow(2,d.zoom-B.tileID.overscaledZ),te=n*B.queryPadding*l.EXTENT/B.tileSize/J,O=[X.getTilePoint(new l.MercatorCoordinate(T,I)),X.getTilePoint(new l.MercatorCoordinate(C,F))];if(O[0].x-te<l.EXTENT&&O[0].y-te<l.EXTENT&&O[1].x+te>=0&&O[1].y+te>=0){const ne=_.map(ue=>X.getTilePoint(ue)),ie=y.map(ue=>X.getTilePoint(ue));u.push({tile:B,tileID:X,queryGeometry:ne,cameraQueryGeometry:ie,scale:J})}}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($n(this._source.type))for(const t in this._tiles){const n=this._tiles[t];if(n.fadeEndTime!==void 0&&n.fadeEndTime>=l.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 fn(a,t){const n=Math.abs(2*a.wrap)-+(a.wrap<0),s=Math.abs(2*t.wrap)-+(t.wrap<0);return a.overscaledZ-t.overscaledZ||s-n||t.canonical.y-a.canonical.y||t.canonical.x-a.canonical.x}function $n(a){return a==="raster"||a==="image"||a==="video"}yi.maxOverzooming=10,yi.maxUnderzooming=3;const dr="mapboxgl_preloaded_worker_pool";class Si{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Si.workerCount;)this.workers.push(new Worker(Qr.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[dr]}numActive(){return Object.keys(this.active).length}}const Vn=Math.floor(l.exported.hardwareConcurrency/2);let Mr;function mn(){return Mr||(Mr=new Si),Mr}function gn(a,t){const n={};for(const s in a)s!=="ref"&&(n[s]=a[s]);return l.refProperties.forEach(s=>{s in t&&(n[s]=t[s])}),n}function Nn(a){a=a.slice();const t=Object.create(null);for(let n=0;n<a.length;n++)t[a[n].id]=a[n];for(let n=0;n<a.length;n++)"ref"in a[n]&&(a[n]=gn(a[n],t[a[n].ref]));return a}Si.workerCount=Math.max(Math.min(Vn,6),1);const ht={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 er(a,t,n){n.push({command:ht.addSource,args:[a,t[a]]})}function zr(a,t,n){t.push({command:ht.removeSource,args:[a]}),n[a]=!0}function Pr(a,t,n,s){zr(a,n,s),er(a,t,n)}function Gn(a,t,n){let s;for(s in a[n])if(Object.prototype.hasOwnProperty.call(a[n],s)&&s!=="data"&&!Te(a[n][s],t[n][s]))return!1;for(s in t[n])if(Object.prototype.hasOwnProperty.call(t[n],s)&&s!=="data"&&!Te(a[n][s],t[n][s]))return!1;return!0}function pr(a,t,n,s,u,d){let f;for(f in t=t||{},a=a||{})Object.prototype.hasOwnProperty.call(a,f)&&(Te(a[f],t[f])||n.push({command:d,args:[s,f,t[f],u]}));for(f in t)Object.prototype.hasOwnProperty.call(t,f)&&!Object.prototype.hasOwnProperty.call(a,f)&&(Te(a[f],t[f])||n.push({command:d,args:[s,f,t[f],u]}))}function fr(a){return a.id}function _n(a,t){return a[t.id]=t,a}class mr{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=l.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 d=n-1,f=this._distances[d],_=s-f,y=_>0?(u-f)/_:0;return this.points[d].mult(1-y).add(this.points[n].mult(y))}}function de(a,t){let n=!0;return a==="always"||a!=="never"&&t!=="never"||(n=!1),n}class Ce{constructor(t,n,s){const u=this.boxCells=[],d=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([]),d.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,d){this._forEachCell(n,s,u,d,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(u),this.bboxes.push(d)}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,d,f){this.boxCells[d].push(f)}_insertCircleCell(t,n,s,u,d,f){this.circleCells[d].push(f)}_query(t,n,s,u,d,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(d)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 T=this.circles[3*v],I=this.circles[3*v+1],C=this.circles[3*v+2];y.push({key:this.circleKeys[v],x1:T-C,y1:I-C,x2:T+C,y2:I+C})}}else this._forEachCell(t,n,s,u,this._queryCell,y,{hitTest:d,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,d,f){return this._query(t,n,s,u,!0,d,f).length>0}hitTestCircle(t,n,s,u,d){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 T=[];return this._forEachCell(f,y,_,v,this._queryCellCircle,T,{hitTest:!0,overlapMode:u,circle:{x:t,y:n,radius:s},seenUids:{box:{},circle:{}}},d),T.length>0}_queryCell(t,n,s,u,d,f,_,y){const{seenUids:v,hitTest:T,overlapMode:I}=_,C=this.boxCells[d];if(C!==null){const R=this.bboxes;for(const B of C)if(!v.box[B]){v.box[B]=!0;const X=4*B,J=this.boxKeys[B];if(t<=R[X+2]&&n<=R[X+3]&&s>=R[X+0]&&u>=R[X+1]&&(!y||y(J))&&(!T||!de(I,J.overlapMode))&&(f.push({key:J,x1:R[X],y1:R[X+1],x2:R[X+2],y2:R[X+3]}),T))return!0}}const F=this.circleCells[d];if(F!==null){const R=this.circles;for(const B of F)if(!v.circle[B]){v.circle[B]=!0;const X=3*B,J=this.circleKeys[B];if(this._circleAndRectCollide(R[X],R[X+1],R[X+2],t,n,s,u)&&(!y||y(J))&&(!T||!de(I,J.overlapMode))){const te=R[X],O=R[X+1],ne=R[X+2];if(f.push({key:J,x1:te-ne,y1:O-ne,x2:te+ne,y2:O+ne}),T)return!0}}}return!1}_queryCellCircle(t,n,s,u,d,f,_,y){const{circle:v,seenUids:T,overlapMode:I}=_,C=this.boxCells[d];if(C!==null){const R=this.bboxes;for(const B of C)if(!T.box[B]){T.box[B]=!0;const X=4*B,J=this.boxKeys[B];if(this._circleAndRectCollide(v.x,v.y,v.radius,R[X+0],R[X+1],R[X+2],R[X+3])&&(!y||y(J))&&!de(I,J.overlapMode))return f.push(!0),!0}}const F=this.circleCells[d];if(F!==null){const R=this.circles;for(const B of F)if(!T.circle[B]){T.circle[B]=!0;const X=3*B,J=this.circleKeys[B];if(this._circlesCollide(R[X],R[X+1],R[X+2],v.x,v.y,v.radius)&&(!y||y(J))&&!de(I,J.overlapMode))return f.push(!0),!0}}}_forEachCell(t,n,s,u,d,f,_,y){const v=this._convertToXCellCoord(t),T=this._convertToYCellCoord(n),I=this._convertToXCellCoord(s),C=this._convertToYCellCoord(u);for(let F=v;F<=I;F++)for(let R=T;R<=C;R++)if(d.call(this,t,n,s,u,this.xCellCount*R+F,f,_,y))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,s,u,d,f){const _=u-t,y=d-n,v=s+f;return v*v>_*_+y*y}_circleAndRectCollide(t,n,s,u,d,f,_){const y=(f-u)/2,v=Math.abs(t-(u+y));if(v>y+s)return!1;const T=(_-d)/2,I=Math.abs(n-(d+T));if(I>T+s)return!1;if(v<=y||I<=T)return!0;const C=v-y,F=I-T;return C*C+F*F<=s*s}}function Zr(a,t,n,s,u){const d=l.create();return t?(l.scale(d,d,[1/u,1/u,1]),n||l.rotateZ(d,d,s.angle)):l.multiply(d,s.labelPlaneMatrix,a),d}function ji(a,t,n,s,u){if(t){const d=l.clone(a);return l.scale(d,d,[u,u,1]),n||l.rotateZ(d,d,-s.angle),d}return s.glCoordMatrix}function dt(a,t,n){let s;n?(s=[a.x,a.y,n(a.x,a.y),1],l.transformMat4(s,s,t)):(s=[a.x,a.y,0,1],gr(s,s,t));const u=s[3];return{point:new l.pointGeometry(s[0]/u,s[1]/u),signedDistanceFromCamera:u}}function Oi(a,t){return .5+a/t*.5}function Ii(a,t){const n=a[0]/a[3],s=a[1]/a[3];return n>=-t[0]&&n<=t[0]&&s>=-t[1]&&s<=t[1]}function Ai(a,t,n,s,u,d,f,_,y,v){const T=s?a.textSizeData:a.iconSizeData,I=l.evaluateSizeForZoom(T,n.transform.zoom),C=[256/n.width*2+1,256/n.height*2+1],F=s?a.text.dynamicLayoutVertexArray:a.icon.dynamicLayoutVertexArray;F.clear();const R=a.lineVertexArray,B=s?a.text.placedSymbolArray:a.icon.placedSymbolArray,X=n.transform.width/n.transform.height;let J=!1;for(let te=0;te<B.length;te++){const O=B.get(te);if(O.hidden||O.writingMode===l.WritingMode.vertical&&!J){Je(O.numGlyphs,F);continue}let ne;if(J=!1,v?(ne=[O.anchorX,O.anchorY,v(O.anchorX,O.anchorY),1],l.transformMat4(ne,ne,t)):(ne=[O.anchorX,O.anchorY,0,1],gr(ne,ne,t)),!Ii(ne,C)){Je(O.numGlyphs,F);continue}const ie=Oi(n.transform.cameraToCenterDistance,ne[3]),ue=l.evaluateSizeForFeature(T,I,O),he=f?ue/ie:ue*ie,ye=new l.pointGeometry(O.anchorX,O.anchorY),ce=dt(ye,u,v).point,Le={},Ie=et(O,he,!1,_,t,u,d,a.glyphOffsetArray,R,F,ce,ye,Le,X,y,v);J=Ie.useVertical,(Ie.notEnoughRoom||J||Ie.needsFlipping&&et(O,he,!0,_,t,u,d,a.glyphOffsetArray,R,F,ce,ye,Le,X,y,v).notEnoughRoom)&&Je(O.numGlyphs,F)}s?a.text.dynamicLayoutVertexBuffer.updateData(F):a.icon.dynamicLayoutVertexBuffer.updateData(F)}function kr(a,t,n,s,u,d,f,_,y,v,T,I,C){const F=_.glyphStartIndex+_.numGlyphs,R=_.lineStartIndex,B=_.lineStartIndex+_.lineLength,X=t.getoffsetX(_.glyphStartIndex),J=t.getoffsetX(F-1),te=oi(a*X,n,s,u,d,f,_.segment,R,B,y,v,T,I,C);if(!te)return null;const O=oi(a*J,n,s,u,d,f,_.segment,R,B,y,v,T,I,C);return O?{first:te,last:O}:null}function Se(a,t,n,s){return a===l.WritingMode.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*s?{useVertical:!0}:(a===l.WritingMode.vertical?t.y<n.y:t.x>n.x)?{needsFlipping:!0}:null}function et(a,t,n,s,u,d,f,_,y,v,T,I,C,F,R,B){const X=t/24,J=a.lineOffsetX*X,te=a.lineOffsetY*X;let O;if(a.numGlyphs>1){const ne=a.glyphStartIndex+a.numGlyphs,ie=a.lineStartIndex,ue=a.lineStartIndex+a.lineLength,he=kr(X,_,J,te,n,T,I,a,y,d,C,R,B);if(!he)return{notEnoughRoom:!0};const ye=dt(he.first.point,f,B).point,ce=dt(he.last.point,f,B).point;if(s&&!n){const Le=Se(a.writingMode,ye,ce,F);if(Le)return Le}O=[he.first];for(let Le=a.glyphStartIndex+1;Le<ne-1;Le++)O.push(oi(X*_.getoffsetX(Le),J,te,n,T,I,a.segment,ie,ue,y,d,C,R,B));O.push(he.last)}else{if(s&&!n){const ie=dt(I,u,B).point,ue=a.lineStartIndex+a.segment+1,he=new l.pointGeometry(y.getx(ue),y.gety(ue)),ye=dt(he,u,B),ce=ye.signedDistanceFromCamera>0?ye.point:Ye(I,he,ie,1,u,B),Le=Se(a.writingMode,ie,ce,F);if(Le)return Le}const ne=oi(X*_.getoffsetX(a.glyphStartIndex),J,te,n,T,I,a.segment,a.lineStartIndex,a.lineStartIndex+a.lineLength,y,d,C,R,B);if(!ne)return{notEnoughRoom:!0};O=[ne]}for(const ne of O)l.addDynamicAttributes(v,ne.point,ne.angle);return{}}function Ye(a,t,n,s,u,d){const f=dt(a.add(a.sub(t)._unit()),u,d).point,_=n.sub(f);return n.add(_._mult(s/_.mag()))}function oi(a,t,n,s,u,d,f,_,y,v,T,I,C,F){const R=s?a-t:a+t;let B=R>0?1:-1,X=0;s&&(B*=-1,X=Math.PI),B<0&&(X+=Math.PI);let J=B>0?_+f:_+f+1,te=u,O=u,ne=0,ie=0;const ue=Math.abs(R),he=[];for(;ne+ie<=ue;){if(J+=B,J<_||J>=y)return null;if(O=te,he.push(te),te=I[J],te===void 0){const Re=new l.pointGeometry(v.getx(J),v.gety(J)),Qe=dt(Re,T,F);if(Qe.signedDistanceFromCamera>0)te=I[J]=Qe.point;else{const it=J-B;te=Ye(ne===0?d:new l.pointGeometry(v.getx(it),v.gety(it)),Re,O,ue-ne+1,T,F)}}ne+=ie,ie=O.dist(te)}const ye=(ue-ne)/ie,ce=te.sub(O),Le=ce.mult(ye)._add(O);Le._add(ce._unit()._perp()._mult(n*B));const Ie=X+Math.atan2(te.y-O.y,te.x-O.x);return he.push(Le),{point:Le,angle:C?Ie:0,path:he}}const Dr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Je(a,t){for(let n=0;n<a;n++){const s=t.length;t.resize(s+4),t.float32.set(Dr,3*s)}}function gr(a,t,n){const s=t[0],u=t[1];return a[0]=n[0]*s+n[4]*u+n[12],a[1]=n[1]*s+n[5]*u+n[13],a[3]=n[3]*s+n[7]*u+n[15],a}const Yt=100;class yn{constructor(t,n=new Ce(t.width+200,t.height+200,25),s=new Ce(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+Yt,this.screenBottomBoundary=t.height+Yt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,n,s,u,d,f){const _=this.projectAndGetPerspectiveRatio(u,t.anchorPointX,t.anchorPointY,f),y=s*_.perspectiveRatio,v=t.x1*y+_.point.x,T=t.y1*y+_.point.y,I=t.x2*y+_.point.x,C=t.y2*y+_.point.y;return!this.isInsideGrid(v,T,I,C)||n!=="always"&&this.grid.hitTest(v,T,I,C,n,d)||_.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[v,T,I,C],offscreen:this.isOffscreen(v,T,I,C)}}placeCollisionCircles(t,n,s,u,d,f,_,y,v,T,I,C,F,R){const B=[],X=new l.pointGeometry(n.anchorX,n.anchorY),J=dt(X,f,R),te=Oi(this.transform.cameraToCenterDistance,J.signedDistanceFromCamera),O=(T?d/te:d*te)/l.ONE_EM,ne=dt(X,_,R).point,ie=kr(O,u,n.lineOffsetX*O,n.lineOffsetY*O,!1,ne,X,n,s,_,{},!1,R);let ue=!1,he=!1,ye=!0;if(ie){const ce=.5*C*te+F,Le=new l.pointGeometry(-100,-100),Ie=new l.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),Re=new mr,Qe=ie.first,it=ie.last;let Ge=[];for(let ut=Qe.path.length-1;ut>=1;ut--)Ge.push(Qe.path[ut]);for(let ut=1;ut<it.path.length;ut++)Ge.push(it.path[ut]);const bt=2.5*ce;if(y){const ut=Ge.map(mt=>dt(mt,y,R));Ge=ut.some(mt=>mt.signedDistanceFromCamera<=0)?[]:ut.map(mt=>mt.point)}let wt=[];if(Ge.length>0){const ut=Ge[0].clone(),mt=Ge[0].clone();for(let Et=1;Et<Ge.length;Et++)ut.x=Math.min(ut.x,Ge[Et].x),ut.y=Math.min(ut.y,Ge[Et].y),mt.x=Math.max(mt.x,Ge[Et].x),mt.y=Math.max(mt.y,Ge[Et].y);wt=ut.x>=Le.x&&mt.x<=Ie.x&&ut.y>=Le.y&&mt.y<=Ie.y?[Ge]:mt.x<Le.x||ut.x>Ie.x||mt.y<Le.y||ut.y>Ie.y?[]:l.clipLine([Ge],Le.x,Le.y,Ie.x,Ie.y)}for(const ut of wt){Re.reset(ut,.25*ce);let mt=0;mt=Re.length<=.5*ce?1:Math.ceil(Re.paddedLength/bt)+1;for(let Et=0;Et<mt;Et++){const ei=Et/Math.max(mt-1,1),nr=Re.lerp(ei),Wi=nr.x+Yt,or=nr.y+Yt;B.push(Wi,or,ce,0);const $r=Wi-ce,$i=or-ce,vi=Wi+ce,xr=or+ce;if(ye=ye&&this.isOffscreen($r,$i,vi,xr),he=he||this.isInsideGrid($r,$i,vi,xr),t!=="always"&&this.grid.hitTestCircle(Wi,or,ce,t,I)&&(ue=!0,!v))return{circles:[],offscreen:!1,collisionDetected:ue}}}}return{circles:!v&&ue||!he||te<this.perspectiveRatioCutoff?[]:B,offscreen:ye,collisionDetected:ue}}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[];let s=1/0,u=1/0,d=-1/0,f=-1/0;for(const T of t){const I=new l.pointGeometry(T.x+Yt,T.y+Yt);s=Math.min(s,I.x),u=Math.min(u,I.y),d=Math.max(d,I.x),f=Math.max(f,I.y),n.push(I)}const _=this.grid.query(s,u,d,f).concat(this.ignoredGrid.query(s,u,d,f)),y={},v={};for(const T of _){const I=T.key;if(y[I.bucketInstanceId]===void 0&&(y[I.bucketInstanceId]={}),y[I.bucketInstanceId][I.featureIndex])continue;const C=[new l.pointGeometry(T.x1,T.y1),new l.pointGeometry(T.x2,T.y1),new l.pointGeometry(T.x2,T.y2),new l.pointGeometry(T.x1,T.y2)];l.polygonIntersectsPolygon(n,C)&&(y[I.bucketInstanceId][I.featureIndex]=!0,v[I.bucketInstanceId]===void 0&&(v[I.bucketInstanceId]=[]),v[I.bucketInstanceId].push(I.featureIndex))}return v}insertCollisionBox(t,n,s,u,d,f){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:u,featureIndex:d,collisionGroupID:f,overlapMode:n},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,n,s,u,d,f){const _=s?this.ignoredGrid:this.grid,y={bucketInstanceId:u,featureIndex:d,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 d;return u?(d=[n,s,u(n,s),1],l.transformMat4(d,d,t)):(d=[n,s,0,1],gr(d,d,t)),{point:new l.pointGeometry((d[0]/d[3]+1)/2*this.transform.width+Yt,(-d[1]/d[3]+1)/2*this.transform.height+Yt),perspectiveRatio:.5+this.transform.cameraToCenterDistance/d[3]*.5}}isOffscreen(t,n,s,u){return s<Yt||t>=this.screenRightBoundary||u<Yt||n>this.screenBottomBoundary}isInsideGrid(t,n,s,u){return s>=0&&t<this.gridRightBoundary&&u>=0&&n<this.gridBottomBoundary}getViewportMatrix(){const t=l.identity([]);return l.translate(t,t,[-100,-100,0]),t}}function qt(a,t,n){return t*(l.EXTENT/(a.tileSize*Math.pow(2,n-a.tileID.overscaledZ)))}class fi{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 Tt{constructor(t,n,s,u,d){this.text=new fi(t?t.text:null,n,s,d),this.icon=new fi(t?t.icon:null,n,u,d)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class xn{constructor(t,n,s){this.text=t,this.icon=n,this.skipFade=s}}class tr{constructor(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]}}class jr{constructor(t,n,s,u,d){this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=s,this.bucketIndex=u,this.tileID=d}}class Xr{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 vn(a,t,n,s,u){const{horizontalAlign:d,verticalAlign:f}=l.getAnchorAlignment(a),_=-(d-.5)*t,y=-(f-.5)*n,v=l.evaluateVariableOffset(a,s);return new l.pointGeometry(_+v[0]*u,y+v[1]*u)}function Wr(a,t,n,s,u,d){const{x1:f,x2:_,y1:y,y2:v,anchorPointX:T,anchorPointY:I}=a,C=new l.pointGeometry(t,n);return s&&C._rotate(u?d:-d),{x1:f+C.x,y1:y+C.y,x2:_+C.x,y2:v+C.y,anchorPointX:T,anchorPointY:I}}class L{constructor(t,n,s,u,d){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new yn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new Xr(u),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,s,u){const d=s.getBucket(n),f=s.latestFeatureIndex;if(!d||!f||n.id!==d.layerIds[0])return;const _=s.collisionBoxArray,y=d.layers[0].layout,v=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),T=s.tileSize/l.EXTENT,I=this.transform.calculatePosMatrix(s.tileID.toUnwrapped()),C=y.get("text-pitch-alignment")==="map",F=y.get("text-rotation-alignment")==="map",R=qt(s,1,this.transform.zoom),B=Zr(I,C,F,this.transform,R);let X=null;if(C){const te=ji(I,C,F,this.transform,R);X=l.multiply([],this.transform.labelPlaneMatrix,te)}this.retainedQueryData[d.bucketInstanceId]=new jr(d.bucketInstanceId,f,d.sourceLayerIndex,d.index,s.tileID);const J={bucket:d,layout:y,posMatrix:I,textLabelPlaneMatrix:B,labelToScreenMatrix:X,scale:v,textPixelRatio:T,holdingForFade:s.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:l.evaluateSizeForZoom(d.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(d.sourceID)};if(u)for(const te of d.sortKeyRanges){const{sortKey:O,symbolInstanceStart:ne,symbolInstanceEnd:ie}=te;t.push({sortKey:O,symbolInstanceStart:ne,symbolInstanceEnd:ie,parameters:J})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:d.symbolInstances.length,parameters:J})}attemptAnchorPlacement(t,n,s,u,d,f,_,y,v,T,I,C,F,R,B,X){const J=[C.textOffset0,C.textOffset1],te=vn(t,s,u,J,d),O=this.collisionIndex.placeCollisionBox(Wr(n,te.x,te.y,f,_,this.transform.angle),I,y,v,T.predicate,X);if((!B||this.collisionIndex.placeCollisionBox(Wr(B,te.x,te.y,f,_,this.transform.angle),I,y,v,T.predicate,X).box.length!==0)&&O.box.length>0){let ne;if(this.prevPlacement&&this.prevPlacement.variableOffsets[C.crossTileID]&&this.prevPlacement.placements[C.crossTileID]&&this.prevPlacement.placements[C.crossTileID].text&&(ne=this.prevPlacement.variableOffsets[C.crossTileID].anchor),C.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[C.crossTileID]={textOffset:J,width:s,height:u,anchor:t,textBoxScale:d,prevAnchor:ne},this.markUsedJustification(F,t,C,R),F.allowVerticalPlacement&&(this.markUsedOrientation(F,R,C),this.placedOrientations[C.crossTileID]=R),{shift:te,placedGlyphBoxes:O}}}placeLayerBucketPart(t,n,s){const{bucket:u,layout:d,posMatrix:f,textLabelPlaneMatrix:_,labelToScreenMatrix:y,textPixelRatio:v,holdingForFade:T,collisionBoxArray:I,partiallyEvaluatedTextSize:C,collisionGroup:F}=t.parameters,R=d.get("text-optional"),B=d.get("icon-optional"),X=l.getOverlapMode(d,"text-overlap","text-allow-overlap"),J=X==="always",te=l.getOverlapMode(d,"icon-overlap","icon-allow-overlap"),O=te==="always",ne=d.get("text-rotation-alignment")==="map",ie=d.get("text-pitch-alignment")==="map",ue=d.get("icon-text-fit")!=="none",he=d.get("symbol-z-order")==="viewport-y",ye=J&&(O||!u.hasIconData()||B),ce=O&&(J||!u.hasTextData()||R);!u.collisionArrays&&I&&u.deserializeCollisionBoxes(I);const Le=(Ie,Re)=>{if(n[Ie.crossTileID])return;if(T)return void(this.placements[Ie.crossTileID]=new xn(!1,!1,!1));let Qe=!1,it=!1,Ge=!0,bt=null,wt={box:null,offscreen:null},ut={box:null,offscreen:null},mt=null,Et=null,ei=null,nr=0,Wi=0,or=0;Re.textFeatureIndex?nr=Re.textFeatureIndex:Ie.useRuntimeCollisionCircles&&(nr=Ie.featureIndex),Re.verticalTextFeatureIndex&&(Wi=Re.verticalTextFeatureIndex);const $r=this.retainedQueryData[u.bucketInstanceId].tileID,$i=this.terrain?(Ht,ot)=>this.terrain.getElevation($r,Ht,ot):null;for(const Ht of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const ot=Re[Ht];ot&&(ot.elevation=$i?$i(ot.anchorPointX,ot.anchorPointY):0)}const vi=Re.textBox;if(vi){const Ht=xt=>{let ti=l.WritingMode.horizontal;if(u.allowVerticalPlacement&&!xt&&this.prevPlacement){const ii=this.prevPlacement.placedOrientations[Ie.crossTileID];ii&&(this.placedOrientations[Ie.crossTileID]=ii,ti=ii,this.markUsedOrientation(u,ti,Ie))}return ti},ot=(xt,ti)=>{if(u.allowVerticalPlacement&&Ie.numVerticalGlyphVertices>0&&Re.verticalTextBox){for(const ii of u.writingModes)if(ii===l.WritingMode.vertical?(wt=ti(),ut=wt):wt=xt(),wt&&wt.box&&wt.box.length)break}else wt=xt()};if(d.get("text-variable-anchor")){let xt=d.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Ie.crossTileID]){const Bt=this.prevPlacement.variableOffsets[Ie.crossTileID];xt.indexOf(Bt.anchor)>0&&(xt=xt.filter(Vi=>Vi!==Bt.anchor),xt.unshift(Bt.anchor))}const ti=(Bt,Vi,en)=>{const Ds=Bt.x2-Bt.x1,Dn=Bt.y2-Bt.y1,$a=Ie.textBoxScale,Ls=ue&&te==="never"?Vi:null;let Vr={box:[],offscreen:!1};const tn=X!=="never"?2*xt.length:xt.length;for(let rn=0;rn<tn;++rn){const Go=this.attemptAnchorPlacement(xt[rn%xt.length],Bt,Ds,Dn,$a,ne,ie,v,f,F,rn>=xt.length?X:"never",Ie,u,en,Ls,$i);if(Go&&(Vr=Go.placedGlyphBoxes,Vr&&Vr.box&&Vr.box.length)){Qe=!0,bt=Go.shift;break}}return Vr};ot(()=>ti(vi,Re.iconBox,l.WritingMode.horizontal),()=>{const Bt=Re.verticalTextBox;return u.allowVerticalPlacement&&!(wt&&wt.box&&wt.box.length)&&Ie.numVerticalGlyphVertices>0&&Bt?ti(Bt,Re.verticalIconBox,l.WritingMode.vertical):{box:null,offscreen:null}}),wt&&(Qe=wt.box,Ge=wt.offscreen);const ii=Ht(wt&&wt.box);if(!Qe&&this.prevPlacement){const Bt=this.prevPlacement.variableOffsets[Ie.crossTileID];Bt&&(this.variableOffsets[Ie.crossTileID]=Bt,this.markUsedJustification(u,Bt.anchor,Ie,ii))}}else{const xt=(ti,ii)=>{const Bt=this.collisionIndex.placeCollisionBox(ti,X,v,f,F.predicate,$i);return Bt&&Bt.box&&Bt.box.length&&(this.markUsedOrientation(u,ii,Ie),this.placedOrientations[Ie.crossTileID]=ii),Bt};ot(()=>xt(vi,l.WritingMode.horizontal),()=>{const ti=Re.verticalTextBox;return u.allowVerticalPlacement&&Ie.numVerticalGlyphVertices>0&&ti?xt(ti,l.WritingMode.vertical):{box:null,offscreen:null}}),Ht(wt&&wt.box&&wt.box.length)}}if(mt=wt,Qe=mt&&mt.box&&mt.box.length>0,Ge=mt&&mt.offscreen,Ie.useRuntimeCollisionCircles){const Ht=u.text.placedSymbolArray.get(Ie.centerJustifiedTextSymbolIndex),ot=l.evaluateSizeForFeature(u.textSizeData,C,Ht),xt=d.get("text-padding");Et=this.collisionIndex.placeCollisionCircles(X,Ht,u.lineVertexArray,u.glyphOffsetArray,ot,f,_,y,s,ie,F.predicate,Ie.collisionCircleDiameter,xt,$i),Et.circles.length&&Et.collisionDetected&&!s&&l.warnOnce("Collisions detected, but collision boxes are not shown"),Qe=J||Et.circles.length>0&&!Et.collisionDetected,Ge=Ge&&Et.offscreen}if(Re.iconFeatureIndex&&(or=Re.iconFeatureIndex),Re.iconBox){const Ht=ot=>{const xt=ue&&bt?Wr(ot,bt.x,bt.y,ne,ie,this.transform.angle):ot;return this.collisionIndex.placeCollisionBox(xt,te,v,f,F.predicate,$i)};ut&&ut.box&&ut.box.length&&Re.verticalIconBox?(ei=Ht(Re.verticalIconBox),it=ei.box.length>0):(ei=Ht(Re.iconBox),it=ei.box.length>0),Ge=Ge&&ei.offscreen}const xr=R||Ie.numHorizontalGlyphVertices===0&&Ie.numVerticalGlyphVertices===0,No=B||Ie.numIconVertices===0;if(xr||No?No?xr||(it=it&&Qe):Qe=it&&Qe:it=Qe=it&&Qe,Qe&&mt&&mt.box&&this.collisionIndex.insertCollisionBox(mt.box,X,d.get("text-ignore-placement"),u.bucketInstanceId,ut&&ut.box&&Wi?Wi:nr,F.ID),it&&ei&&this.collisionIndex.insertCollisionBox(ei.box,te,d.get("icon-ignore-placement"),u.bucketInstanceId,or,F.ID),Et&&(Qe&&this.collisionIndex.insertCollisionCircles(Et.circles,X,d.get("text-ignore-placement"),u.bucketInstanceId,nr,F.ID),s)){const Ht=u.bucketInstanceId;let ot=this.collisionCircleArrays[Ht];ot===void 0&&(ot=this.collisionCircleArrays[Ht]=new tr);for(let xt=0;xt<Et.circles.length;xt+=4)ot.circles.push(Et.circles[xt+0]),ot.circles.push(Et.circles[xt+1]),ot.circles.push(Et.circles[xt+2]),ot.circles.push(Et.collisionDetected?1:0)}if(Ie.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[Ie.crossTileID]=new xn(Qe||ye,it||ce,Ge||u.justReloaded),n[Ie.crossTileID]=!0};if(he){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Ie=u.getSortedSymbolIndexes(this.transform.angle);for(let Re=Ie.length-1;Re>=0;--Re){const Qe=Ie[Re];Le(u.symbolInstances.get(Qe),u.collisionArrays[Qe])}}else for(let Ie=t.symbolInstanceStart;Ie<t.symbolInstanceEnd;Ie++)Le(u.symbolInstances.get(Ie),u.collisionArrays[Ie]);if(s&&u.bucketInstanceId in this.collisionCircleArrays){const Ie=this.collisionCircleArrays[u.bucketInstanceId];l.invert(Ie.invProjMatrix,f),Ie.viewportMatrix=this.collisionIndex.getViewportMatrix()}u.justReloaded=!1}markUsedJustification(t,n,s,u){let d;d=u===l.WritingMode.vertical?s.verticalPlacedTextSymbolIndex:{left:s.leftJustifiedTextSymbolIndex,center:s.centerJustifiedTextSymbolIndex,right:s.rightJustifiedTextSymbolIndex}[l.getAnchorJustification(n)];const f=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex,s.verticalPlacedTextSymbolIndex];for(const _ of f)_>=0&&(t.text.placedSymbolArray.get(_).crossTileID=d>=0&&_!==d?0:s.crossTileID)}markUsedOrientation(t,n,s){const u=n===l.WritingMode.horizontal||n===l.WritingMode.horizontalOnly?n:0,d=n===l.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=d)}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,d=n?n.opacities:{},f=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],T=d[y];T?(this.opacities[y]=new Tt(T,u,v.text,v.icon),s=s||v.text!==T.text.placed||v.icon!==T.icon.placed):(this.opacities[y]=new Tt(null,u,v.text,v.icon,v.skipFade),s=s||v.text||v.icon)}for(const y in d){const v=d[y];if(!this.opacities[y]){const T=new Tt(v,u,!1,!1);T.isHidden()||(this.opacities[y]=T,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 d=u.getBucket(t);d&&u.latestFeatureIndex&&t.id===d.layerIds[0]&&this.updateBucketOpacities(d,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,d=new Tt(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",T=u.get("text-pitch-alignment")==="map",I=u.get("icon-text-fit")!=="none",C=new Tt(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 F=(R,B,X)=>{for(let J=0;J<B/4;J++)R.opacityVertexArray.emplaceBack(X)};for(let R=0;R<t.symbolInstances.length;R++){const B=t.symbolInstances.get(R),{numHorizontalGlyphVertices:X,numVerticalGlyphVertices:J,crossTileID:te}=B;let O=this.opacities[te];n[te]?O=d:O||(O=C,this.opacities[te]=O),n[te]=!0;const ne=B.numIconVertices>0,ie=this.placedOrientations[B.crossTileID],ue=ie===l.WritingMode.vertical,he=ie===l.WritingMode.horizontal||ie===l.WritingMode.horizontalOnly;if(X>0||J>0){const ye=K(O.text);F(t.text,X,ue?le:ye),F(t.text,J,he?le:ye);const ce=O.text.isHidden();[B.rightJustifiedTextSymbolIndex,B.centerJustifiedTextSymbolIndex,B.leftJustifiedTextSymbolIndex].forEach(Re=>{Re>=0&&(t.text.placedSymbolArray.get(Re).hidden=ce||ue?1:0)}),B.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(B.verticalPlacedTextSymbolIndex).hidden=ce||he?1:0);const Le=this.variableOffsets[B.crossTileID];Le&&this.markUsedJustification(t,Le.anchor,B,ie);const Ie=this.placedOrientations[B.crossTileID];Ie&&(this.markUsedJustification(t,"left",B,Ie),this.markUsedOrientation(t,Ie,B))}if(ne){const ye=K(O.icon),ce=!(I&&B.verticalPlacedIconSymbolIndex&&ue);B.placedIconSymbolIndex>=0&&(F(t.icon,B.numIconVertices,ce?ye:le),t.icon.placedSymbolArray.get(B.placedIconSymbolIndex).hidden=O.icon.isHidden()),B.verticalPlacedIconSymbolIndex>=0&&(F(t.icon,B.numVerticalIconVertices,ce?le:ye),t.icon.placedSymbolArray.get(B.verticalPlacedIconSymbolIndex).hidden=O.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ye=t.collisionArrays[R];if(ye){let ce=new l.pointGeometry(0,0);if(ye.textBox||ye.verticalTextBox){let Ie=!0;if(y){const Re=this.variableOffsets[te];Re?(ce=vn(Re.anchor,Re.width,Re.height,Re.textOffset,Re.textBoxScale),v&&ce._rotate(T?this.transform.angle:-this.transform.angle)):Ie=!1}ye.textBox&&b(t.textCollisionBox.collisionVertexArray,O.text.placed,!Ie||ue,ce.x,ce.y),ye.verticalTextBox&&b(t.textCollisionBox.collisionVertexArray,O.text.placed,!Ie||he,ce.x,ce.y)}const Le=Boolean(!he&&ye.verticalIconBox);ye.iconBox&&b(t.iconCollisionBox.collisionVertexArray,O.icon.placed,Le,I?ce.x:0,I?ce.y:0),ye.verticalIconBox&&b(t.iconCollisionBox.collisionVertexArray,O.icon.placed,!Le,I?ce.x:0,I?ce.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 R=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=R.invProjMatrix,t.placementViewportMatrix=R.viewportMatrix,t.collisionCircleArray=R.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(a,t,n,s,u){a.emplaceBack(t?1:0,n?1:0,s||0,u||0),a.emplaceBack(t?1:0,n?1:0,s||0,u||0),a.emplaceBack(t?1:0,n?1:0,s||0,u||0),a.emplaceBack(t?1:0,n?1:0,s||0,u||0)}const S=Math.pow(2,25),k=Math.pow(2,24),D=Math.pow(2,17),N=Math.pow(2,16),H=Math.pow(2,9),Z=Math.pow(2,8),G=Math.pow(2,1);function K(a){if(a.opacity===0&&!a.placed)return 0;if(a.opacity===1&&a.placed)return 4294967295;const t=a.placed?1:0,n=Math.floor(127*a.opacity);return n*S+t*k+n*D+t*N+n*H+t*Z+n*G+t}const le=0;class _e{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,d){const f=this._bucketParts;for(;this._currentTileIndex<t.length;)if(n.getBucketParts(f,u,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,d())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++,d())return!0;return!1}}class ae{constructor(t,n,s,u,d,f,_,y){this.placement=new L(t,n,f,_,y),this._currentPlacementIndex=s.length-1,this._forceFullPlacement=u,this._showCollisionBoxes=d,this._done=!1}isDone(){return this._done}continuePlacement(t,n,s){const u=l.exported.now(),d=()=>{const f=l.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 _e(f)),this._inProgressLayer.continuePlacement(s[f.source],this.placement,this._showCollisionBoxes,f,d))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Oe=512/l.EXTENT/2;class $e{constructor(t,n,s){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=s;for(let u=0;u<n.length;u++){const d=n.get(u),f=d.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:d.crossTileID,coord:this.getScaledCoordinates(d,t)})}}getScaledCoordinates(t,n){const s=Oe/Math.pow(2,n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*l.EXTENT+t.anchorX)*s),y:Math.floor((n.canonical.y*l.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 d=0;d<t.length;d++){const f=t.get(d);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 De{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ze{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],d={};for(const f in u){const _=u[f];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+n),d[_.tileID.key]=_}this.indexes[s]=d}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 d=0;d<n.symbolInstances.length;d++)n.symbolInstances.get(d).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const u=this.usedCrossTileIDs[t.overscaledZ];for(const d in this.indexes){const f=this.indexes[d];if(Number(d)>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(d)).key];_&&_.findMatches(n.symbolInstances,t,u)}}for(let d=0;d<n.symbolInstances.length;d++){const f=n.symbolInstances.get(d);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 $e(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 d in u)t[u[d].bucketInstanceId]||(this.removeBucketCrossTileIDs(s,u[d]),delete u[d],n=!0)}return n}}class Xe{constructor(){this.layerIndexes={},this.crossTileIDs=new De,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,n,s){let u=this.layerIndexes[t.id];u===void 0&&(u=this.layerIndexes[t.id]=new Ze);let d=!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)&&(d=!0),f[y.bucketInstanceId]=!0)}return u.removeStaleBuckets(f)&&(d=!0),d}pruneUnusedLayers(t){const n={};t.forEach(s=>{n[s]=!0});for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}var pt=l.createLayout([{name:"a_pos",type:"Int16",components:2}]);class Ke extends l.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),l.ortho(s.posMatrix,0,l.EXTENT,0,l.EXTENT,0,1),this._tiles[s.key]=new Ir(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 d=t.clone();d.posMatrix=new Float64Array(16),l.ortho(d.posMatrix,0,l.EXTENT,0,l.EXTENT,0,1),n[s]=d}else if(u.canonical.isChildOf(t.canonical)){const d=t.clone();d.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=l.EXTENT>>f;l.ortho(d.posMatrix,0,v,0,v,0,1),l.translate(d.posMatrix,d.posMatrix,[-_*v,-y*v,0]),n[s]=d}else if(t.canonical.isChildOf(u.canonical)){const d=t.clone();d.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=l.EXTENT>>f;l.ortho(d.posMatrix,0,l.EXTENT,0,l.EXTENT,0,1),l.translate(d.posMatrix,d.posMatrix,[_*v,y*v,0]),l.scale(d.posMatrix,d.posMatrix,[1/2**f,1/2**f,0]),n[s]=d}}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 d=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!d||!d.dem)&&n)for(;u>=s.minzoom&&(!d||!d.dem);)d=this.sourceCache.getTileByID(t.scaledTo(u--).key);return d}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeLoaded>=t)}}class tt{constructor(t,n,s){this.style=t,this.sourceCache=new Ke(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=l.EXTENT){if(!(n>=0&&n<u&&s>=0&&s<u))return this.elevationOffset;let d=0;const f=this.getTerrainData(t);if(f.tile&&f.tile.dem){const _=l.transformMat4$1([],[n/u*l.EXTENT,s/u*l.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])],T=f.tile.dem.get(v[0],v[1]),I=f.tile.dem.get(v[0],v[1]+1),C=f.tile.dem.get(v[0]+1,v[1]),F=f.tile.dem.get(v[0]+1,v[1]+1);d=l.number(l.number(T,I,y[0]-v[0]),l.number(C,F,y[0]-v[0]),y[1]-v[1])}return d}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=l.EXTENT){return(this.getDEMElevation(t,n,s,u)+this.elevationOffset)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const u=this.style.map.painter.context,d=new l.RGBAImage({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new He(u,d,u.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new He(u,new l.RGBAImage({width:1,height:1}),u.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=l.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 He(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 d=t.canonical.z-n.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=u?d=t.canonical.z-u:l.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const f=t.canonical.x-(t.canonical.x>>d<<d),_=t.canonical.y-(t.canonical.y>>d<<d),y=l.fromScaling(new Float64Array(16),[1/(l.EXTENT<<d),1/(l.EXTENT<<d),0]);l.translate(y,y,[f*l.EXTENT,_*l.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 He(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 He(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 d=0,f=0;d<this._coordsTextureSize;d++)for(let _=0;_<this._coordsTextureSize;_++,f+=4)n[f+0]=255&_,n[f+1]=255&d,n[f+2]=_>>8<<4|d>>8,n[f+3]=0;const s=new l.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),u=new He(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,d=u.gl;u.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),d.readPixels(t.x,s.height/devicePixelRatio-t.y-1,1,1,d.RGBA,d.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 T=this._coordsTextureSize,I=(1<<v.tileID.canonical.z)*T;return new l.MercatorCoordinate((v.tileID.canonical.x*T+f)/I,(v.tileID.canonical.y*T+_)/I,this.getElevation(v.tileID,f,_,T))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.style.map.painter.context,n=new l.PosArray,s=new l.TriangleIndexArray,u=this.meshSize,d=l.EXTENT/u,f=u*u;for(let _=0;_<=u;_++)for(let y=0;y<=u;y++)n.emplaceBack(y*d,_*d);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,pt.members),segments:l.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 ft=(a,t)=>l.emitValidationErrors(a,t&&t.filter(n=>n.identifier!=="source.canvas")),St=l.pick(ht,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Qt=l.pick(ht,["setCenter","setZoom","setBearing","setPitch"]),kt=function(){const a={},t=l.spec.$version;for(const n in l.spec.$root){const s=l.spec.$root[n];if(s.required){let u=null;u=n==="version"?t:s.type==="array"?[]:{},u!=null&&(a[n]=u)}}return a}();class li extends l.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new lr(mn(),this),this.imageManager=new Mt,this.imageManager.setEventedParent(this),this.glyphManager=new $t(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new wo(256,512),this.crossTileSymbolIndex=new Xe,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.getReferrer());const s=this;this._rtlTextPluginCallback=li.registerForPluginStateChange(u=>{s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:u.pluginStatus,pluginURL:u.pluginURL},(d,f)=>{if(l.triggerPluginCompletionEvent(d),f&&f.every(_=>_))for(const _ in s.sourceCaches)s.sourceCaches[_].reload()})}),this.on("data",u=>{if(u.dataType!=="source"||u.sourceDataType!=="metadata")return;const d=this.sourceCaches[u.sourceId];if(!d)return;const f=d.getSource();if(f&&f.vectorLayerIds)for(const _ in this._layers){const y=this._layers[_];y.source===f.id&&this._validateLayer(y)}})}loadURL(t,n={}){this.fire(new l.Event("dataloading",{dataType:"style"}));const s=typeof n.validate!="boolean"||n.validate,u=this.map._requestManager.transformRequest(t,l.ResourceType.Style);this._request=l.getJSON(u,(d,f)=>{this._request=null,d?this.fire(new l.ErrorEvent(d)):f&&this._load(f,s)})}loadJSON(t,n={}){this.fire(new l.Event("dataloading",{dataType:"style"})),this._request=l.exported.frame(()=>{this._request=null,this._load(t,n.validate!==!1)})}loadEmpty(){this.fire(new l.Event("dataloading",{dataType:"style"})),this._load(kt,!1)}_load(t,n){if(n&&ft(this,l.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=Nn(this.stylesheet.layers);this._order=s.map(u=>u.id),this._layers={},this._serializedLayers={};for(let u of s)u=l.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 pi(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new l.Event("data",{dataType:"style"})),this.fire(new l.Event("style.load"))}_loadSprite(t){this._spriteRequest=function(n,s,u,d){let f,_,y;const v=u>1?"@2x":"";let T=l.getJSON(s.transformRequest(s.normalizeSpriteURL(n,v,".json"),l.ResourceType.SpriteJSON),(F,R)=>{T=null,y||(y=F,f=R,C())}),I=l.getImage(s.transformRequest(s.normalizeSpriteURL(n,v,".png"),l.ResourceType.SpriteImage),(F,R)=>{I=null,y||(y=F,_=R,C())});function C(){if(y)d(y);else if(f&&_){const F=l.exported.getImageData(_),R={};for(const B in f){const{width:X,height:J,x:te,y:O,sdf:ne,pixelRatio:ie,stretchX:ue,stretchY:he,content:ye}=f[B],ce=new l.RGBAImage({width:X,height:J});l.RGBAImage.copy(F,ce,{x:te,y:O},{x:0,y:0},{width:X,height:J}),R[B]={data:ce,pixelRatio:ie,sdf:ne,stretchX:ue,stretchY:he,content:ye}}d(null,R)}}return{cancel(){T&&(T.cancel(),T=null),I&&(I.cancel(),I=null)}}}(t,this.map._requestManager,this.map.getPixelRatio(),(n,s)=>{if(this._spriteRequest=null,n)this.fire(new l.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 l.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 l.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),d=Object.keys(this._removedLayers);(u.length||d.length)&&this._updateWorkerLayers(u,d);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 d=this.sourceCaches[u];s[u]=d.used,d.used=!1}for(const u of this._order){const d=this._layers[u];d.recalculate(t,this._availableImages),!d.isHidden(t.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(const u in s){const d=this.sourceCaches[u];s[u]!==d.used&&d.fire(new l.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:u}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new l.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 tt(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 l.Event("terrain",{terrain:t}))}setState(t){if(this._checkLoaded(),ft(this,l.validateStyle(t)))return!1;(t=l.clone$1(t)).layers=Nn(t.layers);const n=function(u,d){if(!u)return[{command:ht.setStyle,args:[d]}];let f=[];try{if(!Te(u.version,d.version))return[{command:ht.setStyle,args:[d]}];Te(u.center,d.center)||f.push({command:ht.setCenter,args:[d.center]}),Te(u.zoom,d.zoom)||f.push({command:ht.setZoom,args:[d.zoom]}),Te(u.bearing,d.bearing)||f.push({command:ht.setBearing,args:[d.bearing]}),Te(u.pitch,d.pitch)||f.push({command:ht.setPitch,args:[d.pitch]}),Te(u.sprite,d.sprite)||f.push({command:ht.setSprite,args:[d.sprite]}),Te(u.glyphs,d.glyphs)||f.push({command:ht.setGlyphs,args:[d.glyphs]}),Te(u.transition,d.transition)||f.push({command:ht.setTransition,args:[d.transition]}),Te(u.light,d.light)||f.push({command:ht.setLight,args:[d.light]});const _={},y=[];(function(T,I,C,F){let R;for(R in I=I||{},T=T||{})Object.prototype.hasOwnProperty.call(T,R)&&(Object.prototype.hasOwnProperty.call(I,R)||zr(R,C,F));for(R in I)Object.prototype.hasOwnProperty.call(I,R)&&(Object.prototype.hasOwnProperty.call(T,R)?Te(T[R],I[R])||(T[R].type==="geojson"&&I[R].type==="geojson"&&Gn(T,I,R)?C.push({command:ht.setGeoJSONSourceData,args:[R,I[R].data]}):Pr(R,I,C,F)):er(R,I,C))})(u.sources,d.sources,y,_);const v=[];u.layers&&u.layers.forEach(T=>{_[T.source]?f.push({command:ht.removeLayer,args:[T.id]}):v.push(T)}),f=f.concat(y),function(T,I,C){I=I||[];const F=(T=T||[]).map(fr),R=I.map(fr),B=T.reduce(_n,{}),X=I.reduce(_n,{}),J=F.slice(),te=Object.create(null);let O,ne,ie,ue,he,ye,ce;for(O=0,ne=0;O<F.length;O++)ie=F[O],Object.prototype.hasOwnProperty.call(X,ie)?ne++:(C.push({command:ht.removeLayer,args:[ie]}),J.splice(J.indexOf(ie,ne),1));for(O=0,ne=0;O<R.length;O++)ie=R[R.length-1-O],J[J.length-1-O]!==ie&&(Object.prototype.hasOwnProperty.call(B,ie)?(C.push({command:ht.removeLayer,args:[ie]}),J.splice(J.lastIndexOf(ie,J.length-ne),1)):ne++,ye=J[J.length-O],C.push({command:ht.addLayer,args:[X[ie],ye]}),J.splice(J.length-O,0,ie),te[ie]=!0);for(O=0;O<R.length;O++)if(ie=R[O],ue=B[ie],he=X[ie],!te[ie]&&!Te(ue,he))if(Te(ue.source,he.source)&&Te(ue["source-layer"],he["source-layer"])&&Te(ue.type,he.type)){for(ce in pr(ue.layout,he.layout,C,ie,null,ht.setLayoutProperty),pr(ue.paint,he.paint,C,ie,null,ht.setPaintProperty),Te(ue.filter,he.filter)||C.push({command:ht.setFilter,args:[ie,he.filter]}),Te(ue.minzoom,he.minzoom)&&Te(ue.maxzoom,he.maxzoom)||C.push({command:ht.setLayerZoomRange,args:[ie,he.minzoom,he.maxzoom]}),ue)Object.prototype.hasOwnProperty.call(ue,ce)&&ce!=="layout"&&ce!=="paint"&&ce!=="filter"&&ce!=="metadata"&&ce!=="minzoom"&&ce!=="maxzoom"&&(ce.indexOf("paint.")===0?pr(ue[ce],he[ce],C,ie,ce.slice(6),ht.setPaintProperty):Te(ue[ce],he[ce])||C.push({command:ht.setLayerProperty,args:[ie,ce,he[ce]]}));for(ce in he)Object.prototype.hasOwnProperty.call(he,ce)&&!Object.prototype.hasOwnProperty.call(ue,ce)&&ce!=="layout"&&ce!=="paint"&&ce!=="filter"&&ce!=="metadata"&&ce!=="minzoom"&&ce!=="maxzoom"&&(ce.indexOf("paint.")===0?pr(ue[ce],he[ce],C,ie,ce.slice(6),ht.setPaintProperty):Te(ue[ce],he[ce])||C.push({command:ht.setLayerProperty,args:[ie,ce,he[ce]]}))}else C.push({command:ht.removeLayer,args:[ie]}),ye=J[J.lastIndexOf(ie)+1],C.push({command:ht.addLayer,args:[he,ye]})}(v,d.layers,f)}catch(_){console.warn("Unable to compute style diff:",_),f=[{command:ht.setStyle,args:[d]}]}return f}(this.serialize(),t).filter(u=>!(u.command in Qt));if(n.length===0)return!1;const s=n.filter(u=>!(u.command in St));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 l.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 l.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 l.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(l.validateStyle.source,`sources.${t}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const u=this.sourceCaches[t]=new yi(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 l.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 l.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 l.ErrorEvent(new Error(`Layer "${u}" already exists on this map.`)));let d;if(t.type==="custom"){if(ft(this,l.validateCustomStyleLayer(t)))return;d=l.createStyleLayer(t)}else{if(typeof t.source=="object"&&(this.addSource(u,t.source),t=l.clone$1(t),t=l.extend(t,{source:u})),this._validate(l.validateStyle.layer,`layers.${u}`,t,{arrayIndex:-1},s))return;d=l.createStyleLayer(t),this._validateLayer(d),d.setEventedParent(this,{layer:{id:u}}),this._serializedLayers[d.id]=d.serialize()}const f=n?this._order.indexOf(n):this._order.length;if(n&&f===-1)this.fire(new l.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]=d,this._removedLayers[u]&&d.source&&d.type!=="custom"){const _=this._removedLayers[u];delete this._removedLayers[u],_.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new l.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 l.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 l.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 l.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(!Te(u.filter,n))return n==null?(u.filter=void 0,void this._updateLayer(u)):void(this._validate(l.validateStyle.filter,`layers.${u.id}.filter`,n,null,s)||(u.filter=l.clone$1(n),this._updateLayer(u)))}else this.fire(new l.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return l.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,s,u={}){this._checkLoaded();const d=this.getLayer(t);d?Te(d.getLayoutProperty(n),s)||(d.setLayoutProperty(n,s,u),this._updateLayer(d)):this.fire(new l.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 l.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,s,u={}){this._checkLoaded();const d=this.getLayer(t);d?Te(d.getPaintProperty(n),s)||(d.setPaintProperty(n,s,u)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new l.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,d=this.sourceCaches[s];if(d===void 0)return void this.fire(new l.ErrorEvent(new Error(`The source '${s}' does not exist in the map's style.`)));const f=d.getSource().type;f==="geojson"&&u?this.fire(new l.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):f!=="vector"||u?(t.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(u,t.id,n)):this.fire(new l.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 l.ErrorEvent(new Error(`The source '${s}' does not exist in the map's style.`)));const d=u.getSource().type,f=d==="vector"?t.sourceLayer:void 0;d!=="vector"||f?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new l.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):u.removeFeatureState(f,t.id,n):this.fire(new l.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 l.ErrorEvent(new Error("The feature id parameter must be provided."))),u.getFeatureState(s,t.id)):void this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new l.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return l.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return l.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:l.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 T of v)u.push(T)}}}u.sort((f,_)=>_.intersectionZ-f.intersectionZ);const d=[];for(let f=this._order.length-1;f>=0;f--){const _=this._order[f];if(n(_))for(let y=u.length-1;y>=0;y--){const v=u[y].feature;if(s[v.layer.id]<f)break;d.push(v),u.pop()}else for(const y of t){const v=y[_];if(v)for(const T of v)d.push(T.feature)}}return d}queryRenderedFeatures(t,n,s){n&&n.filter&&this._validate(l.validateStyle.filter,"queryRenderedFeatures.filter",n.filter,null,n);const u={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new l.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const f of n.layers){const _=this._layers[f];if(!_)return this.fire(new l.ErrorEvent(new Error(`The layer '${f}' does not exist in the map's style and cannot be queried for features.`))),[];u[_.source]=!0}}const d=[];n.availableImages=this._availableImages;for(const f in this.sourceCaches)n.layers&&!u[f]||d.push(pn(this.sourceCaches[f],this._layers,this._serializedLayers,t,n,s));return this.placement&&d.push(function(f,_,y,v,T,I,C){const F={},R=I.queryRenderedSymbols(v),B=[];for(const X of Object.keys(R).map(Number))B.push(C[X]);B.sort(Qi);for(const X of B){const J=X.featureIndex.lookupSymbolFeatures(R[X.bucketInstanceId],_,X.bucketIndex,X.sourceLayerIndex,T.filter,T.layers,T.availableImages,f);for(const te in J){const O=F[te]=F[te]||[],ne=J[te];ne.sort((ie,ue)=>{const he=X.featureSortOrder;if(he){const ye=he.indexOf(ie.featureIndex);return he.indexOf(ue.featureIndex)-ye}return ue.featureIndex-ie.featureIndex});for(const ie of ne)O.push(ie)}}for(const X in F)F[X].forEach(J=>{const te=J.feature,O=y[f[X].source].getFeatureState(te.layer["source-layer"],te.id);te.source=te.layer.source,te.layer["source-layer"]&&(te.sourceLayer=te.layer["source-layer"]),te.state=O});return F}(this._layers,this._serializedLayers,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(d)}querySourceFeatures(t,n){n&&n.filter&&this._validate(l.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[t];return s?function(u,d){const f=u.getRenderableIds().map(v=>u.getTileByID(v)),_=[],y={};for(let v=0;v<f.length;v++){const T=f[v],I=T.tileID.canonical.key;y[I]||(y[I]=!0,T.querySourceFeatures(_,d))}return _}(s,n):[]}addSourceType(t,n,s){return li.getSourceType(t)?s(new Error(`A source type called "${t}" already exists.`)):(li.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(!Te(t[f],s[f])){u=!0;break}if(!u)return;const d={now:l.exported.now(),transition:l.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(d)}_validate(t,n,s,u,d={}){return(!d||d.validate!==!1)&&ft(this,t.call(l.validateStyle,l.extend({key:n,style:this.serialize(),value:s,styleSpec:l.spec},u)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.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,d=!1){let f=!1,_=!1;const y={};for(const v of this._order){const T=this._layers[v];if(T.type!=="symbol")continue;if(!y[T.source]){const C=this.sourceCaches[T.source];y[T.source]=C.getRenderableIds(!0).map(F=>C.getTileByID(F)).sort((F,R)=>R.tileID.overscaledZ-F.tileID.overscaledZ||(F.tileID.isLessThan(R.tileID)?-1:1))}const I=this.crossTileSymbolIndex.addLayer(T,y[T.source],t.center.lng);f=f||I}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.exported.now(),t.zoom))&&(this.pauseablePlacement=new ae(t,this.terrain,this._order,d,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(l.exported.now()),_=!0),f&&this.pauseablePlacement.placement.setStale()),_||f)for(const v of this._order){const T=this._layers[v];T.type==="symbol"&&this.placement.updateLayerOpacities(T,y[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.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 l.makeRequest(n,s)}}li.getSourceType=function(a){return hn[a]},li.setSourceType=function(a,t){hn[a]=t},li.registerForPluginStateChange=l.registerForPluginStateChange;var bn="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 qn={prelude:It(`#ifdef GL_ES
3
3
  precision mediump float;
4
4
  #else