@defra/interactive-map 0.0.46-fmp-2 → 0.0.47-alpha

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.
@@ -1 +1 @@
1
- import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import l from"ol/source/Vector.js";import u from"ol/source/VectorTile.js";import"ol/tilegrid.js";import p from"ol/tilegrid/TileGrid.js";import{distance as c}from"ol/coordinate.js";import{toPromise as f}from"ol/functions.js";import d from"ol/render/Feature.js";import m from"ol/style/Circle.js";import y from"ol/style/Fill.js";import h from"ol/style/Icon.js";import g from"ol/style/Stroke.js";import v from"ol/style/Style.js";import b from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import x from"@babel/runtime/helpers/asyncToGenerator";import{defaults as w}from"ol/interaction/defaults.js";import k from"proj4";import{register as M}from"ol/proj/proj4.js";import S from"@babel/runtime/helpers/defineProperty";import z from"ol/source/XYZ.js";import j from"ol/source/TileWMS.js";import C from"ol/source/OGCVectorTile.js";import A from"ol/TileState.js";import{fromString as O}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as E}from"ol/render/canvas.js";import{getUid as _}from"ol/util.js";import P from"ol/Feature.js";class I{isBaseMapReady(){throw new Error(this.name+" must implement isBaseMapReady()")}}var $=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],T=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],q=[-238375,1376256],D=300,F=2,N=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],L="uk",R="world";var G=(e,t)=>{var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function H(e){var{map:t,view:r,emit:n,eventBus:o,events:a,on:i,debouncers:s}=e,l=!1,u=G(()=>{l=!1,n(a.MAP_MOVE_END)},500);s.push(u);var p,c,f,d=(p=()=>n(a.MAP_MOVE),c=10,f=0,function(){var e=Date.now();e-f>=c&&(f=e,p(...arguments))});i(r,"change",()=>{l||(l=!0,o.emit(a.MAP_MOVE_START)),u()}),i(t,"postrender",()=>{l&&d()})}function B(e){var{map:t,source:r,events:n,eventBus:o,getZoom:a,getCenter:i,getBounds:s,getResolution:l}=e,u=!1,p=[],c=[],f=[],d=t.getView(),m=e=>{var t=(()=>{if(u)return null;var e=a();return{center:i(),bounds:s(),resolution:l(),zoom:e,isAtMaxZoom:e+.01>=d.getMaxZoom(),isAtMinZoom:e-.01<=d.getMinZoom()}})();t&&o.emit(e,t)},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])},h=(e,t,r)=>{e.on(t,r),c.push([e,t,r])},g=!1,v=()=>{g||(g=!0,o.emit(n.MAP_LOADED))},b=G(()=>m(n.MAP_DATA_CHANGE),500);f.push(b);var x=e=>{u||(c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c=[],h(e,"tileloadend",v),h(e,"tileloadend",b))};return H({map:t,view:t.getView(),emit:m,eventBus:o,events:n,on:y,debouncers:f}),x(r),t.once("rendercomplete",()=>m(n.MAP_FIRST_IDLE)),function(e){var{map:t,eventBus:r,events:n,on:o}=e,a=null;o(t,"pointerdown",e=>{a=e.pixel}),o(t,"click",e=>{if(a){var t=e.pixel[0]-a[0],o=e.pixel[1]-a[1];if(Math.hypot(t,o)>6)return}r.emit(n.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:t,eventBus:o,events:n,on:y}),y(t,"postrender",()=>o.emit(n.MAP_RENDER)),{setSource:x,remove(){u=!0,f.forEach(e=>e.cancel()),p.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)})}}}var V={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-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","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const Z=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function U(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return Z.forEach(e=>{e in t&&(r[e]=t[e])}),r}class W extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class J{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new J(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 X={kind:"null"},Y={kind:"number"},K={kind:"string"},Q={kind:"boolean"},ee={kind:"color"},te={kind:"projectionDefinition"},re={kind:"object"},ne={kind:"value"},oe={kind:"collator"},ae={kind:"formatted"},ie={kind:"padding"},se={kind:"colorArray"},le={kind:"numberArray"},ue={kind:"resolvedImage"},pe={kind:"variableAnchorOffsetCollection"};function ce(e,t){return{kind:"array",itemType:e,N:t}}function fe(e){if("array"===e.kind){const t=fe(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const de=[X,Y,K,Q,ee,te,ae,re,ce(ne),ie,le,se,ue,pe];function me(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!me(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of de)if(!me(e,t))return null}return`Expected ${fe(e)} but found ${fe(t)} instead.`}function ye(e,t){return t.some(t=>t.kind===e.kind)}function he(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function ge(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const ve=.96422,be=.82521,xe=4/29,we=6/29,ke=3*we*we,Me=we*we*we,Se=Math.PI/180,ze=180/Math.PI;function je(e){return(e%=360)<0&&(e+=360),e}function Ce([e,t,r,n]){let o,a;const i=Oe((.2225045*(e=Ae(e))+.7168786*(t=Ae(t))+.0606169*(r=Ae(r)))/1);e===t&&t===r?o=a=i:(o=Oe((.4360747*e+.3850649*t+.1430804*r)/ve),a=Oe((.0139322*e+.0971045*t+.7141733*r)/be));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function Ae(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Oe(e){return e>Me?Math.pow(e,1/3):e/ke+xe}function Ee([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*Pe(o),a=ve*Pe(a),i=be*Pe(i),[_e(3.1338561*a-1.6168667*o-.4906146*i),_e(-.9787684*a+1.9161415*o+.033454*i),_e(.0719453*a-.2289914*o+1.4052427*i),n]}function _e(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Pe(e){return e>we?e*e*e:ke*(e-xe)}const Ie=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function $e(e,t){return Ie(e,t)?e[t]:void 0}function Te(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=$e(Le,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[qe(e.slice(r,r+=t)),qe(e.slice(r,r+=t)),qe(e.slice(r,r+=t)),qe(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[Fe(+t/r,0,1),Fe(+a/r,0,1),Fe(+l/r,0,1),c?De(+c,f):1];if(Ne(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,Fe(+o,0,100),Fe(+i,0,100),l?De(+l,u):1];if(Ne(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=je(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function qe(e){return parseInt(e.padEnd(2,e),16)/255}function De(e,t){return Fe(t?e/100:e,0,1)}function Fe(e,t,r){return Math.min(Math.max(t,e),r)}function Ne(e){return!e.some(Number.isNaN)}const Le={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Re(e,t,r){return e+r*(t-e)}function Ge(e,t,r){return e.map((e,n)=>Re(e,t[n],r))}class He{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof He)return e;if("string"!=typeof e)return;const t=Te(e);return t?new He(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=Ce(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?je(Math.atan2(n,r)*ze):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ce(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=Ge(e.rgb,t.rgb,r);return new He(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*Se,Ee([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Re(o,l,r),Re(a,u,r),Re(i,p,r)]);return new He(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=Ee(Ge(e.lab,t.lab,r));return new He(n,o,a,i,!1)}}}}He.black=new He(0,0,0,1),He.white=new He(1,1,1,1),He.transparent=new He(0,0,0,0),He.red=new He(1,0,0,1);class Be{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Ve=["bottom","center","top"];class Ze{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class Ue{constructor(e){this.sections=e}static fromString(e){return new Ue([new Ze(e,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof Ue?e:Ue.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class We{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof We)return e;if("number"==typeof e)return new We([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)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 We(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new We(Ge(e.values,t.values,r))}}class Je{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Je)return e;if("number"==typeof e)return new Je([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new Je(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Je(Ge(e.values,t.values,r))}}class Xe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xe)return e;if("string"==typeof e){const t=He.parse(e);if(!t)return;return new Xe([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=He.parse(r);if(!e)return;t.push(e)}return new Xe(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(He.interpolate(e.values[a],t.values[a],r,n));return new Xe(o)}}class Ye extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Ke=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qe)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!Ke.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new Qe(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new Ye(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new Ye(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Re(t,s,r),Re(i,l,r)])}return new Qe(a)}}class et{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new et({name:e,available:!1}):null}}class tt{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new tt(e,t,r)}static parse(e){return e instanceof tt?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new tt(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new tt(e.from,e.to,e.transition):"string"==typeof e?new tt(e,e,1):void 0}}function rt(e,t,r,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function nt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof tt||e instanceof He||e instanceof Be||e instanceof Ue||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Qe||e instanceof et)return!0;if(Array.isArray(e)){for(const t of e)if(!nt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!nt(e[t]))return!1;return!0}return!1}function ot(e){if(null===e)return X;if("string"==typeof e)return K;if("boolean"==typeof e)return Q;if("number"==typeof e)return Y;if(e instanceof He)return ee;if(e instanceof tt)return te;if(e instanceof Be)return oe;if(e instanceof Ue)return ae;if(e instanceof We)return ie;if(e instanceof Je)return le;if(e instanceof Xe)return se;if(e instanceof Qe)return pe;if(e instanceof et)return ue;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=ot(t);if(r){if(r===e)continue;r=ne;break}r=e}return ce(r||ne,t)}return re}function at(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof He||e instanceof tt||e instanceof Ue||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Qe||e instanceof et?e.toString():JSON.stringify(e)}class it{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!nt(e[1]))return t.error("invalid value");const r=e[1];let n=ot(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new it(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const st={string:K,number:Y,boolean:Q,object:re};class lt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in st)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=st[r],n++}else o=ne;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=ce(o,a)}else{if(!st[o])throw new Error(`Types doesn't contain name = ${o}`);r=st[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,ne);if(!r)return null;a.push(r)}return new lt(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!me(this.type,ot(r)))return r;if(t===this.args.length-1)throw new Ye(`Expected value to be of type ${fe(this.type)}, but found ${fe(ot(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ut={"to-boolean":Q,"to-color":ee,"to-number":Y,"to-string":K};class pt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!ut[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=ut[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,ne);if(!n)return null;o.push(n)}return new pt(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof He)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:rt(t[0],t[1],t[2],t[3]),!r))return new He(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ye(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=We.parse(t);if(n)return n}throw new Ye(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Je.parse(t);if(n)return n}throw new Ye(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Xe.parse(t);if(n)return n}throw new Ye(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=Qe.parse(t);if(n)return n}throw new Ye(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Ye(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Ue.fromString(at(this.args[0].evaluate(e)));case"resolvedImage":return et.fromString(at(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return at(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ct=["Unknown","Point","LineString","Polygon"];class ft{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ct[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=He.parse(e),this._parseColorCache.set(e,t)),t}}class dt{constructor(e,t,r=[],n,o=new J,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new lt(t,[e]):"coerce"===r?new pt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof it)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new ft;try{n=new it(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new dt(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new W(r,e))}checkSubtype(e,t){const r=me(e,t);return r&&this.error(r),r}}class mt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new mt(r,n):null}outputDefined(){return this.result.outputDefined()}}class yt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new yt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class ht{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Y),n=t.parse(e[2],2,ce(t.expectedType||ne));if(!r||!n)return null;const o=n.type;return new ht(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ye(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Ye(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Ye(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class gt{constructor(e,t){this.type=Q,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,ne);return r&&n?ye(r.type,[Q,K,Y,X,ne])?new gt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${fe(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!he(t,["boolean","string","number","null"]))throw new Ye(`Expected first argument to be of type boolean, string, number or null, but found ${fe(ot(t))} instead.`);if(!he(r,["string","array"]))throw new Ye(`Expected second argument to be of type array or string, but found ${fe(ot(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class vt{constructor(e,t,r){this.type=Y,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,ne);if(!r||!n)return null;if(!ye(r.type,[Q,K,Y,X,ne]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${fe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Y);return o?new vt(r,n,o):null}return new vt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!he(t,["boolean","string","number","null"]))throw new Ye(`Expected first argument to be of type boolean, string, number or null, but found ${fe(ot(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),he(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(he(r,["array"]))return r.indexOf(t,n);throw new Ye(`Expected second argument to be of type array or string, but found ${fe(ot(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class bt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ot(e)))return null}else r=ot(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,ne);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new bt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(ot(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class xt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,Q);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new xt(r,n,o)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class wt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,Y);if(!r||!n)return null;if(!ye(r.type,[ce(ne),K,ne]))return t.error(`Expected first argument to be of type array or string, but found ${fe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Y);return o?new wt(r.type,r,n,o):null}return new wt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),he(t,["string"]))return[...t].slice(r,n).join("");if(he(t,["array"]))return t.slice(r,n);throw new Ye(`Expected first argument to be of type array or string, but found ${fe(ot(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function kt(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new Ye("Input is not a number.");i=s-1}return 0}class Mt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,Y);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new Mt(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[kt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zt,jt;var Ct=function(){if(jt)return zt;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return jt=1,zt=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},zt}(),At=St(Ct);class Ot{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=Et(t,e.base,r,n);else if("linear"===e.name)o=Et(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new At(a[0],a[1],a[2],a[3]).solve(Et(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,Y),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==se?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=ee;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return ge(s,Y)||ge(s,te)||ge(s,ee)||ge(s,ie)||ge(s,le)||ge(s,se)||ge(s,pe)||ge(s,ce(Y))?new Ot(s,r,n,o,i):t.error(`Type ${fe(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=kt(t,n),i=t[a],s=t[a+1],l=Ot.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Re(u,p,l);case"color":return He.interpolate(u,p,l);case"padding":return We.interpolate(u,p,l);case"colorArray":return Xe.interpolate(u,p,l);case"numberArray":return Je.interpolate(u,p,l);case"variableAnchorOffsetCollection":return Qe.interpolate(u,p,l);case"array":return Ge(u,p,l);case"projectionDefinition":return tt.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return He.interpolate(u,p,l,"hcl");case"colorArray":return Xe.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return He.interpolate(u,p,l,"lab");case"colorArray":return Xe.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Et(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class _t{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>me(n,e.type));return new _t(a?ne:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof et&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Pt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function It(e,t,r,n){return 0===n.compare(t,r)}function $t(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=Q,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,ne);if(!a)return null;if(!Pt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${fe(a.type)}'.`);let i=t.parse(e[2],2,ne);if(!i)return null;if(!Pt(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${fe(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${fe(a.type)}' and '${fe(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new lt(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new lt(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,oe),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=ot(a),r=ot(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ye(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=ot(a),r=ot(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Tt=$t("==",function(e,t,r){return t===r},It),qt=$t("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!It(0,t,r,n)}),Dt=$t("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Ft=$t(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Nt=$t("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Lt=$t(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Rt{constructor(e,t,r){this.type=oe,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Q);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Q);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,K),!a)?null:new Rt(n,o,a)}evaluate(e){return new Be(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}}class Gt{constructor(e,t,r,n,o,a){this.type=K,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Y);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,K),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,K),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,K),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,Y),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,Y),!l)?null:new Gt(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ht{constructor(e){this.type=ae,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,Y),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,ce(K)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,ee),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Ve.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,K),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,ne);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Ht(n)}evaluate(e){return new Ue(this.sections.map(t=>{const r=t.content.evaluate(e);return ot(r)===ue?new Ze("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Ze(at(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Bt{constructor(e){this.type=ue,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,K);return r?new Bt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=et.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Vt{constructor(e){this.type=Y,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${fe(r.type)} instead.`):new Vt(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new Ye(`Expected value to be of type string or array, but found ${fe(ot(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Zt=8192;function Ut(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*Zt),Math.round(n*a*Zt)]}function Wt(e,t){const r=Math.pow(2,t.z),n=(e[0]/Zt+t.x)/r,o=(e[1]/Zt+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function Jt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Xt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function Yt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Kt(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function Qt(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!ar(e,t,r,n)||!ar(r,n,e,t));var i,s}function er(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(Qt(e,t,n[r],n[r+1]))return!0;return!1}function tr(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(Kt(e,o[t],o[t+1]))return r;Yt(e,o[t],o[t+1])&&(n=!n)}return n}function rr(e,t){for(const r of t)if(tr(e,r))return!0;return!1}function nr(e,t){for(const r of e)if(!tr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(er(e[r],e[r+1],t))return!1;return!0}function or(e,t){for(const r of t)if(nr(e,r))return!0;return!1}function ar(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function ir(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=Ut(e[o][n],r);Jt(t,i),a.push(i)}n.push(a)}return n}function sr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=ir(e[o],t,r);n.push(a)}return n}function lr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}Jt(t,e)}function ur(e,t,r,n){const o=Math.pow(2,n.z)*Zt,a=[n.x*Zt,n.y*Zt],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];lr(n,t,r,o),i.push(n)}return i}function pr(e,t,r,n){const o=Math.pow(2,n.z)*Zt,a=[n.x*Zt,n.y*Zt],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];Jt(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)lr(n,t,r,o)}return i}class cr{constructor(e,t){this.type=Q,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(nt(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new cr(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new cr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new cr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ir(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!tr(e,a))return!1}if("MultiPolygon"===t.type){const a=sr(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!rr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ir(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!nr(e,a))return!1}if("MultiPolygon"===t.type){const a=sr(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!or(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class fr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function dr(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const mr=1/298.257223563,yr=mr*(2-mr),hr=Math.PI/180;class gr{constructor(e){const t=6378.137*hr*1e3,r=Math.cos(e*hr),n=1/(1-yr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-yr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function vr(e,t){return t[0]-e[0]}function br(e){return e[1]-e[0]+1}function xr(e,t){return e[1]>=e[0]&&e[1]<t}function wr(e,t){if(e[0]>e[1])return[null,null];const r=br(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function kr(e,t){if(!xr(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Jt(r,e[n]);return r}function Mr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)Jt(t,e);return t}function Sr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function zr(e,t,r){if(!Sr(e)||!Sr(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function jr(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Cr(e,t,r,n,o){const a=Math.min(jr(e,[r,n],o),jr(t,[r,n],o)),i=Math.min(jr(r,[e,t],o),jr(n,[e,t],o));return Math.min(a,i)}function Ar(e,t,r,n,o){if(!(xr(t,e.length)&&xr(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(Qt(t,s,n,i))return 0;a=Math.min(a,Cr(t,s,n,i,o))}}return a}function Or(e,t,r,n,o){if(!(xr(t,e.length)&&xr(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function Er(e,t,r){if(tr(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,jr(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function _r(e,t,r,n){if(!xr(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(tr(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(Qt(t,i,a,l))return 0;o=Math.min(o,Cr(t,i,a,l,n))}}return o}function Pr(e,t){for(const r of e)for(const e of r)if(tr(e,t,!0))return!0;return!1}function Ir(e,t,r,n=1/0){const o=Mr(e),a=Mr(t);if(n!==1/0&&zr(o,a,r)>=n)return n;if(Xt(o,a)){if(Pr(e,t))return 0}else if(Pr(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(Qt(o,s,n,l))return 0;i=Math.min(i,Cr(o,s,n,l,r))}}return i}function $r(e,t,r,n,o,a){if(!a)return;const i=zr(kr(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function Tr(e,t,r,n,o,a,i){if(!a||!i)return;const s=zr(kr(n,a),kr(o,i),r);s<t&&e.push([s,a,i])}function qr(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new fr([[0,[0,e.length-1],[0,0]]],vr),s=Mr(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(br(l)<=u){if(!xr(l,e.length))return NaN;if(t){const t=_r(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=Er(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=wr(l,t);$r(i,a,n,e,s,r[0]),$r(i,a,n,e,s,r[1])}}return a}function Dr(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new fr([[0,[0,e.length-1],[0,r.length-1]]],vr);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(br(l)<=p&&br(u)<=c){if(!xr(l,e.length)&&xr(u,r.length))return NaN;let a;if(t&&n)a=Ar(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=jr(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=jr(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=Or(e,l,r,u,o),i=Math.min(i,a)}else{const a=wr(l,t),p=wr(u,n);Tr(s,i,o,e,r,a[0],p[0]),Tr(s,i,o,e,r,a[0],p[1]),Tr(s,i,o,e,r,a[1],p[0]),Tr(s,i,o,e,r,a[1],p[1])}}return i}function Fr(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=dr(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>Wt([t.x,t.y],e.canonical)))),o=new gr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,qr([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,qr(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,Ir(t,e.coordinates,o,a))}if(0===a)return a}return a}function Nr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Lr{constructor(e,t){this.type=Y,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(nt(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Lr(t,t.features.map(e=>Nr(e.geometry)).flat());if("Feature"===t.type)return new Lr(t,Nr(t.geometry));if("type"in t&&"coordinates"in t)return new Lr(t,Nr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Wt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new gr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Dr(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Dr(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,qr(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Wt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new gr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Dr(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Dr(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,qr(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Fr(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Rr{constructor(e){this.type=ne,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Rr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?$e(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Gr={"==":Tt,"!=":qt,">":Ft,"<":Dt,">=":Lt,"<=":Nt,array:lt,at:ht,boolean:lt,case:xt,coalesce:_t,collator:Rt,format:Ht,image:Bt,in:gt,"index-of":vt,interpolate:Ot,"interpolate-hcl":Ot,"interpolate-lab":Ot,length:Vt,let:mt,literal:it,match:bt,number:lt,"number-format":Gt,object:lt,slice:wt,step:Mt,string:lt,"to-boolean":pt,"to-color":pt,"to-number":pt,"to-string":pt,var:yt,within:cr,distance:Lr,"global-state":Rr};class Hr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=Hr.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new dt(t.registry,Wr,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Hr(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(fe).join(", ")})`:`(${fe(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(fe(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Hr.definitions=t;for(const r in t)e[r]=Hr}}function Br(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=rt(t,r,n,a);if(i)throw new Ye(i);return new He(t/255,r/255,n/255,a,!1)}function Vr(e,t){return e in t}function Zr(e,t){const r=t[e];return void 0===r?null:r}function Ur(e){return{type:e}}function Wr(e){if(e instanceof yt)return Wr(e.boundExpression);if(e instanceof Hr&&"error"===e.name)return!1;if(e instanceof Rt)return!1;if(e instanceof cr)return!1;if(e instanceof Lr)return!1;if(e instanceof Rr)return!1;const t=e instanceof pt||e instanceof lt;let r=!0;return e.eachChild(e=>{r=t?r&&Wr(e):r&&e instanceof it}),!!r&&(Jr(e)&&Yr(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function Jr(e){if(e instanceof Hr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof cr)return!1;if(e instanceof Lr)return!1;let t=!0;return e.eachChild(e=>{t&&!Jr(e)&&(t=!1)}),t}function Xr(e){if(e instanceof Hr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!Xr(e)&&(t=!1)}),t}function Yr(e,t){if(e instanceof Hr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!Yr(e,t)&&(r=!1)}),r}function Kr(e){return{result:"success",value:e}}function Qr(e){return{result:"error",value:e}}function en(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&ot(e)===re}Hr.register(Gr,{error:[{kind:"error"},[K],(e,[t])=>{throw new Ye(t.evaluate(e))}],typeof:[K,[ne],(e,[t])=>fe(ot(t.evaluate(e)))],"to-rgba":[ce(Y,4),[ee],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[ee,[Y,Y,Y],Br],rgba:[ee,[Y,Y,Y,Y],Br],has:{type:Q,overloads:[[[K],(e,[t])=>Vr(t.evaluate(e),e.properties())],[[K,re],(e,[t,r])=>Vr(t.evaluate(e),r.evaluate(e))]]},get:{type:ne,overloads:[[[K],(e,[t])=>Zr(t.evaluate(e),e.properties())],[[K,re],(e,[t,r])=>Zr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ne,[K],(e,[t])=>Zr(t.evaluate(e),e.featureState||{})],properties:[re,[],e=>e.properties()],"geometry-type":[K,[],e=>e.geometryType()],id:[ne,[],e=>e.id()],zoom:[Y,[],e=>e.globals.zoom],"heatmap-density":[Y,[],e=>e.globals.heatmapDensity||0],elevation:[Y,[],e=>e.globals.elevation||0],"line-progress":[Y,[],e=>e.globals.lineProgress||0],accumulated:[ne,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Y,Ur(Y),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[Y,Ur(Y),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:Y,overloads:[[[Y,Y],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Y],(e,[t])=>-t.evaluate(e)]]},"/":[Y,[Y,Y],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Y,[Y,Y],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Y,[],()=>Math.LN2],pi:[Y,[],()=>Math.PI],e:[Y,[],()=>Math.E],"^":[Y,[Y,Y],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Y,[Y],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))],log2:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Y,[Y],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Y,[Y],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Y,[Y],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Y,[Y],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Y,[Y],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Y,[Y],(e,[t])=>Math.atan(t.evaluate(e))],min:[Y,Ur(Y),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[Y,Ur(Y),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[Y,[Y],(e,[t])=>Math.abs(t.evaluate(e))],round:[Y,[Y],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Y,[Y],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Y,[Y],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Q,[K,ne],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[Q,[ne],(e,[t])=>e.id()===t.value],"filter-type-==":[Q,[K],(e,[t])=>e.geometryType()===t.value],"filter-<":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[Q,[ne],(e,[t])=>t.value in e.properties()],"filter-has-id":[Q,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[Q,[ce(K)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Q,[ce(ne)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Q,[K,ce(ne)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Q,[K,ce(ne)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Q,overloads:[[[Q,Q],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Ur(Q),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:Q,overloads:[[[Q,Q],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Ur(Q),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[Q,[Q],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Q,[K],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[K,[K],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[K,[K],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[K,Ur(ne),(e,t)=>t.map(t=>at(t.evaluate(e))).join("")],split:[ce(K),[K,K],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[K,[ce(K),K],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[K,[oe],(e,[t])=>t.evaluate(e).resolvedLocale()]});class tn{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new ft,this._defaultValue=t?function(e){if("color"===e.type&&en(e.default))return new He(0,0,0,0);switch(e.type){case"color":return He.parse(e.default)||null;case"padding":return We.parse(e.default)||null;case"numberArray":return Je.parse(e.default)||null;case"colorArray":return Xe.parse(e.default)||null;case"variableAnchorOffsetCollection":return Qe.parse(e.default)||null;case"projectionDefinition":return tt.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=pn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ye(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function rn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Gr}function nn(e,t,r){const n=new dt(Gr,Wr,[],t?function(e){const t={color:ee,string:K,number:Y,enum:K,boolean:Q,formatted:ae,padding:ie,numberArray:le,colorArray:se,projectionDefinition:te,resolvedImage:ue,variableAnchorOffsetCollection:pe};if("array"===e.type)return ce(t[e.value]||ne,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Kr(new tn(o,t,r)):Qr(n.errors)}class on{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Xr(t.expression),this.globalStateRefs=un(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class an{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Xr(t.expression),this.globalStateRefs=un(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?Ot.interpolationFactor(this.interpolationType,e,t,r):0}}function sn(e,t,r){const n=nn(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=Jr(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return Qr([new W("","data expressions not supported")]);var i;const s=Yr(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return Qr([new W("","zoom expressions not supported")]);const l=ln(o);if(!l&&!s)return Qr([new W("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof W)return Qr([l]);if(l instanceof Ot&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return Qr([new W("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Kr(new on(a?"constant":"source",n.value,r));const u=l instanceof Ot?l.interpolation:void 0;return Kr(new an(a?"camera":"composite",n.value,l.labels,u,r))}function ln(e){let t=null;if(e instanceof mt)t=ln(e.result);else if(e instanceof _t){for(const r of e.args)if(t=ln(r),t)break}else(e instanceof Mt||e instanceof Ot)&&e.input instanceof Hr&&"zoom"===e.input.name&&(t=e);return t instanceof W||e.eachChild(e=>{const r=ln(e);r instanceof W?t=r:!t&&r?t=new W("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new W("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function un(e,t=new Set){return e instanceof Rr&&t.add(e.key),e.eachChild(e=>{un(e,t)}),t}function pn(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function cn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!cn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const fn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function dn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};cn(e)||(e=hn(e));const r=nn(e,fn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:yn(e),getGlobalStateRefs:()=>un(r.value.expression)}}function mn(e,t){return e<t?-1:e>t?1:0}function yn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(yn(e[t]))return!0;return!1}function hn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?gn(e[1],e[2],"=="):"!="===t?xn(gn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?gn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(hn))):"all"===t?["all"].concat(e.slice(1).map(hn)):"none"===t?["all"].concat(e.slice(1).map(hn).map(xn)):"in"===t?vn(e[1],e.slice(2)):"!in"===t?xn(vn(e[1],e.slice(2))):"has"===t?bn(e[1]):"!has"!==t||xn(bn(e[1]))}function gn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function vn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(mn)]]:["filter-in-small",e,["literal",t]]}}function bn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function xn(e){return["!",e]}function wn(e){return"object"==typeof e?["literal",e]:e}function kn(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,wn(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],On(e[1])]:[e[0],wn(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=An({},t);if("exponential"===i){const r=[Mn(e),["linear"],["zoom"]];for(const e of a){Cn(r,e,zn(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){Cn(e,r,zn(n[r],t,o[r]),!0)}return jn(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=An(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[Mn(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)Cn(a,e[0],e[1],i);return jn(a),a}(e,t,r):zn(e,t,r)}function Mn(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Sn(e,t){const r=wn((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function zn(e,t,r){const n=An(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(Sn(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)Cn(n,e[0],e[1],!1);return n.push(Sn(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)Cn(t,e[0],e[1],!0);return jn(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,wn(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[Mn(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)Cn(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,wn(e.default)]}throw new Error(`Unknown property function type ${n}`)}function jn(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function Cn(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function An(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function On(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const En=V;function _n(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return He.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function Pn(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",Pn(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=Pn(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push(Pn(e[t]));return o}}}return e}const In={},$n={zoom:0,distanceFromCenter:0};Hr.register(Gr,{...Hr.definitions,pitch:[{kind:"number"},[],e=>$n.pitch||0],"distance-from-center":[{kind:"number"},[],e=>$n.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(O(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],_n],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],_n],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=In[t.evaluate(e)];return void 0===r?{}:r}]});var Tn={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},qn=" ",Dn=/(italic|oblique)$/i,Fn={};function Nn(e,t,r){var n=Fn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Dn.test(f)&&(f=f.replace(Dn,""),s=a?s:c[c.length-1].replace(f,""),a=!0),Tn){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:Tn[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(qn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(qn)&&(y='"'+y+'"'),l.push(y)}n=Fn[e]=[s,i,l]}return n[0]+qn+n[1]+qn+t+"px"+(r?"/"+r:"")+qn+n[2]}const Ln=Object.freeze({}),Rn={},Gn={};let Hn=0;function Bn(e){return e.id||(e.id=Hn++),e.id}function Vn(e){return e*Math.PI/180}const Zn=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Un(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function Wn(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=Un(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function Jn(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function Xn(e,t,r){const n=Un(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=Jn(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const Yn=Array(256).join(" ");function Kn(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=Yn.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let Qn;function eo(){return Qn||(Qn=Un(1,1).getContext("2d")),Qn}function to(e,t){return eo().measureText(e).width+(e.length-1)*t}const ro={};function no(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(no(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=ro[o];if(!a){const i=e.split(" ");if(i.length>1){const e=eo();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;to(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(to(r,n)<.35*o){const o=e>0?to(l[e-1],n):1/0,a=e<t-1?to(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(to(r,n)>.7*o&&to(a,n)<.6*o){const i=r.split(" "),s=i.pop();to(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=Kn(a,n),ro[o]=a}return a}E.on("propertychange",()=>{for(const e in ro)delete ro[e]});const oo={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},ao={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},io=function(e,t){let r=sn(e,t);if("error"===r.result){const n=Pn(e);n!==e&&(r=sn(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let so,lo;function uo(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Ln)[r];const o=En[`${t}_${e.type}`]&&En[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=rn(n);if(!a&&en(n)&&(n=kn(n,o),a=!0),a){const e=io(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=He.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(rn(r)||en(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!rn(o)&&en(o)&&(o=kn(o,e)),rn(o)){const r=io(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r]($n,n,a)}function po(e,t,r,n){if(!uo(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return uo(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function co(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=dn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e]($n,r)}function fo(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const mo=/\{[^{}}]*\}/g;function yo(e,t){return e.replace(mo,function(e){return t[e.slice(1,-1)]||""})}function ho(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let go=!1;const vo={};function bo(t,n,o,a=Zn,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&(In[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");vo[function(e,t){return Bn(e)+"."+_(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];f(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const x=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=U(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],M={},S={},z=function(e){let t=Rn[e.id];return t||(t={},Rn[Bn(e)]=t),t}(n),j=function(e){let t=Gn[e.id];return t||(t={},Gn[Bn(e)]=t),t}(n);let C;for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(C){if(t.source!==C)throw new Error(`Layer "${r}" does not use source "${C}`)}else{C=t.source;const e=n.sources[C];if(!e)throw new Error(`Source "${C}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${C}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const A=[],O=function(o,s,f){const x=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),C=w[k[x]];if(!C)return;let O=a.indexOf(s);-1==O&&(O=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),$n.zoom=O,$n.distanceFromCenter=0;const E=o.getGeometry(),_=oo[E.getType()],P=t.get("map");if(P&&P instanceof e&&1===_){const e=P.getSize();if(e){const t=P.getView().getCenter(),n=r(E.getExtent());$n.distanceFromCenter=c(t,n)/s/e[1]}}const I={id:o.getId(),properties:k,type:_},$=t.get("mapbox-featurestate")[o.getId()];let T,q=-1;for(let e=0,r=C.length;e<r;++e){const r=C[e],a=r.layer,c=a.id;if(void 0!==f&&f!==c)continue;const x=a.layout||Ln,w=a.paint||Ln;if("none"===uo(a,"layout","visibility",I,z,$)||"minzoom"in a&&O<a.minzoom||"maxzoom"in a&&O>=a.maxzoom)continue;const E=a.filter;if(!E||co(c,E,I,j)){let e,c,f,j,C,O;T=a;const E=r.index;if(3==_&&("fill"==a.type||"fill-extrusion"==a.type))if(c=uo(a,"paint",a.type+"-opacity",I,z,$),a.type+"-pattern"in w){const e=uo(a,"paint",a.type+"-pattern",I,z,$);if(e){const t="string"==typeof e?yo(e,k):e.toString(),r=ho(t,p);if(i&&i[t]&&r){++q,O=A[q],O&&O.getFill()&&!O.getStroke()&&!O.getText()||(O=new v({fill:new y}),A[q]=O),f=O.getFill(),O.setZIndex(E);const e=t+"."+c;let n=S[e];if(!n){const o=i[t],a=Un(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),S[e]=n}f.setColor(n)}}}else if(e=fo(uo(a,"paint",a.type+"-color",I,z,$),c),a.type+"-outline-color"in w&&(C=fo(uo(a,"paint",a.type+"-outline-color",I,z,$),c)),C||(C=e),e||C){if(++q,O=A[q],(!O||e&&!O.getFill()||!e&&O.getFill()||C&&!O.getStroke()||!C&&O.getStroke()||O.getText())&&(O=new v({fill:e?new y:void 0,stroke:C?new g:void 0}),A[q]=O),e&&(f=O.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=uo(a,"paint","fill-extrusion-height",I,z,$);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(C&&"transparent"!==C){const e=He.parse(C);C=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}C&&(j=O.getStroke(),j.setColor(C),j.setWidth(.5)),O.setZIndex(E)}if(1!=_&&"line"==a.type){e="line-pattern"in w?void 0:fo(uo(a,"paint","line-color",I,z,$),uo(a,"paint","line-opacity",I,z,$));const t=uo(a,"paint","line-width",I,z,$);e&&t>0&&(++q,O=A[q],O&&O.getStroke()&&!O.getFill()&&!O.getText()||(O=new v({stroke:new g}),A[q]=O),j=O.getStroke(),j.setLineCap(uo(a,"layout","line-cap",I,z,$)),j.setLineJoin(uo(a,"layout","line-join",I,z,$)),j.setMiterLimit(uo(a,"layout","line-miter-limit",I,z,$)),j.setColor(e),j.setWidth(t),j.setLineDash(w["line-dasharray"]?uo(a,"paint","line-dasharray",I,z,$).map(function(e){return e*t}):null),"function"==typeof j.setOffset&&j.setOffset(uo(a,"paint","line-offset",I,z,$)),O.setZIndex(E))}let P,D,F,N,L,R,G,H,B,V=!1,Z=null,U=0;if((1==_||2==_)&&"icon-image"in x){const e=uo(a,"layout","icon-image",I,z,$);if(e){let r;P="string"==typeof e?yo(e,k):e.toString();const n=u?u(t,P):void 0,l=ho(P,p);if(i&&i[P]&&l||n){const e=uo(a,"layout","icon-rotation-alignment",I,z,$);if(2==_){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();lo||(so=[NaN,NaN],lo=new d("Point",so,[],2,{},void 0)),r=lo,so[0]=n[0],so[1]=n[1];if("line"===uo(a,"layout","symbol-placement",I,z,$)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){U=Math.atan2(a-s,i-o);break}}}}}}if(2!==_||r){const t=uo(a,"layout","icon-size",I,z,$),o=void 0!==w["icon-color"]?uo(a,"paint","icon-color",I,z,$):null;if(!o||0!==o.a){const r=uo(a,"paint","icon-halo-color",I,z,$),s=uo(a,"paint","icon-halo-width",I,z,$);let u=`${P}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),D=M[u],!D){const p=po(a,I,"icon",z);let c;"icon-offset"in x&&(c=uo(a,"layout","icon-offset",I,z,$).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),D=new h(r)}else{const n=i[P];let a,u,d;if(s)n.sdf?(a=Wn(Xn(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=Wn(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=Xn(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}D=new h({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}M[u]=D}}D&&(++q,O=A[q],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new v,A[q]=O),O.setGeometry(r),D.setRotation(U+Vn(uo(a,"layout","icon-rotate",I,z,$))),D.setOpacity(uo(a,"paint","icon-opacity",I,z,$)),D.setAnchor(ao[uo(a,"layout","icon-anchor",I,z,$)]),O.setImage(D),Z=O.getText(),O.setText(void 0),O.setZIndex(E),V=!0,F=!1)}else F=!0}}}if(1==_&&"circle"===a.type){++q,O=A[q],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new v,A[q]=O);const e="circle-radius"in w?uo(a,"paint","circle-radius",I,z,$):5,t=fo(uo(a,"paint","circle-stroke-color",I,z,$),uo(a,"paint","circle-stroke-opacity",I,z,$)),r=uo(a,"paint","circle-translate",I,z,$),n=fo(uo(a,"paint","circle-color",I,z,$),uo(a,"paint","circle-opacity",I,z,$)),o=uo(a,"paint","circle-stroke-width",I,z,$),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];D=M[i],D||(D=new m({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new g({width:o,color:t}):void 0,fill:n?new y({color:n}):void 0,declutterMode:"none"}),M[i]=D),O.setImage(D),Z=O.getText(),O.setText(void 0),O.setGeometry(void 0),O.setZIndex(E),V=!0}if("text-field"in x){G=Math.round(uo(a,"layout","text-size",I,z,$));const e=uo(a,"layout","text-font",I,z,$);R=uo(a,"layout","text-line-height",I,z,$),L=Nn(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),H=uo(a,"layout","text-letter-spacing",I,z,$),B=uo(a,"layout","text-max-width",I,z,$);const t=uo(a,"layout","text-field",I,z,$);N="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Nn(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==_)return t.push(Kn(i,H),a),t;i=no(i,a,B,H).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):yo(t,k).trim(),c=uo(a,"paint","text-opacity",I,z,$)}if(N&&c&&!F){V||(++q,O=A[q],O&&O.getText()&&!O.getFill()&&!O.getStroke()||(O=new v,A[q]=O),O.setImage(void 0),O.setGeometry(void 0));const e=po(a,I,"text",z);O.getText()||O.setText(Z),Z=O.getText(),(!Z||"getDeclutterMode"in Z&&Z.getDeclutterMode()!==e)&&(Z=new b({padding:[2,2,2,2],declutterMode:e}),O.setText(Z));const t=uo(a,"layout","text-transform",I,z,$);"uppercase"==t?N=Array.isArray(N)?N.map((e,t)=>t%2?e:e.toUpperCase()):N.toUpperCase():"lowercase"==t&&(N=Array.isArray(N)?N.map((e,t)=>t%2?e:e.toLowerCase()):N.toLowerCase());const r=Array.isArray(N)?N:2==_?Kn(N,H):no(N,L,B,H);if(Z.setText(r),Z.setFont(L),Z.setRotation(Vn(uo(a,"layout","text-rotate",I,z,$))),"function"==typeof Z.setKeepUpright){const e=uo(a,"layout","text-keep-upright",I,z,$);Z.setKeepUpright(e)}const n=uo(a,"layout","text-anchor",I,z,$),o=V||1==_?"point":uo(a,"layout","symbol-placement",I,z,$);let i;if("line-center"===o?(Z.setPlacement("line"),i="center"):Z.setPlacement(o),"line"===o&&"function"==typeof Z.setRepeat){const e=uo(a,"layout","symbol-spacing",I,z,$);Z.setRepeat(2*e)}Z.setOverflow("point"===o);let s=uo(a,"paint","text-halo-width",I,z,$);const l=uo(a,"layout","text-offset",I,z,$),u=uo(a,"paint","text-translate",I,z,$);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=uo(a,"layout","text-rotation-alignment",I,z,$);Z.setRotateWithView("map"==e)}else Z.setMaxAngle(Vn(uo(a,"layout","text-max-angle",I,z,$))*N.length/r.length),Z.setRotateWithView(!1);Z.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),Z.setTextBaseline(d);const m=uo(a,"layout","text-justify",I,z,$);Z.setJustify("auto"===m?void 0:m),Z.setOffsetX(l[0]*G+f+u[0]),Z.setOffsetY(l[1]*G+p+u[1]);const h=Z.getFill()||new y;h.setColor(fo(uo(a,"paint","text-color",I,z,$),c)),Z.setFill(h);const x=fo(uo(a,"paint","text-halo-color",I,z,$),c);if(x&&s>0){const e=Z.getStroke()||new g;e.setColor(x),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),Z.setStroke(e)}else Z.setStroke(void 0);const w=uo(a,"layout","text-padding",I,z,$),k=Z.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),O.setZIndex(E)}}}return q>-1?(A.length=q+1,go&&("set"in o?o.set("mapbox-layer",T):o.getProperties()["mapbox-layer"]=T),A):void 0};return t.setStyle(O),t.set("mapbox-layers",k),t.set("mapbox-source",C),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),O}function xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}He.parse("#000000"),He.parse("#FFFFFF"),He.parse("#000000"),function(e=!1){go=e}(!0);var ko="EPSG:27700",Mo=["vector","raster","wms","ogc-vt"];function So(e,t,r){var n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}var zo=e=>(t,r)=>{var n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(A.ERROR))};function jo(){return new p({resolutions:$,origin:q,tileSize:256})}function Co(e,t){return Ao.apply(this,arguments)}function Ao(){return Ao=x(function*(e,t){if(e.type&&!Mo.includes(e.type))throw new Error("Unsupported map style type: '".concat(e.type,"'"));if("wms"===e.type){var r=function(e,t,r){var n=jo();return new j({url:e,params:t,projection:ko,tileGrid:n,tileLoadFunction:r?zo(r):void 0})}(e.url,e.params||{},t);return{layer:new a({source:r}),source:r}}if("raster"===e.type){var n=function(e,t){var r=jo();return new z({projection:ko,tileGrid:r,tileUrlFunction:t=>{var[r,n,o]=t;return e.replace("{z}",r).replace("{x}",n).replace("{y}",o)},tileLoadFunction:t?zo(t):void 0})}(e.url,t);return{layer:new a({source:n}),source:n}}return"ogc-vt"===e.type?function(e,t){return _o.apply(this,arguments)}(e.url,t,e):function(e,t){return Eo.apply(this,arguments)}(e.url,t,e)}),Ao.apply(this,arguments)}function Oo(e,t){var r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a="".concat(n,".json").concat(o),i="".concat(n,".png").concat(o);return{jsonUrl:a,pngUrl:i,fetch:()=>So(a,"SpriteJSON",t).then(e=>e.json())}}function Eo(){return Eo=x(function*(e,t){var{renderMode:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yield So(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=yield So(i,"Source",t).then(e=>e.json()),c=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=Oo(n.sprite,t),g=yield h.fetch();!function(e){e.layers.forEach(e=>{var t;null!==(t=e.paint)&&void 0!==t&&t["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);var v=new p({extent:c,origin:f,resolutions:d,tileSize:m}),b=new u({format:new o,url:y,projection:ko,tileGrid:v}),x=new s(wo({source:b,declutter:!0},r&&{renderMode:r}));return x.set("layerType","vectorTile"),bo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}),Eo.apply(this,arguments)}function _o(){return _o=x(function*(e,t){var r,{renderMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=yield So(e,"Style",t).then(e=>e.json()),i=Object.keys(a.sources)[0],l=a.sources[i].url,u=Oo(a.sprite,t),c=null===(r=(yield So(l,"Source",t).then(e=>e.json())).links)||void 0===r?void 0:r.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=yield Promise.all([So(c.href,"Source",t).then(e=>e.json()),u.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");var v=new p({resolutions:m,origin:y,tileSize:h}),b=new C({url:l,format:g,tileGrid:v,projection:ko}),x=new s(wo({source:b,declutter:!0},n&&{renderMode:n}));return x.set("layerType","vectorTile"),bo(x,a,i,m,d,u.pngUrl),{layer:x,source:b}}),_o.apply(this,arguments)}function Po(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===Po(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var Io=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return Po(e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r},$o=e=>{var t=e/1609.344;if(t<.5){var r=Math.round(e),n=1===r?"metre":"metres";return"".concat(r," ").concat(n)}if(t<10){var o=Number.parseFloat(t.toFixed(1)),a=1===o?"mile":"miles";return"".concat(o," ").concat(a)}var i=Math.round(t);return"".concat(i," miles")},To=e=>Io(e),qo=(e,t,r)=>{for(var n=[],o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},Do=e=>{var t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:qo(r,0,r.length)};if("Polygon"===t){var n=e.getEnds(),o=0;return{type:"Polygon",coordinates:n.map(e=>{var t=qo(r,o,e);return o=e,t})}}if("MultiPolygon"===t){var a=e.getEndss(),i=0,s=a.map(e=>{var t=i,n=e.map(e=>{var n=qo(r,t,e);return t=e,n});return i=e[e.length-1],n});return{type:"MultiPolygon",coordinates:s}}return{type:t,coordinates:qo(r,0,r.length)}},Fo=(e,t,r,n)=>{var o=[];return e.getLayers().forEach(e=>{if(e instanceof s){var a=e.getSource(),i=null==a?void 0:a.sourceTiles_;i&&Object.values(i).forEach(e=>{e.getState()===A.LOADED&&e.getFeatures().forEach(e=>{var a;if((null===(a=e.get("mapbox-layer"))||void 0===a?void 0:a.id)===t){var i=n?e.get(n):e.getId();String(i)===String(r)&&o.push(Do(e))}})})}}),o},No=new Map,Lo=(e,t)=>{if(!e)return null;if("string"==typeof e)return e.trim();if("object"==typeof e){if(t&&e[t])return e[t];var r=Object.values(e)[0];return null!=r?r:null}return null},Ro={symbol:"pin",backgroundColor:"#ca3535",foregroundColor:"#ffffff"},Go={dot:"M8 3c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.241 5-5-2.24-5-5-5z",cross:"M6 3H10V6H13V10H10V13H6V10H3V6H6Z",diamond:"M8 2L14 8L8 14L2 8Z",triangle:"M8 2L14 14H2Z",square:"M3 3H13V13H3Z"},Ho={id:"pin",viewBox:"0 0 44 44",anchor:[.5,.9],graphic:Go.dot,svg:'<path d="M22 40.999c-3.621 0-8.306-5.864-10.258-8.3C9.02 29.302 6 23.66 6 19.002a16.01 16.01 0 0 1 16-16 16.01 16.01 0 0 1 16 16c0 4.658-3.02 10.3-5.742 13.697-1.952 2.437-6.637 8.3-10.258 8.3z" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M22 7.001a12.01 12.01 0 0 1 12 12c0 7.623-10.377 17.998-12 17.998S10 26.624 10 19.001a12.01 12.01 0 0 1 12-12z" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 19) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Bo={id:"circle",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:Go.dot,svg:'<circle cx="22" cy="22" r="16" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <circle cx="22" cy="22" r="12" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Vo={id:"square",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:Go.dot,svg:'<path d="M13 6h18c3.863 0 7 3.137 7 7v18c0 3.863-3.137 7-7 7H13c-3.863 0-7-3.137-7-7V13c0-3.863 3.137-7 7-7" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M13 34a3 3 0 0 1-3-3V13a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v18a3 3 0 0 1-3 3H13z" fill-rule="nonzero" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Zo=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),Uo=e=>{if(!(e=>!(!e.symbol&&!e.symbolSvgContent))(e))return{};var t={};return Zo.forEach(r=>{if(null!=e[r]){var n=r.charAt(6).toLowerCase()+r.slice(7);t[n]=e[r]}}),t},Wo={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}};function Jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Xo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Yo=new Map,Ko=new Map,Qo={},ea=e=>{var t=0;for(var r of e)t=Math.trunc((t<<5)-t+r.codePointAt(0));return Math.abs(t).toString(36)},ta=new Set(["id","svg","viewBox","anchor","symbol","symbolSvgContent"]);function ra(e,t,r){var n,o,a,i,s=null==r?void 0:r.id,l=Object.fromEntries(Object.entries(e||{}).filter(e=>{var[t]=e;return!ta.has(t)})),u=Object.fromEntries(Object.entries(Qo).filter(e=>{var[t]=e;return!ta.has(t)})),p=Object.fromEntries(Object.entries(t).filter(e=>{var[,t]=e;return null!=t})),c=Xo(Xo(Xo(Xo({},Ro),u),l),p),f=null!==(n=Wo[null==r?void 0:r.mapColorScheme])&&void 0!==n?n:Wo.light;return c.haloColor=null!==(o=null==r?void 0:r.haloColor)&&void 0!==o?o:f.haloColor,c.selectedColor=null!==(a=null==r?void 0:r.selectedColor)&&void 0!==a?a:f.selectedColor,c.activeColor=null!==(i=null==r?void 0:r.activeColor)&&void 0!==i?i:f.activeColor,"string"==typeof c.graphic&&Go[c.graphic]&&(c.graphic=Go[c.graphic]),Object.fromEntries(Object.entries(c).map(e=>{var[t,r]=e;return[t,Lo(r,s)||""]}))}function na(e,t){return Object.entries(t).reduce((e,t)=>{var[r,n]=t;return e.replaceAll("{{".concat(r,"}}"),n)},e)}var oa={setDefaults(e){Qo=e||{}},getDefaults:()=>Xo(Xo({},Ro),Qo),register(e){Yo.set(e.id,e)},get:e=>Yo.get(e),list:()=>[...Yo.values()],clear(){Yo.clear()},initialise(){this.register(Ho),this.register(Bo),this.register(Vo)},resolve(e,t,r){var n=ra(e,t||{},r);return e?(n.selectedColor="none",n.activeColor="none",na(e.svg,n)):""},resolveActive(e,t,r){var n=ra(e,t||{},r);return e?na(e.svg,n):""},resolveSelected(e,t,r){var n=ra(e,t||{},r);return e?(n.activeColor="none",na(e.svg,n)):""},getSymbolImageId(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,o=this.getSymbolDef(e);if(!o)return null;var a=Uo(e),i=r?this.resolveActive(o,a,t):this.resolve(o,a,t);return"symbol-".concat(r?"act-":"").concat(ea(i),"-").concat(n,"x")},getSymbolDef(e){return e.symbolSvgContent?{svg:e.symbolSvgContent}:e.symbol?this.get(e.symbol):void 0},rasteriseSymbolImage(e,t,r,n){var o=this;return x(function*(){var a=o.getSymbolDef(e);if(!a)return null;var i,s,l=Uo(e);"active"===r?(i=o.resolveActive(a,l,t),s="act-"):"selected"===r?(i=o.resolveSelected(a,l,t),s="sel-"):(i=o.resolve(a,l,t),s="");var u="symbol-".concat(s).concat(ea(i),"-").concat(n,"x"),p=Ko.get(u);if(!p){var c=((e,t)=>{var r;return e.symbolViewBox?e.symbolViewBox:null!==(r=null==t?void 0:t.viewBox)&&void 0!==r?r:"0 0 38 38"})(e,a),[,,f,d]=c.split(" ").map(Number),m='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(f*n,'" height="').concat(d*n,'" viewBox="').concat(c,'">').concat(i,"</svg>");p=yield((e,t,r)=>new Promise((n,o)=>{var a="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(e)),i=new Image(t,r);i.onload=()=>{var e=document.createElement("canvas");e.width=t,e.height=r;var o=e.getContext("2d");o.drawImage(i,0,0,t,r),n(o.getImageData(0,0,t,r))},i.onerror=()=>{o(new Error("Failed to rasterise SVG: ".concat(e.slice(0,80))))},i.src=a}))(m,f*n,d*n),Ko.set(u,p)}return{imageId:u,imageData:p}})()}};function aa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aa(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}oa.initialise();var sa="EPSG:27700",la=new n({dataProjection:sa,featureProjection:sa}),ua="_highlight",pa=999,ca=(e,t)=>{if(!e)return[];var{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new v({stroke:new g({color:r,width:i}),zIndex:pa}),new v({stroke:new g({color:n,width:a}),zIndex:1e3})];var s=[new v({stroke:new g({color:n,width:a}),zIndex:pa})];return o&&"transparent"!==o&&s.push(new v({fill:new y({color:o}),zIndex:pa})),s},fa=(e,t)=>{if(!(e=>!!(null!=e&&e.symbol||null!=e&&e.symbolSvgContent))(e))return null;var r=t?e.symbolActiveImageId:e.symbolSelectedImageId,n=r&&(e=>No.get(e))(r);if(!n)return null;var o=((e,t)=>{var r;return e.symbolAnchor?e.symbolAnchor:null!==(r=null==t?void 0:t.anchor)&&void 0!==r?r:[.5,.5]})(e,oa.getSymbolDef(e)),a=1/(e.symbolPixelRatio||1);return[new v({image:new h({img:n,anchor:o,scale:a}),zIndex:pa})]},da=e=>{var t=new Set,r={};for(var{layerId:n,featureId:o,idProperty:a}of null!=e?e:[])t.add("".concat(n,":").concat(o)),a&&(r[n]=a);return{keys:t,idProps:r}},ma=(e,t,r)=>{var n;if(null!=r)return e.getLayers().forEach(e=>{var o;if(!n&&"vector"===e.get("layerType")&&!e.get(ua)&&e.get("layerId")===t){var a=null===(o=e.getSource())||void 0===o?void 0:o.getFeatureById(String(r));a&&(n=a.getProperties())}}),n},ya=(e,t,r,n,o)=>{for(var{layerId:a,featureId:i,geometry:s}of null!=r?r:[]){var l;if(s){var u=ma(e,a,i),p=null!==(l=fa(u,n))&&void 0!==l?l:ca(null==o?void 0:o[a],n);if(p.length){var c=new P({geometry:la.readGeometry(s)});c.setStyle(p),t.addFeature(c)}}}},ha=(e,t)=>{var{type:r,coordinates:n}=e,o=e=>{var[r,n]=e;return t(r,n)},a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},ga=(e,t,r,n)=>{if(!e)return null;var o=new Set;e.getLayers().forEach(e=>{if("vector"===e.get("layerType")&&!e.get(ua)){var t=e.get("layerId");t&&o.add(t)}});var{keys:a,idProps:s}=da(t),{keys:u,idProps:p}=da(r),c=ia(ia({},s),p);((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType"))if(t.size>0||r.size>0){e._highlightOriginalStyle||(e._highlightOriginalStyle=e.getStyleFunction());var a=e._highlightOriginalStyle;e.setStyle((e,i)=>{var s,l=a(e,i),u=null===(s=e.get("mapbox-layer"))||void 0===s?void 0:s.id;if(!u)return l;var p=n[u],c=p?e.get(p):e.getId(),f="".concat(u,":").concat(c),d=r.has(f),m=!d&&t.has(f);if(!d&&!m)return l;var y,h=ca(null==o?void 0:o[u],d);return h.length?[...(y=l,y?Array.isArray(y)?y:[y]:[]),...h]:l})}else e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle)})})(e,a,u,c,n);var f=(e=>{var t=null;return e.getLayers().forEach(e=>{e.get(ua)&&(t=e)}),t||((t=new i({source:new l,zIndex:1001})).set(ua,!0),t.set("layerType","vector"),e.addLayer(t)),t})(e),d=f.getSource();d.clear();var m=(null!=t?t:[]).filter(e=>o.has(e.layerId)),y=(null!=r?r:[]).filter(e=>o.has(e.layerId));ya(e,d,y,!0,n),ya(e,d,m,!1,n);var h=(null!=t?t:[]).flatMap(t=>((e,t)=>{var{layerId:r,featureId:n,idProperty:o,geometry:a}=t;if(null!=n){var i=Fo(e,r,n,o);if(i.length>0)return i}return a?[a]:[]})(e,t));return(e=>{if(!e.length)return null;var t=1/0,r=1/0,n=-1/0,o=-1/0;for(var a of e)ha(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(h)};function va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var ba="EPSG:27700",xa=new n({dataProjection:ba,featureProjection:ba}),wa=e=>{var t=e.getId();if(null!=t)return t;var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?va(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):va(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e.getProperties());return delete r["mapbox-layer"],JSON.stringify(r)},ka=(e,t,r)=>{var n=e.getViewport();if(r&&e.un("pointermove",r),null==t||!t.length)return n.style.cursor="",null;var o=new Set(t),a=null,i=t=>{var r;if("mouse"===(null===(r=t.originalEvent)||void 0===r?void 0:r.pointerType)){var i=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;var t=e.forEachFeatureAtPixel(i,(e,t)=>((e,t,r)=>{if("vectorTile"===t.get("layerType")){var n,o=null===(n=e.get("mapbox-layer"))||void 0===n?void 0:n.id;return Boolean(o&&r.has(o))}if("vector"===t.get("layerType")&&!t.get("_highlight")){var a=t.get("layerId");return Boolean(a&&r.has(a))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})}};return e.on("pointermove",i),i};function Ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Sa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ma(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ma(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(()=>{if("undefined"!=typeof HTMLCanvasElement){var e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.call(this,t,"2d"===t?Sa(Sa({},r),{},{willReadFrequently:!0}):r,...o)}}})();var za="EPSG:27700",ja=e=>{if(e){var{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]}};k.defs(za,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),M(k);class Ca extends I{constructor(e){var{mapProviderConfig:t={},events:r,eventBus:n}=e;super(),this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:N,supportsMapSizes:!0},Object.assign(this,t)}get name(){return"OpenLayersProvider"}initMap(n){var o=this;return x(function*(){var a,{container:i,padding:s,mapStyle:l,mapSize:u,center:p,zoom:c,bounds:f,minZoom:d,maxZoom:m,transformRequest:y,pixelRatio:h}=n;o.mapStyleId=null==l?void 0:l.id,o.mapSize=u;var{events:g,eventBus:v}=o,{layer:b,source:k}=yield Co(l,y),M=(null!==(a=o.zoomAlignment)&&void 0!==a?a:L)===R?{resolutions:T,defaultMinZoom:6,maxZoom:20}:{resolutions:$,defaultMinZoom:0,maxZoom:$.length-1},S=new t({projection:za,center:null!=p?p:f?r(f):void 0,zoom:null!=c?c:M.defaultMinZoom,minZoom:null!=d?d:M.defaultMinZoom,maxZoom:null!=m?m:M.maxZoom,resolutions:M.resolutions,constrainResolution:!1,padding:ja(s)}),z=new e({target:i,layers:[b],view:S,controls:[],interactions:w({doubleClickZoom:!1}),pixelRatio:h});f&&z.once("rendercomplete",()=>{S.fit(f,{size:z.getSize(),duration:0})}),o.mapEventHandles=B({map:z,source:k,events:g,eventBus:v,getZoom:o.getZoom.bind(o),getCenter:o.getCenter.bind(o),getBounds:o.getBounds.bind(o),getResolution:o.getResolution.bind(o)}),o.appEventHandles=function(e){var{mapProvider:t,transformRequest:r,events:n,eventBus:o,map:a,onBaseSourceChange:i}=e,s=function(){var e=x(function*(e){var{layer:s,source:l}=yield Co(e,r);a.getLayers().setAt(0,s),i(l),o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:e.id}),t.reapplyHighlights()});return function(t){return e.apply(this,arguments)}}(),l=e=>{a.setPixelRatio(e)},u=e=>{var{mapSize:r}=e;t.mapSize=r};return o.on(n.MAP_SET_STYLE,s),o.on(n.MAP_SET_PIXEL_RATIO,l),o.on(n.MAP_SIZE_CHANGE,u),{remove(){o.off(n.MAP_SET_STYLE,s),o.off(n.MAP_SET_PIXEL_RATIO,l),o.off(n.MAP_SIZE_CHANGE,u)}}}({mapProvider:o,transformRequest:y,events:g,eventBus:v,map:z,onBaseSourceChange:o.mapEventHandles.setSource})||[],o.map=z,o.view=S,v.emit(g.MAP_READY,{map:o.map,mapStyleId:o.mapStyleId,mapSize:o.mapSize,crs:o.crs})})()}destroyMap(){var e,t;null===(e=this.mapEventHandles)||void 0===e||e.remove(),null===(t=this.appEventHandles)||void 0===t||t.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView(e){var{center:t,zoom:r}=e;this.view.animate({center:null!=t?t:this.view.getCenter(),zoom:null!=r?r:this.view.getZoom(),duration:D})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:D})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:D})}panBy(e){var t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:D})}fitToBounds(e){var t=Array.isArray(e)?e:To(e);this.view.fit(t,{duration:D})}setPadding(e){this.view.padding=ja(e)}getCenter(){var e=this.view.getCenter(),t=F;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return[];var{radius:n=10}=r,o=[t.x,t.y],a=[],i=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{if("vectorTile"===t.get("layerType")){var r=e.get("mapbox-layer"),n=null==r?void 0:r.id;if(!n||"background"===(null==r?void 0:r.type))return;var o="".concat(n,":").concat(wa(e));if(i.has(o))return;i.add(o),a.push({id:e.getId(),layer:{id:n},geometry:Do(e),properties:e.getProperties()})}else if("vector"===t.get("layerType")){var s=t.get("layerId");if(!s||t.get("_highlight"))return;var l=e.getId(),u="".concat(s,":").concat(l);if(i.has(u))return;i.add(u),a.push({id:l,layer:{id:s},geometry:xa.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})}},{hitTolerance:n}),a}(this.map,e,t)}getFeatureGeometry(e,t,r){var n=Fo(this.map,e,t,r);return 0===n.length?null:1===n.length?n[0]:{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=ka(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return((e,t)=>{var r=new Set(t),n=[],o=new Set,a=e.getView().calculateExtent(e.getSize());return e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType")){var t,i=null===(t=e.getSource())||void 0===t?void 0:t.sourceTiles_;if(!i)return;Object.values(i).forEach(e=>{e.getState()===A.LOADED&&e.getFeatures().forEach(e=>{var t=e.get("mapbox-layer"),a=null==t?void 0:t.id;if(a&&r.has(a)&&"background"!==(null==t?void 0:t.type)){var i="".concat(a,":").concat(wa(e));o.has(i)||(o.add(i),n.push({id:e.getId(),layer:{id:a},geometry:Do(e),properties:e.getProperties()}))}})})}else if("vector"===e.get("layerType")){var s,l=e.get("layerId");if(!l||!r.has(l)||e.get("_highlight"))return;null===(s=e.getSource())||void 0===s||s.getFeaturesInExtent(a).forEach(e=>{n.push({id:e.getId(),layer:{id:l},geometry:xa.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})})}}),n})(this.map,e)}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},ga(this.map,e,t,r)}reapplyHighlights(){if(this._lastHighlightArgs){var{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;ga(this.map,e,t,r)}}getAreaDimensions(){return(e=>{if(!e)return"";var[t,r,n,o]=e,a=n-t;return"".concat($o(o-r)," by ").concat($o(a))})((e=>{var t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{var r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push("".concat(n>0?"north":"south"," ").concat($o(Math.abs(n)))),Math.abs(r)>1&&o.push("".concat(r>0?"east":"west"," ").concat($o(Math.abs(r)))),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};var t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return((e,t,r)=>{var n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;var o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=To(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;var f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top})(e,t,this.map)}}export{Ca as default};
1
+ import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import l from"ol/source/Vector.js";import u from"ol/source/VectorTile.js";import"ol/tilegrid.js";import p from"ol/tilegrid/TileGrid.js";import{distance as c}from"ol/coordinate.js";import{toPromise as f}from"ol/functions.js";import d from"ol/render/Feature.js";import m from"ol/style/Circle.js";import y from"ol/style/Fill.js";import h from"ol/style/Icon.js";import g from"ol/style/Stroke.js";import v from"ol/style/Style.js";import b from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import x from"@babel/runtime/helpers/asyncToGenerator";import{defaults as w}from"ol/interaction/defaults.js";import k from"proj4";import{register as M}from"ol/proj/proj4.js";import S from"@babel/runtime/helpers/defineProperty";import z from"ol/source/XYZ.js";import j from"ol/source/TileWMS.js";import C from"ol/source/OGCVectorTile.js";import A from"ol/TileState.js";import{fromString as O}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as E}from"ol/render/canvas.js";import{getUid as _}from"ol/util.js";import P from"ol/Feature.js";class I{isBaseMapReady(){throw new Error(this.name+" must implement isBaseMapReady()")}}var $=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],T=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],q=[-238375,1376256],D=300,F=2,N=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],L="uk",R="world";var G=(e,t)=>{var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function H(e){var{map:t,view:r,emit:n,eventBus:o,events:a,on:i,debouncers:s}=e,l=!1,u=G(()=>{l=!1,n(a.MAP_MOVE_END)},500);s.push(u);var p,c,f,d=(p=()=>n(a.MAP_MOVE),c=10,f=0,function(){var e=Date.now();e-f>=c&&(f=e,p(...arguments))});i(r,"change",()=>{l||(l=!0,o.emit(a.MAP_MOVE_START)),u()}),i(t,"postrender",()=>{l&&d()})}function B(e){var{map:t,source:r,events:n,eventBus:o,getZoom:a,getCenter:i,getBounds:s,getResolution:l}=e,u=!1,p=[],c=[],f=[],d=t.getView(),m=e=>{var t=(()=>{if(u)return null;var e=a();return{center:i(),bounds:s(),resolution:l(),zoom:e,isAtMaxZoom:e+.01>=d.getMaxZoom(),isAtMinZoom:e-.01<=d.getMinZoom()}})();t&&o.emit(e,t)},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])},h=(e,t,r)=>{e.on(t,r),c.push([e,t,r])},g=!1,v=()=>{g||(g=!0,o.emit(n.MAP_LOADED))},b=G(()=>m(n.MAP_DATA_CHANGE),500);f.push(b);var x=e=>{u||(c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c=[],h(e,"tileloadend",v),h(e,"tileloadend",b))};return H({map:t,view:t.getView(),emit:m,eventBus:o,events:n,on:y,debouncers:f}),x(r),t.once("rendercomplete",()=>m(n.MAP_FIRST_IDLE)),function(e){var{map:t,eventBus:r,events:n,on:o}=e,a=null;o(t,"pointerdown",e=>{a=e.pixel}),o(t,"click",e=>{if(a){var t=e.pixel[0]-a[0],o=e.pixel[1]-a[1];if(Math.hypot(t,o)>6)return}r.emit(n.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:t,eventBus:o,events:n,on:y}),y(t,"postrender",()=>o.emit(n.MAP_RENDER)),{setSource:x,remove(){u=!0,f.forEach(e=>e.cancel()),p.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)})}}}var V={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-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","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const Z=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function U(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return Z.forEach(e=>{e in t&&(r[e]=t[e])}),r}class W extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class J{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new J(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 X={kind:"null"},Y={kind:"number"},K={kind:"string"},Q={kind:"boolean"},ee={kind:"color"},te={kind:"projectionDefinition"},re={kind:"object"},ne={kind:"value"},oe={kind:"collator"},ae={kind:"formatted"},ie={kind:"padding"},se={kind:"colorArray"},le={kind:"numberArray"},ue={kind:"resolvedImage"},pe={kind:"variableAnchorOffsetCollection"};function ce(e,t){return{kind:"array",itemType:e,N:t}}function fe(e){if("array"===e.kind){const t=fe(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const de=[X,Y,K,Q,ee,te,ae,re,ce(ne),ie,le,se,ue,pe];function me(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!me(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of de)if(!me(e,t))return null}return`Expected ${fe(e)} but found ${fe(t)} instead.`}function ye(e,t){return t.some(t=>t.kind===e.kind)}function he(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function ge(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const ve=.96422,be=.82521,xe=4/29,we=6/29,ke=3*we*we,Me=we*we*we,Se=Math.PI/180,ze=180/Math.PI;function je(e){return(e%=360)<0&&(e+=360),e}function Ce([e,t,r,n]){let o,a;const i=Oe((.2225045*(e=Ae(e))+.7168786*(t=Ae(t))+.0606169*(r=Ae(r)))/1);e===t&&t===r?o=a=i:(o=Oe((.4360747*e+.3850649*t+.1430804*r)/ve),a=Oe((.0139322*e+.0971045*t+.7141733*r)/be));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function Ae(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Oe(e){return e>Me?Math.pow(e,1/3):e/ke+xe}function Ee([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*Pe(o),a=ve*Pe(a),i=be*Pe(i),[_e(3.1338561*a-1.6168667*o-.4906146*i),_e(-.9787684*a+1.9161415*o+.033454*i),_e(.0719453*a-.2289914*o+1.4052427*i),n]}function _e(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Pe(e){return e>we?e*e*e:ke*(e-xe)}const Ie=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function $e(e,t){return Ie(e,t)?e[t]:void 0}function Te(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=$e(Le,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[qe(e.slice(r,r+=t)),qe(e.slice(r,r+=t)),qe(e.slice(r,r+=t)),qe(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[Fe(+t/r,0,1),Fe(+a/r,0,1),Fe(+l/r,0,1),c?De(+c,f):1];if(Ne(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,Fe(+o,0,100),Fe(+i,0,100),l?De(+l,u):1];if(Ne(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=je(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function qe(e){return parseInt(e.padEnd(2,e),16)/255}function De(e,t){return Fe(t?e/100:e,0,1)}function Fe(e,t,r){return Math.min(Math.max(t,e),r)}function Ne(e){return!e.some(Number.isNaN)}const Le={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Re(e,t,r){return e+r*(t-e)}function Ge(e,t,r){return e.map((e,n)=>Re(e,t[n],r))}class He{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof He)return e;if("string"!=typeof e)return;const t=Te(e);return t?new He(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=Ce(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?je(Math.atan2(n,r)*ze):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ce(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=Ge(e.rgb,t.rgb,r);return new He(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*Se,Ee([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Re(o,l,r),Re(a,u,r),Re(i,p,r)]);return new He(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=Ee(Ge(e.lab,t.lab,r));return new He(n,o,a,i,!1)}}}}He.black=new He(0,0,0,1),He.white=new He(1,1,1,1),He.transparent=new He(0,0,0,0),He.red=new He(1,0,0,1);class Be{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Ve=["bottom","center","top"];class Ze{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class Ue{constructor(e){this.sections=e}static fromString(e){return new Ue([new Ze(e,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof Ue?e:Ue.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class We{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof We)return e;if("number"==typeof e)return new We([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)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 We(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new We(Ge(e.values,t.values,r))}}class Je{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Je)return e;if("number"==typeof e)return new Je([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new Je(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Je(Ge(e.values,t.values,r))}}class Xe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xe)return e;if("string"==typeof e){const t=He.parse(e);if(!t)return;return new Xe([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=He.parse(r);if(!e)return;t.push(e)}return new Xe(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(He.interpolate(e.values[a],t.values[a],r,n));return new Xe(o)}}class Ye extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Ke=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qe)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!Ke.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new Qe(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new Ye(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new Ye(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Re(t,s,r),Re(i,l,r)])}return new Qe(a)}}class et{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new et({name:e,available:!1}):null}}class tt{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new tt(e,t,r)}static parse(e){return e instanceof tt?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new tt(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new tt(e.from,e.to,e.transition):"string"==typeof e?new tt(e,e,1):void 0}}function rt(e,t,r,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function nt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof tt||e instanceof He||e instanceof Be||e instanceof Ue||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Qe||e instanceof et)return!0;if(Array.isArray(e)){for(const t of e)if(!nt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!nt(e[t]))return!1;return!0}return!1}function ot(e){if(null===e)return X;if("string"==typeof e)return K;if("boolean"==typeof e)return Q;if("number"==typeof e)return Y;if(e instanceof He)return ee;if(e instanceof tt)return te;if(e instanceof Be)return oe;if(e instanceof Ue)return ae;if(e instanceof We)return ie;if(e instanceof Je)return le;if(e instanceof Xe)return se;if(e instanceof Qe)return pe;if(e instanceof et)return ue;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=ot(t);if(r){if(r===e)continue;r=ne;break}r=e}return ce(r||ne,t)}return re}function at(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof He||e instanceof tt||e instanceof Ue||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Qe||e instanceof et?e.toString():JSON.stringify(e)}class it{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!nt(e[1]))return t.error("invalid value");const r=e[1];let n=ot(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new it(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const st={string:K,number:Y,boolean:Q,object:re};class lt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in st)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=st[r],n++}else o=ne;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=ce(o,a)}else{if(!st[o])throw new Error(`Types doesn't contain name = ${o}`);r=st[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,ne);if(!r)return null;a.push(r)}return new lt(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!me(this.type,ot(r)))return r;if(t===this.args.length-1)throw new Ye(`Expected value to be of type ${fe(this.type)}, but found ${fe(ot(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ut={"to-boolean":Q,"to-color":ee,"to-number":Y,"to-string":K};class pt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!ut[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=ut[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,ne);if(!n)return null;o.push(n)}return new pt(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof He)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:rt(t[0],t[1],t[2],t[3]),!r))return new He(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ye(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=We.parse(t);if(n)return n}throw new Ye(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Je.parse(t);if(n)return n}throw new Ye(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Xe.parse(t);if(n)return n}throw new Ye(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=Qe.parse(t);if(n)return n}throw new Ye(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Ye(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Ue.fromString(at(this.args[0].evaluate(e)));case"resolvedImage":return et.fromString(at(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return at(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ct=["Unknown","Point","LineString","Polygon"];class ft{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ct[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=He.parse(e),this._parseColorCache.set(e,t)),t}}class dt{constructor(e,t,r=[],n,o=new J,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new lt(t,[e]):"coerce"===r?new pt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof it)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new ft;try{n=new it(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new dt(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new W(r,e))}checkSubtype(e,t){const r=me(e,t);return r&&this.error(r),r}}class mt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new mt(r,n):null}outputDefined(){return this.result.outputDefined()}}class yt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new yt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class ht{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Y),n=t.parse(e[2],2,ce(t.expectedType||ne));if(!r||!n)return null;const o=n.type;return new ht(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ye(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Ye(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Ye(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class gt{constructor(e,t){this.type=Q,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,ne);return r&&n?ye(r.type,[Q,K,Y,X,ne])?new gt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${fe(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!he(t,["boolean","string","number","null"]))throw new Ye(`Expected first argument to be of type boolean, string, number or null, but found ${fe(ot(t))} instead.`);if(!he(r,["string","array"]))throw new Ye(`Expected second argument to be of type array or string, but found ${fe(ot(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class vt{constructor(e,t,r){this.type=Y,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,ne);if(!r||!n)return null;if(!ye(r.type,[Q,K,Y,X,ne]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${fe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Y);return o?new vt(r,n,o):null}return new vt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!he(t,["boolean","string","number","null"]))throw new Ye(`Expected first argument to be of type boolean, string, number or null, but found ${fe(ot(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),he(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(he(r,["array"]))return r.indexOf(t,n);throw new Ye(`Expected second argument to be of type array or string, but found ${fe(ot(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class bt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ot(e)))return null}else r=ot(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,ne);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new bt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(ot(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class xt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,Q);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new xt(r,n,o)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class wt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,Y);if(!r||!n)return null;if(!ye(r.type,[ce(ne),K,ne]))return t.error(`Expected first argument to be of type array or string, but found ${fe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Y);return o?new wt(r.type,r,n,o):null}return new wt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),he(t,["string"]))return[...t].slice(r,n).join("");if(he(t,["array"]))return t.slice(r,n);throw new Ye(`Expected first argument to be of type array or string, but found ${fe(ot(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function kt(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new Ye("Input is not a number.");i=s-1}return 0}class Mt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,Y);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new Mt(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[kt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zt,jt;var Ct=function(){if(jt)return zt;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return jt=1,zt=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},zt}(),At=St(Ct);class Ot{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=Et(t,e.base,r,n);else if("linear"===e.name)o=Et(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new At(a[0],a[1],a[2],a[3]).solve(Et(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,Y),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==se?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=ee;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return ge(s,Y)||ge(s,te)||ge(s,ee)||ge(s,ie)||ge(s,le)||ge(s,se)||ge(s,pe)||ge(s,ce(Y))?new Ot(s,r,n,o,i):t.error(`Type ${fe(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=kt(t,n),i=t[a],s=t[a+1],l=Ot.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Re(u,p,l);case"color":return He.interpolate(u,p,l);case"padding":return We.interpolate(u,p,l);case"colorArray":return Xe.interpolate(u,p,l);case"numberArray":return Je.interpolate(u,p,l);case"variableAnchorOffsetCollection":return Qe.interpolate(u,p,l);case"array":return Ge(u,p,l);case"projectionDefinition":return tt.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return He.interpolate(u,p,l,"hcl");case"colorArray":return Xe.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return He.interpolate(u,p,l,"lab");case"colorArray":return Xe.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Et(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class _t{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>me(n,e.type));return new _t(a?ne:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof et&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Pt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function It(e,t,r,n){return 0===n.compare(t,r)}function $t(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=Q,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,ne);if(!a)return null;if(!Pt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${fe(a.type)}'.`);let i=t.parse(e[2],2,ne);if(!i)return null;if(!Pt(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${fe(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${fe(a.type)}' and '${fe(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new lt(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new lt(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,oe),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=ot(a),r=ot(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ye(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=ot(a),r=ot(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Tt=$t("==",function(e,t,r){return t===r},It),qt=$t("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!It(0,t,r,n)}),Dt=$t("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Ft=$t(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Nt=$t("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Lt=$t(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Rt{constructor(e,t,r){this.type=oe,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Q);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Q);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,K),!a)?null:new Rt(n,o,a)}evaluate(e){return new Be(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}}class Gt{constructor(e,t,r,n,o,a){this.type=K,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Y);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,K),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,K),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,K),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,Y),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,Y),!l)?null:new Gt(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ht{constructor(e){this.type=ae,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,Y),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,ce(K)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,ee),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Ve.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,K),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,ne);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Ht(n)}evaluate(e){return new Ue(this.sections.map(t=>{const r=t.content.evaluate(e);return ot(r)===ue?new Ze("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Ze(at(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Bt{constructor(e){this.type=ue,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,K);return r?new Bt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=et.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Vt{constructor(e){this.type=Y,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${fe(r.type)} instead.`):new Vt(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new Ye(`Expected value to be of type string or array, but found ${fe(ot(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Zt=8192;function Ut(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*Zt),Math.round(n*a*Zt)]}function Wt(e,t){const r=Math.pow(2,t.z),n=(e[0]/Zt+t.x)/r,o=(e[1]/Zt+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function Jt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Xt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function Yt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Kt(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function Qt(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!ar(e,t,r,n)||!ar(r,n,e,t));var i,s}function er(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(Qt(e,t,n[r],n[r+1]))return!0;return!1}function tr(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(Kt(e,o[t],o[t+1]))return r;Yt(e,o[t],o[t+1])&&(n=!n)}return n}function rr(e,t){for(const r of t)if(tr(e,r))return!0;return!1}function nr(e,t){for(const r of e)if(!tr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(er(e[r],e[r+1],t))return!1;return!0}function or(e,t){for(const r of t)if(nr(e,r))return!0;return!1}function ar(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function ir(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=Ut(e[o][n],r);Jt(t,i),a.push(i)}n.push(a)}return n}function sr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=ir(e[o],t,r);n.push(a)}return n}function lr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}Jt(t,e)}function ur(e,t,r,n){const o=Math.pow(2,n.z)*Zt,a=[n.x*Zt,n.y*Zt],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];lr(n,t,r,o),i.push(n)}return i}function pr(e,t,r,n){const o=Math.pow(2,n.z)*Zt,a=[n.x*Zt,n.y*Zt],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];Jt(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)lr(n,t,r,o)}return i}class cr{constructor(e,t){this.type=Q,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(nt(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new cr(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new cr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new cr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ir(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!tr(e,a))return!1}if("MultiPolygon"===t.type){const a=sr(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!rr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ir(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!nr(e,a))return!1}if("MultiPolygon"===t.type){const a=sr(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!or(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class fr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function dr(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const mr=1/298.257223563,yr=mr*(2-mr),hr=Math.PI/180;class gr{constructor(e){const t=6378.137*hr*1e3,r=Math.cos(e*hr),n=1/(1-yr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-yr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function vr(e,t){return t[0]-e[0]}function br(e){return e[1]-e[0]+1}function xr(e,t){return e[1]>=e[0]&&e[1]<t}function wr(e,t){if(e[0]>e[1])return[null,null];const r=br(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function kr(e,t){if(!xr(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Jt(r,e[n]);return r}function Mr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)Jt(t,e);return t}function Sr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function zr(e,t,r){if(!Sr(e)||!Sr(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function jr(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Cr(e,t,r,n,o){const a=Math.min(jr(e,[r,n],o),jr(t,[r,n],o)),i=Math.min(jr(r,[e,t],o),jr(n,[e,t],o));return Math.min(a,i)}function Ar(e,t,r,n,o){if(!(xr(t,e.length)&&xr(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(Qt(t,s,n,i))return 0;a=Math.min(a,Cr(t,s,n,i,o))}}return a}function Or(e,t,r,n,o){if(!(xr(t,e.length)&&xr(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function Er(e,t,r){if(tr(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,jr(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function _r(e,t,r,n){if(!xr(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(tr(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(Qt(t,i,a,l))return 0;o=Math.min(o,Cr(t,i,a,l,n))}}return o}function Pr(e,t){for(const r of e)for(const e of r)if(tr(e,t,!0))return!0;return!1}function Ir(e,t,r,n=1/0){const o=Mr(e),a=Mr(t);if(n!==1/0&&zr(o,a,r)>=n)return n;if(Xt(o,a)){if(Pr(e,t))return 0}else if(Pr(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(Qt(o,s,n,l))return 0;i=Math.min(i,Cr(o,s,n,l,r))}}return i}function $r(e,t,r,n,o,a){if(!a)return;const i=zr(kr(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function Tr(e,t,r,n,o,a,i){if(!a||!i)return;const s=zr(kr(n,a),kr(o,i),r);s<t&&e.push([s,a,i])}function qr(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new fr([[0,[0,e.length-1],[0,0]]],vr),s=Mr(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(br(l)<=u){if(!xr(l,e.length))return NaN;if(t){const t=_r(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=Er(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=wr(l,t);$r(i,a,n,e,s,r[0]),$r(i,a,n,e,s,r[1])}}return a}function Dr(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new fr([[0,[0,e.length-1],[0,r.length-1]]],vr);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(br(l)<=p&&br(u)<=c){if(!xr(l,e.length)&&xr(u,r.length))return NaN;let a;if(t&&n)a=Ar(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=jr(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=jr(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=Or(e,l,r,u,o),i=Math.min(i,a)}else{const a=wr(l,t),p=wr(u,n);Tr(s,i,o,e,r,a[0],p[0]),Tr(s,i,o,e,r,a[0],p[1]),Tr(s,i,o,e,r,a[1],p[0]),Tr(s,i,o,e,r,a[1],p[1])}}return i}function Fr(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=dr(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>Wt([t.x,t.y],e.canonical)))),o=new gr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,qr([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,qr(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,Ir(t,e.coordinates,o,a))}if(0===a)return a}return a}function Nr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Lr{constructor(e,t){this.type=Y,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(nt(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Lr(t,t.features.map(e=>Nr(e.geometry)).flat());if("Feature"===t.type)return new Lr(t,Nr(t.geometry));if("type"in t&&"coordinates"in t)return new Lr(t,Nr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Wt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new gr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Dr(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Dr(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,qr(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Wt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new gr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Dr(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Dr(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,qr(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Fr(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Rr{constructor(e){this.type=ne,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Rr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?$e(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Gr={"==":Tt,"!=":qt,">":Ft,"<":Dt,">=":Lt,"<=":Nt,array:lt,at:ht,boolean:lt,case:xt,coalesce:_t,collator:Rt,format:Ht,image:Bt,in:gt,"index-of":vt,interpolate:Ot,"interpolate-hcl":Ot,"interpolate-lab":Ot,length:Vt,let:mt,literal:it,match:bt,number:lt,"number-format":Gt,object:lt,slice:wt,step:Mt,string:lt,"to-boolean":pt,"to-color":pt,"to-number":pt,"to-string":pt,var:yt,within:cr,distance:Lr,"global-state":Rr};class Hr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=Hr.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new dt(t.registry,Wr,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Hr(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(fe).join(", ")})`:`(${fe(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(fe(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Hr.definitions=t;for(const r in t)e[r]=Hr}}function Br(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=rt(t,r,n,a);if(i)throw new Ye(i);return new He(t/255,r/255,n/255,a,!1)}function Vr(e,t){return e in t}function Zr(e,t){const r=t[e];return void 0===r?null:r}function Ur(e){return{type:e}}function Wr(e){if(e instanceof yt)return Wr(e.boundExpression);if(e instanceof Hr&&"error"===e.name)return!1;if(e instanceof Rt)return!1;if(e instanceof cr)return!1;if(e instanceof Lr)return!1;if(e instanceof Rr)return!1;const t=e instanceof pt||e instanceof lt;let r=!0;return e.eachChild(e=>{r=t?r&&Wr(e):r&&e instanceof it}),!!r&&(Jr(e)&&Yr(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function Jr(e){if(e instanceof Hr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof cr)return!1;if(e instanceof Lr)return!1;let t=!0;return e.eachChild(e=>{t&&!Jr(e)&&(t=!1)}),t}function Xr(e){if(e instanceof Hr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!Xr(e)&&(t=!1)}),t}function Yr(e,t){if(e instanceof Hr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!Yr(e,t)&&(r=!1)}),r}function Kr(e){return{result:"success",value:e}}function Qr(e){return{result:"error",value:e}}function en(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&ot(e)===re}Hr.register(Gr,{error:[{kind:"error"},[K],(e,[t])=>{throw new Ye(t.evaluate(e))}],typeof:[K,[ne],(e,[t])=>fe(ot(t.evaluate(e)))],"to-rgba":[ce(Y,4),[ee],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[ee,[Y,Y,Y],Br],rgba:[ee,[Y,Y,Y,Y],Br],has:{type:Q,overloads:[[[K],(e,[t])=>Vr(t.evaluate(e),e.properties())],[[K,re],(e,[t,r])=>Vr(t.evaluate(e),r.evaluate(e))]]},get:{type:ne,overloads:[[[K],(e,[t])=>Zr(t.evaluate(e),e.properties())],[[K,re],(e,[t,r])=>Zr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ne,[K],(e,[t])=>Zr(t.evaluate(e),e.featureState||{})],properties:[re,[],e=>e.properties()],"geometry-type":[K,[],e=>e.geometryType()],id:[ne,[],e=>e.id()],zoom:[Y,[],e=>e.globals.zoom],"heatmap-density":[Y,[],e=>e.globals.heatmapDensity||0],elevation:[Y,[],e=>e.globals.elevation||0],"line-progress":[Y,[],e=>e.globals.lineProgress||0],accumulated:[ne,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Y,Ur(Y),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[Y,Ur(Y),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:Y,overloads:[[[Y,Y],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Y],(e,[t])=>-t.evaluate(e)]]},"/":[Y,[Y,Y],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Y,[Y,Y],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Y,[],()=>Math.LN2],pi:[Y,[],()=>Math.PI],e:[Y,[],()=>Math.E],"^":[Y,[Y,Y],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Y,[Y],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))],log2:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Y,[Y],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Y,[Y],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Y,[Y],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Y,[Y],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Y,[Y],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Y,[Y],(e,[t])=>Math.atan(t.evaluate(e))],min:[Y,Ur(Y),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[Y,Ur(Y),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[Y,[Y],(e,[t])=>Math.abs(t.evaluate(e))],round:[Y,[Y],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Y,[Y],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Y,[Y],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Q,[K,ne],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[Q,[ne],(e,[t])=>e.id()===t.value],"filter-type-==":[Q,[K],(e,[t])=>e.geometryType()===t.value],"filter-<":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[Q,[ne],(e,[t])=>t.value in e.properties()],"filter-has-id":[Q,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[Q,[ce(K)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Q,[ce(ne)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Q,[K,ce(ne)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Q,[K,ce(ne)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Q,overloads:[[[Q,Q],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Ur(Q),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:Q,overloads:[[[Q,Q],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Ur(Q),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[Q,[Q],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Q,[K],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[K,[K],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[K,[K],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[K,Ur(ne),(e,t)=>t.map(t=>at(t.evaluate(e))).join("")],split:[ce(K),[K,K],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[K,[ce(K),K],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[K,[oe],(e,[t])=>t.evaluate(e).resolvedLocale()]});class tn{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new ft,this._defaultValue=t?function(e){if("color"===e.type&&en(e.default))return new He(0,0,0,0);switch(e.type){case"color":return He.parse(e.default)||null;case"padding":return We.parse(e.default)||null;case"numberArray":return Je.parse(e.default)||null;case"colorArray":return Xe.parse(e.default)||null;case"variableAnchorOffsetCollection":return Qe.parse(e.default)||null;case"projectionDefinition":return tt.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=pn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ye(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function rn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Gr}function nn(e,t,r){const n=new dt(Gr,Wr,[],t?function(e){const t={color:ee,string:K,number:Y,enum:K,boolean:Q,formatted:ae,padding:ie,numberArray:le,colorArray:se,projectionDefinition:te,resolvedImage:ue,variableAnchorOffsetCollection:pe};if("array"===e.type)return ce(t[e.value]||ne,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Kr(new tn(o,t,r)):Qr(n.errors)}class on{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Xr(t.expression),this.globalStateRefs=un(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class an{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Xr(t.expression),this.globalStateRefs=un(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?Ot.interpolationFactor(this.interpolationType,e,t,r):0}}function sn(e,t,r){const n=nn(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=Jr(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return Qr([new W("","data expressions not supported")]);var i;const s=Yr(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return Qr([new W("","zoom expressions not supported")]);const l=ln(o);if(!l&&!s)return Qr([new W("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof W)return Qr([l]);if(l instanceof Ot&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return Qr([new W("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Kr(new on(a?"constant":"source",n.value,r));const u=l instanceof Ot?l.interpolation:void 0;return Kr(new an(a?"camera":"composite",n.value,l.labels,u,r))}function ln(e){let t=null;if(e instanceof mt)t=ln(e.result);else if(e instanceof _t){for(const r of e.args)if(t=ln(r),t)break}else(e instanceof Mt||e instanceof Ot)&&e.input instanceof Hr&&"zoom"===e.input.name&&(t=e);return t instanceof W||e.eachChild(e=>{const r=ln(e);r instanceof W?t=r:!t&&r?t=new W("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new W("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function un(e,t=new Set){return e instanceof Rr&&t.add(e.key),e.eachChild(e=>{un(e,t)}),t}function pn(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function cn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!cn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const fn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function dn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};cn(e)||(e=hn(e));const r=nn(e,fn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:yn(e),getGlobalStateRefs:()=>un(r.value.expression)}}function mn(e,t){return e<t?-1:e>t?1:0}function yn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(yn(e[t]))return!0;return!1}function hn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?gn(e[1],e[2],"=="):"!="===t?xn(gn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?gn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(hn))):"all"===t?["all"].concat(e.slice(1).map(hn)):"none"===t?["all"].concat(e.slice(1).map(hn).map(xn)):"in"===t?vn(e[1],e.slice(2)):"!in"===t?xn(vn(e[1],e.slice(2))):"has"===t?bn(e[1]):"!has"!==t||xn(bn(e[1]))}function gn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function vn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(mn)]]:["filter-in-small",e,["literal",t]]}}function bn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function xn(e){return["!",e]}function wn(e){return"object"==typeof e?["literal",e]:e}function kn(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,wn(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],On(e[1])]:[e[0],wn(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=An({},t);if("exponential"===i){const r=[Mn(e),["linear"],["zoom"]];for(const e of a){Cn(r,e,zn(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){Cn(e,r,zn(n[r],t,o[r]),!0)}return jn(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=An(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[Mn(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)Cn(a,e[0],e[1],i);return jn(a),a}(e,t,r):zn(e,t,r)}function Mn(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Sn(e,t){const r=wn((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function zn(e,t,r){const n=An(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(Sn(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)Cn(n,e[0],e[1],!1);return n.push(Sn(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)Cn(t,e[0],e[1],!0);return jn(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,wn(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[Mn(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)Cn(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,wn(e.default)]}throw new Error(`Unknown property function type ${n}`)}function jn(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function Cn(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function An(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function On(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const En=V;function _n(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return He.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function Pn(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",Pn(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=Pn(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push(Pn(e[t]));return o}}}return e}const In={},$n={zoom:0,distanceFromCenter:0};Hr.register(Gr,{...Hr.definitions,pitch:[{kind:"number"},[],e=>$n.pitch||0],"distance-from-center":[{kind:"number"},[],e=>$n.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(O(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],_n],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],_n],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=In[t.evaluate(e)];return void 0===r?{}:r}]});var Tn={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},qn=" ",Dn=/(italic|oblique)$/i,Fn={};function Nn(e,t,r){var n=Fn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Dn.test(f)&&(f=f.replace(Dn,""),s=a?s:c[c.length-1].replace(f,""),a=!0),Tn){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:Tn[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(qn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(qn)&&(y='"'+y+'"'),l.push(y)}n=Fn[e]=[s,i,l]}return n[0]+qn+n[1]+qn+t+"px"+(r?"/"+r:"")+qn+n[2]}const Ln=Object.freeze({}),Rn={},Gn={};let Hn=0;function Bn(e){return e.id||(e.id=Hn++),e.id}function Vn(e){return e*Math.PI/180}const Zn=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Un(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function Wn(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=Un(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function Jn(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function Xn(e,t,r){const n=Un(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=Jn(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const Yn=Array(256).join(" ");function Kn(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=Yn.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let Qn;function eo(){return Qn||(Qn=Un(1,1).getContext("2d")),Qn}function to(e,t){return eo().measureText(e).width+(e.length-1)*t}const ro={};function no(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(no(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=ro[o];if(!a){const i=e.split(" ");if(i.length>1){const e=eo();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;to(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(to(r,n)<.35*o){const o=e>0?to(l[e-1],n):1/0,a=e<t-1?to(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(to(r,n)>.7*o&&to(a,n)<.6*o){const i=r.split(" "),s=i.pop();to(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=Kn(a,n),ro[o]=a}return a}E.on("propertychange",()=>{for(const e in ro)delete ro[e]});const oo={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},ao={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},io=function(e,t){let r=sn(e,t);if("error"===r.result){const n=Pn(e);n!==e&&(r=sn(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let so,lo;function uo(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Ln)[r];const o=En[`${t}_${e.type}`]&&En[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=rn(n);if(!a&&en(n)&&(n=kn(n,o),a=!0),a){const e=io(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=He.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(rn(r)||en(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!rn(o)&&en(o)&&(o=kn(o,e)),rn(o)){const r=io(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r]($n,n,a)}function po(e,t,r,n){if(!uo(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return uo(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function co(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=dn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e]($n,r)}function fo(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const mo=/\{[^{}}]*\}/g;function yo(e,t){return e.replace(mo,function(e){return t[e.slice(1,-1)]||""})}function ho(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let go=!1;const vo={};function bo(t,n,o,a=Zn,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&(In[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");vo[function(e,t){return Bn(e)+"."+_(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];f(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const x=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=U(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],M={},S={},z=function(e){let t=Rn[e.id];return t||(t={},Rn[Bn(e)]=t),t}(n),j=function(e){let t=Gn[e.id];return t||(t={},Gn[Bn(e)]=t),t}(n);let C;for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(C){if(t.source!==C)throw new Error(`Layer "${r}" does not use source "${C}`)}else{C=t.source;const e=n.sources[C];if(!e)throw new Error(`Source "${C}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${C}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const A=[],O=function(o,s,f){const x=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),C=w[k[x]];if(!C)return;let O=a.indexOf(s);-1==O&&(O=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),$n.zoom=O,$n.distanceFromCenter=0;const E=o.getGeometry(),_=oo[E.getType()],P=t.get("map");if(P&&P instanceof e&&1===_){const e=P.getSize();if(e){const t=P.getView().getCenter(),n=r(E.getExtent());$n.distanceFromCenter=c(t,n)/s/e[1]}}const I={id:o.getId(),properties:k,type:_},$=t.get("mapbox-featurestate")[o.getId()];let T,q=-1;for(let e=0,r=C.length;e<r;++e){const r=C[e],a=r.layer,c=a.id;if(void 0!==f&&f!==c)continue;const x=a.layout||Ln,w=a.paint||Ln;if("none"===uo(a,"layout","visibility",I,z,$)||"minzoom"in a&&O<a.minzoom||"maxzoom"in a&&O>=a.maxzoom)continue;const E=a.filter;if(!E||co(c,E,I,j)){let e,c,f,j,C,O;T=a;const E=r.index;if(3==_&&("fill"==a.type||"fill-extrusion"==a.type))if(c=uo(a,"paint",a.type+"-opacity",I,z,$),a.type+"-pattern"in w){const e=uo(a,"paint",a.type+"-pattern",I,z,$);if(e){const t="string"==typeof e?yo(e,k):e.toString(),r=ho(t,p);if(i&&i[t]&&r){++q,O=A[q],O&&O.getFill()&&!O.getStroke()&&!O.getText()||(O=new v({fill:new y}),A[q]=O),f=O.getFill(),O.setZIndex(E);const e=t+"."+c;let n=S[e];if(!n){const o=i[t],a=Un(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),S[e]=n}f.setColor(n)}}}else if(e=fo(uo(a,"paint",a.type+"-color",I,z,$),c),a.type+"-outline-color"in w&&(C=fo(uo(a,"paint",a.type+"-outline-color",I,z,$),c)),C||(C=e),e||C){if(++q,O=A[q],(!O||e&&!O.getFill()||!e&&O.getFill()||C&&!O.getStroke()||!C&&O.getStroke()||O.getText())&&(O=new v({fill:e?new y:void 0,stroke:C?new g:void 0}),A[q]=O),e&&(f=O.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=uo(a,"paint","fill-extrusion-height",I,z,$);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(C&&"transparent"!==C){const e=He.parse(C);C=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}C&&(j=O.getStroke(),j.setColor(C),j.setWidth(.5)),O.setZIndex(E)}if(1!=_&&"line"==a.type){e="line-pattern"in w?void 0:fo(uo(a,"paint","line-color",I,z,$),uo(a,"paint","line-opacity",I,z,$));const t=uo(a,"paint","line-width",I,z,$);e&&t>0&&(++q,O=A[q],O&&O.getStroke()&&!O.getFill()&&!O.getText()||(O=new v({stroke:new g}),A[q]=O),j=O.getStroke(),j.setLineCap(uo(a,"layout","line-cap",I,z,$)),j.setLineJoin(uo(a,"layout","line-join",I,z,$)),j.setMiterLimit(uo(a,"layout","line-miter-limit",I,z,$)),j.setColor(e),j.setWidth(t),j.setLineDash(w["line-dasharray"]?uo(a,"paint","line-dasharray",I,z,$).map(function(e){return e*t}):null),"function"==typeof j.setOffset&&j.setOffset(uo(a,"paint","line-offset",I,z,$)),O.setZIndex(E))}let P,D,F,N,L,R,G,H,B,V=!1,Z=null,U=0;if((1==_||2==_)&&"icon-image"in x){const e=uo(a,"layout","icon-image",I,z,$);if(e){let r;P="string"==typeof e?yo(e,k):e.toString();const n=u?u(t,P):void 0,l=ho(P,p);if(i&&i[P]&&l||n){const e=uo(a,"layout","icon-rotation-alignment",I,z,$);if(2==_){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();lo||(so=[NaN,NaN],lo=new d("Point",so,[],2,{},void 0)),r=lo,so[0]=n[0],so[1]=n[1];if("line"===uo(a,"layout","symbol-placement",I,z,$)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){U=Math.atan2(a-s,i-o);break}}}}}}if(2!==_||r){const t=uo(a,"layout","icon-size",I,z,$),o=void 0!==w["icon-color"]?uo(a,"paint","icon-color",I,z,$):null;if(!o||0!==o.a){const r=uo(a,"paint","icon-halo-color",I,z,$),s=uo(a,"paint","icon-halo-width",I,z,$);let u=`${P}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),D=M[u],!D){const p=po(a,I,"icon",z);let c;"icon-offset"in x&&(c=uo(a,"layout","icon-offset",I,z,$).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),D=new h(r)}else{const n=i[P];let a,u,d;if(s)n.sdf?(a=Wn(Xn(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=Wn(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=Xn(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}D=new h({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}M[u]=D}}D&&(++q,O=A[q],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new v,A[q]=O),O.setGeometry(r),D.setRotation(U+Vn(uo(a,"layout","icon-rotate",I,z,$))),D.setOpacity(uo(a,"paint","icon-opacity",I,z,$)),D.setAnchor(ao[uo(a,"layout","icon-anchor",I,z,$)]),O.setImage(D),Z=O.getText(),O.setText(void 0),O.setZIndex(E),V=!0,F=!1)}else F=!0}}}if(1==_&&"circle"===a.type){++q,O=A[q],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new v,A[q]=O);const e="circle-radius"in w?uo(a,"paint","circle-radius",I,z,$):5,t=fo(uo(a,"paint","circle-stroke-color",I,z,$),uo(a,"paint","circle-stroke-opacity",I,z,$)),r=uo(a,"paint","circle-translate",I,z,$),n=fo(uo(a,"paint","circle-color",I,z,$),uo(a,"paint","circle-opacity",I,z,$)),o=uo(a,"paint","circle-stroke-width",I,z,$),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];D=M[i],D||(D=new m({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new g({width:o,color:t}):void 0,fill:n?new y({color:n}):void 0,declutterMode:"none"}),M[i]=D),O.setImage(D),Z=O.getText(),O.setText(void 0),O.setGeometry(void 0),O.setZIndex(E),V=!0}if("text-field"in x){G=Math.round(uo(a,"layout","text-size",I,z,$));const e=uo(a,"layout","text-font",I,z,$);R=uo(a,"layout","text-line-height",I,z,$),L=Nn(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),H=uo(a,"layout","text-letter-spacing",I,z,$),B=uo(a,"layout","text-max-width",I,z,$);const t=uo(a,"layout","text-field",I,z,$);N="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Nn(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==_)return t.push(Kn(i,H),a),t;i=no(i,a,B,H).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):yo(t,k).trim(),c=uo(a,"paint","text-opacity",I,z,$)}if(N&&c&&!F){V||(++q,O=A[q],O&&O.getText()&&!O.getFill()&&!O.getStroke()||(O=new v,A[q]=O),O.setImage(void 0),O.setGeometry(void 0));const e=po(a,I,"text",z);O.getText()||O.setText(Z),Z=O.getText(),(!Z||"getDeclutterMode"in Z&&Z.getDeclutterMode()!==e)&&(Z=new b({padding:[2,2,2,2],declutterMode:e}),O.setText(Z));const t=uo(a,"layout","text-transform",I,z,$);"uppercase"==t?N=Array.isArray(N)?N.map((e,t)=>t%2?e:e.toUpperCase()):N.toUpperCase():"lowercase"==t&&(N=Array.isArray(N)?N.map((e,t)=>t%2?e:e.toLowerCase()):N.toLowerCase());const r=Array.isArray(N)?N:2==_?Kn(N,H):no(N,L,B,H);if(Z.setText(r),Z.setFont(L),Z.setRotation(Vn(uo(a,"layout","text-rotate",I,z,$))),"function"==typeof Z.setKeepUpright){const e=uo(a,"layout","text-keep-upright",I,z,$);Z.setKeepUpright(e)}const n=uo(a,"layout","text-anchor",I,z,$),o=V||1==_?"point":uo(a,"layout","symbol-placement",I,z,$);let i;if("line-center"===o?(Z.setPlacement("line"),i="center"):Z.setPlacement(o),"line"===o&&"function"==typeof Z.setRepeat){const e=uo(a,"layout","symbol-spacing",I,z,$);Z.setRepeat(2*e)}Z.setOverflow("point"===o);let s=uo(a,"paint","text-halo-width",I,z,$);const l=uo(a,"layout","text-offset",I,z,$),u=uo(a,"paint","text-translate",I,z,$);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=uo(a,"layout","text-rotation-alignment",I,z,$);Z.setRotateWithView("map"==e)}else Z.setMaxAngle(Vn(uo(a,"layout","text-max-angle",I,z,$))*N.length/r.length),Z.setRotateWithView(!1);Z.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),Z.setTextBaseline(d);const m=uo(a,"layout","text-justify",I,z,$);Z.setJustify("auto"===m?void 0:m),Z.setOffsetX(l[0]*G+f+u[0]),Z.setOffsetY(l[1]*G+p+u[1]);const h=Z.getFill()||new y;h.setColor(fo(uo(a,"paint","text-color",I,z,$),c)),Z.setFill(h);const x=fo(uo(a,"paint","text-halo-color",I,z,$),c);if(x&&s>0){const e=Z.getStroke()||new g;e.setColor(x),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),Z.setStroke(e)}else Z.setStroke(void 0);const w=uo(a,"layout","text-padding",I,z,$),k=Z.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),O.setZIndex(E)}}}return q>-1?(A.length=q+1,go&&("set"in o?o.set("mapbox-layer",T):o.getProperties()["mapbox-layer"]=T),A):void 0};return t.setStyle(O),t.set("mapbox-layers",k),t.set("mapbox-source",C),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),O}function xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}He.parse("#000000"),He.parse("#FFFFFF"),He.parse("#000000"),function(e=!1){go=e}(!0);var ko="EPSG:27700",Mo=new Set(["vector","raster","wms","ogc-vt"]);function So(e,t,r){var n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}var zo=e=>(t,r)=>{var n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(A.ERROR))};function jo(e){return new p(wo({resolutions:$,origin:q,tileSize:256},e&&{extent:e}))}function Co(e,t){return Ao.apply(this,arguments)}function Ao(){return Ao=x(function*(e,t){if(e.type&&!Mo.has(e.type))throw new Error("Unsupported map style type: '".concat(e.type,"'"));if("wms"===e.type){var r=function(e,t,r){var n=jo();return new j({url:e,params:t,projection:ko,tileGrid:n,tileLoadFunction:r?zo(r):void 0})}(e.url,e.params||{},t);return{layer:new a({source:r}),source:r}}if("raster"===e.type){var n=function(e,t,r){var n=jo(r);return new z({projection:ko,tileGrid:n,tileUrlFunction:t=>{var[r,n,o]=t;return e.replace("{z}",r).replace("{x}",n).replace("{y}",o)},tileLoadFunction:t?zo(t):void 0})}(e.url,t,e.extent);return{layer:new a({source:n}),source:n}}return"ogc-vt"===e.type?function(e,t){return _o.apply(this,arguments)}(e.url,t,e):function(e,t){return Eo.apply(this,arguments)}(e.url,t,e)}),Ao.apply(this,arguments)}function Oo(e,t){var r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a="".concat(n,".json").concat(o),i="".concat(n,".png").concat(o);return{jsonUrl:a,pngUrl:i,fetch:()=>So(a,"SpriteJSON",t).then(e=>e.json())}}function Eo(){return Eo=x(function*(e,t){var{renderMode:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yield So(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=yield So(i,"Source",t).then(e=>e.json()),c=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=Oo(n.sprite,t),g=yield h.fetch();!function(e){e.layers.forEach(e=>{var t;null!==(t=e.paint)&&void 0!==t&&t["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);var v=new p({extent:c,origin:f,resolutions:d,tileSize:m}),b=new u({format:new o,url:y,projection:ko,tileGrid:v}),x=new s(wo({source:b,declutter:!0},r&&{renderMode:r}));return x.set("layerType","vectorTile"),bo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}),Eo.apply(this,arguments)}function _o(){return _o=x(function*(e,t){var r,{renderMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=yield So(e,"Style",t).then(e=>e.json()),i=Object.keys(a.sources)[0],l=a.sources[i].url,u=Oo(a.sprite,t),c=null===(r=(yield So(l,"Source",t).then(e=>e.json())).links)||void 0===r?void 0:r.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=yield Promise.all([So(c.href,"Source",t).then(e=>e.json()),u.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");var v=new p({resolutions:m,origin:y,tileSize:h}),b=new C({url:l,format:g,tileGrid:v,projection:ko}),x=new s(wo({source:b,declutter:!0},n&&{renderMode:n}));return x.set("layerType","vectorTile"),bo(x,a,i,m,d,u.pngUrl),{layer:x,source:b}}),_o.apply(this,arguments)}function Po(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===Po(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var Io=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return Po(e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r},$o=e=>{var t=e/1609.344;if(t<.5){var r=Math.round(e),n=1===r?"metre":"metres";return"".concat(r," ").concat(n)}if(t<10){var o=Number.parseFloat(t.toFixed(1)),a=1===o?"mile":"miles";return"".concat(o," ").concat(a)}var i=Math.round(t);return"".concat(i," miles")},To=e=>Io(e),qo=(e,t,r)=>{for(var n=[],o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},Do=e=>{var t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:qo(r,0,r.length)};if("Polygon"===t){var n=e.getEnds(),o=0;return{type:"Polygon",coordinates:n.map(e=>{var t=qo(r,o,e);return o=e,t})}}if("MultiPolygon"===t){var a=e.getEndss(),i=0,s=a.map(e=>{var t=i,n=e.map(e=>{var n=qo(r,t,e);return t=e,n});return i=e[e.length-1],n});return{type:"MultiPolygon",coordinates:s}}return{type:t,coordinates:qo(r,0,r.length)}},Fo=(e,t,r,n)=>{var o=[];return e.getLayers().forEach(e=>{if(e instanceof s){var a=e.getSource(),i=null==a?void 0:a.sourceTiles_;i&&Object.values(i).forEach(e=>{e.getState()===A.LOADED&&e.getFeatures().forEach(e=>{var a;if((null===(a=e.get("mapbox-layer"))||void 0===a?void 0:a.id)===t){var i=n?e.get(n):e.getId();String(i)===String(r)&&o.push(Do(e))}})})}}),o},No=new Map,Lo=(e,t)=>{if(!e)return null;if("string"==typeof e)return e.trim();if("object"==typeof e){if(t&&e[t])return e[t];var r=Object.values(e)[0];return null!=r?r:null}return null},Ro={symbol:"pin",backgroundColor:"#ca3535",foregroundColor:"#ffffff"},Go={dot:"M8 3c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.241 5-5-2.24-5-5-5z",cross:"M6 3H10V6H13V10H10V13H6V10H3V6H6Z",diamond:"M8 2L14 8L8 14L2 8Z",triangle:"M8 2L14 14H2Z",square:"M3 3H13V13H3Z"},Ho={id:"pin",viewBox:"0 0 44 44",anchor:[.5,.9],graphic:Go.dot,svg:'<path d="M22 40.999c-3.621 0-8.306-5.864-10.258-8.3C9.02 29.302 6 23.66 6 19.002a16.01 16.01 0 0 1 16-16 16.01 16.01 0 0 1 16 16c0 4.658-3.02 10.3-5.742 13.697-1.952 2.437-6.637 8.3-10.258 8.3z" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M22 7.001a12.01 12.01 0 0 1 12 12c0 7.623-10.377 17.998-12 17.998S10 26.624 10 19.001a12.01 12.01 0 0 1 12-12z" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 19) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Bo={id:"circle",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:Go.dot,svg:'<circle cx="22" cy="22" r="16" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <circle cx="22" cy="22" r="12" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Vo={id:"square",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:Go.dot,svg:'<path d="M13 6h18c3.863 0 7 3.137 7 7v18c0 3.863-3.137 7-7 7H13c-3.863 0-7-3.137-7-7V13c0-3.863 3.137-7 7-7" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M13 34a3 3 0 0 1-3-3V13a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v18a3 3 0 0 1-3 3H13z" fill-rule="nonzero" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Zo=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),Uo=e=>{if(!(e=>!(!e.symbol&&!e.symbolSvgContent))(e))return{};var t={};return Zo.forEach(r=>{if(null!=e[r]){var n=r.charAt(6).toLowerCase()+r.slice(7);t[n]=e[r]}}),t},Wo={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}};function Jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Xo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Yo=new Map,Ko=new Map,Qo={},ea=e=>{var t=0;for(var r of e)t=Math.trunc((t<<5)-t+r.codePointAt(0));return Math.abs(t).toString(36)},ta=new Set(["id","svg","viewBox","anchor","symbol","symbolSvgContent"]);function ra(e,t,r){var n,o,a,i,s=null==r?void 0:r.id,l=Object.fromEntries(Object.entries(e||{}).filter(e=>{var[t]=e;return!ta.has(t)})),u=Object.fromEntries(Object.entries(Qo).filter(e=>{var[t]=e;return!ta.has(t)})),p=Object.fromEntries(Object.entries(t).filter(e=>{var[,t]=e;return null!=t})),c=Xo(Xo(Xo(Xo({},Ro),u),l),p),f=null!==(n=Wo[null==r?void 0:r.mapColorScheme])&&void 0!==n?n:Wo.light;return c.haloColor=null!==(o=null==r?void 0:r.haloColor)&&void 0!==o?o:f.haloColor,c.selectedColor=null!==(a=null==r?void 0:r.selectedColor)&&void 0!==a?a:f.selectedColor,c.activeColor=null!==(i=null==r?void 0:r.activeColor)&&void 0!==i?i:f.activeColor,"string"==typeof c.graphic&&Go[c.graphic]&&(c.graphic=Go[c.graphic]),Object.fromEntries(Object.entries(c).map(e=>{var[t,r]=e;return[t,Lo(r,s)||""]}))}function na(e,t){return Object.entries(t).reduce((e,t)=>{var[r,n]=t;return e.replaceAll("{{".concat(r,"}}"),n)},e)}var oa={setDefaults(e){Qo=e||{}},getDefaults:()=>Xo(Xo({},Ro),Qo),register(e){Yo.set(e.id,e)},get:e=>Yo.get(e),list:()=>[...Yo.values()],clear(){Yo.clear()},initialise(){this.register(Ho),this.register(Bo),this.register(Vo)},resolve(e,t,r){var n=ra(e,t||{},r);return e?(n.selectedColor="none",n.activeColor="none",na(e.svg,n)):""},resolveActive(e,t,r){var n=ra(e,t||{},r);return e?na(e.svg,n):""},resolveSelected(e,t,r){var n=ra(e,t||{},r);return e?(n.activeColor="none",na(e.svg,n)):""},getSymbolImageId(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,o=this.getSymbolDef(e);if(!o)return null;var a=Uo(e),i=r?this.resolveActive(o,a,t):this.resolve(o,a,t);return"symbol-".concat(r?"act-":"").concat(ea(i),"-").concat(n,"x")},getSymbolDef(e){return e.symbolSvgContent?{svg:e.symbolSvgContent}:e.symbol?this.get(e.symbol):void 0},rasteriseSymbolImage(e,t,r,n){var o=this;return x(function*(){var a=o.getSymbolDef(e);if(!a)return null;var i,s,l=Uo(e);"active"===r?(i=o.resolveActive(a,l,t),s="act-"):"selected"===r?(i=o.resolveSelected(a,l,t),s="sel-"):(i=o.resolve(a,l,t),s="");var u="symbol-".concat(s).concat(ea(i),"-").concat(n,"x"),p=Ko.get(u);if(!p){var c=((e,t)=>{var r;return e.symbolViewBox?e.symbolViewBox:null!==(r=null==t?void 0:t.viewBox)&&void 0!==r?r:"0 0 38 38"})(e,a),[,,f,d]=c.split(" ").map(Number),m='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(f*n,'" height="').concat(d*n,'" viewBox="').concat(c,'">').concat(i,"</svg>");p=yield((e,t,r)=>new Promise((n,o)=>{var a="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(e)),i=new Image(t,r);i.onload=()=>{var e=document.createElement("canvas");e.width=t,e.height=r;var o=e.getContext("2d");o.drawImage(i,0,0,t,r),n(o.getImageData(0,0,t,r))},i.onerror=()=>{o(new Error("Failed to rasterise SVG: ".concat(e.slice(0,80))))},i.src=a}))(m,f*n,d*n),Ko.set(u,p)}return{imageId:u,imageData:p}})()}};function aa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aa(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}oa.initialise();var sa="EPSG:27700",la=new n({dataProjection:sa,featureProjection:sa}),ua="_highlight",pa=999,ca=(e,t)=>{if(!e)return[];var{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new v({stroke:new g({color:r,width:i}),zIndex:pa}),new v({stroke:new g({color:n,width:a}),zIndex:1e3})];var s=[new v({stroke:new g({color:n,width:a}),zIndex:pa})];return o&&"transparent"!==o&&s.push(new v({fill:new y({color:o}),zIndex:pa})),s},fa=(e,t)=>{if(!(e=>!!(null!=e&&e.symbol||null!=e&&e.symbolSvgContent))(e))return null;var r=t?e.symbolActiveImageId:e.symbolSelectedImageId,n=r&&(e=>No.get(e))(r);if(!n)return null;var o=((e,t)=>{var r;return e.symbolAnchor?e.symbolAnchor:null!==(r=null==t?void 0:t.anchor)&&void 0!==r?r:[.5,.5]})(e,oa.getSymbolDef(e)),a=1/(e.symbolPixelRatio||1);return[new v({image:new h({img:n,anchor:o,scale:a}),zIndex:pa})]},da=e=>{var t=new Set,r={};for(var{layerId:n,featureId:o,idProperty:a}of null!=e?e:[])t.add("".concat(n,":").concat(o)),a&&(r[n]=a);return{keys:t,idProps:r}},ma=(e,t,r)=>{var n;if(null!=r)return e.getLayers().forEach(e=>{var o;if(!n&&"vector"===e.get("layerType")&&!e.get(ua)&&e.get("layerId")===t){var a=null===(o=e.getSource())||void 0===o?void 0:o.getFeatureById(String(r));a&&(n=a.getProperties())}}),n},ya=(e,t,r,n,o)=>{for(var{layerId:a,featureId:i,geometry:s}of null!=r?r:[]){var l;if(s){var u=ma(e,a,i),p=null!==(l=fa(u,n))&&void 0!==l?l:ca(null==o?void 0:o[a],n);if(p.length){var c=new P({geometry:la.readGeometry(s)});c.setStyle(p),t.addFeature(c)}}}},ha=(e,t)=>{var{type:r,coordinates:n}=e,o=e=>{var[r,n]=e;return t(r,n)},a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},ga=(e,t,r,n)=>{if(!e)return null;var o=new Set;e.getLayers().forEach(e=>{if("vector"===e.get("layerType")&&!e.get(ua)){var t=e.get("layerId");t&&o.add(t)}});var{keys:a,idProps:s}=da(t),{keys:u,idProps:p}=da(r),c=ia(ia({},s),p);((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType"))if(t.size>0||r.size>0){e._highlightOriginalStyle||(e._highlightOriginalStyle=e.getStyleFunction());var a=e._highlightOriginalStyle;e.setStyle((e,i)=>{var s,l=a(e,i),u=null===(s=e.get("mapbox-layer"))||void 0===s?void 0:s.id;if(!u)return l;var p=n[u],c=p?e.get(p):e.getId(),f="".concat(u,":").concat(c),d=r.has(f),m=!d&&t.has(f);if(!d&&!m)return l;var y,h=ca(null==o?void 0:o[u],d);return h.length?[...(y=l,y?Array.isArray(y)?y:[y]:[]),...h]:l})}else e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle)})})(e,a,u,c,n);var f=(e=>{var t=null;return e.getLayers().forEach(e=>{e.get(ua)&&(t=e)}),t||((t=new i({source:new l,zIndex:1001})).set(ua,!0),t.set("layerType","vector"),e.addLayer(t)),t})(e),d=f.getSource();d.clear();var m=(null!=t?t:[]).filter(e=>o.has(e.layerId)),y=(null!=r?r:[]).filter(e=>o.has(e.layerId));ya(e,d,y,!0,n),ya(e,d,m,!1,n);var h=(null!=t?t:[]).flatMap(t=>((e,t)=>{var{layerId:r,featureId:n,idProperty:o,geometry:a}=t;if(null!=n){var i=Fo(e,r,n,o);if(i.length>0)return i}return a?[a]:[]})(e,t));return(e=>{if(!e.length)return null;var t=1/0,r=1/0,n=-1/0,o=-1/0;for(var a of e)ha(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(h)};function va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var ba="EPSG:27700",xa=new n({dataProjection:ba,featureProjection:ba}),wa=e=>{var t=e.getId();if(null!=t)return t;var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?va(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):va(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e.getProperties());return delete r["mapbox-layer"],JSON.stringify(r)},ka=(e,t,r)=>{var n=e.getViewport();if(r&&e.un("pointermove",r),null==t||!t.length)return n.style.cursor="",null;var o=new Set(t),a=null,i=t=>{var r;if("mouse"===(null===(r=t.originalEvent)||void 0===r?void 0:r.pointerType)){var i=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;var t=e.forEachFeatureAtPixel(i,(e,t)=>((e,t,r)=>{if("vectorTile"===t.get("layerType")){var n,o=null===(n=e.get("mapbox-layer"))||void 0===n?void 0:n.id;return Boolean(o&&r.has(o))}if("vector"===t.get("layerType")&&!t.get("_highlight")){var a=t.get("layerId");return Boolean(a&&r.has(a))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})}};return e.on("pointermove",i),i};function Ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Sa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ma(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ma(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(()=>{if("undefined"!=typeof HTMLCanvasElement){var e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.call(this,t,"2d"===t?Sa(Sa({},r),{},{willReadFrequently:!0}):r,...o)}}})();var za="EPSG:27700",ja=e=>{if(e){var{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]}};k.defs(za,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),M(k);class Ca extends I{constructor(e){var{mapProviderConfig:t={},events:r,eventBus:n}=e;super(),this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:N,supportsMapSizes:!0},Object.assign(this,t)}get name(){return"OpenLayersProvider"}initMap(n){var o=this;return x(function*(){var a,{container:i,padding:s,mapStyle:l,mapSize:u,center:p,zoom:c,bounds:f,minZoom:d,maxZoom:m,transformRequest:y,pixelRatio:h}=n;o.mapStyleId=null==l?void 0:l.id,o.mapSize=u;var{events:g,eventBus:v}=o,{layer:b,source:k}=yield Co(l,y),M=(null!==(a=o.zoomAlignment)&&void 0!==a?a:L)===R?{resolutions:T,defaultMinZoom:6,maxZoom:20}:{resolutions:$,defaultMinZoom:0,maxZoom:$.length-1},S=new t({projection:za,center:null!=p?p:f?r(f):void 0,zoom:null!=c?c:M.defaultMinZoom,minZoom:null!=d?d:M.defaultMinZoom,maxZoom:null!=m?m:M.maxZoom,resolutions:M.resolutions,constrainResolution:!1,padding:ja(s)}),z=new e({target:i,layers:[b],view:S,controls:[],interactions:w({doubleClickZoom:!1}),pixelRatio:h});f&&z.once("rendercomplete",()=>{S.fit(f,{size:z.getSize(),duration:0})}),o.mapEventHandles=B({map:z,source:k,events:g,eventBus:v,getZoom:o.getZoom.bind(o),getCenter:o.getCenter.bind(o),getBounds:o.getBounds.bind(o),getResolution:o.getResolution.bind(o)}),o.appEventHandles=function(e){var{mapProvider:t,transformRequest:r,events:n,eventBus:o,map:a,onBaseSourceChange:i}=e,s=function(){var e=x(function*(e){var{layer:s,source:l}=yield Co(e,r);a.getLayers().setAt(0,s),i(l),o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:e.id}),t.reapplyHighlights()});return function(t){return e.apply(this,arguments)}}(),l=e=>{a.setPixelRatio(e)},u=e=>{var{mapSize:r}=e;t.mapSize=r};return o.on(n.MAP_SET_STYLE,s),o.on(n.MAP_SET_PIXEL_RATIO,l),o.on(n.MAP_SIZE_CHANGE,u),{remove(){o.off(n.MAP_SET_STYLE,s),o.off(n.MAP_SET_PIXEL_RATIO,l),o.off(n.MAP_SIZE_CHANGE,u)}}}({mapProvider:o,transformRequest:y,events:g,eventBus:v,map:z,onBaseSourceChange:o.mapEventHandles.setSource})||[],o.map=z,o.view=S,v.emit(g.MAP_READY,{map:o.map,mapStyleId:o.mapStyleId,mapSize:o.mapSize,crs:o.crs})})()}destroyMap(){var e,t;null===(e=this.mapEventHandles)||void 0===e||e.remove(),null===(t=this.appEventHandles)||void 0===t||t.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView(e){var{center:t,zoom:r}=e;this.view.animate({center:null!=t?t:this.view.getCenter(),zoom:null!=r?r:this.view.getZoom(),duration:D})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:D})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:D})}panBy(e){var t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:D})}fitToBounds(e){var t=Array.isArray(e)?e:To(e);this.view.fit(t,{duration:D})}setPadding(e){this.view.padding=ja(e)}getCenter(){var e=this.view.getCenter(),t=F;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return[];var{radius:n=10}=r,o=[t.x,t.y],a=[],i=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{if("vectorTile"===t.get("layerType")){var r=e.get("mapbox-layer"),n=null==r?void 0:r.id;if(!n||"background"===(null==r?void 0:r.type))return;var o="".concat(n,":").concat(wa(e));if(i.has(o))return;i.add(o),a.push({id:e.getId(),layer:{id:n},geometry:Do(e),properties:e.getProperties()})}else if("vector"===t.get("layerType")){var s=t.get("layerId");if(!s||t.get("_highlight"))return;var l=e.getId(),u="".concat(s,":").concat(l);if(i.has(u))return;i.add(u),a.push({id:l,layer:{id:s},geometry:xa.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})}},{hitTolerance:n}),a}(this.map,e,t)}getFeatureGeometry(e,t,r){var n=Fo(this.map,e,t,r);return 0===n.length?null:1===n.length?n[0]:{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=ka(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return((e,t)=>{var r=new Set(t),n=[],o=new Set,a=e.getView().calculateExtent(e.getSize());return e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType")){var t,i=null===(t=e.getSource())||void 0===t?void 0:t.sourceTiles_;if(!i)return;Object.values(i).forEach(e=>{e.getState()===A.LOADED&&e.getFeatures().forEach(e=>{var t=e.get("mapbox-layer"),a=null==t?void 0:t.id;if(a&&r.has(a)&&"background"!==(null==t?void 0:t.type)){var i="".concat(a,":").concat(wa(e));o.has(i)||(o.add(i),n.push({id:e.getId(),layer:{id:a},geometry:Do(e),properties:e.getProperties()}))}})})}else if("vector"===e.get("layerType")){var s,l=e.get("layerId");if(!l||!r.has(l)||e.get("_highlight"))return;null===(s=e.getSource())||void 0===s||s.getFeaturesInExtent(a).forEach(e=>{n.push({id:e.getId(),layer:{id:l},geometry:xa.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})})}}),n})(this.map,e)}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},ga(this.map,e,t,r)}reapplyHighlights(){if(this._lastHighlightArgs){var{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;ga(this.map,e,t,r)}}getAreaDimensions(){return(e=>{if(!e)return"";var[t,r,n,o]=e,a=n-t;return"".concat($o(o-r)," by ").concat($o(a))})((e=>{var t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{var r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push("".concat(n>0?"north":"south"," ").concat($o(Math.abs(n)))),Math.abs(r)>1&&o.push("".concat(r>0?"east":"west"," ").concat($o(Math.abs(r)))),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};var t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return((e,t,r)=>{var n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;var o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=To(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;var f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top})(e,t,this.map)}}export{Ca as default};