@maptiler/sdk 2.1.0 → 2.2.1

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,3 +1,3 @@
1
- import h from"maplibre-gl";import{Base64 as Xt}from"js-base64";import Qt from"events";import{config as Te,expandMapStyle as eo,MapStyleVariant as to,ReferenceMapStyle as oo,MapStyle as ro,mapStylePresetList as ao,geolocation as Xe}from"@maptiler/client";import{LanguageGeocoding as ml,MapStyle as dl,MapStyleVariant as gl,ReferenceMapStyle as vl,ServiceError as yl,bufferToPixelDataBrowser as fl,circumferenceAtLatitude as Ll,coordinates as Al,data as wl,elevation as bl,expandMapStyle as Sl,geocoding as Cl,geolocation as Tl,getAutoLanguageGeocoding as Il,getBufferToPixelDataParser as Rl,getTileCache as El,mapStylePresetList as xl,math as Pl,misc as Ol,staticMaps as _l,styleToStyle as Nl}from"@maptiler/client";import{v4 as lo}from"uuid";var no="@maptiler/sdk",io="2.1.0",so="The Javascript & TypeScript map SDK tailored for MapTiler Cloud",uo="dist/maptiler-sdk.mjs",co="dist/maptiler-sdk.d.ts",po="dist/maptiler-sdk.css",ho="module",mo={".":{import:"./dist/maptiler-sdk.mjs",types:"./dist/maptiler-sdk.d.ts"},"./dist/maptiler-sdk.css":{import:"./dist/maptiler-sdk.css"},"./style.css":{import:"./dist/maptiler-sdk.css"}},go=["maptiler","map","sdk","webmap","cloud","webGL","maplibre"],vo="https://docs.maptiler.com/sdk-js/",yo="BSD-3-Clause",fo={type:"git",url:"https://github.com/maptiler/maptiler-sdk-js.git"},Lo={build:"rm -rf dist/* && NODE_ENV=production rollup -c",dev:"rm -rf dist/* && NODE_ENV=development rollup -c -w","format:fix":'prettier --write "src/**/*.{js,ts,tsx}"',format:'prettier -c "src/**/*.{js,ts,tsx}"',"lint:fix":'eslint --fix "src/**/*.{js,ts}"',lint:'eslint "src/**/*.{js,ts}"',doc:"rm -rf docs/* && typedoc --out docs && cp -r images docs/",prepare:"npm run format:fix && npm run lint:fix && npm run build && npm run test","test:dev":"vitest dev",test:"vitest run"},Ao="MapTiler",wo={"@rollup/plugin-commonjs":"^24.1.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.2","@types/uuid":"^9.0.2","@types/xmldom":"^0.1.31","@typescript-eslint/eslint-plugin":"^6.9.0","@typescript-eslint/parser":"^6.9.0",eslint:"^8.52.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1",prettier:"^3.0.3",rollup:"^3.20.6","rollup-plugin-copy-merge":"^1.0.0","rollup-plugin-dts":"^5.3.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-node-globals":"^1.4.0","rollup-plugin-shell":"^1.0.9","rollup-plugin-string":"^3.0.0","rollup-plugin-swc":"^0.2.1",serve:"^14.2.0",terser:"^5.17.1",typedoc:"^0.24.8",typescript:"^5.1.6",vitest:"^0.34.2",xmldom:"^0.6.0"},bo={"@maptiler/client":"^1.8.1",events:"^3.3.0","js-base64":"^3.7.4","maplibre-gl":"4.4.1",uuid:"^9.0.0"},So={name:no,version:io,description:so,module:uo,types:co,style:po,type:ho,exports:mo,keywords:go,homepage:vo,license:yo,repository:fo,scripts:Lo,author:Ao,devDependencies:wo,dependencies:bo};const S={VISITOR:"visitor",VISITOR_ENGLISH:"visitor_en",STYLE:"style",AUTO:"auto",STYLE_LOCK:"style_lock",LATIN:"name:latin",NON_LATIN:"name:nonlatin",LOCAL:"name",INTERNATIONAL:"name_int",ALBANIAN:"name:sq",AMHARIC:"name:am",ARABIC:"name:ar",ARMENIAN:"name:hy",AZERBAIJANI:"name:az",BASQUE:"name:eu",BELORUSSIAN:"name:be",BENGALI:"name:bn",BOSNIAN:"name:bs",BRETON:"name:br",BULGARIAN:"name:bg",CATALAN:"name:ca",CHINESE:"name:zh",TRADITIONAL_CHINESE:"name:zh-Hant",SIMPLIFIED_CHINESE:"name:zh-Hans",CORSICAN:"name:co",CROATIAN:"name:hr",CZECH:"name:cs",DANISH:"name:da",DUTCH:"name:nl",ENGLISH:"name:en",ESPERANTO:"name:eo",ESTONIAN:"name:et",FINNISH:"name:fi",FRENCH:"name:fr",FRISIAN:"name:fy",GEORGIAN:"name:ka",GERMAN:"name:de",GREEK:"name:el",HEBREW:"name:he",HINDI:"name:hi",HUNGARIAN:"name:hu",ICELANDIC:"name:is",INDONESIAN:"name:id",IRISH:"name:ga",ITALIAN:"name:it",JAPANESE:"name:ja",JAPANESE_HIRAGANA:"name:ja-Hira",JAPANESE_KANA:"name:ja_kana",JAPANESE_LATIN:"name:ja_rm",JAPANESE_2018:"name:ja-Latn",KANNADA:"name:kn",KAZAKH:"name:kk",KOREAN:"name:ko",KOREAN_LATIN:"name:ko-Latn",KURDISH:"name:ku",ROMAN_LATIN:"name:la",LATVIAN:"name:lv",LITHUANIAN:"name:lt",LUXEMBOURGISH:"name:lb",MACEDONIAN:"name:mk",MALAYALAM:"name:ml",MALTESE:"name:mt",NORWEGIAN:"name:no",OCCITAN:"name:oc",PERSIAN:"name:fa",POLISH:"name:pl",PORTUGUESE:"name:pt",PUNJABI:"name:pa",WESTERN_PUNJABI:"name:pnb",ROMANIAN:"name:ro",ROMANSH:"name:rm",RUSSIAN:"name:ru",SCOTTISH_GAELIC:"name:gd",SERBIAN_CYRILLIC:"name:sr",SERBIAN_LATIN:"name:sr-Latn",SLOVAK:"name:sk",SLOVENE:"name:sl",SPANISH:"name:es",SWEDISH:"name:sv",TAMIL:"name:ta",TELUGU:"name:te",THAI:"name:th",TURKISH:"name:tr",UKRAINIAN:"name:uk",URDU:"name:ur",VIETNAMIAN_LATIN:"name:vi",WELSH:"name:cy"},Co=new Set(Object.values(S));function Ie(t){return Co.has(t)}const To=new Set(Object.values(S));function Re(){if(typeof navigator>"u")return`name:${Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0]}`;const t=Array.from(new Set(navigator.languages.map(e=>`name:${e.split("-")[0]}`))).filter(e=>To.has(e));return t.length?t[0]:S.LOCAL}const V={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:S.STYLE,secondaryLanguage:S.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(V);var Io=Object.defineProperty,Ro=(t,e,o)=>e in t?Io(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,ce=(t,e,o)=>(Ro(t,typeof e!="symbol"?e+"":e,o),o);const Qe=lo();let et=class extends Qt{constructor(){super(),ce(this,"primaryLanguage",V.primaryLanguage),ce(this,"secondaryLanguage"),ce(this,"session",!0),ce(this,"caching",!0),ce(this,"_unit","metric"),ce(this,"_apiKey","")}set unit(e){this._unit=e,this.emit("unit",e)}get unit(){return this._unit}set apiKey(e){this._apiKey=e,Te.apiKey=e,this.emit("apiKey",e)}get apiKey(){return this._apiKey}set fetch(e){Te.fetch=e}get fetch(){return Te.fetch}};const j=new et;class tt extends h.LogoControl{onAdd(e){return super.onAdd(e)}}var Eo=Object.defineProperty,xo=(t,e,o)=>e in t?Eo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,ot=(t,e,o)=>(xo(t,typeof e!="symbol"?e+"":e,o),o);class Ee extends tt{constructor(e={}){var o,r;super(e),ot(this,"logoURL",""),ot(this,"linkURL",""),this.logoURL=(o=e.logoURL)!=null?o:V.maptilerLogoURL,this.linkURL=(r=e.linkURL)!=null?r:V.maptilerURL}onAdd(e){var o;this._map=e,this._compact=(o=this.options.compact)!=null?o:!1,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const r=window.document.createElement("a");return r.style.backgroundRepeat="no-repeat",r.style.cursor="pointer",r.style.display="block",r.style.height="23px",r.style.margin="0 0 -4px -4px",r.style.overflow="hidden",r.style.width="88px",r.style.backgroundImage=`url(${this.logoURL})`,r.style.backgroundSize="100px 30px",r.style.width="100px",r.style.height="30px",r.target="_blank",r.rel="noopener",r.href=this.linkURL,r.setAttribute("aria-label","MapTiler logo"),r.setAttribute("rel","noopener"),this._container.appendChild(r),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}var ge=(t,e,o)=>new Promise((r,a)=>{var l=n=>{try{s(o.next(n))}catch(u){a(u)}},i=n=>{try{s(o.throw(n))}catch(u){a(u)}},s=n=>n.done?r(n.value):Promise.resolve(n.value).then(l,i);s((o=o.apply(t,e)).next())});const xe="localcache_source",Pe="localcache",Po="maptiler_sdk",Oo=1e3,_o=100;function No(t,e){if(j.caching&&j.session&&t.host===V.maptilerApiHost){if(e=="Source"&&t.href.includes("tiles.json"))return t.href.replace("https://",`${xe}://`);if(e=="Tile"||e=="Glyphs")return t.href.replace("https://",`${Pe}://`)}return t.href}let Oe;function rt(){return ge(this,null,function*(){return Oe||(Oe=yield caches.open(Po)),Oe})}let at=0;function Mo(){return ge(this,null,function*(){const t=yield rt(),e=yield t.keys(),o=e.slice(0,Math.max(e.length-Oo,0));for(const r of o)t.delete(r)})}function $o(){Ye(xe,(t,e)=>ge(this,null,function*(){if(!t.url)throw new Error("");t.url=t.url.replace(`${xe}://`,"https://");const o=t;o.signal=e.signal;const r=yield fetch(t.url,o),a=yield r.json();return a.tiles&&a.tiles.length>0&&(a.tiles[0]+="&last-modified="+r.headers.get("Last-Modified")),{data:a,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires")}})),Ye(Pe,(t,e)=>ge(this,null,function*(){if(!t.url)throw new Error("");t.url=t.url.replace(`${Pe}://`,"https://");const o=new URL(t.url),r=new URL(o);r.searchParams.delete("mtsid"),r.searchParams.delete("key");const a=r.toString(),l=new URL(o);l.searchParams.delete("last-modified");const i=l.toString(),s=c=>ge(this,null,function*(){return{data:yield c.arrayBuffer(),cacheControl:c.headers.get("Cache-Control"),expires:c.headers.get("Expires")}}),n=yield rt(),u=yield n.match(a);if(u)return s(u);{const c=t;c.signal=e.signal;const p=yield fetch(i,c);return p.status>=200&&p.status<300&&(n.put(a,p.clone()).catch(()=>{}),++at>_o&&(Mo(),at=0)),s(p)}}))}var ko=Object.defineProperty,lt=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,nt=(t,e,o)=>e in t?ko(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,it=(t,e)=>{for(var o in e||(e={}))Fo.call(e,o)&&nt(t,o,e[o]);if(lt)for(var o of lt(e))zo.call(e,o)&&nt(t,o,e[o]);return t};function Bo(){h.getRTLTextPluginStatus()==="unavailable"&&h.setRTLTextPlugin(V.rtlPluginURL,t=>{t&&console.error(t)},!0)}function Uo(t,e){t.forEach(o=>{typeof e[o]=="function"&&(e[o]=e[o].bind(e))})}function oe(t,e,o){const r=window.document.createElement(t);return e!==void 0&&(r.className=e),o&&o.appendChild(r),r}function st(t){t.parentNode&&t.parentNode.removeChild(t)}function ut(t,e){let o=null;try{o=new URL(t)}catch{return{url:t}}return o.host===V.maptilerApiHost&&(o.searchParams.has("key")||o.searchParams.append("key",j.apiKey),j.session&&o.searchParams.append("mtsid",Qe)),{url:No(o,e)}}function ct(t){return function(e,o){var r;if(t!=null){const a=t(e,o),l=ut((r=a?.url)!=null?r:"",o);return it(it({},a),l)}else return ut(e,o)}}function pt(){return Math.random().toString(36).substring(2)}function ve(t){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(t)}function Ho(t){try{return JSON.parse(t)}catch{}return null}function ht(t){return t?typeof t=="string"||t instanceof String?!t.startsWith("http")&&t.toLowerCase().includes(".json")?t:eo(t):t instanceof to?t.getExpandedStyleURL():t instanceof oo?t.getDefaultVariant().getExpandedStyleURL():t:ro[ao[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL()}var jo=Object.defineProperty,Do=(t,e,o)=>e in t?jo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,_e=(t,e,o)=>(Do(t,typeof e!="symbol"?e+"":e,o),o);class mt{constructor(){_e(this,"_map"),_e(this,"_container"),_e(this,"_terrainButton"),Uo(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(e){return this._map=e,this._container=oe("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=oe("button","maplibregl-ctrl-terrain",this._container),oe("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){st(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.hasTerrain()?this._map.disableTerrain():this._map.enableTerrain(),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.hasTerrain()?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))}}class dt extends h.NavigationControl{onAdd(e){return super.onAdd(e)}}var Go=Object.defineProperty,Vo=(t,e,o)=>e in t?Go(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Wo=(t,e,o)=>(Vo(t,typeof e!="symbol"?e+"":e,o),o);class gt extends dt{constructor(){super({showCompass:!0,showZoom:!0,visualizePitch:!0}),Wo(this,"_rotateCompassArrow",()=>{const e=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5))}) rotateX(${Math.min(70,this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e}),this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",e=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})}_createButton(e,o){const r=super._createButton(e,o);return r.clickFunction=o,r}}class vt extends h.GeolocateControl{onAdd(e){return super.onAdd(e)}}var Zo=Object.defineProperty,Ko=Object.defineProperties,Yo=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertySymbols,qo=Object.prototype.hasOwnProperty,Jo=Object.prototype.propertyIsEnumerable,Ne=(t,e,o)=>e in t?Zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Xo=(t,e)=>{for(var o in e||(e={}))qo.call(e,o)&&Ne(t,o,e[o]);if(yt)for(var o of yt(e))Jo.call(e,o)&&Ne(t,o,e[o]);return t},Qo=(t,e)=>Ko(t,Yo(e)),ye=(t,e,o)=>(Ne(t,typeof e!="symbol"?e+"":e,o),o);const ft=h.Marker,Lt=h.LngLat,er=h.LngLatBounds;class At extends vt{constructor(){super(...arguments),ye(this,"lastUpdatedCenter",new Lt(0,0)),ye(this,"_updateCamera",e=>{var o,r,a;const l=new Lt(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,s=this._map.getBearing(),n=Qo(Xo({bearing:s},this.options.fitBoundsOptions),{linear:!0}),u=this._map.getZoom();u>((a=(r=(o=this.options)==null?void 0:o.fitBoundsOptions)==null?void 0:r.maxZoom)!=null?a:30)&&(n.zoom=u),this._map.fitBounds(er.fromLngLat(l,i),n,{geolocateSource:!0});let c=!1;const p=()=>{c=!0};this._map.once("click",p),this._map.once("dblclick",p),this._map.once("dragstart",p),this._map.once("mousedown",p),this._map.once("touchstart",p),this._map.once("wheel",p),this._map.once("moveend",()=>{this._map.off("click",p),this._map.off("dblclick",p),this._map.off("dragstart",p),this._map.off("mousedown",p),this._map.off("touchstart",p),this._map.off("wheel",p),!c&&(this.lastUpdatedCenter=this._map.getCenter())})}),ye(this,"_setupUI",e=>{if(this.lastUpdatedCenter=this._map.getCenter(),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=oe("button","maplibregl-ctrl-geolocate",this._container),oe("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",e===!1){const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=oe("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ft({element:this._dotElement}),this._circleElement=oe("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ft({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",o=>{const r=o.originalEvent&&o.originalEvent.type==="resize",a=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!o.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!r&&a>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}),ye(this,"_onZoom",()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()})}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const e=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],o=this._map.project(e),r=this._map.unproject([o.x,o.y]),a=this._map.unproject([o.x+20,o.y]),l=r.distanceTo(a)/20,i=Math.ceil(2*this._accuracy/l);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}}class wt extends h.ScaleControl{onAdd(e){return super.onAdd(e)}}class bt extends h.FullscreenControl{onAdd(e){return super.onAdd(e)}}var tr=Object.defineProperty,or=Object.defineProperties,rr=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,ar=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable,Me=(t,e,o)=>e in t?tr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,pe=(t,e)=>{for(var o in e||(e={}))ar.call(e,o)&&Me(t,o,e[o]);if(St)for(var o of St(e))lr.call(e,o)&&Me(t,o,e[o]);return t},Ct=(t,e)=>or(t,rr(e)),nr=(t,e,o)=>(Me(t,typeof e!="symbol"?e+"":e,o),o),$e=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)},L=(t,e,o)=>($e(t,e,"read from private field"),o?o.call(t):e.get(t)),X=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},he=(t,e,o,r)=>($e(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o),W=(t,e,o)=>($e(t,e,"access private method"),o),Z,Q,ae,Tt,le,Y,fe,ke,It,K,q,Fe,Rt;let ze=class{constructor(e,o){X(this,ke),X(this,K),X(this,Fe),X(this,Z,void 0),nr(this,"map"),X(this,Q,void 0),X(this,ae,void 0),X(this,Tt,void 0),X(this,le,void 0),X(this,Y,!1),X(this,fe,void 0);var r;e.style!==void 0&&he(this,Y,!0),he(this,Z,Ct(pe(Ct(pe({zoomAdjust:-4,position:"top-right"},o),{forceNoAttributionControl:!0,attributionControl:!1,navigationControl:!1,geolocateControl:!1,maptilerLogo:!1,minimap:!1,hash:!1,pitchAdjust:!1}),e),{containerStyle:pe({border:"1px solid #000",width:"400px",height:"300px"},(r=e.containerStyle)!=null?r:{})})),e.lockZoom!==void 0&&(L(this,Z).minZoom=e.lockZoom,L(this,Z).maxZoom=e.lockZoom)}setStyle(e,o){L(this,Y)||this.map.setStyle(e,o),W(this,K,q).call(this)}addLayer(e,o){return L(this,Y)||this.map.addLayer(e,o),W(this,K,q).call(this),this.map}moveLayer(e,o){return L(this,Y)||this.map.moveLayer(e,o),W(this,K,q).call(this),this.map}removeLayer(e){return L(this,Y)||this.map.removeLayer(e),W(this,K,q).call(this),this}setLayerZoomRange(e,o,r){return L(this,Y)||this.map.setLayerZoomRange(e,o,r),W(this,K,q).call(this),this}setFilter(e,o,r){return L(this,Y)||this.map.setFilter(e,o,r),W(this,K,q).call(this),this}setPaintProperty(e,o,r,a){return L(this,Y)||this.map.setPaintProperty(e,o,r,a),W(this,K,q).call(this),this}setLayoutProperty(e,o,r,a){return L(this,Y)||this.map.setLayoutProperty(e,o,r,a),W(this,K,q).call(this),this}setGlyphs(e,o){return L(this,Y)||this.map.setGlyphs(e,o),W(this,K,q).call(this),this}onAdd(e){he(this,Q,e),he(this,ae,oe("div","maplibregl-ctrl maplibregl-ctrl-group"));for(const[o,r]of Object.entries(L(this,Z).containerStyle))L(this,ae).style.setProperty(o,r);return L(this,Z).container=L(this,ae),L(this,Z).zoom=e.getZoom()+L(this,Z).zoomAdjust,this.map=new Pt(L(this,Z)),this.map.once("style.load",()=>{this.map.resize()}),this.map.once("load",()=>{W(this,ke,It).call(this,L(this,Z).parentRect),he(this,fe,W(this,Fe,Rt).call(this))}),L(this,ae)}onRemove(){var e;(e=L(this,fe))==null||e.call(this),st(L(this,ae))}};Z=new WeakMap,Q=new WeakMap,ae=new WeakMap,Tt=new WeakMap,le=new WeakMap,Y=new WeakMap,fe=new WeakMap,ke=new WeakSet,It=function(t){t===void 0||t.linePaint===void 0&&t.fillPaint===void 0||(he(this,le,{type:"Feature",properties:{name:"parentRect"},geometry:{type:"Polygon",coordinates:[[[],[],[],[],[]]]}}),this.map.addSource("parentRect",{type:"geojson",data:L(this,le)}),(t.lineLayout!==void 0||t.linePaint!==void 0)&&this.map.addLayer({id:"parentRectOutline",type:"line",source:"parentRect",layout:pe({},t.lineLayout),paint:pe({"line-color":"#FFF","line-width":1,"line-opacity":.85},t.linePaint)}),t.fillPaint!==void 0&&this.map.addLayer({id:"parentRectFill",type:"fill",source:"parentRect",layout:{},paint:pe({"fill-color":"#08F","fill-opacity":.135},t.fillPaint)}),W(this,K,q).call(this))},K=new WeakSet,q=function(){if(L(this,le)===void 0)return;const{devicePixelRatio:t}=window,e=L(this,Q).getCanvas(),o=e.width/t,r=e.height/t,a=L(this,Q).unproject.bind(L(this,Q)),l=a([0,0]),i=a([o,0]),s=a([0,r]),n=a([o,r]);L(this,le).geometry.coordinates=[[s.toArray(),n.toArray(),i.toArray(),l.toArray(),s.toArray()]],this.map.getSource("parentRect").setData(L(this,le))},Fe=new WeakSet,Rt=function(){const{pitchAdjust:t}=L(this,Z),e=()=>{l("parent")},o=()=>{l("minimap")},r=()=>{L(this,Q).on("move",e),this.map.on("move",o)},a=()=>{L(this,Q).off("move",e),this.map.off("move",o)},l=i=>{var s;a();const n=i==="parent"?L(this,Q):this.map,u=i==="parent"?this.map:L(this,Q),c=n.getCenter(),p=n.getZoom()+((s=L(this,Z).zoomAdjust)!=null?s:-4)*(i==="parent"?1:-1),v=n.getBearing(),m=n.getPitch();u.jumpTo({center:c,zoom:p,bearing:v,pitch:t?m:0}),W(this,K,q).call(this),r()};return r(),()=>{a()}};var ir=Object.defineProperty,sr=Object.defineProperties,ur=Object.getOwnPropertyDescriptors,Et=Object.getOwnPropertySymbols,cr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,Be=(t,e,o)=>e in t?ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Ue=(t,e)=>{for(var o in e||(e={}))cr.call(e,o)&&Be(t,o,e[o]);if(Et)for(var o of Et(e))pr.call(e,o)&&Be(t,o,e[o]);return t},hr=(t,e)=>sr(t,ur(e)),ee=(t,e,o)=>(Be(t,typeof e!="symbol"?e+"":e,o),o),te=(t,e,o)=>new Promise((r,a)=>{var l=n=>{try{s(o.next(n))}catch(u){a(u)}},i=n=>{try{s(o.throw(n))}catch(u){a(u)}},s=n=>n.done?r(n.value):Promise.resolve(n.value).then(l,i);s((o=o.apply(t,e)).next())});const xt={POINT:"POINT",COUNTRY:"COUNTRY"};class Pt extends h.Map{constructor(e){var o,r,a;e.apiKey&&(j.apiKey=e.apiKey);const l=ht(e.style),i=location.hash;j.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");let s={compact:!1};e.customAttribution?s.customAttribution=e.customAttribution:e.attributionControl&&typeof e.attributionControl=="object"&&(s=Ue(Ue({},s),e.attributionControl)),super(hr(Ue({},e),{style:l,maplibreLogo:!1,transformRequest:ct(e.transformRequest),attributionControl:e.forceNoAttributionControl===!0?!1:s})),ee(this,"isTerrainEnabled",!1),ee(this,"terrainExaggeration",1),ee(this,"primaryLanguage"),ee(this,"terrainGrowing",!1),ee(this,"terrainFlattening",!1),ee(this,"minimap"),ee(this,"forceLanguageUpdate"),ee(this,"languageAlwaysBeenStyle"),ee(this,"isReady",!1),j.caching&&$o(),this.primaryLanguage=(o=e.language)!=null?o:j.primaryLanguage,this.forceLanguageUpdate=!(this.primaryLanguage===S.STYLE||this.primaryLanguage===S.STYLE_LOCK),this.languageAlwaysBeenStyle=this.primaryLanguage===S.STYLE,this.terrainExaggeration=(r=e.terrainExaggeration)!=null?r:this.terrainExaggeration,this.once("styledata",()=>te(this,null,function*(){if(!e.geolocate||e.center||e.hash&&i)return;try{if(e.geolocate===xt.COUNTRY){yield this.fitToIpBounds();return}}catch(m){console.warn(m.message)}let v;try{yield this.centerOnIpPoint(e.zoom),v=this.getCameraHash()}catch(m){console.warn(m.message)}(yield navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(m=>{v===this.getCameraHash()&&(this.terrain?this.easeTo({center:[m.coords.longitude,m.coords.latitude],zoom:e.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[m.coords.longitude,m.coords.latitude],zoom:e.zoom||12,duration:2e3})}))},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})})),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",()=>te(this,null,function*(){Bo()})),this.once("load",()=>te(this,null,function*(){let v={logo:null};try{const m=Object.keys(this.style.sourceCaches).map(g=>this.getSource(g)).filter(g=>g&&"url"in g&&typeof g.url=="string"&&g?.url.includes("tiles.json")),T=new URL(m[0].url);T.searchParams.has("key")||T.searchParams.append("key",j.apiKey),v=yield(yield fetch(T.href)).json()}catch{}if(e.forceNoAttributionControl!==!0)if("logo"in v&&v.logo){const m=v.logo;this.addControl(new Ee({logoURL:m}),e.logoPosition)}else e.maptilerLogo&&this.addControl(new Ee,e.logoPosition);if(e.scaleControl){const m=e.scaleControl===!0||e.scaleControl===void 0?"bottom-right":e.scaleControl,T=new wt({unit:j.unit});this.addControl(T,m),j.on("unit",g=>{T.setUnit(g)})}if(e.navigationControl!==!1){const m=e.navigationControl===!0||e.navigationControl===void 0?"top-right":e.navigationControl;this.addControl(new gt,m)}if(e.geolocateControl!==!1){const m=e.geolocateControl===!0||e.geolocateControl===void 0?"top-right":e.geolocateControl;this.addControl(new At({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),m)}if(e.terrainControl){const m=e.terrainControl===!0||e.terrainControl===void 0?"top-right":e.terrainControl;this.addControl(new mt,m)}if(e.fullscreenControl){const m=e.fullscreenControl===!0||e.fullscreenControl===void 0?"top-right":e.fullscreenControl;this.addControl(new bt({}),m)}this.isReady=!0,this.fire("ready",{target:this})}));let n=!1,u=!1,c;this.once("ready",()=>{n=!0,u&&this.fire("loadWithTerrain",c)}),this.once("style.load",()=>{var v;const{minimap:m}=e;if(typeof m=="object"){const{zoom:T,center:g,style:k,language:M,apiKey:R,maptilerLogo:z,antialias:F,refreshExpiredTiles:_,maxBounds:E,scrollZoom:I,minZoom:A,maxZoom:C,boxZoom:w,locale:B,fadeDuration:f,crossSourceCollisions:b,clickTolerance:O,bounds:N,fitBoundsOptions:$,pixelRatio:D,validateStyle:H}=e;this.minimap=new ze(m,{zoom:T,center:g,style:k,language:M,apiKey:R,container:"null",maptilerLogo:z,antialias:F,refreshExpiredTiles:_,maxBounds:E,scrollZoom:I,minZoom:A,maxZoom:C,boxZoom:w,locale:B,fadeDuration:f,crossSourceCollisions:b,clickTolerance:O,bounds:N,fitBoundsOptions:$,pixelRatio:D,validateStyle:H}),this.addControl(this.minimap,(v=m.position)!=null?v:"bottom-left")}else m===!0?(this.minimap=new ze({},e),this.addControl(this.minimap,"bottom-left")):m!==void 0&&m!==!1&&(this.minimap=new ze({},e),this.addControl(this.minimap,m))});const p=v=>{v.terrain&&(u=!0,c={type:"loadWithTerrain",target:this,terrain:v.terrain},this.off("terrain",p),n&&this.fire("loadWithTerrain",c))};this.on("terrain",p),e.terrain&&this.enableTerrain((a=e.terrainExaggeration)!=null?a:this.terrainExaggeration)}onLoadAsync(){return te(this,null,function*(){return new Promise(e=>{if(this.loaded())return e(this);this.once("load",()=>{e(this)})})})}onReadyAsync(){return te(this,null,function*(){return new Promise(e=>{if(this.isReady)return e(this);this.once("ready",()=>{e(this)})})})}onLoadWithTerrainAsync(){return te(this,null,function*(){return new Promise(e=>{if(this.isReady&&this.terrain)return e(this);this.once("loadWithTerrain",()=>{e(this)})})})}setStyle(e,o){var r;return(r=this.minimap)==null||r.setStyle(e),this.forceLanguageUpdate=!0,this.once("idle",()=>{this.forceLanguageUpdate=!1}),super.setStyle(ht(e),o)}addLayer(e,o){var r;return(r=this.minimap)==null||r.addLayer(e,o),super.addLayer(e,o)}moveLayer(e,o){var r;return(r=this.minimap)==null||r.moveLayer(e,o),super.moveLayer(e,o)}removeLayer(e){var o;return(o=this.minimap)==null||o.removeLayer(e),super.removeLayer(e)}setLayerZoomRange(e,o,r){var a;return(a=this.minimap)==null||a.setLayerZoomRange(e,o,r),super.setLayerZoomRange(e,o,r)}setFilter(e,o,r){var a;return(a=this.minimap)==null||a.setFilter(e,o,r),super.setFilter(e,o,r)}setPaintProperty(e,o,r,a){var l;return(l=this.minimap)==null||l.setPaintProperty(e,o,r,a),super.setPaintProperty(e,o,r,a)}setLayoutProperty(e,o,r,a){var l;return(l=this.minimap)==null||l.setLayoutProperty(e,o,r,a),super.setLayoutProperty(e,o,r,a)}setGlyphs(e,o){var r;return(r=this.minimap)==null||r.setGlyphs(e,o),super.setGlyphs(e,o)}getStyleLanguage(){return!this.style.stylesheet.metadata||typeof this.style.stylesheet.metadata!="object"?null:"maptiler:language"in this.style.stylesheet.metadata&&typeof this.style.stylesheet.metadata["maptiler:language"]=="string"?this.style.stylesheet.metadata["maptiler:language"]:null}setLanguage(e){var o,r;(r=(o=this.minimap)==null?void 0:o.map)==null||r.setLanguage(e),this.onStyleReady(()=>{this.setPrimaryLanguage(e)})}setPrimaryLanguage(e){const o=this.getStyleLanguage();if(!(e===S.STYLE&&(o===S.AUTO||o===S.VISITOR))&&(e!==S.STYLE&&(this.languageAlwaysBeenStyle=!1),this.languageAlwaysBeenStyle||this.primaryLanguage===e&&!this.forceLanguageUpdate))return;if(!Ie(e)){console.warn(`The language "${e}" is not supported.`);return}if(this.primaryLanguage===S.STYLE_LOCK){console.warn("The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag.");return}this.primaryLanguage=e;let r=e;if(e===S.STYLE){if(!o){console.warn("The style has no default languages.");return}if(!Ie(o)){console.warn("The language defined in the style is not valid.");return}r=o}let a=S.LOCAL,l=`{${a}}`;r==S.VISITOR?(a=Re(),l=["case",["all",["has",a],["has",S.LOCAL]],["case",["==",["get",a],["get",S.LOCAL]],["get",S.LOCAL],["format",["get",a],{"font-scale":.8},`
2
- `,["get",S.LOCAL],{"font-scale":1.1}]],["get",S.LOCAL]]):r==S.VISITOR_ENGLISH?(a=S.ENGLISH,l=["case",["all",["has",a],["has",S.LOCAL]],["case",["==",["get",a],["get",S.LOCAL]],["get",S.LOCAL],["format",["get",a],{"font-scale":.8},`
3
- `,["get",S.LOCAL],{"font-scale":1.1}]],["get",S.LOCAL]]):r===S.AUTO?(a=Re(),l=["case",["has",a],["get",a],["get",S.LOCAL]]):r===S.LOCAL?(a=S.LOCAL,l=`{${a}}`):(a=r,l=["case",["has",a],["get",a],["get",S.LOCAL]]);const{layers:i}=this.getStyle();for(const s of i){if(s.type!=="symbol")continue;const n=s,u=this.getSource(n.source);if(!u||!("url"in u&&typeof u.url=="string")||new URL(u.url).host!==V.maptilerApiHost)continue;const{id:c,layout:p}=n;if(!p||!("text-field"in p))continue;const v=this.getLayoutProperty(c,"text-field");typeof v=="string"&&(v.toLowerCase().includes("ref")||v.toLowerCase().includes("housenumber"))||this.setLayoutProperty(c,"text-field",l)}}getPrimaryLanguage(){return this.primaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(e,o=1e3){if(!this.terrain)return;const r=performance.now(),a=this.terrain.exaggeration,l=e-a,i=()=>{if(!this.terrain||this.terrainFlattening)return;const s=(performance.now()-r)/o;if(s<.99){const n=1-Math.pow(1-s,4),u=a+n*l;this.terrain.exaggeration=u,requestAnimationFrame(i)}else this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=e;this.triggerRepaint()};this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame(i)}enableTerrain(e=this.terrainExaggeration){if(e<0){console.warn("Terrain exaggeration cannot be negative.");return}const o=a=>te(this,null,function*(){!this.terrain||a.type!=="data"||a.dataType!=="source"||!("source"in a)||a.sourceId!=="maptiler-terrain"||a.source.type!=="raster-dem"||a.isSourceLoaded&&(this.off("data",o),this.growTerrain(e))}),r=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=e,this.on("data",o),this.addSource(V.terrainSourceId,{type:"raster-dem",url:V.terrainSourceURL}),this.setTerrain({source:V.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(e);return}this.loaded()||this.isTerrainEnabled?r():this.once("load",()=>{this.getTerrain()&&this.getSource(V.terrainSourceId)||r()})}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;const e=1*1e3,o=performance.now(),r=this.terrain.exaggeration,a=()=>{if(!this.terrain||this.terrainGrowing)return;const l=(performance.now()-o)/e;if(l<.99){const i=Math.pow(1-l,4),s=r*i;this.terrain.exaggeration=s,requestAnimationFrame(a)}else this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(),this.getSource(V.terrainSourceId)&&this.removeSource(V.terrainSourceId);this.triggerRepaint()};this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(a)}setTerrainExaggeration(e,o=!0){!o&&this.terrain?(this.terrainExaggeration=e,this.terrain.exaggeration=e,this.triggerRepaint()):this.enableTerrain(e)}onStyleReady(e){this.isStyleLoaded()?e():this.once("styledata",()=>{e()})}fitToIpBounds(){return te(this,null,function*(){const e=yield Xe.info();this.fitBounds(e.country_bounds,{duration:0,padding:100})})}centerOnIpPoint(e){return te(this,null,function*(){var o,r;const a=yield Xe.info();this.jumpTo({center:[(o=a?.longitude)!=null?o:0,(r=a?.latitude)!=null?r:0],zoom:e||11})})}getCameraHash(){const e=new Float32Array(5),o=this.getCenter();return e[0]=o.lng,e[1]=o.lat,e[2]=this.getZoom(),e[3]=this.getPitch(),e[4]=this.getBearing(),Xt.fromUint8Array(new Uint8Array(e.buffer))}getSdkConfig(){return j}getMaptilerSessionId(){return Qe}setTransformRequest(e){return super.setTransformRequest(ct(e)),this}}class mr extends h.Marker{addTo(e){return super.addTo(e)}}class dr extends h.Popup{addTo(e){return super.addTo(e)}}class gr extends h.Style{constructor(e,o={}){super(e,o)}}class vr extends h.CanvasSource{onAdd(e){super.onAdd(e)}}class yr extends h.GeoJSONSource{onAdd(e){super.onAdd(e)}}class fr extends h.ImageSource{onAdd(e){super.onAdd(e)}}class Lr extends h.RasterTileSource{onAdd(e){super.onAdd(e)}}class Ar extends h.RasterDEMTileSource{onAdd(e){super.onAdd(e)}}class wr extends h.VectorTileSource{onAdd(e){super.onAdd(e)}}class br extends h.VideoSource{onAdd(e){super.onAdd(e)}}class Sr extends h.AttributionControl{onAdd(e){return super.onAdd(e)}}class Cr extends h.TerrainControl{onAdd(e){return super.onAdd(e)}}class Tr extends h.BoxZoomHandler{constructor(e,o){super(e,o)}}class Ir extends h.ScrollZoomHandler{constructor(e,o){super(e,o)}}class Rr extends h.CooperativeGesturesHandler{constructor(e,o){super(e,o)}}class Er extends h.KeyboardHandler{constructor(e){super(e)}}class xr extends h.TwoFingersTouchPitchHandler{constructor(e){super(e)}}class Pr extends h.MapWheelEvent{constructor(e,o,r){super(e,o,r)}}class Or extends h.MapTouchEvent{constructor(e,o,r){super(e,o,r)}}class _r extends h.MapMouseEvent{constructor(e,o,r,a={}){super(e,o,r,a)}}var Nr=Object.defineProperty,Ot=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,_t=(t,e,o)=>e in t?Nr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,ne=(t,e)=>{for(var o in e||(e={}))Mr.call(e,o)&&_t(t,o,e[o]);if(Ot)for(var o of Ot(e))$r.call(e,o)&&_t(t,o,e[o]);return t};function Le(t){if(typeof DOMParser<"u"){const e=new DOMParser().parseFromString(t,"application/xml");if(e.querySelector("parsererror"))throw new Error("The provided string is not valid XML");return e}else throw new Error("No XML parser found")}function He(t,e){if(!t.hasChildNodes())return!1;for(const o of Array.from(t.childNodes)){const r=o.nodeName;if(typeof r=="string"&&r.trim().toLowerCase()===e.toLowerCase())return!0}return!1}function je(t){if(typeof XMLSerializer<"u")return new XMLSerializer().serializeToString(t);throw new Error("No XML serializer found")}function De(t){if(typeof t=="string"&&(t=Le(t)),!He(t,"gpx"))throw new Error("The XML document is not valid GPX");const e=U(t,"trk"),o=U(t,"rte"),r=U(t,"wpt"),a={type:"FeatureCollection",features:[]};for(const l of Array.from(e)){const i=Br(l);i&&a.features.push(i)}for(const l of Array.from(o)){const i=Ur(l);i&&a.features.push(i)}for(const l of Array.from(r))a.features.push(Hr(l));return a}function Ge(t,e){var o;if(typeof t=="string"&&(t=Le(t)),!He(t,"kml"))throw new Error("The XML document is not valid KML");const r={type:"FeatureCollection",features:[]},a={},l={},i={},s=U(t,"Placemark"),n=U(t,"Style"),u=U(t,"StyleMap");for(const c of Array.from(n)){const p=kt(e!==void 0?e(c):je(c)).toString(16);a["#"+ie(c,"id")]=p,l[p]=c}for(const c of Array.from(u)){a["#"+ie(c,"id")]=kt(e!==void 0?e(c):je(c)).toString(16);const p=U(c,"Pair"),v={};for(const m of Array.from(p))v[(o=x(y(m,"key")))!=null?o:""]=x(y(m,"styleUrl"));i["#"+ie(c,"id")]=v}for(const c of Array.from(s))r.features=r.features.concat(zr(c,a,l,i));return r}function Nt(t){if(t===null)return["#000000",1];let e="",o=1;return t.substring(0,1)==="#"&&(t=t.substring(1)),(t.length===6||t.length===3)&&(e=t),t.length===8&&(o=parseInt(t.substring(0,2),16)/255,e="#"+t.substring(6,8)+t.substring(4,6)+t.substring(2,4)),[e??"#000000",o??1]}function kr(t){return zt(t.split(" "))}function Fr(t){var e;let o=U(t,"coord");const r=[],a=[];o.length===0&&(o=U(t,"gx:coord"));for(const i of Array.from(o))r.push(kr((e=x(i))!=null?e:""));const l=U(t,"when");for(const i of Array.from(l))a.push(x(i));return{coords:r,times:a}}function Ae(t){var e,o,r;const a=["Polygon","LineString","Point","Track","gx:Track"];let l,i,s,n,u;const c=[],p=[];if(y(t,"MultiGeometry")!==null)return Ae(y(t,"MultiGeometry"));if(y(t,"MultiTrack")!==null)return Ae(y(t,"MultiTrack"));if(y(t,"gx:MultiTrack")!==null)return Ae(y(t,"gx:MultiTrack"));for(s=0;s<a.length;s++)if(i=U(t,a[s]),i){for(n=0;n<i.length;n++)if(l=i[n],a[s]==="Point")c.push({type:"Point",coordinates:Bt((e=x(y(l,"coordinates")))!=null?e:"")});else if(a[s]==="LineString")c.push({type:"LineString",coordinates:Ut((o=x(y(l,"coordinates")))!=null?o:"")});else if(a[s]==="Polygon"){const v=U(l,"LinearRing"),m=[];for(u=0;u<v.length;u++)m.push(Ut((r=x(y(v[u],"coordinates")))!=null?r:""));c.push({type:"Polygon",coordinates:m})}else if(a[s]==="Track"||a[s]==="gx:Track"){const v=Fr(l);c.push({type:"LineString",coordinates:v.coords}),v.times.length&&p.push(v.times)}}return{geoms:c,coordTimes:p}}function zr(t,e,o,r){var a,l,i,s,n,u,c,p,v,m;const T=Ae(t),g={},k=x(y(t,"name")),M=x(y(t,"address")),R=x(y(t,"description")),z=y(t,"TimeSpan"),F=y(t,"TimeStamp"),_=y(t,"ExtendedData"),E=y(t,"visibility");let I,A=x(y(t,"styleUrl")),C=y(t,"LineStyle"),w=y(t,"PolyStyle");if(!T.geoms.length)return[];if(k&&(g.name=k),M&&(g.address=M),A){A[0]!=="#"&&(A="#"+A),g.styleUrl=A,e[A]&&(g.styleHash=e[A]),r[A]&&(g.styleMapHash=r[A],g.styleHash=e[(a=r[A].normal)!=null?a:""]);const f=o[(l=g.styleHash)!=null?l:""];if(f){C||(C=y(f,"LineStyle")),w||(w=y(f,"PolyStyle"));const b=y(f,"IconStyle");if(b){const O=y(b,"Icon");if(O){const N=x(y(O,"href"));N&&(g.icon=N)}}}}if(R&&(g.description=R),z){const f=x(y(z,"begin")),b=x(y(z,"end"));f&&b&&(g.timespan={begin:f,end:b})}if(F!==null&&(g.timestamp=(i=x(y(F,"when")))!=null?i:new Date().toISOString()),C!==null){const f=Nt(x(y(C,"color"))),b=f[0],O=f[1],N=parseFloat((s=x(y(C,"width")))!=null?s:"");b&&(g.stroke=b),isNaN(O)||(g["stroke-opacity"]=O),isNaN(N)||(g["stroke-width"]=N)}if(w){const f=Nt(x(y(w,"color"))),b=f[0],O=f[1],N=x(y(w,"fill")),$=x(y(w,"outline"));b&&(g.fill=b),isNaN(O)||(g["fill-opacity"]=O),N&&(g["fill-opacity"]=N==="1"?g["fill-opacity"]||1:0),$&&(g["stroke-opacity"]=$==="1"?g["stroke-opacity"]||1:0)}if(_){const f=U(_,"Data"),b=U(_,"SimpleData");for(I=0;I<f.length;I++)g[(n=f[I].getAttribute("name"))!=null?n:""]=(u=x(y(f[I],"value")))!=null?u:"";for(I=0;I<b.length;I++)g[(c=b[I].getAttribute("name"))!=null?c:""]=(p=x(b[I]))!=null?p:""}E!==null&&(g.visibility=(v=x(E))!=null?v:""),T.coordTimes.length!==0&&(g.coordTimes=T.coordTimes.length===1?T.coordTimes[0]:T.coordTimes);const B={type:"Feature",geometry:T.geoms.length===1?T.geoms[0]:{type:"GeometryCollection",geometries:T.geoms},properties:g};return ie(t,"id")&&(B.id=(m=ie(t,"id"))!=null?m:void 0),[B]}function Mt(t,e){const o=U(t,e),r=[],a=[];let l=[];const i=o.length;if(!(i<2)){for(let s=0;s<i;s++){const n=Ht(o[s]);r.push(n.coordinates),n.time&&a.push(n.time),(n.heartRate||l.length)&&(l.length===0&&(l=new Array(s).fill(null)),l.push(n.heartRate))}return{line:r,times:a,heartRates:l}}}function Br(t){const e=U(t,"trkseg"),o=[],r=[],a=[];let l;for(let s=0;s<e.length;s++)if(l=Mt(e[s],"trkpt"),l!==void 0&&(l.line&&o.push(l.line),l.times&&l.times.length&&r.push(l.times),a.length||l.heartRates&&l.heartRates.length)){if(!a.length)for(let n=0;n<s;n++)a.push(new Array(o[n].length).fill(null));l.heartRates&&l.heartRates.length?a.push(l.heartRates):a.push(new Array(l.line.length).fill(null))}if(o.length===0)return;const i=ne(ne({},Ve(t)),$t(y(t,"extensions")));return r.length!==0&&(i.coordTimes=o.length===1?r[0]:r),a.length!==0&&(i.heartRates=o.length===1?a[0]:a),o.length===1?{type:"Feature",properties:i,geometry:{type:"LineString",coordinates:o[0]}}:{type:"Feature",properties:i,geometry:{type:"MultiLineString",coordinates:o}}}function Ur(t){const e=Mt(t,"rtept");return e===void 0?void 0:{type:"Feature",properties:ne(ne({},Ve(t)),$t(y(t,"extensions"))),geometry:{type:"LineString",coordinates:e.line}}}function Hr(t){return{type:"Feature",properties:ne(ne({},Ve(t)),We(t,["sym"])),geometry:{type:"Point",coordinates:Ht(t).coordinates}}}function $t(t){var e,o;const r={};if(t){const a=y(t,"line");if(a){const l=x(y(a,"color")),i=parseFloat((e=x(y(a,"opacity")))!=null?e:"0"),s=parseFloat((o=x(y(a,"width")))!=null?o:"0");l&&(r.stroke=l),isNaN(i)||(r["stroke-opacity"]=i),isNaN(s)||(r["stroke-width"]=s*96/25.4)}}return r}function Ve(t){const e=We(t,["name","cmt","desc","type","time","keywords"]),o=U(t,"link");if(o.length!==0){e.links=[];for(const r of Array.from(o)){const a=ne({href:ie(r,"href")},We(r,["text","type"]));e.links.push(a)}}return e}function kt(t){let e=0;if(!t||!t.length)return e;for(let o=0;o<t.length;o++)e=(e<<5)-e+t.charCodeAt(o)|0;return e}function U(t,e){return t.getElementsByTagName(e)}function ie(t,e){return t.getAttribute(e)}function Ft(t,e){var o;return parseFloat((o=ie(t,e))!=null?o:"0")}function y(t,e){const o=U(t,e);return o.length?o[0]:null}function jr(t){return t.normalize&&t.normalize(),t}function zt(t){return t.map(parseFloat).map(e=>isNaN(e)?null:e)}function x(t){return t&&jr(t),t&&t.textContent}function We(t,e){var o;const r={};let a,l;for(l=0;l<e.length;l++)a=y(t,e[l]),a&&(r[e[l]]=(o=x(a))!=null?o:"");return r}function Bt(t){return zt(t.replace(/\s*/g,"").split(","))}function Ut(t){const e=t.replace(/^\s*|\s*$/g,"").split(/\s+/),o=[];for(const r of e)o.push(Bt(r));return o}function Ht(t){var e,o;const r=[Ft(t,"lon"),Ft(t,"lat")],a=y(t,"ele"),l=y(t,"gpxtpx:hr")||y(t,"hr"),i=y(t,"time");let s;return a&&(s=parseFloat((e=x(a))!=null?e:"0"),isNaN(s)||r.push(s)),{coordinates:r,time:i?x(i):null,heartRate:l!==null?parseFloat((o=x(l))!=null?o:"0"):null}}function jt(t){try{typeof t=="string"&&(t=Le(t))}catch{return null}try{return De(t)}catch{}try{return Ge(t)}catch{}return null}var Dr=Object.defineProperty,Gr=(t,e,o)=>e in t?Dr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Dt=(t,e,o)=>(Gr(t,typeof e!="symbol"?e+"":e,o),o);function we(t){const e=t.toString(16);return e.length==1?"0"+e:e}function Vr(t){return"#"+we(t[0])+we(t[1])+we(t[2])+(t.length===4?we(t[3]):"")}class d extends Array{constructor(e={}){super(),Dt(this,"min",0),Dt(this,"max",1),"min"in e&&(this.min=e.min),"max"in e&&(this.max=e.max),"stops"in e&&this.setStops(e.stops,{clone:!1})}static fromArrayDefinition(e){return new d({stops:e.map(o=>({value:o[0],color:o[1]}))})}setStops(e,o={clone:!0}){const r=o.clone?this.clone():this;r.length=0;let a=1/0,l=-1/0;for(let i=0;i<e.length;i+=1)a=Math.min(a,e[i].value),l=Math.max(l,e[i].value),r.push({value:e[i].value,color:e[i].color.slice()});return r.sort((i,s)=>i.value<s.value?-1:1),this.min=a,this.max=l,r}scale(e,o,r={clone:!0}){const a=r.clone,l=this[0].value,i=this.at(-1).value-l,s=o-e,n=[];for(let u=0;u<this.length;u+=1){const c=(this[u].value-l)/i*s+e;a?n.push({value:c,color:this[u].color.slice()}):this[u].value=c}return a?new d({stops:n}):this}at(e){return e<0?this[this.length+e]:this[e]}clone(){return new d({stops:this.getRawColorStops()})}getRawColorStops(){const e=[];for(let o=0;o<this.length;o+=1)e.push({value:this[o].value,color:this[o].color});return e}reverse(e={clone:!0}){const o=e.clone?this.clone():this;for(let r=0;r<~~(o.length/2);r+=1){const a=o[r].color;o[r].color=o.at(-(r+1)).color,o.at(-(r+1)).color=a}return o}getBounds(){return{min:this.min,max:this.max}}getColor(e,o={smooth:!0}){if(e<=this[0].value)return this[0].color;if(e>=this.at(-1).value)return this.at(-1).color;for(let r=0;r<this.length-1;r+=1){if(e>this[r+1].value)continue;const a=this[r].color;if(!o.smooth)return a.slice();const l=this[r].value,i=this[r+1].value,s=this[r+1].color,n=(i-e)/(i-l);return a.map((u,c)=>Math.round(u*n+s[c]*(1-n)))}return[0,0,0]}getColorHex(e,o={smooth:!0,withAlpha:!1}){return Vr(this.getColor(e,o))}getColorRelative(e,o={smooth:!0}){const r=this.getBounds();return this.getColor(r.min+e*(r.max-r.min),o)}getCanvasStrip(e={horizontal:!0,size:512,smooth:!0}){const o=document.createElement("canvas");o.width=e.horizontal?e.size:1,o.height=e.horizontal?1:e.size;const r=o.getContext("2d");if(!r)throw new Error("Canvs context is missing");const a=r.getImageData(0,0,o.width,o.height),l=a.data,i=e.size,s=this[0].value,n=(this.at(-1).value-s)/i;for(let u=0;u<i;u+=1){const c=this.getColor(s+u*n,{smooth:e.smooth});l[u*4]=c[0],l[u*4+1]=c[1],l[u*4+2]=c[2],l[u*4+3]=c.length>3?c[3]:255}return r.putImageData(a,0,0),o}resample(e,o=15){const r=this.getBounds(),a=this.scale(0,1),l=1/(o-1);let i;if(e==="ease-in-square")i=Array.from({length:o},(s,n)=>{const u=n*l,c=Math.pow(u,2),p=a.getColor(c);return{value:u,color:p}});else if(e==="ease-out-square")i=Array.from({length:o},(s,n)=>{const u=n*l,c=1-Math.pow(1-u,2),p=a.getColor(c);return{value:u,color:p}});else if(e==="ease-out-sqrt")i=Array.from({length:o},(s,n)=>{const u=n*l,c=Math.pow(u,.5),p=a.getColor(c);return{value:u,color:p}});else if(e==="ease-in-sqrt")i=Array.from({length:o},(s,n)=>{const u=n*l,c=1-Math.pow(1-u,.5),p=a.getColor(c);return{value:u,color:p}});else if(e==="ease-out-exp")i=Array.from({length:o},(s,n)=>{const u=n*l,c=1-Math.pow(2,-10*u),p=a.getColor(c);return{value:u,color:p}});else if(e==="ease-in-exp")i=Array.from({length:o},(s,n)=>{const u=n*l,c=Math.pow(2,10*u-10),p=a.getColor(c);return{value:u,color:p}});else throw new Error("Invalid ressampling method.");return new d({stops:i}).scale(r.min,r.max)}transparentStart(){const e=this.getRawColorStops();return e.unshift({value:e[0].value,color:e[0].color.slice()}),e[1].value+=.001,e.forEach(o=>{o.color.length===3&&o.color.push(255)}),e[0].color[3]=0,new d({stops:e})}hasTransparentStart(){return this[0].color.length===4&&this[0].color[3]===0}}const Ze={NULL:new d({stops:[{value:0,color:[0,0,0,0]},{value:1,color:[0,0,0,0]}]}),GRAY:new d({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),JET:new d({stops:[{value:0,color:[0,0,131]},{value:.125,color:[0,60,170]},{value:.375,color:[5,255,255]},{value:.625,color:[255,255,0]},{value:.875,color:[250,0,0]},{value:1,color:[128,0,0]}]}),HSV:new d({stops:[{value:0,color:[255,0,0]},{value:.169,color:[253,255,2]},{value:.173,color:[247,255,2]},{value:.337,color:[0,252,4]},{value:.341,color:[0,252,10]},{value:.506,color:[1,249,255]},{value:.671,color:[2,0,253]},{value:.675,color:[8,0,253]},{value:.839,color:[255,0,251]},{value:.843,color:[255,0,245]},{value:1,color:[255,0,6]}]}),HOT:new d({stops:[{value:0,color:[0,0,0]},{value:.3,color:[230,0,0]},{value:.6,color:[255,210,0]},{value:1,color:[255,255,255]}]}),SPRING:new d({stops:[{value:0,color:[255,0,255]},{value:1,color:[255,255,0]}]}),SUMMER:new d({stops:[{value:0,color:[0,128,102]},{value:1,color:[255,255,102]}]}),AUTOMN:new d({stops:[{value:0,color:[255,0,0]},{value:1,color:[255,255,0]}]}),WINTER:new d({stops:[{value:0,color:[0,0,255]},{value:1,color:[0,255,128]}]}),BONE:new d({stops:[{value:0,color:[0,0,0]},{value:.376,color:[84,84,116]},{value:.753,color:[169,200,200]},{value:1,color:[255,255,255]}]}),COPPER:new d({stops:[{value:0,color:[0,0,0]},{value:.804,color:[255,160,102]},{value:1,color:[255,199,127]}]}),GREYS:new d({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),YIGNBU:new d({stops:[{value:0,color:[8,29,88]},{value:.125,color:[37,52,148]},{value:.25,color:[34,94,168]},{value:.375,color:[29,145,192]},{value:.5,color:[65,182,196]},{value:.625,color:[127,205,187]},{value:.75,color:[199,233,180]},{value:.875,color:[237,248,217]},{value:1,color:[255,255,217]}]}),GREENS:new d({stops:[{value:0,color:[0,68,27]},{value:.125,color:[0,109,44]},{value:.25,color:[35,139,69]},{value:.375,color:[65,171,93]},{value:.5,color:[116,196,118]},{value:.625,color:[161,217,155]},{value:.75,color:[199,233,192]},{value:.875,color:[229,245,224]},{value:1,color:[247,252,245]}]}),YIORRD:new d({stops:[{value:0,color:[128,0,38]},{value:.125,color:[189,0,38]},{value:.25,color:[227,26,28]},{value:.375,color:[252,78,42]},{value:.5,color:[253,141,60]},{value:.625,color:[254,178,76]},{value:.75,color:[254,217,118]},{value:.875,color:[255,237,160]},{value:1,color:[255,255,204]}]}),BLUERED:new d({stops:[{value:0,color:[0,0,255]},{value:1,color:[255,0,0]}]}),RDBU:new d({stops:[{value:0,color:[5,10,172]},{value:.35,color:[106,137,247]},{value:.5,color:[190,190,190]},{value:.6,color:[220,170,132]},{value:.7,color:[230,145,90]},{value:1,color:[178,10,28]}]}),PICNIC:new d({stops:[{value:0,color:[0,0,255]},{value:.1,color:[51,153,255]},{value:.2,color:[102,204,255]},{value:.3,color:[153,204,255]},{value:.4,color:[204,204,255]},{value:.5,color:[255,255,255]},{value:.6,color:[255,204,255]},{value:.7,color:[255,153,255]},{value:.8,color:[255,102,204]},{value:.9,color:[255,102,102]},{value:1,color:[255,0,0]}]}),RAINBOW:new d({stops:[{value:0,color:[150,0,90]},{value:.125,color:[0,0,200]},{value:.25,color:[0,25,255]},{value:.375,color:[0,152,255]},{value:.5,color:[44,255,150]},{value:.625,color:[151,255,0]},{value:.75,color:[255,234,0]},{value:.875,color:[255,111,0]},{value:1,color:[255,0,0]}]}),PORTLAND:new d({stops:[{value:0,color:[12,51,131]},{value:.25,color:[10,136,186]},{value:.5,color:[242,211,56]},{value:.75,color:[242,143,56]},{value:1,color:[217,30,30]}]}),BLACKBODY:new d({stops:[{value:0,color:[0,0,0]},{value:.2,color:[230,0,0]},{value:.4,color:[230,210,0]},{value:.7,color:[255,255,255]},{value:1,color:[160,200,255]}]}),EARTH:new d({stops:[{value:0,color:[0,0,130]},{value:.1,color:[0,180,180]},{value:.2,color:[40,210,40]},{value:.4,color:[230,230,50]},{value:.6,color:[120,70,20]},{value:1,color:[255,255,255]}]}),ELECTRIC:new d({stops:[{value:0,color:[0,0,0]},{value:.15,color:[30,0,100]},{value:.4,color:[120,0,100]},{value:.6,color:[160,90,0]},{value:.8,color:[230,200,0]},{value:1,color:[255,250,220]}]}),VIRIDIS:new d({stops:[{value:0,color:[68,1,84]},{value:.13,color:[71,44,122]},{value:.25,color:[59,81,139]},{value:.38,color:[44,113,142]},{value:.5,color:[33,144,141]},{value:.63,color:[39,173,129]},{value:.75,color:[92,200,99]},{value:.88,color:[170,220,50]},{value:1,color:[253,231,37]}]}),INFERNO:new d({stops:[{value:0,color:[0,0,4]},{value:.13,color:[31,12,72]},{value:.25,color:[85,15,109]},{value:.38,color:[136,34,106]},{value:.5,color:[186,54,85]},{value:.63,color:[227,89,51]},{value:.75,color:[249,140,10]},{value:.88,color:[249,201,50]},{value:1,color:[252,255,164]}]}),MAGMA:new d({stops:[{value:0,color:[0,0,4]},{value:.13,color:[28,16,68]},{value:.25,color:[79,18,123]},{value:.38,color:[129,37,129]},{value:.5,color:[181,54,122]},{value:.63,color:[229,80,100]},{value:.75,color:[251,135,97]},{value:.88,color:[254,194,135]},{value:1,color:[252,253,191]}]}),PLASMA:new d({stops:[{value:0,color:[13,8,135]},{value:.13,color:[75,3,161]},{value:.25,color:[125,3,168]},{value:.38,color:[168,34,150]},{value:.5,color:[203,70,121]},{value:.63,color:[229,107,93]},{value:.75,color:[248,148,65]},{value:.88,color:[253,195,40]},{value:1,color:[240,249,33]}]}),WARM:new d({stops:[{value:0,color:[125,0,179]},{value:.13,color:[172,0,187]},{value:.25,color:[219,0,170]},{value:.38,color:[255,0,130]},{value:.5,color:[255,63,74]},{value:.63,color:[255,123,0]},{value:.75,color:[234,176,0]},{value:.88,color:[190,228,0]},{value:1,color:[147,255,0]}]}),COOL:new d({stops:[{value:0,color:[125,0,179]},{value:.13,color:[116,0,218]},{value:.25,color:[98,74,237]},{value:.38,color:[68,146,231]},{value:.5,color:[0,204,197]},{value:.63,color:[0,247,146]},{value:.75,color:[0,255,88]},{value:.88,color:[40,255,8]},{value:1,color:[147,255,0]}]}),RAINBOW_SOFT:new d({stops:[{value:0,color:[125,0,179]},{value:.1,color:[199,0,180]},{value:.2,color:[255,0,121]},{value:.3,color:[255,108,0]},{value:.4,color:[222,194,0]},{value:.5,color:[150,255,0]},{value:.6,color:[0,255,55]},{value:.7,color:[0,246,150]},{value:.8,color:[50,167,222]},{value:.9,color:[103,51,235]},{value:1,color:[124,0,186]}]}),BATHYMETRY:new d({stops:[{value:0,color:[40,26,44]},{value:.13,color:[59,49,90]},{value:.25,color:[64,76,139]},{value:.38,color:[63,110,151]},{value:.5,color:[72,142,158]},{value:.63,color:[85,174,163]},{value:.75,color:[120,206,163]},{value:.88,color:[187,230,172]},{value:1,color:[253,254,204]}]}),CDOM:new d({stops:[{value:0,color:[47,15,62]},{value:.13,color:[87,23,86]},{value:.25,color:[130,28,99]},{value:.38,color:[171,41,96]},{value:.5,color:[206,67,86]},{value:.63,color:[230,106,84]},{value:.75,color:[242,149,103]},{value:.88,color:[249,193,135]},{value:1,color:[254,237,176]}]}),CHLOROPHYLL:new d({stops:[{value:0,color:[18,36,20]},{value:.13,color:[25,63,41]},{value:.25,color:[24,91,59]},{value:.38,color:[13,119,72]},{value:.5,color:[18,148,80]},{value:.63,color:[80,173,89]},{value:.75,color:[132,196,122]},{value:.88,color:[175,221,162]},{value:1,color:[215,249,208]}]}),DENSITY:new d({stops:[{value:0,color:[54,14,36]},{value:.13,color:[89,23,80]},{value:.25,color:[110,45,132]},{value:.38,color:[120,77,178]},{value:.5,color:[120,113,213]},{value:.63,color:[115,151,228]},{value:.75,color:[134,185,227]},{value:.88,color:[177,214,227]},{value:1,color:[230,241,241]}]}),FREESURFACE_BLUE:new d({stops:[{value:0,color:[30,4,110]},{value:.13,color:[47,14,176]},{value:.25,color:[41,45,236]},{value:.38,color:[25,99,212]},{value:.5,color:[68,131,200]},{value:.63,color:[114,156,197]},{value:.75,color:[157,181,203]},{value:.88,color:[200,208,216]},{value:1,color:[241,237,236]}]}),FREESURFACE_RED:new d({stops:[{value:0,color:[60,9,18]},{value:.13,color:[100,17,27]},{value:.25,color:[142,20,29]},{value:.38,color:[177,43,27]},{value:.5,color:[192,87,63]},{value:.63,color:[205,125,105]},{value:.75,color:[216,162,148]},{value:.88,color:[227,199,193]},{value:1,color:[241,237,236]}]}),OXYGEN:new d({stops:[{value:0,color:[64,5,5]},{value:.13,color:[106,6,15]},{value:.25,color:[144,26,7]},{value:.38,color:[168,64,3]},{value:.5,color:[188,100,4]},{value:.63,color:[206,136,11]},{value:.75,color:[220,174,25]},{value:.88,color:[231,215,44]},{value:1,color:[248,254,105]}]}),PAR:new d({stops:[{value:0,color:[51,20,24]},{value:.13,color:[90,32,35]},{value:.25,color:[129,44,34]},{value:.38,color:[159,68,25]},{value:.5,color:[182,99,19]},{value:.63,color:[199,134,22]},{value:.75,color:[212,171,35]},{value:.88,color:[221,210,54]},{value:1,color:[225,253,75]}]}),PHASE:new d({stops:[{value:0,color:[145,105,18]},{value:.13,color:[184,71,38]},{value:.25,color:[186,58,115]},{value:.38,color:[160,71,185]},{value:.5,color:[110,97,218]},{value:.63,color:[50,123,164]},{value:.75,color:[31,131,110]},{value:.88,color:[77,129,34]},{value:1,color:[145,105,18]}]}),SALINITY:new d({stops:[{value:0,color:[42,24,108]},{value:.13,color:[33,50,162]},{value:.25,color:[15,90,145]},{value:.38,color:[40,118,137]},{value:.5,color:[59,146,135]},{value:.63,color:[79,175,126]},{value:.75,color:[120,203,104]},{value:.88,color:[193,221,100]},{value:1,color:[253,239,154]}]}),TEMPERATURE:new d({stops:[{value:0,color:[4,35,51]},{value:.13,color:[23,51,122]},{value:.25,color:[85,59,157]},{value:.38,color:[129,79,143]},{value:.5,color:[175,95,130]},{value:.63,color:[222,112,101]},{value:.75,color:[249,146,66]},{value:.88,color:[249,196,65]},{value:1,color:[232,250,91]}]}),TURBIDITY:new d({stops:[{value:0,color:[34,31,27]},{value:.13,color:[65,50,41]},{value:.25,color:[98,69,52]},{value:.38,color:[131,89,57]},{value:.5,color:[161,112,59]},{value:.63,color:[185,140,66]},{value:.75,color:[202,174,88]},{value:.88,color:[216,209,126]},{value:1,color:[233,246,171]}]}),VELOCITY_BLUE:new d({stops:[{value:0,color:[17,32,64]},{value:.13,color:[35,52,116]},{value:.25,color:[29,81,156]},{value:.38,color:[31,113,162]},{value:.5,color:[50,144,169]},{value:.63,color:[87,173,176]},{value:.75,color:[149,196,189]},{value:.88,color:[203,221,211]},{value:1,color:[254,251,230]}]}),VELOCITY_GREEN:new d({stops:[{value:0,color:[23,35,19]},{value:.13,color:[24,64,38]},{value:.25,color:[11,95,45]},{value:.38,color:[39,123,35]},{value:.5,color:[95,146,12]},{value:.63,color:[152,165,18]},{value:.75,color:[201,186,69]},{value:.88,color:[233,216,137]},{value:1,color:[255,253,205]}]}),CUBEHELIX:new d({stops:[{value:0,color:[0,0,0]},{value:.07,color:[22,5,59]},{value:.13,color:[60,4,105]},{value:.2,color:[109,1,135]},{value:.27,color:[161,0,147]},{value:.33,color:[210,2,142]},{value:.4,color:[251,11,123]},{value:.47,color:[255,29,97]},{value:.53,color:[255,54,69]},{value:.6,color:[255,85,46]},{value:.67,color:[255,120,34]},{value:.73,color:[255,157,37]},{value:.8,color:[241,191,57]},{value:.87,color:[224,220,93]},{value:.93,color:[218,241,142]},{value:1,color:[227,253,198]}]}),CIVIDIS:new d({stops:[{value:0,color:[0,32,77,255]},{value:.125,color:[5,54,110,255]},{value:.25,color:[65,77,108,255]},{value:.375,color:[97,100,111,255]},{value:.5,color:[125,124,121,255]},{value:.625,color:[156,149,120,255]},{value:.75,color:[190,175,111,255]},{value:.875,color:[225,204,94,255]},{value:1,color:[255,235,70,255]}]}),TURBO:new d({stops:[{value:0,color:[48,18,59,255]},{value:.125,color:[70,107,227,255]},{value:.25,color:[40,187,236,255]},{value:.375,color:[49,242,153,255]},{value:.5,color:[162,252,60,255]},{value:.625,color:[237,208,58,255]},{value:.75,color:[251,128,34,255]},{value:.875,color:[210,49,5,255]},{value:1,color:[122,4,3,255]}]}),ROCKET:new d({stops:[{value:0,color:[250,235,221,0]},{value:.133,color:[250,235,221,255]},{value:.266,color:[246,170,130,255]},{value:.4,color:[240,96,67,255]},{value:.533,color:[203,27,79,255]},{value:.666,color:[132,30,90,255]},{value:.8,color:[63,27,68,255]},{value:1,color:[3,5,26,255]}]}),MAKO:new d({stops:[{value:0,color:[11,4,5,255]},{value:.125,color:[43,28,53,255]},{value:.25,color:[62,53,107,255]},{value:.375,color:[59,86,152,255]},{value:.5,color:[53,123,162,255]},{value:.625,color:[53,158,170,255]},{value:.75,color:[73,193,173,255]},{value:.875,color:[150,221,181,255]},{value:1,color:[222,245,229,255]}]})},Gt=[["#1D5B79","#468B97","#EF6262","#F3AA60"],["#614BC3","#33BBC5","#85E6C5","#C8FFE0"],["#461959","#7A316F","#CD6688","#AED8CC"],["#0079FF","#00DFA2","#F6FA70","#FF0060"],["#39B5E0","#A31ACB","#FF78F0","#F5EA5A"],["#37E2D5","#590696","#C70A80","#FBCB0A"],["#FFD36E","#FFF56D","#99FFCD","#9FB4FF"],["#00EAD3","#FFF5B7","#FF449F","#005F99"],["#10A19D","#540375","#FF7000","#FFBF00"]];function Ke(){return Gt[~~(Math.random()*Gt.length)][~~(Math.random()*4)]}function be(){return`maptiler_source_${pt()}`}function Se(){return`maptiler_layer_${pt()}`}function Vt(t,e){if(e<=t[0].zoom)return t[0].value;if(e>=t[t.length-1].zoom)return t[t.length-1].value;for(let o=0;o<t.length-1;o+=1)if(e>=t[o].zoom&&e<t[o+1].zoom){const r=t[o+1].zoom-t[o].zoom,a=(e-t[o].zoom)/r;return a*t[o+1].value+(1-a)*t[o].value}return 0}function se(t){return["interpolate",["linear"],["zoom"],...t.map(e=>[e.zoom,e.value]).flat()]}function P(t){return["interpolate",["linear"],["zoom"],...t.map(e=>[e.zoom,e.value]).flat()]}function Wr(t,e){if(typeof e=="number"&&typeof t=="number")return 2*e+t;if(typeof e=="number"&&Array.isArray(t))return["interpolate",["linear"],["zoom"],...t.map(o=>[o.zoom,2*e+o.value]).flat()];if(typeof t=="number"&&Array.isArray(e))return["interpolate",["linear"],["zoom"],...e.map(o=>[o.zoom,2*o.value+t]).flat()];if(Array.isArray(t)&&Array.isArray(e)){const o=Array.from(new Set([...t.map(r=>r.zoom),...e.map(r=>r.zoom)])).sort((r,a)=>r<a?-1:1);return["interpolate",["linear"],["zoom"],...o.map(r=>[r,2*Vt(e,r)+Vt(t,r)]).flat()]}return 0}function Zr(t,e){return["interpolate",["linear"],["get",e],...t.map(o=>[o.propertyValue,o.value]).flat()]}function Wt(t){const e=t.trimStart(),o=`${e}${" ".repeat(t.length-e.length)}`,r=Array.from(o);if(!r.every(l=>l===" "||l==="_"))throw new Error("A dash pattern must be composed only of whitespace and underscore characters.");if(!(r.some(l=>l==="_")&&r.some(l=>l===" ")))throw new Error("A dash pattern must contain at least one underscore and one whitespace character");const a=[1];for(let l=1;l<r.length;l+=1){const i=r[l-1],s=r[l];i===s?a[a.length-1]+=1:a.push(1)}return a}function Zt(t,e){return["interpolate",["linear"],["get",e],...t.map(o=>[o.value,o.color]).flat()]}function Kt(t,e,o=!0){return o?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",e],...t.map(r=>[r.value,r.pointRadius*.025]).flat()],2,["interpolate",["linear"],["get",e],...t.map(r=>[r.value,r.pointRadius*.05]).flat()],4,["interpolate",["linear"],["get",e],...t.map(r=>[r.value,r.pointRadius*.1]).flat()],8,["interpolate",["linear"],["get",e],...t.map(r=>[r.value,r.pointRadius*.25]).flat()],16,["interpolate",["linear"],["get",e],...t.map(r=>[r.value,r.pointRadius]).flat()]]:["interpolate",["linear"],["get",e],...t.map(r=>[r.value,r.pointRadius]).flat()]}function Kr(t,e,o=!0){return o?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",e],...t.map(r=>[r.propertyValue,r.value*.025]).flat()],2,["interpolate",["linear"],["get",e],...t.map(r=>[r.propertyValue,r.value*.05]).flat()],4,["interpolate",["linear"],["get",e],...t.map(r=>[r.propertyValue,r.value*.1]).flat()],8,["interpolate",["linear"],["get",e],...t.map(r=>[r.propertyValue,r.value*.25]).flat()],16,["interpolate",["linear"],["get",e],...t.map(r=>[r.propertyValue,r.value]).flat()]]:["interpolate",["linear"],["get",e],...t.map(r=>[r.propertyValue,r.value]).flat()]}function Yt(t,e){return t.every(o=>o.color[3]===t[0].color[3])?t[0].color[3]?t[0].color[3]/255:1:["interpolate",["linear"],["get",e],...t.getRawColorStops().map(o=>{const r=o.value,a=o.color;return[r,a.length===4?a[3]/255:1]}).flat()]}function Yr(t,e=10){return["interpolate",["linear"],["heatmap-density"],...Array.from({length:e+1},(o,r)=>{const a=r/e;return[a,t.getColorHex(a)]}).flat()]}var qr=Object.defineProperty,Jr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptors,qt=Object.getOwnPropertySymbols,Qr=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,Jt=(t,e,o)=>e in t?qr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,ue=(t,e)=>{for(var o in e||(e={}))Qr.call(e,o)&&Jt(t,o,e[o]);if(qt)for(var o of qt(e))ea.call(e,o)&&Jt(t,o,e[o]);return t},ta=(t,e)=>Jr(t,Xr(e)),oa=(t,e,o)=>new Promise((r,a)=>{var l=n=>{try{s(o.next(n))}catch(u){a(u)}},i=n=>{try{s(o.throw(n))}catch(u){a(u)}},s=n=>n.done?r(n.value):Promise.resolve(n.value).then(l,i);s((o=o.apply(t,e)).next())});function ra(t,e){return oa(this,arguments,function*(o,r,a={}){var l,i,s;if(!r.sourceId&&!r.data)throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");let n=r.data;if(typeof n=="string"){if(ve(n))n=`https://api.maptiler.com/data/${r.data}/features.json?key=${j.apiKey}`;else if(((l=n.split(".").pop())==null?void 0:l.toLowerCase().trim())==="gpx"){const u=yield(yield fetch(n,a)).text();n=De(u)}else if(((i=n.split(".").pop())==null?void 0:i.toLowerCase().trim())==="kml"){const u=yield(yield fetch(n,a)).text();n=Ge(u)}else{const u=(s=Ho(n))!=null?s:jt(n);u&&(n=u)}if(!n)throw new Error("Polyline data was provided as string but is incompatible with valid formats.")}return aa(o,ta(ue({},r),{data:n}))})}function aa(t,e){var o,r,a,l,i,s,n,u,c,p,v,m,T,g,k,M,R,z,F,_;if(e.layerId&&t.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const E=(o=e.sourceId)!=null?o:be(),I=(r=e.layerId)!=null?r:Se(),A={polylineLayerId:I,polylineOutlineLayerId:"",polylineSourceId:E};e.data&&!t.getSource(E)&&t.addSource(E,{type:"geojson",data:e.data});const C=(a=e.lineWidth)!=null?a:3,w=(l=e.lineColor)!=null?l:Ke(),B=(i=e.lineOpacity)!=null?i:1,f=(s=e.lineBlur)!=null?s:0,b=(n=e.lineGapWidth)!=null?n:0;let O=(u=e.lineDashArray)!=null?u:null;const N=(c=e.outlineWidth)!=null?c:1,$=(p=e.outlineColor)!=null?p:"#FFFFFF",D=(v=e.outlineOpacity)!=null?v:1,H=(m=e.outlineBlur)!=null?m:0;if(typeof O=="string"&&(O=Wt(O)),e.outline===!0){const J=`${I}_outline`;A.polylineOutlineLayerId=J,t.addLayer({id:J,type:"line",source:E,layout:{"line-join":(T=e.lineJoin)!=null?T:"round","line-cap":(g=e.lineCap)!=null?g:"round"},minzoom:(k=e.minzoom)!=null?k:0,maxzoom:(M=e.maxzoom)!=null?M:23,paint:{"line-opacity":typeof D=="number"?D:P(D),"line-color":typeof $=="string"?$:se($),"line-width":Wr(C,N),"line-blur":typeof H=="number"?H:P(H)}},e.beforeId)}return t.addLayer({id:I,type:"line",source:E,layout:{"line-join":(R=e.lineJoin)!=null?R:"round","line-cap":(z=e.lineCap)!=null?z:"round"},minzoom:(F=e.minzoom)!=null?F:0,maxzoom:(_=e.maxzoom)!=null?_:23,paint:ue({"line-opacity":typeof B=="number"?B:P(B),"line-color":typeof w=="string"?w:se(w),"line-width":typeof C=="number"?C:P(C),"line-blur":typeof f=="number"?f:P(f),"line-gap-width":typeof b=="number"?b:P(b)},O&&{"line-dasharray":O})},e.beforeId),A}function la(t,e){var o,r,a,l,i,s,n,u,c,p,v;if(e.layerId&&t.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const m=(o=e.sourceId)!=null?o:be(),T=(r=e.layerId)!=null?r:Se(),g={polygonLayerId:T,polygonOutlineLayerId:e.outline?`${T}_outline`:"",polygonSourceId:m};if(e.data&&!t.getSource(m)){let w=e.data;typeof w=="string"&&ve(w)&&(w=`https://api.maptiler.com/data/${w}/features.json?key=${j.apiKey}`),t.addSource(m,{type:"geojson",data:w})}let k=(a=e.outlineDashArray)!=null?a:null;const M=(l=e.outlineWidth)!=null?l:1,R=(i=e.outlineColor)!=null?i:"#FFFFFF",z=(s=e.outlineOpacity)!=null?s:1,F=(n=e.outlineBlur)!=null?n:0,_=(u=e.fillColor)!=null?u:Ke(),E=(c=e.fillOpacity)!=null?c:1,I=(p=e.outlinePosition)!=null?p:"center",A=(v=e.pattern)!=null?v:null;typeof k=="string"&&(k=Wt(k));const C=(w=null)=>{var B,f,b,O,N,$;if(t.addLayer({id:T,type:"fill",source:m,minzoom:(B=e.minzoom)!=null?B:0,maxzoom:(f=e.maxzoom)!=null?f:23,paint:ue({"fill-color":typeof _=="string"?_:se(_),"fill-opacity":typeof E=="number"?E:P(E)},w&&{"fill-pattern":w})},e.beforeId),e.outline===!0){let D;I==="inside"?typeof M=="number"?D=.5*M:D=P(M.map(({zoom:H,value:J})=>({zoom:H,value:.5*J}))):I==="outside"?typeof M=="number"?D=-.5*M:D=P(M.map(H=>({zoom:H.zoom,value:-.5*H.value}))):D=0,t.addLayer({id:g.polygonOutlineLayerId,type:"line",source:m,layout:{"line-join":(b=e.outlineJoin)!=null?b:"round","line-cap":(O=e.outlineCap)!=null?O:"butt"},minzoom:(N=e.minzoom)!=null?N:0,maxzoom:($=e.maxzoom)!=null?$:23,paint:ue({"line-opacity":typeof z=="number"?z:P(z),"line-color":typeof R=="string"?R:se(R),"line-width":typeof M=="number"?M:P(M),"line-blur":typeof F=="number"?F:P(F),"line-offset":D},k&&{"line-dasharray":k})},e.beforeId)}};return A?t.hasImage(A)?C(A):t.loadImage(A).then(w=>{t.addImage(A,w.data),C(A)}).catch(w=>(console.error("Could not load the pattern image.",w.message),C())):C(),g}function na(t,e){var o,r,a,l,i,s,n,u,c,p,v,m,T,g,k,M;if(e.layerId&&t.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const R=(o=e.minPointRadius)!=null?o:10,z=(r=e.maxPointRadius)!=null?r:50,F=(a=e.cluster)!=null?a:!1,_=20,E=Array.isArray(e.pointColor)?e.pointColor:Ze.TURBO.scale(10,e.cluster?1e4:1e3).resample("ease-out-square"),I=E.getBounds(),A=(l=e.sourceId)!=null?l:be(),C=(i=e.layerId)!=null?i:Se(),w=(s=e.showLabel)!=null?s:F,B=(n=e.alignOnViewport)!=null?n:!0,f=(u=e.outline)!=null?u:!1,b=(c=e.outlineOpacity)!=null?c:1,O=(p=e.outlineWidth)!=null?p:1,N=(v=e.outlineColor)!=null?v:"#FFFFFF";let $;const D=(m=e.zoomCompensation)!=null?m:!0,H=(T=e.minzoom)!=null?T:0,J=(g=e.maxzoom)!=null?g:23;typeof e.pointOpacity=="number"?$=e.pointOpacity:Array.isArray(e.pointOpacity)?$=P(e.pointOpacity):e.cluster?$=Yt(E,"point_count"):e.property?$=Yt(E,e.property):$=P([{zoom:H,value:0},{zoom:H+.25,value:1},{zoom:J-.25,value:1},{zoom:J,value:0}]);const re={pointLayerId:C,clusterLayerId:"",labelLayerId:"",pointSourceId:A};if(e.data&&!t.getSource(A)){let G=e.data;typeof G=="string"&&ve(G)&&(G=`https://api.maptiler.com/data/${G}/features.json?key=${j.apiKey}`),t.addSource(A,{type:"geojson",data:G,cluster:F})}if(F){re.clusterLayerId=`${C}_cluster`;const G=Array.from({length:_},(me,de)=>{const Ce=I.min+de*(I.max-I.min)/(_-1);return{value:Ce,pointRadius:R+(z-R)*Math.pow(de/(_-1),.5),color:E.getColorHex(Ce)}});t.addLayer({id:re.clusterLayerId,type:"circle",source:A,filter:["has","point_count"],paint:ue({"circle-color":typeof e.pointColor=="string"?e.pointColor:Zt(G,"point_count"),"circle-radius":typeof e.pointRadius=="number"?e.pointRadius:Array.isArray(e.pointRadius)?P(e.pointRadius):Kt(G,"point_count",!1),"circle-pitch-alignment":B?"viewport":"map","circle-pitch-scale":"map","circle-opacity":$},f&&{"circle-stroke-opacity":typeof b=="number"?b:P(b),"circle-stroke-width":typeof O=="number"?O:P(O),"circle-stroke-color":typeof N=="string"?N:se(N)}),minzoom:H,maxzoom:J},e.beforeId),t.addLayer({id:re.pointLayerId,type:"circle",source:A,filter:["!",["has","point_count"]],paint:ue({"circle-pitch-alignment":B?"viewport":"map","circle-pitch-scale":"map","circle-color":typeof e.pointColor=="string"?e.pointColor:E.getColorHex(E.getBounds().min),"circle-radius":typeof e.pointRadius=="number"?e.pointRadius:Array.isArray(e.pointRadius)?P(e.pointRadius):G[0].pointRadius*.75,"circle-opacity":$},f&&{"circle-stroke-opacity":typeof b=="number"?b:P(b),"circle-stroke-width":typeof O=="number"?O:P(O),"circle-stroke-color":typeof N=="string"?N:se(N)}),minzoom:H,maxzoom:J},e.beforeId)}else{let G=typeof e.pointColor=="string"?e.pointColor:Array.isArray(e.pointColor)?e.pointColor.getColorHex(e.pointColor.getBounds().min):Ke(),me=typeof e.pointRadius=="number"?D?P([{zoom:0,value:e.pointRadius*.025},{zoom:2,value:e.pointRadius*.05},{zoom:4,value:e.pointRadius*.1},{zoom:8,value:e.pointRadius*.25},{zoom:16,value:e.pointRadius*1}]):e.pointRadius:Array.isArray(e.pointRadius)?P(e.pointRadius):D?P([{zoom:0,value:R*.05},{zoom:2,value:R*.1},{zoom:4,value:R*.2},{zoom:8,value:R*.5},{zoom:16,value:R*1}]):R;if(e.property&&Array.isArray(e.pointColor)){const de=Array.from({length:_},(Ce,qe)=>{const Je=I.min+qe*(I.max-I.min)/(_-1);return{value:Je,pointRadius:typeof e.pointRadius=="number"?e.pointRadius:R+(z-R)*Math.pow(qe/(_-1),.5),color:typeof e.pointColor=="string"?e.pointColor:E.getColorHex(Je)}});G=Zt(de,e.property),me=Kt(de,e.property,D)}t.addLayer({id:re.pointLayerId,type:"circle",source:A,layout:{"circle-sort-key":e.property?["/",1,["get",e.property]]:0},paint:ue({"circle-pitch-alignment":B?"viewport":"map","circle-pitch-scale":"map","circle-color":G,"circle-opacity":$,"circle-radius":me},f&&{"circle-stroke-opacity":typeof b=="number"?b:P(b),"circle-stroke-width":typeof O=="number"?O:P(O),"circle-stroke-color":typeof N=="string"?N:se(N)}),minzoom:H,maxzoom:J},e.beforeId)}if(w!==!1&&(e.cluster||e.property)){re.labelLayerId=`${C}_label`;const G=(k=e.labelColor)!=null?k:"#fff",me=(M=e.labelSize)!=null?M:12;t.addLayer({id:re.labelLayerId,type:"symbol",source:A,filter:["has",e.cluster?"point_count":e.property],layout:{"text-field":e.cluster?"{point_count_abbreviated}":`{${e.property}}`,"text-font":["Noto Sans Regular"],"text-size":me,"text-pitch-alignment":B?"viewport":"map","symbol-sort-key":["/",1,["get",e.cluster?"point_count":e.property]]},paint:{"text-color":G,"text-opacity":$},minzoom:H,maxzoom:J},e.beforeId)}return re}function ia(t,e){var o,r,a,l,i,s,n,u,c,p;if(e.layerId&&t.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const v=(o=e.sourceId)!=null?o:be(),m=(r=e.layerId)!=null?r:Se(),T=(a=e.minzoom)!=null?a:0,g=(l=e.maxzoom)!=null?l:23,k=(i=e.zoomCompensation)!=null?i:!0,M=(s=e.opacity)!=null?s:[{zoom:T,value:0},{zoom:T+.25,value:1},{zoom:g-.25,value:1},{zoom:g,value:0}];let R=Array.isArray(e.colorRamp)?e.colorRamp:Ze.TURBO.transparentStart();const z=R.getBounds();(z.min!==0||z.max!==1)&&(R=R.scale(0,1)),R.hasTransparentStart()||(R=R.transparentStart());const F=(n=e.intensity)!=null?n:[{zoom:0,value:.01},{zoom:4,value:.2},{zoom:16,value:1}],_=(u=e.property)!=null?u:null,E=(c=e.weight)!=null?c:1;let I=1;_?typeof E=="number"?(I=E,typeof e.weight=="number"&&console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`")):Array.isArray(E)?I=Zr(E,_):console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"):typeof E=="number"?I=E:Array.isArray(E)&&console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");const A=[{zoom:0,value:50*.025},{zoom:2,value:50*.05},{zoom:4,value:50*.1},{zoom:8,value:50*.25},{zoom:16,value:50}],C=(p=e.radius)!=null?p:k?A:10;let w=1;typeof C=="number"?w=C:Array.isArray(C)&&"zoom"in C[0]?w=P(C):_&&Array.isArray(C)&&"propertyValue"in C[0]?w=Kr(C,_,k):!_&&Array.isArray(C)&&"propertyValue"in C[0]?(w=P(A),console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")):w=P(A);const B={heatmapLayerId:m,heatmapSourceId:v};if(e.data&&!t.getSource(v)){let f=e.data;typeof f=="string"&&ve(f)&&(f=`https://api.maptiler.com/data/${f}/features.json?key=${j.apiKey}`),t.addSource(v,{type:"geojson",data:f})}return t.addLayer({id:m,type:"heatmap",source:v,minzoom:T,maxzoom:g,paint:{"heatmap-weight":I,"heatmap-intensity":typeof F=="number"?F:P(F),"heatmap-color":Yr(R),"heatmap-radius":w,"heatmap-opacity":typeof M=="number"?M:P(M)}}),B}const sa={addPolyline:ra,addPolygon:la,addPoint:na,addHeatmap:ia},{setRTLTextPlugin:ua,getRTLTextPluginStatus:ca,LngLat:pa,LngLatBounds:ha,MercatorCoordinate:ma,Evented:da,AJAXError:ga,prewarm:va,clearPrewarmedResources:ya,addProtocol:Ye,removeProtocol:fa,Hash:La,Point:Aa,config:wa,EdgeInsets:ba,DragRotateHandler:Sa,DragPanHandler:Ca,TwoFingersTouchZoomRotateHandler:Ta,DoubleClickZoomHandler:Ia,TwoFingersTouchZoomHandler:Ra,TwoFingersTouchRotateHandler:Ea,getWorkerCount:xa,setWorkerCount:Pa,getMaxParallelImageRequests:Oa,setMaxParallelImageRequests:_a,getWorkerUrl:Na,setWorkerUrl:Ma,addSourceType:$a,importScriptInWorkers:ka}=h;function Fa(){return So.version}function za(){return h.getVersion()}const Ba=h.Map,Ua=h.Marker,Ha=h.Popup,ja=h.Style,Da=h.CanvasSource,Ga=h.GeoJSONSource,Va=h.ImageSource,Wa=h.RasterTileSource,Za=h.RasterDEMTileSource,Ka=h.VectorTileSource,Ya=h.VideoSource;h.NavigationControl,h.GeolocateControl,h.AttributionControl,h.LogoControl,h.ScaleControl,h.FullscreenControl,h.TerrainControl;const qa=h.BoxZoomHandler,Ja=h.ScrollZoomHandler,Xa=h.CooperativeGesturesHandler,Qa=h.KeyboardHandler,el=h.TwoFingersTouchPitchHandler,tl=h.MapWheelEvent,ol=h.MapTouchEvent,rl=h.MapMouseEvent;export{ga as AJAXError,Sr as AttributionControl,Tr as BoxZoomHandler,qa as BoxZoomHandlerMLGL,vr as CanvasSource,Da as CanvasSourceMLGL,d as ColorRamp,Ze as ColorRampCollection,Rr as CooperativeGesturesHandler,Xa as CooperativeGesturesHandlerMLGL,Ia as DoubleClickZoomHandler,Ca as DragPanHandler,Sa as DragRotateHandler,ba as EdgeInsets,da as Evented,bt as FullscreenControl,yr as GeoJSONSource,Ga as GeoJSONSourceMLGL,vt as GeolocateControl,xt as GeolocationType,La as Hash,fr as ImageSource,Va as ImageSourceMLGL,Er as KeyboardHandler,Qa as KeyboardHandlerMLGL,S as Language,ml as LanguageGeocoding,pa as LngLat,ha as LngLatBounds,tt as LogoControl,Pt as Map,Ba as MapMLGL,_r as MapMouseEvent,rl as MapMouseEventMLGL,dl as MapStyle,gl as MapStyleVariant,Or as MapTouchEvent,ol as MapTouchEventMLGL,Pr as MapWheelEvent,tl as MapWheelEventMLGL,At as MaptilerGeolocateControl,Ee as MaptilerLogoControl,gt as MaptilerNavigationControl,mt as MaptilerTerrainControl,mr as Marker,Ua as MarkerMLGL,ma as MercatorCoordinate,dt as NavigationControl,Aa as Point,dr as Popup,Ha as PopupMLGL,Ar as RasterDEMTileSource,Za as RasterDEMTileSourceMLGL,Lr as RasterTileSource,Wa as RasterTileSourceMLGL,vl as ReferenceMapStyle,wt as ScaleControl,Ir as ScrollZoomHandler,Ja as ScrollZoomHandlerMLGL,et as SdkConfig,yl as ServiceError,gr as Style,ja as StyleMLGL,Cr as TerrainControl,xr as TwoFingersTouchPitchHandler,el as TwoFingersTouchPitchHandlerMLGL,Ea as TwoFingersTouchRotateHandler,Ra as TwoFingersTouchZoomHandler,Ta as TwoFingersTouchZoomRotateHandler,wr as VectorTileSource,Ka as VectorTileSourceMLGL,br as VideoSource,Ya as VideoSourceMLGL,Ye as addProtocol,$a as addSourceType,fl as bufferToPixelDataBrowser,Ll as circumferenceAtLatitude,ya as clearPrewarmedResources,j as config,wa as configMLGL,Al as coordinates,wl as data,bl as elevation,Sl as expandMapStyle,Cl as geocoding,Tl as geolocation,Il as getAutoLanguageGeocoding,Re as getBrowserLanguage,Rl as getBufferToPixelDataParser,za as getMapLibreVersion,Oa as getMaxParallelImageRequests,ca as getRTLTextPluginStatus,El as getTileCache,Fa as getVersion,xa as getWorkerCount,Na as getWorkerUrl,De as gpx,jt as gpxOrKml,He as hasChildNodeWithName,sa as helpers,ka as importScriptInWorkers,Ie as isLanguageSupported,Ge as kml,xl as mapStylePresetList,Pl as math,Ol as misc,va as prewarm,fa as removeProtocol,_a as setMaxParallelImageRequests,ua as setRTLTextPlugin,Pa as setWorkerCount,Ma as setWorkerUrl,_l as staticMaps,Le as str2xml,Nl as styleToStyle,je as xml2str};
1
+ import C,{addProtocol as we}from"maplibre-gl";import{AJAXError as Wo,AttributionControl as Ko,BoxZoomHandler as Zo,CanvasSource as Yo,CooperativeGesturesHandler as qo,DoubleClickZoomHandler as Jo,DragPanHandler as Xo,DragRotateHandler as Qo,EdgeInsets as er,Evented as tr,FullscreenControl as or,GeoJSONSource as rr,GeolocateControl as ar,Hash as nr,ImageSource as ir,KeyboardHandler as lr,LngLat as sr,LngLatBounds as cr,LogoControl as ur,Map as pr,MapMouseEvent as hr,MapTouchEvent as mr,MapWheelEvent as dr,Marker as gr,MercatorCoordinate as yr,NavigationControl as vr,Point as fr,Popup as Lr,RasterDEMTileSource as Ar,RasterTileSource as wr,ScaleControl as Cr,ScrollZoomHandler as Sr,Style as br,TerrainControl as Tr,TwoFingersTouchPitchHandler as Ir,TwoFingersTouchRotateHandler as Er,TwoFingersTouchZoomHandler as Rr,TwoFingersTouchZoomRotateHandler as xr,VectorTileSource as Nr,VideoSource as _r,addProtocol as Mr,addSourceType as Pr,clearPrewarmedResources as Or,config as kr,getVersion as Fr,getMaxParallelImageRequests as zr,getRTLTextPluginStatus as Br,getWorkerCount as Ur,getWorkerUrl as Gr,importScriptInWorkers as Hr,prewarm as Dr,removeProtocol as $r,setMaxParallelImageRequests as jr,setRTLTextPlugin as Vr,setWorkerCount as Wr,setWorkerUrl as Kr}from"maplibre-gl";import dt from"events";import{config as re,expandMapStyle as gt,MapStyleVariant as yt,ReferenceMapStyle as vt,MapStyle as ft,mapStylePresetList as Lt,geolocation as Ce}from"@maptiler/client";import{LanguageGeocoding as Yr,MapStyle as qr,MapStyleVariant as Jr,ReferenceMapStyle as Xr,ServiceError as Qr,bufferToPixelDataBrowser as ea,circumferenceAtLatitude as ta,coordinates as oa,data as ra,elevation as aa,expandMapStyle as na,geocoding as ia,geolocation as la,getAutoLanguageGeocoding as sa,getBufferToPixelDataParser as ca,getTileCache as ua,mapStylePresetList as pa,math as ha,misc as ma,staticMaps as da,styleToStyle as ga}from"@maptiler/client";import{v4 as At}from"uuid";import{Base64 as wt}from"js-base64";var Ct="@maptiler/sdk",St="2.2.1",bt="The Javascript & TypeScript map SDK tailored for MapTiler Cloud",Tt="dist/maptiler-sdk.mjs",It="dist/maptiler-sdk.d.ts",Et="dist/maptiler-sdk.css",Rt="module",xt={".":{import:"./dist/maptiler-sdk.mjs",types:"./dist/maptiler-sdk.d.ts"},"./dist/maptiler-sdk.css":{import:"./dist/maptiler-sdk.css"},"./style.css":{import:"./dist/maptiler-sdk.css"}},Nt=["maptiler","map","sdk","webmap","cloud","webGL","maplibre"],_t="https://docs.maptiler.com/sdk-js/",Mt="BSD-3-Clause",Pt={type:"git",url:"https://github.com/maptiler/maptiler-sdk-js.git"},Ot={build:"rm -rf dist/* && NODE_ENV=production rollup -c",dev:"rm -rf dist/* && NODE_ENV=development rollup -c -w",biome:"biome check --max-diagnostics=1000","biome:fix":"npx @biomejs/biome check --max-diagnostics=1000 --write",doc:"rm -rf docs/* && typedoc --out docs && cp -r images docs/",prepare:"npm run biome:fix && npm run build && npm run test","test:dev":"vitest dev",test:"vitest run"},kt="MapTiler",Ft={"@biomejs/biome":"1.8.3","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@types/uuid":"^9.0.2","@types/xmldom":"^0.1.31",rollup:"^4.18.0","rollup-plugin-copy-merge":"^1.0.2","rollup-plugin-dts":"^6.1.1","rollup-plugin-esbuild":"^6.1.1","rollup-plugin-node-globals":"^1.4.0","rollup-plugin-shell":"^1.0.9","rollup-plugin-string":"^3.0.0","rollup-plugin-swc":"^0.2.1",serve:"^14.2.0",terser:"^5.17.1",typedoc:"^0.24.8",typescript:"^5.1.6",vitest:"^0.34.2",xmldom:"^0.6.0"},zt={"@maptiler/client":"^1.8.1",events:"^3.3.0","js-base64":"^3.7.4","maplibre-gl":"4.4.1",uuid:"^9.0.0"},Bt={name:Ct,version:St,description:bt,module:Tt,types:It,style:Et,type:Rt,exports:xt,keywords:Nt,homepage:_t,license:Mt,repository:Pt,scripts:Ot,author:kt,devDependencies:Ft,dependencies:zt};const A={VISITOR:"visitor",VISITOR_ENGLISH:"visitor_en",STYLE:"style",AUTO:"auto",STYLE_LOCK:"style_lock",LATIN:"name:latin",NON_LATIN:"name:nonlatin",LOCAL:"name",INTERNATIONAL:"name_int",ALBANIAN:"name:sq",AMHARIC:"name:am",ARABIC:"name:ar",ARMENIAN:"name:hy",AZERBAIJANI:"name:az",BASQUE:"name:eu",BELORUSSIAN:"name:be",BENGALI:"name:bn",BOSNIAN:"name:bs",BRETON:"name:br",BULGARIAN:"name:bg",CATALAN:"name:ca",CHINESE:"name:zh",TRADITIONAL_CHINESE:"name:zh-Hant",SIMPLIFIED_CHINESE:"name:zh-Hans",CORSICAN:"name:co",CROATIAN:"name:hr",CZECH:"name:cs",DANISH:"name:da",DUTCH:"name:nl",ENGLISH:"name:en",ESPERANTO:"name:eo",ESTONIAN:"name:et",FINNISH:"name:fi",FRENCH:"name:fr",FRISIAN:"name:fy",GEORGIAN:"name:ka",GERMAN:"name:de",GREEK:"name:el",HEBREW:"name:he",HINDI:"name:hi",HUNGARIAN:"name:hu",ICELANDIC:"name:is",INDONESIAN:"name:id",IRISH:"name:ga",ITALIAN:"name:it",JAPANESE:"name:ja",JAPANESE_HIRAGANA:"name:ja-Hira",JAPANESE_KANA:"name:ja_kana",JAPANESE_LATIN:"name:ja_rm",JAPANESE_2018:"name:ja-Latn",KANNADA:"name:kn",KAZAKH:"name:kk",KOREAN:"name:ko",KOREAN_LATIN:"name:ko-Latn",KURDISH:"name:ku",ROMAN_LATIN:"name:la",LATVIAN:"name:lv",LITHUANIAN:"name:lt",LUXEMBOURGISH:"name:lb",MACEDONIAN:"name:mk",MALAYALAM:"name:ml",MALTESE:"name:mt",NORWEGIAN:"name:no",OCCITAN:"name:oc",PERSIAN:"name:fa",POLISH:"name:pl",PORTUGUESE:"name:pt",PUNJABI:"name:pa",WESTERN_PUNJABI:"name:pnb",ROMANIAN:"name:ro",ROMANSH:"name:rm",RUSSIAN:"name:ru",SCOTTISH_GAELIC:"name:gd",SERBIAN_CYRILLIC:"name:sr",SERBIAN_LATIN:"name:sr-Latn",SLOVAK:"name:sk",SLOVENE:"name:sl",SPANISH:"name:es",SWEDISH:"name:sv",TAMIL:"name:ta",TELUGU:"name:te",THAI:"name:th",TURKISH:"name:tr",UKRAINIAN:"name:uk",URDU:"name:ur",VIETNAMIAN_LATIN:"name:vi",WELSH:"name:cy"},Ut=new Set(Object.values(A));function ae(o){return Ut.has(o)}const Gt=new Set(Object.values(A));function ne(){if(typeof navigator>"u")return`name:${Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0]}`;const o=Array.from(new Set(navigator.languages.map(e=>`name:${e.split("-")[0]}`))).filter(e=>Gt.has(e));return o.length?o[0]:A.LOCAL}const M={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:A.STYLE,secondaryLanguage:A.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(M);const Se=At();class be extends dt{constructor(){super(...arguments),this.primaryLanguage=M.primaryLanguage,this.session=!0,this.caching=!0,this._unit="metric",this._apiKey=""}set unit(e){this._unit=e,this.emit("unit",e)}get unit(){return this._unit}set apiKey(e){this._apiKey=e,re.apiKey=e,this.emit("apiKey",e)}get apiKey(){return this._apiKey}set fetch(e){re.fetch=e}get fetch(){return re.fetch}}const R=new be,ie="localcache_source",le="localcache",Ht="maptiler_sdk",Dt=1e3,$t=100,se=typeof caches<"u";function jt(o,e){if(se&&R.caching&&R.session&&o.host===M.maptilerApiHost){if(e==="Source"&&o.href.includes("tiles.json"))return o.href.replace("https://",`${ie}://`);if(e==="Tile"||e==="Glyphs")return o.href.replace("https://",`${le}://`)}return o.href}let ce;async function Te(){return ce||(ce=await caches.open(Ht)),ce}let Ie=0;async function Vt(){const o=await Te(),e=await o.keys(),t=e.slice(0,Math.max(e.length-Dt,0));for(const r of t)o.delete(r)}function Wt(){we(ie,async(o,e)=>{if(!o.url)throw new Error("");o.url=o.url.replace(`${ie}://`,"https://");const t=o;t.signal=e.signal;const r=await fetch(o.url,t),a=await r.json();return a.tiles&&a.tiles.length>0&&(a.tiles[0]+=`&last-modified=${r.headers.get("Last-Modified")}`),{data:a,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires")}}),we(le,async(o,e)=>{if(!o.url)throw new Error("");o.url=o.url.replace(`${le}://`,"https://");const t=new URL(o.url),r=new URL(t);r.searchParams.delete("mtsid"),r.searchParams.delete("key");const a=r.toString(),n=new URL(t);n.searchParams.delete("last-modified");const i=n.toString(),l=async d=>({data:await d.arrayBuffer(),cacheControl:d.headers.get("Cache-Control"),expires:d.headers.get("Expires")}),u=await Te(),s=await u.match(a);if(s)return l(s);const c=o;c.signal=e.signal;const p=await fetch(i,c);return p.status>=200&&p.status<300&&(u.put(a,p.clone()).catch(()=>{}),++Ie>$t&&(Vt(),Ie=0)),l(p)})}function Kt(){if(typeof window>"u")return;const o=C.getRTLTextPluginStatus();if(o==="unavailable"||o==="requested")try{C.setRTLTextPlugin(M.rtlPluginURL,!0)}catch{}}function Zt(o,e){for(const t of o)typeof e[t]=="function"&&(e[t]=e[t].bind(e))}function U(o,e,t){const r=window.document.createElement(o);return e!==void 0&&(r.className=e),t&&t.appendChild(r),r}function Ee(o){o.parentNode&&o.parentNode.removeChild(o)}function Re(o,e){let t=null;try{t=new URL(o)}catch{return{url:o}}return t.host===M.maptilerApiHost&&(t.searchParams.has("key")||t.searchParams.append("key",R.apiKey),R.session&&t.searchParams.append("mtsid",Se)),{url:jt(t,e)}}function xe(o){return(e,t)=>{if(o!=null){const r=o(e,t),a=Re(r?.url??"",t);return{...r,...a}}return Re(e,t)}}function Ne(){return Math.random().toString(36).substring(2)}function q(o){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(o)}function Yt(o){try{return JSON.parse(o)}catch{}return null}function qt(){return document.createElement("canvas").getContext("webgl2")?null:typeof WebGL2RenderingContext<"u"?"Graphic rendering with WebGL2 has been disabled or is not supported by your graphic card. The map cannot be displayed.":"Your browser does not support graphic rendering with WebGL2. The map cannot be displayed."}function Jt(o){const e=qt();if(!e)return;let t=null;if(typeof o=="string"?t=document.getElementById(o):o instanceof HTMLElement&&(t=o),!t)throw new Error("The Map container must be provided.");const r=document.createElement("div");throw r.innerHTML=e,r.classList.add("no-webgl-support-div"),t.appendChild(r),new Error(e)}class Xt extends C.Marker{addTo(e){return super.addTo(e)}}class Qt extends C.Popup{addTo(e){return super.addTo(e)}}class eo extends C.Style{constructor(e,t={}){super(e,t)}}class to extends C.CanvasSource{onAdd(e){super.onAdd(e)}}class oo extends C.GeoJSONSource{onAdd(e){super.onAdd(e)}}class ro extends C.ImageSource{onAdd(e){super.onAdd(e)}}class ao extends C.RasterTileSource{onAdd(e){super.onAdd(e)}}class no extends C.RasterDEMTileSource{onAdd(e){super.onAdd(e)}}class io extends C.VectorTileSource{onAdd(e){super.onAdd(e)}}class lo extends C.VideoSource{onAdd(e){super.onAdd(e)}}class _e extends C.NavigationControl{onAdd(e){return super.onAdd(e)}}class Me extends C.GeolocateControl{onAdd(e){return super.onAdd(e)}}class so extends C.AttributionControl{onAdd(e){return super.onAdd(e)}}class Pe extends C.LogoControl{onAdd(e){return super.onAdd(e)}}class Oe extends C.ScaleControl{onAdd(e){return super.onAdd(e)}}class ke extends C.FullscreenControl{onAdd(e){return super.onAdd(e)}}class co extends C.TerrainControl{onAdd(e){return super.onAdd(e)}}class uo extends C.BoxZoomHandler{constructor(e,t){super(e,t)}}class po extends C.ScrollZoomHandler{constructor(e,t){super(e,t)}}class ho extends C.CooperativeGesturesHandler{constructor(e,t){super(e,t)}}class mo extends C.KeyboardHandler{constructor(e){super(e)}}class go extends C.TwoFingersTouchPitchHandler{constructor(e){super(e)}}class yo extends C.MapWheelEvent{constructor(e,t,r){super(e,t,r)}}class vo extends C.MapTouchEvent{constructor(e,t,r){super(e,t,r)}}class fo extends C.MapMouseEvent{constructor(e,t,r,a={}){super(e,t,r,a)}}class ue extends Pe{constructor(e={}){super(e),this.logoURL="",this.linkURL="",this.logoURL=e.logoURL??M.maptilerLogoURL,this.linkURL=e.linkURL??M.maptilerURL}onAdd(e){this._map=e,this._compact=this.options.compact??!1,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const t=window.document.createElement("a");return t.style.backgroundRepeat="no-repeat",t.style.cursor="pointer",t.style.display="block",t.style.height="23px",t.style.margin="0 0 -4px -4px",t.style.overflow="hidden",t.style.width="88px",t.style.backgroundImage=`url(${this.logoURL})`,t.style.backgroundSize="100px 30px",t.style.width="100px",t.style.height="30px",t.target="_blank",t.rel="noopener",t.href=this.linkURL,t.setAttribute("aria-label","MapTiler logo"),t.setAttribute("rel","noopener"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}function Fe(o){return o?typeof o=="string"||o instanceof String?!o.startsWith("http")&&o.toLowerCase().includes(".json")?o:gt(o):o instanceof yt?o.getExpandedStyleURL():o instanceof vt?o.getDefaultVariant().getExpandedStyleURL():o:ft[Lt[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL()}class ze{constructor(){Zt(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(e){return this._map=e,this._container=U("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=U("button","maplibregl-ctrl-terrain",this._container),U("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Ee(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.hasTerrain()?this._map.disableTerrain():this._map.enableTerrain(),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.hasTerrain()?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))}}class Be extends _e{constructor(){super({showCompass:!0,showZoom:!0,visualizePitch:!0}),this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.cos(this._map.transform.pitch*(Math.PI/180))**.5)}) rotateX(${Math.min(70,this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",e=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})}_createButton(e,t){const r=super._createButton(e,t);return r.clickFunction=t,r}}const Ue=C.Marker,Ge=C.LngLat,Lo=C.LngLatBounds;class He extends Me{constructor(){super(...arguments),this.lastUpdatedCenter=new Ge(0,0),this._updateCamera=e=>{const t=new Ge(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,a={bearing:this._map.getBearing(),...this.options.fitBoundsOptions,linear:!0},n=this._map.getZoom();n>(this.options?.fitBoundsOptions?.maxZoom??30)&&(a.zoom=n),this._map.fitBounds(Lo.fromLngLat(t,r),a,{geolocateSource:!0});let i=!1;const l=()=>{i=!0};this._map.once("click",l),this._map.once("dblclick",l),this._map.once("dragstart",l),this._map.once("mousedown",l),this._map.once("touchstart",l),this._map.once("wheel",l),this._map.once("moveend",()=>{this._map.off("click",l),this._map.off("dblclick",l),this._map.off("dragstart",l),this._map.off("mousedown",l),this._map.off("touchstart",l),this._map.off("wheel",l),!i&&(this.lastUpdatedCenter=this._map.getCenter())})},this._setupUI=e=>{if(this.lastUpdatedCenter=this._map.getCenter(),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=U("button","maplibregl-ctrl-geolocate",this._container),U("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",e===!1){const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=U("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ue({element:this._dotElement}),this._circleElement=U("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ue({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",t=>{const r=t.originalEvent&&t.originalEvent.type==="resize",a=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!t.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!r&&a>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const e=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],t=this._map.project(e),r=this._map.unproject([t.x,t.y]),a=this._map.unproject([t.x+20,t.y]),n=r.distanceTo(a)/20,i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}}var De=o=>{throw TypeError(o)},pe=(o,e,t)=>e.has(o)||De("Cannot "+t),f=(o,e,t)=>(pe(o,e,"read from private field"),t?t.call(o):e.get(o)),G=(o,e,t)=>e.has(o)?De("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),W=(o,e,t,r)=>(pe(o,e,"write to private field"),e.set(o,t),t),P=(o,e,t)=>(pe(o,e,"access private method"),t),O,B,D,$e,$,k,J,_,je,F,Ve;class he{constructor(e,t){G(this,_),G(this,O),G(this,B),G(this,D),G(this,$e),G(this,$),G(this,k,!1),G(this,J),e.style!==void 0&&W(this,k,!0),W(this,O,{zoomAdjust:-4,position:"top-right",...t,forceNoAttributionControl:!0,attributionControl:!1,navigationControl:!1,geolocateControl:!1,maptilerLogo:!1,minimap:!1,hash:!1,pitchAdjust:!1,...e,containerStyle:{border:"1px solid #000",width:"400px",height:"300px",...e.containerStyle??{}}}),e.lockZoom!==void 0&&(f(this,O).minZoom=e.lockZoom,f(this,O).maxZoom=e.lockZoom)}setStyle(e,t){f(this,k)||this.map.setStyle(e,t),P(this,_,F).call(this)}addLayer(e,t){return f(this,k)||this.map.addLayer(e,t),P(this,_,F).call(this),this.map}moveLayer(e,t){return f(this,k)||this.map.moveLayer(e,t),P(this,_,F).call(this),this.map}removeLayer(e){return f(this,k)||this.map.removeLayer(e),P(this,_,F).call(this),this}setLayerZoomRange(e,t,r){return f(this,k)||this.map.setLayerZoomRange(e,t,r),P(this,_,F).call(this),this}setFilter(e,t,r){return f(this,k)||this.map.setFilter(e,t,r),P(this,_,F).call(this),this}setPaintProperty(e,t,r,a){return f(this,k)||this.map.setPaintProperty(e,t,r,a),P(this,_,F).call(this),this}setLayoutProperty(e,t,r,a){return f(this,k)||this.map.setLayoutProperty(e,t,r,a),P(this,_,F).call(this),this}setGlyphs(e,t){return f(this,k)||this.map.setGlyphs(e,t),P(this,_,F).call(this),this}onAdd(e){W(this,B,e),W(this,D,U("div","maplibregl-ctrl maplibregl-ctrl-group"));for(const[t,r]of Object.entries(f(this,O).containerStyle))f(this,D).style.setProperty(t,r);return f(this,O).container=f(this,D),f(this,O).zoom=e.getZoom()+f(this,O).zoomAdjust,this.map=new Ke(f(this,O)),this.map.once("style.load",()=>{this.map.resize()}),this.map.once("load",()=>{P(this,_,je).call(this,f(this,O).parentRect),W(this,J,P(this,_,Ve).call(this))}),f(this,D)}onRemove(){var e;(e=f(this,J))==null||e.call(this),Ee(f(this,D))}}O=new WeakMap,B=new WeakMap,D=new WeakMap,$e=new WeakMap,$=new WeakMap,k=new WeakMap,J=new WeakMap,_=new WeakSet,je=function(o){o===void 0||o.linePaint===void 0&&o.fillPaint===void 0||(W(this,$,{type:"Feature",properties:{name:"parentRect"},geometry:{type:"Polygon",coordinates:[[[],[],[],[],[]]]}}),this.map.addSource("parentRect",{type:"geojson",data:f(this,$)}),(o.lineLayout!==void 0||o.linePaint!==void 0)&&this.map.addLayer({id:"parentRectOutline",type:"line",source:"parentRect",layout:{...o.lineLayout},paint:{"line-color":"#FFF","line-width":1,"line-opacity":.85,...o.linePaint}}),o.fillPaint!==void 0&&this.map.addLayer({id:"parentRectFill",type:"fill",source:"parentRect",layout:{},paint:{"fill-color":"#08F","fill-opacity":.135,...o.fillPaint}}),P(this,_,F).call(this))},F=function(){if(f(this,$)===void 0)return;const{devicePixelRatio:o}=window,e=f(this,B).getCanvas(),t=e.width/o,r=e.height/o,a=f(this,B).unproject.bind(f(this,B)),n=a([0,0]),i=a([t,0]),l=a([0,r]),u=a([t,r]);f(this,$).geometry.coordinates=[[l.toArray(),u.toArray(),i.toArray(),n.toArray(),l.toArray()]],this.map.getSource("parentRect").setData(f(this,$))},Ve=function(){const{pitchAdjust:o}=f(this,O),e=()=>{n("parent")},t=()=>{n("minimap")},r=()=>{f(this,B).on("move",e),this.map.on("move",t)},a=()=>{f(this,B).off("move",e),this.map.off("move",t)},n=i=>{a();const l=i==="parent"?f(this,B):this.map,u=i==="parent"?this.map:f(this,B),s=l.getCenter(),c=l.getZoom()+(f(this,O).zoomAdjust??-4)*(i==="parent"?1:-1),p=l.getBearing(),d=l.getPitch();u.jumpTo({center:s,zoom:c,bearing:p,pitch:o?d:0}),P(this,_,F).call(this),r()};return r(),()=>{a()}};const We={POINT:"POINT",COUNTRY:"COUNTRY"};class Ke extends C.Map{constructor(e){Jt(e.container),e.apiKey&&(R.apiKey=e.apiKey);const t=Fe(e.style),r=location.hash;R.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");let a={compact:!1};e.customAttribution?a.customAttribution=e.customAttribution:e.attributionControl&&typeof e.attributionControl=="object"&&(a={...a,...e.attributionControl}),super({...e,style:t,maplibreLogo:!1,transformRequest:xe(e.transformRequest),attributionControl:e.forceNoAttributionControl===!0?!1:a}),this.isTerrainEnabled=!1,this.terrainExaggeration=1,this.terrainGrowing=!1,this.terrainFlattening=!1,this.isReady=!1,R.caching&&!se&&console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"),R.caching&&se&&Wt(),this.primaryLanguage=e.language??R.primaryLanguage,this.forceLanguageUpdate=!(this.primaryLanguage===A.STYLE||this.primaryLanguage===A.STYLE_LOCK),this.languageAlwaysBeenStyle=this.primaryLanguage===A.STYLE,this.terrainExaggeration=e.terrainExaggeration??this.terrainExaggeration,this.once("styledata",async()=>{if(!e.geolocate||e.center||e.hash&&r)return;try{if(e.geolocate===We.COUNTRY){await this.fitToIpBounds();return}}catch(c){console.warn(c.message)}let s;try{await this.centerOnIpPoint(e.zoom),s=this.getCameraHash()}catch(c){console.warn(c.message)}(await navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(c=>{s===this.getCameraHash()&&(this.terrain?this.easeTo({center:[c.coords.longitude,c.coords.latitude],zoom:e.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[c.coords.longitude,c.coords.latitude],zoom:e.zoom||12,duration:2e3})}))},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})}),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",async()=>{let s={logo:null};try{const c=Object.keys(this.style.sourceCaches).map(d=>this.getSource(d)).filter(d=>d&&"url"in d&&typeof d.url=="string"&&d?.url.includes("tiles.json")),p=new URL(c[0].url);p.searchParams.has("key")||p.searchParams.append("key",R.apiKey),s=await(await fetch(p.href)).json()}catch{}if(e.forceNoAttributionControl!==!0)if("logo"in s&&s.logo){const c=s.logo;this.addControl(new ue({logoURL:c}),e.logoPosition)}else e.maptilerLogo&&this.addControl(new ue,e.logoPosition);if(e.scaleControl){const c=e.scaleControl===!0||e.scaleControl===void 0?"bottom-right":e.scaleControl,p=new Oe({unit:R.unit});this.addControl(p,c),R.on("unit",d=>{p.setUnit(d)})}if(e.navigationControl!==!1){const c=e.navigationControl===!0||e.navigationControl===void 0?"top-right":e.navigationControl;this.addControl(new Be,c)}if(e.geolocateControl!==!1){const c=e.geolocateControl===!0||e.geolocateControl===void 0?"top-right":e.geolocateControl;this.addControl(new He({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),c)}if(e.terrainControl){const c=e.terrainControl===!0||e.terrainControl===void 0?"top-right":e.terrainControl;this.addControl(new ze,c)}if(e.fullscreenControl){const c=e.fullscreenControl===!0||e.fullscreenControl===void 0?"top-right":e.fullscreenControl;this.addControl(new ke({}),c)}this.isReady=!0,this.fire("ready",{target:this})});let n=!1,i=!1,l;this.once("ready",()=>{n=!0,i&&this.fire("loadWithTerrain",l)}),this.once("style.load",()=>{const{minimap:s}=e;if(typeof s=="object"){const{zoom:c,center:p,style:d,language:y,apiKey:v,maptilerLogo:g,antialias:w,refreshExpiredTiles:N,maxBounds:L,scrollZoom:I,minZoom:E,maxZoom:T,boxZoom:z,locale:H,fadeDuration:K,crossSourceCollisions:Z,clickTolerance:Y,bounds:ut,fitBoundsOptions:pt,pixelRatio:ht,validateStyle:mt}=e;this.minimap=new he(s,{zoom:c,center:p,style:d,language:y,apiKey:v,container:"null",maptilerLogo:g,antialias:w,refreshExpiredTiles:N,maxBounds:L,scrollZoom:I,minZoom:E,maxZoom:T,boxZoom:z,locale:H,fadeDuration:K,crossSourceCollisions:Z,clickTolerance:Y,bounds:ut,fitBoundsOptions:pt,pixelRatio:ht,validateStyle:mt}),this.addControl(this.minimap,s.position??"bottom-left")}else s===!0?(this.minimap=new he({},e),this.addControl(this.minimap,"bottom-left")):s!==void 0&&s!==!1&&(this.minimap=new he({},e),this.addControl(this.minimap,s))});const u=s=>{s.terrain&&(i=!0,l={type:"loadWithTerrain",target:this,terrain:s.terrain},this.off("terrain",u),n&&this.fire("loadWithTerrain",l))};this.on("terrain",u),e.terrain&&this.enableTerrain(e.terrainExaggeration??this.terrainExaggeration)}async onLoadAsync(){return new Promise(e=>{if(this.loaded())return e(this);this.once("load",()=>{e(this)})})}async onReadyAsync(){return new Promise(e=>{if(this.isReady)return e(this);this.once("ready",()=>{e(this)})})}async onLoadWithTerrainAsync(){return new Promise(e=>{if(this.isReady&&this.terrain)return e(this);this.once("loadWithTerrain",()=>{e(this)})})}setStyle(e,t){return this.minimap?.setStyle(e),this.forceLanguageUpdate=!0,this.once("idle",()=>{this.forceLanguageUpdate=!1}),super.setStyle(Fe(e),t)}addLayer(e,t){return this.minimap?.addLayer(e,t),super.addLayer(e,t)}moveLayer(e,t){return this.minimap?.moveLayer(e,t),super.moveLayer(e,t)}removeLayer(e){return this.minimap?.removeLayer(e),super.removeLayer(e)}setLayerZoomRange(e,t,r){return this.minimap?.setLayerZoomRange(e,t,r),super.setLayerZoomRange(e,t,r)}setFilter(e,t,r){return this.minimap?.setFilter(e,t,r),super.setFilter(e,t,r)}setPaintProperty(e,t,r,a){return this.minimap?.setPaintProperty(e,t,r,a),super.setPaintProperty(e,t,r,a)}setLayoutProperty(e,t,r,a){return this.minimap?.setLayoutProperty(e,t,r,a),super.setLayoutProperty(e,t,r,a)}setGlyphs(e,t){return this.minimap?.setGlyphs(e,t),super.setGlyphs(e,t)}getStyleLanguage(){return!this.style.stylesheet.metadata||typeof this.style.stylesheet.metadata!="object"?null:"maptiler:language"in this.style.stylesheet.metadata&&typeof this.style.stylesheet.metadata["maptiler:language"]=="string"?this.style.stylesheet.metadata["maptiler:language"]:null}setLanguage(e){this.minimap?.map?.setLanguage(e),this.onStyleReady(()=>{this.setPrimaryLanguage(e)})}setPrimaryLanguage(e){const t=this.getStyleLanguage();if(!(e===A.STYLE&&(t===A.AUTO||t===A.VISITOR))&&(e!==A.STYLE&&(this.languageAlwaysBeenStyle=!1),this.languageAlwaysBeenStyle||this.primaryLanguage===e&&!this.forceLanguageUpdate))return;if(!ae(e)){console.warn(`The language "${e}" is not supported.`);return}if(this.primaryLanguage===A.STYLE_LOCK){console.warn("The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag.");return}this.primaryLanguage=e;let r=e;if(e===A.STYLE){if(!t){console.warn("The style has no default languages.");return}if(!ae(t)){console.warn("The language defined in the style is not valid.");return}r=t}let a=A.LOCAL,n=`{${a}}`;r===A.VISITOR?(a=ne(),n=["case",["all",["has",a],["has",A.LOCAL]],["case",["==",["get",a],["get",A.LOCAL]],["get",A.LOCAL],["format",["get",a],{"font-scale":.8},`
2
+ `,["get",A.LOCAL],{"font-scale":1.1}]],["get",A.LOCAL]]):r===A.VISITOR_ENGLISH?(a=A.ENGLISH,n=["case",["all",["has",a],["has",A.LOCAL]],["case",["==",["get",a],["get",A.LOCAL]],["get",A.LOCAL],["format",["get",a],{"font-scale":.8},`
3
+ `,["get",A.LOCAL],{"font-scale":1.1}]],["get",A.LOCAL]]):r===A.AUTO?(a=ne(),n=["case",["has",a],["get",a],["get",A.LOCAL]]):r===A.LOCAL?(a=A.LOCAL,n=`{${a}}`):(a=r,n=["case",["has",a],["get",a],["get",A.LOCAL]]);const{layers:i}=this.getStyle();for(const l of i){if(l.type!=="symbol")continue;const u=l,s=this.getSource(u.source);if(!s||!("url"in s&&typeof s.url=="string")||new URL(s.url).host!==M.maptilerApiHost)continue;const{id:c,layout:p}=u;if(!p||!("text-field"in p))continue;const d=this.getLayoutProperty(c,"text-field");typeof d=="string"&&(d.toLowerCase().includes("ref")||d.toLowerCase().includes("housenumber"))||this.setLayoutProperty(c,"text-field",n)}}getPrimaryLanguage(){return this.primaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(e,t=1e3){if(!this.terrain)return;const r=performance.now(),a=this.terrain.exaggeration,n=e-a,i=()=>{if(!this.terrain||this.terrainFlattening)return;const l=(performance.now()-r)/t;if(l<.99){const u=1-(1-l)**4,s=a+u*n;this.terrain.exaggeration=s,requestAnimationFrame(i)}else this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=e;this.triggerRepaint()};this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame(i)}enableTerrain(e=this.terrainExaggeration){if(e<0){console.warn("Terrain exaggeration cannot be negative.");return}const t=async a=>{!this.terrain||a.type!=="data"||a.dataType!=="source"||!("source"in a)||a.sourceId!=="maptiler-terrain"||a.source.type!=="raster-dem"||a.isSourceLoaded&&(this.off("data",t),this.growTerrain(e))},r=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=e,this.on("data",t),this.addSource(M.terrainSourceId,{type:"raster-dem",url:M.terrainSourceURL}),this.setTerrain({source:M.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(e);return}this.loaded()||this.isTerrainEnabled?r():this.once("load",()=>{this.getTerrain()&&this.getSource(M.terrainSourceId)||r()})}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;const e=1*1e3,t=performance.now(),r=this.terrain.exaggeration,a=()=>{if(!this.terrain||this.terrainGrowing)return;const n=(performance.now()-t)/e;if(n<.99){const i=(1-n)**4,l=r*i;this.terrain.exaggeration=l,requestAnimationFrame(a)}else this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(),this.getSource(M.terrainSourceId)&&this.removeSource(M.terrainSourceId);this.triggerRepaint()};this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(a)}setTerrainExaggeration(e,t=!0){!t&&this.terrain?(this.terrainExaggeration=e,this.terrain.exaggeration=e,this.triggerRepaint()):this.enableTerrain(e)}onStyleReady(e){this.isStyleLoaded()?e():this.once("styledata",()=>{e()})}async fitToIpBounds(){const e=await Ce.info();this.fitBounds(e.country_bounds,{duration:0,padding:100})}async centerOnIpPoint(e){const t=await Ce.info();this.jumpTo({center:[t?.longitude??0,t?.latitude??0],zoom:e||11})}getCameraHash(){const e=new Float32Array(5),t=this.getCenter();return e[0]=t.lng,e[1]=t.lat,e[2]=this.getZoom(),e[3]=this.getPitch(),e[4]=this.getBearing(),wt.fromUint8Array(new Uint8Array(e.buffer))}getSdkConfig(){return R}getMaptilerSessionId(){return Se}setTransformRequest(e){return super.setTransformRequest(xe(e)),this}}function X(o){if(typeof DOMParser<"u"){const e=new DOMParser().parseFromString(o,"application/xml");if(e.querySelector("parsererror"))throw new Error("The provided string is not valid XML");return e}throw new Error("No XML parser found")}function me(o,e){if(!o.hasChildNodes())return!1;for(const t of Array.from(o.childNodes)){const r=t.nodeName;if(typeof r=="string"&&r.trim().toLowerCase()===e.toLowerCase())return!0}return!1}function de(o){if(typeof XMLSerializer<"u")return new XMLSerializer().serializeToString(o);throw new Error("No XML serializer found")}function ge(o){const e=typeof o=="string"?X(o):o;if(!me(e,"gpx"))throw new Error("The XML document is not valid GPX");const t=x(e,"trk"),r=x(e,"rte"),a=x(e,"wpt"),n={type:"FeatureCollection",features:[]};for(const i of Array.from(t)){const l=So(i);l&&n.features.push(l)}for(const i of Array.from(r)){const l=bo(i);l&&n.features.push(l)}for(const i of Array.from(a))n.features.push(To(i));return n}function ye(o,e){let t=o;if(typeof t=="string"&&(t=X(t)),!me(t,"kml"))throw new Error("The XML document is not valid KML");const r={type:"FeatureCollection",features:[]},a={},n={},i={},l=x(t,"Placemark"),u=x(t,"Style"),s=x(t,"StyleMap");for(const c of Array.from(u)){const p=Je(e!==void 0?e(c):de(c)).toString(16);a[`#${j(c,"id")}`]=p,n[p]=c}for(const c of Array.from(s)){a[`#${j(c,"id")}`]=Je(e!==void 0?e(c):de(c)).toString(16);const p=x(c,"Pair"),d={};for(const y of Array.from(p))d[S(m(y,"key"))??""]=S(m(y,"styleUrl"));i[`#${j(c,"id")}`]=d}for(const c of Array.from(l))r.features=r.features.concat(Co(c,a,n,i));return r}function Ze(o){if(o===null)return["#000000",1];let e="",t=1,r=o;return r.substring(0,1)==="#"&&(r=r.substring(1)),(r.length===6||r.length===3)&&(e=r),r.length===8&&(t=Number.parseInt(r.substring(0,2),16)/255,e=`#${r.substring(6,8)}${r.substring(4,6)}${r.substring(2,4)}`),[e??"#000000",t??1]}function Ao(o){return Qe(o.split(" "))}function wo(o){let e=x(o,"coord");const t=[],r=[];e.length===0&&(e=x(o,"gx:coord"));for(const n of Array.from(e))t.push(Ao(S(n)??""));const a=x(o,"when");for(const n of Array.from(a))r.push(S(n));return{coords:t,times:r}}function Q(o){const e=["Polygon","LineString","Point","Track","gx:Track"];let t,r,a,n,i;const l=[],u=[];if(m(o,"MultiGeometry")!==null)return Q(m(o,"MultiGeometry"));if(m(o,"MultiTrack")!==null)return Q(m(o,"MultiTrack"));if(m(o,"gx:MultiTrack")!==null)return Q(m(o,"gx:MultiTrack"));for(a=0;a<e.length;a++)if(r=x(o,e[a]),r){for(n=0;n<r.length;n++)if(t=r[n],e[a]==="Point")l.push({type:"Point",coordinates:et(S(m(t,"coordinates"))??"")});else if(e[a]==="LineString")l.push({type:"LineString",coordinates:tt(S(m(t,"coordinates"))??"")});else if(e[a]==="Polygon"){const s=x(t,"LinearRing"),c=[];for(i=0;i<s.length;i++)c.push(tt(S(m(s[i],"coordinates"))??""));l.push({type:"Polygon",coordinates:c})}else if(e[a]==="Track"||e[a]==="gx:Track"){const s=wo(t);l.push({type:"LineString",coordinates:s.coords}),s.times.length&&u.push(s.times)}}return{geoms:l,coordTimes:u}}function Co(o,e,t,r){const a=Q(o),n={},i=S(m(o,"name")),l=S(m(o,"address")),u=S(m(o,"description")),s=m(o,"TimeSpan"),c=m(o,"TimeStamp"),p=m(o,"ExtendedData"),d=m(o,"visibility");let y,v=S(m(o,"styleUrl")),g=m(o,"LineStyle"),w=m(o,"PolyStyle");if(!a.geoms.length)return[];if(i&&(n.name=i),l&&(n.address=l),v){v[0]!=="#"&&(v=`#${v}`),n.styleUrl=v,e[v]&&(n.styleHash=e[v]),r[v]&&(n.styleMapHash=r[v],n.styleHash=e[r[v].normal??""]);const L=t[n.styleHash??""];if(L){g||(g=m(L,"LineStyle")),w||(w=m(L,"PolyStyle"));const I=m(L,"IconStyle");if(I){const E=m(I,"Icon");if(E){const T=S(m(E,"href"));T&&(n.icon=T)}}}}if(u&&(n.description=u),s){const L=S(m(s,"begin")),I=S(m(s,"end"));L&&I&&(n.timespan={begin:L,end:I})}if(c!==null&&(n.timestamp=S(m(c,"when"))??new Date().toISOString()),g!==null){const L=Ze(S(m(g,"color"))),I=L[0],E=L[1],T=Number.parseFloat(S(m(g,"width"))??"");I&&(n.stroke=I),Number.isNaN(E)||(n["stroke-opacity"]=E),Number.isNaN(T)||(n["stroke-width"]=T)}if(w){const L=Ze(S(m(w,"color"))),I=L[0],E=L[1],T=S(m(w,"fill")),z=S(m(w,"outline"));I&&(n.fill=I),Number.isNaN(E)||(n["fill-opacity"]=E),T&&(n["fill-opacity"]=T==="1"?n["fill-opacity"]||1:0),z&&(n["stroke-opacity"]=z==="1"?n["stroke-opacity"]||1:0)}if(p){const L=x(p,"Data"),I=x(p,"SimpleData");for(y=0;y<L.length;y++)n[L[y].getAttribute("name")??""]=S(m(L[y],"value"))??"";for(y=0;y<I.length;y++)n[I[y].getAttribute("name")??""]=S(I[y])??""}d!==null&&(n.visibility=S(d)??""),a.coordTimes.length!==0&&(n.coordTimes=a.coordTimes.length===1?a.coordTimes[0]:a.coordTimes);const N={type:"Feature",geometry:a.geoms.length===1?a.geoms[0]:{type:"GeometryCollection",geometries:a.geoms},properties:n};return j(o,"id")&&(N.id=j(o,"id")??void 0),[N]}function Ye(o,e){const t=x(o,e),r=[],a=[];let n=[];const i=t.length;if(!(i<2)){for(let l=0;l<i;l++){const u=ot(t[l]);r.push(u.coordinates),u.time&&a.push(u.time),(u.heartRate||n.length)&&(n.length===0&&(n=new Array(l).fill(null)),n.push(u.heartRate))}return{line:r,times:a,heartRates:n}}}function So(o){const e=x(o,"trkseg"),t=[],r=[],a=[];let n;for(let l=0;l<e.length;l++)if(n=Ye(e[l],"trkpt"),n!==void 0&&(n.line&&t.push(n.line),n.times&&n.times.length&&r.push(n.times),a.length||n.heartRates&&n.heartRates.length)){if(!a.length)for(let u=0;u<l;u++)a.push(new Array(t[u].length).fill(null));n.heartRates&&n.heartRates.length?a.push(n.heartRates):a.push(new Array(n.line.length).fill(null))}if(t.length===0)return;const i={...ve(o),...qe(m(o,"extensions"))};return r.length!==0&&(i.coordTimes=t.length===1?r[0]:r),a.length!==0&&(i.heartRates=t.length===1?a[0]:a),t.length===1?{type:"Feature",properties:i,geometry:{type:"LineString",coordinates:t[0]}}:{type:"Feature",properties:i,geometry:{type:"MultiLineString",coordinates:t}}}function bo(o){const e=Ye(o,"rtept");return e===void 0?void 0:{type:"Feature",properties:{...ve(o),...qe(m(o,"extensions"))},geometry:{type:"LineString",coordinates:e.line}}}function To(o){return{type:"Feature",properties:{...ve(o),...fe(o,["sym"])},geometry:{type:"Point",coordinates:ot(o).coordinates}}}function qe(o){const e={};if(o){const t=m(o,"line");if(t){const r=S(m(t,"color")),a=Number.parseFloat(S(m(t,"opacity"))??"0"),n=Number.parseFloat(S(m(t,"width"))??"0");r&&(e.stroke=r),Number.isNaN(a)||(e["stroke-opacity"]=a),Number.isNaN(n)||(e["stroke-width"]=n*96/25.4)}}return e}function ve(o){const e=fe(o,["name","cmt","desc","type","time","keywords"]),t=x(o,"link");if(t.length!==0){e.links=[];for(const r of Array.from(t)){const a={href:j(r,"href"),...fe(r,["text","type"])};e.links.push(a)}}return e}function Je(o){let e=0;if(!o||!o.length)return e;for(let t=0;t<o.length;t++)e=(e<<5)-e+o.charCodeAt(t)|0;return e}function x(o,e){return o.getElementsByTagName(e)}function j(o,e){return o.getAttribute(e)}function Xe(o,e){return Number.parseFloat(j(o,e)??"0")}function m(o,e){const t=x(o,e);return t.length?t[0]:null}function Io(o){return o.normalize&&o.normalize(),o}function Qe(o){return o.map(Number.parseFloat).map(e=>Number.isNaN(e)?null:e)}function S(o){return o&&Io(o),o&&o.textContent}function fe(o,e){const t={};let r,a;for(a=0;a<e.length;a++)r=m(o,e[a]),r&&(t[e[a]]=S(r)??"");return t}function et(o){return Qe(o.replace(/\s*/g,"").split(","))}function tt(o){const e=o.replace(/^\s*|\s*$/g,"").split(/\s+/),t=[];for(const r of e)t.push(et(r));return t}function ot(o){const e=[Xe(o,"lon"),Xe(o,"lat")],t=m(o,"ele"),r=m(o,"gpxtpx:hr")||m(o,"hr"),a=m(o,"time");let n;return t&&(n=Number.parseFloat(S(t)??"0"),Number.isNaN(n)||e.push(n)),{coordinates:e,time:a?S(a):null,heartRate:r!==null?Number.parseFloat(S(r)??"0"):null}}function rt(o){let e=o;try{typeof e=="string"&&(e=X(e))}catch{return null}try{return ge(e)}catch{}try{return ye(e)}catch{}return null}function ee(o){const e=o.toString(16);return e.length===1?`0${e}`:e}function Eo(o){return`#${ee(o[0])}${ee(o[1])}${ee(o[2])}${o.length===4?ee(o[3]):""}`}class h extends Array{constructor(e={}){super(),this.min=0,this.max=1,"min"in e&&(this.min=e.min),"max"in e&&(this.max=e.max),"stops"in e&&this.setStops(e.stops,{clone:!1})}static fromArrayDefinition(e){return new h({stops:e.map(t=>({value:t[0],color:t[1]}))})}setStops(e,t={clone:!0}){const r=t.clone?this.clone():this;r.length=0;let a=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(let i=0;i<e.length;i+=1)a=Math.min(a,e[i].value),n=Math.max(n,e[i].value),r.push({value:e[i].value,color:e[i].color.slice()});return r.sort((i,l)=>i.value<l.value?-1:1),this.min=a,this.max=n,r}scale(e,t,r={clone:!0}){const a=r.clone,n=this[0].value,i=this.at(-1).value-n,l=t-e,u=[];for(let s=0;s<this.length;s+=1){const c=(this[s].value-n)/i*l+e;a?u.push({value:c,color:this[s].color.slice()}):this[s].value=c}return a?new h({stops:u}):this}at(e){return e<0?this[this.length+e]:this[e]}clone(){return new h({stops:this.getRawColorStops()})}getRawColorStops(){const e=[];for(let t=0;t<this.length;t+=1)e.push({value:this[t].value,color:this[t].color});return e}reverse(e={clone:!0}){const t=e.clone?this.clone():this;for(let r=0;r<~~(t.length/2);r+=1){const a=t[r].color;t[r].color=t.at(-(r+1)).color,t.at(-(r+1)).color=a}return t}getBounds(){return{min:this.min,max:this.max}}getColor(e,t={smooth:!0}){if(e<=this[0].value)return this[0].color;if(e>=this.at(-1).value)return this.at(-1).color;for(let r=0;r<this.length-1;r+=1){if(e>this[r+1].value)continue;const a=this[r].color;if(!t.smooth)return a.slice();const n=this[r].value,i=this[r+1].value,l=this[r+1].color,u=(i-e)/(i-n);return a.map((s,c)=>Math.round(s*u+l[c]*(1-u)))}return[0,0,0]}getColorHex(e,t={smooth:!0,withAlpha:!1}){return Eo(this.getColor(e,t))}getColorRelative(e,t={smooth:!0}){const r=this.getBounds();return this.getColor(r.min+e*(r.max-r.min),t)}getCanvasStrip(e={horizontal:!0,size:512,smooth:!0}){const t=document.createElement("canvas");t.width=e.horizontal?e.size:1,t.height=e.horizontal?1:e.size;const r=t.getContext("2d");if(!r)throw new Error("Canvs context is missing");const a=r.getImageData(0,0,t.width,t.height),n=a.data,i=e.size,l=this[0].value,u=(this.at(-1).value-l)/i;for(let s=0;s<i;s+=1){const c=this.getColor(l+s*u,{smooth:e.smooth});n[s*4]=c[0],n[s*4+1]=c[1],n[s*4+2]=c[2],n[s*4+3]=c.length>3?c[3]:255}return r.putImageData(a,0,0),t}resample(e,t=15){const r=this.getBounds(),a=this.scale(0,1),n=1/(t-1);let i;if(e==="ease-in-square")i=Array.from({length:t},(l,u)=>{const s=u*n,c=s**2,p=a.getColor(c);return{value:s,color:p}});else if(e==="ease-out-square")i=Array.from({length:t},(l,u)=>{const s=u*n,c=1-(1-s)**2,p=a.getColor(c);return{value:s,color:p}});else if(e==="ease-out-sqrt")i=Array.from({length:t},(l,u)=>{const s=u*n,c=s**.5,p=a.getColor(c);return{value:s,color:p}});else if(e==="ease-in-sqrt")i=Array.from({length:t},(l,u)=>{const s=u*n,c=1-(1-s)**.5,p=a.getColor(c);return{value:s,color:p}});else if(e==="ease-out-exp")i=Array.from({length:t},(l,u)=>{const s=u*n,c=1-2**(-10*s),p=a.getColor(c);return{value:s,color:p}});else if(e==="ease-in-exp")i=Array.from({length:t},(l,u)=>{const s=u*n,c=2**(10*s-10),p=a.getColor(c);return{value:s,color:p}});else throw new Error("Invalid ressampling method.");return new h({stops:i}).scale(r.min,r.max)}transparentStart(){const e=this.getRawColorStops();e.unshift({value:e[0].value,color:e[0].color.slice()}),e[1].value+=.001;for(const t of e)t.color.length===3&&t.color.push(255);return e[0].color[3]=0,new h({stops:e})}hasTransparentStart(){return this[0].color.length===4&&this[0].color[3]===0}}const Le={NULL:new h({stops:[{value:0,color:[0,0,0,0]},{value:1,color:[0,0,0,0]}]}),GRAY:new h({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),JET:new h({stops:[{value:0,color:[0,0,131]},{value:.125,color:[0,60,170]},{value:.375,color:[5,255,255]},{value:.625,color:[255,255,0]},{value:.875,color:[250,0,0]},{value:1,color:[128,0,0]}]}),HSV:new h({stops:[{value:0,color:[255,0,0]},{value:.169,color:[253,255,2]},{value:.173,color:[247,255,2]},{value:.337,color:[0,252,4]},{value:.341,color:[0,252,10]},{value:.506,color:[1,249,255]},{value:.671,color:[2,0,253]},{value:.675,color:[8,0,253]},{value:.839,color:[255,0,251]},{value:.843,color:[255,0,245]},{value:1,color:[255,0,6]}]}),HOT:new h({stops:[{value:0,color:[0,0,0]},{value:.3,color:[230,0,0]},{value:.6,color:[255,210,0]},{value:1,color:[255,255,255]}]}),SPRING:new h({stops:[{value:0,color:[255,0,255]},{value:1,color:[255,255,0]}]}),SUMMER:new h({stops:[{value:0,color:[0,128,102]},{value:1,color:[255,255,102]}]}),AUTOMN:new h({stops:[{value:0,color:[255,0,0]},{value:1,color:[255,255,0]}]}),WINTER:new h({stops:[{value:0,color:[0,0,255]},{value:1,color:[0,255,128]}]}),BONE:new h({stops:[{value:0,color:[0,0,0]},{value:.376,color:[84,84,116]},{value:.753,color:[169,200,200]},{value:1,color:[255,255,255]}]}),COPPER:new h({stops:[{value:0,color:[0,0,0]},{value:.804,color:[255,160,102]},{value:1,color:[255,199,127]}]}),GREYS:new h({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),YIGNBU:new h({stops:[{value:0,color:[8,29,88]},{value:.125,color:[37,52,148]},{value:.25,color:[34,94,168]},{value:.375,color:[29,145,192]},{value:.5,color:[65,182,196]},{value:.625,color:[127,205,187]},{value:.75,color:[199,233,180]},{value:.875,color:[237,248,217]},{value:1,color:[255,255,217]}]}),GREENS:new h({stops:[{value:0,color:[0,68,27]},{value:.125,color:[0,109,44]},{value:.25,color:[35,139,69]},{value:.375,color:[65,171,93]},{value:.5,color:[116,196,118]},{value:.625,color:[161,217,155]},{value:.75,color:[199,233,192]},{value:.875,color:[229,245,224]},{value:1,color:[247,252,245]}]}),YIORRD:new h({stops:[{value:0,color:[128,0,38]},{value:.125,color:[189,0,38]},{value:.25,color:[227,26,28]},{value:.375,color:[252,78,42]},{value:.5,color:[253,141,60]},{value:.625,color:[254,178,76]},{value:.75,color:[254,217,118]},{value:.875,color:[255,237,160]},{value:1,color:[255,255,204]}]}),BLUERED:new h({stops:[{value:0,color:[0,0,255]},{value:1,color:[255,0,0]}]}),RDBU:new h({stops:[{value:0,color:[5,10,172]},{value:.35,color:[106,137,247]},{value:.5,color:[190,190,190]},{value:.6,color:[220,170,132]},{value:.7,color:[230,145,90]},{value:1,color:[178,10,28]}]}),PICNIC:new h({stops:[{value:0,color:[0,0,255]},{value:.1,color:[51,153,255]},{value:.2,color:[102,204,255]},{value:.3,color:[153,204,255]},{value:.4,color:[204,204,255]},{value:.5,color:[255,255,255]},{value:.6,color:[255,204,255]},{value:.7,color:[255,153,255]},{value:.8,color:[255,102,204]},{value:.9,color:[255,102,102]},{value:1,color:[255,0,0]}]}),RAINBOW:new h({stops:[{value:0,color:[150,0,90]},{value:.125,color:[0,0,200]},{value:.25,color:[0,25,255]},{value:.375,color:[0,152,255]},{value:.5,color:[44,255,150]},{value:.625,color:[151,255,0]},{value:.75,color:[255,234,0]},{value:.875,color:[255,111,0]},{value:1,color:[255,0,0]}]}),PORTLAND:new h({stops:[{value:0,color:[12,51,131]},{value:.25,color:[10,136,186]},{value:.5,color:[242,211,56]},{value:.75,color:[242,143,56]},{value:1,color:[217,30,30]}]}),BLACKBODY:new h({stops:[{value:0,color:[0,0,0]},{value:.2,color:[230,0,0]},{value:.4,color:[230,210,0]},{value:.7,color:[255,255,255]},{value:1,color:[160,200,255]}]}),EARTH:new h({stops:[{value:0,color:[0,0,130]},{value:.1,color:[0,180,180]},{value:.2,color:[40,210,40]},{value:.4,color:[230,230,50]},{value:.6,color:[120,70,20]},{value:1,color:[255,255,255]}]}),ELECTRIC:new h({stops:[{value:0,color:[0,0,0]},{value:.15,color:[30,0,100]},{value:.4,color:[120,0,100]},{value:.6,color:[160,90,0]},{value:.8,color:[230,200,0]},{value:1,color:[255,250,220]}]}),VIRIDIS:new h({stops:[{value:0,color:[68,1,84]},{value:.13,color:[71,44,122]},{value:.25,color:[59,81,139]},{value:.38,color:[44,113,142]},{value:.5,color:[33,144,141]},{value:.63,color:[39,173,129]},{value:.75,color:[92,200,99]},{value:.88,color:[170,220,50]},{value:1,color:[253,231,37]}]}),INFERNO:new h({stops:[{value:0,color:[0,0,4]},{value:.13,color:[31,12,72]},{value:.25,color:[85,15,109]},{value:.38,color:[136,34,106]},{value:.5,color:[186,54,85]},{value:.63,color:[227,89,51]},{value:.75,color:[249,140,10]},{value:.88,color:[249,201,50]},{value:1,color:[252,255,164]}]}),MAGMA:new h({stops:[{value:0,color:[0,0,4]},{value:.13,color:[28,16,68]},{value:.25,color:[79,18,123]},{value:.38,color:[129,37,129]},{value:.5,color:[181,54,122]},{value:.63,color:[229,80,100]},{value:.75,color:[251,135,97]},{value:.88,color:[254,194,135]},{value:1,color:[252,253,191]}]}),PLASMA:new h({stops:[{value:0,color:[13,8,135]},{value:.13,color:[75,3,161]},{value:.25,color:[125,3,168]},{value:.38,color:[168,34,150]},{value:.5,color:[203,70,121]},{value:.63,color:[229,107,93]},{value:.75,color:[248,148,65]},{value:.88,color:[253,195,40]},{value:1,color:[240,249,33]}]}),WARM:new h({stops:[{value:0,color:[125,0,179]},{value:.13,color:[172,0,187]},{value:.25,color:[219,0,170]},{value:.38,color:[255,0,130]},{value:.5,color:[255,63,74]},{value:.63,color:[255,123,0]},{value:.75,color:[234,176,0]},{value:.88,color:[190,228,0]},{value:1,color:[147,255,0]}]}),COOL:new h({stops:[{value:0,color:[125,0,179]},{value:.13,color:[116,0,218]},{value:.25,color:[98,74,237]},{value:.38,color:[68,146,231]},{value:.5,color:[0,204,197]},{value:.63,color:[0,247,146]},{value:.75,color:[0,255,88]},{value:.88,color:[40,255,8]},{value:1,color:[147,255,0]}]}),RAINBOW_SOFT:new h({stops:[{value:0,color:[125,0,179]},{value:.1,color:[199,0,180]},{value:.2,color:[255,0,121]},{value:.3,color:[255,108,0]},{value:.4,color:[222,194,0]},{value:.5,color:[150,255,0]},{value:.6,color:[0,255,55]},{value:.7,color:[0,246,150]},{value:.8,color:[50,167,222]},{value:.9,color:[103,51,235]},{value:1,color:[124,0,186]}]}),BATHYMETRY:new h({stops:[{value:0,color:[40,26,44]},{value:.13,color:[59,49,90]},{value:.25,color:[64,76,139]},{value:.38,color:[63,110,151]},{value:.5,color:[72,142,158]},{value:.63,color:[85,174,163]},{value:.75,color:[120,206,163]},{value:.88,color:[187,230,172]},{value:1,color:[253,254,204]}]}),CDOM:new h({stops:[{value:0,color:[47,15,62]},{value:.13,color:[87,23,86]},{value:.25,color:[130,28,99]},{value:.38,color:[171,41,96]},{value:.5,color:[206,67,86]},{value:.63,color:[230,106,84]},{value:.75,color:[242,149,103]},{value:.88,color:[249,193,135]},{value:1,color:[254,237,176]}]}),CHLOROPHYLL:new h({stops:[{value:0,color:[18,36,20]},{value:.13,color:[25,63,41]},{value:.25,color:[24,91,59]},{value:.38,color:[13,119,72]},{value:.5,color:[18,148,80]},{value:.63,color:[80,173,89]},{value:.75,color:[132,196,122]},{value:.88,color:[175,221,162]},{value:1,color:[215,249,208]}]}),DENSITY:new h({stops:[{value:0,color:[54,14,36]},{value:.13,color:[89,23,80]},{value:.25,color:[110,45,132]},{value:.38,color:[120,77,178]},{value:.5,color:[120,113,213]},{value:.63,color:[115,151,228]},{value:.75,color:[134,185,227]},{value:.88,color:[177,214,227]},{value:1,color:[230,241,241]}]}),FREESURFACE_BLUE:new h({stops:[{value:0,color:[30,4,110]},{value:.13,color:[47,14,176]},{value:.25,color:[41,45,236]},{value:.38,color:[25,99,212]},{value:.5,color:[68,131,200]},{value:.63,color:[114,156,197]},{value:.75,color:[157,181,203]},{value:.88,color:[200,208,216]},{value:1,color:[241,237,236]}]}),FREESURFACE_RED:new h({stops:[{value:0,color:[60,9,18]},{value:.13,color:[100,17,27]},{value:.25,color:[142,20,29]},{value:.38,color:[177,43,27]},{value:.5,color:[192,87,63]},{value:.63,color:[205,125,105]},{value:.75,color:[216,162,148]},{value:.88,color:[227,199,193]},{value:1,color:[241,237,236]}]}),OXYGEN:new h({stops:[{value:0,color:[64,5,5]},{value:.13,color:[106,6,15]},{value:.25,color:[144,26,7]},{value:.38,color:[168,64,3]},{value:.5,color:[188,100,4]},{value:.63,color:[206,136,11]},{value:.75,color:[220,174,25]},{value:.88,color:[231,215,44]},{value:1,color:[248,254,105]}]}),PAR:new h({stops:[{value:0,color:[51,20,24]},{value:.13,color:[90,32,35]},{value:.25,color:[129,44,34]},{value:.38,color:[159,68,25]},{value:.5,color:[182,99,19]},{value:.63,color:[199,134,22]},{value:.75,color:[212,171,35]},{value:.88,color:[221,210,54]},{value:1,color:[225,253,75]}]}),PHASE:new h({stops:[{value:0,color:[145,105,18]},{value:.13,color:[184,71,38]},{value:.25,color:[186,58,115]},{value:.38,color:[160,71,185]},{value:.5,color:[110,97,218]},{value:.63,color:[50,123,164]},{value:.75,color:[31,131,110]},{value:.88,color:[77,129,34]},{value:1,color:[145,105,18]}]}),SALINITY:new h({stops:[{value:0,color:[42,24,108]},{value:.13,color:[33,50,162]},{value:.25,color:[15,90,145]},{value:.38,color:[40,118,137]},{value:.5,color:[59,146,135]},{value:.63,color:[79,175,126]},{value:.75,color:[120,203,104]},{value:.88,color:[193,221,100]},{value:1,color:[253,239,154]}]}),TEMPERATURE:new h({stops:[{value:0,color:[4,35,51]},{value:.13,color:[23,51,122]},{value:.25,color:[85,59,157]},{value:.38,color:[129,79,143]},{value:.5,color:[175,95,130]},{value:.63,color:[222,112,101]},{value:.75,color:[249,146,66]},{value:.88,color:[249,196,65]},{value:1,color:[232,250,91]}]}),TURBIDITY:new h({stops:[{value:0,color:[34,31,27]},{value:.13,color:[65,50,41]},{value:.25,color:[98,69,52]},{value:.38,color:[131,89,57]},{value:.5,color:[161,112,59]},{value:.63,color:[185,140,66]},{value:.75,color:[202,174,88]},{value:.88,color:[216,209,126]},{value:1,color:[233,246,171]}]}),VELOCITY_BLUE:new h({stops:[{value:0,color:[17,32,64]},{value:.13,color:[35,52,116]},{value:.25,color:[29,81,156]},{value:.38,color:[31,113,162]},{value:.5,color:[50,144,169]},{value:.63,color:[87,173,176]},{value:.75,color:[149,196,189]},{value:.88,color:[203,221,211]},{value:1,color:[254,251,230]}]}),VELOCITY_GREEN:new h({stops:[{value:0,color:[23,35,19]},{value:.13,color:[24,64,38]},{value:.25,color:[11,95,45]},{value:.38,color:[39,123,35]},{value:.5,color:[95,146,12]},{value:.63,color:[152,165,18]},{value:.75,color:[201,186,69]},{value:.88,color:[233,216,137]},{value:1,color:[255,253,205]}]}),CUBEHELIX:new h({stops:[{value:0,color:[0,0,0]},{value:.07,color:[22,5,59]},{value:.13,color:[60,4,105]},{value:.2,color:[109,1,135]},{value:.27,color:[161,0,147]},{value:.33,color:[210,2,142]},{value:.4,color:[251,11,123]},{value:.47,color:[255,29,97]},{value:.53,color:[255,54,69]},{value:.6,color:[255,85,46]},{value:.67,color:[255,120,34]},{value:.73,color:[255,157,37]},{value:.8,color:[241,191,57]},{value:.87,color:[224,220,93]},{value:.93,color:[218,241,142]},{value:1,color:[227,253,198]}]}),CIVIDIS:new h({stops:[{value:0,color:[0,32,77,255]},{value:.125,color:[5,54,110,255]},{value:.25,color:[65,77,108,255]},{value:.375,color:[97,100,111,255]},{value:.5,color:[125,124,121,255]},{value:.625,color:[156,149,120,255]},{value:.75,color:[190,175,111,255]},{value:.875,color:[225,204,94,255]},{value:1,color:[255,235,70,255]}]}),TURBO:new h({stops:[{value:0,color:[48,18,59,255]},{value:.125,color:[70,107,227,255]},{value:.25,color:[40,187,236,255]},{value:.375,color:[49,242,153,255]},{value:.5,color:[162,252,60,255]},{value:.625,color:[237,208,58,255]},{value:.75,color:[251,128,34,255]},{value:.875,color:[210,49,5,255]},{value:1,color:[122,4,3,255]}]}),ROCKET:new h({stops:[{value:0,color:[250,235,221,0]},{value:.133,color:[250,235,221,255]},{value:.266,color:[246,170,130,255]},{value:.4,color:[240,96,67,255]},{value:.533,color:[203,27,79,255]},{value:.666,color:[132,30,90,255]},{value:.8,color:[63,27,68,255]},{value:1,color:[3,5,26,255]}]}),MAKO:new h({stops:[{value:0,color:[11,4,5,255]},{value:.125,color:[43,28,53,255]},{value:.25,color:[62,53,107,255]},{value:.375,color:[59,86,152,255]},{value:.5,color:[53,123,162,255]},{value:.625,color:[53,158,170,255]},{value:.75,color:[73,193,173,255]},{value:.875,color:[150,221,181,255]},{value:1,color:[222,245,229,255]}]})},at=[["#1D5B79","#468B97","#EF6262","#F3AA60"],["#614BC3","#33BBC5","#85E6C5","#C8FFE0"],["#461959","#7A316F","#CD6688","#AED8CC"],["#0079FF","#00DFA2","#F6FA70","#FF0060"],["#39B5E0","#A31ACB","#FF78F0","#F5EA5A"],["#37E2D5","#590696","#C70A80","#FBCB0A"],["#FFD36E","#FFF56D","#99FFCD","#9FB4FF"],["#00EAD3","#FFF5B7","#FF449F","#005F99"],["#10A19D","#540375","#FF7000","#FFBF00"]];function Ae(){return at[~~(Math.random()*at.length)][~~(Math.random()*4)]}function te(){return`maptiler_source_${Ne()}`}function oe(){return`maptiler_layer_${Ne()}`}function nt(o,e){if(e<=o[0].zoom)return o[0].value;if(e>=o[o.length-1].zoom)return o[o.length-1].value;for(let t=0;t<o.length-1;t+=1)if(e>=o[t].zoom&&e<o[t+1].zoom){const r=o[t+1].zoom-o[t].zoom,a=(e-o[t].zoom)/r;return a*o[t+1].value+(1-a)*o[t].value}return 0}function V(o){return["interpolate",["linear"],["zoom"],...o.flatMap(e=>[e.zoom,e.value])]}function b(o){return["interpolate",["linear"],["zoom"],...o.flatMap(e=>[e.zoom,e.value])]}function Ro(o,e){if(typeof e=="number"&&typeof o=="number")return 2*e+o;if(typeof e=="number"&&Array.isArray(o))return["interpolate",["linear"],["zoom"],...o.flatMap(t=>[t.zoom,2*e+t.value])];if(typeof o=="number"&&Array.isArray(e))return["interpolate",["linear"],["zoom"],...e.flatMap(t=>[t.zoom,2*t.value+o])];if(Array.isArray(o)&&Array.isArray(e)){const t=Array.from(new Set([...o.map(r=>r.zoom),...e.map(r=>r.zoom)])).sort((r,a)=>r<a?-1:1);return["interpolate",["linear"],["zoom"],...t.flatMap(r=>[r,2*nt(e,r)+nt(o,r)])]}return 0}function xo(o,e){return["interpolate",["linear"],["get",e],...o.flatMap(t=>[t.propertyValue,t.value])]}function it(o){const e=o.trimStart(),t=`${e}${" ".repeat(o.length-e.length)}`,r=Array.from(t);if(!r.every(n=>n===" "||n==="_"))throw new Error("A dash pattern must be composed only of whitespace and underscore characters.");if(!(r.some(n=>n==="_")&&r.some(n=>n===" ")))throw new Error("A dash pattern must contain at least one underscore and one whitespace character");const a=[1];for(let n=1;n<r.length;n+=1){const i=r[n-1],l=r[n];i===l?a[a.length-1]+=1:a.push(1)}return a}function lt(o,e){return["interpolate",["linear"],["get",e],...o.flatMap(t=>[t.value,t.color])]}function st(o,e,t=!0){return t?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.value,r.pointRadius*.025])],2,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.value,r.pointRadius*.05])],4,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.value,r.pointRadius*.1])],8,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.value,r.pointRadius*.25])],16,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.value,r.pointRadius])]]:["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.value,r.pointRadius])]}function No(o,e,t=!0){return t?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.propertyValue,r.value*.025])],2,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.propertyValue,r.value*.05])],4,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.propertyValue,r.value*.1])],8,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.propertyValue,r.value*.25])],16,["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.propertyValue,r.value])]]:["interpolate",["linear"],["get",e],...o.flatMap(r=>[r.propertyValue,r.value])]}function ct(o,e){return o.every(t=>t.color[3]===o[0].color[3])?o[0].color[3]?o[0].color[3]/255:1:["interpolate",["linear"],["get",e],...o.getRawColorStops().flatMap(t=>{const r=t.value,a=t.color;return[r,a.length===4?a[3]/255:1]})]}function _o(o,e=10){return["interpolate",["linear"],["heatmap-density"],...Array.from({length:e+1},(t,r)=>{const a=r/e;return[a,o.getColorHex(a)]}).flat()]}async function Mo(o,e,t={}){if(!e.sourceId&&!e.data)throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");let r=e.data;if(typeof r=="string"){if(q(r))r=`https://api.maptiler.com/data/${e.data}/features.json?key=${R.apiKey}`;else if(r.split(".").pop()?.toLowerCase().trim()==="gpx"){const a=await(await fetch(r,t)).text();r=ge(a)}else if(r.split(".").pop()?.toLowerCase().trim()==="kml"){const a=await(await fetch(r,t)).text();r=ye(a)}else{const a=Yt(r)??rt(r);a&&(r=a)}if(!r)throw new Error("Polyline data was provided as string but is incompatible with valid formats.")}return Po(o,{...e,data:r})}function Po(o,e){if(e.layerId&&o.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const t=e.sourceId??te(),r=e.layerId??oe(),a={polylineLayerId:r,polylineOutlineLayerId:"",polylineSourceId:t};e.data&&!o.getSource(t)&&o.addSource(t,{type:"geojson",data:e.data});const n=e.lineWidth??3,i=e.lineColor??Ae(),l=e.lineOpacity??1,u=e.lineBlur??0,s=e.lineGapWidth??0;let c=e.lineDashArray??null;const p=e.outlineWidth??1,d=e.outlineColor??"#FFFFFF",y=e.outlineOpacity??1,v=e.outlineBlur??0;if(typeof c=="string"&&(c=it(c)),e.outline===!0){const g=`${r}_outline`;a.polylineOutlineLayerId=g,o.addLayer({id:g,type:"line",source:t,layout:{"line-join":e.lineJoin??"round","line-cap":e.lineCap??"round"},minzoom:e.minzoom??0,maxzoom:e.maxzoom??23,paint:{"line-opacity":typeof y=="number"?y:b(y),"line-color":typeof d=="string"?d:V(d),"line-width":Ro(n,p),"line-blur":typeof v=="number"?v:b(v)}},e.beforeId)}return o.addLayer({id:r,type:"line",source:t,layout:{"line-join":e.lineJoin??"round","line-cap":e.lineCap??"round"},minzoom:e.minzoom??0,maxzoom:e.maxzoom??23,paint:{"line-opacity":typeof l=="number"?l:b(l),"line-color":typeof i=="string"?i:V(i),"line-width":typeof n=="number"?n:b(n),"line-blur":typeof u=="number"?u:b(u),"line-gap-width":typeof s=="number"?s:b(s),...c&&{"line-dasharray":c}}},e.beforeId),a}function Oo(o,e){if(e.layerId&&o.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const t=e.sourceId??te(),r=e.layerId??oe(),a={polygonLayerId:r,polygonOutlineLayerId:e.outline?`${r}_outline`:"",polygonSourceId:t};if(e.data&&!o.getSource(t)){let g=e.data;typeof g=="string"&&q(g)&&(g=`https://api.maptiler.com/data/${g}/features.json?key=${R.apiKey}`),o.addSource(t,{type:"geojson",data:g})}let n=e.outlineDashArray??null;const i=e.outlineWidth??1,l=e.outlineColor??"#FFFFFF",u=e.outlineOpacity??1,s=e.outlineBlur??0,c=e.fillColor??Ae(),p=e.fillOpacity??1,d=e.outlinePosition??"center",y=e.pattern??null;typeof n=="string"&&(n=it(n));const v=(g=null)=>{if(o.addLayer({id:r,type:"fill",source:t,minzoom:e.minzoom??0,maxzoom:e.maxzoom??23,paint:{"fill-color":typeof c=="string"?c:V(c),"fill-opacity":typeof p=="number"?p:b(p),...g&&{"fill-pattern":g}}},e.beforeId),e.outline===!0){let w;d==="inside"?typeof i=="number"?w=.5*i:w=b(i.map(({zoom:N,value:L})=>({zoom:N,value:.5*L}))):d==="outside"?typeof i=="number"?w=-.5*i:w=b(i.map(N=>({zoom:N.zoom,value:-.5*N.value}))):w=0,o.addLayer({id:a.polygonOutlineLayerId,type:"line",source:t,layout:{"line-join":e.outlineJoin??"round","line-cap":e.outlineCap??"butt"},minzoom:e.minzoom??0,maxzoom:e.maxzoom??23,paint:{"line-opacity":typeof u=="number"?u:b(u),"line-color":typeof l=="string"?l:V(l),"line-width":typeof i=="number"?i:b(i),"line-blur":typeof s=="number"?s:b(s),"line-offset":w,...n&&{"line-dasharray":n}}},e.beforeId)}};return y?o.hasImage(y)?v(y):o.loadImage(y).then(g=>{o.addImage(y,g.data),v(y)}).catch(g=>(console.error("Could not load the pattern image.",g.message),v())):v(),a}function ko(o,e){if(e.layerId&&o.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const t=e.minPointRadius??10,r=e.maxPointRadius??50,a=e.cluster??!1,n=20,i=Array.isArray(e.pointColor)?e.pointColor:Le.TURBO.scale(10,e.cluster?1e4:1e3).resample("ease-out-square"),l=i.getBounds(),u=e.sourceId??te(),s=e.layerId??oe(),c=e.showLabel??a,p=e.alignOnViewport??!0,d=e.outline??!1,y=e.outlineOpacity??1,v=e.outlineWidth??1,g=e.outlineColor??"#FFFFFF";let w;const N=e.zoomCompensation??!0,L=e.minzoom??0,I=e.maxzoom??23;typeof e.pointOpacity=="number"?w=e.pointOpacity:Array.isArray(e.pointOpacity)?w=b(e.pointOpacity):e.cluster?w=ct(i,"point_count"):e.property?w=ct(i,e.property):w=b([{zoom:L,value:0},{zoom:L+.25,value:1},{zoom:I-.25,value:1},{zoom:I,value:0}]);const E={pointLayerId:s,clusterLayerId:"",labelLayerId:"",pointSourceId:u};if(e.data&&!o.getSource(u)){let T=e.data;typeof T=="string"&&q(T)&&(T=`https://api.maptiler.com/data/${T}/features.json?key=${R.apiKey}`),o.addSource(u,{type:"geojson",data:T,cluster:a})}if(a){E.clusterLayerId=`${s}_cluster`;const T=Array.from({length:n},(z,H)=>{const K=l.min+H*(l.max-l.min)/(n-1);return{value:K,pointRadius:t+(r-t)*(H/(n-1))**.5,color:i.getColorHex(K)}});o.addLayer({id:E.clusterLayerId,type:"circle",source:u,filter:["has","point_count"],paint:{"circle-color":typeof e.pointColor=="string"?e.pointColor:lt(T,"point_count"),"circle-radius":typeof e.pointRadius=="number"?e.pointRadius:Array.isArray(e.pointRadius)?b(e.pointRadius):st(T,"point_count",!1),"circle-pitch-alignment":p?"viewport":"map","circle-pitch-scale":"map","circle-opacity":w,...d&&{"circle-stroke-opacity":typeof y=="number"?y:b(y),"circle-stroke-width":typeof v=="number"?v:b(v),"circle-stroke-color":typeof g=="string"?g:V(g)}},minzoom:L,maxzoom:I},e.beforeId),o.addLayer({id:E.pointLayerId,type:"circle",source:u,filter:["!",["has","point_count"]],paint:{"circle-pitch-alignment":p?"viewport":"map","circle-pitch-scale":"map","circle-color":typeof e.pointColor=="string"?e.pointColor:i.getColorHex(i.getBounds().min),"circle-radius":typeof e.pointRadius=="number"?e.pointRadius:Array.isArray(e.pointRadius)?b(e.pointRadius):T[0].pointRadius*.75,"circle-opacity":w,...d&&{"circle-stroke-opacity":typeof y=="number"?y:b(y),"circle-stroke-width":typeof v=="number"?v:b(v),"circle-stroke-color":typeof g=="string"?g:V(g)}},minzoom:L,maxzoom:I},e.beforeId)}else{let T=typeof e.pointColor=="string"?e.pointColor:Array.isArray(e.pointColor)?e.pointColor.getColorHex(e.pointColor.getBounds().min):Ae(),z=typeof e.pointRadius=="number"?N?b([{zoom:0,value:e.pointRadius*.025},{zoom:2,value:e.pointRadius*.05},{zoom:4,value:e.pointRadius*.1},{zoom:8,value:e.pointRadius*.25},{zoom:16,value:e.pointRadius*1}]):e.pointRadius:Array.isArray(e.pointRadius)?b(e.pointRadius):N?b([{zoom:0,value:t*.05},{zoom:2,value:t*.1},{zoom:4,value:t*.2},{zoom:8,value:t*.5},{zoom:16,value:t*1}]):t;if(e.property&&Array.isArray(e.pointColor)){const H=Array.from({length:n},(K,Z)=>{const Y=l.min+Z*(l.max-l.min)/(n-1);return{value:Y,pointRadius:typeof e.pointRadius=="number"?e.pointRadius:t+(r-t)*(Z/(n-1))**.5,color:typeof e.pointColor=="string"?e.pointColor:i.getColorHex(Y)}});T=lt(H,e.property),z=st(H,e.property,N)}o.addLayer({id:E.pointLayerId,type:"circle",source:u,layout:{"circle-sort-key":e.property?["/",1,["get",e.property]]:0},paint:{"circle-pitch-alignment":p?"viewport":"map","circle-pitch-scale":"map","circle-color":T,"circle-opacity":w,"circle-radius":z,...d&&{"circle-stroke-opacity":typeof y=="number"?y:b(y),"circle-stroke-width":typeof v=="number"?v:b(v),"circle-stroke-color":typeof g=="string"?g:V(g)}},minzoom:L,maxzoom:I},e.beforeId)}if(c!==!1&&(e.cluster||e.property)){E.labelLayerId=`${s}_label`;const T=e.labelColor??"#fff",z=e.labelSize??12;o.addLayer({id:E.labelLayerId,type:"symbol",source:u,filter:["has",e.cluster?"point_count":e.property],layout:{"text-field":e.cluster?"{point_count_abbreviated}":`{${e.property}}`,"text-font":["Noto Sans Regular"],"text-size":z,"text-pitch-alignment":p?"viewport":"map","symbol-sort-key":["/",1,["get",e.cluster?"point_count":e.property]]},paint:{"text-color":T,"text-opacity":w},minzoom:L,maxzoom:I},e.beforeId)}return E}function Fo(o,e){if(e.layerId&&o.getLayer(e.layerId))throw new Error(`A layer already exists with the layer id: ${e.layerId}`);const t=e.sourceId??te(),r=e.layerId??oe(),a=e.minzoom??0,n=e.maxzoom??23,i=e.zoomCompensation??!0,l=e.opacity??[{zoom:a,value:0},{zoom:a+.25,value:1},{zoom:n-.25,value:1},{zoom:n,value:0}];let u=Array.isArray(e.colorRamp)?e.colorRamp:Le.TURBO.transparentStart();const s=u.getBounds();(s.min!==0||s.max!==1)&&(u=u.scale(0,1)),u.hasTransparentStart()||(u=u.transparentStart());const c=e.intensity??[{zoom:0,value:.01},{zoom:4,value:.2},{zoom:16,value:1}],p=e.property??null,d=e.weight??1;let y=1;p?typeof d=="number"?(y=d,typeof e.weight=="number"&&console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`")):Array.isArray(d)?y=xo(d,p):console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"):typeof d=="number"?y=d:Array.isArray(d)&&console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");const v=[{zoom:0,value:50*.025},{zoom:2,value:50*.05},{zoom:4,value:50*.1},{zoom:8,value:50*.25},{zoom:16,value:50}],g=e.radius??(i?v:10);let w=1;typeof g=="number"?w=g:Array.isArray(g)&&"zoom"in g[0]?w=b(g):p&&Array.isArray(g)&&"propertyValue"in g[0]?w=No(g,p,i):!p&&Array.isArray(g)&&"propertyValue"in g[0]?(w=b(v),console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")):w=b(v);const N={heatmapLayerId:r,heatmapSourceId:t};if(e.data&&!o.getSource(t)){let L=e.data;typeof L=="string"&&q(L)&&(L=`https://api.maptiler.com/data/${L}/features.json?key=${R.apiKey}`),o.addSource(t,{type:"geojson",data:L})}return o.addLayer({id:r,type:"heatmap",source:t,minzoom:a,maxzoom:n,paint:{"heatmap-weight":y,"heatmap-intensity":typeof c=="number"?c:b(c),"heatmap-color":_o(u),"heatmap-radius":w,"heatmap-opacity":typeof l=="number"?l:b(l)}}),N}const zo={addPolyline:Mo,addPolygon:Oo,addPoint:ko,addHeatmap:Fo};Kt();function Bo(){return Bt.version}export{Wo as AJAXError,so as AttributionControl,Ko as AttributionControlMLGL,uo as BoxZoomHandler,Zo as BoxZoomHandlerMLGL,to as CanvasSource,Yo as CanvasSourceMLGL,h as ColorRamp,Le as ColorRampCollection,ho as CooperativeGesturesHandler,qo as CooperativeGesturesHandlerMLGL,Jo as DoubleClickZoomHandler,Xo as DragPanHandler,Qo as DragRotateHandler,er as EdgeInsets,tr as Evented,ke as FullscreenControl,or as FullscreenControlMLGL,oo as GeoJSONSource,rr as GeoJSONSourceMLGL,Me as GeolocateControl,ar as GeolocateControlMLGL,We as GeolocationType,nr as Hash,ro as ImageSource,ir as ImageSourceMLGL,mo as KeyboardHandler,lr as KeyboardHandlerMLGL,A as Language,Yr as LanguageGeocoding,sr as LngLat,cr as LngLatBounds,Pe as LogoControl,ur as LogoControlMLGL,Ke as Map,pr as MapMLGL,fo as MapMouseEvent,hr as MapMouseEventMLGL,qr as MapStyle,Jr as MapStyleVariant,vo as MapTouchEvent,mr as MapTouchEventMLGL,yo as MapWheelEvent,dr as MapWheelEventMLGL,He as MaptilerGeolocateControl,ue as MaptilerLogoControl,Be as MaptilerNavigationControl,ze as MaptilerTerrainControl,Xt as Marker,gr as MarkerMLGL,yr as MercatorCoordinate,_e as NavigationControl,vr as NavigationControlMLGL,fr as Point,Qt as Popup,Lr as PopupMLGL,no as RasterDEMTileSource,Ar as RasterDEMTileSourceMLGL,ao as RasterTileSource,wr as RasterTileSourceMLGL,Xr as ReferenceMapStyle,Oe as ScaleControl,Cr as ScaleControlMLGL,po as ScrollZoomHandler,Sr as ScrollZoomHandlerMLGL,be as SdkConfig,Qr as ServiceError,eo as Style,br as StyleMLGL,co as TerrainControl,Tr as TerrainControlMLGL,go as TwoFingersTouchPitchHandler,Ir as TwoFingersTouchPitchHandlerMLGL,Er as TwoFingersTouchRotateHandler,Rr as TwoFingersTouchZoomHandler,xr as TwoFingersTouchZoomRotateHandler,io as VectorTileSource,Nr as VectorTileSourceMLGL,lo as VideoSource,_r as VideoSourceMLGL,Mr as addProtocol,Pr as addSourceType,ea as bufferToPixelDataBrowser,ta as circumferenceAtLatitude,Or as clearPrewarmedResources,R as config,kr as configMLGL,oa as coordinates,ra as data,aa as elevation,na as expandMapStyle,ia as geocoding,la as geolocation,sa as getAutoLanguageGeocoding,ne as getBrowserLanguage,ca as getBufferToPixelDataParser,Fr as getMapLibreVersion,zr as getMaxParallelImageRequests,Br as getRTLTextPluginStatus,ua as getTileCache,Bo as getVersion,Ur as getWorkerCount,Gr as getWorkerUrl,ge as gpx,rt as gpxOrKml,me as hasChildNodeWithName,zo as helpers,Hr as importScriptInWorkers,ae as isLanguageSupported,ye as kml,pa as mapStylePresetList,ha as math,ma as misc,Dr as prewarm,$r as removeProtocol,jr as setMaxParallelImageRequests,Vr as setRTLTextPlugin,Wr as setWorkerCount,Kr as setWorkerUrl,da as staticMaps,X as str2xml,ga as styleToStyle,de as xml2str};