From 0dc8611e93cff82420ccd35453cd4c143d5913b5 Mon Sep 17 00:00:00 2001 From: dabreegster Date: Tue, 16 Jul 2024 12:46:35 +0000 Subject: [PATCH] deploy: 2cf5ae2f817e634acedaa5c704a71903a947f288 --- .../{entry.DyFwfDnc.js => entry.B8-zo55L.js} | 4 +-- .../{app.BCeJdQ1Y.js => app.CRzvNebz.js} | 4 +-- _app/immutable/entry/start.BULYG7iv.js | 1 - _app/immutable/entry/start.QwNSKCDS.js | 1 + .../nodes/{1.BR8J8OAt.js => 1.DvvR6iYn.js} | 2 +- .../nodes/{2.DjBmDr6K.js => 2.B-EZKrE_.js} | 34 +++++++++--------- _app/version.json | 2 +- assets/route_snapper_bg.wasm | Bin 251355 -> 260285 bytes index.html | 12 +++---- 9 files changed, 30 insertions(+), 30 deletions(-) rename _app/immutable/chunks/{entry.DyFwfDnc.js => entry.B8-zo55L.js} (90%) rename _app/immutable/entry/{app.BCeJdQ1Y.js => app.CRzvNebz.js} (95%) delete mode 100644 _app/immutable/entry/start.BULYG7iv.js create mode 100644 _app/immutable/entry/start.QwNSKCDS.js rename _app/immutable/nodes/{1.BR8J8OAt.js => 1.DvvR6iYn.js} (93%) rename _app/immutable/nodes/{2.DjBmDr6K.js => 2.B-EZKrE_.js} (90%) diff --git a/_app/immutable/chunks/entry.DyFwfDnc.js b/_app/immutable/chunks/entry.B8-zo55L.js similarity index 90% rename from _app/immutable/chunks/entry.DyFwfDnc.js rename to _app/immutable/chunks/entry.B8-zo55L.js index 30241dd..e9602b6 100644 --- a/_app/immutable/chunks/entry.DyFwfDnc.js +++ b/_app/immutable/chunks/entry.B8-zo55L.js @@ -1,3 +1,3 @@ -import{z as re}from"./scheduler.BYEMbWP1.js";import{w as dt}from"./index.Cin_jHdv.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var xt;const I=((xt=globalThis.__sveltekit_1usnsu5)==null?void 0:xt.base)??"/scheme-sketcher-lib";var Nt;const ke=((Nt=globalThis.__sveltekit_1usnsu5)==null?void 0:Nt.assets)??I,Se="1720962772715",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...K,"":K.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Gt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function Y(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,Te=-4,Ue=-5,xe=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===Te)return 1/0;if(o===Ue)return-1/0;if(o===xe)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function z(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const x=jt($t)??{},G=jt(Dt)??{},T={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){x[t]=pt()}function Ve(t,n){let e=t+1;for(;x[e];)delete x[e],e+=1;for(e=n+1;G[e];)delete G[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,J,L,ut,$;const Ht=[],W=[];let P=null;const Bt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,M=!1,C=!1,Kt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],J=t.nodes[1],ft(),J(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=x[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await Ye(ut,e):Be(location.href,{replaceState:!0}),Ke()}function Yt(t){W.some(n=>n==null?void 0:n.snapshot)&&(G[t]=W.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function zt(t){var n;(n=G[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=W[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function Tt(){mt(k),At($t,x),Yt(A),At(Dt,G)}async function Jt(t,n,e,r){return B({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function Ge(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function Wt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:T,components:W},hydrate:!0}),zt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Ut(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Me(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Me(w.url,e);let d=!1;const m=c.map((p,y)=>{var U;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Ut(d,h,u,g,(U=b.server)==null?void 0:U.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:z(p),error:await q(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Ut(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await J(),loader:J,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return M||Bt.forEach(s=>s(i)),a?null:o}async function B({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),M=!0,X&&T.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await q(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await q(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Jt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await T.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),Yt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Kt=!0}else Wt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&ze(),Pt=!0,l.props.page&&(R=l.props.page),M=!1,t==="popstate"&&zt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),T.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Gt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=Y(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&Ge(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=Y(o);f.reload||(f.preload_code===K.viewport&&e.observe(o),f.preload_code===K.eager&&ct(i.pathname))}}O.push(a),a()}function q(t,n){if(t instanceof et)return t.body;const e=z(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function Be(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Jt(t,n,0)}function Ke(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Tt(),!M){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Bt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Tt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Gt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Y(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?M=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),B({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=Y(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),B({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=x[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Kt||f)){t(s),x[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await B({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&T.navigating.set(null)});function t(e){w.url=e,T.page.set({...R,url:e}),T.page.notify()}}async function Ye(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` +import{z as re}from"./scheduler.BYEMbWP1.js";import{w as dt}from"./index.Cin_jHdv.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var xt;const I=((xt=globalThis.__sveltekit_1spz7ga)==null?void 0:xt.base)??"/scheme-sketcher-lib";var Nt;const ke=((Nt=globalThis.__sveltekit_1spz7ga)==null?void 0:Nt.assets)??I,Se="1721133981029",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",B={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...B,"":B.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Gt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function K(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,Te=-4,Ue=-5,xe=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===Te)return 1/0;if(o===Ue)return-1/0;if(o===xe)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function Y(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const x=jt($t)??{},G=jt(Dt)??{},T={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){x[t]=pt()}function Ve(t,n){let e=t+1;for(;x[e];)delete x[e],e+=1;for(e=n+1;G[e];)delete G[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,J,L,ut,$;const Ht=[],W=[];let P=null;const zt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,M=!1,C=!1,Bt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],J=t.nodes[1],ft(),J(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=x[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await Ke(ut,e):ze(location.href,{replaceState:!0}),Be()}function Kt(t){W.some(n=>n==null?void 0:n.snapshot)&&(G[t]=W.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Yt(t){var n;(n=G[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=W[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function Tt(){mt(k),At($t,x),Kt(A),At(Dt,G)}async function Jt(t,n,e,r){return z({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function Ge(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function Wt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:T,components:W},hydrate:!0}),Yt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Ut(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Me(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Me(w.url,e);let d=!1;const m=c.map((p,y)=>{var U;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Ut(d,h,u,g,(U=b.server)==null?void 0:U.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:Y(p),error:await q(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Ut(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await J(),loader:J,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return M||zt.forEach(s=>s(i)),a?null:o}async function z({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),M=!0,X&&T.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await q(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await q(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Jt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await T.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),Kt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Bt=!0}else Wt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&Ye(),Pt=!0,l.props.page&&(R=l.props.page),M=!1,t==="popstate"&&Yt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),T.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Gt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=K(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&Ge(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=K(o);f.reload||(f.preload_code===B.viewport&&e.observe(o),f.preload_code===B.eager&&ct(i.pathname))}}O.push(a),a()}function q(t,n){if(t instanceof et)return t.body;const e=Y(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function ze(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Jt(t,n,0)}function Be(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Tt(),!M){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};zt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Tt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Gt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=K(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?M=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),z({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=K(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),z({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=x[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Bt||f)){t(s),x[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await z({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&T.navigating.set(null)});function t(e){w.url=e,T.page.set({...R,url:e}),T.page.notify()}}async function Ke(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` `:c.decode(d,{stream:!0});;){const m=u.indexOf(` -`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function ze(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,T as s}; +`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Ye(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,T as s}; diff --git a/_app/immutable/entry/app.BCeJdQ1Y.js b/_app/immutable/entry/app.CRzvNebz.js similarity index 95% rename from _app/immutable/entry/app.BCeJdQ1Y.js rename to _app/immutable/entry/app.CRzvNebz.js index efbc553..d8ed43b 100644 --- a/_app/immutable/entry/app.BCeJdQ1Y.js +++ b/_app/immutable/entry/app.CRzvNebz.js @@ -1,7 +1,7 @@ -import{s as A,b as B,p as d,j as U,k as b,i as p,q as j,r as z,e as M,d as W,f as F,v as L,w as h,t as G,h as H,m as J,x as N,y as k,z as K}from"../chunks/scheduler.BYEMbWP1.js";import{S as Q,i as X,a as w,c as R,t as g,g as P,b as v,d as C,m as E,e as y}from"../chunks/index.By7-O7ez.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;w(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),g(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&w(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;w(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),g(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&w(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;w(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),g(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&w(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=M("div"),n&&n.c(),this.h()},l(i){e=W(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=F(e);n&&n.l(s),s.forEach(p),this.h()},h(){L(e,"id","svelte-announcer"),L(e,"aria-live","assertive"),L(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&p(e),n&&n.d()}}}function O(a){let e;return{c(){e=G(a[7])},l(n){e=H(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&J(e,n[7])},d(n){n&&p(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=B(),u&&u.c(),s=d()},l(o){n.l(o),i=U(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),w(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),g(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(g(n),c=!0)},o(o){w(n),c=!1},d(o){o&&(p(i),p(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;j(i.page.notify);let o=!1,_=!1,m=null;z(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),K().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){N[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){N[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){N[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends Q{constructor(e){super(),X(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.nBwI6ytY.js"),__vite__mapDeps([0,1,2]),import.meta.url),()=>S(()=>import("../nodes/1.BR8J8OAt.js"),__vite__mapDeps([3,1,2,4,5]),import.meta.url),()=>S(()=>import("../nodes/2.DjBmDr6K.js"),__vite__mapDeps([6,1,2,5,7]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; +import{s as A,b as B,p as d,j as U,k as b,i as p,q as j,r as z,e as M,d as W,f as F,v as L,w as h,t as G,h as H,m as J,x as N,y as k,z as K}from"../chunks/scheduler.BYEMbWP1.js";import{S as Q,i as X,a as w,c as R,t as g,g as P,b as v,d as C,m as E,e as y}from"../chunks/index.By7-O7ez.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;w(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),g(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&w(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;w(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),g(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&w(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;w(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),g(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&w(e.$$.fragment,t),i=!1},d(t){t&&p(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=M("div"),n&&n.c(),this.h()},l(i){e=W(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=F(e);n&&n.l(s),s.forEach(p),this.h()},h(){L(e,"id","svelte-announcer"),L(e,"aria-live","assertive"),L(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&p(e),n&&n.d()}}}function O(a){let e;return{c(){e=G(a[7])},l(n){e=H(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&J(e,n[7])},d(n){n&&p(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=B(),u&&u.c(),s=d()},l(o){n.l(o),i=U(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),w(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),g(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(g(n),c=!0)},o(o){w(n),c=!1},d(o){o&&(p(i),p(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;j(i.page.notify);let o=!1,_=!1,m=null;z(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),K().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){N[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){N[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){N[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends Q{constructor(e){super(),X(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.nBwI6ytY.js"),__vite__mapDeps([0,1,2]),import.meta.url),()=>S(()=>import("../nodes/1.DvvR6iYn.js"),__vite__mapDeps([3,1,2,4,5]),import.meta.url),()=>S(()=>import("../nodes/2.B-EZKrE_.js"),__vite__mapDeps([6,1,2,5,7]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["../nodes/0.nBwI6ytY.js","../chunks/scheduler.BYEMbWP1.js","../chunks/index.By7-O7ez.js","../nodes/1.BR8J8OAt.js","../chunks/entry.DyFwfDnc.js","../chunks/index.Cin_jHdv.js","../nodes/2.DjBmDr6K.js","../assets/2.CjbQrcFm.css"] + __vite__mapDeps.viteFileDeps = ["../nodes/0.nBwI6ytY.js","../chunks/scheduler.BYEMbWP1.js","../chunks/index.By7-O7ez.js","../nodes/1.DvvR6iYn.js","../chunks/entry.B8-zo55L.js","../chunks/index.Cin_jHdv.js","../nodes/2.B-EZKrE_.js","../assets/2.CjbQrcFm.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/_app/immutable/entry/start.BULYG7iv.js b/_app/immutable/entry/start.BULYG7iv.js deleted file mode 100644 index cf11578..0000000 --- a/_app/immutable/entry/start.BULYG7iv.js +++ /dev/null @@ -1 +0,0 @@ -import{a as t}from"../chunks/entry.DyFwfDnc.js";export{t as start}; diff --git a/_app/immutable/entry/start.QwNSKCDS.js b/_app/immutable/entry/start.QwNSKCDS.js new file mode 100644 index 0000000..78b4867 --- /dev/null +++ b/_app/immutable/entry/start.QwNSKCDS.js @@ -0,0 +1 @@ +import{a as t}from"../chunks/entry.B8-zo55L.js";export{t as start}; diff --git a/_app/immutable/nodes/1.BR8J8OAt.js b/_app/immutable/nodes/1.DvvR6iYn.js similarity index 93% rename from _app/immutable/nodes/1.BR8J8OAt.js rename to _app/immutable/nodes/1.DvvR6iYn.js index b6c6eb7..63efc8b 100644 --- a/_app/immutable/nodes/1.BR8J8OAt.js +++ b/_app/immutable/nodes/1.DvvR6iYn.js @@ -1 +1 @@ -import{s as S,e as _,t as f,b as x,d,f as g,h,i as l,j,k as m,l as v,m as $,n as E,o as k}from"../chunks/scheduler.BYEMbWP1.js";import{S as q,i as y}from"../chunks/index.By7-O7ez.js";import{s as C}from"../chunks/entry.DyFwfDnc.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",u;return{c(){t=_("h1"),o=f(r),n=x(),i=_("p"),u=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(l),n=j(e),i=d(e,"P",{});var p=g(i);u=h(p,c),p.forEach(l)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,u)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(u,c)},i:E,o:E,d(e){e&&(l(t),l(n),l(i))}}}function z(s,t,r){let o;return k(s,P,n=>r(0,o=n)),[o]}let F=class extends q{constructor(t){super(),y(this,t,z,w,S,{})}};export{F as component}; +import{s as S,e as _,t as f,b as x,d,f as g,h,i as l,j,k as m,l as v,m as $,n as E,o as k}from"../chunks/scheduler.BYEMbWP1.js";import{S as q,i as y}from"../chunks/index.By7-O7ez.js";import{s as C}from"../chunks/entry.B8-zo55L.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",u;return{c(){t=_("h1"),o=f(r),n=x(),i=_("p"),u=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(l),n=j(e),i=d(e,"P",{});var p=g(i);u=h(p,c),p.forEach(l)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,u)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(u,c)},i:E,o:E,d(e){e&&(l(t),l(n),l(i))}}}function z(s,t,r){let o;return k(s,P,n=>r(0,o=n)),[o]}let F=class extends q{constructor(t){super(),y(this,t,z,w,S,{})}};export{F as component}; diff --git a/_app/immutable/nodes/2.DjBmDr6K.js b/_app/immutable/nodes/2.B-EZKrE_.js similarity index 90% rename from _app/immutable/nodes/2.DjBmDr6K.js rename to _app/immutable/nodes/2.B-EZKrE_.js index ed97332..1972f1c 100644 --- a/_app/immutable/nodes/2.DjBmDr6K.js +++ b/_app/immutable/nodes/2.B-EZKrE_.js @@ -1,8 +1,8 @@ -var Bk=Object.defineProperty;var Ok=(n,e,t)=>e in n?Bk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Xr=(n,e,t)=>(Ok(n,typeof e!="symbol"?e+"":e,t),t);import{A as os,O as Gb,P as Zb,s as At,p as Ot,k as ce,i as ee,Q as zc,o as bt,R as Ei,S as zi,n as Yt,c as yi,u as _i,g as vi,a as bi,x as Hr,T as gi,U as Er,z as $k,V as Hb,e as et,d as tt,f as Lt,v as Ke,W as B0,X as es,Y as fr,Z as Ym,b as qe,j as Ge,w as ki,_ as td,D as Nk,$ as Wb,r as As,a0 as Qr,a1 as da,t as xt,h as wt,l as _t,m as ai,a2 as yc,a3 as _c,a4 as Pi,a5 as Zg,a6 as jk,a7 as to,F as Vk,a8 as O0,a9 as Uk,aa as zs,ab as qk,y as bd}from"../chunks/scheduler.BYEMbWP1.js";import{a as fe,t as ae,S as Dt,i as Ft,g as vr,c as br,f as fi,b as Ae,d as Fe,m as ze,e as Le}from"../chunks/index.By7-O7ez.js";import{w as Yr,r as km}from"../chunks/index.Cin_jHdv.js";const Hg=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function _o(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Wg(n,e){fe(n,1,1,()=>{e.delete(n.key)})}function Xg(n,e,t,o,l,u,f,c,y,w,M,k){let T=n.length,z=u.length,F=T;const B={};for(;F--;)B[n[F].key]=F;const G=[],J=new Map,j=new Map,V=[];for(F=z;F--;){const Ee=k(l,u,F),Pe=t(Ee);let $e=f.get(Pe);$e?o&&V.push(()=>$e.p(Ee,e)):($e=w(Pe,Ee),$e.c()),J.set(Pe,G[F]=$e),Pe in B&&j.set(Pe,Math.abs(F-B[Pe]))}const me=new Set,X=new Set;function pe(Ee){ae(Ee,1),Ee.m(c,M),f.set(Ee.key,Ee),M=Ee.first,z--}for(;T&&z;){const Ee=G[z-1],Pe=n[T-1],$e=Ee.key,Ye=Pe.key;Ee===Pe?(M=Ee.first,T--,z--):J.has(Ye)?!f.has($e)||me.has($e)?pe(Ee):X.has(Ye)?T--:j.get($e)>j.get(Ye)?(X.add($e),pe(Ee)):(me.add(Ye),T--):(y(Pe,f),T--)}for(;T--;){const Ee=n[T];J.has(Ee.key)||y(Ee,f)}for(;z;)pe(G[z-1]);return os(V),G}function Ai(n,e){const t={},o={},l={$$scope:1};let u=n.length;for(;u--;){const f=n[u],c=e[u];if(c){for(const y in f)y in c||(o[y]=1);for(const y in c)l[y]||(t[y]=c[y],l[y]=1);n[u]=c}else for(const y in f)l[y]=1}for(const f in o)f in t||(t[f]=void 0);return t}function sn(n){return typeof n=="object"&&n!==null?n:{}}let Gk=Date.now();function pa(n){return`${n}-${Gk++}`}const Jg=Symbol.for("svelte-maplibre");function ma(){return Zb(Jg)}function Zk(n){let e=new WeakMap;return t=>{var f;let o=e.get(t.originalEvent);if(o!==void 0)return o;let u=(f=t.target.queryRenderedFeatures(t.point).find(c=>{var y;return(y=n.get(c.layer.id))==null?void 0:y.interactive}))==null?void 0:f.layer.id;return e.set(t.originalEvent,u),u}}function Hk(){let n=new Map;return Gb(Jg,{map:Yr(null),source:km(null),layer:km(null),popupTarget:km(null),cluster:Yr(),loadedImages:Yr(new Set),minzoom:Yr(0),maxzoom:Yr(24),layerEvent:Yr(null),layerInfo:n,eventTopMost:Zk(n)})}function $0(n){return{subscribe:n.subscribe}}function Kg({key:n,setPopupTarget:e=!1,setCluster:t=!1,setMouseEvent:o=!1}){let l=ma(),u=Yr(null),f=$0(u),c={...l,[n]:$0(u)};if(e&&(c.popupTarget=f),o){let y=Yr(null);c.layerEvent=y,l.layerEvent=y}return t&&(c.cluster=Yr()),Gb(Jg,c),{...l,self:u}}function Xb(){return Kg({key:"source",setCluster:!0})}function Wk(n=!0){return Kg({key:"layer",setPopupTarget:n,setMouseEvent:n})}function Xk(){return Kg({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function Jk(n){return"layerType"in n&&n.layerType==="deckgl"}var vc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Kd(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(o){var l=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:function(){return n[o]}})}),t}var Jb={exports:{}};/** +var Bk=Object.defineProperty;var Ok=(n,e,t)=>e in n?Bk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Jr=(n,e,t)=>(Ok(n,typeof e!="symbol"?e+"":e,t),t);import{A as ss,O as Gb,P as Zb,s as At,p as $t,k as ce,i as ee,Q as zc,o as bt,R as Ei,S as zi,n as Yt,c as yi,u as _i,g as vi,a as bi,x as Wr,T as gi,U as Er,z as $k,V as Hb,e as et,d as tt,f as Lt,v as Ke,W as B0,X as ts,Y as fr,Z as Ym,b as qe,j as Ge,w as ki,_ as td,D as Nk,$ as Wb,r as As,a0 as Qr,a1 as da,t as xt,h as wt,l as _t,m as ai,a2 as yc,a3 as _c,a4 as Pi,a5 as Zg,a6 as jk,a7 as to,F as Vk,a8 as O0,a9 as Uk,aa as zs,ab as qk,y as bd}from"../chunks/scheduler.BYEMbWP1.js";import{a as fe,t as ae,S as Dt,i as Ft,g as vr,c as br,f as fi,b as Ae,d as Fe,m as ze,e as Le}from"../chunks/index.By7-O7ez.js";import{w as Yr,r as km}from"../chunks/index.Cin_jHdv.js";const Hg=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function _o(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Wg(n,e){fe(n,1,1,()=>{e.delete(n.key)})}function Xg(n,e,t,o,l,u,f,c,y,w,M,k){let T=n.length,z=u.length,F=T;const B={};for(;F--;)B[n[F].key]=F;const G=[],J=new Map,j=new Map,V=[];for(F=z;F--;){const Ee=k(l,u,F),Pe=t(Ee);let $e=f.get(Pe);$e?o&&V.push(()=>$e.p(Ee,e)):($e=w(Pe,Ee),$e.c()),J.set(Pe,G[F]=$e),Pe in B&&j.set(Pe,Math.abs(F-B[Pe]))}const me=new Set,X=new Set;function pe(Ee){ae(Ee,1),Ee.m(c,M),f.set(Ee.key,Ee),M=Ee.first,z--}for(;T&&z;){const Ee=G[z-1],Pe=n[T-1],$e=Ee.key,Ye=Pe.key;Ee===Pe?(M=Ee.first,T--,z--):J.has(Ye)?!f.has($e)||me.has($e)?pe(Ee):X.has(Ye)?T--:j.get($e)>j.get(Ye)?(X.add($e),pe(Ee)):(me.add(Ye),T--):(y(Pe,f),T--)}for(;T--;){const Ee=n[T];J.has(Ee.key)||y(Ee,f)}for(;z;)pe(G[z-1]);return ss(V),G}function Ai(n,e){const t={},o={},l={$$scope:1};let u=n.length;for(;u--;){const f=n[u],c=e[u];if(c){for(const y in f)y in c||(o[y]=1);for(const y in c)l[y]||(t[y]=c[y],l[y]=1);n[u]=c}else for(const y in f)l[y]=1}for(const f in o)f in t||(t[f]=void 0);return t}function sn(n){return typeof n=="object"&&n!==null?n:{}}let Gk=Date.now();function pa(n){return`${n}-${Gk++}`}const Jg=Symbol.for("svelte-maplibre");function ma(){return Zb(Jg)}function Zk(n){let e=new WeakMap;return t=>{var f;let o=e.get(t.originalEvent);if(o!==void 0)return o;let u=(f=t.target.queryRenderedFeatures(t.point).find(c=>{var y;return(y=n.get(c.layer.id))==null?void 0:y.interactive}))==null?void 0:f.layer.id;return e.set(t.originalEvent,u),u}}function Hk(){let n=new Map;return Gb(Jg,{map:Yr(null),source:km(null),layer:km(null),popupTarget:km(null),cluster:Yr(),loadedImages:Yr(new Set),minzoom:Yr(0),maxzoom:Yr(24),layerEvent:Yr(null),layerInfo:n,eventTopMost:Zk(n)})}function $0(n){return{subscribe:n.subscribe}}function Kg({key:n,setPopupTarget:e=!1,setCluster:t=!1,setMouseEvent:o=!1}){let l=ma(),u=Yr(null),f=$0(u),c={...l,[n]:$0(u)};if(e&&(c.popupTarget=f),o){let y=Yr(null);c.layerEvent=y,l.layerEvent=y}return t&&(c.cluster=Yr()),Gb(Jg,c),{...l,self:u}}function Xb(){return Kg({key:"source",setCluster:!0})}function Wk(n=!0){return Kg({key:"layer",setPopupTarget:n,setMouseEvent:n})}function Xk(){return Kg({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function Jk(n){return"layerType"in n&&n.layerType==="deckgl"}var vc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Kd(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(o){var l=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:function(){return n[o]}})}),t}var Jb={exports:{}};/** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.5.0/LICENSE.txt - */(function(n,e){(function(t,o){n.exports=o()})(vc,function(){var t={},o={};function l(f,c,y){if(o[f]=y,f==="index"){var w="var sharedModule = {}; ("+o.shared+")(sharedModule); ("+o.worker+")(sharedModule);",M={};return o.shared(M),o.index(t,M),typeof window<"u"&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),t}}l("shared",["exports"],function(f){function c(s,r,a,d){return new(a||(a=Promise))(function(m,_){function x(A){try{P(d.next(A))}catch(D){_(D)}}function S(A){try{P(d.throw(A))}catch(D){_(D)}}function P(A){var D;A.done?m(A.value):(D=A.value,D instanceof a?D:new a(function(R){R(D)})).then(x,S)}P((d=d.apply(s,r||[])).next())})}function y(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}typeof SuppressedError=="function"&&SuppressedError;var w=M;function M(s,r){this.x=s,this.y=r}M.prototype={clone:function(){return new M(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,r){return this.clone()._rotateAround(s,r)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var r=s.x-this.x,a=s.y-this.y;return r*r+a*a},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,r){return Math.atan2(this.x*r-this.y*s,this.x*s+this.y*r)},_matMult:function(s){var r=s[2]*this.x+s[3]*this.y;return this.x=s[0]*this.x+s[1]*this.y,this.y=r,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var r=Math.cos(s),a=Math.sin(s),d=a*this.x+r*this.y;return this.x=r*this.x-a*this.y,this.y=d,this},_rotateAround:function(s,r){var a=Math.cos(s),d=Math.sin(s),m=r.y+d*(this.x-r.x)+a*(this.y-r.y);return this.x=r.x+a*(this.x-r.x)-d*(this.y-r.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},M.convert=function(s){return s instanceof M?s:Array.isArray(s)?new M(s[0],s[1]):s};var k=y(w),T=z;function z(s,r,a,d){this.cx=3*s,this.bx=3*(a-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(d-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=r,this.p2x=a,this.p2y=d}z.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,r){if(r===void 0&&(r=1e-6),s<0)return 0;if(s>1)return 1;for(var a=s,d=0;d<8;d++){var m=this.sampleCurveX(a)-s;if(Math.abs(m)m?x=a:S=a,a=.5*(S-x)+x;return a},solve:function(s,r){return this.sampleCurveY(this.solveCurveX(s,r))}};var F=y(T);let B,G;function J(){return B==null&&(B=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),B}function j(){if(G==null&&(G=!1,J())){const r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let d=0;d<5*5;d++){const m=4*d;r.fillStyle=`rgb(${m},${m+1},${m+2})`,r.fillRect(d%5,Math.floor(d/5),1,1)}const a=r.getImageData(0,0,5,5).data;for(let d=0;d<5*5*4;d++)if(d%4!=3&&a[d]!==d){G=!0;break}}}return G||!1}function V(s,r,a,d){const m=new F(s,r,a,d);return _=>m.solve(_)}const me=V(.25,.1,.25,1);function X(s,r,a){return Math.min(a,Math.max(r,s))}function pe(s,r,a){const d=a-r,m=((s-r)%d+d)%d+r;return m===r?a:m}function Ee(s,...r){for(const a of r)for(const d in a)s[d]=a[d];return s}let Pe=1;function $e(s,r,a){const d={};for(const m in s)d[m]=r.call(this,s[m],m,s);return d}function Ye(s,r,a){const d={};for(const m in s)r.call(this,s[m],m,s)&&(d[m]=s[m]);return d}function ve(s){return Array.isArray(s)?s.map(ve):typeof s=="object"&&s?$e(s,ve):s}const We={};function at(s){We[s]||(typeof console<"u"&&console.warn(s),We[s]=!0)}function mt(s,r,a){return(a.y-s.y)*(r.x-s.x)>(r.y-s.y)*(a.x-s.x)}function Ht(s){return typeof WorkerGlobalScope<"u"&&s!==void 0&&s instanceof WorkerGlobalScope}let qt=null;function Ue(s){return typeof ImageBitmap<"u"&&s instanceof ImageBitmap}const Xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Zt(s,r,a,d,m){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const _=new VideoFrame(s,{timestamp:0});try{const x=_==null?void 0:_.format;if(!x||!x.startsWith("BGR")&&!x.startsWith("RGB"))throw new Error(`Unrecognized format ${x}`);const S=x.startsWith("BGR"),P=new Uint8ClampedArray(d*m*4);if(yield _.copyTo(P,function(A,D,R,N,Z){const W=4*Math.max(-D,0),Q=(Math.max(0,R)-R)*N*4+W,ie=4*N,he=Math.max(0,D),ke=Math.max(0,R);return{rect:{x:he,y:ke,width:Math.min(A.width,D+N)-he,height:Math.min(A.height,R+Z)-ke},layout:[{offset:Q,stride:ie}]}}(s,r,a,d,m)),S)for(let A=0;AHt(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ni=function(s,r){if(/:\/\//.test(s.url)&&!/^https?:|^file:/.test(s.url)){const d=ct(s.url);if(d)return d(s,r);if(Ht(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,targetMapId:tr},r)}if(!(/^file:/.test(a=s.url)||/^file:/.test(rr())&&!/^\w+:/.test(a))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(d,m){return c(this,void 0,void 0,function*(){const _=new Request(d.url,{method:d.method||"GET",body:d.body,credentials:d.credentials,headers:d.headers,cache:d.cache,referrer:rr(),signal:m.signal});d.type!=="json"||_.headers.has("Accept")||_.headers.set("Accept","application/json");const x=yield fetch(_);if(!x.ok){const A=yield x.blob();throw new rt(x.status,x.statusText,d.url,A)}let S;S=d.type==="arrayBuffer"||d.type==="image"?x.arrayBuffer():d.type==="json"?x.json():x.text();const P=yield S;if(m.signal.aborted)throw wr();return{data:P,cacheControl:x.headers.get("Cache-Control"),expires:x.headers.get("Expires")}})}(s,r);if(Ht(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,mustQueue:!0,targetMapId:tr},r)}var a;return function(d,m){return new Promise((_,x)=>{var S;const P=new XMLHttpRequest;P.open(d.method||"GET",d.url,!0),d.type!=="arrayBuffer"&&d.type!=="image"||(P.responseType="arraybuffer");for(const A in d.headers)P.setRequestHeader(A,d.headers[A]);d.type==="json"&&(P.responseType="text",!((S=d.headers)===null||S===void 0)&&S.Accept||P.setRequestHeader("Accept","application/json")),P.withCredentials=d.credentials==="include",P.onerror=()=>{x(new Error(P.statusText))},P.onload=()=>{if(!m.signal.aborted)if((P.status>=200&&P.status<300||P.status===0)&&P.response!==null){let A=P.response;if(d.type==="json")try{A=JSON.parse(P.response)}catch(D){return void x(D)}_({data:A,cacheControl:P.getResponseHeader("Cache-Control"),expires:P.getResponseHeader("Expires")})}else{const A=new Blob([P.response],{type:P.getResponseHeader("Content-Type")});x(new rt(P.status,P.statusText,d.url,A))}},m.signal.addEventListener("abort",()=>{P.abort(),x(wr())}),P.send(d.body)})}(s,r)};function cr(s){if(!s||s.indexOf("://")<=0||s.indexOf("data:image/")===0||s.indexOf("blob:")===0)return!0;const r=new URL(s),a=window.location;return r.protocol===a.protocol&&r.host===a.host}function li(s,r,a){a[s]&&a[s].indexOf(r)!==-1||(a[s]=a[s]||[],a[s].push(r))}function Bi(s,r,a){if(a&&a[s]){const d=a[s].indexOf(r);d!==-1&&a[s].splice(d,1)}}class Se{constructor(r,a={}){Ee(this,a),this.type=r}}class Be extends Se{constructor(r,a={}){super("error",Ee({error:r},a))}}class nr{on(r,a){return this._listeners=this._listeners||{},li(r,a,this._listeners),this}off(r,a){return Bi(r,a,this._listeners),Bi(r,a,this._oneTimeListeners),this}once(r,a){return a?(this._oneTimeListeners=this._oneTimeListeners||{},li(r,a,this._oneTimeListeners),this):new Promise(d=>this.once(r,d))}fire(r,a){typeof r=="string"&&(r=new Se(r,a||{}));const d=r.type;if(this.listens(d)){r.target=this;const m=this._listeners&&this._listeners[d]?this._listeners[d].slice():[];for(const S of m)S.call(this,r);const _=this._oneTimeListeners&&this._oneTimeListeners[d]?this._oneTimeListeners[d].slice():[];for(const S of _)Bi(d,S,this._oneTimeListeners),S.call(this,r);const x=this._eventedParent;x&&(Ee(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(r))}else r instanceof Be&&console.error(r.error);return this}listens(r){return this._listeners&&this._listeners[r]&&this._listeners[r].length>0||this._oneTimeListeners&&this._oneTimeListeners[r]&&this._oneTimeListeners[r].length>0||this._eventedParent&&this._eventedParent.listens(r)}setEventedParent(r,a){return this._eventedParent=r,this._eventedParentData=a,this}}var Te={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const Mi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function cn(s,r){const a={};for(const d in s)d!=="ref"&&(a[d]=s[d]);return Mi.forEach(d=>{d in r&&(a[d]=r[d])}),a}function ur(s,r){if(Array.isArray(s)){if(!Array.isArray(r)||s.length!==r.length)return!1;for(let a=0;a`:s.itemType.kind==="value"?"array":`array<${r}>`}return s.kind}const Y=[Oo,lt,er,Nt,un,So,On,q(Wt),$o,so,le];function oe(s,r){if(r.kind==="error")return null;if(s.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!oe(s.itemType,r.itemType))&&(typeof s.N!="number"||s.N===r.N))return null}else{if(s.kind===r.kind)return null;if(s.kind==="value"){for(const a of Y)if(!oe(a,r))return null}}return`Expected ${U(s)} but found ${U(r)} instead.`}function _e(s,r){return r.some(a=>a.kind===s.kind)}function be(s,r){return r.some(a=>a==="null"?s===null:a==="array"?Array.isArray(s):a==="object"?s&&!Array.isArray(s)&&typeof s=="object":a===typeof s)}function Me(s,r){return s.kind==="array"&&r.kind==="array"?s.itemType.kind===r.itemType.kind&&typeof s.N=="number":s.kind===r.kind}const de=.96422,Oe=.82521,Ze=4/29,De=6/29,ot=3*De*De,Ct=De*De*De,Rt=Math.PI/180,Kt=180/Math.PI;function pr(s){return(s%=360)<0&&(s+=360),s}function Xt([s,r,a,d]){let m,_;const x=ri((.2225045*(s=Cr(s))+.7168786*(r=Cr(r))+.0606169*(a=Cr(a)))/1);s===r&&r===a?m=_=x:(m=ri((.4360747*s+.3850649*r+.1430804*a)/de),_=ri((.0139322*s+.0971045*r+.7141733*a)/Oe));const S=116*x-16;return[S<0?0:S,500*(m-x),200*(x-_),d]}function Cr(s){return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}function ri(s){return s>Ct?Math.pow(s,1/3):s/ot+Ze}function di([s,r,a,d]){let m=(s+16)/116,_=isNaN(r)?m:m+r/500,x=isNaN(a)?m:m-a/200;return m=1*Sr(m),_=de*Sr(_),x=Oe*Sr(x),[ir(3.1338561*_-1.6168667*m-.4906146*x),ir(-.9787684*_+1.9161415*m+.033454*x),ir(.0719453*_-.2289914*m+1.4052427*x),d]}function ir(s){return(s=s<=.00304?12.92*s:1.055*Math.pow(s,1/2.4)-.055)<0?0:s>1?1:s}function Sr(s){return s>De?s*s*s:ot*(s-Ze)}function Gr(s){return parseInt(s.padEnd(2,s),16)/255}function xi(s,r){return Oi(r?s/100:s,0,1)}function Oi(s,r,a){return Math.min(Math.max(r,s),a)}function $i(s){return!s.some(Number.isNaN)}const Ma={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class kr{constructor(r,a,d,m=1,_=!0){this.r=r,this.g=a,this.b=d,this.a=m,_||(this.r*=m,this.g*=m,this.b*=m,m||this.overwriteGetter("rgb",[r,a,d,m]))}static parse(r){if(r instanceof kr)return r;if(typeof r!="string")return;const a=function(d){if((d=d.toLowerCase().trim())==="transparent")return[0,0,0,0];const m=Ma[d];if(m){const[x,S,P]=m;return[x/255,S/255,P/255,1]}if(d.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(d)){const x=d.length<6?1:2;let S=1;return[Gr(d.slice(S,S+=x)),Gr(d.slice(S,S+=x)),Gr(d.slice(S,S+=x)),Gr(d.slice(S,S+x)||"ff")]}if(d.startsWith("rgb")){const x=d.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[S,P,A,D,R,N,Z,W,Q,ie,he,ke]=x,ge=[D||" ",Z||" ",ie].join("");if(ge===" "||ge===" /"||ge===",,"||ge===",,,"){const we=[A,N,Q].join(""),Re=we==="%%%"?100:we===""?255:0;if(Re){const He=[Oi(+P/Re,0,1),Oi(+R/Re,0,1),Oi(+W/Re,0,1),he?xi(+he,ke):1];if($i(He))return He}}return}}const _=d.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(_){const[x,S,P,A,D,R,N,Z,W]=_,Q=[P||" ",D||" ",N].join("");if(Q===" "||Q===" /"||Q===",,"||Q===",,,"){const ie=[+S,Oi(+A,0,100),Oi(+R,0,100),Z?xi(+Z,W):1];if($i(ie))return function([he,ke,ge,we]){function Re(He){const ht=(He+he/30)%12,zt=ke*Math.min(ge,1-ge);return ge-zt*Math.max(-1,Math.min(ht-3,9-ht,1))}return he=pr(he),ke/=100,ge/=100,[Re(0),Re(8),Re(4),we]}(ie)}}}(r);return a?new kr(...a,!1):void 0}get rgb(){const{r,g:a,b:d,a:m}=this,_=m||1/0;return this.overwriteGetter("rgb",[r/_,a/_,d/_,m])}get hcl(){return this.overwriteGetter("hcl",function(r){const[a,d,m,_]=Xt(r),x=Math.sqrt(d*d+m*m);return[Math.round(1e4*x)?pr(Math.atan2(m,d)*Kt):NaN,x,a,_]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Xt(this.rgb))}overwriteGetter(r,a){return Object.defineProperty(this,r,{value:a}),a}toString(){const[r,a,d,m]=this.rgb;return`rgba(${[r,a,d].map(_=>Math.round(255*_)).join(",")},${m})`}}kr.black=new kr(0,0,0,1),kr.white=new kr(1,1,1,1),kr.transparent=new kr(0,0,0,0),kr.red=new kr(1,0,0,1);class Oc{constructor(r,a,d){this.sensitivity=r?a?"variant":"case":a?"accent":"base",this.locale=d,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(r,a){return this.collator.compare(r,a)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class $c{constructor(r,a,d,m,_){this.text=r,this.image=a,this.scale=d,this.fontStack=m,this.textColor=_}}class xn{constructor(r){this.sections=r}static fromString(r){return new xn([new $c(r,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(r=>r.text.length!==0||r.image&&r.image.name.length!==0)}static factory(r){return r instanceof xn?r:xn.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}}class wn{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof wn)return r;if(typeof r=="number")return new wn([r,r,r,r]);if(Array.isArray(r)&&!(r.length<1||r.length>4)){for(const a of r)if(typeof a!="number")return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]]}return new wn(r)}}toString(){return JSON.stringify(this.values)}}const pp=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Sn{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof Sn)return r;if(Array.isArray(r)&&!(r.length<1)&&r.length%2==0){for(let a=0;a=0&&s<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof a=="number"&&a>=0&&a<=255?d===void 0||typeof d=="number"&&d>=0&&d<=1?null:`Invalid rgba value [${[s,r,a,d].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof d=="number"?[s,r,a,d]:[s,r,a]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ia(s){if(s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"||s instanceof kr||s instanceof Oc||s instanceof xn||s instanceof wn||s instanceof Sn||s instanceof Ni)return!0;if(Array.isArray(s)){for(const r of s)if(!Ia(r))return!1;return!0}if(typeof s=="object"){for(const r in s)if(!Ia(s[r]))return!1;return!0}return!1}function pi(s){if(s===null)return Oo;if(typeof s=="string")return er;if(typeof s=="boolean")return Nt;if(typeof s=="number")return lt;if(s instanceof kr)return un;if(s instanceof Oc)return oo;if(s instanceof xn)return So;if(s instanceof wn)return $o;if(s instanceof Sn)return le;if(s instanceof Ni)return so;if(Array.isArray(s)){const r=s.length;let a;for(const d of s){const m=pi(d);if(a){if(a===m)continue;a=Wt;break}a=m}return q(a||Wt,r)}return On}function ko(s){const r=typeof s;return s===null?"":r==="string"||r==="number"||r==="boolean"?String(s):s instanceof kr||s instanceof xn||s instanceof wn||s instanceof Sn||s instanceof Ni?s.toString():JSON.stringify(s)}class ls{constructor(r,a){this.type=r,this.value=a}static parse(r,a){if(r.length!==2)return a.error(`'literal' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!Ia(r[1]))return a.error("invalid value");const d=r[1];let m=pi(d);const _=a.expectedType;return m.kind!=="array"||m.N!==0||!_||_.kind!=="array"||typeof _.N=="number"&&_.N!==0||(m=_),new ls(m,d)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ci{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}}const gl={string:er,number:lt,boolean:Nt,object:On};class Dn{constructor(r,a){this.type=r,this.args=a}static parse(r,a){if(r.length<2)return a.error("Expected at least one argument.");let d,m=1;const _=r[0];if(_==="array"){let S,P;if(r.length>2){const A=r[1];if(typeof A!="string"||!(A in gl)||A==="object")return a.error('The item type argument of "array" must be one of string, number, boolean',1);S=gl[A],m++}else S=Wt;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return a.error('The length argument to "array" must be a positive integer literal',2);P=r[2],m++}d=q(S,P)}else{if(!gl[_])throw new Error(`Types doesn't contain name = ${_}`);d=gl[_]}const x=[];for(;mr.outputDefined())}}const Ta={"to-boolean":Nt,"to-color":un,"to-number":lt,"to-string":er};class No{constructor(r,a){this.type=r,this.args=a}static parse(r,a){if(r.length<2)return a.error("Expected at least one argument.");const d=r[0];if(!Ta[d])throw new Error(`Can't parse ${d} as it is not part of the known types`);if((d==="to-boolean"||d==="to-string")&&r.length!==2)return a.error("Expected one argument.");const m=Ta[d],_=[];for(let x=1;x4?`Invalid rbga value ${JSON.stringify(a)}: expected an array containing either three or four numeric values.`:ml(a[0],a[1],a[2],a[3]),!d))return new kr(a[0]/255,a[1]/255,a[2]/255,a[3])}throw new ci(d||`Could not parse color from value '${typeof a=="string"?a:JSON.stringify(a)}'`)}case"padding":{let a;for(const d of this.args){a=d.evaluate(r);const m=wn.parse(a);if(m)return m}throw new ci(`Could not parse padding from value '${typeof a=="string"?a:JSON.stringify(a)}'`)}case"variableAnchorOffsetCollection":{let a;for(const d of this.args){a=d.evaluate(r);const m=Sn.parse(a);if(m)return m}throw new ci(`Could not parse variableAnchorOffsetCollection from value '${typeof a=="string"?a:JSON.stringify(a)}'`)}case"number":{let a=null;for(const d of this.args){if(a=d.evaluate(r),a===null)return 0;const m=Number(a);if(!isNaN(m))return m}throw new ci(`Could not convert ${JSON.stringify(a)} to number.`)}case"formatted":return xn.fromString(ko(this.args[0].evaluate(r)));case"resolvedImage":return Ni.fromString(ko(this.args[0].evaluate(r)));default:return ko(this.args[0].evaluate(r))}}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}const Nc=["Unknown","Point","LineString","Polygon"];class Ca{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Nc[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(r){let a=this._parseColorCache[r];return a||(a=this._parseColorCache[r]=kr.parse(r)),a}}class jo{constructor(r,a,d=[],m,_=new no,x=[]){this.registry=r,this.path=d,this.key=d.map(S=>`[${S}]`).join(""),this.scope=_,this.errors=x,this.expectedType=m,this._isConstant=a}parse(r,a,d,m,_={}){return a?this.concat(a,d,m)._parse(r,_):this._parse(r,_)}_parse(r,a){function d(m,_,x){return x==="assert"?new Dn(_,[m]):x==="coerce"?new No(_,[m]):m}if(r!==null&&typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"||(r=["literal",r]),Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const m=r[0];if(typeof m!="string")return this.error(`Expression name must be a string, but found ${typeof m} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const _=this.registry[m];if(_){let x=_.parse(r,this);if(!x)return null;if(this.expectedType){const S=this.expectedType,P=x.type;if(S.kind!=="string"&&S.kind!=="number"&&S.kind!=="boolean"&&S.kind!=="object"&&S.kind!=="array"||P.kind!=="value")if(S.kind!=="color"&&S.kind!=="formatted"&&S.kind!=="resolvedImage"||P.kind!=="value"&&P.kind!=="string")if(S.kind!=="padding"||P.kind!=="value"&&P.kind!=="number"&&P.kind!=="array")if(S.kind!=="variableAnchorOffsetCollection"||P.kind!=="value"&&P.kind!=="array"){if(this.checkSubtype(S,P))return null}else x=d(x,S,a.typeAnnotation||"coerce");else x=d(x,S,a.typeAnnotation||"coerce");else x=d(x,S,a.typeAnnotation||"coerce");else x=d(x,S,a.typeAnnotation||"assert")}if(!(x instanceof ls)&&x.type.kind!=="resolvedImage"&&this._isConstant(x)){const S=new Ca;try{x=new ls(x.type,x.evaluate(S))}catch(P){return this.error(P.message),null}}return x}return this.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(r===void 0?"'undefined' value invalid. Use null instead.":typeof r=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof r} instead.`)}concat(r,a,d){const m=typeof r=="number"?this.path.concat(r):this.path,_=d?this.scope.concat(d):this.scope;return new jo(this.registry,this._isConstant,m,a||null,_,this.errors)}error(r,...a){const d=`${this.key}${a.map(m=>`[${m}]`).join("")}`;this.errors.push(new Yi(d,r))}checkSubtype(r,a){const d=oe(r,a);return d&&this.error(d),d}}class _r{constructor(r,a){this.type=a.type,this.bindings=[].concat(r),this.result=a}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(const a of this.bindings)r(a[1]);r(this.result)}static parse(r,a){if(r.length<4)return a.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);const d=[];for(let _=1;_=d.length)throw new ci(`Array index out of bounds: ${a} > ${d.length-1}.`);if(a!==Math.floor(a))throw new ci(`Array index must be an integer, but found ${a} instead.`);return d[a]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}}class Aa{constructor(r,a){this.type=Nt,this.needle=r,this.haystack=a}static parse(r,a){if(r.length!==3)return a.error(`Expected 2 arguments, but found ${r.length-1} instead.`);const d=a.parse(r[1],1,Wt),m=a.parse(r[2],2,Wt);return d&&m?_e(d.type,[Nt,er,lt,Oo,Wt])?new Aa(d,m):a.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(d.type)} instead`):null}evaluate(r){const a=this.needle.evaluate(r),d=this.haystack.evaluate(r);if(!d)return!1;if(!be(a,["boolean","string","number","null"]))throw new ci(`Expected first argument to be of type boolean, string, number or null, but found ${U(pi(a))} instead.`);if(!be(d,["string","array"]))throw new ci(`Expected second argument to be of type array or string, but found ${U(pi(d))} instead.`);return d.indexOf(a)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}}class _l{constructor(r,a,d){this.type=lt,this.needle=r,this.haystack=a,this.fromIndex=d}static parse(r,a){if(r.length<=2||r.length>=5)return a.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const d=a.parse(r[1],1,Wt),m=a.parse(r[2],2,Wt);if(!d||!m)return null;if(!_e(d.type,[Nt,er,lt,Oo,Wt]))return a.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(d.type)} instead`);if(r.length===4){const _=a.parse(r[3],3,lt);return _?new _l(d,m,_):null}return new _l(d,m)}evaluate(r){const a=this.needle.evaluate(r),d=this.haystack.evaluate(r);if(!be(a,["boolean","string","number","null"]))throw new ci(`Expected first argument to be of type boolean, string, number or null, but found ${U(pi(a))} instead.`);if(!be(d,["string","array"]))throw new ci(`Expected second argument to be of type array or string, but found ${U(pi(d))} instead.`);if(this.fromIndex){const m=this.fromIndex.evaluate(r);return d.indexOf(a,m)}return d.indexOf(a)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}}class vl{constructor(r,a,d,m,_,x){this.inputType=r,this.type=a,this.input=d,this.cases=m,this.outputs=_,this.otherwise=x}static parse(r,a){if(r.length<5)return a.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return a.error("Expected an even number of arguments.");let d,m;a.expectedType&&a.expectedType.kind!=="value"&&(m=a.expectedType);const _={},x=[];for(let A=2;ANumber.MAX_SAFE_INTEGER)return N.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof W=="number"&&Math.floor(W)!==W)return N.error("Numeric branch labels must be integer values.");if(d){if(N.checkSubtype(d,pi(W)))return null}else d=pi(W);if(_[String(W)]!==void 0)return N.error("Branch labels must be unique.");_[String(W)]=x.length}const Z=a.parse(R,A,m);if(!Z)return null;m=m||Z.type,x.push(Z)}const S=a.parse(r[1],1,Wt);if(!S)return null;const P=a.parse(r[r.length-1],r.length-1,m);return P?S.type.kind!=="value"&&a.concat(1).checkSubtype(d,S.type)?null:new vl(d,m,S,_,x,P):null}evaluate(r){const a=this.input.evaluate(r);return(pi(a)===this.inputType&&this.outputs[this.cases[a]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}}class bl{constructor(r,a,d){this.type=r,this.branches=a,this.otherwise=d}static parse(r,a){if(r.length<4)return a.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!=0)return a.error("Expected an odd number of arguments.");let d;a.expectedType&&a.expectedType.kind!=="value"&&(d=a.expectedType);const m=[];for(let x=1;xa.outputDefined())&&this.otherwise.outputDefined()}}class xl{constructor(r,a,d,m){this.type=r,this.input=a,this.beginIndex=d,this.endIndex=m}static parse(r,a){if(r.length<=2||r.length>=5)return a.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const d=a.parse(r[1],1,Wt),m=a.parse(r[2],2,lt);if(!d||!m)return null;if(!_e(d.type,[q(Wt),er,Wt]))return a.error(`Expected first argument to be of type array or string, but found ${U(d.type)} instead`);if(r.length===4){const _=a.parse(r[3],3,lt);return _?new xl(d.type,d,m,_):null}return new xl(d.type,d,m)}evaluate(r){const a=this.input.evaluate(r),d=this.beginIndex.evaluate(r);if(!be(a,["string","array"]))throw new ci(`Expected first argument to be of type array or string, but found ${U(pi(a))} instead.`);if(this.endIndex){const m=this.endIndex.evaluate(r);return a.slice(d,m)}return a.slice(d)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}}function za(s,r){const a=s.length-1;let d,m,_=0,x=a,S=0;for(;_<=x;)if(S=Math.floor((_+x)/2),d=s[S],m=s[S+1],d<=r){if(S===a||rr))throw new ci("Input is not a number.");x=S-1}return 0}class Os{constructor(r,a,d){this.type=r,this.input=a,this.labels=[],this.outputs=[];for(const[m,_]of d)this.labels.push(m),this.outputs.push(_)}static parse(r,a){if(r.length-1<4)return a.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return a.error("Expected an even number of arguments.");const d=a.parse(r[1],1,lt);if(!d)return null;const m=[];let _=null;a.expectedType&&a.expectedType.kind!=="value"&&(_=a.expectedType);for(let x=1;x=S)return a.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);const R=a.parse(P,D,_);if(!R)return null;_=_||R.type,m.push([S,R])}return new Os(_,d,m)}evaluate(r){const a=this.labels,d=this.outputs;if(a.length===1)return d[0].evaluate(r);const m=this.input.evaluate(r);if(m<=a[0])return d[0].evaluate(r);const _=a.length;return m>=a[_-1]?d[_-1].evaluate(r):d[za(a,m)].evaluate(r)}eachChild(r){r(this.input);for(const a of this.outputs)r(a)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function mp(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var gp=Oh;function Oh(s,r,a,d){this.cx=3*s,this.bx=3*(a-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(d-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=r,this.p2x=a,this.p2y=d}Oh.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,r){if(r===void 0&&(r=1e-6),s<0)return 0;if(s>1)return 1;for(var a=s,d=0;d<8;d++){var m=this.sampleCurveX(a)-s;if(Math.abs(m)m?x=a:S=a,a=.5*(S-x)+x;return a},solve:function(s,r){return this.sampleCurveY(this.solveCurveX(s,r))}};var yp=mp(gp);function Vo(s,r,a){return s+a*(r-s)}function La(s,r,a){return s.map((d,m)=>Vo(d,r[m],a))}const kn={number:Vo,color:function(s,r,a,d="rgb"){switch(d){case"rgb":{const[m,_,x,S]=La(s.rgb,r.rgb,a);return new kr(m,_,x,S,!1)}case"hcl":{const[m,_,x,S]=s.hcl,[P,A,D,R]=r.hcl;let N,Z;if(isNaN(m)||isNaN(P))isNaN(m)?isNaN(P)?N=NaN:(N=P,x!==1&&x!==0||(Z=A)):(N=m,D!==1&&D!==0||(Z=_));else{let ke=P-m;P>m&&ke>180?ke-=360:P180&&(ke+=360),N=m+a*ke}const[W,Q,ie,he]=function([ke,ge,we,Re]){return ke=isNaN(ke)?0:ke*Rt,di([we,Math.cos(ke)*ge,Math.sin(ke)*ge,Re])}([N,Z??Vo(_,A,a),Vo(x,D,a),Vo(S,R,a)]);return new kr(W,Q,ie,he,!1)}case"lab":{const[m,_,x,S]=di(La(s.lab,r.lab,a));return new kr(m,_,x,S,!1)}}},array:La,padding:function(s,r,a){return new wn(La(s.values,r.values,a))},variableAnchorOffsetCollection:function(s,r,a){const d=s.values,m=r.values;if(d.length!==m.length)throw new ci(`Cannot interpolate values of different length. from: ${s.toString()}, to: ${r.toString()}`);const _=[];for(let x=0;xtypeof D!="number"||D<0||D>1))return a.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:A}}}if(r.length-1<4)return a.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return a.error("Expected an even number of arguments.");if(_=a.parse(_,2,lt),!_)return null;const S=[];let P=null;d==="interpolate-hcl"||d==="interpolate-lab"?P=un:a.expectedType&&a.expectedType.kind!=="value"&&(P=a.expectedType);for(let A=0;A=D)return a.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',N);const W=a.parse(R,Z,P);if(!W)return null;P=P||W.type,S.push([D,W])}return Me(P,lt)||Me(P,un)||Me(P,$o)||Me(P,le)||Me(P,q(lt))?new En(P,d,m,_,S):a.error(`Type ${U(P)} is not interpolatable.`)}evaluate(r){const a=this.labels,d=this.outputs;if(a.length===1)return d[0].evaluate(r);const m=this.input.evaluate(r);if(m<=a[0])return d[0].evaluate(r);const _=a.length;if(m>=a[_-1])return d[_-1].evaluate(r);const x=za(a,m),S=En.interpolationFactor(this.interpolation,m,a[x],a[x+1]),P=d[x].evaluate(r),A=d[x+1].evaluate(r);switch(this.operator){case"interpolate":return kn[this.type.kind](P,A,S);case"interpolate-hcl":return kn.color(P,A,S,"hcl");case"interpolate-lab":return kn.color(P,A,S,"lab")}}eachChild(r){r(this.input);for(const a of this.outputs)r(a)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function Da(s,r,a,d){const m=d-a,_=s-a;return m===0?0:r===1?_/m:(Math.pow(r,_)-1)/(Math.pow(r,m)-1)}class wl{constructor(r,a){this.type=r,this.args=a}static parse(r,a){if(r.length<2)return a.error("Expectected at least one argument.");let d=null;const m=a.expectedType;m&&m.kind!=="value"&&(d=m);const _=[];for(const S of r.slice(1)){const P=a.parse(S,1+_.length,d,void 0,{typeAnnotation:"omit"});if(!P)return null;d=d||P.type,_.push(P)}if(!d)throw new Error("No output type");const x=m&&_.some(S=>oe(m,S.type));return new wl(x?Wt:d,_)}evaluate(r){let a,d=null,m=0;for(const _ of this.args)if(m++,d=_.evaluate(r),d&&d instanceof Ni&&!d.available&&(a||(a=d.name),d=null,m===this.args.length&&(d=a)),d!==null)break;return d}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}function $h(s,r){return s==="=="||s==="!="?r.kind==="boolean"||r.kind==="string"||r.kind==="number"||r.kind==="null"||r.kind==="value":r.kind==="string"||r.kind==="number"||r.kind==="value"}function Nh(s,r,a,d){return d.compare(r,a)===0}function cs(s,r,a){const d=s!=="=="&&s!=="!=";return class Kb{constructor(_,x,S){this.type=Nt,this.lhs=_,this.rhs=x,this.collator=S,this.hasUntypedArgument=_.type.kind==="value"||x.type.kind==="value"}static parse(_,x){if(_.length!==3&&_.length!==4)return x.error("Expected two or three arguments.");const S=_[0];let P=x.parse(_[1],1,Wt);if(!P)return null;if(!$h(S,P.type))return x.concat(1).error(`"${S}" comparisons are not supported for type '${U(P.type)}'.`);let A=x.parse(_[2],2,Wt);if(!A)return null;if(!$h(S,A.type))return x.concat(2).error(`"${S}" comparisons are not supported for type '${U(A.type)}'.`);if(P.type.kind!==A.type.kind&&P.type.kind!=="value"&&A.type.kind!=="value")return x.error(`Cannot compare types '${U(P.type)}' and '${U(A.type)}'.`);d&&(P.type.kind==="value"&&A.type.kind!=="value"?P=new Dn(A.type,[P]):P.type.kind!=="value"&&A.type.kind==="value"&&(A=new Dn(P.type,[A])));let D=null;if(_.length===4){if(P.type.kind!=="string"&&A.type.kind!=="string"&&P.type.kind!=="value"&&A.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(D=x.parse(_[3],3,oo),!D)return null}return new Kb(P,A,D)}evaluate(_){const x=this.lhs.evaluate(_),S=this.rhs.evaluate(_);if(d&&this.hasUntypedArgument){const P=pi(x),A=pi(S);if(P.kind!==A.kind||P.kind!=="string"&&P.kind!=="number")throw new ci(`Expected arguments for "${s}" to be (string, string) or (number, number), but found (${P.kind}, ${A.kind}) instead.`)}if(this.collator&&!d&&this.hasUntypedArgument){const P=pi(x),A=pi(S);if(P.kind!=="string"||A.kind!=="string")return r(_,x,S)}return this.collator?a(_,x,S,this.collator.evaluate(_)):r(_,x,S)}eachChild(_){_(this.lhs),_(this.rhs),this.collator&&_(this.collator)}outputDefined(){return!0}}}const jh=cs("==",function(s,r,a){return r===a},Nh),_p=cs("!=",function(s,r,a){return r!==a},function(s,r,a,d){return!Nh(0,r,a,d)}),vp=cs("<",function(s,r,a){return r",function(s,r,a){return r>a},function(s,r,a,d){return d.compare(r,a)>0}),Uh=cs("<=",function(s,r,a){return r<=a},function(s,r,a,d){return d.compare(r,a)<=0}),bp=cs(">=",function(s,r,a){return r>=a},function(s,r,a,d){return d.compare(r,a)>=0});class Sl{constructor(r,a,d){this.type=oo,this.locale=d,this.caseSensitive=r,this.diacriticSensitive=a}static parse(r,a){if(r.length!==2)return a.error("Expected one argument.");const d=r[1];if(typeof d!="object"||Array.isArray(d))return a.error("Collator options argument must be an object.");const m=a.parse(d["case-sensitive"]!==void 0&&d["case-sensitive"],1,Nt);if(!m)return null;const _=a.parse(d["diacritic-sensitive"]!==void 0&&d["diacritic-sensitive"],1,Nt);if(!_)return null;let x=null;return d.locale&&(x=a.parse(d.locale,1,er),!x)?null:new Sl(m,_,x)}evaluate(r){return new Oc(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}}class Vc{constructor(r,a,d,m,_){this.type=er,this.number=r,this.locale=a,this.currency=d,this.minFractionDigits=m,this.maxFractionDigits=_}static parse(r,a){if(r.length!==3)return a.error("Expected two arguments.");const d=a.parse(r[1],1,lt);if(!d)return null;const m=r[2];if(typeof m!="object"||Array.isArray(m))return a.error("NumberFormat options argument must be an object.");let _=null;if(m.locale&&(_=a.parse(m.locale,1,er),!_))return null;let x=null;if(m.currency&&(x=a.parse(m.currency,1,er),!x))return null;let S=null;if(m["min-fraction-digits"]&&(S=a.parse(m["min-fraction-digits"],1,lt),!S))return null;let P=null;return m["max-fraction-digits"]&&(P=a.parse(m["max-fraction-digits"],1,lt),!P)?null:new Vc(d,_,x,S,P)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}}class kl{constructor(r){this.type=So,this.sections=r}static parse(r,a){if(r.length<2)return a.error("Expected at least one argument.");const d=r[1];if(!Array.isArray(d)&&typeof d=="object")return a.error("First argument must be an image or text section.");const m=[];let _=!1;for(let x=1;x<=r.length-1;++x){const S=r[x];if(_&&typeof S=="object"&&!Array.isArray(S)){_=!1;let P=null;if(S["font-scale"]&&(P=a.parse(S["font-scale"],1,lt),!P))return null;let A=null;if(S["text-font"]&&(A=a.parse(S["text-font"],1,q(er)),!A))return null;let D=null;if(S["text-color"]&&(D=a.parse(S["text-color"],1,un),!D))return null;const R=m[m.length-1];R.scale=P,R.font=A,R.textColor=D}else{const P=a.parse(r[x],1,Wt);if(!P)return null;const A=P.type.kind;if(A!=="string"&&A!=="value"&&A!=="null"&&A!=="resolvedImage")return a.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");_=!0,m.push({content:P,scale:null,font:null,textColor:null})}}return new kl(m)}evaluate(r){return new xn(this.sections.map(a=>{const d=a.content.evaluate(r);return pi(d)===so?new $c("",d,null,null,null):new $c(ko(d),null,a.scale?a.scale.evaluate(r):null,a.font?a.font.evaluate(r).join(","):null,a.textColor?a.textColor.evaluate(r):null)}))}eachChild(r){for(const a of this.sections)r(a.content),a.scale&&r(a.scale),a.font&&r(a.font),a.textColor&&r(a.textColor)}outputDefined(){return!1}}class Uc{constructor(r){this.type=so,this.input=r}static parse(r,a){if(r.length!==2)return a.error("Expected two arguments.");const d=a.parse(r[1],1,er);return d?new Uc(d):a.error("No image name provided.")}evaluate(r){const a=this.input.evaluate(r),d=Ni.fromString(a);return d&&r.availableImages&&(d.available=r.availableImages.indexOf(a)>-1),d}eachChild(r){r(this.input)}outputDefined(){return!1}}class qc{constructor(r){this.type=lt,this.input=r}static parse(r,a){if(r.length!==2)return a.error(`Expected 1 argument, but found ${r.length-1} instead.`);const d=a.parse(r[1],1);return d?d.type.kind!=="array"&&d.type.kind!=="string"&&d.type.kind!=="value"?a.error(`Expected argument of type string or array, but found ${U(d.type)} instead.`):new qc(d):null}evaluate(r){const a=this.input.evaluate(r);if(typeof a=="string"||Array.isArray(a))return a.length;throw new ci(`Expected value to be of type string or array, but found ${U(pi(a))} instead.`)}eachChild(r){r(this.input)}outputDefined(){return!1}}const ao=8192;function Gc(s,r){const a=(180+s[0])/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s[1]*Math.PI/360)))/360,m=Math.pow(2,r.z);return[Math.round(a*m*ao),Math.round(d*m*ao)]}function $s(s,r){const a=Math.pow(2,r.z);return[(m=(s[0]/ao+r.x)/a,360*m-180),(d=(s[1]/ao+r.y)/a,360/Math.PI*Math.atan(Math.exp((180-360*d)*Math.PI/180))-90)];var d,m}function hr(s,r){s[0]=Math.min(s[0],r[0]),s[1]=Math.min(s[1],r[1]),s[2]=Math.max(s[2],r[0]),s[3]=Math.max(s[3],r[1])}function Fa(s,r){return!(s[0]<=r[0]||s[2]>=r[2]||s[1]<=r[1]||s[3]>=r[3])}function xp(s,r,a){const d=s[0]-r[0],m=s[1]-r[1],_=s[0]-a[0],x=s[1]-a[1];return d*x-_*m==0&&d*_<=0&&m*x<=0}function El(s,r,a,d){return(m=[d[0]-a[0],d[1]-a[1]])[0]*(_=[r[0]-s[0],r[1]-s[1]])[1]-m[1]*_[0]!=0&&!(!Gh(s,r,a,d)||!Gh(a,d,s,r));var m,_}function wp(s,r,a){for(const d of a)for(let m=0;m(m=s)[1]!=(x=S[P+1])[1]>m[1]&&m[0]<(x[0]-_[0])*(m[1]-_[1])/(x[1]-_[1])+_[0]&&(d=!d)}var m,_,x;return d}function Sp(s,r){for(const a of r)if(Ns(s,a))return!0;return!1}function qh(s,r){for(const a of s)if(!Ns(a,r))return!1;for(let a=0;a0&&S<0||x<0&&S>0}function Zc(s,r,a){const d=[];for(let m=0;ma[2]){const m=.5*d;let _=s[0]-a[0]>m?-d:a[0]-s[0]>m?d:0;_===0&&(_=s[0]-a[2]>m?-d:a[2]-s[0]>m?d:0),s[0]+=_}hr(r,s)}function Wh(s,r,a,d){const m=Math.pow(2,d.z)*ao,_=[d.x*ao,d.y*ao],x=[];for(const S of s)for(const P of S){const A=[P.x+_[0],P.y+_[1]];Hh(A,r,a,m),x.push(A)}return x}function Xh(s,r,a,d){const m=Math.pow(2,d.z)*ao,_=[d.x*ao,d.y*ao],x=[];for(const P of s){const A=[];for(const D of P){const R=[D.x+_[0],D.y+_[1]];hr(r,R),A.push(R)}x.push(A)}if(r[2]-r[0]<=m/2){(S=r)[0]=S[1]=1/0,S[2]=S[3]=-1/0;for(const P of x)for(const A of P)Hh(A,r,a,m)}var S;return x}class us{constructor(r,a){this.type=Nt,this.geojson=r,this.geometries=a}static parse(r,a){if(r.length!==2)return a.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(Ia(r[1])){const d=r[1];if(d.type==="FeatureCollection"){const m=[];for(const _ of d.features){const{type:x,coordinates:S}=_.geometry;x==="Polygon"&&m.push(S),x==="MultiPolygon"&&m.push(...S)}if(m.length)return new us(d,{type:"MultiPolygon",coordinates:m})}else if(d.type==="Feature"){const m=d.geometry.type;if(m==="Polygon"||m==="MultiPolygon")return new us(d,d.geometry)}else if(d.type==="Polygon"||d.type==="MultiPolygon")return new us(d,d)}return a.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return function(a,d){const m=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=a.canonicalID();if(d.type==="Polygon"){const S=Zc(d.coordinates,_,x),P=Wh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!Ns(A,S))return!1}if(d.type==="MultiPolygon"){const S=Zh(d.coordinates,_,x),P=Wh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!Sp(A,S))return!1}return!0}(r,this.geometries);if(r.geometryType()==="LineString")return function(a,d){const m=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=a.canonicalID();if(d.type==="Polygon"){const S=Zc(d.coordinates,_,x),P=Xh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!qh(A,S))return!1}if(d.type==="MultiPolygon"){const S=Zh(d.coordinates,_,x),P=Xh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!kp(A,S))return!1}return!0}(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Jh=class{constructor(s=[],r=Ep){if(this.data=s,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const s=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:r,compare:a}=this,d=r[s];for(;s>0;){const m=s-1>>1,_=r[m];if(a(d,_)>=0)break;r[s]=_,s=m}r[s]=d}_down(s){const{data:r,compare:a}=this,d=this.length>>1,m=r[s];for(;s=0)break;r[s]=x,s=_}r[s]=m}};function Ep(s,r){return sr?1:0}function Pp(s,r,a,d,m){Kh(s,r,a,d||s.length-1,m||Mp)}function Kh(s,r,a,d,m){for(;d>a;){if(d-a>600){var _=d-a+1,x=r-a+1,S=Math.log(_),P=.5*Math.exp(2*S/3),A=.5*Math.sqrt(S*P*(_-P)/_)*(x-_/2<0?-1:1);Kh(s,r,Math.max(a,Math.floor(r-x*P/_+A)),Math.min(d,Math.floor(r+(_-x)*P/_+A)),m)}var D=s[r],R=a,N=d;for(Ra(s,a,r),m(s[d],D)>0&&Ra(s,a,d);R0;)N--}m(s[a],D)===0?Ra(s,a,N):Ra(s,++N,d),N<=r&&(a=N+1),r<=N&&(d=N-1)}}function Ra(s,r,a){var d=s[r];s[r]=s[a],s[a]=d}function Mp(s,r){return sr?1:0}function Pl(s,r){if(s.length<=1)return[s];const a=[];let d,m;for(const _ of s){const x=Tp(_);x!==0&&(_.area=Math.abs(x),m===void 0&&(m=x<0),m===x<0?(d&&a.push(d),d=[_]):d.push(_))}if(d&&a.push(d),r>1)for(let _=0;_1?(A=r[P+1][0],D=r[P+1][1]):Z>0&&(A+=R/this.kx*Z,D+=N/this.ky*Z)),R=this.wrap(a[0]-A)*this.kx,N=(a[1]-D)*this.ky;const W=R*R+N*N;W180;)r-=360;return r}}function tf(s,r){return r[0]-s[0]}function Ml(s){return s[1]-s[0]+1}function Eo(s,r){return s[1]>=s[0]&&s[1]s[1])return[null,null];const a=Ml(s);if(r){if(a===2)return[s,null];const m=Math.floor(a/2);return[[s[0],s[0]+m],[s[0]+m,s[1]]]}if(a===1)return[s,null];const d=Math.floor(a/2)-1;return[[s[0],s[0]+d],[s[0]+d+1,s[1]]]}function Wc(s,r){if(!Eo(r,s.length))return[1/0,1/0,-1/0,-1/0];const a=[1/0,1/0,-1/0,-1/0];for(let d=r[0];d<=r[1];++d)hr(a,s[d]);return a}function Xc(s){const r=[1/0,1/0,-1/0,-1/0];for(const a of s)for(const d of a)hr(r,d);return r}function rf(s){return s[0]!==-1/0&&s[1]!==-1/0&&s[2]!==1/0&&s[3]!==1/0}function Jc(s,r,a){if(!rf(s)||!rf(r))return NaN;let d=0,m=0;return s[2]r[2]&&(d=s[0]-r[2]),s[1]>r[3]&&(m=s[1]-r[3]),s[3]=d)return d;if(Fa(m,_)){if(Oa(s,r))return 0}else if(Oa(r,s))return 0;let x=1/0;for(const S of s)for(let P=0,A=S.length,D=A-1;P0;){const P=x.pop();if(P[0]>=_)continue;const A=P[1],D=r?50:100;if(Ml(A)<=D){if(!Eo(A,s.length))return NaN;if(r){const R=$r(s,A,a,d);if(isNaN(R)||R===0)return R;_=Math.min(_,R)}else for(let R=A[0];R<=A[1];++R){const N=Zr(s[R],a,d);if(_=Math.min(_,N),_===0)return 0}}else{const R=Ba(A,r);Qc(x,_,d,s,S,R[0]),Qc(x,_,d,s,S,R[1])}}return _}function Cl(s,r,a,d,m,_=1/0){let x=Math.min(_,m.distance(s[0],a[0]));if(x===0)return x;const S=new Jh([[0,[0,s.length-1],[0,a.length-1]]],tf);for(;S.length>0;){const P=S.pop();if(P[0]>=x)continue;const A=P[1],D=P[2],R=r?50:100,N=d?50:100;if(Ml(A)<=R&&Ml(D)<=N){if(!Eo(A,s.length)&&Eo(D,a.length))return NaN;let Z;if(r&&d)Z=sr(s,A,a,D,m),x=Math.min(x,Z);else if(r&&!d){const W=s.slice(A[0],A[1]+1);for(let Q=D[0];Q<=D[1];++Q)if(Z=Ar(a[Q],W,m),x=Math.min(x,Z),x===0)return x}else if(!r&&d){const W=a.slice(D[0],D[1]+1);for(let Q=A[0];Q<=A[1];++Q)if(Z=Ar(s[Q],W,m),x=Math.min(x,Z),x===0)return x}else Z=Yc(s,A,a,D,m),x=Math.min(x,Z)}else{const Z=Ba(A,r),W=Ba(D,d);Il(S,x,m,s,a,Z[0],W[0]),Il(S,x,m,s,a,Z[0],W[1]),Il(S,x,m,s,a,Z[1],W[0]),Il(S,x,m,s,a,Z[1],W[1])}}return x}function eu(s){return s.type==="MultiPolygon"?s.coordinates.map(r=>({type:"Polygon",coordinates:r})):s.type==="MultiLineString"?s.coordinates.map(r=>({type:"LineString",coordinates:r})):s.type==="MultiPoint"?s.coordinates.map(r=>({type:"Point",coordinates:r})):[s]}class Uo{constructor(r,a){this.type=lt,this.geojson=r,this.geometries=a}static parse(r,a){if(r.length!==2)return a.error(`'distance' expression requires exactly one argument, but found ${r.length-1} instead.`);if(Ia(r[1])){const d=r[1];if(d.type==="FeatureCollection")return new Uo(d,d.features.map(m=>eu(m.geometry)).flat());if(d.type==="Feature")return new Uo(d,eu(d.geometry));if("type"in d&&"coordinates"in d)return new Uo(d,eu(d))}return a.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return function(a,d){const m=a.geometry(),_=m.flat().map(P=>$s([P.x,P.y],a.canonical));if(m.length===0)return NaN;const x=new Hc(_[0][1]);let S=1/0;for(const P of d){switch(P.type){case"Point":S=Math.min(S,Cl(_,!1,[P.coordinates],!1,x,S));break;case"LineString":S=Math.min(S,Cl(_,!1,P.coordinates,!0,x,S));break;case"Polygon":S=Math.min(S,Tl(_,!1,P.coordinates,x,S))}if(S===0)return S}return S}(r,this.geometries);if(r.geometryType()==="LineString")return function(a,d){const m=a.geometry(),_=m.flat().map(P=>$s([P.x,P.y],a.canonical));if(m.length===0)return NaN;const x=new Hc(_[0][1]);let S=1/0;for(const P of d){switch(P.type){case"Point":S=Math.min(S,Cl(_,!0,[P.coordinates],!1,x,S));break;case"LineString":S=Math.min(S,Cl(_,!0,P.coordinates,!0,x,S));break;case"Polygon":S=Math.min(S,Tl(_,!0,P.coordinates,x,S))}if(S===0)return S}return S}(r,this.geometries);if(r.geometryType()==="Polygon")return function(a,d){const m=a.geometry();if(m.length===0||m[0].length===0)return NaN;const _=Pl(m,0).map(P=>P.map(A=>A.map(D=>$s([D.x,D.y],a.canonical)))),x=new Hc(_[0][0][0][1]);let S=1/0;for(const P of d)for(const A of _){switch(P.type){case"Point":S=Math.min(S,Tl([P.coordinates],!1,A,x,S));break;case"LineString":S=Math.min(S,Tl(P.coordinates,!0,A,x,S));break;case"Polygon":S=Math.min(S,nf(A,P.coordinates,x,S))}if(S===0)return S}return S}(r,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const hs={"==":jh,"!=":_p,">":Vh,"<":vp,">=":bp,"<=":Uh,array:Dn,at:jc,boolean:Dn,case:bl,coalesce:wl,collator:Sl,format:kl,image:Uc,in:Aa,"index-of":_l,interpolate:En,"interpolate-hcl":En,"interpolate-lab":En,length:qc,let:_r,literal:ls,match:vl,number:Dn,"number-format":Vc,object:Dn,slice:xl,step:Os,string:Dn,"to-boolean":No,"to-color":No,"to-number":No,"to-string":No,var:yl,within:us,distance:Uo};class Pn{constructor(r,a,d,m){this.name=r,this.type=a,this._evaluate=d,this.args=m}evaluate(r){return this._evaluate(r,this.args)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,a){const d=r[0],m=Pn.definitions[d];if(!m)return a.error(`Unknown expression "${d}". If you wanted a literal array, use ["literal", [...]].`,0);const _=Array.isArray(m)?m[0]:m.type,x=Array.isArray(m)?[[m[1],m[2]]]:m.overloads,S=x.filter(([A])=>!Array.isArray(A)||A.length===r.length-1);let P=null;for(const[A,D]of S){P=new jo(a.registry,zl,a.path,null,a.scope);const R=[];let N=!1;for(let Z=1;Z{return N=R,Array.isArray(N)?`(${N.map(U).join(", ")})`:`(${U(N.type)}...)`;var N}).join(" | "),D=[];for(let R=1;R{a=r?a&&zl(d):a&&d instanceof ls}),!!a&&Ll(s)&&Dl(s,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ll(s){if(s instanceof Pn&&(s.name==="get"&&s.args.length===1||s.name==="feature-state"||s.name==="has"&&s.args.length===1||s.name==="properties"||s.name==="geometry-type"||s.name==="id"||/^filter-/.test(s.name))||s instanceof us||s instanceof Uo)return!1;let r=!0;return s.eachChild(a=>{r&&!Ll(a)&&(r=!1)}),r}function $a(s){if(s instanceof Pn&&s.name==="feature-state")return!1;let r=!0;return s.eachChild(a=>{r&&!$a(a)&&(r=!1)}),r}function Dl(s,r){if(s instanceof Pn&&r.indexOf(s.name)>=0)return!1;let a=!0;return s.eachChild(d=>{a&&!Dl(d,r)&&(a=!1)}),a}function of(s){return{result:"success",value:s}}function js(s){return{result:"error",value:s}}function ds(s){return s["property-type"]==="data-driven"||s["property-type"]==="cross-faded-data-driven"}function iu(s){return!!s.expression&&s.expression.parameters.indexOf("zoom")>-1}function Vs(s){return!!s.expression&&s.expression.interpolated}function mr(s){return s instanceof Number?"number":s instanceof String?"string":s instanceof Boolean?"boolean":Array.isArray(s)?"array":s===null?"null":typeof s}function Na(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function sf(s){return s}function af(s,r){const a=r.type==="color",d=s.stops&&typeof s.stops[0][0]=="object",m=d||!(d||s.property!==void 0),_=s.type||(Vs(r)?"exponential":"interval");if(a||r.type==="padding"){const D=a?kr.parse:wn.parse;(s=io({},s)).stops&&(s.stops=s.stops.map(R=>[R[0],D(R[1])])),s.default=D(s.default?s.default:r.default)}if(s.colorSpace&&(x=s.colorSpace)!=="rgb"&&x!=="hcl"&&x!=="lab")throw new Error(`Unknown color space: "${s.colorSpace}"`);var x;let S,P,A;if(_==="exponential")S=nu;else if(_==="interval")S=Rl;else if(_==="categorical"){S=Fl,P=Object.create(null);for(const D of s.stops)P[D[0]]=D[1];A=typeof s.stops[0][0]}else{if(_!=="identity")throw new Error(`Unknown function type "${_}"`);S=ou}if(d){const D={},R=[];for(let W=0;WW[0]),evaluate:({zoom:W},Q)=>nu({stops:N,base:s.base},r,W).evaluate(W,Q)}}if(m){const D=_==="exponential"?{name:"exponential",base:s.base!==void 0?s.base:1}:null;return{kind:"camera",interpolationType:D,interpolationFactor:En.interpolationFactor.bind(void 0,D),zoomStops:s.stops.map(R=>R[0]),evaluate:({zoom:R})=>S(s,r,R,P,A)}}return{kind:"source",evaluate(D,R){const N=R&&R.properties?R.properties[s.property]:void 0;return N===void 0?ps(s.default,r.default):S(s,r,N,P,A)}}}function ps(s,r,a){return s!==void 0?s:r!==void 0?r:a!==void 0?a:void 0}function Fl(s,r,a,d,m){return ps(typeof a===m?d[a]:void 0,s.default,r.default)}function Rl(s,r,a){if(mr(a)!=="number")return ps(s.default,r.default);const d=s.stops.length;if(d===1||a<=s.stops[0][0])return s.stops[0][1];if(a>=s.stops[d-1][0])return s.stops[d-1][1];const m=za(s.stops.map(_=>_[0]),a);return s.stops[m][1]}function nu(s,r,a){const d=s.base!==void 0?s.base:1;if(mr(a)!=="number")return ps(s.default,r.default);const m=s.stops.length;if(m===1||a<=s.stops[0][0])return s.stops[0][1];if(a>=s.stops[m-1][0])return s.stops[m-1][1];const _=za(s.stops.map(D=>D[0]),a),x=function(D,R,N,Z){const W=Z-N,Q=D-N;return W===0?0:R===1?Q/W:(Math.pow(R,Q)-1)/(Math.pow(R,W)-1)}(a,d,s.stops[_][0],s.stops[_+1][0]),S=s.stops[_][1],P=s.stops[_+1][1],A=kn[r.type]||sf;return typeof S.evaluate=="function"?{evaluate(...D){const R=S.evaluate.apply(void 0,D),N=P.evaluate.apply(void 0,D);if(R!==void 0&&N!==void 0)return A(R,N,x,s.colorSpace)}}:A(S,P,x,s.colorSpace)}function ou(s,r,a){switch(r.type){case"color":a=kr.parse(a);break;case"formatted":a=xn.fromString(a.toString());break;case"resolvedImage":a=Ni.fromString(a.toString());break;case"padding":a=wn.parse(a);break;default:mr(a)===r.type||r.type==="enum"&&r.values[a]||(a=void 0)}return ps(a,s.default,r.default)}Pn.register(hs,{error:[{kind:"error"},[er],(s,[r])=>{throw new ci(r.evaluate(s))}],typeof:[er,[Wt],(s,[r])=>U(pi(r.evaluate(s)))],"to-rgba":[q(lt,4),[un],(s,[r])=>{const[a,d,m,_]=r.evaluate(s).rgb;return[255*a,255*d,255*m,_]}],rgb:[un,[lt,lt,lt],tu],rgba:[un,[lt,lt,lt,lt],tu],has:{type:Nt,overloads:[[[er],(s,[r])=>Al(r.evaluate(s),s.properties())],[[er,On],(s,[r,a])=>Al(r.evaluate(s),a.evaluate(s))]]},get:{type:Wt,overloads:[[[er],(s,[r])=>ru(r.evaluate(s),s.properties())],[[er,On],(s,[r,a])=>ru(r.evaluate(s),a.evaluate(s))]]},"feature-state":[Wt,[er],(s,[r])=>ru(r.evaluate(s),s.featureState||{})],properties:[On,[],s=>s.properties()],"geometry-type":[er,[],s=>s.geometryType()],id:[Wt,[],s=>s.id()],zoom:[lt,[],s=>s.globals.zoom],"heatmap-density":[lt,[],s=>s.globals.heatmapDensity||0],"line-progress":[lt,[],s=>s.globals.lineProgress||0],accumulated:[Wt,[],s=>s.globals.accumulated===void 0?null:s.globals.accumulated],"+":[lt,fs(lt),(s,r)=>{let a=0;for(const d of r)a+=d.evaluate(s);return a}],"*":[lt,fs(lt),(s,r)=>{let a=1;for(const d of r)a*=d.evaluate(s);return a}],"-":{type:lt,overloads:[[[lt,lt],(s,[r,a])=>r.evaluate(s)-a.evaluate(s)],[[lt],(s,[r])=>-r.evaluate(s)]]},"/":[lt,[lt,lt],(s,[r,a])=>r.evaluate(s)/a.evaluate(s)],"%":[lt,[lt,lt],(s,[r,a])=>r.evaluate(s)%a.evaluate(s)],ln2:[lt,[],()=>Math.LN2],pi:[lt,[],()=>Math.PI],e:[lt,[],()=>Math.E],"^":[lt,[lt,lt],(s,[r,a])=>Math.pow(r.evaluate(s),a.evaluate(s))],sqrt:[lt,[lt],(s,[r])=>Math.sqrt(r.evaluate(s))],log10:[lt,[lt],(s,[r])=>Math.log(r.evaluate(s))/Math.LN10],ln:[lt,[lt],(s,[r])=>Math.log(r.evaluate(s))],log2:[lt,[lt],(s,[r])=>Math.log(r.evaluate(s))/Math.LN2],sin:[lt,[lt],(s,[r])=>Math.sin(r.evaluate(s))],cos:[lt,[lt],(s,[r])=>Math.cos(r.evaluate(s))],tan:[lt,[lt],(s,[r])=>Math.tan(r.evaluate(s))],asin:[lt,[lt],(s,[r])=>Math.asin(r.evaluate(s))],acos:[lt,[lt],(s,[r])=>Math.acos(r.evaluate(s))],atan:[lt,[lt],(s,[r])=>Math.atan(r.evaluate(s))],min:[lt,fs(lt),(s,r)=>Math.min(...r.map(a=>a.evaluate(s)))],max:[lt,fs(lt),(s,r)=>Math.max(...r.map(a=>a.evaluate(s)))],abs:[lt,[lt],(s,[r])=>Math.abs(r.evaluate(s))],round:[lt,[lt],(s,[r])=>{const a=r.evaluate(s);return a<0?-Math.round(-a):Math.round(a)}],floor:[lt,[lt],(s,[r])=>Math.floor(r.evaluate(s))],ceil:[lt,[lt],(s,[r])=>Math.ceil(r.evaluate(s))],"filter-==":[Nt,[er,Wt],(s,[r,a])=>s.properties()[r.value]===a.value],"filter-id-==":[Nt,[Wt],(s,[r])=>s.id()===r.value],"filter-type-==":[Nt,[er],(s,[r])=>s.geometryType()===r.value],"filter-<":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d{const a=s.id(),d=r.value;return typeof a==typeof d&&a":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d>m}],"filter-id->":[Nt,[Wt],(s,[r])=>{const a=s.id(),d=r.value;return typeof a==typeof d&&a>d}],"filter-<=":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d<=m}],"filter-id-<=":[Nt,[Wt],(s,[r])=>{const a=s.id(),d=r.value;return typeof a==typeof d&&a<=d}],"filter->=":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d>=m}],"filter-id->=":[Nt,[Wt],(s,[r])=>{const a=s.id(),d=r.value;return typeof a==typeof d&&a>=d}],"filter-has":[Nt,[Wt],(s,[r])=>r.value in s.properties()],"filter-has-id":[Nt,[],s=>s.id()!==null&&s.id()!==void 0],"filter-type-in":[Nt,[q(er)],(s,[r])=>r.value.indexOf(s.geometryType())>=0],"filter-id-in":[Nt,[q(Wt)],(s,[r])=>r.value.indexOf(s.id())>=0],"filter-in-small":[Nt,[er,q(Wt)],(s,[r,a])=>a.value.indexOf(s.properties()[r.value])>=0],"filter-in-large":[Nt,[er,q(Wt)],(s,[r,a])=>function(d,m,_,x){for(;_<=x;){const S=_+x>>1;if(m[S]===d)return!0;m[S]>d?x=S-1:_=S+1}return!1}(s.properties()[r.value],a.value,0,a.value.length-1)],all:{type:Nt,overloads:[[[Nt,Nt],(s,[r,a])=>r.evaluate(s)&&a.evaluate(s)],[fs(Nt),(s,r)=>{for(const a of r)if(!a.evaluate(s))return!1;return!0}]]},any:{type:Nt,overloads:[[[Nt,Nt],(s,[r,a])=>r.evaluate(s)||a.evaluate(s)],[fs(Nt),(s,r)=>{for(const a of r)if(a.evaluate(s))return!0;return!1}]]},"!":[Nt,[Nt],(s,[r])=>!r.evaluate(s)],"is-supported-script":[Nt,[er],(s,[r])=>{const a=s.globals&&s.globals.isSupportedScript;return!a||a(r.evaluate(s))}],upcase:[er,[er],(s,[r])=>r.evaluate(s).toUpperCase()],downcase:[er,[er],(s,[r])=>r.evaluate(s).toLowerCase()],concat:[er,fs(Wt),(s,r)=>r.map(a=>ko(a.evaluate(s))).join("")],"resolved-locale":[er,[oo],(s,[r])=>r.evaluate(s).resolvedLocale()]});class Bl{constructor(r,a){var d;this.expression=r,this._warningHistory={},this._evaluator=new Ca,this._defaultValue=a?(d=a).type==="color"&&Na(d.default)?new kr(0,0,0,0):d.type==="color"?kr.parse(d.default)||null:d.type==="padding"?wn.parse(d.default)||null:d.type==="variableAnchorOffsetCollection"?Sn.parse(d.default)||null:d.default===void 0?null:d.default:null,this._enumValues=a&&a.type==="enum"?a.values:null}evaluateWithoutErrorHandling(r,a,d,m,_,x){return this._evaluator.globals=r,this._evaluator.feature=a,this._evaluator.featureState=d,this._evaluator.canonical=m,this._evaluator.availableImages=_||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(r,a,d,m,_,x){this._evaluator.globals=r,this._evaluator.feature=a||null,this._evaluator.featureState=d||null,this._evaluator.canonical=m,this._evaluator.availableImages=_||null,this._evaluator.formattedSection=x||null;try{const S=this.expression.evaluate(this._evaluator);if(S==null||typeof S=="number"&&S!=S)return this._defaultValue;if(this._enumValues&&!(S in this._enumValues))throw new ci(`Expected value to be one of ${Object.keys(this._enumValues).map(P=>JSON.stringify(P)).join(", ")}, but found ${JSON.stringify(S)} instead.`);return S}catch(S){return this._warningHistory[S.message]||(this._warningHistory[S.message]=!0,typeof console<"u"&&console.warn(S.message)),this._defaultValue}}}function ja(s){return Array.isArray(s)&&s.length>0&&typeof s[0]=="string"&&s[0]in hs}function ms(s,r){const a=new jo(hs,zl,[],r?function(m){const _={color:un,string:er,number:lt,enum:er,boolean:Nt,formatted:So,padding:$o,resolvedImage:so,variableAnchorOffsetCollection:le};return m.type==="array"?q(_[m.value]||Wt,m.length):_[m.type]}(r):void 0),d=a.parse(s,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return d?of(new Bl(d,r)):js(a.errors)}class su{constructor(r,a){this.kind=r,this._styleExpression=a,this.isStateDependent=r!=="constant"&&!$a(a.expression)}evaluateWithoutErrorHandling(r,a,d,m,_,x){return this._styleExpression.evaluateWithoutErrorHandling(r,a,d,m,_,x)}evaluate(r,a,d,m,_,x){return this._styleExpression.evaluate(r,a,d,m,_,x)}}class au{constructor(r,a,d,m){this.kind=r,this.zoomStops=d,this._styleExpression=a,this.isStateDependent=r!=="camera"&&!$a(a.expression),this.interpolationType=m}evaluateWithoutErrorHandling(r,a,d,m,_,x){return this._styleExpression.evaluateWithoutErrorHandling(r,a,d,m,_,x)}evaluate(r,a,d,m,_,x){return this._styleExpression.evaluate(r,a,d,m,_,x)}interpolationFactor(r,a,d){return this.interpolationType?En.interpolationFactor(this.interpolationType,r,a,d):0}}function lf(s,r){const a=ms(s,r);if(a.result==="error")return a;const d=a.value.expression,m=Ll(d);if(!m&&!ds(r))return js([new Yi("","data expressions not supported")]);const _=Dl(d,["zoom"]);if(!_&&!iu(r))return js([new Yi("","zoom expressions not supported")]);const x=$l(d);return x||_?x instanceof Yi?js([x]):x instanceof En&&!Vs(r)?js([new Yi("",'"interpolate" expressions cannot be used with this property')]):of(x?new au(m?"camera":"composite",a.value,x.labels,x instanceof En?x.interpolation:void 0):new su(m?"constant":"source",a.value)):js([new Yi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ol{constructor(r,a){this._parameters=r,this._specification=a,io(this,af(this._parameters,this._specification))}static deserialize(r){return new Ol(r._parameters,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification}}}function $l(s){let r=null;if(s instanceof _r)r=$l(s.result);else if(s instanceof wl){for(const a of s.args)if(r=$l(a),r)break}else(s instanceof Os||s instanceof En)&&s.input instanceof Pn&&s.input.name==="zoom"&&(r=s);return r instanceof Yi||s.eachChild(a=>{const d=$l(a);d instanceof Yi?r=d:!r&&d?r=new Yi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&d&&r!==d&&(r=new Yi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function Us(s){if(s===!0||s===!1)return!0;if(!Array.isArray(s)||s.length===0)return!1;switch(s[0]){case"has":return s.length>=2&&s[1]!=="$id"&&s[1]!=="$type";case"in":return s.length>=3&&(typeof s[1]!="string"||Array.isArray(s[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return s.length!==3||Array.isArray(s[1])||Array.isArray(s[2]);case"any":case"all":for(const r of s.slice(1))if(!Us(r)&&typeof r!="boolean")return!1;return!0;default:return!0}}const Nl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Qi(s){if(s==null)return{filter:()=>!0,needGeometry:!1};Us(s)||(s=jl(s));const r=ms(s,Nl);if(r.result==="error")throw new Error(r.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,d,m)=>r.value.evaluate(a,d,{},m),needGeometry:lu(s)}}function Va(s,r){return sr?1:0}function lu(s){if(!Array.isArray(s))return!1;if(s[0]==="within"||s[0]==="distance")return!0;for(let r=1;r"||r==="<="||r===">="?cu(s[1],s[2],r):r==="any"?(a=s.slice(1),["any"].concat(a.map(jl))):r==="all"?["all"].concat(s.slice(1).map(jl)):r==="none"?["all"].concat(s.slice(1).map(jl).map(Gs)):r==="in"?qs(s[1],s.slice(2)):r==="!in"?Gs(qs(s[1],s.slice(2))):r==="has"?uu(s[1]):r!=="!has"||Gs(uu(s[1]));var a}function cu(s,r,a){switch(s){case"$type":return[`filter-type-${a}`,r];case"$id":return[`filter-id-${a}`,r];default:return[`filter-${a}`,s,r]}}function qs(s,r){if(r.length===0)return!1;switch(s){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(a=>typeof a!=typeof r[0])?["filter-in-large",s,["literal",r.sort(Va)]]:["filter-in-small",s,["literal",r]]}}function uu(s){switch(s){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",s]}}function Gs(s){return["!",s]}function hu(s){const r=typeof s;if(r==="number"||r==="boolean"||r==="string"||s==null)return JSON.stringify(s);if(Array.isArray(s)){let m="[";for(const _ of s)m+=`${hu(_)},`;return`${m}]`}const a=Object.keys(s).sort();let d="{";for(let m=0;md.maximum?[new nt(r,a,`${a} is greater than the maximum value ${d.maximum}`)]:[]}function du(s){const r=s.valueSpec,a=Nr(s.value.type);let d,m,_,x={};const S=a!=="categorical"&&s.value.property===void 0,P=!S,A=mr(s.value.stops)==="array"&&mr(s.value.stops[0])==="array"&&mr(s.value.stops[0][0])==="object",D=hn({key:s.key,value:s.value,valueSpec:s.styleSpec.function,validateSpec:s.validateSpec,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{stops:function(Z){if(a==="identity")return[new nt(Z.key,Z.value,'identity function may not have a "stops" property')];let W=[];const Q=Z.value;return W=W.concat(Vl({key:Z.key,value:Q,valueSpec:Z.valueSpec,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,arrayElementValidator:R})),mr(Q)==="array"&&Q.length===0&&W.push(new nt(Z.key,Q,"array must have at least one stop")),W},default:function(Z){return Z.validateSpec({key:Z.key,value:Z.value,valueSpec:r,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec})}}});return a==="identity"&&S&&D.push(new nt(s.key,s.value,'missing required property "property"')),a==="identity"||s.value.stops||D.push(new nt(s.key,s.value,'missing required property "stops"')),a==="exponential"&&s.valueSpec.expression&&!Vs(s.valueSpec)&&D.push(new nt(s.key,s.value,"exponential functions not supported")),s.styleSpec.$version>=8&&(P&&!ds(s.valueSpec)?D.push(new nt(s.key,s.value,"property functions not supported")):S&&!iu(s.valueSpec)&&D.push(new nt(s.key,s.value,"zoom functions not supported"))),a!=="categorical"&&!A||s.value.property!==void 0||D.push(new nt(s.key,s.value,'"property" property is required')),D;function R(Z){let W=[];const Q=Z.value,ie=Z.key;if(mr(Q)!=="array")return[new nt(ie,Q,`array expected, ${mr(Q)} found`)];if(Q.length!==2)return[new nt(ie,Q,`array length 2 expected, length ${Q.length} found`)];if(A){if(mr(Q[0])!=="object")return[new nt(ie,Q,`object expected, ${mr(Q[0])} found`)];if(Q[0].zoom===void 0)return[new nt(ie,Q,"object stop key must have zoom")];if(Q[0].value===void 0)return[new nt(ie,Q,"object stop key must have value")];if(_&&_>Nr(Q[0].zoom))return[new nt(ie,Q[0].zoom,"stop zoom values must appear in ascending order")];Nr(Q[0].zoom)!==_&&(_=Nr(Q[0].zoom),m=void 0,x={}),W=W.concat(hn({key:`${ie}[0]`,value:Q[0],valueSpec:{zoom:{}},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,objectElementValidators:{zoom:Ua,value:N}}))}else W=W.concat(N({key:`${ie}[0]`,value:Q[0],valueSpec:{},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec},Q));return ja(gs(Q[1]))?W.concat([new nt(`${ie}[1]`,Q[1],"expressions are not allowed in function stops.")]):W.concat(Z.validateSpec({key:`${ie}[1]`,value:Q[1],valueSpec:r,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec}))}function N(Z,W){const Q=mr(Z.value),ie=Nr(Z.value),he=Z.value!==null?Z.value:W;if(d){if(Q!==d)return[new nt(Z.key,he,`${Q} stop domain type must match previous stop domain type ${d}`)]}else d=Q;if(Q!=="number"&&Q!=="string"&&Q!=="boolean")return[new nt(Z.key,he,"stop domain value must be a number, string, or boolean")];if(Q!=="number"&&a!=="categorical"){let ke=`number expected, ${Q} found`;return ds(r)&&a===void 0&&(ke+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new nt(Z.key,he,ke)]}return a!=="categorical"||Q!=="number"||isFinite(ie)&&Math.floor(ie)===ie?a!=="categorical"&&Q==="number"&&m!==void 0&&ienew nt(`${s.key}${d.key}`,s.value,d.message));const a=r.value.expression||r.value._styleExpression.expression;if(s.expressionContext==="property"&&s.propertyKey==="text-font"&&!a.outputDefined())return[new nt(s.key,s.value,`Invalid data expression for "${s.propertyKey}". Output values must be contained as literals within the expression.`)];if(s.expressionContext==="property"&&s.propertyType==="layout"&&!$a(a))return[new nt(s.key,s.value,'"feature-state" data expressions are not supported with layout properties.')];if(s.expressionContext==="filter"&&!$a(a))return[new nt(s.key,s.value,'"feature-state" data expressions are not supported with filters.')];if(s.expressionContext&&s.expressionContext.indexOf("cluster")===0){if(!Dl(a,["zoom","feature-state"]))return[new nt(s.key,s.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(s.expressionContext==="cluster-initial"&&!Ll(a))return[new nt(s.key,s.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qa(s){const r=s.key,a=s.value,d=s.valueSpec,m=[];return Array.isArray(d.values)?d.values.indexOf(Nr(a))===-1&&m.push(new nt(r,a,`expected one of [${d.values.join(", ")}], ${JSON.stringify(a)} found`)):Object.keys(d.values).indexOf(Nr(a))===-1&&m.push(new nt(r,a,`expected one of [${Object.keys(d.values).join(", ")}], ${JSON.stringify(a)} found`)),m}function Ga(s){return Us(gs(s.value))?ys(io({},s,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Za(s)}function Za(s){const r=s.value,a=s.key;if(mr(r)!=="array")return[new nt(a,r,`array expected, ${mr(r)} found`)];const d=s.styleSpec;let m,_=[];if(r.length<1)return[new nt(a,r,"filter array must have at least 1 element")];switch(_=_.concat(qa({key:`${a}[0]`,value:r[0],valueSpec:d.filter_operator,style:s.style,styleSpec:s.styleSpec})),Nr(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&Nr(r[1])==="$type"&&_.push(new nt(a,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&_.push(new nt(a,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(m=mr(r[1]),m!=="string"&&_.push(new nt(`${a}[1]`,r[1],`string expected, ${m} found`)));for(let x=2;x{A in a&&r.push(new nt(d,a[A],`"${A}" is prohibited for ref layers`))}),m.layers.forEach(A=>{Nr(A.id)===S&&(P=A)}),P?P.ref?r.push(new nt(d,a.ref,"ref cannot reference another ref layer")):x=Nr(P.type):r.push(new nt(d,a.ref,`ref layer "${S}" not found`))}else if(x!=="background")if(a.source){const P=m.sources&&m.sources[a.source],A=P&&Nr(P.type);P?A==="vector"&&x==="raster"?r.push(new nt(d,a.source,`layer "${a.id}" requires a raster source`)):A!=="raster-dem"&&x==="hillshade"?r.push(new nt(d,a.source,`layer "${a.id}" requires a raster-dem source`)):A==="raster"&&x!=="raster"?r.push(new nt(d,a.source,`layer "${a.id}" requires a vector source`)):A!=="vector"||a["source-layer"]?A==="raster-dem"&&x!=="hillshade"?r.push(new nt(d,a.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!a.paint||!a.paint["line-gradient"]||A==="geojson"&&P.lineMetrics||r.push(new nt(d,a,`layer "${a.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new nt(d,a,`layer "${a.id}" must specify a "source-layer"`)):r.push(new nt(d,a.source,`source "${a.source}" not found`))}else r.push(new nt(d,a,'missing required property "source"'));return r=r.concat(hn({key:d,value:a,valueSpec:_.layer,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,objectElementValidators:{"*":()=>[],type:()=>s.validateSpec({key:`${d}.type`,value:a.type,valueSpec:_.layer.type,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,object:a,objectKey:"type"}),filter:Ga,layout:P=>hn({layer:a,key:P.key,value:P.value,style:P.style,styleSpec:P.styleSpec,validateSpec:P.validateSpec,objectElementValidators:{"*":A=>gu(io({layerType:x},A))}}),paint:P=>hn({layer:a,key:P.key,value:P.value,style:P.style,styleSpec:P.styleSpec,validateSpec:P.validateSpec,objectElementValidators:{"*":A=>mu(io({layerType:x},A))}})}})),r}function Po(s){const r=s.value,a=s.key,d=mr(r);return d!=="string"?[new nt(a,r,`string expected, ${d} found`)]:[]}const _u={promoteId:function({key:s,value:r}){if(mr(r)==="string")return Po({key:s,value:r});{const a=[];for(const d in r)a.push(...Po({key:`${s}.${d}`,value:r[d]}));return a}}};function uf(s){const r=s.value,a=s.key,d=s.styleSpec,m=s.style,_=s.validateSpec;if(!r.type)return[new nt(a,r,'"type" is required')];const x=Nr(r.type);let S;switch(x){case"vector":case"raster":return S=hn({key:a,value:r,valueSpec:d[`source_${x.replace("-","_")}`],style:s.style,styleSpec:d,objectElementValidators:_u,validateSpec:_}),S;case"raster-dem":return S=function(P){var A;const D=(A=P.sourceName)!==null&&A!==void 0?A:"",R=P.value,N=P.styleSpec,Z=N.source_raster_dem,W=P.style;let Q=[];const ie=mr(R);if(R===void 0)return Q;if(ie!=="object")return Q.push(new nt("source_raster_dem",R,`object expected, ${ie} found`)),Q;const he=Nr(R.encoding)==="custom",ke=["redFactor","greenFactor","blueFactor","baseShift"],ge=P.value.encoding?`"${P.value.encoding}"`:"Default";for(const we in R)!he&&ke.includes(we)?Q.push(new nt(we,R[we],`In "${D}": "${we}" is only valid when "encoding" is set to "custom". ${ge} encoding found`)):Z[we]?Q=Q.concat(P.validateSpec({key:we,value:R[we],valueSpec:Z[we],validateSpec:P.validateSpec,style:W,styleSpec:N})):Q.push(new nt(we,R[we],`unknown property "${we}"`));return Q}({sourceName:a,value:r,style:s.style,styleSpec:d,validateSpec:_}),S;case"geojson":if(S=hn({key:a,value:r,valueSpec:d.source_geojson,style:m,styleSpec:d,validateSpec:_,objectElementValidators:_u}),r.cluster)for(const P in r.clusterProperties){const[A,D]=r.clusterProperties[P],R=typeof A=="string"?[A,["accumulated"],["get",P]]:A;S.push(...ys({key:`${a}.${P}.map`,value:D,validateSpec:_,expressionContext:"cluster-map"})),S.push(...ys({key:`${a}.${P}.reduce`,value:R,validateSpec:_,expressionContext:"cluster-reduce"}))}return S;case"video":return hn({key:a,value:r,valueSpec:d.source_video,style:m,validateSpec:_,styleSpec:d});case"image":return hn({key:a,value:r,valueSpec:d.source_image,style:m,validateSpec:_,styleSpec:d});case"canvas":return[new nt(a,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qa({key:`${a}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:m,validateSpec:_,styleSpec:d})}}function vu(s){const r=s.value,a=s.styleSpec,d=a.light,m=s.style;let _=[];const x=mr(r);if(r===void 0)return _;if(x!=="object")return _=_.concat([new nt("light",r,`object expected, ${x} found`)]),_;for(const S in r){const P=S.match(/^(.*)-transition$/);_=_.concat(P&&d[P[1]]&&d[P[1]].transition?s.validateSpec({key:S,value:r[S],valueSpec:a.transition,validateSpec:s.validateSpec,style:m,styleSpec:a}):d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],validateSpec:s.validateSpec,style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)])}return _}function hf(s){const r=s.value,a=s.styleSpec,d=a.sky,m=s.style,_=mr(r);if(r===void 0)return[];if(_!=="object")return[new nt("sky",r,`object expected, ${_} found`)];let x=[];for(const S in r)x=x.concat(d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)]);return x}function bu(s){const r=s.value,a=s.styleSpec,d=a.terrain,m=s.style;let _=[];const x=mr(r);if(r===void 0)return _;if(x!=="object")return _=_.concat([new nt("terrain",r,`object expected, ${x} found`)]),_;for(const S in r)_=_.concat(d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],validateSpec:s.validateSpec,style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)]);return _}function xu(s){let r=[];const a=s.value,d=s.key;if(Array.isArray(a)){const m=[],_=[];for(const x in a)a[x].id&&m.includes(a[x].id)&&r.push(new nt(d,a,`all the sprites' ids must be unique, but ${a[x].id} is duplicated`)),m.push(a[x].id),a[x].url&&_.includes(a[x].url)&&r.push(new nt(d,a,`all the sprites' URLs must be unique, but ${a[x].url} is duplicated`)),_.push(a[x].url),r=r.concat(hn({key:`${d}[${x}]`,value:a[x],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:s.validateSpec}));return r}return Po({key:d,value:a})}const wu={"*":()=>[],array:Vl,boolean:function(s){const r=s.value,a=s.key,d=mr(r);return d!=="boolean"?[new nt(a,r,`boolean expected, ${d} found`)]:[]},number:Ua,color:function(s){const r=s.key,a=s.value,d=mr(a);return d!=="string"?[new nt(r,a,`color expected, ${d} found`)]:kr.parse(String(a))?[]:[new nt(r,a,`color expected, "${a}" found`)]},constants:cf,enum:qa,filter:Ga,function:du,layer:yu,object:hn,source:uf,light:vu,sky:hf,terrain:bu,projection:function(s){const r=s.value,a=s.styleSpec,d=a.projection,m=s.style,_=mr(r);if(r===void 0)return[];if(_!=="object")return[new nt("projection",r,`object expected, ${_} found`)];let x=[];for(const S in r)x=x.concat(d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)]);return x},string:Po,formatted:function(s){return Po(s).length===0?[]:ys(s)},resolvedImage:function(s){return Po(s).length===0?[]:ys(s)},padding:function(s){const r=s.key,a=s.value;if(mr(a)==="array"){if(a.length<1||a.length>4)return[new nt(r,a,`padding requires 1 to 4 values; ${a.length} values found`)];const d={type:"number"};let m=[];for(let _=0;_[]}})),s.constants&&(a=a.concat(cf({key:"constants",value:s.constants,style:s,styleSpec:r,validateSpec:Ha}))),Su(a)}function $n(s){return function(r){return s({...r,validateSpec:Ha})}}function Su(s){return[].concat(s).sort((r,a)=>r.line-a.line)}function Nn(s){return function(...r){return Su(s.apply(this,r))}}Fn.source=Nn($n(uf)),Fn.sprite=Nn($n(xu)),Fn.glyphs=Nn($n(ff)),Fn.light=Nn($n(vu)),Fn.sky=Nn($n(hf)),Fn.terrain=Nn($n(bu)),Fn.layer=Nn($n(yu)),Fn.filter=Nn($n(Ga)),Fn.paintProperty=Nn($n(mu)),Fn.layoutProperty=Nn($n(gu));const Mo=Fn,Cp=Mo.light,ku=Mo.sky,Ap=Mo.paintProperty,zp=Mo.layoutProperty;function Eu(s,r){let a=!1;if(r&&r.length)for(const d of r)s.fire(new Be(new Error(d.message))),a=!0;return a}class Zs{constructor(r,a,d){const m=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;const x=new Int32Array(this.arrayBuffer);r=x[0],this.d=(a=x[1])+2*(d=x[2]);for(let P=0;P=R[W+0]&&m>=R[W+1])?(S[Z]=!0,x.push(D[Z])):S[Z]=!1}}}}_forEachCell(r,a,d,m,_,x,S,P){const A=this._convertToCellCoord(r),D=this._convertToCellCoord(a),R=this._convertToCellCoord(d),N=this._convertToCellCoord(m);for(let Z=A;Z<=R;Z++)for(let W=D;W<=N;W++){const Q=this.d*W+Z;if((!P||P(this._convertFromCellCoord(Z),this._convertFromCellCoord(W),this._convertFromCellCoord(Z+1),this._convertFromCellCoord(W+1)))&&_.call(this,r,a,d,m,Q,x,S,P))return}}_convertFromCellCoord(r){return(r-this.padding)/this.scale}_convertToCellCoord(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const r=this.cells,a=3+this.cells.length+1+1;let d=0;for(let x=0;x=0)continue;const x=s[_];m[_]=lo[a].shallow.indexOf(_)>=0?x:Wa(x,r)}s instanceof Error&&(m.message=s.message)}if(m.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(m.$name=a),m}function co(s){if(pf(s))return s;if(Array.isArray(s))return s.map(co);if(typeof s!="object")throw new Error("can't deserialize object of type "+typeof s);const r=Pu(s)||"Object";if(!lo[r])throw new Error(`can't deserialize unregistered class ${r}`);const{klass:a}=lo[r];if(!a)throw new Error(`can't deserialize unregistered class ${r}`);if(a.deserialize)return a.deserialize(s);const d=Object.create(a.prototype);for(const m of Object.keys(s)){if(m==="$name")continue;const _=s[m];d[m]=lo[r].shallow.indexOf(m)>=0?_:co(_)}return d}class mf{constructor(){this.first=!0}update(r,a){const d=Math.floor(r);return this.first?(this.first=!1,this.lastIntegerZoom=d,this.lastIntegerZoomTime=0,this.lastZoom=r,this.lastFloorZoom=d,!0):(this.lastFloorZoom>d?(this.lastIntegerZoom=d+1,this.lastIntegerZoomTime=a):this.lastFloorZooms>=128&&s<=255,Arabic:s=>s>=1536&&s<=1791,"Arabic Supplement":s=>s>=1872&&s<=1919,"Arabic Extended-A":s=>s>=2208&&s<=2303,"Hangul Jamo":s=>s>=4352&&s<=4607,"Unified Canadian Aboriginal Syllabics":s=>s>=5120&&s<=5759,Khmer:s=>s>=6016&&s<=6143,"Unified Canadian Aboriginal Syllabics Extended":s=>s>=6320&&s<=6399,"General Punctuation":s=>s>=8192&&s<=8303,"Letterlike Symbols":s=>s>=8448&&s<=8527,"Number Forms":s=>s>=8528&&s<=8591,"Miscellaneous Technical":s=>s>=8960&&s<=9215,"Control Pictures":s=>s>=9216&&s<=9279,"Optical Character Recognition":s=>s>=9280&&s<=9311,"Enclosed Alphanumerics":s=>s>=9312&&s<=9471,"Geometric Shapes":s=>s>=9632&&s<=9727,"Miscellaneous Symbols":s=>s>=9728&&s<=9983,"Miscellaneous Symbols and Arrows":s=>s>=11008&&s<=11263,"CJK Radicals Supplement":s=>s>=11904&&s<=12031,"Kangxi Radicals":s=>s>=12032&&s<=12255,"Ideographic Description Characters":s=>s>=12272&&s<=12287,"CJK Symbols and Punctuation":s=>s>=12288&&s<=12351,Hiragana:s=>s>=12352&&s<=12447,Katakana:s=>s>=12448&&s<=12543,Bopomofo:s=>s>=12544&&s<=12591,"Hangul Compatibility Jamo":s=>s>=12592&&s<=12687,Kanbun:s=>s>=12688&&s<=12703,"Bopomofo Extended":s=>s>=12704&&s<=12735,"CJK Strokes":s=>s>=12736&&s<=12783,"Katakana Phonetic Extensions":s=>s>=12784&&s<=12799,"Enclosed CJK Letters and Months":s=>s>=12800&&s<=13055,"CJK Compatibility":s=>s>=13056&&s<=13311,"CJK Unified Ideographs Extension A":s=>s>=13312&&s<=19903,"Yijing Hexagram Symbols":s=>s>=19904&&s<=19967,"CJK Unified Ideographs":s=>s>=19968&&s<=40959,"Yi Syllables":s=>s>=40960&&s<=42127,"Yi Radicals":s=>s>=42128&&s<=42191,"Hangul Jamo Extended-A":s=>s>=43360&&s<=43391,"Hangul Syllables":s=>s>=44032&&s<=55215,"Hangul Jamo Extended-B":s=>s>=55216&&s<=55295,"Private Use Area":s=>s>=57344&&s<=63743,"CJK Compatibility Ideographs":s=>s>=63744&&s<=64255,"Arabic Presentation Forms-A":s=>s>=64336&&s<=65023,"Vertical Forms":s=>s>=65040&&s<=65055,"CJK Compatibility Forms":s=>s>=65072&&s<=65103,"Small Form Variants":s=>s>=65104&&s<=65135,"Arabic Presentation Forms-B":s=>s>=65136&&s<=65279,"Halfwidth and Fullwidth Forms":s=>s>=65280&&s<=65519};function Mu(s){for(const r of s)if(Iu(r.charCodeAt(0)))return!0;return!1}function Lp(s){for(const r of s)if(!gf(r.charCodeAt(0)))return!1;return!0}function gf(s){return!(pt.Arabic(s)||pt["Arabic Supplement"](s)||pt["Arabic Extended-A"](s)||pt["Arabic Presentation Forms-A"](s)||pt["Arabic Presentation Forms-B"](s))}function Iu(s){return!(s!==746&&s!==747&&(s<4352||!(pt["Bopomofo Extended"](s)||pt.Bopomofo(s)||pt["CJK Compatibility Forms"](s)&&!(s>=65097&&s<=65103)||pt["CJK Compatibility Ideographs"](s)||pt["CJK Compatibility"](s)||pt["CJK Radicals Supplement"](s)||pt["CJK Strokes"](s)||!(!pt["CJK Symbols and Punctuation"](s)||s>=12296&&s<=12305||s>=12308&&s<=12319||s===12336)||pt["CJK Unified Ideographs Extension A"](s)||pt["CJK Unified Ideographs"](s)||pt["Enclosed CJK Letters and Months"](s)||pt["Hangul Compatibility Jamo"](s)||pt["Hangul Jamo Extended-A"](s)||pt["Hangul Jamo Extended-B"](s)||pt["Hangul Jamo"](s)||pt["Hangul Syllables"](s)||pt.Hiragana(s)||pt["Ideographic Description Characters"](s)||pt.Kanbun(s)||pt["Kangxi Radicals"](s)||pt["Katakana Phonetic Extensions"](s)||pt.Katakana(s)&&s!==12540||!(!pt["Halfwidth and Fullwidth Forms"](s)||s===65288||s===65289||s===65293||s>=65306&&s<=65310||s===65339||s===65341||s===65343||s>=65371&&s<=65503||s===65507||s>=65512&&s<=65519)||!(!pt["Small Form Variants"](s)||s>=65112&&s<=65118||s>=65123&&s<=65126)||pt["Unified Canadian Aboriginal Syllabics"](s)||pt["Unified Canadian Aboriginal Syllabics Extended"](s)||pt["Vertical Forms"](s)||pt["Yijing Hexagram Symbols"](s)||pt["Yi Syllables"](s)||pt["Yi Radicals"](s))))}function yf(s){return!(Iu(s)||function(r){return!!(pt["Latin-1 Supplement"](r)&&(r===167||r===169||r===174||r===177||r===188||r===189||r===190||r===215||r===247)||pt["General Punctuation"](r)&&(r===8214||r===8224||r===8225||r===8240||r===8241||r===8251||r===8252||r===8258||r===8263||r===8264||r===8265||r===8273)||pt["Letterlike Symbols"](r)||pt["Number Forms"](r)||pt["Miscellaneous Technical"](r)&&(r>=8960&&r<=8967||r>=8972&&r<=8991||r>=8996&&r<=9e3||r===9003||r>=9085&&r<=9114||r>=9150&&r<=9165||r===9167||r>=9169&&r<=9179||r>=9186&&r<=9215)||pt["Control Pictures"](r)&&r!==9251||pt["Optical Character Recognition"](r)||pt["Enclosed Alphanumerics"](r)||pt["Geometric Shapes"](r)||pt["Miscellaneous Symbols"](r)&&!(r>=9754&&r<=9759)||pt["Miscellaneous Symbols and Arrows"](r)&&(r>=11026&&r<=11055||r>=11088&&r<=11097||r>=11192&&r<=11243)||pt["CJK Symbols and Punctuation"](r)||pt.Katakana(r)||pt["Private Use Area"](r)||pt["CJK Compatibility Forms"](r)||pt["Small Form Variants"](r)||pt["Halfwidth and Fullwidth Forms"](r)||r===8734||r===8756||r===8757||r>=9984&&r<=10087||r>=10102&&r<=10131||r===65532||r===65533)}(s))}function qo(s){return s>=1424&&s<=2303||pt["Arabic Presentation Forms-A"](s)||pt["Arabic Presentation Forms-B"](s)}function _f(s,r){return!(!r&&qo(s)||s>=2304&&s<=3583||s>=3840&&s<=4255||pt.Khmer(s))}function Tu(s){for(const r of s)if(qo(r.charCodeAt(0)))return!0;return!1}const Go=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(s){this.pluginStatus=s.pluginStatus,this.pluginURL=s.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(s){this.applyArabicShaping=s.applyArabicShaping,this.processBidirectionalText=s.processBidirectionalText,this.processStyledBidirectionalText=s.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class zr{constructor(r,a){this.zoom=r,a?(this.now=a.now,this.fadeDuration=a.fadeDuration,this.zoomHistory=a.zoomHistory,this.transition=a.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new mf,this.transition={})}isSupportedScript(r){return function(a,d){for(const m of a)if(!_f(m.charCodeAt(0),d))return!1;return!0}(r,Go.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const r=this.zoom,a=r-Math.floor(r),d=this.crossFadingFactor();return r>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:a+(1-a)*d}:{fromScale:.5,toScale:1,t:1-(1-d)*a}}}class Ul{constructor(r,a){this.property=r,this.value=a,this.expression=function(d,m){if(Na(d))return new Ol(d,m);if(ja(d)){const _=lf(d,m);if(_.result==="error")throw new Error(_.value.map(x=>`${x.key}: ${x.message}`).join(", "));return _.value}{let _=d;return m.type==="color"&&typeof d=="string"?_=kr.parse(d):m.type!=="padding"||typeof d!="number"&&!Array.isArray(d)?m.type==="variableAnchorOffsetCollection"&&Array.isArray(d)&&(_=Sn.parse(d)):_=wn.parse(d),{kind:"constant",evaluate:()=>_}}}(a===void 0?r.specification.default:a,r.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(r,a,d){return this.property.possiblyEvaluate(this,r,a,d)}}class Hs{constructor(r){this.property=r,this.value=new Ul(r,void 0)}transitioned(r,a){return new vf(this.property,this.value,a,Ee({},r.transition,this.transition),r.now)}untransitioned(){return new vf(this.property,this.value,null,{},0)}}class Ws{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitionablePropertyValues)}getValue(r){return ve(this._values[r].value.value)}setValue(r,a){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Hs(this._values[r].property)),this._values[r].value=new Ul(this._values[r].property,a===null?void 0:ve(a))}getTransition(r){return ve(this._values[r].transition)}setTransition(r,a){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Hs(this._values[r].property)),this._values[r].transition=ve(a)||void 0}serialize(){const r={};for(const a of Object.keys(this._values)){const d=this.getValue(a);d!==void 0&&(r[a]=d);const m=this.getTransition(a);m!==void 0&&(r[`${a}-transition`]=m)}return r}transitioned(r,a){const d=new Cu(this._properties);for(const m of Object.keys(this._values))d._values[m]=this._values[m].transitioned(r,a._values[m]);return d}untransitioned(){const r=new Cu(this._properties);for(const a of Object.keys(this._values))r._values[a]=this._values[a].untransitioned();return r}}class vf{constructor(r,a,d,m,_){this.property=r,this.value=a,this.begin=_+m.delay||0,this.end=this.begin+m.duration||0,r.specification.transition&&(m.delay||m.duration)&&(this.prior=d)}possiblyEvaluate(r,a,d){const m=r.now||0,_=this.value.possiblyEvaluate(r,a,d),x=this.prior;if(x){if(m>this.end)return this.prior=null,_;if(this.value.isDataDriven())return this.prior=null,_;if(m=1)return 1;const A=P*P,D=A*P;return 4*(P<.5?D:3*(P-A)+D-.75)}(S))}}return _}}class Cu{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitioningPropertyValues)}possiblyEvaluate(r,a,d){const m=new ql(this._properties);for(const _ of Object.keys(this._values))m._values[_]=this._values[_].possiblyEvaluate(r,a,d);return m}hasTransition(){for(const r of Object.keys(this._values))if(this._values[r].prior)return!0;return!1}}class Xa{constructor(r){this._properties=r,this._values=Object.create(r.defaultPropertyValues)}hasValue(r){return this._values[r].value!==void 0}getValue(r){return ve(this._values[r].value)}setValue(r,a){this._values[r]=new Ul(this._values[r].property,a===null?void 0:ve(a))}serialize(){const r={};for(const a of Object.keys(this._values)){const d=this.getValue(a);d!==void 0&&(r[a]=d)}return r}possiblyEvaluate(r,a,d){const m=new ql(this._properties);for(const _ of Object.keys(this._values))m._values[_]=this._values[_].possiblyEvaluate(r,a,d);return m}}class uo{constructor(r,a,d){this.property=r,this.value=a,this.parameters=d}isConstant(){return this.value.kind==="constant"}constantOr(r){return this.value.kind==="constant"?this.value.value:r}evaluate(r,a,d,m){return this.property.evaluate(this.value,this.parameters,r,a,d,m)}}class ql{constructor(r){this._properties=r,this._values=Object.create(r.defaultPossiblyEvaluatedValues)}get(r){return this._values[r]}}class It{constructor(r){this.specification=r}possiblyEvaluate(r,a){if(r.isDataDriven())throw new Error("Value should not be data driven");return r.expression.evaluate(a)}interpolate(r,a,d){const m=kn[this.specification.type];return m?m(r,a,d):r}}class Bt{constructor(r,a){this.specification=r,this.overrides=a}possiblyEvaluate(r,a,d,m){return new uo(this,r.expression.kind==="constant"||r.expression.kind==="camera"?{kind:"constant",value:r.expression.evaluate(a,null,{},d,m)}:r.expression,a)}interpolate(r,a,d){if(r.value.kind!=="constant"||a.value.kind!=="constant")return r;if(r.value.value===void 0||a.value.value===void 0)return new uo(this,{kind:"constant",value:void 0},r.parameters);const m=kn[this.specification.type];if(m){const _=m(r.value.value,a.value.value,d);return new uo(this,{kind:"constant",value:_},r.parameters)}return r}evaluate(r,a,d,m,_,x){return r.kind==="constant"?r.value:r.evaluate(a,d,m,_,x)}}class v extends Bt{possiblyEvaluate(r,a,d,m){if(r.value===void 0)return new uo(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){const _=r.expression.evaluate(a,null,{},d,m),x=r.property.specification.type==="resolvedImage"&&typeof _!="string"?_.name:_,S=this._calculate(x,x,x,a);return new uo(this,{kind:"constant",value:S},a)}if(r.expression.kind==="camera"){const _=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new uo(this,{kind:"constant",value:_},a)}return new uo(this,r.expression,a)}evaluate(r,a,d,m,_,x){if(r.kind==="source"){const S=r.evaluate(a,d,m,_,x);return this._calculate(S,S,S,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},d,m),r.evaluate({zoom:Math.floor(a.zoom)},d,m),r.evaluate({zoom:Math.floor(a.zoom)+1},d,m),a):r.value}_calculate(r,a,d,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:d,to:a}}interpolate(r){return r}}class i{constructor(r){this.specification=r}possiblyEvaluate(r,a,d,m){if(r.value!==void 0){if(r.expression.kind==="constant"){const _=r.expression.evaluate(a,null,{},d,m);return this._calculate(_,_,_,a)}return this._calculate(r.expression.evaluate(new zr(Math.floor(a.zoom-1),a)),r.expression.evaluate(new zr(Math.floor(a.zoom),a)),r.expression.evaluate(new zr(Math.floor(a.zoom+1),a)),a)}}_calculate(r,a,d,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:d,to:a}}interpolate(r){return r}}class h{constructor(r){this.specification=r}possiblyEvaluate(r,a,d,m){return!!r.expression.evaluate(a,null,{},d,m)}interpolate(){return!1}}class p{constructor(r){this.properties=r,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const a in r){const d=r[a];d.specification.overridable&&this.overridableProperties.push(a);const m=this.defaultPropertyValues[a]=new Ul(d,void 0),_=this.defaultTransitionablePropertyValues[a]=new Hs(d);this.defaultTransitioningPropertyValues[a]=_.untransitioned(),this.defaultPossiblyEvaluatedValues[a]=m.possiblyEvaluate({})}}}St("DataDrivenProperty",Bt),St("DataConstantProperty",It),St("CrossFadedDataDrivenProperty",v),St("CrossFadedProperty",i),St("ColorRampProperty",h);const g="-transition";class b extends nr{constructor(r,a){if(super(),this.id=r.id,this.type=r.type,this._featureFilter={filter:()=>!0,needGeometry:!1},r.type!=="custom"&&(this.metadata=r.metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new Xa(a.layout)),a.paint)){this._transitionablePaint=new Ws(a.paint);for(const d in r.paint)this.setPaintProperty(d,r.paint[d],{validate:!1});for(const d in r.layout)this.setLayoutProperty(d,r.layout[d],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ql(a.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)}setLayoutProperty(r,a,d={}){a!=null&&this._validate(zp,`layers.${this.id}.layout.${r}`,r,a,d)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)}getPaintProperty(r){return r.endsWith(g)?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)}setPaintProperty(r,a,d={}){if(a!=null&&this._validate(Ap,`layers.${this.id}.paint.${r}`,r,a,d))return!1;if(r.endsWith(g))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;{const m=this._transitionablePaint._values[r],_=m.property.specification["property-type"]==="cross-faded-data-driven",x=m.value.isDataDriven(),S=m.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);const P=this._transitionablePaint._values[r].value;return P.isDataDriven()||x||_||this._handleOverridablePaintPropertyUpdate(r,S,P)}}_handleSpecialPaintPropertyUpdate(r){}_handleOverridablePaintPropertyUpdate(r,a,d){return!1}isHidden(r){return!!(this.minzoom&&r=this.maxzoom)||this.visibility==="none"}updateTransitions(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)}serialize(){const r={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),Ye(r,(a,d)=>!(a===void 0||d==="layout"&&!Object.keys(a).length||d==="paint"&&!Object.keys(a).length))}_validate(r,a,d,m,_={}){return(!_||_.validate!==!1)&&Eu(this,r.call(Mo,{key:a,layerType:this.type,objectKey:d,value:m,styleSpec:Te,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const r in this.paint._values){const a=this.paint.get(r);if(a instanceof uo&&ds(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1}}const E={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class I{constructor(r,a){this._structArray=r,this._pos1=a*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class C{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(r,a){return r._trim(),a&&(r.isTransferred=!0,a.push(r.arrayBuffer)),{length:r.length,arrayBuffer:r.arrayBuffer}}static deserialize(r){const a=Object.create(this.prototype);return a.arrayBuffer=r.arrayBuffer,a.length=r.length,a.capacity=r.arrayBuffer.byteLength/a.bytesPerElement,a._refreshViews(),a}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(r){this.reserve(r),this.length=r}reserve(r){if(r>this.capacity){this.capacity=Math.max(r,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const a=this.uint8;this._refreshViews(),a&&this.uint8.set(a)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function L(s,r=1){let a=0,d=0;return{members:s.map(m=>{const _=E[m.type].BYTES_PER_ELEMENT,x=a=$(a,Math.max(r,_)),S=m.components||1;return d=Math.max(d,_),a+=_*S,{name:m.name,type:m.type,components:S,offset:x}}),size:$(a,Math.max(d,r)),alignment:r}}function $(s,r){return Math.ceil(s/r)*r}class O extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a){const d=this.length;return this.resize(d+1),this.emplace(d,r,a)}emplace(r,a,d){const m=2*r;return this.int16[m+0]=a,this.int16[m+1]=d,r}}O.prototype.bytesPerElement=4,St("StructArrayLayout2i4",O);class H extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.int16[_+0]=a,this.int16[_+1]=d,this.int16[_+2]=m,r}}H.prototype.bytesPerElement=6,St("StructArrayLayout3i6",H);class K extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,r,a,d,m)}emplace(r,a,d,m,_){const x=4*r;return this.int16[x+0]=a,this.int16[x+1]=d,this.int16[x+2]=m,this.int16[x+3]=_,r}}K.prototype.bytesPerElement=8,St("StructArrayLayout4i8",K);class te extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=6*r;return this.int16[P+0]=a,this.int16[P+1]=d,this.int16[P+2]=m,this.int16[P+3]=_,this.int16[P+4]=x,this.int16[P+5]=S,r}}te.prototype.bytesPerElement=12,St("StructArrayLayout2i4i12",te);class se extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=4*r,A=8*r;return this.int16[P+0]=a,this.int16[P+1]=d,this.uint8[A+4]=m,this.uint8[A+5]=_,this.uint8[A+6]=x,this.uint8[A+7]=S,r}}se.prototype.bytesPerElement=8,St("StructArrayLayout2i4ub8",se);class re extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a){const d=this.length;return this.resize(d+1),this.emplace(d,r,a)}emplace(r,a,d){const m=2*r;return this.float32[m+0]=a,this.float32[m+1]=d,r}}re.prototype.bytesPerElement=8,St("StructArrayLayout2f8",re);class ue extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D){const R=this.length;return this.resize(R+1),this.emplace(R,r,a,d,m,_,x,S,P,A,D)}emplace(r,a,d,m,_,x,S,P,A,D,R){const N=10*r;return this.uint16[N+0]=a,this.uint16[N+1]=d,this.uint16[N+2]=m,this.uint16[N+3]=_,this.uint16[N+4]=x,this.uint16[N+5]=S,this.uint16[N+6]=P,this.uint16[N+7]=A,this.uint16[N+8]=D,this.uint16[N+9]=R,r}}ue.prototype.bytesPerElement=20,St("StructArrayLayout10ui20",ue);class ye extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D,R,N){const Z=this.length;return this.resize(Z+1),this.emplace(Z,r,a,d,m,_,x,S,P,A,D,R,N)}emplace(r,a,d,m,_,x,S,P,A,D,R,N,Z){const W=12*r;return this.int16[W+0]=a,this.int16[W+1]=d,this.int16[W+2]=m,this.int16[W+3]=_,this.uint16[W+4]=x,this.uint16[W+5]=S,this.uint16[W+6]=P,this.uint16[W+7]=A,this.int16[W+8]=D,this.int16[W+9]=R,this.int16[W+10]=N,this.int16[W+11]=Z,r}}ye.prototype.bytesPerElement=24,St("StructArrayLayout4i4ui4i24",ye);class ne extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.float32[_+0]=a,this.float32[_+1]=d,this.float32[_+2]=m,r}}ne.prototype.bytesPerElement=12,St("StructArrayLayout3f12",ne);class xe extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r){const a=this.length;return this.resize(a+1),this.emplace(a,r)}emplace(r,a){return this.uint32[1*r+0]=a,r}}xe.prototype.bytesPerElement=4,St("StructArrayLayout1ul4",xe);class Ie extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A){const D=this.length;return this.resize(D+1),this.emplace(D,r,a,d,m,_,x,S,P,A)}emplace(r,a,d,m,_,x,S,P,A,D){const R=10*r,N=5*r;return this.int16[R+0]=a,this.int16[R+1]=d,this.int16[R+2]=m,this.int16[R+3]=_,this.int16[R+4]=x,this.int16[R+5]=S,this.uint32[N+3]=P,this.uint16[R+8]=A,this.uint16[R+9]=D,r}}Ie.prototype.bytesPerElement=20,St("StructArrayLayout6i1ul2ui20",Ie);class Ce extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=6*r;return this.int16[P+0]=a,this.int16[P+1]=d,this.int16[P+2]=m,this.int16[P+3]=_,this.int16[P+4]=x,this.int16[P+5]=S,r}}Ce.prototype.bytesPerElement=12,St("StructArrayLayout2i2i2i12",Ce);class je extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_){const x=this.length;return this.resize(x+1),this.emplace(x,r,a,d,m,_)}emplace(r,a,d,m,_,x){const S=4*r,P=8*r;return this.float32[S+0]=a,this.float32[S+1]=d,this.float32[S+2]=m,this.int16[P+6]=_,this.int16[P+7]=x,r}}je.prototype.bytesPerElement=16,St("StructArrayLayout2f1f2i16",je);class Je extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=16*r,A=4*r,D=8*r;return this.uint8[P+0]=a,this.uint8[P+1]=d,this.float32[A+1]=m,this.float32[A+2]=_,this.int16[D+6]=x,this.int16[D+7]=S,r}}Je.prototype.bytesPerElement=16,St("StructArrayLayout2ub2f2i16",Je);class gt extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.uint16[_+0]=a,this.uint16[_+1]=d,this.uint16[_+2]=m,r}}gt.prototype.bytesPerElement=6,St("StructArrayLayout3ui6",gt);class yt extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he){const ke=this.length;return this.resize(ke+1),this.emplace(ke,r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he)}emplace(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke){const ge=24*r,we=12*r,Re=48*r;return this.int16[ge+0]=a,this.int16[ge+1]=d,this.uint16[ge+2]=m,this.uint16[ge+3]=_,this.uint32[we+2]=x,this.uint32[we+3]=S,this.uint32[we+4]=P,this.uint16[ge+10]=A,this.uint16[ge+11]=D,this.uint16[ge+12]=R,this.float32[we+7]=N,this.float32[we+8]=Z,this.uint8[Re+36]=W,this.uint8[Re+37]=Q,this.uint8[Re+38]=ie,this.uint32[we+10]=he,this.int16[ge+22]=ke,r}}yt.prototype.bytesPerElement=48,St("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",yt);class Qe extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke,ge,we,Re,He,ht,zt,dt,ut,Mt,kt){const vt=this.length;return this.resize(vt+1),this.emplace(vt,r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke,ge,we,Re,He,ht,zt,dt,ut,Mt,kt)}emplace(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke,ge,we,Re,He,ht,zt,dt,ut,Mt,kt,vt){const Ne=32*r,Tt=16*r;return this.int16[Ne+0]=a,this.int16[Ne+1]=d,this.int16[Ne+2]=m,this.int16[Ne+3]=_,this.int16[Ne+4]=x,this.int16[Ne+5]=S,this.int16[Ne+6]=P,this.int16[Ne+7]=A,this.uint16[Ne+8]=D,this.uint16[Ne+9]=R,this.uint16[Ne+10]=N,this.uint16[Ne+11]=Z,this.uint16[Ne+12]=W,this.uint16[Ne+13]=Q,this.uint16[Ne+14]=ie,this.uint16[Ne+15]=he,this.uint16[Ne+16]=ke,this.uint16[Ne+17]=ge,this.uint16[Ne+18]=we,this.uint16[Ne+19]=Re,this.uint16[Ne+20]=He,this.uint16[Ne+21]=ht,this.uint16[Ne+22]=zt,this.uint32[Tt+12]=dt,this.float32[Tt+13]=ut,this.float32[Tt+14]=Mt,this.uint16[Ne+30]=kt,this.uint16[Ne+31]=vt,r}}Qe.prototype.bytesPerElement=64,St("StructArrayLayout8i15ui1ul2f2ui64",Qe);class it extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r){const a=this.length;return this.resize(a+1),this.emplace(a,r)}emplace(r,a){return this.float32[1*r+0]=a,r}}it.prototype.bytesPerElement=4,St("StructArrayLayout1f4",it);class Et extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.uint16[6*r+0]=a,this.float32[_+1]=d,this.float32[_+2]=m,r}}Et.prototype.bytesPerElement=12,St("StructArrayLayout1ui2f12",Et);class Ut extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=4*r;return this.uint32[2*r+0]=a,this.uint16[_+2]=d,this.uint16[_+3]=m,r}}Ut.prototype.bytesPerElement=8,St("StructArrayLayout1ul2ui8",Ut);class st extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a){const d=this.length;return this.resize(d+1),this.emplace(d,r,a)}emplace(r,a,d){const m=2*r;return this.uint16[m+0]=a,this.uint16[m+1]=d,r}}st.prototype.bytesPerElement=4,St("StructArrayLayout2ui4",st);class ft extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r){const a=this.length;return this.resize(a+1),this.emplace(a,r)}emplace(r,a){return this.uint16[1*r+0]=a,r}}ft.prototype.bytesPerElement=2,St("StructArrayLayout1ui2",ft);class jt extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,r,a,d,m)}emplace(r,a,d,m,_){const x=4*r;return this.float32[x+0]=a,this.float32[x+1]=d,this.float32[x+2]=m,this.float32[x+3]=_,r}}jt.prototype.bytesPerElement=16,St("StructArrayLayout4f16",jt);class jr extends I{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new k(this.anchorPointX,this.anchorPointY)}}jr.prototype.size=20;class Qt extends Ie{get(r){return new jr(this,r)}}St("CollisionBoxArray",Qt);class ar extends I{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(r){this._structArray.uint8[this._pos1+37]=r}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(r){this._structArray.uint8[this._pos1+38]=r}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(r){this._structArray.uint32[this._pos4+10]=r}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ar.prototype.size=48;class Vr extends yt{get(r){return new ar(this,r)}}St("PlacedSymbolArray",Vr);class ji extends I{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(r){this._structArray.uint32[this._pos4+12]=r}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}ji.prototype.size=64;class jn extends Qe{get(r){return new ji(this,r)}}St("SymbolInstanceArray",jn);class Ur extends it{getoffsetX(r){return this.float32[1*r+0]}}St("GlyphOffsetArray",Ur);class fn extends H{getx(r){return this.int16[3*r+0]}gety(r){return this.int16[3*r+1]}gettileUnitDistanceFromAnchor(r){return this.int16[3*r+2]}}St("SymbolLineVertexArray",fn);class en extends I{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}en.prototype.size=12;class Vi extends Et{get(r){return new en(this,r)}}St("TextAnchorOffsetArray",Vi);class Ui extends I{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Ui.prototype.size=8;class Vn extends Ut{get(r){return new Ui(this,r)}}St("FeatureIndexArray",Vn);class _s extends O{}class Gl extends O{}class Xs extends O{}class vs extends te{}class Zl extends se{}class Au extends re{}class Li extends ue{}class Un extends ye{}class Zo extends ne{}class Js extends xe{}class qi extends Ce{}class Gi extends Je{}class Ii extends gt{}class Wr extends st{}const Ks=L([{name:"a_pos",components:2,type:"Int16"}],4),{members:zu}=Ks;class wi{constructor(r=[]){this.segments=r}prepareSegment(r,a,d,m){let _=this.segments[this.segments.length-1];return r>wi.MAX_VERTEX_ARRAY_LENGTH&&at(`Max vertices per segment is ${wi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}`),(!_||_.vertexLength+r>wi.MAX_VERTEX_ARRAY_LENGTH||_.sortKey!==m)&&(_={vertexOffset:a.length,primitiveOffset:d.length,vertexLength:0,primitiveLength:0},m!==void 0&&(_.sortKey=m),this.segments.push(_)),_}get(){return this.segments}destroy(){for(const r of this.segments)for(const a in r.vaos)r.vaos[a].destroy()}static simpleSegment(r,a,d,m){return new wi([{vertexOffset:r,primitiveOffset:a,vertexLength:d,primitiveLength:m,vaos:{},sortKey:0}])}}function bf(s,r){return 256*(s=X(Math.floor(s),0,255))+X(Math.floor(r),0,255)}wi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,St("SegmentVector",wi);const Hl=L([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Wl={exports:{}},Ho={exports:{}};Ho.exports=function(s,r){var a,d,m,_,x,S,P,A;for(d=s.length-(a=3&s.length),m=r,x=3432918353,S=461845907,A=0;A>>16)*x&65535)<<16)&4294967295)<<15|P>>>17))*S+(((P>>>16)*S&65535)<<16)&4294967295)<<13|m>>>19))+((5*(m>>>16)&65535)<<16)&4294967295))+((58964+(_>>>16)&65535)<<16);switch(P=0,a){case 3:P^=(255&s.charCodeAt(A+2))<<16;case 2:P^=(255&s.charCodeAt(A+1))<<8;case 1:m^=P=(65535&(P=(P=(65535&(P^=255&s.charCodeAt(A)))*x+(((P>>>16)*x&65535)<<16)&4294967295)<<15|P>>>17))*S+(((P>>>16)*S&65535)<<16)&4294967295}return m^=s.length,m=2246822507*(65535&(m^=m>>>16))+((2246822507*(m>>>16)&65535)<<16)&4294967295,m=3266489909*(65535&(m^=m>>>13))+((3266489909*(m>>>16)&65535)<<16)&4294967295,(m^=m>>>16)>>>0};var xf=Ho.exports,Lu={exports:{}};Lu.exports=function(s,r){for(var a,d=s.length,m=r^d,_=0;d>=4;)a=1540483477*(65535&(a=255&s.charCodeAt(_)|(255&s.charCodeAt(++_))<<8|(255&s.charCodeAt(++_))<<16|(255&s.charCodeAt(++_))<<24))+((1540483477*(a>>>16)&65535)<<16),m=1540483477*(65535&m)+((1540483477*(m>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),d-=4,++_;switch(d){case 3:m^=(255&s.charCodeAt(_+2))<<16;case 2:m^=(255&s.charCodeAt(_+1))<<8;case 1:m=1540483477*(65535&(m^=255&s.charCodeAt(_)))+((1540483477*(m>>>16)&65535)<<16)}return m=1540483477*(65535&(m^=m>>>13))+((1540483477*(m>>>16)&65535)<<16),(m^=m>>>15)>>>0};var Du=xf,Fu=Lu.exports;Wl.exports=Du,Wl.exports.murmur3=Du,Wl.exports.murmur2=Fu;var Xl=y(Wl.exports);class Ys{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(r,a,d,m){this.ids.push(Qy(r)),this.positions.push(a,d,m)}getPositions(r){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const a=Qy(r);let d=0,m=this.ids.length-1;for(;d>1;this.ids[x]>=a?m=x:d=x+1}const _=[];for(;this.ids[d]===a;)_.push({index:this.positions[3*d],start:this.positions[3*d+1],end:this.positions[3*d+2]}),d++;return _}static serialize(r,a){const d=new Float64Array(r.ids),m=new Uint32Array(r.positions);return Dp(d,m,0,d.length-1),a&&a.push(d.buffer,m.buffer),{ids:d,positions:m}}static deserialize(r){const a=new Ys;return a.ids=r.ids,a.positions=r.positions,a.indexed=!0,a}}function Qy(s){const r=+s;return!isNaN(r)&&r<=Number.MAX_SAFE_INTEGER?r:Xl(String(s))}function Dp(s,r,a,d){for(;a>1];let _=a-1,x=d+1;for(;;){do _++;while(s[_]m);if(_>=x)break;wf(s,_,x),wf(r,3*_,3*x),wf(r,3*_+1,3*x+1),wf(r,3*_+2,3*x+2)}x-a`u_${m}`),this.type=d}setUniform(r,a,d){r.set(d.constantOr(this.value))}getBinding(r,a,d){return this.type==="color"?new t_(r,a):new Sf(r,a)}}class Jl{constructor(r,a){this.uniformNames=a.map(d=>`u_${d}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(r,a){this.pixelRatioFrom=a.pixelRatio,this.pixelRatioTo=r.pixelRatio,this.patternFrom=a.tlbr,this.patternTo=r.tlbr}setUniform(r,a,d,m){const _=m==="u_pattern_to"?this.patternTo:m==="u_pattern_from"?this.patternFrom:m==="u_pixel_ratio_to"?this.pixelRatioTo:m==="u_pixel_ratio_from"?this.pixelRatioFrom:null;_&&r.set(_)}getBinding(r,a,d){return d.substr(0,9)==="u_pattern"?new e_(r,a):new Sf(r,a)}}class bs{constructor(r,a,d,m){this.expression=r,this.type=d,this.maxValue=0,this.paintVertexAttributes=a.map(_=>({name:`a_${_}`,type:"Float32",components:d==="color"?2:1,offset:0})),this.paintVertexArray=new m}populatePaintArray(r,a,d,m,_){const x=this.paintVertexArray.length,S=this.expression.evaluate(new zr(0),a,{},m,[],_);this.paintVertexArray.resize(r),this._setPaintValue(x,r,S)}updatePaintArray(r,a,d,m){const _=this.expression.evaluate({zoom:0},d,m);this._setPaintValue(r,a,_)}_setPaintValue(r,a,d){if(this.type==="color"){const m=Fp(d);for(let _=r;_`u_${S}_t`),this.type=d,this.useIntegerZoom=m,this.zoom=_,this.maxValue=0,this.paintVertexAttributes=a.map(S=>({name:`a_${S}`,type:"Float32",components:d==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(r,a,d,m,_){const x=this.expression.evaluate(new zr(this.zoom),a,{},m,[],_),S=this.expression.evaluate(new zr(this.zoom+1),a,{},m,[],_),P=this.paintVertexArray.length;this.paintVertexArray.resize(r),this._setPaintValue(P,r,x,S)}updatePaintArray(r,a,d,m){const _=this.expression.evaluate({zoom:this.zoom},d,m),x=this.expression.evaluate({zoom:this.zoom+1},d,m);this._setPaintValue(r,a,_,x)}_setPaintValue(r,a,d,m){if(this.type==="color"){const _=Fp(d),x=Fp(m);for(let S=r;S`#define HAS_UNIFORM_${m}`))}return r}getBinderAttributes(){const r=[];for(const a in this.binders){const d=this.binders[a];if(d instanceof bs||d instanceof Io)for(let m=0;m!0){this.programConfigurations={};for(const m of r)this.programConfigurations[m.id]=new r_(m,a,d);this.needsUpload=!1,this._featureMap=new Ys,this._bufferOffset=0}populatePaintArrays(r,a,d,m,_,x){for(const S in this.programConfigurations)this.programConfigurations[S].populatePaintArrays(r,a,m,_,x);a.id!==void 0&&this._featureMap.add(a.id,d,this._bufferOffset,r),this._bufferOffset=r,this.needsUpload=!0}updatePaintArrays(r,a,d,m){for(const _ of d)this.needsUpload=this.programConfigurations[_.id].updatePaintArrays(r,this._featureMap,a,_,m)||this.needsUpload}get(r){return this.programConfigurations[r]}upload(r){if(this.needsUpload){for(const a in this.programConfigurations)this.programConfigurations[a].upload(r);this.needsUpload=!1}}destroy(){for(const r in this.programConfigurations)this.programConfigurations[r].destroy()}}function G2(s,r){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[s]||[s.replace(`${r}-`,"").replace(/-/g,"_")]}function i_(s,r,a){const d={color:{source:re,composite:jt},number:{source:it,composite:re}},m=function(_){return{"line-pattern":{source:Li,composite:Li},"fill-pattern":{source:Li,composite:Li},"fill-extrusion-pattern":{source:Li,composite:Li}}[_]}(s);return m&&m[a]||d[r][a]}St("ConstantBinder",Ru),St("CrossFadedConstantBinder",Jl),St("SourceExpressionBinder",bs),St("CrossFadedCompositeBinder",Qs),St("CompositeExpressionBinder",Io),St("ProgramConfiguration",r_,{omit:["_buffers"]}),St("ProgramConfigurationSet",Ka);const mi=8192,Rp=Math.pow(2,14)-1,n_=-Rp-1;function Ya(s){const r=mi/s.extent,a=s.loadGeometry();for(let d=0;dx.x+1||Px.y+1)&&at("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return a}function Qa(s,r){return{type:s.type,id:s.id,properties:s.properties,geometry:r?Ya(s):[]}}function kf(s,r,a,d,m){s.emplaceBack(2*r+(d+1)/2,2*a+(m+1)/2)}class Bp{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(a=>a.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new Gl,this.indexArray=new Ii,this.segments=new wi,this.programConfigurations=new Ka(r.layers,r.zoom),this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){const m=this.layers[0],_=[];let x=null,S=!1;m.type==="circle"&&(x=m.layout.get("circle-sort-key"),S=!x.isConstant());for(const{feature:P,id:A,index:D,sourceLayerIndex:R}of r){const N=this.layers[0]._featureFilter.needGeometry,Z=Qa(P,N);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),Z,d))continue;const W=S?x.evaluate(Z,{},d):void 0,Q={id:A,properties:P.properties,type:P.type,sourceLayerIndex:R,index:D,geometry:N?Z.geometry:Ya(P),patterns:{},sortKey:W};_.push(Q)}S&&_.sort((P,A)=>P.sortKey-A.sortKey);for(const P of _){const{geometry:A,index:D,sourceLayerIndex:R}=P,N=r[D].feature;this.addFeature(P,A,D,d),a.featureIndex.insert(N,A,D,R,this.index)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,zu),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(r,a,d,m){for(const _ of a)for(const x of _){const S=x.x,P=x.y;if(S<0||S>=mi||P<0||P>=mi)continue;const A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,r.sortKey),D=A.vertexLength;kf(this.layoutVertexArray,S,P,-1,-1),kf(this.layoutVertexArray,S,P,1,-1),kf(this.layoutVertexArray,S,P,1,1),kf(this.layoutVertexArray,S,P,-1,1),this.indexArray.emplaceBack(D,D+1,D+2),this.indexArray.emplaceBack(D,D+3,D+2),A.vertexLength+=4,A.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,d,{},m)}}function o_(s,r){for(let a=0;a1){if(Op(s,r))return!0;for(let d=0;d1?a:a.sub(r)._mult(m)._add(r))}function l_(s,r){let a,d,m,_=!1;for(let x=0;xr.y!=m.y>r.y&&r.x<(m.x-d.x)*(r.y-d.y)/(m.y-d.y)+d.x&&(_=!_)}return _}function Kl(s,r){let a=!1;for(let d=0,m=s.length-1;dr.y!=x.y>r.y&&r.x<(x.x-_.x)*(r.y-_.y)/(x.y-_.y)+_.x&&(a=!a)}return a}function X2(s,r,a){const d=a[0],m=a[2];if(s.xm.x&&r.x>m.x||s.ym.y&&r.y>m.y)return!1;const _=mt(s,r,a[0]);return _!==mt(s,r,a[1])||_!==mt(s,r,a[2])||_!==mt(s,r,a[3])}function Bu(s,r,a){const d=r.paint.get(s).value;return d.kind==="constant"?d.value:a.programConfigurations.get(r.id).getMaxValue(s)}function Ef(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}function Pf(s,r,a,d,m){if(!r[0]&&!r[1])return s;const _=k.convert(r)._mult(m);a==="viewport"&&_._rotate(-d);const x=[];for(let S=0;Sf_(ie,Q))}(A,P),Z=R?D*S:D;for(const W of m)for(const Q of W){const ie=R?Q:f_(Q,P);let he=Z;const ke=Mf([],[Q.x,Q.y,0,1],P);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?he*=ke[3]/x.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(he*=x.cameraToCenterDistance/ke[3]),Z2(N,ie,he))return!0}return!1}}function f_(s,r){const a=Mf([],[s.x,s.y,0,1],r);return new k(a[0]/a[3],a[1]/a[3])}class d_ extends Bp{}let p_;St("HeatmapBucket",d_,{omit:["layers"]});var Q2={get paint(){return p_=p_||new p({"heatmap-radius":new Bt(Te.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Bt(Te.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new It(Te.paint_heatmap["heatmap-intensity"]),"heatmap-color":new h(Te.paint_heatmap["heatmap-color"]),"heatmap-opacity":new It(Te.paint_heatmap["heatmap-opacity"])})}};function jp(s,{width:r,height:a},d,m){if(m){if(m instanceof Uint8ClampedArray)m=new Uint8Array(m.buffer);else if(m.length!==r*a*d)throw new RangeError(`mismatched image size. expected: ${m.length} but got: ${r*a*d}`)}else m=new Uint8Array(r*a*d);return s.width=r,s.height=a,s.data=m,s}function m_(s,{width:r,height:a},d){if(r===s.width&&a===s.height)return;const m=jp({},{width:r,height:a},d);Vp(s,m,{x:0,y:0},{x:0,y:0},{width:Math.min(s.width,r),height:Math.min(s.height,a)},d),s.width=r,s.height=a,s.data=m.data}function Vp(s,r,a,d,m,_){if(m.width===0||m.height===0)return r;if(m.width>s.width||m.height>s.height||a.x>s.width-m.width||a.y>s.height-m.height)throw new RangeError("out of range source coordinates for image copy");if(m.width>r.width||m.height>r.height||d.x>r.width-m.width||d.y>r.height-m.height)throw new RangeError("out of range destination coordinates for image copy");const x=s.data,S=r.data;if(x===S)throw new Error("srcData equals dstData, so image is already copied");for(let P=0;P{r[s.evaluationKey]=P;const A=s.expression.evaluate(r);m.data[x+S+0]=Math.floor(255*A.r/A.a),m.data[x+S+1]=Math.floor(255*A.g/A.a),m.data[x+S+2]=Math.floor(255*A.b/A.a),m.data[x+S+3]=Math.floor(255*A.a)};if(s.clips)for(let x=0,S=0;x80*a){d=_=s[0],m=x=s[1];for(var W=a;W_&&(_=S),P>x&&(x=P);A=(A=Math.max(_-d,x-m))!==0?32767/A:0}return Nu(N,Z,a,d,m,A,0),Z}function __(s,r,a,d,m){var _,x;if(m===Zp(s,r,a,d)>0)for(_=r;_=r;_-=d)x=x_(_,s[_],s[_+1],x);return x&&Tf(x,x.next)&&(Vu(x),x=x.next),x}function el(s,r){if(!s)return s;r||(r=s);var a,d=s;do if(a=!1,d.steiner||!Tf(d,d.next)&&ui(d.prev,d,d.next)!==0)d=d.next;else{if(Vu(d),(d=r=d.prev)===d.next)break;a=!0}while(a||d!==r);return r}function Nu(s,r,a,d,m,_,x){if(s){!x&&_&&function(D,R,N,Z){var W=D;do W.z===0&&(W.z=qp(W.x,W.y,R,N,Z)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==D);W.prevZ.nextZ=null,W.prevZ=null,function(Q){var ie,he,ke,ge,we,Re,He,ht,zt=1;do{for(he=Q,Q=null,we=null,Re=0;he;){for(Re++,ke=he,He=0,ie=0;ie0||ht>0&&ke;)He!==0&&(ht===0||!ke||he.z<=ke.z)?(ge=he,he=he.nextZ,He--):(ge=ke,ke=ke.nextZ,ht--),we?we.nextZ=ge:Q=ge,ge.prevZ=we,we=ge;he=ke}we.nextZ=null,zt*=2}while(Re>1)}(W)}(s,d,m,_);for(var S,P,A=s;s.prev!==s.next;)if(S=s.prev,P=s.next,_?sS(s,d,m,_):oS(s))r.push(S.i/a|0),r.push(s.i/a|0),r.push(P.i/a|0),Vu(s),s=P.next,A=P.next;else if((s=P)===A){x?x===1?Nu(s=aS(el(s),r,a),r,a,d,m,_,2):x===2&&lS(s,r,a,d,m,_):Nu(el(s),r,a,d,m,_,1);break}}}function oS(s){var r=s.prev,a=s,d=s.next;if(ui(r,a,d)>=0)return!1;for(var m=r.x,_=a.x,x=d.x,S=r.y,P=a.y,A=d.y,D=m<_?m_?m>x?m:x:_>x?_:x,Z=S>P?S>A?S:A:P>A?P:A,W=d.next;W!==r;){if(W.x>=D&&W.x<=N&&W.y>=R&&W.y<=Z&&Ql(m,S,_,P,x,A,W.x,W.y)&&ui(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function sS(s,r,a,d){var m=s.prev,_=s,x=s.next;if(ui(m,_,x)>=0)return!1;for(var S=m.x,P=_.x,A=x.x,D=m.y,R=_.y,N=x.y,Z=SP?S>A?S:A:P>A?P:A,ie=D>R?D>N?D:N:R>N?R:N,he=qp(Z,W,r,a,d),ke=qp(Q,ie,r,a,d),ge=s.prevZ,we=s.nextZ;ge&&ge.z>=he&&we&&we.z<=ke;){if(ge.x>=Z&&ge.x<=Q&&ge.y>=W&&ge.y<=ie&&ge!==m&&ge!==x&&Ql(S,D,P,R,A,N,ge.x,ge.y)&&ui(ge.prev,ge,ge.next)>=0||(ge=ge.prevZ,we.x>=Z&&we.x<=Q&&we.y>=W&&we.y<=ie&&we!==m&&we!==x&&Ql(S,D,P,R,A,N,we.x,we.y)&&ui(we.prev,we,we.next)>=0))return!1;we=we.nextZ}for(;ge&&ge.z>=he;){if(ge.x>=Z&&ge.x<=Q&&ge.y>=W&&ge.y<=ie&&ge!==m&&ge!==x&&Ql(S,D,P,R,A,N,ge.x,ge.y)&&ui(ge.prev,ge,ge.next)>=0)return!1;ge=ge.prevZ}for(;we&&we.z<=ke;){if(we.x>=Z&&we.x<=Q&&we.y>=W&&we.y<=ie&&we!==m&&we!==x&&Ql(S,D,P,R,A,N,we.x,we.y)&&ui(we.prev,we,we.next)>=0)return!1;we=we.nextZ}return!0}function aS(s,r,a){var d=s;do{var m=d.prev,_=d.next.next;!Tf(m,_)&&v_(m,d,d.next,_)&&ju(m,_)&&ju(_,m)&&(r.push(m.i/a|0),r.push(d.i/a|0),r.push(_.i/a|0),Vu(d),Vu(d.next),d=s=_),d=d.next}while(d!==s);return el(d)}function lS(s,r,a,d,m,_){var x=s;do{for(var S=x.next.next;S!==x.prev;){if(x.i!==S.i&&dS(x,S)){var P=b_(x,S);return x=el(x,x.next),P=el(P,P.next),Nu(x,r,a,d,m,_,0),void Nu(P,r,a,d,m,_,0)}S=S.next}x=x.next}while(x!==s)}function cS(s,r){return s.x-r.x}function uS(s,r){var a=function(m,_){var x,S=_,P=m.x,A=m.y,D=-1/0;do{if(A<=S.y&&A>=S.next.y&&S.next.y!==S.y){var R=S.x+(A-S.y)*(S.next.x-S.x)/(S.next.y-S.y);if(R<=P&&R>D&&(D=R,x=S.x=S.x&&S.x>=W&&P!==S.x&&Ql(Ax.x||S.x===x.x&&hS(x,S)))&&(x=S,ie=N)),S=S.next;while(S!==Z);return x}(s,r);if(!a)return r;var d=b_(a,s);return el(d,d.next),el(a,a.next)}function hS(s,r){return ui(s.prev,s,r.prev)<0&&ui(r.next,s,s.next)<0}function qp(s,r,a,d,m){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-a)*m|0)|s<<8))|s<<4))|s<<2))|s<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-d)*m|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function fS(s){var r=s,a=s;do(r.x=(s-x)*(_-S)&&(s-x)*(d-S)>=(a-x)*(r-S)&&(a-x)*(_-S)>=(m-x)*(d-S)}function dS(s,r){return s.next.i!==r.i&&s.prev.i!==r.i&&!function(a,d){var m=a;do{if(m.i!==a.i&&m.next.i!==a.i&&m.i!==d.i&&m.next.i!==d.i&&v_(m,m.next,a,d))return!0;m=m.next}while(m!==a);return!1}(s,r)&&(ju(s,r)&&ju(r,s)&&function(a,d){var m=a,_=!1,x=(a.x+d.x)/2,S=(a.y+d.y)/2;do m.y>S!=m.next.y>S&&m.next.y!==m.y&&x<(m.next.x-m.x)*(S-m.y)/(m.next.y-m.y)+m.x&&(_=!_),m=m.next;while(m!==a);return _}(s,r)&&(ui(s.prev,s,r.prev)||ui(s,r.prev,r))||Tf(s,r)&&ui(s.prev,s,s.next)>0&&ui(r.prev,r,r.next)>0)}function ui(s,r,a){return(r.y-s.y)*(a.x-r.x)-(r.x-s.x)*(a.y-r.y)}function Tf(s,r){return s.x===r.x&&s.y===r.y}function v_(s,r,a,d){var m=Af(ui(s,r,a)),_=Af(ui(s,r,d)),x=Af(ui(a,d,s)),S=Af(ui(a,d,r));return m!==_&&x!==S||!(m!==0||!Cf(s,a,r))||!(_!==0||!Cf(s,d,r))||!(x!==0||!Cf(a,s,d))||!(S!==0||!Cf(a,r,d))}function Cf(s,r,a){return r.x<=Math.max(s.x,a.x)&&r.x>=Math.min(s.x,a.x)&&r.y<=Math.max(s.y,a.y)&&r.y>=Math.min(s.y,a.y)}function Af(s){return s>0?1:s<0?-1:0}function ju(s,r){return ui(s.prev,s,s.next)<0?ui(s,r,s.next)>=0&&ui(s,s.prev,r)>=0:ui(s,r,s.prev)<0||ui(s,s.next,r)<0}function b_(s,r){var a=new Gp(s.i,s.x,s.y),d=new Gp(r.i,r.x,r.y),m=s.next,_=r.prev;return s.next=r,r.prev=s,a.next=m,m.prev=a,d.next=a,a.prev=d,_.next=d,d.prev=_,d}function x_(s,r,a,d){var m=new Gp(s,r,a);return d?(m.next=d.next,m.prev=d,d.next.prev=m,d.next=m):(m.prev=m,m.next=m),m}function Vu(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Gp(s,r,a){this.i=s,this.x=r,this.y=a,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Zp(s,r,a,d){for(var m=0,_=r,x=a-d;_0&&a.holes.push(d+=s[m-1].length)}return a};var w_=y(Up.exports);function Hp(s,r,a){const d=a.patternDependencies;let m=!1;for(const _ of r){const x=_.paint.get(`${s}-pattern`);x.isConstant()||(m=!0);const S=x.constantOr(null);S&&(m=!0,d[S.to]=!0,d[S.from]=!0)}return m}function Wp(s,r,a,d,m){const _=m.patternDependencies;for(const x of r){const S=x.paint.get(`${s}-pattern`).value;if(S.kind!=="constant"){let P=S.evaluate({zoom:d-1},a,{},m.availableImages),A=S.evaluate({zoom:d},a,{},m.availableImages),D=S.evaluate({zoom:d+1},a,{},m.availableImages);P=P&&P.name?P.name:P,A=A&&A.name?A.name:A,D=D&&D.name?D.name:D,_[P]=!0,_[A]=!0,_[D]=!0,a.patterns[x.id]={min:P,mid:A,max:D}}}return a}class Xp{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(a=>a.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Xs,this.indexArray=new Ii,this.indexArray2=new Wr,this.programConfigurations=new Ka(r.layers,r.zoom),this.segments=new wi,this.segments2=new wi,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){this.hasPattern=Hp("fill",this.layers,a);const m=this.layers[0].layout.get("fill-sort-key"),_=!m.isConstant(),x=[];for(const{feature:S,id:P,index:A,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,N=Qa(S,R);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),N,d))continue;const Z=_?m.evaluate(N,{},d,a.availableImages):void 0,W={id:P,properties:S.properties,type:S.type,sourceLayerIndex:D,index:A,geometry:R?N.geometry:Ya(S),patterns:{},sortKey:Z};x.push(W)}_&&x.sort((S,P)=>S.sortKey-P.sortKey);for(const S of x){const{geometry:P,index:A,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Wp("fill",this.layers,S,this.zoom,a);this.patternFeatures.push(R)}else this.addFeature(S,P,A,d,{});a.featureIndex.insert(r[A].feature,P,A,D,this.index)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}addFeatures(r,a,d){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,a,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,nS),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.indexBuffer2=r.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(r,a,d,m,_){for(const x of Pl(a,500)){let S=0;for(const Z of x)S+=Z.length;const P=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray),A=P.vertexLength,D=[],R=[];for(const Z of x){if(Z.length===0)continue;Z!==x[0]&&R.push(D.length/2);const W=this.segments2.prepareSegment(Z.length,this.layoutVertexArray,this.indexArray2),Q=W.vertexLength;this.layoutVertexArray.emplaceBack(Z[0].x,Z[0].y),this.indexArray2.emplaceBack(Q+Z.length-1,Q),D.push(Z[0].x),D.push(Z[0].y);for(let ie=1;ie>3}if(m--,d===1||d===2)_+=s.readSVarint(),x+=s.readSVarint(),d===1&&(r&&S.push(r),r=[]),r.push(new vS(_,x));else{if(d!==7)throw new Error("unknown command "+d);r&&r.push(r[0].clone())}}return r&&S.push(r),S},ec.prototype.bbox=function(){var s=this._pbf;s.pos=this._geometry;for(var r=s.readVarint()+s.pos,a=1,d=0,m=0,_=0,x=1/0,S=-1/0,P=1/0,A=-1/0;s.pos>3}if(d--,a===1||a===2)(m+=s.readSVarint())S&&(S=m),(_+=s.readSVarint())A&&(A=_);else if(a!==7)throw new Error("unknown command "+a)}return[x,P,S,A]},ec.prototype.toGeoJSON=function(s,r,a){var d,m,_=this.extent*Math.pow(2,a),x=this.extent*s,S=this.extent*r,P=this.loadGeometry(),A=ec.types[this.type];function D(Z){for(var W=0;W>3;m=x===1?d.readString():x===2?d.readFloat():x===3?d.readDouble():x===4?d.readVarint64():x===5?d.readVarint():x===6?d.readSVarint():x===7?d.readBoolean():null}return m}(a))}M_.prototype.feature=function(s){if(s<0||s>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[s];var r=this._pbf.readVarint()+this._pbf.pos;return new wS(this._pbf,r,this.extent,this._keys,this._values)};var kS=P_;function ES(s,r,a){if(s===3){var d=new kS(a,a.readVarint()+a.pos);d.length&&(r[d.name]=d)}}ea.VectorTile=function(s,r){this.layers=s.readFields(ES,{},r)},ea.VectorTileFeature=E_,ea.VectorTileLayer=P_;const PS=ea.VectorTileFeature.types,Jp=Math.pow(2,13);function Uu(s,r,a,d,m,_,x,S){s.emplaceBack(r,a,2*Math.floor(d*Jp)+x,m*Jp*2,_*Jp*2,Math.round(S))}class Kp{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(a=>a.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new vs,this.centroidVertexArray=new _s,this.indexArray=new Ii,this.programConfigurations=new Ka(r.layers,r.zoom),this.segments=new wi,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){this.features=[],this.hasPattern=Hp("fill-extrusion",this.layers,a);for(const{feature:m,id:_,index:x,sourceLayerIndex:S}of r){const P=this.layers[0]._featureFilter.needGeometry,A=Qa(m,P);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),A,d))continue;const D={id:_,sourceLayerIndex:S,index:x,geometry:P?A.geometry:Ya(m),properties:m.properties,type:m.type,patterns:{}};this.hasPattern?this.features.push(Wp("fill-extrusion",this.layers,D,this.zoom,a)):this.addFeature(D,D.geometry,x,d,{}),a.featureIndex.insert(m,D.geometry,x,S,this.index,!0)}}addFeatures(r,a,d){for(const m of this.features){const{geometry:_}=m;this.addFeature(m,_,m.index,a,d)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,_S),this.centroidVertexBuffer=r.createVertexBuffer(this.centroidVertexArray,yS.members,!0),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(r,a,d,m,_){for(const x of Pl(a,500)){const S={x:0,y:0,vertexCount:0};let P=0;for(const W of x)P+=W.length;let A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const W of x){if(W.length===0||IS(W))continue;let Q=0;for(let ie=0;ie=1){const ke=W[ie-1];if(!MS(he,ke)){A.vertexLength+4>wi.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ge=he.sub(ke)._perp()._unit(),we=ke.dist(he);Q+we>32768&&(Q=0),Uu(this.layoutVertexArray,he.x,he.y,ge.x,ge.y,0,0,Q),Uu(this.layoutVertexArray,he.x,he.y,ge.x,ge.y,0,1,Q),S.x+=2*he.x,S.y+=2*he.y,S.vertexCount+=2,Q+=we,Uu(this.layoutVertexArray,ke.x,ke.y,ge.x,ge.y,0,0,Q),Uu(this.layoutVertexArray,ke.x,ke.y,ge.x,ge.y,0,1,Q),S.x+=2*ke.x,S.y+=2*ke.y,S.vertexCount+=2;const Re=A.vertexLength;this.indexArray.emplaceBack(Re,Re+2,Re+1),this.indexArray.emplaceBack(Re+1,Re+2,Re+3),A.vertexLength+=4,A.primitiveLength+=2}}}}if(A.vertexLength+P>wi.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(P,this.layoutVertexArray,this.indexArray)),PS[r.type]!=="Polygon")continue;const D=[],R=[],N=A.vertexLength;for(const W of x)if(W.length!==0){W!==x[0]&&R.push(D.length/2);for(let Q=0;Qmi)||s.y===r.y&&(s.y<0||s.y>mi)}function IS(s){return s.every(r=>r.x<0)||s.every(r=>r.x>mi)||s.every(r=>r.y<0)||s.every(r=>r.y>mi)}let I_;St("FillExtrusionBucket",Kp,{omit:["layers","features"]});var TS={get paint(){return I_=I_||new p({"fill-extrusion-opacity":new It(Te["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Bt(Te["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new It(Te["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new It(Te["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new v(Te["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Bt(Te["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Bt(Te["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new It(Te["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class CS extends b{constructor(r){super(r,TS)}createBucket(r){return new Kp(r)}queryRadius(){return Ef(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(r,a,d,m,_,x,S,P){const A=Pf(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,S),D=this.paint.get("fill-extrusion-height").evaluate(a,d),R=this.paint.get("fill-extrusion-base").evaluate(a,d),N=function(W,Q,ie,he){const ke=[];for(const ge of W){const we=[ge.x,ge.y,0,1];Mf(we,we,Q),ke.push(new k(we[0]/we[3],we[1]/we[3]))}return ke}(A,P),Z=function(W,Q,ie,he){const ke=[],ge=[],we=he[8]*Q,Re=he[9]*Q,He=he[10]*Q,ht=he[11]*Q,zt=he[8]*ie,dt=he[9]*ie,ut=he[10]*ie,Mt=he[11]*ie;for(const kt of W){const vt=[],Ne=[];for(const Tt of kt){const Pt=Tt.x,Vt=Tt.y,Tr=he[0]*Pt+he[4]*Vt+he[12],Mr=he[1]*Pt+he[5]*Vt+he[13],Ti=he[2]*Pt+he[6]*Vt+he[14],ho=he[3]*Pt+he[7]*Vt+he[15],Hi=Ti+He,oi=ho+ht,pn=Tr+zt,mn=Mr+dt,gn=Ti+ut,si=ho+Mt,Ci=new k((Tr+we)/oi,(Mr+Re)/oi);Ci.z=Hi/oi,vt.push(Ci);const tn=new k(pn/si,mn/si);tn.z=gn/si,Ne.push(tn)}ke.push(vt),ge.push(Ne)}return[ke,ge]}(m,R,D,P);return function(W,Q,ie){let he=1/0;s_(ie,Q)&&(he=T_(ie,Q[0]));for(let ke=0;kea.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(a=>{this.gradients[a.id]={}}),this.layoutVertexArray=new Zl,this.layoutVertexArray2=new Au,this.indexArray=new Ii,this.programConfigurations=new Ka(r.layers,r.zoom),this.segments=new wi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){this.hasPattern=Hp("line",this.layers,a);const m=this.layers[0].layout.get("line-sort-key"),_=!m.isConstant(),x=[];for(const{feature:S,id:P,index:A,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,N=Qa(S,R);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),N,d))continue;const Z=_?m.evaluate(N,{},d):void 0,W={id:P,properties:S.properties,type:S.type,sourceLayerIndex:D,index:A,geometry:R?N.geometry:Ya(S),patterns:{},sortKey:Z};x.push(W)}_&&x.sort((S,P)=>S.sortKey-P.sortKey);for(const S of x){const{geometry:P,index:A,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Wp("line",this.layers,S,this.zoom,a);this.patternFeatures.push(R)}else this.addFeature(S,P,A,d,{});a.featureIndex.insert(r[A].feature,P,A,D,this.index)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}addFeatures(r,a,d){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,a,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=r.createVertexBuffer(this.layoutVertexArray2,DS)),this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,zS),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(r){if(r.properties&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_end"))return{start:+r.properties.mapbox_clip_start,end:+r.properties.mapbox_clip_end}}addFeature(r,a,d,m,_){const x=this.layers[0].layout,S=x.get("line-join").evaluate(r,{}),P=x.get("line-cap"),A=x.get("line-miter-limit"),D=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(r);for(const R of a)this.addLine(R,r,S,P,A,D);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,d,_,m)}addLine(r,a,d,m,_,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let he=0;he=2&&r[P-1].equals(r[P-2]);)P--;let A=0;for(;A0;if(ht&&he>A){const Mt=N.dist(Z);if(Mt>2*D){const kt=N.sub(N.sub(Z)._mult(D/Mt)._round());this.updateDistance(Z,kt),this.addCurrentVertex(kt,Q,0,0,R),Z=kt}}const dt=Z&&W;let ut=dt?d:S?"butt":m;if(dt&&ut==="round"&&(Re_&&(ut="bevel"),ut==="bevel"&&(Re>2&&(ut="flipbevel"),Re<_&&(ut="miter")),Z&&this.updateDistance(Z,N),ut==="miter")ke._mult(Re),this.addCurrentVertex(N,ke,0,0,R);else if(ut==="flipbevel"){if(Re>100)ke=ie.mult(-1);else{const Mt=Re*Q.add(ie).mag()/Q.sub(ie).mag();ke._perp()._mult(Mt*(zt?-1:1))}this.addCurrentVertex(N,ke,0,0,R),this.addCurrentVertex(N,ke.mult(-1),0,0,R)}else if(ut==="bevel"||ut==="fakeround"){const Mt=-Math.sqrt(Re*Re-1),kt=zt?Mt:0,vt=zt?0:Mt;if(Z&&this.addCurrentVertex(N,Q,kt,vt,R),ut==="fakeround"){const Ne=Math.round(180*He/Math.PI/20);for(let Tt=1;Tt2*D){const kt=N.add(W.sub(N)._mult(D/Mt)._round());this.updateDistance(N,kt),this.addCurrentVertex(kt,ie,0,0,R),N=kt}}}}addCurrentVertex(r,a,d,m,_,x=!1){const S=a.y*m-a.x,P=-a.y-a.x*m;this.addHalfVertex(r,a.x+a.y*d,a.y-a.x*d,x,!1,d,_),this.addHalfVertex(r,S,P,x,!0,-m,_),this.distance>C_/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(r,a,d,m,_,x))}addHalfVertex({x:r,y:a},d,m,_,x,S,P){const A=.5*(this.lineClips?this.scaledDistance*(C_-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((r<<1)+(_?1:0),(a<<1)+(x?1:0),Math.round(63*d)+128,Math.round(63*m)+128,1+(S===0?0:S<0?-1:1)|(63&A)<<2,A>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const D=P.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),P.primitiveLength++),x?this.e2=D:this.e1=D}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(r,a){this.distance+=r.dist(a),this.updateScaledDistance()}}let A_,z_;St("LineBucket",Yp,{omit:["layers","patternFeatures"]});var L_={get paint(){return z_=z_||new p({"line-opacity":new Bt(Te.paint_line["line-opacity"]),"line-color":new Bt(Te.paint_line["line-color"]),"line-translate":new It(Te.paint_line["line-translate"]),"line-translate-anchor":new It(Te.paint_line["line-translate-anchor"]),"line-width":new Bt(Te.paint_line["line-width"]),"line-gap-width":new Bt(Te.paint_line["line-gap-width"]),"line-offset":new Bt(Te.paint_line["line-offset"]),"line-blur":new Bt(Te.paint_line["line-blur"]),"line-dasharray":new i(Te.paint_line["line-dasharray"]),"line-pattern":new v(Te.paint_line["line-pattern"]),"line-gradient":new h(Te.paint_line["line-gradient"])})},get layout(){return A_=A_||new p({"line-cap":new It(Te.layout_line["line-cap"]),"line-join":new Bt(Te.layout_line["line-join"]),"line-miter-limit":new It(Te.layout_line["line-miter-limit"]),"line-round-limit":new It(Te.layout_line["line-round-limit"]),"line-sort-key":new Bt(Te.layout_line["line-sort-key"])})}};class BS extends Bt{possiblyEvaluate(r,a){return a=new zr(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),super.possiblyEvaluate(r,a)}evaluate(r,a,d,m){return a=Ee({},a,{zoom:Math.floor(a.zoom)}),super.evaluate(r,a,d,m)}}let zf;class OS extends b{constructor(r){super(r,L_),this.gradientVersion=0,zf||(zf=new BS(L_.paint.properties["line-width"].specification),zf.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(r){if(r==="line-gradient"){const a=this.gradientExpression();this.stepInterpolant=!!function(d){return d._styleExpression!==void 0}(a)&&a._styleExpression.expression instanceof Os,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(r,a){super.recalculate(r,a),this.paint._values["line-floorwidth"]=zf.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)}createBucket(r){return new Yp(r)}queryRadius(r){const a=r,d=D_(Bu("line-width",this,a),Bu("line-gap-width",this,a)),m=Bu("line-offset",this,a);return d/2+Math.abs(m)+Ef(this.paint.get("line-translate"))}queryIntersectsFeature(r,a,d,m,_,x,S){const P=Pf(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),x.angle,S),A=S/2*D_(this.paint.get("line-width").evaluate(a,d),this.paint.get("line-gap-width").evaluate(a,d)),D=this.paint.get("line-offset").evaluate(a,d);return D&&(m=function(R,N){const Z=[];for(let W=0;W=3){for(let ie=0;ie0?r+2*s:s}const $S=L([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),NS=L([{name:"a_projected_pos",components:3,type:"Float32"}],4);L([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const jS=L([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);L([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const F_=L([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),VS=L([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function US(s,r,a){return s.sections.forEach(d=>{d.text=function(m,_,x){const S=_.layout.get("text-transform").evaluate(x,{});return S==="uppercase"?m=m.toLocaleUpperCase():S==="lowercase"&&(m=m.toLocaleLowerCase()),Go.applyArabicShaping&&(m=Go.applyArabicShaping(m)),m}(d.text,r,a)}),s}L([{name:"triangle",components:3,type:"Uint16"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),L([{type:"Float32",name:"offsetX"}]),L([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),L([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Gu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Si=24,R_=Pr,B_=function(s,r,a,d,m){var _,x,S=8*m-d-1,P=(1<>1,D=-7,R=a?m-1:0,N=a?-1:1,Z=s[r+R];for(R+=N,_=Z&(1<<-D)-1,Z>>=-D,D+=S;D>0;_=256*_+s[r+R],R+=N,D-=8);for(x=_&(1<<-D)-1,_>>=-D,D+=d;D>0;x=256*x+s[r+R],R+=N,D-=8);if(_===0)_=1-A;else{if(_===P)return x?NaN:1/0*(Z?-1:1);x+=Math.pow(2,d),_-=A}return(Z?-1:1)*x*Math.pow(2,_-d)},O_=function(s,r,a,d,m,_){var x,S,P,A=8*_-m-1,D=(1<>1,N=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,Z=d?0:_-1,W=d?1:-1,Q=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(S=isNaN(r)?1:0,x=D):(x=Math.floor(Math.log(r)/Math.LN2),r*(P=Math.pow(2,-x))<1&&(x--,P*=2),(r+=x+R>=1?N/P:N*Math.pow(2,1-R))*P>=2&&(x++,P/=2),x+R>=D?(S=0,x=D):x+R>=1?(S=(r*P-1)*Math.pow(2,m),x+=R):(S=r*Math.pow(2,R-1)*Math.pow(2,m),x=0));m>=8;s[a+Z]=255&S,Z+=W,S/=256,m-=8);for(x=x<0;s[a+Z]=255&x,Z+=W,x/=256,A-=8);s[a+Z-W]|=128*Q};function Pr(s){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(s)?s:new Uint8Array(s||0),this.pos=0,this.type=0,this.length=this.buf.length}Pr.Varint=0,Pr.Fixed64=1,Pr.Bytes=2,Pr.Fixed32=5;var Qp=4294967296,$_=1/Qp,N_=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function xs(s){return s.type===Pr.Bytes?s.readVarint()+s.pos:s.pos+1}function tc(s,r,a){return a?4294967296*r+(s>>>0):4294967296*(r>>>0)+(s>>>0)}function j_(s,r,a){var d=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(7*Math.LN2));a.realloc(d);for(var m=a.pos-1;m>=s;m--)a.buf[m+d]=a.buf[m]}function qS(s,r){for(var a=0;a>>8,s[a+2]=r>>>16,s[a+3]=r>>>24}function V_(s,r){return(s[r]|s[r+1]<<8|s[r+2]<<16)+(s[r+3]<<24)}Pr.prototype={destroy:function(){this.buf=null},readFields:function(s,r,a){for(a=a||this.length;this.pos>3,_=this.pos;this.type=7&d,s(m,r,this),this.pos===_&&this.skip(d)}return r},readMessage:function(s,r){return this.readFields(s,r,this.readVarint()+this.pos)},readFixed32:function(){var s=Lf(this.buf,this.pos);return this.pos+=4,s},readSFixed32:function(){var s=V_(this.buf,this.pos);return this.pos+=4,s},readFixed64:function(){var s=Lf(this.buf,this.pos)+Lf(this.buf,this.pos+4)*Qp;return this.pos+=8,s},readSFixed64:function(){var s=Lf(this.buf,this.pos)+V_(this.buf,this.pos+4)*Qp;return this.pos+=8,s},readFloat:function(){var s=B_(this.buf,this.pos,!0,23,4);return this.pos+=4,s},readDouble:function(){var s=B_(this.buf,this.pos,!0,52,8);return this.pos+=8,s},readVarint:function(s){var r,a,d=this.buf;return r=127&(a=d[this.pos++]),a<128?r:(r|=(127&(a=d[this.pos++]))<<7,a<128?r:(r|=(127&(a=d[this.pos++]))<<14,a<128?r:(r|=(127&(a=d[this.pos++]))<<21,a<128?r:function(m,_,x){var S,P,A=x.buf;if(S=(112&(P=A[x.pos++]))>>4,P<128||(S|=(127&(P=A[x.pos++]))<<3,P<128)||(S|=(127&(P=A[x.pos++]))<<10,P<128)||(S|=(127&(P=A[x.pos++]))<<17,P<128)||(S|=(127&(P=A[x.pos++]))<<24,P<128)||(S|=(1&(P=A[x.pos++]))<<31,P<128))return tc(m,S,_);throw new Error("Expected varint not more than 10 bytes")}(r|=(15&(a=d[this.pos]))<<28,s,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var s=this.readVarint();return s%2==1?(s+1)/-2:s/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var s=this.readVarint()+this.pos,r=this.pos;return this.pos=s,s-r>=12&&N_?function(a,d,m){return N_.decode(a.subarray(d,m))}(this.buf,r,s):function(a,d,m){for(var _="",x=d;x239?4:D>223?3:D>191?2:1;if(x+N>m)break;N===1?D<128&&(R=D):N===2?(192&(S=a[x+1]))==128&&(R=(31&D)<<6|63&S)<=127&&(R=null):N===3?(P=a[x+2],(192&(S=a[x+1]))==128&&(192&P)==128&&((R=(15&D)<<12|(63&S)<<6|63&P)<=2047||R>=55296&&R<=57343)&&(R=null)):N===4&&(P=a[x+2],A=a[x+3],(192&(S=a[x+1]))==128&&(192&P)==128&&(192&A)==128&&((R=(15&D)<<18|(63&S)<<12|(63&P)<<6|63&A)<=65535||R>=1114112)&&(R=null)),R===null?(R=65533,N=1):R>65535&&(R-=65536,_+=String.fromCharCode(R>>>10&1023|55296),R=56320|1023&R),_+=String.fromCharCode(R),x+=N}return _}(this.buf,r,s)},readBytes:function(){var s=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,s);return this.pos=s,r},readPackedVarint:function(s,r){if(this.type!==Pr.Bytes)return s.push(this.readVarint(r));var a=xs(this);for(s=s||[];this.pos127;);else if(r===Pr.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Pr.Fixed32)this.pos+=4;else{if(r!==Pr.Fixed64)throw new Error("Unimplemented type: "+r);this.pos+=8}},writeTag:function(s,r){this.writeVarint(s<<3|r)},realloc:function(s){for(var r=this.length||16;r268435455||s<0?function(r,a){var d,m;if(r>=0?(d=r%4294967296|0,m=r/4294967296|0):(m=~(-r/4294967296),4294967295^(d=~(-r%4294967296))?d=d+1|0:(d=0,m=m+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");a.realloc(10),function(_,x,S){S.buf[S.pos++]=127&_|128,_>>>=7,S.buf[S.pos++]=127&_|128,_>>>=7,S.buf[S.pos++]=127&_|128,_>>>=7,S.buf[S.pos++]=127&_|128,S.buf[S.pos]=127&(_>>>=7)}(d,0,a),function(_,x){var S=(7&_)<<4;x.buf[x.pos++]|=S|((_>>>=3)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_)))))}(m,a)}(s,this):(this.realloc(4),this.buf[this.pos++]=127&s|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=s>>>7&127))))},writeSVarint:function(s){this.writeVarint(s<0?2*-s-1:2*s)},writeBoolean:function(s){this.writeVarint(!!s)},writeString:function(s){s=String(s),this.realloc(4*s.length),this.pos++;var r=this.pos;this.pos=function(d,m,_){for(var x,S,P=0;P55295&&x<57344){if(!S){x>56319||P+1===m.length?(d[_++]=239,d[_++]=191,d[_++]=189):S=x;continue}if(x<56320){d[_++]=239,d[_++]=191,d[_++]=189,S=x;continue}x=S-55296<<10|x-56320|65536,S=null}else S&&(d[_++]=239,d[_++]=191,d[_++]=189,S=null);x<128?d[_++]=x:(x<2048?d[_++]=x>>6|192:(x<65536?d[_++]=x>>12|224:(d[_++]=x>>18|240,d[_++]=x>>12&63|128),d[_++]=x>>6&63|128),d[_++]=63&x|128)}return _}(this.buf,s,this.pos);var a=this.pos-r;a>=128&&j_(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeFloat:function(s){this.realloc(4),O_(this.buf,s,this.pos,!0,23,4),this.pos+=4},writeDouble:function(s){this.realloc(8),O_(this.buf,s,this.pos,!0,52,8),this.pos+=8},writeBytes:function(s){var r=s.length;this.writeVarint(r),this.realloc(r);for(var a=0;a=128&&j_(a,d,this),this.pos=a-1,this.writeVarint(d),this.pos+=d},writeMessage:function(s,r,a){this.writeTag(s,Pr.Bytes),this.writeRawMessage(r,a)},writePackedVarint:function(s,r){r.length&&this.writeMessage(s,qS,r)},writePackedSVarint:function(s,r){r.length&&this.writeMessage(s,GS,r)},writePackedBoolean:function(s,r){r.length&&this.writeMessage(s,WS,r)},writePackedFloat:function(s,r){r.length&&this.writeMessage(s,ZS,r)},writePackedDouble:function(s,r){r.length&&this.writeMessage(s,HS,r)},writePackedFixed32:function(s,r){r.length&&this.writeMessage(s,XS,r)},writePackedSFixed32:function(s,r){r.length&&this.writeMessage(s,JS,r)},writePackedFixed64:function(s,r){r.length&&this.writeMessage(s,KS,r)},writePackedSFixed64:function(s,r){r.length&&this.writeMessage(s,YS,r)},writeBytesField:function(s,r){this.writeTag(s,Pr.Bytes),this.writeBytes(r)},writeFixed32Field:function(s,r){this.writeTag(s,Pr.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(s,r){this.writeTag(s,Pr.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(s,r){this.writeTag(s,Pr.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(s,r){this.writeTag(s,Pr.Fixed64),this.writeSFixed64(r)},writeVarintField:function(s,r){this.writeTag(s,Pr.Varint),this.writeVarint(r)},writeSVarintField:function(s,r){this.writeTag(s,Pr.Varint),this.writeSVarint(r)},writeStringField:function(s,r){this.writeTag(s,Pr.Bytes),this.writeString(r)},writeFloatField:function(s,r){this.writeTag(s,Pr.Fixed32),this.writeFloat(r)},writeDoubleField:function(s,r){this.writeTag(s,Pr.Fixed64),this.writeDouble(r)},writeBooleanField:function(s,r){this.writeVarintField(s,!!r)}};var em=y(R_);const tm=3;function QS(s,r,a){s===1&&a.readMessage(ek,r)}function ek(s,r,a){if(s===3){const{id:d,bitmap:m,width:_,height:x,left:S,top:P,advance:A}=a.readMessage(tk,{});r.push({id:d,bitmap:new $u({width:_+2*tm,height:x+2*tm},m),metrics:{width:_,height:x,left:S,top:P,advance:A}})}}function tk(s,r,a){s===1?r.id=a.readVarint():s===2?r.bitmap=a.readBytes():s===3?r.width=a.readVarint():s===4?r.height=a.readVarint():s===5?r.left=a.readSVarint():s===6?r.top=a.readSVarint():s===7&&(r.advance=a.readVarint())}const U_=tm;function q_(s){let r=0,a=0;for(const x of s)r+=x.w*x.h,a=Math.max(a,x.w);s.sort((x,S)=>S.h-x.h);const d=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),a),h:1/0}];let m=0,_=0;for(const x of s)for(let S=d.length-1;S>=0;S--){const P=d[S];if(!(x.w>P.w||x.h>P.h)){if(x.x=P.x,x.y=P.y,_=Math.max(_,x.y+x.h),m=Math.max(m,x.x+x.w),x.w===P.w&&x.h===P.h){const A=d.pop();S=0&&d>=r&&Ff[this.text.charCodeAt(d)];d--)a--;this.text=this.text.substring(r,a),this.sectionIndex=this.sectionIndex.slice(r,a)}substring(r,a){const d=new ic;return d.text=this.text.substring(r,a),d.sectionIndex=this.sectionIndex.slice(r,a),d.sections=this.sections,d}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((r,a)=>Math.max(r,this.sections[a].scale),0)}addTextSection(r,a){this.text+=r.text,this.sections.push(Hu.forText(r.scale,r.fontStack||a));const d=this.sections.length-1;for(let m=0;m=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Df(s,r,a,d,m,_,x,S,P,A,D,R,N,Z,W){const Q=ic.fromFeature(s,m);let ie;R===f.ai.vertical&&Q.verticalizePunctuation();const{processBidirectionalText:he,processStyledBidirectionalText:ke}=Go;if(he&&Q.sections.length===1){ie=[];const Re=he(Q.toString(),im(Q,A,_,r,d,Z));for(const He of Re){const ht=new ic;ht.text=He,ht.sections=Q.sections;for(let zt=0;zt0&&ws>Xi&&(Xi=ws)}else{const Hn=ht[gr.fontStack],Di=Hn&&Hn[qr];if(Di&&Di.rect)ac=Di.rect,ii=Di.metrics;else{const ws=He[gr.fontStack],Yu=ws&&ws[qr];if(!Yu)continue;ii=Yu.metrics}Rn=(Ci-gr.scale)*Si}fo?(Re.verticalizable=!0,yn.push({glyph:qr,imageName:Xo,x:Vt,y:Tr+Rn,vertical:fo,scale:gr.scale,fontStack:gr.fontStack,sectionIndex:Lr,metrics:ii,rect:ac}),Vt+=Jo*gr.scale+Ne):(yn.push({glyph:qr,imageName:Xo,x:Vt,y:Tr+Rn,vertical:fo,scale:gr.scale,fontStack:gr.fontStack,sectionIndex:Lr,metrics:ii,rect:ac}),Vt+=ii.advance*gr.scale+Ne)}yn.length!==0&&(Mr=Math.max(Vt-Ne,Mr),ok(yn,0,yn.length-1,ho,Xi)),Vt=0;const Zn=ut*Ci+Xi;Wi.lineOffset=Math.max(Xi,tn),Tr+=Zn,Ti=Math.max(Zn,Ti),++Hi}var oi;const pn=Tr-Zu,{horizontalAlign:mn,verticalAlign:gn}=nm(Mt);(function(si,Ci,tn,Wi,yn,Xi,Zn,In,gr){const Lr=(Ci-tn)*yn;let qr=0;qr=Xi!==Zn?-In*Wi-Zu:(-Wi*gr+.5)*Zn;for(const Rn of si)for(const ii of Rn.positionedGlyphs)ii.x+=Lr,ii.y+=qr})(Re.positionedLines,ho,mn,gn,Mr,Ti,ut,pn,dt.length),Re.top+=-gn*pn,Re.bottom=Re.top+pn,Re.left+=-mn*Mr,Re.right=Re.left+Mr}(we,r,a,d,ie,x,S,P,R,A,N,W),!function(Re){for(const He of Re)if(He.positionedGlyphs.length!==0)return!1;return!0}(ge)&&we}const Ff={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},rk={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},ik={40:!0};function Z_(s,r,a,d,m,_){if(r.imageName){const x=d[r.imageName];return x?x.displaySize[0]*r.scale*Si/_+m:0}{const x=a[r.fontStack],S=x&&x[s];return S?S.metrics.advance*r.scale+m:0}}function H_(s,r,a,d){const m=Math.pow(s-r,2);return d?s=0;let A=0;for(let R=0;RA){const D=Math.ceil(_/A);m*=D/x,x=D}return{x1:d,y1:m,x2:d+_,y2:m+x}}function K_(s,r,a,d,m,_){const x=s.image;let S;if(x.content){const ie=x.content,he=x.pixelRatio||1;S=[ie[0]/he,ie[1]/he,x.displaySize[0]-ie[2]/he,x.displaySize[1]-ie[3]/he]}const P=r.left*_,A=r.right*_;let D,R,N,Z;a==="width"||a==="both"?(Z=m[0]+P-d[3],R=m[0]+A+d[1]):(Z=m[0]+(P+A-x.displaySize[0])/2,R=Z+x.displaySize[0]);const W=r.top*_,Q=r.bottom*_;return a==="height"||a==="both"?(D=m[1]+W-d[0],N=m[1]+Q+d[2]):(D=m[1]+(W+Q-x.displaySize[1])/2,N=D+x.displaySize[1]),{image:x,top:D,right:R,bottom:N,left:Z,collisionPadding:S}}const Wu=255,Wo=128,ra=Wu*Wo;function Y_(s,r){const{expression:a}=r;if(a.kind==="constant")return{kind:"constant",layoutSize:a.evaluate(new zr(s+1))};if(a.kind==="source")return{kind:"source"};{const{zoomStops:d,interpolationType:m}=a;let _=0;for(;_x.id),this.index=r.index,this.pixelRatio=r.pixelRatio,this.sourceLayerIndex=r.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Np([]),this.placementViewportMatrix=Np([]);const a=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Y_(this.zoom,a["text-size"]),this.iconSizeData=Y_(this.zoom,a["icon-size"]);const d=this.layers[0].layout,m=d.get("symbol-sort-key"),_=d.get("symbol-z-order");this.canOverlap=om(d,"text-overlap","text-allow-overlap")!=="never"||om(d,"icon-overlap","icon-allow-overlap")!=="never"||d.get("text-ignore-placement")||d.get("icon-ignore-placement"),this.sortFeaturesByKey=_!=="viewport-y"&&!m.isConstant(),this.sortFeaturesByY=(_==="viewport-y"||_==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,d.get("symbol-placement")==="point"&&(this.writingModes=d.get("text-writing-mode").map(x=>f.ai[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=r.sourceID}createArrays(){this.text=new am(new Ka(this.layers,this.zoom,r=>/^text/.test(r))),this.icon=new am(new Ka(this.layers,this.zoom,r=>/^icon/.test(r))),this.glyphOffsetArray=new Ur,this.lineVertexArray=new fn,this.symbolInstances=new jn,this.textAnchorOffsets=new Vi}calculateGlyphDependencies(r,a,d,m,_){for(let x=0;x0)&&(x.value.kind!=="constant"||x.value.value.length>0),D=P.value.kind!=="constant"||!!P.value.value||Object.keys(P.parameters).length>0,R=_.get("symbol-sort-key");if(this.features=[],!A&&!D)return;const N=a.iconDependencies,Z=a.glyphDependencies,W=a.availableImages,Q=new zr(this.zoom);for(const{feature:ie,id:he,index:ke,sourceLayerIndex:ge}of r){const we=m._featureFilter.needGeometry,Re=Qa(ie,we);if(!m._featureFilter.filter(Q,Re,d))continue;let He,ht;if(we||(Re.geometry=Ya(ie)),A){const dt=m.getValueAndResolveTokens("text-field",Re,d,W),ut=xn.factory(dt),Mt=this.hasRTLText=this.hasRTLText||ck(ut);(!Mt||Go.getRTLTextPluginStatus()==="unavailable"||Mt&&Go.isParsed())&&(He=US(ut,m,Re))}if(D){const dt=m.getValueAndResolveTokens("icon-image",Re,d,W);ht=dt instanceof Ni?dt:Ni.fromString(dt)}if(!He&&!ht)continue;const zt=this.sortFeaturesByKey?R.evaluate(Re,{},d):void 0;if(this.features.push({id:he,text:He,icon:ht,index:ke,sourceLayerIndex:ge,geometry:Re.geometry,properties:ie.properties,type:ak[ie.type],sortKey:zt}),ht&&(N[ht.name]=!0),He){const dt=x.evaluate(Re,{},d).join(","),ut=_.get("text-rotation-alignment")!=="viewport"&&_.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(f.ai.vertical)>=0;for(const Mt of He.sections)if(Mt.image)N[Mt.image.name]=!0;else{const kt=Mu(He.toString()),vt=Mt.fontStack||dt,Ne=Z[vt]=Z[vt]||{};this.calculateGlyphDependencies(Mt.text,Ne,ut,this.allowVerticalPlacement,kt)}}}_.get("symbol-placement")==="line"&&(this.features=function(ie){const he={},ke={},ge=[];let we=0;function Re(dt){ge.push(ie[dt]),we++}function He(dt,ut,Mt){const kt=ke[dt];return delete ke[dt],ke[ut]=kt,ge[kt].geometry[0].pop(),ge[kt].geometry[0]=ge[kt].geometry[0].concat(Mt[0]),kt}function ht(dt,ut,Mt){const kt=he[ut];return delete he[ut],he[dt]=kt,ge[kt].geometry[0].shift(),ge[kt].geometry[0]=Mt[0].concat(ge[kt].geometry[0]),kt}function zt(dt,ut,Mt){const kt=Mt?ut[0][ut[0].length-1]:ut[0][0];return`${dt}:${kt.x}:${kt.y}`}for(let dt=0;dtdt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ie,he)=>ie.sortKey-he.sortKey)}update(r,a,d){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(r,a,this.layers,d),this.icon.programConfigurations.updatePaintArrays(r,a,this.layers,d))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(r){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(r),this.iconCollisionBox.upload(r)),this.text.upload(r,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(r,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(r,a){const d=this.lineVertexArray.length;if(r.segment!==void 0){let m=r.dist(a[r.segment+1]),_=r.dist(a[r.segment]);const x={};for(let S=r.segment+1;S=0;S--)x[S]={x:a[S].x,y:a[S].y,tileUnitDistanceFromAnchor:_},S>0&&(_+=a[S-1].dist(a[S]));for(let S=0;S0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(r,a){const d=r.placedSymbolArray.get(a),m=d.vertexStartIndex+4*d.numGlyphs;for(let _=d.vertexStartIndex;_m[S]-m[P]||_[P]-_[S]),x}addToSortKeyRanges(r,a){const d=this.sortKeyRanges[this.sortKeyRanges.length-1];d&&d.sortKey===a?d.symbolInstanceEnd=r+1:this.sortKeyRanges.push({sortKey:a,symbolInstanceStart:r,symbolInstanceEnd:r+1})}sortFeatures(r){if(this.sortFeaturesByY&&this.sortedAngle!==r&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(r),this.sortedAngle=r,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const a of this.symbolInstanceIndexes){const d=this.symbolInstances.get(a);this.featureSortOrder.push(d.featureIndex),[d.rightJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.leftJustifiedTextSymbolIndex].forEach((m,_,x)=>{m>=0&&x.indexOf(m)===_&&this.addIndicesForPlacedSymbol(this.text,m)}),d.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,d.verticalPlacedTextSymbolIndex),d.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.placedIconSymbolIndex),d.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Q_,e0;St("SymbolBucket",nc,{omit:["layers","collisionBoxArray","features","compareText"]}),nc.MAX_GLYPHS=65535,nc.addDynamicAttributes=sm;var cm={get paint(){return e0=e0||new p({"icon-opacity":new Bt(Te.paint_symbol["icon-opacity"]),"icon-color":new Bt(Te.paint_symbol["icon-color"]),"icon-halo-color":new Bt(Te.paint_symbol["icon-halo-color"]),"icon-halo-width":new Bt(Te.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Bt(Te.paint_symbol["icon-halo-blur"]),"icon-translate":new It(Te.paint_symbol["icon-translate"]),"icon-translate-anchor":new It(Te.paint_symbol["icon-translate-anchor"]),"text-opacity":new Bt(Te.paint_symbol["text-opacity"]),"text-color":new Bt(Te.paint_symbol["text-color"],{runtimeType:un,getOverride:s=>s.textColor,hasOverride:s=>!!s.textColor}),"text-halo-color":new Bt(Te.paint_symbol["text-halo-color"]),"text-halo-width":new Bt(Te.paint_symbol["text-halo-width"]),"text-halo-blur":new Bt(Te.paint_symbol["text-halo-blur"]),"text-translate":new It(Te.paint_symbol["text-translate"]),"text-translate-anchor":new It(Te.paint_symbol["text-translate-anchor"])})},get layout(){return Q_=Q_||new p({"symbol-placement":new It(Te.layout_symbol["symbol-placement"]),"symbol-spacing":new It(Te.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new It(Te.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Bt(Te.layout_symbol["symbol-sort-key"]),"symbol-z-order":new It(Te.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new It(Te.layout_symbol["icon-allow-overlap"]),"icon-overlap":new It(Te.layout_symbol["icon-overlap"]),"icon-ignore-placement":new It(Te.layout_symbol["icon-ignore-placement"]),"icon-optional":new It(Te.layout_symbol["icon-optional"]),"icon-rotation-alignment":new It(Te.layout_symbol["icon-rotation-alignment"]),"icon-size":new Bt(Te.layout_symbol["icon-size"]),"icon-text-fit":new It(Te.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new It(Te.layout_symbol["icon-text-fit-padding"]),"icon-image":new Bt(Te.layout_symbol["icon-image"]),"icon-rotate":new Bt(Te.layout_symbol["icon-rotate"]),"icon-padding":new Bt(Te.layout_symbol["icon-padding"]),"icon-keep-upright":new It(Te.layout_symbol["icon-keep-upright"]),"icon-offset":new Bt(Te.layout_symbol["icon-offset"]),"icon-anchor":new Bt(Te.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new It(Te.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new It(Te.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new It(Te.layout_symbol["text-rotation-alignment"]),"text-field":new Bt(Te.layout_symbol["text-field"]),"text-font":new Bt(Te.layout_symbol["text-font"]),"text-size":new Bt(Te.layout_symbol["text-size"]),"text-max-width":new Bt(Te.layout_symbol["text-max-width"]),"text-line-height":new It(Te.layout_symbol["text-line-height"]),"text-letter-spacing":new Bt(Te.layout_symbol["text-letter-spacing"]),"text-justify":new Bt(Te.layout_symbol["text-justify"]),"text-radial-offset":new Bt(Te.layout_symbol["text-radial-offset"]),"text-variable-anchor":new It(Te.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Bt(Te.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Bt(Te.layout_symbol["text-anchor"]),"text-max-angle":new It(Te.layout_symbol["text-max-angle"]),"text-writing-mode":new It(Te.layout_symbol["text-writing-mode"]),"text-rotate":new Bt(Te.layout_symbol["text-rotate"]),"text-padding":new It(Te.layout_symbol["text-padding"]),"text-keep-upright":new It(Te.layout_symbol["text-keep-upright"]),"text-transform":new Bt(Te.layout_symbol["text-transform"]),"text-offset":new Bt(Te.layout_symbol["text-offset"]),"text-allow-overlap":new It(Te.layout_symbol["text-allow-overlap"]),"text-overlap":new It(Te.layout_symbol["text-overlap"]),"text-ignore-placement":new It(Te.layout_symbol["text-ignore-placement"]),"text-optional":new It(Te.layout_symbol["text-optional"])})}};class t0{constructor(r){if(r.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=r.property.overrides?r.property.overrides.runtimeType:Oo,this.defaultValue=r}evaluate(r){if(r.formattedSection){const a=this.defaultValue.property.overrides;if(a&&a.hasOverride(r.formattedSection))return a.getOverride(r.formattedSection)}return r.feature&&r.featureState?this.defaultValue.evaluate(r.feature,r.featureState):this.defaultValue.property.specification.default}eachChild(r){this.defaultValue.isConstant()||r(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}St("FormatSectionOverride",t0,{omit:["defaultValue"]});class Bf extends b{constructor(r){super(r,cm)}recalculate(r,a){if(super.recalculate(r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const d=this.layout.get("text-writing-mode");if(d){const m=[];for(const _ of d)m.indexOf(_)<0&&m.push(_);this.layout._values["text-writing-mode"]=m}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,a,d,m){const _=this.layout.get(r).evaluate(a,{},d,m),x=this._unevaluatedLayout._values[r];return x.isDataDriven()||ja(x.value)||!_?_:function(S,P){return P.replace(/{([^{}]+)}/g,(A,D)=>S&&D in S?String(S[D]):"")}(a.properties,_)}createBucket(r){return new nc(r)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const r of cm.paint.overridableProperties){if(!Bf.hasPaintOverride(this.layout,r))continue;const a=this.paint.get(r),d=new t0(a),m=new Bl(d,a.property.specification);let _=null;_=a.value.kind==="constant"||a.value.kind==="source"?new su("source",m):new au("composite",m,a.value.zoomStops),this.paint._values[r]=new uo(a.property,_,a.parameters)}}_handleOverridablePaintPropertyUpdate(r,a,d){return!(!this.layout||a.isDataDriven()||d.isDataDriven())&&Bf.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,a){const d=r.get("text-field"),m=cm.paint.properties[a];let _=!1;const x=S=>{for(const P of S)if(m.overrides&&m.overrides.hasOverride(P))return void(_=!0)};if(d.value.kind==="constant"&&d.value.value instanceof xn)x(d.value.value.sections);else if(d.value.kind==="source"){const S=A=>{_||(A instanceof ls&&pi(A.value)===So?x(A.value.sections):A instanceof kl?x(A.sections):A.eachChild(S))},P=d.value;P._styleExpression&&S(P._styleExpression.expression)}return _}}let r0;var uk={get paint(){return r0=r0||new p({"background-color":new It(Te.paint_background["background-color"]),"background-pattern":new i(Te.paint_background["background-pattern"]),"background-opacity":new It(Te.paint_background["background-opacity"])})}};class hk extends b{constructor(r){super(r,uk)}}let i0;var fk={get paint(){return i0=i0||new p({"raster-opacity":new It(Te.paint_raster["raster-opacity"]),"raster-hue-rotate":new It(Te.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new It(Te.paint_raster["raster-brightness-min"]),"raster-brightness-max":new It(Te.paint_raster["raster-brightness-max"]),"raster-saturation":new It(Te.paint_raster["raster-saturation"]),"raster-contrast":new It(Te.paint_raster["raster-contrast"]),"raster-resampling":new It(Te.paint_raster["raster-resampling"]),"raster-fade-duration":new It(Te.paint_raster["raster-fade-duration"])})}};class dk extends b{constructor(r){super(r,fk)}}class pk extends b{constructor(r){super(r,{}),this.onAdd=a=>{this.implementation.onAdd&&this.implementation.onAdd(a,a.painter.context.gl)},this.onRemove=a=>{this.implementation.onRemove&&this.implementation.onRemove(a,a.painter.context.gl)},this.implementation=r}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class mk{constructor(r){this._methodToThrottle=r,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const um=63710088e-1;class ia{constructor(r,a){if(isNaN(r)||isNaN(a))throw new Error(`Invalid LngLat object: (${r}, ${a})`);if(this.lng=+r,this.lat=+a,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ia(pe(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(r){const a=Math.PI/180,d=this.lat*a,m=r.lat*a,_=Math.sin(d)*Math.sin(m)+Math.cos(d)*Math.cos(m)*Math.cos((r.lng-this.lng)*a);return um*Math.acos(Math.min(_,1))}static convert(r){if(r instanceof ia)return r;if(Array.isArray(r)&&(r.length===2||r.length===3))return new ia(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&typeof r=="object"&&r!==null)return new ia(Number("lng"in r?r.lng:r.lon),Number(r.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const n0=2*Math.PI*um;function o0(s){return n0*Math.cos(s*Math.PI/180)}function s0(s){return(180+s)/360}function a0(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function l0(s,r){return s/o0(r)}function hm(s){return 360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90}class Of{constructor(r,a,d=0){this.x=+r,this.y=+a,this.z=+d}static fromLngLat(r,a=0){const d=ia.convert(r);return new Of(s0(d.lng),a0(d.lat),l0(a,d.lat))}toLngLat(){return new ia(360*this.x-180,hm(this.y))}toAltitude(){return this.z*o0(hm(this.y))}meterInMercatorCoordinateUnits(){return 1/n0*(r=hm(this.y),1/Math.cos(r*Math.PI/180));var r}}function c0(s,r,a){var d=2*Math.PI*6378137/256/Math.pow(2,a);return[s*d-2*Math.PI*6378137/2,r*d-2*Math.PI*6378137/2]}class fm{constructor(r,a,d){if(r<0||r>25||d<0||d>=Math.pow(2,r)||a<0||a>=Math.pow(2,r))throw new Error(`x=${a}, y=${d}, z=${r} outside of bounds. 0<=x<${Math.pow(2,r)}, 0<=y<${Math.pow(2,r)} 0<=z<=25 `);this.z=r,this.x=a,this.y=d,this.key=Xu(0,r,r,a,d)}equals(r){return this.z===r.z&&this.x===r.x&&this.y===r.y}url(r,a,d){const m=(x=this.y,S=this.z,P=c0(256*(_=this.x),256*(x=Math.pow(2,S)-x-1),S),A=c0(256*(_+1),256*(x+1),S),P[0]+","+P[1]+","+A[0]+","+A[1]);var _,x,S,P,A;const D=function(R,N,Z){let W,Q="";for(let ie=R;ie>0;ie--)W=1<1?"@2x":"").replace(/{quadkey}/g,D).replace(/{bbox-epsg-3857}/g,m)}isChildOf(r){const a=this.z-r.z;return a>0&&r.x===this.x>>a&&r.y===this.y>>a}getTilePoint(r){const a=Math.pow(2,this.z);return new k((r.x*a-this.x)*mi,(r.y*a-this.y)*mi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class u0{constructor(r,a){this.wrap=r,this.canonical=a,this.key=Xu(r,a.z,a.z,a.x,a.y)}}class Gn{constructor(r,a,d,m,_){if(r= z; overscaledZ = ${r}; z = ${d}`);this.overscaledZ=r,this.wrap=a,this.canonical=new fm(d,+m,+_),this.key=Xu(a,r,d,m,_)}clone(){return new Gn(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(r){return this.overscaledZ===r.overscaledZ&&this.wrap===r.wrap&&this.canonical.equals(r.canonical)}scaledTo(r){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-r;return r>this.canonical.z?new Gn(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gn(r,this.wrap,r,this.canonical.x>>a,this.canonical.y>>a)}calculateScaledKey(r,a){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const d=this.canonical.z-r;return r>this.canonical.z?Xu(this.wrap*+a,r,this.canonical.z,this.canonical.x,this.canonical.y):Xu(this.wrap*+a,r,r,this.canonical.x>>d,this.canonical.y>>d)}isChildOf(r){if(r.wrap!==this.wrap)return!1;const a=this.canonical.z-r.canonical.z;return r.overscaledZ===0||r.overscaledZ>a&&r.canonical.y===this.canonical.y>>a}children(r){if(this.overscaledZ>=r)return[new Gn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const a=this.canonical.z+1,d=2*this.canonical.x,m=2*this.canonical.y;return[new Gn(a,this.wrap,a,d,m),new Gn(a,this.wrap,a,d+1,m),new Gn(a,this.wrap,a,d,m+1),new Gn(a,this.wrap,a,d+1,m+1)]}isLessThan(r){return this.wrapr.wrap)&&(this.overscaledZr.overscaledZ)&&(this.canonical.xr.canonical.x)&&this.canonical.ythis.max&&(this.max=R),R=this.dim+1||a<-1||a>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(a+1)*this.stride+(r+1)}unpack(r,a,d){return r*this.redFactor+a*this.greenFactor+d*this.blueFactor-this.baseShift}getPixels(){return new qn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(r,a,d){if(this.dim!==r.dim)throw new Error("dem dimension mismatch");let m=a*this.dim,_=a*this.dim+this.dim,x=d*this.dim,S=d*this.dim+this.dim;switch(a){case-1:m=_-1;break;case 1:_=m+1}switch(d){case-1:x=S-1;break;case 1:S=x+1}const P=-a*this.dim,A=-d*this.dim;for(let D=x;D=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${r} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[r]}}class d0{constructor(r,a,d,m,_){this.type="Feature",this._vectorTileFeature=r,r._z=a,r._x=d,r._y=m,this.properties=r.properties,this.id=_}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(r){this._geometry=r}toJSON(){const r={geometry:this.geometry};for(const a in this)a!=="_geometry"&&a!=="_vectorTileFeature"&&(r[a]=this[a]);return r}}class p0{constructor(r,a){this.tileID=r,this.x=r.canonical.x,this.y=r.canonical.y,this.z=r.canonical.z,this.grid=new Zs(mi,16,0),this.grid3D=new Zs(mi,16,0),this.featureIndexArray=new Vn,this.promoteId=a}insert(r,a,d,m,_,x){const S=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(d,m,_);const P=x?this.grid3D:this.grid;for(let A=0;A=0&&R[3]>=0&&P.insert(S,R[0],R[1],R[2],R[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ea.VectorTile(new em(this.rawTileData)).layers,this.sourceLayerCoder=new f0(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(r,a,d,m){this.loadVTLayers();const _=r.params||{},x=mi/r.tileSize/r.scale,S=Qi(_.filter),P=r.queryGeometry,A=r.queryPadding*x,D=g0(P),R=this.grid.query(D.minX-A,D.minY-A,D.maxX+A,D.maxY+A),N=g0(r.cameraQueryGeometry),Z=this.grid3D.query(N.minX-A,N.minY-A,N.maxX+A,N.maxY+A,(ie,he,ke,ge)=>function(we,Re,He,ht,zt){for(const ut of we)if(Re<=ut.x&&He<=ut.y&&ht>=ut.x&&zt>=ut.y)return!0;const dt=[new k(Re,He),new k(Re,zt),new k(ht,zt),new k(ht,He)];if(we.length>2){for(const ut of dt)if(Kl(we,ut))return!0}for(let ut=0;ut(ge||(ge=Ya(we)),Re.queryIntersectsFeature(P,we,He,ge,this.z,r.transform,x,r.pixelPosMatrix)))}return W}loadMatchingFeature(r,a,d,m,_,x,S,P,A,D,R){const N=this.bucketLayerIDs[a];if(x&&!function(ie,he){for(let ke=0;ke=0)return!0;return!1}(x,N))return;const Z=this.sourceLayerCoder.decode(d),W=this.vtLayers[Z].feature(m);if(_.needGeometry){const ie=Qa(W,!0);if(!_.filter(new zr(this.tileID.overscaledZ),ie,this.tileID.canonical))return}else if(!_.filter(new zr(this.tileID.overscaledZ),W))return;const Q=this.getId(W,Z);for(let ie=0;ie{const S=r instanceof ql?r.get(x):null;return S&&S.evaluate?S.evaluate(a,d,m):S})}function g0(s){let r=1/0,a=1/0,d=-1/0,m=-1/0;for(const _ of s)r=Math.min(r,_.x),a=Math.min(a,_.y),d=Math.max(d,_.x),m=Math.max(m,_.y);return{minX:r,minY:a,maxX:d,maxY:m}}function gk(s,r){return r-s}function y0(s,r,a,d,m){const _=[];for(let x=0;x=d&&R.x>=d||(D.x>=d?D=new k(d,D.y+(d-D.x)/(R.x-D.x)*(R.y-D.y))._round():R.x>=d&&(R=new k(d,D.y+(d-D.x)/(R.x-D.x)*(R.y-D.y))._round()),D.y>=m&&R.y>=m||(D.y>=m?D=new k(D.x+(m-D.y)/(R.y-D.y)*(R.x-D.x),m)._round():R.y>=m&&(R=new k(D.x+(m-D.y)/(R.y-D.y)*(R.x-D.x),m)._round()),P&&D.equals(P[P.length-1])||(P=[D],_.push(P)),P.push(R)))))}}return _}St("FeatureIndex",p0,{omit:["rawTileData","sourceLayerCoder"]});class na extends k{constructor(r,a,d,m){super(r,a),this.angle=d,m!==void 0&&(this.segment=m)}clone(){return new na(this.x,this.y,this.angle,this.segment)}}function _0(s,r,a,d,m){if(r.segment===void 0||a===0)return!0;let _=r,x=r.segment+1,S=0;for(;S>-a/2;){if(x--,x<0)return!1;S-=s[x].dist(_),_=s[x]}S+=s[x].dist(s[x+1]),x++;const P=[];let A=0;for(;Sd;)A-=P.shift().angleDelta;if(A>m)return!1;x++,S+=D.dist(R)}return!0}function v0(s){let r=0;for(let a=0;aA){const W=(A-P)/Z,Q=kn.number(R.x,N.x,W),ie=kn.number(R.y,N.y,W),he=new na(Q,ie,N.angleTo(R),D);return he._round(),!x||_0(s,he,S,x,r)?he:void 0}P+=Z}}function _k(s,r,a,d,m,_,x,S,P){const A=b0(d,_,x),D=x0(d,m),R=D*x,N=s[0].x===0||s[0].x===P||s[0].y===0||s[0].y===P;return r-R=0&&we=0&&Re=0&&N+A<=D){const He=new na(we,Re,ke,W);He._round(),d&&!_0(s,He,_,d,m)||Z.push(He)}}R+=he}return S||Z.length||x||(Z=w0(s,R/2,a,d,m,_,x,!0,P)),Z}St("Anchor",na);const oc=Mn;function S0(s,r,a,d){const m=[],_=s.image,x=_.pixelRatio,S=_.paddedRect.w-2*oc,P=_.paddedRect.h-2*oc;let A={x1:s.left,y1:s.top,x2:s.right,y2:s.bottom};const D=_.stretchX||[[0,S]],R=_.stretchY||[[0,P]],N=(Ne,Tt)=>Ne+Tt[1]-Tt[0],Z=D.reduce(N,0),W=R.reduce(N,0),Q=S-Z,ie=P-W;let he=0,ke=Z,ge=0,we=W,Re=0,He=Q,ht=0,zt=ie;if(_.content&&d){const Ne=_.content,Tt=Ne[2]-Ne[0],Pt=Ne[3]-Ne[1];(_.textFitWidth||_.textFitHeight)&&(A=J_(s)),he=$f(D,0,Ne[0]),ge=$f(R,0,Ne[1]),ke=$f(D,Ne[0],Ne[2]),we=$f(R,Ne[1],Ne[3]),Re=Ne[0]-he,ht=Ne[1]-ge,He=Tt-ke,zt=Pt-we}const dt=A.x1,ut=A.y1,Mt=A.x2-dt,kt=A.y2-ut,vt=(Ne,Tt,Pt,Vt)=>{const Tr=Nf(Ne.stretch-he,ke,Mt,dt),Mr=jf(Ne.fixed-Re,He,Ne.stretch,Z),Ti=Nf(Tt.stretch-ge,we,kt,ut),ho=jf(Tt.fixed-ht,zt,Tt.stretch,W),Hi=Nf(Pt.stretch-he,ke,Mt,dt),oi=jf(Pt.fixed-Re,He,Pt.stretch,Z),pn=Nf(Vt.stretch-ge,we,kt,ut),mn=jf(Vt.fixed-ht,zt,Vt.stretch,W),gn=new k(Tr,Ti),si=new k(Hi,Ti),Ci=new k(Hi,pn),tn=new k(Tr,pn),Wi=new k(Mr/x,ho/x),yn=new k(oi/x,mn/x),Xi=r*Math.PI/180;if(Xi){const gr=Math.sin(Xi),Lr=Math.cos(Xi),qr=[Lr,-gr,gr,Lr];gn._matMult(qr),si._matMult(qr),tn._matMult(qr),Ci._matMult(qr)}const Zn=Ne.stretch+Ne.fixed,In=Tt.stretch+Tt.fixed;return{tl:gn,tr:si,bl:tn,br:Ci,tex:{x:_.paddedRect.x+oc+Zn,y:_.paddedRect.y+oc+In,w:Pt.stretch+Pt.fixed-Zn,h:Vt.stretch+Vt.fixed-In},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Wi,pixelOffsetBR:yn,minFontScaleX:He/x/Mt,minFontScaleY:zt/x/kt,isSDF:a}};if(d&&(_.stretchX||_.stretchY)){const Ne=k0(D,Q,Z),Tt=k0(R,ie,W);for(let Pt=0;Pt0&&(Q=Math.max(10,Q),this.circleDiameter=Q)}else{const N=!((R=x.image)===null||R===void 0)&&R.content&&(x.image.textFitWidth||x.image.textFitHeight)?J_(x):{x1:x.left,y1:x.top,x2:x.right,y2:x.bottom};N.y1=N.y1*S-P[0],N.y2=N.y2*S+P[2],N.x1=N.x1*S-P[3],N.x2=N.x2*S+P[1];const Z=x.collisionPadding;if(Z&&(N.x1-=Z[0]*S,N.y1-=Z[1]*S,N.x2+=Z[2]*S,N.y2+=Z[3]*S),D){const W=new k(N.x1,N.y1),Q=new k(N.x2,N.y1),ie=new k(N.x1,N.y2),he=new k(N.x2,N.y2),ke=D*Math.PI/180;W._rotate(ke),Q._rotate(ke),ie._rotate(ke),he._rotate(ke),N.x1=Math.min(W.x,Q.x,ie.x,he.x),N.x2=Math.max(W.x,Q.x,ie.x,he.x),N.y1=Math.min(W.y,Q.y,ie.y,he.y),N.y2=Math.max(W.y,Q.y,ie.y,he.y)}r.emplaceBack(a.x,a.y,N.x1,N.y1,N.x2,N.y2,d,m,_)}this.boxEndIndex=r.length}}class vk{constructor(r=[],a=bk){if(this.data=r,this.length=this.data.length,this.compare=a,this.length>0)for(let d=(this.length>>1)-1;d>=0;d--)this._down(d)}push(r){this.data.push(r),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const r=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:a,compare:d}=this,m=a[r];for(;r>0;){const _=r-1>>1,x=a[_];if(d(m,x)>=0)break;a[r]=x,r=_}a[r]=m}_down(r){const{data:a,compare:d}=this,m=this.length>>1,_=a[r];for(;r=0)break;a[r]=S,r=x}a[r]=_}}function bk(s,r){return sr?1:0}function xk(s,r=1,a=!1){let d=1/0,m=1/0,_=-1/0,x=-1/0;const S=s[0];for(let Z=0;Z_)&&(_=W.x),(!Z||W.y>x)&&(x=W.y)}const P=Math.min(_-d,x-m);let A=P/2;const D=new vk([],wk);if(P===0)return new k(d,m);for(let Z=d;Z<_;Z+=P)for(let W=m;WR.d||!R.d)&&(R=Z,a&&console.log("found best %d after %d probes",Math.round(1e4*Z.d)/1e4,N)),Z.max-R.d<=r||(A=Z.h/2,D.push(new sc(Z.p.x-A,Z.p.y-A,A,s)),D.push(new sc(Z.p.x+A,Z.p.y-A,A,s)),D.push(new sc(Z.p.x-A,Z.p.y+A,A,s)),D.push(new sc(Z.p.x+A,Z.p.y+A,A,s)),N+=4)}return a&&(console.log(`num probes: ${N}`),console.log(`best distance: ${R.d}`)),R.p}function wk(s,r){return r.max-s.max}function sc(s,r,a,d){this.p=new k(s,r),this.h=a,this.d=function(m,_){let x=!1,S=1/0;for(let P=0;P<_.length;P++){const A=_[P];for(let D=0,R=A.length,N=R-1;Dm.y!=W.y>m.y&&m.x<(W.x-Z.x)*(m.y-Z.y)/(W.y-Z.y)+Z.x&&(x=!x),S=Math.min(S,a_(m,Z,W))}}return(x?1:-1)*Math.sqrt(S)}(this.p,d),this.max=this.d+this.h*Math.SQRT2}var Zi;f.ar=void 0,(Zi=f.ar||(f.ar={}))[Zi.center=1]="center",Zi[Zi.left=2]="left",Zi[Zi.right=3]="right",Zi[Zi.top=4]="top",Zi[Zi.bottom=5]="bottom",Zi[Zi["top-left"]=6]="top-left",Zi[Zi["top-right"]=7]="top-right",Zi[Zi["bottom-left"]=8]="bottom-left",Zi[Zi["bottom-right"]=9]="bottom-right";const oa=7,dm=Number.POSITIVE_INFINITY;function E0(s,r){return r[1]!==dm?function(a,d,m){let _=0,x=0;switch(d=Math.abs(d),m=Math.abs(m),a){case"top-right":case"top-left":case"top":x=m-oa;break;case"bottom-right":case"bottom-left":case"bottom":x=-m+oa}switch(a){case"top-right":case"bottom-right":case"right":_=-d;break;case"top-left":case"bottom-left":case"left":_=d}return[_,x]}(s,r[0],r[1]):function(a,d){let m=0,_=0;d<0&&(d=0);const x=d/Math.SQRT2;switch(a){case"top-right":case"top-left":_=x-oa;break;case"bottom-right":case"bottom-left":_=-x+oa;break;case"bottom":_=-d+oa;break;case"top":_=d-oa}switch(a){case"top-right":case"bottom-right":m=-x;break;case"top-left":case"bottom-left":m=x;break;case"left":m=d;break;case"right":m=-d}return[m,_]}(s,r[0])}function P0(s,r,a){var d;const m=s.layout,_=(d=m.get("text-variable-anchor-offset"))===null||d===void 0?void 0:d.evaluate(r,{},a);if(_){const S=_.values,P=[];for(let A=0;AN*Si);D.startsWith("top")?R[1]-=oa:D.startsWith("bottom")&&(R[1]+=oa),P[A+1]=R}return new Sn(P)}const x=m.get("text-variable-anchor");if(x){let S;S=s._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[m.get("text-radial-offset").evaluate(r,{},a)*Si,dm]:m.get("text-offset").evaluate(r,{},a).map(A=>A*Si);const P=[];for(const A of x)P.push(A,E0(A,S));return new Sn(P)}return null}function pm(s){switch(s){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Sk(s,r,a,d,m,_,x,S,P,A,D){let R=_.textMaxSize.evaluate(r,{});R===void 0&&(R=x);const N=s.layers[0].layout,Z=N.get("icon-offset").evaluate(r,{},D),W=I0(a.horizontal),Q=x/24,ie=s.tilePixelRatio*Q,he=s.tilePixelRatio*R/24,ke=s.tilePixelRatio*S,ge=s.tilePixelRatio*N.get("symbol-spacing"),we=N.get("text-padding")*s.tilePixelRatio,Re=function(Ne,Tt,Pt,Vt=1){const Tr=Ne.get("icon-padding").evaluate(Tt,{},Pt),Mr=Tr&&Tr.values;return[Mr[0]*Vt,Mr[1]*Vt,Mr[2]*Vt,Mr[3]*Vt]}(N,r,D,s.tilePixelRatio),He=N.get("text-max-angle")/180*Math.PI,ht=N.get("text-rotation-alignment")!=="viewport"&&N.get("symbol-placement")!=="point",zt=N.get("icon-rotation-alignment")==="map"&&N.get("symbol-placement")!=="point",dt=N.get("symbol-placement"),ut=ge/2,Mt=N.get("icon-text-fit");let kt;d&&Mt!=="none"&&(s.allowVerticalPlacement&&a.vertical&&(kt=K_(d,a.vertical,Mt,N.get("icon-text-fit-padding"),Z,Q)),W&&(d=K_(d,W,Mt,N.get("icon-text-fit-padding"),Z,Q)));const vt=(Ne,Tt)=>{Tt.x<0||Tt.x>=mi||Tt.y<0||Tt.y>=mi||function(Pt,Vt,Tr,Mr,Ti,ho,Hi,oi,pn,mn,gn,si,Ci,tn,Wi,yn,Xi,Zn,In,gr,Lr,qr,Rn,ii,ac){const Xo=Pt.addToLineVertexArray(Vt,Tr);let Jo,fo,Hn,Di,ws=0,Yu=0,z0=0,L0=0,wm=-1,Sm=-1;const Ss={};let D0=Xl("");if(Pt.allowVerticalPlacement&&Mr.vertical){const rn=oi.layout.get("text-rotate").evaluate(Lr,{},ii)+90;Hn=new Vf(pn,Vt,mn,gn,si,Mr.vertical,Ci,tn,Wi,rn),Hi&&(Di=new Vf(pn,Vt,mn,gn,si,Hi,Xi,Zn,Wi,rn))}if(Ti){const rn=oi.layout.get("icon-rotate").evaluate(Lr,{}),Wn=oi.layout.get("icon-text-fit")!=="none",tl=S0(Ti,rn,Rn,Wn),Co=Hi?S0(Hi,rn,Rn,Wn):void 0;fo=new Vf(pn,Vt,mn,gn,si,Ti,Xi,Zn,!1,rn),ws=4*tl.length;const rl=Pt.iconSizeData;let Ko=null;rl.kind==="source"?(Ko=[Wo*oi.layout.get("icon-size").evaluate(Lr,{})],Ko[0]>ra&&at(`${Pt.layerIds[0]}: Value for "icon-size" is >= ${Wu}. Reduce your "icon-size".`)):rl.kind==="composite"&&(Ko=[Wo*qr.compositeIconSizes[0].evaluate(Lr,{},ii),Wo*qr.compositeIconSizes[1].evaluate(Lr,{},ii)],(Ko[0]>ra||Ko[1]>ra)&&at(`${Pt.layerIds[0]}: Value for "icon-size" is >= ${Wu}. Reduce your "icon-size".`)),Pt.addSymbols(Pt.icon,tl,Ko,gr,In,Lr,f.ai.none,Vt,Xo.lineStartIndex,Xo.lineLength,-1,ii),wm=Pt.icon.placedSymbolArray.length-1,Co&&(Yu=4*Co.length,Pt.addSymbols(Pt.icon,Co,Ko,gr,In,Lr,f.ai.vertical,Vt,Xo.lineStartIndex,Xo.lineLength,-1,ii),Sm=Pt.icon.placedSymbolArray.length-1)}const F0=Object.keys(Mr.horizontal);for(const rn of F0){const Wn=Mr.horizontal[rn];if(!Jo){D0=Xl(Wn.text);const Co=oi.layout.get("text-rotate").evaluate(Lr,{},ii);Jo=new Vf(pn,Vt,mn,gn,si,Wn,Ci,tn,Wi,Co)}const tl=Wn.positionedLines.length===1;if(z0+=M0(Pt,Vt,Wn,ho,oi,Wi,Lr,yn,Xo,Mr.vertical?f.ai.horizontal:f.ai.horizontalOnly,tl?F0:[rn],Ss,wm,qr,ii),tl)break}Mr.vertical&&(L0+=M0(Pt,Vt,Mr.vertical,ho,oi,Wi,Lr,yn,Xo,f.ai.vertical,["vertical"],Ss,Sm,qr,ii));const Pk=Jo?Jo.boxStartIndex:Pt.collisionBoxArray.length,Mk=Jo?Jo.boxEndIndex:Pt.collisionBoxArray.length,Ik=Hn?Hn.boxStartIndex:Pt.collisionBoxArray.length,Tk=Hn?Hn.boxEndIndex:Pt.collisionBoxArray.length,Ck=fo?fo.boxStartIndex:Pt.collisionBoxArray.length,Ak=fo?fo.boxEndIndex:Pt.collisionBoxArray.length,zk=Di?Di.boxStartIndex:Pt.collisionBoxArray.length,Lk=Di?Di.boxEndIndex:Pt.collisionBoxArray.length;let To=-1;const qf=(rn,Wn)=>rn&&rn.circleDiameter?Math.max(rn.circleDiameter,Wn):Wn;To=qf(Jo,To),To=qf(Hn,To),To=qf(fo,To),To=qf(Di,To);const R0=To>-1?1:0;R0&&(To*=ac/Si),Pt.glyphOffsetArray.length>=nc.MAX_GLYPHS&&at("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Lr.sortKey!==void 0&&Pt.addToSortKeyRanges(Pt.symbolInstances.length,Lr.sortKey);const Dk=P0(oi,Lr,ii),[Fk,Rk]=function(rn,Wn){const tl=rn.length,Co=Wn==null?void 0:Wn.values;if((Co==null?void 0:Co.length)>0)for(let rl=0;rl=0?Ss.right:-1,Ss.center>=0?Ss.center:-1,Ss.left>=0?Ss.left:-1,Ss.vertical||-1,wm,Sm,D0,Pk,Mk,Ik,Tk,Ck,Ak,zk,Lk,mn,z0,L0,ws,Yu,R0,0,Ci,To,Fk,Rk)}(s,Tt,Ne,a,d,m,kt,s.layers[0],s.collisionBoxArray,r.index,r.sourceLayerIndex,s.index,ie,[we,we,we,we],ht,P,ke,Re,zt,Z,r,_,A,D,x)};if(dt==="line")for(const Ne of y0(r.geometry,0,0,mi,mi)){const Tt=_k(Ne,ge,He,a.vertical||W,d,24,he,s.overscaling,mi);for(const Pt of Tt)W&&kk(s,W.text,ut,Pt)||vt(Ne,Pt)}else if(dt==="line-center"){for(const Ne of r.geometry)if(Ne.length>1){const Tt=yk(Ne,He,a.vertical||W,d,24,he);Tt&&vt(Ne,Tt)}}else if(r.type==="Polygon")for(const Ne of Pl(r.geometry,0)){const Tt=xk(Ne,16);vt(Ne[0],new na(Tt.x,Tt.y,0))}else if(r.type==="LineString")for(const Ne of r.geometry)vt(Ne,new na(Ne[0].x,Ne[0].y,0));else if(r.type==="Point")for(const Ne of r.geometry)for(const Tt of Ne)vt([Tt],new na(Tt.x,Tt.y,0))}function M0(s,r,a,d,m,_,x,S,P,A,D,R,N,Z,W){const Q=function(ke,ge,we,Re,He,ht,zt,dt){const ut=Re.layout.get("text-rotate").evaluate(ht,{})*Math.PI/180,Mt=[];for(const kt of ge.positionedLines)for(const vt of kt.positionedGlyphs){if(!vt.rect)continue;const Ne=vt.rect||{};let Tt=U_+1,Pt=!0,Vt=1,Tr=0;const Mr=(He||dt)&&vt.vertical,Ti=vt.metrics.advance*vt.scale/2;if(dt&&ge.verticalizable&&(Tr=kt.lineOffset/2-(vt.imageName?-(Si-vt.metrics.width*vt.scale)/2:(vt.scale-1)*Si)),vt.imageName){const gr=zt[vt.imageName];Pt=gr.sdf,Vt=gr.pixelRatio,Tt=Mn/Vt}const ho=He?[vt.x+Ti,vt.y]:[0,0];let Hi=He?[0,0]:[vt.x+Ti+we[0],vt.y+we[1]-Tr],oi=[0,0];Mr&&(oi=Hi,Hi=[0,0]);const pn=vt.metrics.isDoubleResolution?2:1,mn=(vt.metrics.left-Tt)*vt.scale-Ti+Hi[0],gn=(-vt.metrics.top-Tt)*vt.scale+Hi[1],si=mn+Ne.w/pn*vt.scale/Vt,Ci=gn+Ne.h/pn*vt.scale/Vt,tn=new k(mn,gn),Wi=new k(si,gn),yn=new k(mn,Ci),Xi=new k(si,Ci);if(Mr){const gr=new k(-Ti,Ti-Zu),Lr=-Math.PI/2,qr=Si/2-Ti,Rn=new k(5-Zu-qr,-(vt.imageName?qr:0)),ii=new k(...oi);tn._rotateAround(Lr,gr)._add(Rn)._add(ii),Wi._rotateAround(Lr,gr)._add(Rn)._add(ii),yn._rotateAround(Lr,gr)._add(Rn)._add(ii),Xi._rotateAround(Lr,gr)._add(Rn)._add(ii)}if(ut){const gr=Math.sin(ut),Lr=Math.cos(ut),qr=[Lr,-gr,gr,Lr];tn._matMult(qr),Wi._matMult(qr),yn._matMult(qr),Xi._matMult(qr)}const Zn=new k(0,0),In=new k(0,0);Mt.push({tl:tn,tr:Wi,bl:yn,br:Xi,tex:Ne,writingMode:ge.writingMode,glyphOffset:ho,sectionIndex:vt.sectionIndex,isSDF:Pt,pixelOffsetTL:Zn,pixelOffsetBR:In,minFontScaleX:0,minFontScaleY:0})}return Mt}(0,a,S,m,_,x,d,s.allowVerticalPlacement),ie=s.textSizeData;let he=null;ie.kind==="source"?(he=[Wo*m.layout.get("text-size").evaluate(x,{})],he[0]>ra&&at(`${s.layerIds[0]}: Value for "text-size" is >= ${Wu}. Reduce your "text-size".`)):ie.kind==="composite"&&(he=[Wo*Z.compositeTextSizes[0].evaluate(x,{},W),Wo*Z.compositeTextSizes[1].evaluate(x,{},W)],(he[0]>ra||he[1]>ra)&&at(`${s.layerIds[0]}: Value for "text-size" is >= ${Wu}. Reduce your "text-size".`)),s.addSymbols(s.text,Q,he,S,_,x,A,r,P.lineStartIndex,P.lineLength,N,W);for(const ke of D)R[ke]=s.text.placedSymbolArray.length-1;return 4*Q.length}function I0(s){for(const r in s)return s[r];return null}function kk(s,r,a,d){const m=s.compareText;if(r in m){const _=m[r];for(let x=_.length-1;x>=0;x--)if(d.dist(_[x])>4;if(m!==1)throw new Error(`Got v${m} data when expected v1.`);const _=T0[15&d];if(!_)throw new Error("Unrecognized array type.");const[x]=new Uint16Array(r,2,1),[S]=new Uint32Array(r,4,1);return new mm(S,x,_,r)}constructor(r,a=64,d=Float64Array,m){if(isNaN(r)||r<0)throw new Error(`Unpexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+a,2),65535),this.ArrayType=d,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;const _=T0.indexOf(this.ArrayType),x=2*r*this.ArrayType.BYTES_PER_ELEMENT,S=r*this.IndexArrayType.BYTES_PER_ELEMENT,P=(8-S%8)%8;if(_<0)throw new Error(`Unexpected typed array class: ${d}.`);m&&m instanceof ArrayBuffer?(this.data=m,this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+P,2*r),this._pos=2*r,this._finished=!0):(this.data=new ArrayBuffer(8+x+S+P),this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+P,2*r),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+_]),new Uint16Array(this.data,2,1)[0]=a,new Uint32Array(this.data,4,1)[0]=r)}add(r,a){const d=this._pos>>1;return this.ids[d]=d,this.coords[this._pos++]=r,this.coords[this._pos++]=a,d}finish(){const r=this._pos>>1;if(r!==this.numItems)throw new Error(`Added ${r} items when expected ${this.numItems}.`);return gm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,a,d,m){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:_,coords:x,nodeSize:S}=this,P=[0,_.length-1,0],A=[];for(;P.length;){const D=P.pop()||0,R=P.pop()||0,N=P.pop()||0;if(R-N<=S){for(let ie=N;ie<=R;ie++){const he=x[2*ie],ke=x[2*ie+1];he>=r&&he<=d&&ke>=a&&ke<=m&&A.push(_[ie])}continue}const Z=N+R>>1,W=x[2*Z],Q=x[2*Z+1];W>=r&&W<=d&&Q>=a&&Q<=m&&A.push(_[Z]),(D===0?r<=W:a<=Q)&&(P.push(N),P.push(Z-1),P.push(1-D)),(D===0?d>=W:m>=Q)&&(P.push(Z+1),P.push(R),P.push(1-D))}return A}within(r,a,d){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:_,nodeSize:x}=this,S=[0,m.length-1,0],P=[],A=d*d;for(;S.length;){const D=S.pop()||0,R=S.pop()||0,N=S.pop()||0;if(R-N<=x){for(let ie=N;ie<=R;ie++)A0(_[2*ie],_[2*ie+1],r,a)<=A&&P.push(m[ie]);continue}const Z=N+R>>1,W=_[2*Z],Q=_[2*Z+1];A0(W,Q,r,a)<=A&&P.push(m[Z]),(D===0?r-d<=W:a-d<=Q)&&(S.push(N),S.push(Z-1),S.push(1-D)),(D===0?r+d>=W:a+d>=Q)&&(S.push(Z+1),S.push(R),S.push(1-D))}return P}}function gm(s,r,a,d,m,_){if(m-d<=a)return;const x=d+m>>1;C0(s,r,x,d,m,_),gm(s,r,a,d,x-1,1-_),gm(s,r,a,x+1,m,1-_)}function C0(s,r,a,d,m,_){for(;m>d;){if(m-d>600){const A=m-d+1,D=a-d+1,R=Math.log(A),N=.5*Math.exp(2*R/3),Z=.5*Math.sqrt(R*N*(A-N)/A)*(D-A/2<0?-1:1);C0(s,r,a,Math.max(d,Math.floor(a-D*N/A+Z)),Math.min(m,Math.floor(a+(A-D)*N/A+Z)),_)}const x=r[2*a+_];let S=d,P=m;for(Ju(s,r,d,a),r[2*m+_]>x&&Ju(s,r,d,m);Sx;)P--}r[2*d+_]===x?Ju(s,r,d,P):(P++,Ju(s,r,P,m)),P<=a&&(d=P+1),a<=P&&(m=P-1)}}function Ju(s,r,a,d){ym(s,a,d),ym(r,2*a,2*d),ym(r,2*a+1,2*d+1)}function ym(s,r,a){const d=s[r];s[r]=s[a],s[a]=d}function A0(s,r,a,d){const m=s-a,_=r-d;return m*m+_*_}var _m;f.bf=void 0,(_m=f.bf||(f.bf={})).create="create",_m.load="load",_m.fullLoad="fullLoad";let Uf=null,Ku=[];const vm=1e3/60,bm="loadTime",xm="fullLoadTime",Ek={mark(s){performance.mark(s)},frame(s){const r=s;Uf!=null&&Ku.push(r-Uf),Uf=r},clearMetrics(){Uf=null,Ku=[],performance.clearMeasures(bm),performance.clearMeasures(xm);for(const s in f.bf)performance.clearMarks(f.bf[s])},getPerformanceMetrics(){performance.measure(bm,f.bf.create,f.bf.load),performance.measure(xm,f.bf.create,f.bf.fullLoad);const s=performance.getEntriesByName(bm)[0].duration,r=performance.getEntriesByName(xm)[0].duration,a=Ku.length,d=1/(Ku.reduce((_,x)=>_+x,0)/a/1e3),m=Ku.filter(_=>_>vm).reduce((_,x)=>_+(x-vm)/vm,0);return{loadTime:s,fullLoadTime:r,fps:d,percentDroppedFrames:m/(a+m)*100,totalFrames:a}}};f.$=class extends K{},f.A=Yl,f.B=ku,f.C=function(s){if(qt==null){const r=s.navigator?s.navigator.userAgent:null;qt=!!s.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return qt},f.D=It,f.E=nr,f.F=class{constructor(s,r){this.target=s,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new mk(()=>this.process()),this.subscription=function(a,d,m,_){return a.addEventListener(d,m,!1),{unsubscribe:()=>{a.removeEventListener(d,m,!1)}}}(this.target,"message",a=>this.receive(a)),this.globalScope=Ht(self)?s:window}registerMessageHandler(s,r){this.messageHandlers[s]=r}sendAsync(s,r){return new Promise((a,d)=>{const m=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[m]={resolve:a,reject:d},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[m];const S={id:m,type:"",origin:location.origin,targetMapId:s.targetMapId,sourceMapId:this.mapId};this.target.postMessage(S)},{once:!0});const _=[],x=Object.assign(Object.assign({},s),{id:m,sourceMapId:this.mapId,origin:location.origin,data:Wa(s.data,_)});this.target.postMessage(x,{transfer:_})})}receive(s){const r=s.data,a=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!==location.origin||r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type===""){delete this.tasks[a];const d=this.abortControllers[a];return delete this.abortControllers[a],void(d&&d.abort())}if(Ht(self)||r.mustQueue)return this.tasks[a]=r,this.taskQueue.push(a),void this.invoker.trigger();this.processTask(a,r)}}process(){if(this.taskQueue.length===0)return;const s=this.taskQueue.shift(),r=this.tasks[s];delete this.tasks[s],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(s,r)}processTask(s,r){return c(this,void 0,void 0,function*(){if(r.type===""){const m=this.resolveRejects[s];return delete this.resolveRejects[s],m?void(r.error?m.reject(co(r.error)):m.resolve(co(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(s,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const a=co(r.data),d=new AbortController;this.abortControllers[s]=d;try{const m=yield this.messageHandlers[r.type](r.sourceMapId,a,d);this.completeTask(s,null,m)}catch(m){this.completeTask(s,m)}})}completeTask(s,r,a){const d=[];delete this.abortControllers[s];const m={id:s,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?Wa(r):null,data:Wa(a,d)};this.target.postMessage(m,{transfer:d})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},f.G=tr,f.H=function(){var s=new Yl(16);return Yl!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s},f.I=rm,f.J=function(s,r,a){var d,m,_,x,S,P,A,D,R,N,Z,W,Q=a[0],ie=a[1],he=a[2];return r===s?(s[12]=r[0]*Q+r[4]*ie+r[8]*he+r[12],s[13]=r[1]*Q+r[5]*ie+r[9]*he+r[13],s[14]=r[2]*Q+r[6]*ie+r[10]*he+r[14],s[15]=r[3]*Q+r[7]*ie+r[11]*he+r[15]):(m=r[1],_=r[2],x=r[3],S=r[4],P=r[5],A=r[6],D=r[7],R=r[8],N=r[9],Z=r[10],W=r[11],s[0]=d=r[0],s[1]=m,s[2]=_,s[3]=x,s[4]=S,s[5]=P,s[6]=A,s[7]=D,s[8]=R,s[9]=N,s[10]=Z,s[11]=W,s[12]=d*Q+S*ie+R*he+r[12],s[13]=m*Q+P*ie+N*he+r[13],s[14]=_*Q+A*ie+Z*he+r[14],s[15]=x*Q+D*ie+W*he+r[15]),s},f.K=function(s,r,a){var d=a[0],m=a[1],_=a[2];return s[0]=r[0]*d,s[1]=r[1]*d,s[2]=r[2]*d,s[3]=r[3]*d,s[4]=r[4]*m,s[5]=r[5]*m,s[6]=r[6]*m,s[7]=r[7]*m,s[8]=r[8]*_,s[9]=r[9]*_,s[10]=r[10]*_,s[11]=r[11]*_,s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15],s},f.L=h_,f.M=function(s,r){const a={};for(let d=0;d{const r=window.document.createElement("video");return r.muted=!0,new Promise(a=>{r.onloadstart=()=>{a(r)};for(const d of s){const m=window.document.createElement("source");cr(d)||(r.crossOrigin="Anonymous"),m.src=d,r.appendChild(m)}})},f.a4=function(){return Pe++},f.a5=Qt,f.a6=nc,f.a7=Qi,f.a8=Qa,f.a9=zr,f.aA=function(s){s=s.slice();const r=Object.create(null);for(let a=0;a{"source"in x&&d[x.source]?a.push({command:"removeLayer",args:[x.id]}):_.push(x)}),a=a.concat(m),function(x,S,P){S=S||[];const A=(x=x||[]).map(Ea),D=S.map(Ea),R=x.reduce(Pa,{}),N=S.reduce(Pa,{}),Z=A.slice(),W=Object.create(null);let Q,ie,he,ke,ge;for(let we=0,Re=0;we@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(a,d,m,_)=>{const x=m||_;return r[d]=!x||x.toLowerCase(),""}),r["max-age"]){const a=parseInt(r["max-age"],10);isNaN(a)?delete r["max-age"]:r["max-age"]=a}return r},f.ac=function(s,r){const a=[];for(const d in s)d in r||a.push(d);return a},f.ad=X,f.ae=function(s,r,a){var d=Math.sin(a),m=Math.cos(a),_=r[0],x=r[1],S=r[2],P=r[3],A=r[4],D=r[5],R=r[6],N=r[7];return r!==s&&(s[8]=r[8],s[9]=r[9],s[10]=r[10],s[11]=r[11],s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15]),s[0]=_*m+A*d,s[1]=x*m+D*d,s[2]=S*m+R*d,s[3]=P*m+N*d,s[4]=A*m-_*d,s[5]=D*m-x*d,s[6]=R*m-S*d,s[7]=N*m-P*d,s},f.af=function(s){var r=new Yl(16);return r[0]=s[0],r[1]=s[1],r[2]=s[2],r[3]=s[3],r[4]=s[4],r[5]=s[5],r[6]=s[6],r[7]=s[7],r[8]=s[8],r[9]=s[9],r[10]=s[10],r[11]=s[11],r[12]=s[12],r[13]=s[13],r[14]=s[14],r[15]=s[15],r},f.ag=Mf,f.ah=function(s,r){let a=0,d=0;if(s.kind==="constant")d=s.layoutSize;else if(s.kind!=="source"){const{interpolationType:m,minZoom:_,maxZoom:x}=s,S=m?X(En.interpolationFactor(m,r,_,x),0,1):0;s.kind==="camera"?d=kn.number(s.minSize,s.maxSize,S):a=S}return{uSizeT:a,uSize:d}},f.aj=function(s,{uSize:r,uSizeT:a},{lowerSize:d,upperSize:m}){return s.kind==="source"?d/Wo:s.kind==="composite"?kn.number(d/Wo,m/Wo,a):r},f.ak=sm,f.al=function(s,r,a,d){const m=r.y-s.y,_=r.x-s.x,x=d.y-a.y,S=d.x-a.x,P=x*_-S*m;if(P===0)return null;const A=(S*(s.y-a.y)-x*(s.x-a.x))/P;return new k(s.x+A*_,s.y+A*m)},f.am=y0,f.an=o_,f.ao=Np,f.ap=function(s){let r=1/0,a=1/0,d=-1/0,m=-1/0;for(const _ of s)r=Math.min(r,_.x),a=Math.min(a,_.y),d=Math.max(d,_.x),m=Math.max(m,_.y);return[r,a,d,m]},f.aq=Si,f.as=om,f.at=function(s,r){var a=r[0],d=r[1],m=r[2],_=r[3],x=r[4],S=r[5],P=r[6],A=r[7],D=r[8],R=r[9],N=r[10],Z=r[11],W=r[12],Q=r[13],ie=r[14],he=r[15],ke=a*S-d*x,ge=a*P-m*x,we=a*A-_*x,Re=d*P-m*S,He=d*A-_*S,ht=m*A-_*P,zt=D*Q-R*W,dt=D*ie-N*W,ut=D*he-Z*W,Mt=R*ie-N*Q,kt=R*he-Z*Q,vt=N*he-Z*ie,Ne=ke*vt-ge*kt+we*Mt+Re*ut-He*dt+ht*zt;return Ne?(s[0]=(S*vt-P*kt+A*Mt)*(Ne=1/Ne),s[1]=(m*kt-d*vt-_*Mt)*Ne,s[2]=(Q*ht-ie*He+he*Re)*Ne,s[3]=(N*He-R*ht-Z*Re)*Ne,s[4]=(P*ut-x*vt-A*dt)*Ne,s[5]=(a*vt-m*ut+_*dt)*Ne,s[6]=(ie*we-W*ht-he*ge)*Ne,s[7]=(D*ht-N*we+Z*ge)*Ne,s[8]=(x*kt-S*ut+A*zt)*Ne,s[9]=(d*ut-a*kt-_*zt)*Ne,s[10]=(W*He-Q*we+he*ke)*Ne,s[11]=(R*we-D*He-Z*ke)*Ne,s[12]=(S*dt-x*Mt-P*zt)*Ne,s[13]=(a*Mt-d*dt+m*zt)*Ne,s[14]=(Q*ge-W*Re-ie*ke)*Ne,s[15]=(D*Re-R*ge+N*ke)*Ne,s):null},f.au=pm,f.av=nm,f.aw=mm,f.ax=function(){const s={},r=Te.$version;for(const a in Te.$root){const d=Te.$root[a];if(d.required){let m=null;m=a==="version"?r:d.type==="array"?[]:{},m!=null&&(s[a]=m)}}return s},f.ay=mf,f.az=rr,f.b=Ue,f.b0=function(s,r){return s[0]=r[0],s[1]=r[1],s[2]=r[2],s[3]=r[3],s[4]=r[4],s[5]=r[5],s[6]=r[6],s[7]=r[7],s[8]=r[8],s[9]=r[9],s[10]=r[10],s[11]=r[11],s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15],s},f.b1=function(s,r,a){return s[0]=r[0]*a[0],s[1]=r[1]*a[1],s[2]=r[2]*a[2],s[3]=r[3]*a[3],s},f.b2=function(s,r){return s[0]*r[0]+s[1]*r[1]+s[2]*r[2]+s[3]*r[3]},f.b3=pe,f.b4=u0,f.b5=l0,f.b6=function(s,r,a,d,m){var _,x=1/Math.tan(r/2);return s[0]=x/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=x,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=-1,s[12]=0,s[13]=0,s[15]=0,m!=null&&m!==1/0?(s[10]=(m+d)*(_=1/(d-m)),s[14]=2*m*d*_):(s[10]=-1,s[14]=-2*d),s},f.b7=function(s,r,a){var d=Math.sin(a),m=Math.cos(a),_=r[4],x=r[5],S=r[6],P=r[7],A=r[8],D=r[9],R=r[10],N=r[11];return r!==s&&(s[0]=r[0],s[1]=r[1],s[2]=r[2],s[3]=r[3],s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15]),s[4]=_*m+A*d,s[5]=x*m+D*d,s[6]=S*m+R*d,s[7]=P*m+N*d,s[8]=A*m-_*d,s[9]=D*m-x*d,s[10]=R*m-S*d,s[11]=N*m-P*d,s},f.b8=V,f.b9=me,f.bA=function(s){return s.message===Jt},f.bB=ms,f.bC=Go,f.ba=function(s){return s*Math.PI/180},f.bb=function(s,r){return s[0]=r[0],s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r[1],s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=r[2],s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s},f.bc=class extends H{},f.bd=um,f.be=Ek,f.bg=rt,f.bh=function(s,r){Ve.REGISTERED_PROTOCOLS[s]=r},f.bi=function(s){delete Ve.REGISTERED_PROTOCOLS[s]},f.bj=function(s,r){const a={};for(let m=0;mvt*Si)}let dt=x?"center":a.get("text-justify").evaluate(A,{},s.canonical);const ut=a.get("symbol-placement")==="point"?a.get("text-max-width").evaluate(A,{},s.canonical)*Si:1/0,Mt=()=>{s.bucket.allowVerticalPlacement&&Mu(we)&&(W.vertical=Df(Q,s.glyphMap,s.glyphPositions,s.imagePositions,D,ut,_,ht,"left",He,he,f.ai.vertical,!0,N,R))};if(!x&&zt){const kt=new Set;if(dt==="auto")for(let Ne=0;Nec(void 0,void 0,void 0,function*(){if(s.byteLength===0)return createImageBitmap(new ImageData(1,1));const r=new Blob([new Uint8Array(s)],{type:"image/png"});try{return createImageBitmap(r)}catch(a){throw new Error(`Could not load image because of ${a.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),f.e=Ee,f.f=s=>new Promise((r,a)=>{const d=new Image;d.onload=()=>{r(d),URL.revokeObjectURL(d.src),d.onload=null,window.requestAnimationFrame(()=>{d.src=Xe})},d.onerror=()=>a(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const m=new Blob([new Uint8Array(s)],{type:"image/png"});d.src=s.byteLength?URL.createObjectURL(m):Xe}),f.g=ct,f.h=(s,r)=>ni(Ee(s,{type:"json"}),r),f.i=Ht,f.j=Be,f.k=Se,f.l=(s,r)=>ni(Ee(s,{type:"arrayBuffer"}),r),f.m=ni,f.n=function(s){return new em(s).readFields(QS,[])},f.o=$u,f.p=q_,f.q=p,f.r=Cp,f.s=cr,f.t=Eu,f.u=pt,f.v=Te,f.w=at,f.x=Mo,f.y=function([s,r,a]){return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:s*Math.cos(r)*Math.sin(a),y:s*Math.sin(r)*Math.sin(a),z:s*Math.cos(a)}},f.z=kn}),l("worker",["./shared"],function(f){class c{constructor(q){this.keyCache={},q&&this.replace(q)}replace(q){this._layerConfigs={},this._layers={},this.update(q,[])}update(q,U){for(const oe of q){this._layerConfigs[oe.id]=oe;const _e=this._layers[oe.id]=f.aB(oe);_e._featureFilter=f.a7(_e.filter),this.keyCache[oe.id]&&delete this.keyCache[oe.id]}for(const oe of U)delete this.keyCache[oe],delete this._layerConfigs[oe],delete this._layers[oe];this.familiesBySource={};const Y=f.bj(Object.values(this._layerConfigs),this.keyCache);for(const oe of Y){const _e=oe.map(De=>this._layers[De.id]),be=_e[0];if(be.visibility==="none")continue;const Me=be.source||"";let de=this.familiesBySource[Me];de||(de=this.familiesBySource[Me]={});const Oe=be.sourceLayer||"_geojsonTileLayer";let Ze=de[Oe];Ze||(Ze=de[Oe]=[]),Ze.push(_e)}}}class y{constructor(q){const U={},Y=[];for(const Me in q){const de=q[Me],Oe=U[Me]={};for(const Ze in de){const De=de[+Ze];if(!De||De.bitmap.width===0||De.bitmap.height===0)continue;const ot={x:0,y:0,w:De.bitmap.width+2,h:De.bitmap.height+2};Y.push(ot),Oe[Ze]={rect:ot,metrics:De.metrics}}}const{w:oe,h:_e}=f.p(Y),be=new f.o({width:oe||1,height:_e||1});for(const Me in q){const de=q[Me];for(const Oe in de){const Ze=de[+Oe];if(!Ze||Ze.bitmap.width===0||Ze.bitmap.height===0)continue;const De=U[Me][Oe].rect;f.o.copy(Ze.bitmap,be,{x:0,y:0},{x:De.x+1,y:De.y+1},Ze.bitmap)}}this.image=be,this.positions=U}}f.bk("GlyphAtlas",y);class w{constructor(q){this.tileID=new f.S(q.tileID.overscaledZ,q.tileID.wrap,q.tileID.canonical.z,q.tileID.canonical.x,q.tileID.canonical.y),this.uid=q.uid,this.zoom=q.zoom,this.pixelRatio=q.pixelRatio,this.tileSize=q.tileSize,this.source=q.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=q.showCollisionBoxes,this.collectResourceTiming=!!q.collectResourceTiming,this.returnDependencies=!!q.returnDependencies,this.promoteId=q.promoteId,this.inFlightDependencies=[]}parse(q,U,Y,oe){return f._(this,void 0,void 0,function*(){this.status="parsing",this.data=q,this.collisionBoxArray=new f.a5;const _e=new f.bl(Object.keys(q.layers).sort()),be=new f.bm(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Me={},de={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Y},Oe=U.familiesBySource[this.source];for(const ir in Oe){const Sr=q.layers[ir];if(!Sr)continue;Sr.version===1&&f.w(`Vector tile source "${this.source}" layer "${ir}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Gr=_e.encode(ir),xi=[];for(let Oi=0;Oi=$i.maxzoom||$i.visibility!=="none"&&(M(Oi,this.zoom,Y),(Me[$i.id]=$i.createBucket({index:be.bucketLayerIDs.length,layers:Oi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Gr,sourceID:this.source})).populate(xi,de,this.tileID.canonical),be.bucketLayerIDs.push(Oi.map(Ma=>Ma.id)))}}const Ze=f.aG(de.glyphDependencies,ir=>Object.keys(ir).map(Number));this.inFlightDependencies.forEach(ir=>ir==null?void 0:ir.abort()),this.inFlightDependencies=[];let De=Promise.resolve({});if(Object.keys(Ze).length){const ir=new AbortController;this.inFlightDependencies.push(ir),De=oe.sendAsync({type:"GG",data:{stacks:Ze,source:this.source,tileID:this.tileID,type:"glyphs"}},ir)}const ot=Object.keys(de.iconDependencies);let Ct=Promise.resolve({});if(ot.length){const ir=new AbortController;this.inFlightDependencies.push(ir),Ct=oe.sendAsync({type:"GI",data:{icons:ot,source:this.source,tileID:this.tileID,type:"icons"}},ir)}const Rt=Object.keys(de.patternDependencies);let Kt=Promise.resolve({});if(Rt.length){const ir=new AbortController;this.inFlightDependencies.push(ir),Kt=oe.sendAsync({type:"GI",data:{icons:Rt,source:this.source,tileID:this.tileID,type:"patterns"}},ir)}const[pr,Xt,Cr]=yield Promise.all([De,Ct,Kt]),ri=new y(pr),di=new f.bn(Xt,Cr);for(const ir in Me){const Sr=Me[ir];Sr instanceof f.a6?(M(Sr.layers,this.zoom,Y),f.bo({bucket:Sr,glyphMap:pr,glyphPositions:ri.positions,imageMap:Xt,imagePositions:di.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Sr.hasPattern&&(Sr instanceof f.bp||Sr instanceof f.bq||Sr instanceof f.br)&&(M(Sr.layers,this.zoom,Y),Sr.addFeatures(de,this.tileID.canonical,di.patternPositions))}return this.status="done",{buckets:Object.values(Me).filter(ir=>!ir.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ri.image,imageAtlas:di,glyphMap:this.returnDependencies?pr:null,iconMap:this.returnDependencies?Xt:null,glyphPositions:this.returnDependencies?ri.positions:null}})}}function M(le,q,U){const Y=new f.a9(q);for(const oe of le)oe.recalculate(Y,U)}class k{constructor(q,U,Y){this.actor=q,this.layerIndex=U,this.availableImages=Y,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(q,U){return f._(this,void 0,void 0,function*(){const Y=yield f.l(q.request,U);try{return{vectorTile:new f.bs.VectorTile(new f.bt(Y.data)),rawData:Y.data,cacheControl:Y.cacheControl,expires:Y.expires}}catch(oe){const _e=new Uint8Array(Y.data);let be=`Unable to parse the tile at ${q.request.url}, `;throw be+=_e[0]===31&&_e[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${oe.message}`,new Error(be)}})}loadTile(q){return f._(this,void 0,void 0,function*(){const U=q.uid,Y=!!(q&&q.request&&q.request.collectResourceTiming)&&new f.bu(q.request),oe=new w(q);this.loading[U]=oe;const _e=new AbortController;oe.abort=_e;try{const be=yield this.loadVectorTile(q,_e);if(delete this.loading[U],!be)return null;const Me=be.rawData,de={};be.expires&&(de.expires=be.expires),be.cacheControl&&(de.cacheControl=be.cacheControl);const Oe={};if(Y){const De=Y.finish();De&&(Oe.resourceTiming=JSON.parse(JSON.stringify(De)))}oe.vectorTile=be.vectorTile;const Ze=oe.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[U]=oe,this.fetching[U]={rawTileData:Me,cacheControl:de,resourceTiming:Oe};try{const De=yield Ze;return f.e({rawTileData:Me.slice(0)},De,de,Oe)}finally{delete this.fetching[U]}}catch(be){throw delete this.loading[U],oe.status="done",this.loaded[U]=oe,be}})}reloadTile(q){return f._(this,void 0,void 0,function*(){const U=q.uid;if(!this.loaded||!this.loaded[U])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Y=this.loaded[U];if(Y.showCollisionBoxes=q.showCollisionBoxes,Y.status==="parsing"){const oe=yield Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor);let _e;if(this.fetching[U]){const{rawTileData:be,cacheControl:Me,resourceTiming:de}=this.fetching[U];delete this.fetching[U],_e=f.e({rawTileData:be.slice(0)},oe,Me,de)}else _e=oe;return _e}if(Y.status==="done"&&Y.vectorTile)return Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(q){return f._(this,void 0,void 0,function*(){const U=this.loading,Y=q.uid;U&&U[Y]&&U[Y].abort&&(U[Y].abort.abort(),delete U[Y])})}removeTile(q){return f._(this,void 0,void 0,function*(){this.loaded&&this.loaded[q.uid]&&delete this.loaded[q.uid]})}}class T{constructor(){this.loaded={}}loadTile(q){return f._(this,void 0,void 0,function*(){const{uid:U,encoding:Y,rawImageData:oe,redFactor:_e,greenFactor:be,blueFactor:Me,baseShift:de}=q,Oe=oe.width+2,Ze=oe.height+2,De=f.b(oe)?new f.R({width:Oe,height:Ze},yield f.bv(oe,-1,-1,Oe,Ze)):oe,ot=new f.bw(U,De,Y,_e,be,Me,de);return this.loaded=this.loaded||{},this.loaded[U]=ot,ot})}removeTile(q){const U=this.loaded,Y=q.uid;U&&U[Y]&&delete U[Y]}}function z(le,q){if(le.length!==0){F(le[0],q);for(var U=1;U=Math.abs(Me)?U-de+Me:Me-de+U,U=de}U+Y>=0!=!!q&&le.reverse()}var B=f.bx(function le(q,U){var Y,oe=q&&q.type;if(oe==="FeatureCollection")for(Y=0;Y>31}function Ht(le,q){for(var U=le.loadGeometry(),Y=le.type,oe=0,_e=0,be=U.length,Me=0;Mele},Zt=Math.fround||(Gt=new Float32Array(1),le=>(Gt[0]=+le,Gt[0]));var Gt;const or=3,Jt=5,wr=6;class Ve{constructor(q){this.options=Object.assign(Object.create(Xe),q),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(q){const{log:U,minZoom:Y,maxZoom:oe}=this.options;U&&console.time("total time");const _e=`prepare ${q.length} points`;U&&console.time(_e),this.points=q;const be=[];for(let de=0;de=Y;de--){const Oe=+Date.now();Me=this.trees[de]=this._createTree(this._cluster(Me,de)),U&&console.log("z%d: %d clusters in %dms",de,Me.numItems,+Date.now()-Oe)}return U&&console.timeEnd("total time"),this}getClusters(q,U){let Y=((q[0]+180)%360+360)%360-180;const oe=Math.max(-90,Math.min(90,q[1]));let _e=q[2]===180?180:((q[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,q[3]));if(q[2]-q[0]>=360)Y=-180,_e=180;else if(Y>_e){const De=this.getClusters([Y,oe,180,be],U),ot=this.getClusters([-180,oe,_e,be],U);return De.concat(ot)}const Me=this.trees[this._limitZoom(U)],de=Me.range(rt(Y),rr(be),rt(_e),rr(oe)),Oe=Me.data,Ze=[];for(const De of de){const ot=this.stride*De;Ze.push(Oe[ot+Jt]>1?ct(Oe,ot,this.clusterProps):this.points[Oe[ot+or]])}return Ze}getChildren(q){const U=this._getOriginId(q),Y=this._getOriginZoom(q),oe="No cluster with the specified id.",_e=this.trees[Y];if(!_e)throw new Error(oe);const be=_e.data;if(U*this.stride>=be.length)throw new Error(oe);const Me=this.options.radius/(this.options.extent*Math.pow(2,Y-1)),de=_e.within(be[U*this.stride],be[U*this.stride+1],Me),Oe=[];for(const Ze of de){const De=Ze*this.stride;be[De+4]===q&&Oe.push(be[De+Jt]>1?ct(be,De,this.clusterProps):this.points[be[De+or]])}if(Oe.length===0)throw new Error(oe);return Oe}getLeaves(q,U,Y){const oe=[];return this._appendLeaves(oe,q,U=U||10,Y=Y||0,0),oe}getTile(q,U,Y){const oe=this.trees[this._limitZoom(q)],_e=Math.pow(2,q),{extent:be,radius:Me}=this.options,de=Me/be,Oe=(Y-de)/_e,Ze=(Y+1+de)/_e,De={features:[]};return this._addTileFeatures(oe.range((U-de)/_e,Oe,(U+1+de)/_e,Ze),oe.data,U,Y,_e,De),U===0&&this._addTileFeatures(oe.range(1-de/_e,Oe,1,Ze),oe.data,_e,Y,_e,De),U===_e-1&&this._addTileFeatures(oe.range(0,Oe,de/_e,Ze),oe.data,-1,Y,_e,De),De.features.length?De:null}getClusterExpansionZoom(q){let U=this._getOriginZoom(q)-1;for(;U<=this.options.maxZoom;){const Y=this.getChildren(q);if(U++,Y.length!==1)break;q=Y[0].properties.cluster_id}return U}_appendLeaves(q,U,Y,oe,_e){const be=this.getChildren(U);for(const Me of be){const de=Me.properties;if(de&&de.cluster?_e+de.point_count<=oe?_e+=de.point_count:_e=this._appendLeaves(q,de.cluster_id,Y,oe,_e):_e1;let Ze,De,ot;if(Oe)Ze=tr(U,de,this.clusterProps),De=U[de],ot=U[de+1];else{const Kt=this.points[U[de+or]];Ze=Kt.properties;const[pr,Xt]=Kt.geometry.coordinates;De=rt(pr),ot=rr(Xt)}const Ct={type:1,geometry:[[Math.round(this.options.extent*(De*_e-Y)),Math.round(this.options.extent*(ot*_e-oe))]],tags:Ze};let Rt;Rt=Oe||this.options.generateId?U[de+or]:this.points[U[de+or]].id,Rt!==void 0&&(Ct.id=Rt),be.features.push(Ct)}}_limitZoom(q){return Math.max(this.options.minZoom,Math.min(Math.floor(+q),this.options.maxZoom+1))}_cluster(q,U){const{radius:Y,extent:oe,reduce:_e,minPoints:be}=this.options,Me=Y/(oe*Math.pow(2,U)),de=q.data,Oe=[],Ze=this.stride;for(let De=0;DeU&&(pr+=de[Cr+Jt])}if(pr>Kt&&pr>=be){let Xt,Cr=ot*Kt,ri=Ct*Kt,di=-1;const ir=((De/Ze|0)<<5)+(U+1)+this.points.length;for(const Sr of Rt){const Gr=Sr*Ze;if(de[Gr+2]<=U)continue;de[Gr+2]=U;const xi=de[Gr+Jt];Cr+=de[Gr]*xi,ri+=de[Gr+1]*xi,de[Gr+4]=ir,_e&&(Xt||(Xt=this._map(de,De,!0),di=this.clusterProps.length,this.clusterProps.push(Xt)),_e(Xt,this._map(de,Gr)))}de[De+4]=ir,Oe.push(Cr/pr,ri/pr,1/0,ir,-1,pr),_e&&Oe.push(di)}else{for(let Xt=0;Xt1)for(const Xt of Rt){const Cr=Xt*Ze;if(!(de[Cr+2]<=U)){de[Cr+2]=U;for(let ri=0;ri>5}_getOriginZoom(q){return(q-this.points.length)%32}_map(q,U,Y){if(q[U+Jt]>1){const be=this.clusterProps[q[U+wr]];return Y?Object.assign({},be):be}const oe=this.points[q[U+or]].properties,_e=this.options.map(oe);return Y&&_e===oe?Object.assign({},_e):_e}}function ct(le,q,U){return{type:"Feature",id:le[q+or],properties:tr(le,q,U),geometry:{type:"Point",coordinates:[(Y=le[q],360*(Y-.5)),ni(le[q+1])]}};var Y}function tr(le,q,U){const Y=le[q+Jt],oe=Y>=1e4?`${Math.round(Y/1e3)}k`:Y>=1e3?Math.round(Y/100)/10+"k":Y,_e=le[q+wr],be=_e===-1?{}:Object.assign({},U[_e]);return Object.assign(be,{cluster:!0,cluster_id:le[q+or],point_count:Y,point_count_abbreviated:oe})}function rt(le){return le/360+.5}function rr(le){const q=Math.sin(le*Math.PI/180),U=.5-.25*Math.log((1+q)/(1-q))/Math.PI;return U<0?0:U>1?1:U}function ni(le){const q=(180-360*le)*Math.PI/180;return 360*Math.atan(Math.exp(q))/Math.PI-90}function cr(le,q,U,Y){let oe=Y;const _e=q+(U-q>>1);let be,Me=U-q;const de=le[q],Oe=le[q+1],Ze=le[U],De=le[U+1];for(let ot=q+3;otoe)be=ot,oe=Ct;else if(Ct===oe){const Rt=Math.abs(ot-_e);RtY&&(be-q>3&&cr(le,q,be,Y),le[be+2]=oe,U-be>3&&cr(le,be,U,Y))}function li(le,q,U,Y,oe,_e){let be=oe-U,Me=_e-Y;if(be!==0||Me!==0){const de=((le-U)*be+(q-Y)*Me)/(be*be+Me*Me);de>1?(U=oe,Y=_e):de>0&&(U+=be*de,Y+=Me*de)}return be=le-U,Me=q-Y,be*be+Me*Me}function Bi(le,q,U,Y){const oe={id:le??null,type:q,geometry:U,tags:Y,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(q==="Point"||q==="MultiPoint"||q==="LineString")Se(oe,U);else if(q==="Polygon")Se(oe,U[0]);else if(q==="MultiLineString")for(const _e of U)Se(oe,_e);else if(q==="MultiPolygon")for(const _e of U)Se(oe,_e[0]);return oe}function Se(le,q){for(let U=0;U0&&(be+=Y?(oe*Ze-Oe*_e)/2:Math.sqrt(Math.pow(Oe-oe,2)+Math.pow(Ze-_e,2))),oe=Oe,_e=Ze}const Me=q.length-3;q[2]=1,cr(q,0,Me,U),q[Me+2]=1,q.size=Math.abs(be),q.start=0,q.end=q.size}function Mi(le,q,U,Y){for(let oe=0;oe1?1:U}function ti(le,q,U,Y,oe,_e,be,Me){if(Y/=q,_e>=(U/=q)&&be=Y)return null;const de=[];for(const Oe of le){const Ze=Oe.geometry;let De=Oe.type;const ot=oe===0?Oe.minX:Oe.minY,Ct=oe===0?Oe.maxX:Oe.maxY;if(ot>=U&&Ct=Y)continue;let Rt=[];if(De==="Point"||De==="MultiPoint")ka(Ze,Rt,U,Y,oe);else if(De==="LineString")Bo(Ze,Rt,U,Y,oe,!1,Me.lineMetrics);else if(De==="MultiLineString")Bs(Ze,Rt,U,Y,oe,!1);else if(De==="Polygon")Bs(Ze,Rt,U,Y,oe,!0);else if(De==="MultiPolygon")for(const Kt of Ze){const pr=[];Bs(Kt,pr,U,Y,oe,!0),pr.length&&Rt.push(pr)}if(Rt.length){if(Me.lineMetrics&&De==="LineString"){for(const Kt of Rt)de.push(Bi(Oe.id,De,Kt,Oe.tags));continue}De!=="LineString"&&De!=="MultiLineString"||(Rt.length===1?(De="LineString",Rt=Rt[0]):De="MultiLineString"),De!=="Point"&&De!=="MultiPoint"||(De=Rt.length===3?"Point":"MultiPoint"),de.push(Bi(Oe.id,De,Rt,Oe.tags))}}return de.length?de:null}function ka(le,q,U,Y,oe){for(let _e=0;_e=U&&be<=Y&&Ln(q,le[_e],le[_e+1],le[_e+2])}}function Bo(le,q,U,Y,oe,_e,be){let Me=wo(le);const de=oe===0?Ea:Pa;let Oe,Ze,De=le.start;for(let pr=0;prU&&(Ze=de(Me,Xt,Cr,di,ir,U),be&&(Me.start=De+Oe*Ze)):Sr>Y?Gr=U&&(Ze=de(Me,Xt,Cr,di,ir,U),xi=!0),Gr>Y&&Sr<=Y&&(Ze=de(Me,Xt,Cr,di,ir,Y),xi=!0),!_e&&xi&&(be&&(Me.end=De+Oe*Ze),q.push(Me),Me=wo(le)),be&&(De+=Oe)}let ot=le.length-3;const Ct=le[ot],Rt=le[ot+1],Kt=oe===0?Ct:Rt;Kt>=U&&Kt<=Y&&Ln(Me,Ct,Rt,le[ot+2]),ot=Me.length-3,_e&&ot>=3&&(Me[ot]!==Me[0]||Me[ot+1]!==Me[1])&&Ln(Me,Me[0],Me[1],Me[2]),Me.length&&q.push(Me)}function wo(le){const q=[];return q.size=le.size,q.start=le.start,q.end=le.end,q}function Bs(le,q,U,Y,oe,_e){for(const be of le)Bo(be,q,U,Y,oe,_e,!1)}function Ln(le,q,U,Y){le.push(q,U,Y)}function Ea(le,q,U,Y,oe,_e){const be=(_e-q)/(Y-q);return Ln(le,_e,U+(oe-U)*be,1),be}function Pa(le,q,U,Y,oe,_e){const be=(_e-U)/(oe-U);return Ln(le,q+(Y-q)*be,_e,1),be}function nt(le,q){const U=[];for(let Y=0;Y0&&q.size<(oe?be:Y))return void(U.numPoints+=q.length/3);const Me=[];for(let de=0;debe)&&(U.numSimplified++,Me.push(q[de],q[de+1])),U.numPoints++;oe&&function(de,Oe){let Ze=0;for(let De=0,ot=de.length,Ct=ot-2;De0===Oe)for(let De=0,ot=de.length;De24)throw new Error("maxZoom should be in the 0-24 range");if(U.promoteId&&U.generateId)throw new Error("promoteId and generateId cannot be used together.");let oe=function(_e,be){const Me=[];if(_e.type==="FeatureCollection")for(let de=0;de<_e.features.length;de++)Be(Me,_e.features[de],be,de);else Be(Me,_e.type==="Feature"?_e:{geometry:_e},be);return Me}(q,U);this.tiles={},this.tileCoords=[],Y&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",U.indexMaxZoom,U.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),oe=function(_e,be){const Me=be.buffer/be.extent;let de=_e;const Oe=ti(_e,1,-1-Me,Me,0,-1,2,be),Ze=ti(_e,1,1-Me,2+Me,0,-1,2,be);return(Oe||Ze)&&(de=ti(_e,1,-Me,1+Me,0,-1,2,be)||[],Oe&&(de=nt(Oe,1).concat(de)),Ze&&(de=de.concat(nt(Ze,-1)))),de}(oe,U),oe.length&&this.splitTile(oe,0,0,0),Y&&(oe.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(q,U,Y,oe,_e,be,Me){const de=[q,U,Y,oe],Oe=this.options,Ze=Oe.debug;for(;de.length;){oe=de.pop(),Y=de.pop(),U=de.pop(),q=de.pop();const De=1<1&&console.time("creation"),Ct=this.tiles[ot]=Oo(q,U,Y,oe,Oe),this.tileCoords.push({z:U,x:Y,y:oe}),Ze)){Ze>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",U,Y,oe,Ct.numFeatures,Ct.numPoints,Ct.numSimplified),console.timeEnd("creation"));const xi=`z${U}`;this.stats[xi]=(this.stats[xi]||0)+1,this.total++}if(Ct.source=q,_e==null){if(U===Oe.indexMaxZoom||Ct.numPoints<=Oe.indexMaxPoints)continue}else{if(U===Oe.maxZoom||U===_e)continue;if(_e!=null){const xi=_e-U;if(Y!==be>>xi||oe!==Me>>xi)continue}}if(Ct.source=null,q.length===0)continue;Ze>1&&console.time("clipping");const Rt=.5*Oe.buffer/Oe.extent,Kt=.5-Rt,pr=.5+Rt,Xt=1+Rt;let Cr=null,ri=null,di=null,ir=null,Sr=ti(q,De,Y-Rt,Y+pr,0,Ct.minX,Ct.maxX,Oe),Gr=ti(q,De,Y+Kt,Y+Xt,0,Ct.minX,Ct.maxX,Oe);q=null,Sr&&(Cr=ti(Sr,De,oe-Rt,oe+pr,1,Ct.minY,Ct.maxY,Oe),ri=ti(Sr,De,oe+Kt,oe+Xt,1,Ct.minY,Ct.maxY,Oe),Sr=null),Gr&&(di=ti(Gr,De,oe-Rt,oe+pr,1,Ct.minY,Ct.maxY,Oe),ir=ti(Gr,De,oe+Kt,oe+Xt,1,Ct.minY,Ct.maxY,Oe),Gr=null),Ze>1&&console.timeEnd("clipping"),de.push(Cr||[],U+1,2*Y,2*oe),de.push(ri||[],U+1,2*Y,2*oe+1),de.push(di||[],U+1,2*Y+1,2*oe),de.push(ir||[],U+1,2*Y+1,2*oe+1)}}getTile(q,U,Y){q=+q,U=+U,Y=+Y;const oe=this.options,{extent:_e,debug:be}=oe;if(q<0||q>24)return null;const Me=1<1&&console.log("drilling down to z%d-%d-%d",q,U,Y);let Oe,Ze=q,De=U,ot=Y;for(;!Oe&&Ze>0;)Ze--,De>>=1,ot>>=1,Oe=this.tiles[On(Ze,De,ot)];return Oe&&Oe.source?(be>1&&(console.log("found parent tile z%d-%d-%d",Ze,De,ot),console.time("drilling down")),this.splitTile(Oe.source,Ze,De,ot,q,U,Y),be>1&&console.timeEnd("drilling down"),this.tiles[de]?Yi(this.tiles[de],_e):null):null}}function On(le,q,U){return 32*((1<{De.properties=Ct;const Rt={};for(const Kt of ot)Rt[Kt]=de[Kt].evaluate(Ze,De);return Rt},be.reduce=(Ct,Rt)=>{De.properties=Rt;for(const Kt of ot)Ze.accumulated=Ct[Kt],Ct[Kt]=Oe[Kt].evaluate(Ze,De)},be}(q)).load((yield this._pendingData).features):(oe=yield this._pendingData,new un(oe,q.geojsonVtOptions)),this.loaded={};const _e={};if(Y){const be=Y.finish();be&&(_e.resourceTiming={},_e.resourceTiming[q.source]=JSON.parse(JSON.stringify(be)))}return _e}catch(_e){if(delete this._pendingRequest,f.bA(_e))return{abandoned:!0};throw _e}var oe})}getData(){return f._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(q){const U=this.loaded;return U&&U[q.uid]?super.reloadTile(q):this.loadTile(q)}loadAndProcessGeoJSON(q,U){return f._(this,void 0,void 0,function*(){let Y=yield this.loadGeoJSON(q,U);if(delete this._pendingRequest,typeof Y!="object")throw new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`);if(B(Y,!0),q.filter){const oe=f.bB(q.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(oe.result==="error")throw new Error(oe.value.map(be=>`${be.key}: ${be.message}`).join(", "));Y={type:"FeatureCollection",features:Y.features.filter(be=>oe.value.evaluate({zoom:0},be))}}return Y})}loadGeoJSON(q,U){return f._(this,void 0,void 0,function*(){const{promoteId:Y}=q;if(q.request){const oe=yield f.h(q.request,U);return this._dataUpdateable=oo(oe.data,Y)?So(oe.data,Y):void 0,oe.data}if(typeof q.data=="string")try{const oe=JSON.parse(q.data);return this._dataUpdateable=oo(oe,Y)?So(oe,Y):void 0,oe}catch{throw new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`)}if(!q.dataDiff)throw new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${q.source}`);return function(oe,_e,be){var Me,de,Oe,Ze;if(_e.removeAll&&oe.clear(),_e.remove)for(const De of _e.remove)oe.delete(De);if(_e.add)for(const De of _e.add){const ot=Wt(De,be);ot!=null&&oe.set(ot,De)}if(_e.update)for(const De of _e.update){let ot=oe.get(De.id);if(ot==null)continue;const Ct=!De.removeAllProperties&&(((Me=De.removeProperties)===null||Me===void 0?void 0:Me.length)>0||((de=De.addOrUpdateProperties)===null||de===void 0?void 0:de.length)>0);if((De.newGeometry||De.removeAllProperties||Ct)&&(ot=Object.assign({},ot),oe.set(De.id,ot),Ct&&(ot.properties=Object.assign({},ot.properties))),De.newGeometry&&(ot.geometry=De.newGeometry),De.removeAllProperties)ot.properties={};else if(((Oe=De.removeProperties)===null||Oe===void 0?void 0:Oe.length)>0)for(const Rt of De.removeProperties)Object.prototype.hasOwnProperty.call(ot.properties,Rt)&&delete ot.properties[Rt];if(((Ze=De.addOrUpdateProperties)===null||Ze===void 0?void 0:Ze.length)>0)for(const{key:Rt,value:Kt}of De.addOrUpdateProperties)ot.properties[Rt]=Kt}}(this._dataUpdateable,q.dataDiff,Y),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(q){return f._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(q){return this._geoJSONIndex.getClusterExpansionZoom(q.clusterId)}getClusterChildren(q){return this._geoJSONIndex.getChildren(q.clusterId)}getClusterLeaves(q){return this._geoJSONIndex.getLeaves(q.clusterId,q.limit,q.offset)}}class so{constructor(q){this.self=q,this.actor=new f.F(q),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(U,Y)=>{if(this.externalWorkerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.externalWorkerSourceTypes[U]=Y},this.self.addProtocol=f.bh,this.self.removeProtocol=f.bi,this.self.registerRTLTextPlugin=U=>{if(f.bC.isParsed())throw new Error("RTL text plugin already registered.");f.bC.setMethods(U)},this.actor.registerMessageHandler("LDT",(U,Y)=>this._getDEMWorkerSource(U,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RDT",(U,Y)=>f._(this,void 0,void 0,function*(){this._getDEMWorkerSource(U,Y.source).removeTile(Y)})),this.actor.registerMessageHandler("GCEZ",(U,Y)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterExpansionZoom(Y)})),this.actor.registerMessageHandler("GCC",(U,Y)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterChildren(Y)})),this.actor.registerMessageHandler("GCL",(U,Y)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterLeaves(Y)})),this.actor.registerMessageHandler("LD",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).loadData(Y)),this.actor.registerMessageHandler("GD",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).getData()),this.actor.registerMessageHandler("LT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).reloadTile(Y)),this.actor.registerMessageHandler("AT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).abortTile(Y)),this.actor.registerMessageHandler("RMT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).removeTile(Y)),this.actor.registerMessageHandler("RS",(U,Y)=>f._(this,void 0,void 0,function*(){if(!this.workerSources[U]||!this.workerSources[U][Y.type]||!this.workerSources[U][Y.type][Y.source])return;const oe=this.workerSources[U][Y.type][Y.source];delete this.workerSources[U][Y.type][Y.source],oe.removeSource!==void 0&&oe.removeSource(Y)})),this.actor.registerMessageHandler("RM",U=>f._(this,void 0,void 0,function*(){delete this.layerIndexes[U],delete this.availableImages[U],delete this.workerSources[U],delete this.demWorkerSources[U]})),this.actor.registerMessageHandler("SR",(U,Y)=>f._(this,void 0,void 0,function*(){this.referrer=Y})),this.actor.registerMessageHandler("SRPS",(U,Y)=>this._syncRTLPluginState(U,Y)),this.actor.registerMessageHandler("IS",(U,Y)=>f._(this,void 0,void 0,function*(){this.self.importScripts(Y)})),this.actor.registerMessageHandler("SI",(U,Y)=>this._setImages(U,Y)),this.actor.registerMessageHandler("UL",(U,Y)=>f._(this,void 0,void 0,function*(){this._getLayerIndex(U).update(Y.layers,Y.removedIds)})),this.actor.registerMessageHandler("SL",(U,Y)=>f._(this,void 0,void 0,function*(){this._getLayerIndex(U).replace(Y)}))}_setImages(q,U){return f._(this,void 0,void 0,function*(){this.availableImages[q]=U;for(const Y in this.workerSources[q]){const oe=this.workerSources[q][Y];for(const _e in oe)oe[_e].availableImages=U}})}_syncRTLPluginState(q,U){return f._(this,void 0,void 0,function*(){if(f.bC.isParsed())return f.bC.getState();if(U.pluginStatus!=="loading")return f.bC.setState(U),U;const Y=U.pluginURL;if(this.self.importScripts(Y),f.bC.isParsed()){const oe={pluginStatus:"loaded",pluginURL:Y};return f.bC.setState(oe),oe}throw f.bC.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Y}`)})}_getAvailableImages(q){let U=this.availableImages[q];return U||(U=[]),U}_getLayerIndex(q){let U=this.layerIndexes[q];return U||(U=this.layerIndexes[q]=new c),U}_getWorkerSource(q,U,Y){if(this.workerSources[q]||(this.workerSources[q]={}),this.workerSources[q][U]||(this.workerSources[q][U]={}),!this.workerSources[q][U][Y]){const oe={sendAsync:(_e,be)=>(_e.targetMapId=q,this.actor.sendAsync(_e,be))};switch(U){case"vector":this.workerSources[q][U][Y]=new k(oe,this._getLayerIndex(q),this._getAvailableImages(q));break;case"geojson":this.workerSources[q][U][Y]=new $o(oe,this._getLayerIndex(q),this._getAvailableImages(q));break;default:this.workerSources[q][U][Y]=new this.externalWorkerSourceTypes[U](oe,this._getLayerIndex(q),this._getAvailableImages(q))}}return this.workerSources[q][U][Y]}_getDEMWorkerSource(q,U){return this.demWorkerSources[q]||(this.demWorkerSources[q]={}),this.demWorkerSources[q][U]||(this.demWorkerSources[q][U]=new T),this.demWorkerSources[q][U]}}return f.i(self)&&(self.worker=new so(self)),so}),l("index",["exports","./shared"],function(f,c){var y="4.5.0";let w,M;const k={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:v=>new Promise((i,h)=>{const p=requestAnimationFrame(i);v.signal.addEventListener("abort",()=>{cancelAnimationFrame(p),h(c.c())})}),getImageData(v,i=0){return this.getImageCanvasContext(v).getImageData(-i,-i,v.width+2*i,v.height+2*i)},getImageCanvasContext(v){const i=window.document.createElement("canvas"),h=i.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("failed to create canvas 2d context");return i.width=v.width,i.height=v.height,h.drawImage(v,0,0,v.width,v.height),h},resolveURL:v=>(w||(w=document.createElement("a")),w.href=v,w.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(M==null&&(M=matchMedia("(prefers-reduced-motion: reduce)")),M.matches)}};class T{static testProp(i){if(!T.docStyle)return i[0];for(let h=0;h{window.removeEventListener("click",T.suppressClickInternal,!0)},0)}static getScale(i){const h=i.getBoundingClientRect();return{x:h.width/i.offsetWidth||1,y:h.height/i.offsetHeight||1,boundingClientRect:h}}static getPoint(i,h,p){const g=h.boundingClientRect;return new c.P((p.clientX-g.left)/h.x-i.clientLeft,(p.clientY-g.top)/h.y-i.clientTop)}static mousePos(i,h){const p=T.getScale(i);return T.getPoint(i,p,h)}static touchPos(i,h){const p=[],g=T.getScale(i);for(let b=0;b{F&&j(F),F=null,J=!0},B.onerror=()=>{G=!0,F=null},B.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(v){let i,h,p,g;v.resetRequestQueue=()=>{i=[],h=0,p=0,g={}},v.addThrottleControl=C=>{const L=p++;return g[L]=C,L},v.removeThrottleControl=C=>{delete g[C],E()},v.getImage=(C,L,$=!0)=>new Promise((O,H)=>{z.supported&&(C.headers||(C.headers={}),C.headers.accept="image/webp,*/*"),c.e(C,{type:"image"}),i.push({abortController:L,requestParameters:C,supportImageRefresh:$,state:"queued",onError:K=>{H(K)},onSuccess:K=>{O(K)}}),E()});const b=C=>c._(this,void 0,void 0,function*(){C.state="running";const{requestParameters:L,supportImageRefresh:$,onError:O,onSuccess:H,abortController:K}=C,te=$===!1&&!c.i(self)&&!c.g(L.url)&&(!L.headers||Object.keys(L.headers).reduce((ue,ye)=>ue&&ye==="accept",!0));h++;const se=te?I(L,K):c.m(L,K);try{const ue=yield se;delete C.abortController,C.state="completed",ue.data instanceof HTMLImageElement||c.b(ue.data)?H(ue):ue.data&&H({data:yield(re=ue.data,typeof createImageBitmap=="function"?c.d(re):c.f(re)),cacheControl:ue.cacheControl,expires:ue.expires})}catch(ue){delete C.abortController,O(ue)}finally{h--,E()}var re}),E=()=>{const C=(()=>{for(const L of Object.keys(g))if(g[L]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let L=h;L0;L++){const $=i.shift();$.abortController.signal.aborted?L--:b($)}},I=(C,L)=>new Promise(($,O)=>{const H=new Image,K=C.url,te=C.credentials;te&&te==="include"?H.crossOrigin="use-credentials":(te&&te==="same-origin"||!c.s(K))&&(H.crossOrigin="anonymous"),L.signal.addEventListener("abort",()=>{H.src="",O(c.c())}),H.fetchPriority="high",H.onload=()=>{H.onerror=H.onload=null,$({data:H})},H.onerror=()=>{H.onerror=H.onload=null,L.signal.aborted||O(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},H.src=K})}(V||(V={})),V.resetRequestQueue();class me{constructor(i){this._transformRequestFn=i}transformRequest(i,h){return this._transformRequestFn&&this._transformRequestFn(i,h)||{url:i}}setTransformRequest(i){this._transformRequestFn=i}}function X(v){var i=new c.A(3);return i[0]=v[0],i[1]=v[1],i[2]=v[2],i}var pe,Ee=function(v,i,h){return v[0]=i[0]-h[0],v[1]=i[1]-h[1],v[2]=i[2]-h[2],v};pe=new c.A(3),c.A!=Float32Array&&(pe[0]=0,pe[1]=0,pe[2]=0);var Pe=function(v){var i=v[0],h=v[1];return i*i+h*h};function $e(v){const i=[];if(typeof v=="string")i.push({id:"default",url:v});else if(v&&v.length>0){const h=[];for(const{id:p,url:g}of v){const b=`${p}${g}`;h.indexOf(b)===-1&&(h.push(b),i.push({id:p,url:g}))}}return i}function Ye(v,i,h){const p=v.split("?");return p[0]+=`${i}${h}`,p.join("?")}(function(){var v=new c.A(2);c.A!=Float32Array&&(v[0]=0,v[1]=0)})();class ve{constructor(i,h,p,g){this.context=i,this.format=p,this.texture=i.gl.createTexture(),this.update(h,g)}update(i,h,p){const{width:g,height:b}=i,E=!(this.size&&this.size[0]===g&&this.size[1]===b||p),{context:I}=this,{gl:C}=I;if(this.useMipmap=!!(h&&h.useMipmap),C.bindTexture(C.TEXTURE_2D,this.texture),I.pixelStoreUnpackFlipY.set(!1),I.pixelStoreUnpack.set(1),I.pixelStoreUnpackPremultiplyAlpha.set(this.format===C.RGBA&&(!h||h.premultiply!==!1)),E)this.size=[g,b],i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||c.b(i)?C.texImage2D(C.TEXTURE_2D,0,this.format,this.format,C.UNSIGNED_BYTE,i):C.texImage2D(C.TEXTURE_2D,0,this.format,g,b,0,this.format,C.UNSIGNED_BYTE,i.data);else{const{x:L,y:$}=p||{x:0,y:0};i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||c.b(i)?C.texSubImage2D(C.TEXTURE_2D,0,L,$,C.RGBA,C.UNSIGNED_BYTE,i):C.texSubImage2D(C.TEXTURE_2D,0,L,$,g,b,C.RGBA,C.UNSIGNED_BYTE,i.data)}this.useMipmap&&this.isSizePowerOfTwo()&&C.generateMipmap(C.TEXTURE_2D)}bind(i,h,p){const{context:g}=this,{gl:b}=g;b.bindTexture(b.TEXTURE_2D,this.texture),p!==b.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(p=b.LINEAR),i!==this.filter&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,i),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,p||i),this.filter=i),h!==this.wrap&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,h),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:i}=this.context;i.deleteTexture(this.texture),this.texture=null}}function We(v){const{userImage:i}=v;return!!(i&&i.render&&i.render())&&(v.data.replace(new Uint8Array(i.data.buffer)),!0)}class at extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(i){if(this.loaded!==i&&(this.loaded=i,i)){for(const{ids:h,promiseResolve:p}of this.requestors)p(this._getImagesForIds(h));this.requestors=[]}}getImage(i){const h=this.images[i];if(h&&!h.data&&h.spriteData){const p=h.spriteData;h.data=new c.R({width:p.width,height:p.height},p.context.getImageData(p.x,p.y,p.width,p.height).data),h.spriteData=null}return h}addImage(i,h){if(this.images[i])throw new Error(`Image id ${i} already exist, use updateImage instead`);this._validate(i,h)&&(this.images[i]=h)}_validate(i,h){let p=!0;const g=h.data||h.spriteData;return this._validateStretch(h.stretchX,g&&g.width)||(this.fire(new c.j(new Error(`Image "${i}" has invalid "stretchX" value`))),p=!1),this._validateStretch(h.stretchY,g&&g.height)||(this.fire(new c.j(new Error(`Image "${i}" has invalid "stretchY" value`))),p=!1),this._validateContent(h.content,h)||(this.fire(new c.j(new Error(`Image "${i}" has invalid "content" value`))),p=!1),p}_validateStretch(i,h){if(!i)return!0;let p=0;for(const g of i){if(g[0]{let g=!0;if(!this.isLoaded())for(const b of i)this.images[b]||(g=!1);this.isLoaded()||g?h(this._getImagesForIds(i)):this.requestors.push({ids:i,promiseResolve:h})})}_getImagesForIds(i){const h={};for(const p of i){let g=this.getImage(p);g||(this.fire(new c.k("styleimagemissing",{id:p})),g=this.getImage(p)),g?h[p]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,textFitWidth:g.textFitWidth,textFitHeight:g.textFitHeight,hasRenderCallback:!!(g.userImage&&g.userImage.render)}:c.w(`Image "${p}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return h}getPixelSize(){const{width:i,height:h}=this.atlasImage;return{width:i,height:h}}getPattern(i){const h=this.patterns[i],p=this.getImage(i);if(!p)return null;if(h&&h.position.version===p.version)return h.position;if(h)h.position.version=p.version;else{const g={w:p.data.width+2,h:p.data.height+2,x:0,y:0},b=new c.I(g,p);this.patterns[i]={bin:g,position:b}}return this._updatePatternAtlas(),this.patterns[i].position}bind(i){const h=i.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new ve(i,this.atlasImage,h.RGBA),this.atlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE)}_updatePatternAtlas(){const i=[];for(const b in this.patterns)i.push(this.patterns[b].bin);const{w:h,h:p}=c.p(i),g=this.atlasImage;g.resize({width:h||1,height:p||1});for(const b in this.patterns){const{bin:E}=this.patterns[b],I=E.x+1,C=E.y+1,L=this.getImage(b).data,$=L.width,O=L.height;c.R.copy(L,g,{x:0,y:0},{x:I,y:C},{width:$,height:O}),c.R.copy(L,g,{x:0,y:O-1},{x:I,y:C-1},{width:$,height:1}),c.R.copy(L,g,{x:0,y:0},{x:I,y:C+O},{width:$,height:1}),c.R.copy(L,g,{x:$-1,y:0},{x:I-1,y:C},{width:1,height:O}),c.R.copy(L,g,{x:0,y:0},{x:I+$,y:C},{width:1,height:O})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(i){for(const h of i){if(this.callbackDispatchedThisFrame[h])continue;this.callbackDispatchedThisFrame[h]=!0;const p=this.getImage(h);p||c.w(`Image with ID: "${h}" was not found`),We(p)&&this.updateImage(h,p)}}}const mt=1e20;function Ht(v,i,h,p,g,b,E,I,C){for(let L=i;L-1);C++,b[C]=I,E[C]=L,E[C+1]=mt}for(let I=0,C=0;I65535)throw new Error("glyphs > 65535 not supported");if(p.ranges[b])return{stack:i,id:h,glyph:g};if(!this.url)throw new Error("glyphsUrl is not set");if(!p.requests[b]){const I=Ue.loadGlyphRange(i,b,this.url,this.requestManager);p.requests[b]=I}const E=yield p.requests[b];for(const I in E)this._doesCharSupportLocalGlyph(+I)||(p.glyphs[+I]=E[+I]);return p.ranges[b]=!0,{stack:i,id:h,glyph:E[h]||null}})}_doesCharSupportLocalGlyph(i){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](i)||c.u["Hangul Syllables"](i)||c.u.Hiragana(i)||c.u.Katakana(i))}_tinySDF(i,h,p){const g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(p))return;let b=i.tinySDF;if(!b){let I="400";/bold/i.test(h)?I="900":/medium/i.test(h)?I="500":/light/i.test(h)&&(I="200"),b=i.tinySDF=new Ue.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:g,fontWeight:I})}const E=b.draw(String.fromCharCode(p));return{id:p,bitmap:new c.o({width:E.width||60,height:E.height||60},E.data),metrics:{width:E.glyphWidth/2||24,height:E.glyphHeight/2||24,left:E.glyphLeft/2+.5||0,top:E.glyphTop/2-27.5||-8,advance:E.glyphAdvance/2||24,isDoubleResolution:!0}}}}Ue.loadGlyphRange=function(v,i,h,p){return c._(this,void 0,void 0,function*(){const g=256*i,b=g+255,E=p.transformRequest(h.replace("{fontstack}",v).replace("{range}",`${g}-${b}`),"Glyphs"),I=yield c.l(E,new AbortController);if(!I||!I.data)throw new Error(`Could not load glyph range. range: ${i}, ${g}-${b}`);const C={};for(const L of c.n(I.data))C[L.id]=L;return C})},Ue.TinySDF=class{constructor({fontSize:v=24,buffer:i=3,radius:h=8,cutoff:p=.25,fontFamily:g="sans-serif",fontWeight:b="normal",fontStyle:E="normal"}={}){this.buffer=i,this.cutoff=p,this.radius=h;const I=this.size=v+4*i,C=this._createCanvas(I),L=this.ctx=C.getContext("2d",{willReadFrequently:!0});L.font=`${E} ${b} ${v}px ${g}`,L.textBaseline="alphabetic",L.textAlign="left",L.fillStyle="black",this.gridOuter=new Float64Array(I*I),this.gridInner=new Float64Array(I*I),this.f=new Float64Array(I),this.z=new Float64Array(I+1),this.v=new Uint16Array(I)}_createCanvas(v){const i=document.createElement("canvas");return i.width=i.height=v,i}draw(v){const{width:i,actualBoundingBoxAscent:h,actualBoundingBoxDescent:p,actualBoundingBoxLeft:g,actualBoundingBoxRight:b}=this.ctx.measureText(v),E=Math.ceil(h),I=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(b-g))),C=Math.min(this.size-this.buffer,E+Math.ceil(p)),L=I+2*this.buffer,$=C+2*this.buffer,O=Math.max(L*$,0),H=new Uint8ClampedArray(O),K={data:H,width:L,height:$,glyphWidth:I,glyphHeight:C,glyphTop:E,glyphLeft:0,glyphAdvance:i};if(I===0||C===0)return K;const{ctx:te,buffer:se,gridInner:re,gridOuter:ue}=this;te.clearRect(se,se,I,C),te.fillText(v,se,se+E);const ye=te.getImageData(se,se,I,C);ue.fill(mt,0,O),re.fill(0,0,O);for(let ne=0;ne0?je*je:0,re[Ce]=je<0?je*je:0}}Ht(ue,0,0,L,$,L,this.f,this.v,this.z),Ht(re,se,se,I,C,L,this.f,this.v,this.z);for(let ne=0;ne1&&(C=i[++I]);const $=Math.abs(L-C.left),O=Math.abs(L-C.right),H=Math.min($,O);let K;const te=b/p*(g+1);if(C.isDash){const se=g-Math.abs(te);K=Math.sqrt(H*H+se*se)}else K=g-Math.sqrt(H*H+te*te);this.data[E+L]=Math.max(0,Math.min(255,K+128))}}}addRegularDash(i){for(let I=i.length-1;I>=0;--I){const C=i[I],L=i[I+1];C.zeroLength?i.splice(I,1):L&&L.isDash===C.isDash&&(L.left=C.left,i.splice(I,1))}const h=i[0],p=i[i.length-1];h.isDash===p.isDash&&(h.left=p.left-this.width,p.right=h.right+this.width);const g=this.width*this.nextRow;let b=0,E=i[b];for(let I=0;I1&&(E=i[++b]);const C=Math.abs(I-E.left),L=Math.abs(I-E.right),$=Math.min(C,L);this.data[g+I]=Math.max(0,Math.min(255,(E.isDash?$:-$)+128))}}addDash(i,h){const p=h?7:0,g=2*p+1;if(this.nextRow+g>this.height)return c.w("LineAtlas out of space"),null;let b=0;for(let I=0;I{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ve]}numActive(){return Object.keys(this.active).length}}const tr=Math.floor(k.hardwareConcurrency/2);let rt,rr;function ni(){return rt||(rt=new ct),rt}ct.workerCount=c.C(globalThis)?Math.max(Math.min(tr,3),1):1;class cr{constructor(i,h){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=h;const p=this.workerPool.acquire(h);for(let g=0;g{h.remove()}),this.actors=[],i&&this.workerPool.release(this.id)}registerMessageHandler(i,h){for(const p of this.actors)p.registerMessageHandler(i,h)}}function li(){return rr||(rr=new cr(ni(),c.G),rr.registerMessageHandler("GR",(v,i,h)=>c.m(i,h))),rr}function Bi(v,i){const h=c.H();return c.J(h,h,[1,1,0]),c.K(h,h,[.5*v.width,.5*v.height,1]),c.L(h,h,v.calculatePosMatrix(i.toUnwrapped()))}function Se(v,i,h,p,g,b){const E=function(O,H,K){if(O)for(const te of O){const se=H[te];if(se&&se.source===K&&se.type==="fill-extrusion")return!0}else for(const te in H){const se=H[te];if(se.source===K&&se.type==="fill-extrusion")return!0}return!1}(g&&g.layers,i,v.id),I=b.maxPitchScaleFactor(),C=v.tilesIn(p,I,E);C.sort(Be);const L=[];for(const O of C)L.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(i,h,v._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,g,b,I,Bi(v.transform,O.tileID))});const $=function(O){const H={},K={};for(const te of O){const se=te.queryResults,re=te.wrappedTileID,ue=K[re]=K[re]||{};for(const ye in se){const ne=se[ye],xe=ue[ye]=ue[ye]||{},Ie=H[ye]=H[ye]||[];for(const Ce of ne)xe[Ce.featureIndex]||(xe[Ce.featureIndex]=!0,Ie.push(Ce))}}return H}(L);for(const O in $)$[O].forEach(H=>{const K=H.feature,te=v.getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=te});return $}function Be(v,i){const h=v.tileID,p=i.tileID;return h.overscaledZ-p.overscaledZ||h.canonical.y-p.canonical.y||h.wrap-p.wrap||h.canonical.x-p.canonical.x}function nr(v,i,h){return c._(this,void 0,void 0,function*(){let p=v;if(v.url?p=(yield c.h(i.transformRequest(v.url,"Source"),h)).data:yield k.frameAsync(h),!p)return null;const g=c.M(c.e(p,v),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in p&&p.vector_layers&&(g.vectorLayerIds=p.vector_layers.map(b=>b.id)),g})}class Te{constructor(i,h){i&&(h?this.setSouthWest(i).setNorthEast(h):Array.isArray(i)&&(i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1])))}setNorthEast(i){return this._ne=i instanceof c.N?new c.N(i.lng,i.lat):c.N.convert(i),this}setSouthWest(i){return this._sw=i instanceof c.N?new c.N(i.lng,i.lat):c.N.convert(i),this}extend(i){const h=this._sw,p=this._ne;let g,b;if(i instanceof c.N)g=i,b=i;else{if(!(i instanceof Te))return Array.isArray(i)?i.length===4||i.every(Array.isArray)?this.extend(Te.convert(i)):this.extend(c.N.convert(i)):i&&("lng"in i||"lon"in i)&&"lat"in i?this.extend(c.N.convert(i)):this;if(g=i._sw,b=i._ne,!g||!b)return this}return h||p?(h.lng=Math.min(g.lng,h.lng),h.lat=Math.min(g.lat,h.lat),p.lng=Math.max(b.lng,p.lng),p.lat=Math.max(b.lat,p.lat)):(this._sw=new c.N(g.lng,g.lat),this._ne=new c.N(b.lng,b.lat)),this}getCenter(){return new c.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new c.N(this.getWest(),this.getNorth())}getSouthEast(){return new c.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(i){const{lng:h,lat:p}=c.N.convert(i);let g=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(g=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=p&&p<=this._ne.lat&&g}static convert(i){return i instanceof Te?i:i&&new Te(i)}static fromLngLat(i,h=0){const p=360*h/40075017,g=p/Math.cos(Math.PI/180*i.lat);return new Te(new c.N(i.lng-g,i.lat-p),new c.N(i.lng+g,i.lat+p))}}class Mi{constructor(i,h,p){this.bounds=Te.convert(this.validateBounds(i)),this.minzoom=h||0,this.maxzoom=p||24}validateBounds(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]}contains(i){const h=Math.pow(2,i.z),p=Math.floor(c.O(this.bounds.getWest())*h),g=Math.floor(c.Q(this.bounds.getNorth())*h),b=Math.ceil(c.O(this.bounds.getEast())*h),E=Math.ceil(c.Q(this.bounds.getSouth())*h);return i.x>=p&&i.x=g&&i.y{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p={request:this.map._requestManager.transformRequest(h,"Tile"),uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,tileSize:this.tileSize*i.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};p.request.collectResourceTiming=this._collectResourceTiming;let g="RT";if(i.actor&&i.state!=="expired"){if(i.state==="loading")return new Promise((b,E)=>{i.reloadPromise={resolve:b,reject:E}})}else i.actor=this.dispatcher.getActor(),g="LT";i.abortController=new AbortController;try{const b=yield i.actor.sendAsync({type:g,data:p},i.abortController);if(delete i.abortController,i.aborted)return;this._afterTileLoadWorkerResponse(i,b)}catch(b){if(delete i.abortController,i.aborted)return;if(b&&b.status!==404)throw b;this._afterTileLoadWorkerResponse(i,null)}})}_afterTileLoadWorkerResponse(i,h){if(h&&h.resourceTiming&&(i.resourceTiming=h.resourceTiming),h&&this.map._refreshExpiredTiles&&i.setExpiryData(h),i.loadVectorData(h,this.map.painter),i.reloadPromise){const p=i.reloadPromise;i.reloadPromise=null,this.loadTile(i).then(p.resolve).catch(p.reject)}}abortTile(i){return c._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.actor&&(yield i.actor.sendAsync({type:"AT",data:{uid:i.uid,type:this.type,source:this.id}}))})}unloadTile(i){return c._(this,void 0,void 0,function*(){i.unloadVectorData(),i.actor&&(yield i.actor.sendAsync({type:"RMT",data:{uid:i.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class ur extends c.E{constructor(i,h,p,g){super(),this.id=i,this.dispatcher=p,this.setEventedParent(g),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},h),c.e(this,c.M(h,["url","scheme","tileSize"]))}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const i=yield nr(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,i&&(c.e(this,i),i.bounds&&(this.tileBounds=new Mi(i.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))}catch(i){this._tileJSONRequest=null,this.fire(new c.j(i))}})}loaded(){return this._loaded}onAdd(i){this.map=i,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(i){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),i(),this.load()}setTiles(i){return this.setSourceProperty(()=>{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}serialize(){return c.e({},this._options)}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);i.abortController=new AbortController;try{const p=yield V.getImage(this.map._requestManager.transformRequest(h,"Tile"),i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(p&&p.data){this.map._refreshExpiredTiles&&p.cacheControl&&p.expires&&i.setExpiryData({cacheControl:p.cacheControl,expires:p.expires});const g=this.map.painter.context,b=g.gl,E=p.data;i.texture=this.map.painter.getTileTexture(E.width),i.texture?i.texture.update(E,{useMipmap:!0}):(i.texture=new ve(g,E,b.RGBA,{useMipmap:!0}),i.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE,b.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&b.texParameterf(b.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),i.state="loaded"}}catch(p){if(delete i.abortController,i.aborted)i.state="unloaded";else if(p)throw i.state="errored",p}})}abortTile(i){return c._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController)})}unloadTile(i){return c._(this,void 0,void 0,function*(){i.texture&&this.map.painter.saveTileTexture(i.texture)})}hasTransition(){return!1}}class ti extends ur{constructor(i,h,p,g){super(i,h,p,g),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox",this.redFactor=h.redFactor,this.greenFactor=h.greenFactor,this.blueFactor=h.blueFactor,this.baseShift=h.baseShift}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p=this.map._requestManager.transformRequest(h,"Tile");i.neighboringTiles=this._getNeighboringTiles(i.tileID),i.abortController=new AbortController;try{const g=yield V.getImage(p,i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(g&&g.data){const b=g.data;this.map._refreshExpiredTiles&&g.cacheControl&&g.expires&&i.setExpiryData({cacheControl:g.cacheControl,expires:g.expires});const E=c.b(b)&&c.U()?b:yield this.readImageNow(b),I={type:this.type,uid:i.uid,source:this.id,rawImageData:E,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!i.actor||i.state==="expired"){i.actor=this.dispatcher.getActor();const C=yield i.actor.sendAsync({type:"LDT",data:I});i.dem=C,i.needsHillshadePrepare=!0,i.needsTerrainPrepare=!0,i.state="loaded"}}}catch(g){if(delete i.abortController,i.aborted)i.state="unloaded";else if(g)throw i.state="errored",g}})}readImageNow(i){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.V()){const h=i.width+2,p=i.height+2;try{return new c.R({width:h,height:p},yield c.W(i,-1,-1,h,p))}catch{}}return k.getImageData(i,1)})}_getNeighboringTiles(i){const h=i.canonical,p=Math.pow(2,h.z),g=(h.x-1+p)%p,b=h.x===0?i.wrap-1:i.wrap,E=(h.x+1+p)%p,I=h.x+1===p?i.wrap+1:i.wrap,C={};return C[new c.S(i.overscaledZ,b,h.z,g,h.y).key]={backfilled:!1},C[new c.S(i.overscaledZ,I,h.z,E,h.y).key]={backfilled:!1},h.y>0&&(C[new c.S(i.overscaledZ,b,h.z,g,h.y-1).key]={backfilled:!1},C[new c.S(i.overscaledZ,i.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},C[new c.S(i.overscaledZ,I,h.z,E,h.y-1).key]={backfilled:!1}),h.y+10&&c.e(b,{resourceTiming:g}),this.fire(new c.k("data",Object.assign(Object.assign({},b),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},b),{sourceDataType:"content"})))}catch(p){if(this._pendingLoads--,this._removed)return void this.fire(new c.k("dataabort",{dataType:"source"}));this.fire(new c.j(p))}})}loaded(){return this._pendingLoads===0}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.actor?"RT":"LT";i.actor=this.actor;const p={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.abortController=new AbortController;const g=yield this.actor.sendAsync({type:h,data:p},i.abortController);delete i.abortController,i.unloadVectorData(),i.aborted||i.loadVectorData(g,this.map.painter,h==="RT")})}abortTile(i){return c._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.aborted=!0})}unloadTile(i){return c._(this,void 0,void 0,function*(){i.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:i.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Bo=c.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class wo extends c.E{constructor(i,h,p,g){super(),this.id=i,this.dispatcher=p,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=h}load(i){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const h=yield V.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,h&&h.data&&(this.image=h.data,i&&(this.coordinates=i),this._finishLoading())}catch(h){this._request=null,this._loaded=!0,this.fire(new c.j(h))}})}loaded(){return this._loaded}updateImage(i){return i.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=i.url,this.load(i.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(i){this.map=i,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(i){this.coordinates=i;const h=i.map(c.Z.fromLngLat);this.tileID=function(g){let b=1/0,E=1/0,I=-1/0,C=-1/0;for(const H of g)b=Math.min(b,H.x),E=Math.min(E,H.y),I=Math.max(I,H.x),C=Math.max(C,H.y);const L=Math.max(I-b,C-E),$=Math.max(0,Math.floor(-Math.log(L)/Math.LN2)),O=Math.pow(2,$);return new c.a1($,Math.floor((b+I)/2*O),Math.floor((E+C)/2*O))}(h),this.minzoom=this.maxzoom=this.tileID.z;const p=h.map(g=>this.tileID.getTilePoint(g)._round());return this._boundsArray=new c.$,this._boundsArray.emplaceBack(p[0].x,p[0].y,0,0),this._boundsArray.emplaceBack(p[1].x,p[1].y,c.X,0),this._boundsArray.emplaceBack(p[3].x,p[3].y,0,c.X),this._boundsArray.emplaceBack(p[2].x,p[2].y,c.X,c.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const i=this.map.painter.context,h=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Bo.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ve(i,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let p=!1;for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(i){return c._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(i.tileID.canonical)?(this.tiles[String(i.tileID.wrap)]=i,i.buckets={}):i.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Bs extends wo{constructor(i,h,p,g){super(i,h,p,g),this.roundZoom=!0,this.type="video",this.options=h}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1;const i=this.options;this.urls=[];for(const h of i.urls)this.urls.push(this.map._requestManager.transformRequest(h,"Source").url);try{const h=yield c.a3(this.urls);if(this._loaded=!0,!h)return;this.video=h,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(h){this.fire(new c.j(h))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(i){if(this.video){const h=this.video.seekable;ih.end(0)?this.fire(new c.j(new c.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=i}}getVideo(){return this.video}onAdd(i){this.map||(this.map=i,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const i=this.map.painter.context,h=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Bo.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new ve(i,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let p=!1;for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ln extends wo{constructor(i,h,p,g){super(i,h,p,g),h.coordinates?Array.isArray(h.coordinates)&&h.coordinates.length===4&&!h.coordinates.some(b=>!Array.isArray(b)||b.length!==2||b.some(E=>typeof E!="number"))||this.fire(new c.j(new c.a2(`sources.${i}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.a2(`sources.${i}`,null,'missing required property "coordinates"'))),h.animate&&typeof h.animate!="boolean"&&this.fire(new c.j(new c.a2(`sources.${i}`,null,'optional "animate" property must be a boolean value'))),h.canvas?typeof h.canvas=="string"||h.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.a2(`sources.${i}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new c.j(new c.a2(`sources.${i}`,null,'missing required property "canvas"'))),this.options=h,this.animate=h.animate===void 0||h.animate}load(){return c._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(i){this.map=i,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let i=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,i=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,i=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const h=this.map.painter.context,p=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,Bo.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?(i||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ve(h,this.canvas,p.RGBA,{premultiply:!0});let g=!1;for(const b in this.tiles){const E=this.tiles[b];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,g=!0)}g&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const i of[this.canvas.width,this.canvas.height])if(isNaN(i)||i<=0)return!0;return!1}}const Ea={},Pa=v=>{switch(v){case"geojson":return ka;case"image":return wo;case"raster":return ur;case"raster-dem":return ti;case"vector":return cn;case"video":return Bs;case"canvas":return Ln}return Ea[v]},nt="RTLPluginLoaded";class io extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=li()}_syncState(i){return this.status=i,this.dispatcher.broadcast("SRPS",{pluginStatus:i,pluginURL:this.url}).catch(h=>{throw this.status="error",h})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(i){return c._(this,arguments,void 0,function*(h,p=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=k.resolveURL(h),!this.url)throw new Error(`requested url ${h} is invalid`);if(this.status==="unavailable"){if(!p)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return c._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.k(nt))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Yi=null;function no(){return Yi||(Yi=new io),Yi}class Oo{constructor(i,h){this.timeAdded=0,this.fadeEndTime=0,this.tileID=i,this.uid=c.a4(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(i){const h=i+this.timeAdded;hb.getLayer(L)).filter(Boolean);if(C.length!==0){I.layers=C,I.stateDependentLayerIds&&(I.stateDependentLayers=I.stateDependentLayerIds.map(L=>C.filter($=>$.id===L)[0]));for(const L of C)E[L.id]=I}}return E}(i.buckets,h.style),this.hasSymbolBuckets=!1;for(const g in this.buckets){const b=this.buckets[g];if(b instanceof c.a6){if(this.hasSymbolBuckets=!0,!p)break;b.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const g in this.buckets){const b=this.buckets[g];if(b instanceof c.a6&&b.hasRTLText){this.hasRTLText=!0,no().lazyLoad();break}}this.queryPadding=0;for(const g in this.buckets){const b=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(g).queryRadius(b))}i.imageAtlas&&(this.imageAtlas=i.imageAtlas),i.glyphAtlasImage&&(this.glyphAtlasImage=i.glyphAtlasImage)}else this.collisionBoxArray=new c.a5}unloadVectorData(){for(const i in this.buckets)this.buckets[i].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(i){return this.buckets[i.id]}upload(i){for(const p in this.buckets){const g=this.buckets[p];g.uploadPending()&&g.upload(i)}const h=i.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ve(i,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ve(i,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(i){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(i,this.imageAtlasTexture)}queryRenderedFeatures(i,h,p,g,b,E,I,C,L,$){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:b,scale:E,tileSize:this.tileSize,pixelPosMatrix:$,transform:C,params:I,queryPadding:this.queryPadding*L},i,h,p):{}}querySourceFeatures(i,h){const p=this.latestFeatureIndex;if(!p||!p.rawTileData)return;const g=p.loadVTLayers(),b=h&&h.sourceLayer?h.sourceLayer:"",E=g._geojsonTileLayer||g[b];if(!E)return;const I=c.a7(h&&h.filter),{z:C,x:L,y:$}=this.tileID.canonical,O={z:C,x:L,y:$};for(let H=0;Hp)g=!1;else if(h)if(this.expirationTime{this.remove(i,b)},p)),this.data[g].push(b),this.order.push(g),this.order.length>this.max){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}return this}has(i){return i.wrapped().key in this.data}getAndRemove(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null}_getAndRemoveByKey(i){const h=this.data[i].shift();return h.timeout&&clearTimeout(h.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),h.value}getByKey(i){const h=this.data[i];return h?h[0].value:null}get(i){return this.has(i)?this.data[i.wrapped().key][0].value:null}remove(i,h){if(!this.has(i))return this;const p=i.wrapped().key,g=h===void 0?0:this.data[p].indexOf(h),b=this.data[p][g];return this.data[p].splice(g,1),b.timeout&&clearTimeout(b.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(b.value),this.order.splice(this.order.indexOf(p),1),this}setMaxSize(i){for(this.max=i;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(i){const h=[];for(const p in this.data)for(const g of this.data[p])i(g.value)||h.push(g);for(const p of h)this.remove(p.value.tileID,p)}}class er{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(i,h,p){const g=String(h);if(this.stateChanges[i]=this.stateChanges[i]||{},this.stateChanges[i][g]=this.stateChanges[i][g]||{},c.e(this.stateChanges[i][g],p),this.deletedStates[i]===null){this.deletedStates[i]={};for(const b in this.state[i])b!==g&&(this.deletedStates[i][b]=null)}else if(this.deletedStates[i]&&this.deletedStates[i][g]===null){this.deletedStates[i][g]={};for(const b in this.state[i][g])p[b]||(this.deletedStates[i][g][b]=null)}else for(const b in p)this.deletedStates[i]&&this.deletedStates[i][g]&&this.deletedStates[i][g][b]===null&&delete this.deletedStates[i][g][b]}removeFeatureState(i,h,p){if(this.deletedStates[i]===null)return;const g=String(h);if(this.deletedStates[i]=this.deletedStates[i]||{},p&&h!==void 0)this.deletedStates[i][g]!==null&&(this.deletedStates[i][g]=this.deletedStates[i][g]||{},this.deletedStates[i][g][p]=null);else if(h!==void 0)if(this.stateChanges[i]&&this.stateChanges[i][g])for(p in this.deletedStates[i][g]={},this.stateChanges[i][g])this.deletedStates[i][g][p]=null;else this.deletedStates[i][g]=null;else this.deletedStates[i]=null}getState(i,h){const p=String(h),g=c.e({},(this.state[i]||{})[p],(this.stateChanges[i]||{})[p]);if(this.deletedStates[i]===null)return{};if(this.deletedStates[i]){const b=this.deletedStates[i][h];if(b===null)return{};for(const E in b)delete g[E]}return g}initializeTileState(i,h){i.setFeatureState(this.state,h)}coalesceChanges(i,h){const p={};for(const g in this.stateChanges){this.state[g]=this.state[g]||{};const b={};for(const E in this.stateChanges[g])this.state[g][E]||(this.state[g][E]={}),c.e(this.state[g][E],this.stateChanges[g][E]),b[E]=this.state[g][E];p[g]=b}for(const g in this.deletedStates){this.state[g]=this.state[g]||{};const b={};if(this.deletedStates[g]===null)for(const E in this.state[g])b[E]={},this.state[g][E]={};else for(const E in this.deletedStates[g]){if(this.deletedStates[g][E]===null)this.state[g][E]={};else for(const I of Object.keys(this.deletedStates[g][E]))delete this.state[g][E][I];b[E]=this.state[g][E]}p[g]=p[g]||{},c.e(p[g],b)}if(this.stateChanges={},this.deletedStates={},Object.keys(p).length!==0)for(const g in i)i[g].setFeatureState(p,h)}}class Nt extends c.E{constructor(i,h,p){super(),this.id=i,this.dispatcher=p,this.on("data",g=>this._dataHandler(g)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((g,b,E,I)=>{const C=new(Pa(b.type))(g,b,E,I);if(C.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${C.id}`);return C})(i,h,p,this),this._tiles={},this._cache=new lt(0,g=>this._unloadTile(g)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new er,this._didEmitContent=!1,this._updated=!1}onAdd(i){this.map=i,this._maxTileCacheSize=i?i._maxTileCacheSize:null,this._maxTileCacheZoomLevels=i?i._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(i)}onRemove(i){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(i)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const i in this._tiles){const h=this._tiles[i];if(h.state!=="loaded"&&h.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const i=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,i&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(i,h,p){return c._(this,void 0,void 0,function*(){try{yield this._source.loadTile(i),this._tileLoaded(i,h,p)}catch(g){i.state="errored",g.status!==404?this._source.fire(new c.j(g,{tile:i})):this.update(this.transform,this.terrain)}})}_unloadTile(i){this._source.unloadTile&&this._source.unloadTile(i)}_abortTile(i){this._source.abortTile&&this._source.abortTile(i),this._source.fire(new c.k("dataabort",{tile:i,coord:i.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(i){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const p=this._tiles[h];p.upload(i),p.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(i=>i.tileID).sort(un).map(i=>i.key)}getRenderableIds(i){const h=[];for(const p in this._tiles)this._isIdRenderable(p,i)&&h.push(this._tiles[p]);return i?h.sort((p,g)=>{const b=p.tileID,E=g.tileID,I=new c.P(b.canonical.x,b.canonical.y)._rotate(this.transform.angle),C=new c.P(E.canonical.x,E.canonical.y)._rotate(this.transform.angle);return b.overscaledZ-E.overscaledZ||C.y-I.y||C.x-I.x}).map(p=>p.tileID.key):h.map(p=>p.tileID).sort(un).map(p=>p.key)}hasRenderableParent(i){const h=this.findLoadedParent(i,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(i,h){return this._tiles[i]&&this._tiles[i].hasData()&&!this._coveredTiles[i]&&(h||!this._tiles[i].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const i in this._tiles)this._tiles[i].state!=="errored"&&this._reloadTile(i,"reloading")}}_reloadTile(i,h){return c._(this,void 0,void 0,function*(){const p=this._tiles[i];p&&(p.state!=="loading"&&(p.state=h),yield this._loadTile(p,i,h))})}_tileLoaded(i,h,p){i.timeAdded=k.now(),p==="expired"&&(i.refreshedUponExpiration=!0),this._setTileReloadTimer(h,i),this.getSource().type==="raster-dem"&&i.dem&&this._backfillDEM(i),this._state.initializeTileState(i,this.map?this.map.painter:null),i.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:i,coord:i.tileID}))}_backfillDEM(i){const h=this.getRenderableIds();for(let g=0;g1||(Math.abs(E)>1&&(Math.abs(E+C)===1?E+=C:Math.abs(E-C)===1&&(E-=C)),b.dem&&g.dem&&(g.dem.backfillBorder(b.dem,E,I),g.neighboringTiles&&g.neighboringTiles[L]&&(g.neighboringTiles[L].backfilled=!0)))}}getTile(i){return this.getTileByID(i.key)}getTileByID(i){return this._tiles[i]}_retainLoadedChildren(i,h,p,g){for(const b in this._tiles){let E=this._tiles[b];if(g[b]||!E.hasData()||E.tileID.overscaledZ<=h||E.tileID.overscaledZ>p)continue;let I=E.tileID;for(;E&&E.tileID.overscaledZ>h+1;){const L=E.tileID.scaledTo(E.tileID.overscaledZ-1);E=this._tiles[L.key],E&&E.hasData()&&(I=L)}let C=I;for(;C.overscaledZ>h;)if(C=C.scaledTo(C.overscaledZ-1),i[C.key]){g[I.key]=I;break}}}findLoadedParent(i,h){if(i.key in this._loadedParentTiles){const p=this._loadedParentTiles[i.key];return p&&p.tileID.overscaledZ>=h?p:null}for(let p=i.overscaledZ-1;p>=h;p--){const g=i.scaledTo(p),b=this._getLoadedTile(g);if(b)return b}}findLoadedSibling(i){return this._getLoadedTile(i)}_getLoadedTile(i){const h=this._tiles[i.key];return h&&h.hasData()?h:this._cache.getByKey(i.wrapped().key)}updateCacheSize(i){const h=Math.ceil(i.width/this._source.tileSize)+1,p=Math.ceil(i.height/this._source.tileSize)+1,g=Math.floor(h*p*(this._maxTileCacheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),b=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(b)}handleWrapJump(i){const h=Math.round((i-(this._prevLng===void 0?i:this._prevLng))/360);if(this._prevLng=i,h){const p={};for(const g in this._tiles){const b=this._tiles[g];b.tileID=b.tileID.unwrapTo(b.tileID.wrap+h),p[b.tileID.key]=b}this._tiles=p;for(const g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(const g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}_updateCoveredAndRetainedTiles(i,h,p,g,b,E){const I={},C={},L=Object.keys(i),$=k.now();for(const O of L){const H=i[O],K=this._tiles[O];if(!K||K.fadeEndTime!==0&&K.fadeEndTime<=$)continue;const te=this.findLoadedParent(H,h),se=this.findLoadedSibling(H),re=te||se||null;re&&(this._addTile(re.tileID),I[re.tileID.key]=re.tileID),C[O]=H}this._retainLoadedChildren(C,g,p,i);for(const O in I)i[O]||(this._coveredTiles[O]=!0,i[O]=I[O]);if(E){const O={},H={};for(const K of b)this._tiles[K.key].hasData()?O[K.key]=K:H[K.key]=K;for(const K in H){const te=H[K].children(this._source.maxzoom);this._tiles[te[0].key]&&this._tiles[te[1].key]&&this._tiles[te[2].key]&&this._tiles[te[3].key]&&(O[te[0].key]=i[te[0].key]=te[0],O[te[1].key]=i[te[1].key]=te[1],O[te[2].key]=i[te[2].key]=te[2],O[te[3].key]=i[te[3].key]=te[3],delete H[K])}for(const K in H){const te=H[K],se=this.findLoadedParent(te,this._source.minzoom),re=this.findLoadedSibling(te),ue=se||re||null;if(ue){O[ue.tileID.key]=i[ue.tileID.key]=ue.tileID;for(const ye in O)O[ye].isChildOf(ue.tileID)&&delete O[ye]}}for(const K in this._tiles)O[K]||(this._coveredTiles[K]=!0)}}update(i,h){if(!this._sourceLoaded||this._paused)return;let p;this.transform=i,this.terrain=h,this.updateCacheSize(i),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?p=i.getVisibleUnwrappedCoordinates(this._source.tileID).map($=>new c.S($.canonical.z,$.wrap,$.canonical.z,$.canonical.x,$.canonical.y)):(p=i.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(p=p.filter($=>this._source.hasTile($)))):p=[];const g=i.coveringZoomLevel(this._source),b=Math.max(g-Nt.maxOverzooming,this._source.minzoom),E=Math.max(g+Nt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const $={};for(const O of p)if(O.canonical.z>this._source.minzoom){const H=O.scaledTo(O.canonical.z-1);$[H.key]=H;const K=O.scaledTo(Math.max(this._source.minzoom,Math.min(O.canonical.z,5)));$[K.key]=K}p=p.concat(Object.values($))}const I=p.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,I&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const C=this._updateRetainedTiles(p,g);On(this._source.type)&&this._updateCoveredAndRetainedTiles(C,b,E,g,p,h);for(const $ in C)this._tiles[$].clearFadeHold();const L=c.ac(this._tiles,C);for(const $ of L){const O=this._tiles[$];O.hasSymbolBuckets&&!O.holdingForFade()?O.setHoldDuration(this.map._fadeDuration):O.hasSymbolBuckets&&!O.symbolFadeFinished()||this._removeTile($)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const i in this._tiles)this._tiles[i].holdingForFade()&&this._removeTile(i)}_updateRetainedTiles(i,h){var p;const g={},b={},E=Math.max(h-Nt.maxOverzooming,this._source.minzoom),I=Math.max(h+Nt.maxUnderzooming,this._source.minzoom),C={};for(const L of i){const $=this._addTile(L);g[L.key]=L,$.hasData()||hthis._source.maxzoom){const H=L.children(this._source.maxzoom)[0],K=this.getTile(H);if(K&&K.hasData()){g[H.key]=H;continue}}else{const H=L.children(this._source.maxzoom);if(g[H[0].key]&&g[H[1].key]&&g[H[2].key]&&g[H[3].key])continue}let O=$.wasRequested();for(let H=L.overscaledZ-1;H>=E;--H){const K=L.scaledTo(H);if(b[K.key])break;if(b[K.key]=!0,$=this.getTile(K),!$&&O&&($=this._addTile(K)),$){const te=$.hasData();if((te||!(!((p=this.map)===null||p===void 0)&&p.cancelPendingTileRequestsWhileZooming)||O)&&(g[K.key]=K),O=$.wasRequested(),te)break}}}return g}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const i in this._tiles){const h=[];let p,g=this._tiles[i].tileID;for(;g.overscaledZ>0;){if(g.key in this._loadedParentTiles){p=this._loadedParentTiles[g.key];break}h.push(g.key);const b=g.scaledTo(g.overscaledZ-1);if(p=this._getLoadedTile(b),p)break;g=b}for(const b of h)this._loadedParentTiles[b]=p}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const i in this._tiles){const h=this._tiles[i].tileID,p=this._getLoadedTile(h);this._loadedSiblingTiles[h.key]=p}}_addTile(i){let h=this._tiles[i.key];if(h)return h;h=this._cache.getAndRemove(i),h&&(this._setTileReloadTimer(i.key,h),h.tileID=i,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[i.key]&&(clearTimeout(this._cacheTimers[i.key]),delete this._cacheTimers[i.key],this._setTileReloadTimer(i.key,h)));const p=h;return h||(h=new Oo(i,this._source.tileSize*i.overscaleFactor()),this._loadTile(h,i.key,h.state)),h.uses++,this._tiles[i.key]=h,p||this._source.fire(new c.k("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(i,h){i in this._timers&&(clearTimeout(this._timers[i]),delete this._timers[i]);const p=h.getExpiryTimeout();p&&(this._timers[i]=setTimeout(()=>{this._reloadTile(i,"expired"),delete this._timers[i]},p))}_removeTile(i){const h=this._tiles[i];h&&(h.uses--,delete this._tiles[i],this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]),h.uses>0||(h.hasData()&&h.state!=="reloading"?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}_dataHandler(i){const h=i.sourceDataType;i.dataType==="source"&&h==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&i.dataType==="source"&&h==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const i in this._tiles)this._removeTile(i);this._cache.reset()}tilesIn(i,h,p){const g=[],b=this.transform;if(!b)return g;const E=p?b.getCameraQueryGeometry(i):i,I=i.map(te=>b.pointCoordinate(te,this.terrain)),C=E.map(te=>b.pointCoordinate(te,this.terrain)),L=this.getIds();let $=1/0,O=1/0,H=-1/0,K=-1/0;for(const te of C)$=Math.min($,te.x),O=Math.min(O,te.y),H=Math.max(H,te.x),K=Math.max(K,te.y);for(let te=0;te=0&&ne[1].y+ye>=0){const xe=I.map(Ce=>re.getTilePoint(Ce)),Ie=C.map(Ce=>re.getTilePoint(Ce));g.push({tile:se,tileID:re,queryGeometry:xe,cameraQueryGeometry:Ie,scale:ue})}}return g}getVisibleCoordinates(i){const h=this.getRenderableIds(i).map(p=>this._tiles[p].tileID);for(const p of h)p.posMatrix=this.transform.calculatePosMatrix(p.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(On(this._source.type)){const i=k.now();for(const h in this._tiles)if(this._tiles[h].fadeEndTime>=i)return!0}return!1}setFeatureState(i,h,p){this._state.updateState(i=i||"_geojsonTileLayer",h,p)}removeFeatureState(i,h,p){this._state.removeFeatureState(i=i||"_geojsonTileLayer",h,p)}getFeatureState(i,h){return this._state.getState(i=i||"_geojsonTileLayer",h)}setDependencies(i,h,p){const g=this._tiles[i];g&&g.setDependencies(h,p)}reloadTilesForDependencies(i,h){for(const p in this._tiles)this._tiles[p].hasDependency(i,h)&&this._reloadTile(p,"reloading");this._cache.filter(p=>!p.hasDependency(i,h))}}function un(v,i){const h=Math.abs(2*v.wrap)-+(v.wrap<0),p=Math.abs(2*i.wrap)-+(i.wrap<0);return v.overscaledZ-i.overscaledZ||p-h||i.canonical.y-v.canonical.y||i.canonical.x-v.canonical.x}function On(v){return v==="raster"||v==="image"||v==="video"}Nt.maxOverzooming=10,Nt.maxUnderzooming=3;class Wt{constructor(i,h){this.reset(i,h)}reset(i,h){this.points=i||[],this._distances=[0];for(let p=1;p0?(g-E)/I:0;return this.points[b].mult(1-C).add(this.points[h].mult(C))}}function oo(v,i){let h=!0;return v==="always"||v!=="never"&&i!=="never"||(h=!1),h}class So{constructor(i,h,p){const g=this.boxCells=[],b=this.circleCells=[];this.xCellCount=Math.ceil(i/p),this.yCellCount=Math.ceil(h/p);for(let E=0;Ethis.width||g<0||h>this.height)return[];const C=[];if(i<=0&&h<=0&&this.width<=p&&this.height<=g){if(b)return[{key:null,x1:i,y1:h,x2:p,y2:g}];for(let L=0;L0}hitTestCircle(i,h,p,g,b){const E=i-p,I=i+p,C=h-p,L=h+p;if(I<0||E>this.width||L<0||C>this.height)return!1;const $=[];return this._forEachCell(E,C,I,L,this._queryCellCircle,$,{hitTest:!0,overlapMode:g,circle:{x:i,y:h,radius:p},seenUids:{box:{},circle:{}}},b),$.length>0}_queryCell(i,h,p,g,b,E,I,C){const{seenUids:L,hitTest:$,overlapMode:O}=I,H=this.boxCells[b];if(H!==null){const te=this.bboxes;for(const se of H)if(!L.box[se]){L.box[se]=!0;const re=4*se,ue=this.boxKeys[se];if(i<=te[re+2]&&h<=te[re+3]&&p>=te[re+0]&&g>=te[re+1]&&(!C||C(ue))&&(!$||!oo(O,ue.overlapMode))&&(E.push({key:ue,x1:te[re],y1:te[re+1],x2:te[re+2],y2:te[re+3]}),$))return!0}}const K=this.circleCells[b];if(K!==null){const te=this.circles;for(const se of K)if(!L.circle[se]){L.circle[se]=!0;const re=3*se,ue=this.circleKeys[se];if(this._circleAndRectCollide(te[re],te[re+1],te[re+2],i,h,p,g)&&(!C||C(ue))&&(!$||!oo(O,ue.overlapMode))){const ye=te[re],ne=te[re+1],xe=te[re+2];if(E.push({key:ue,x1:ye-xe,y1:ne-xe,x2:ye+xe,y2:ne+xe}),$)return!0}}}return!1}_queryCellCircle(i,h,p,g,b,E,I,C){const{circle:L,seenUids:$,overlapMode:O}=I,H=this.boxCells[b];if(H!==null){const te=this.bboxes;for(const se of H)if(!$.box[se]){$.box[se]=!0;const re=4*se,ue=this.boxKeys[se];if(this._circleAndRectCollide(L.x,L.y,L.radius,te[re+0],te[re+1],te[re+2],te[re+3])&&(!C||C(ue))&&!oo(O,ue.overlapMode))return E.push(!0),!0}}const K=this.circleCells[b];if(K!==null){const te=this.circles;for(const se of K)if(!$.circle[se]){$.circle[se]=!0;const re=3*se,ue=this.circleKeys[se];if(this._circlesCollide(te[re],te[re+1],te[re+2],L.x,L.y,L.radius)&&(!C||C(ue))&&!oo(O,ue.overlapMode))return E.push(!0),!0}}}_forEachCell(i,h,p,g,b,E,I,C){const L=this._convertToXCellCoord(i),$=this._convertToYCellCoord(h),O=this._convertToXCellCoord(p),H=this._convertToYCellCoord(g);for(let K=L;K<=O;K++)for(let te=$;te<=H;te++)if(b.call(this,i,h,p,g,this.xCellCount*te+K,E,I,C))return}_convertToXCellCoord(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))}_convertToYCellCoord(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))}_circlesCollide(i,h,p,g,b,E){const I=g-i,C=b-h,L=p+E;return L*L>I*I+C*C}_circleAndRectCollide(i,h,p,g,b,E,I){const C=(E-g)/2,L=Math.abs(i-(g+C));if(L>C+p)return!1;const $=(I-b)/2,O=Math.abs(h-(b+$));if(O>$+p)return!1;if(L<=C||O<=$)return!0;const H=L-C,K=O-$;return H*H+K*K<=p*p}}function $o(v,i,h,p,g){const b=c.H();return i?(c.K(b,b,[1/g,1/g,1]),h||c.ae(b,b,p.angle)):c.L(b,p.labelPlaneMatrix,v),b}function so(v,i,h,p,g){if(i){const b=c.af(v);return c.K(b,b,[g,g,1]),h||c.ae(b,b,-p.angle),b}return p.glCoordMatrix}function le(v,i,h){let p;h?(p=[v.x,v.y,h(v.x,v.y),1],c.ag(p,p,i)):(p=[v.x,v.y,0,1],function(b,E,I){const C=E[0],L=E[1];b[0]=I[0]*C+I[4]*L+I[12],b[1]=I[1]*C+I[5]*L+I[13],b[3]=I[3]*C+I[7]*L+I[15]}(p,p,i));const g=p[3];return{point:new c.P(p[0]/g,p[1]/g),signedDistanceFromCamera:g,isOccluded:!1}}function q(v,i){return .5+v/i*.5}function U(v,i){return v.x>=-i[0]&&v.x<=i[0]&&v.y>=-i[1]&&v.y<=i[1]}function Y(v,i,h,p,g,b,E,I,C,L,$,O,H,K,te){const se=p?v.textSizeData:v.iconSizeData,re=c.ah(se,h.transform.zoom),ue=[256/h.width*2+1,256/h.height*2+1],ye=p?v.text.dynamicLayoutVertexArray:v.icon.dynamicLayoutVertexArray;ye.clear();const ne=v.lineVertexArray,xe=p?v.text.placedSymbolArray:v.icon.placedSymbolArray,Ie=h.transform.width/h.transform.height;let Ce=!1;for(let je=0;jeMath.abs(h.x-i.x)*p?{useVertical:!0}:(v===c.ai.vertical?i.yh.x)?{needsFlipping:!0}:null}function be(v,i,h,p,g,b,E,I,C,L,$){const O=h/24,H=i.lineOffsetX*O,K=i.lineOffsetY*O;let te;if(i.numGlyphs>1){const se=i.glyphStartIndex+i.numGlyphs,re=i.lineStartIndex,ue=i.lineStartIndex+i.lineLength,ye=oe(O,I,H,K,p,i,$,v);if(!ye)return{notEnoughRoom:!0};const ne=le(ye.first.point,E,v.getElevation).point,xe=le(ye.last.point,E,v.getElevation).point;if(g&&!p){const Ie=_e(i.writingMode,ne,xe,L);if(Ie)return Ie}te=[ye.first];for(let Ie=i.glyphStartIndex+1;Ie0?ne.point:function(Ce,je,Je,gt,yt,Qe){return Me(Ce,je,Je,1,yt,Qe)}(v.tileAnchorPoint,ye,re,0,b,v),Ie=_e(i.writingMode,re,xe,L);if(Ie)return Ie}const se=ot(O*I.getoffsetX(i.glyphStartIndex),H,K,p,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,v,$);if(!se||v.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};te=[se]}for(const se of te)c.ak(C,se.point,se.angle);return{}}function Me(v,i,h,p,g,b){const E=v.add(v.sub(i)._unit()),I=g!==void 0?le(E,g,b.getElevation).point:Oe(E.x,E.y,b).point,C=h.sub(I);return h.add(C._mult(p/C.mag()))}function de(v,i,h){const p=i.projectionCache;if(p.projections[v])return p.projections[v];const g=new c.P(i.lineVertexArray.getx(v),i.lineVertexArray.gety(v)),b=Oe(g.x,g.y,i);if(b.signedDistanceFromCamera>0)return p.projections[v]=b.point,p.anyProjectionOccluded=p.anyProjectionOccluded||b.isOccluded,b.point;const E=v-h.direction;return function(I,C,L,$,O){return Me(I,C,L,$,void 0,O)}(h.distanceFromAnchor===0?i.tileAnchorPoint:new c.P(i.lineVertexArray.getx(E),i.lineVertexArray.gety(E)),g,h.previousVertex,h.absOffsetX-h.distanceFromAnchor+1,i)}function Oe(v,i,h){const p=v+h.translation[0],g=i+h.translation[1];let b;return!h.pitchWithMap&&h.projection.useSpecialProjectionForSymbols?(b=h.projection.projectTileCoordinates(p,g,h.unwrappedTileID,h.getElevation),b.point.x=(.5*b.point.x+.5)*h.width,b.point.y=(.5*-b.point.y+.5)*h.height):(b=le(new c.P(p,g),h.labelPlaneMatrix,h.getElevation),b.isOccluded=!1),b}function Ze(v,i,h){return v._unit()._perp()._mult(i*h)}function De(v,i,h,p,g,b,E,I,C){if(I.projectionCache.offsets[v])return I.projectionCache.offsets[v];const L=h.add(i);if(v+C.direction=g)return I.projectionCache.offsets[v]=L,L;const $=de(v+C.direction,I,C),O=Ze($.sub(h),E,C.direction),H=h.add(O),K=$.add(O);return I.projectionCache.offsets[v]=c.al(b,L,H,K)||L,I.projectionCache.offsets[v]}function ot(v,i,h,p,g,b,E,I,C){const L=p?v-i:v+i;let $=L>0?1:-1,O=0;p&&($*=-1,O=Math.PI),$<0&&(O+=Math.PI);let H,K=$>0?b+g:b+g+1;I.projectionCache.cachedAnchorPoint?H=I.projectionCache.cachedAnchorPoint:(H=Oe(I.tileAnchorPoint.x,I.tileAnchorPoint.y,I).point,I.projectionCache.cachedAnchorPoint=H);let te,se,re=H,ue=H,ye=0,ne=0;const xe=Math.abs(L),Ie=[];let Ce;for(;ye+ne<=xe;){if(K+=$,K=E)return null;ye+=ne,ue=re,se=te;const gt={absOffsetX:xe,direction:$,distanceFromAnchor:ye,previousVertex:ue};if(re=de(K,I,gt),h===0)Ie.push(ue),Ce=re.sub(ue);else{let yt;const Qe=re.sub(ue);yt=Qe.mag()===0?Ze(de(K+$,I,gt).sub(re),h,$):Ze(Qe,h,$),se||(se=ue.add(yt)),te=De(K,yt,re,b,E,se,h,I,gt),Ie.push(se),Ce=te.sub(se)}ne=Ce.mag()}const je=Ce._mult((xe-ye)/ne)._add(se||ue),Je=O+Math.atan2(re.y-ue.y,re.x-ue.x);return Ie.push(je),{point:je,angle:C?Je:0,path:Ie}}const Ct=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Rt(v,i){for(let h=0;h=1;Qt--)ft.push(Ut.path[Qt]);for(let Qt=1;Qtar.signedDistanceFromCamera<=0)?[]:Qt.map(ar=>ar.point)}let jr=[];if(ft.length>0){const Qt=ft[0].clone(),ar=ft[0].clone();for(let Vr=1;Vr=Qe.x&&ar.x<=it.x&&Qt.y>=Qe.y&&ar.y<=it.y?[ft]:ar.xit.x||ar.yit.y?[]:c.am([ft],Qe.x,Qe.y,it.x,it.y)}for(const Qt of jr){Et.reset(Qt,.25*yt);let ar=0;ar=Et.length<=.5*yt?1:Math.ceil(Et.paddedLength/jt)+1;for(let Vr=0;Vrle(g,p,h.getElevation))}queryRenderedSymbols(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const h=[];let p=1/0,g=1/0,b=-1/0,E=-1/0;for(const $ of i){const O=new c.P($.x+Kt,$.y+Kt);p=Math.min(p,O.x),g=Math.min(g,O.y),b=Math.max(b,O.x),E=Math.max(E,O.y),h.push(O)}const I=this.grid.query(p,g,b,E).concat(this.ignoredGrid.query(p,g,b,E)),C={},L={};for(const $ of I){const O=$.key;if(C[O.bucketInstanceId]===void 0&&(C[O.bucketInstanceId]={}),C[O.bucketInstanceId][O.featureIndex])continue;const H=[new c.P($.x1,$.y1),new c.P($.x2,$.y1),new c.P($.x2,$.y2),new c.P($.x1,$.y2)];c.an(h,H)&&(C[O.bucketInstanceId][O.featureIndex]=!0,L[O.bucketInstanceId]===void 0&&(L[O.bucketInstanceId]=[]),L[O.bucketInstanceId].push(O.featureIndex))}return L}insertCollisionBox(i,h,p,g,b,E){(p?this.ignoredGrid:this.grid).insert({bucketInstanceId:g,featureIndex:b,collisionGroupID:E,overlapMode:h},i[0],i[1],i[2],i[3])}insertCollisionCircles(i,h,p,g,b,E){const I=p?this.ignoredGrid:this.grid,C={bucketInstanceId:g,featureIndex:b,collisionGroupID:E,overlapMode:h};for(let L=0;L=this.screenRightBoundary||gthis.screenBottomBoundary}isInsideGrid(i,h,p,g){return p>=0&&i=0&&hthis.projectAndGetPerspectiveRatio(p,Qe.x,Qe.y,g,L));gt=yt.some(Qe=>!Qe.isOccluded),Je=yt.map(Qe=>Qe.point)}else gt=!0;return{box:c.ap(Je),allPointsOccluded:!gt}}}function Xt(v,i,h){return i*(c.X/(v.tileSize*Math.pow(2,h-v.tileID.overscaledZ)))}class Cr{constructor(i,h,p,g){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?h:-h))):g&&p?1:0,this.placed=p}isHidden(){return this.opacity===0&&!this.placed}}class ri{constructor(i,h,p,g,b){this.text=new Cr(i?i.text:null,h,p,b),this.icon=new Cr(i?i.icon:null,h,g,b)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class di{constructor(i,h,p){this.text=i,this.icon=h,this.skipFade=p}}class ir{constructor(){this.invProjMatrix=c.H(),this.viewportMatrix=c.H(),this.circles=[]}}class Sr{constructor(i,h,p,g,b){this.bucketInstanceId=i,this.featureIndex=h,this.sourceLayerIndex=p,this.bucketIndex=g,this.tileID=b}}class Gr{constructor(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}}get(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){const h=++this.maxGroupID;this.collisionGroups[i]={ID:h,predicate:p=>p.collisionGroupID===h}}return this.collisionGroups[i]}}function xi(v,i,h,p,g){const{horizontalAlign:b,verticalAlign:E}=c.av(v);return new c.P(-(b-.5)*i+p[0]*g,-(E-.5)*h+p[1]*g)}class Oi{constructor(i,h,p,g,b,E){this.transform=i.clone(),this.terrain=p,this.collisionIndex=new pr(this.transform,h),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=g,this.retainedQueryData={},this.collisionGroups=new Gr(b),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=E,E&&(E.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(i){const h=this.terrain;return h?(p,g)=>h.getElevation(i,p,g):null}getBucketParts(i,h,p,g){const b=p.getBucket(h),E=p.latestFeatureIndex;if(!b||!E||h.id!==b.layerIds[0])return;const I=p.collisionBoxArray,C=b.layers[0].layout,L=b.layers[0].paint,$=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),O=p.tileSize/c.X,H=p.tileID.toUnwrapped(),K=this.transform.calculatePosMatrix(H),te=C.get("text-pitch-alignment")==="map",se=C.get("text-rotation-alignment")==="map",re=Xt(p,1,this.transform.zoom),ue=this.collisionIndex.mapProjection.translatePosition(this.transform,p,L.get("text-translate"),L.get("text-translate-anchor")),ye=this.collisionIndex.mapProjection.translatePosition(this.transform,p,L.get("icon-translate"),L.get("icon-translate-anchor")),ne=$o(K,te,se,this.transform,re);let xe=null;if(te){const Ce=so(K,te,se,this.transform,re);xe=c.L([],this.transform.labelPlaneMatrix,Ce)}this.retainedQueryData[b.bucketInstanceId]=new Sr(b.bucketInstanceId,E,b.sourceLayerIndex,b.index,p.tileID);const Ie={bucket:b,layout:C,translationText:ue,translationIcon:ye,posMatrix:K,unwrappedTileID:H,textLabelPlaneMatrix:ne,labelToScreenMatrix:xe,scale:$,textPixelRatio:O,holdingForFade:p.holdingForFade(),collisionBoxArray:I,partiallyEvaluatedTextSize:c.ah(b.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(b.sourceID)};if(g)for(const Ce of b.sortKeyRanges){const{sortKey:je,symbolInstanceStart:Je,symbolInstanceEnd:gt}=Ce;i.push({sortKey:je,symbolInstanceStart:Je,symbolInstanceEnd:gt,parameters:Ie})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:b.symbolInstances.length,parameters:Ie})}attemptAnchorPlacement(i,h,p,g,b,E,I,C,L,$,O,H,K,te,se,re,ue,ye,ne){const xe=c.ar[i.textAnchor],Ie=[i.textOffset0,i.textOffset1],Ce=xi(xe,p,g,Ie,b),je=this.collisionIndex.placeCollisionBox(h,H,C,L,$,I,E,re,O.predicate,ne,Ce);if((!ye||this.collisionIndex.placeCollisionBox(ye,H,C,L,$,I,E,ue,O.predicate,ne,Ce).placeable)&&je.placeable){let Je;if(this.prevPlacement&&this.prevPlacement.variableOffsets[K.crossTileID]&&this.prevPlacement.placements[K.crossTileID]&&this.prevPlacement.placements[K.crossTileID].text&&(Je=this.prevPlacement.variableOffsets[K.crossTileID].anchor),K.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[K.crossTileID]={textOffset:Ie,width:p,height:g,anchor:xe,textBoxScale:b,prevAnchor:Je},this.markUsedJustification(te,xe,K,se),te.allowVerticalPlacement&&(this.markUsedOrientation(te,se,K),this.placedOrientations[K.crossTileID]=se),{shift:Ce,placedGlyphBoxes:je}}}placeLayerBucketPart(i,h,p){const{bucket:g,layout:b,translationText:E,translationIcon:I,posMatrix:C,unwrappedTileID:L,textLabelPlaneMatrix:$,labelToScreenMatrix:O,textPixelRatio:H,holdingForFade:K,collisionBoxArray:te,partiallyEvaluatedTextSize:se,collisionGroup:re}=i.parameters,ue=b.get("text-optional"),ye=b.get("icon-optional"),ne=c.as(b,"text-overlap","text-allow-overlap"),xe=ne==="always",Ie=c.as(b,"icon-overlap","icon-allow-overlap"),Ce=Ie==="always",je=b.get("text-rotation-alignment")==="map",Je=b.get("text-pitch-alignment")==="map",gt=b.get("icon-text-fit")!=="none",yt=b.get("symbol-z-order")==="viewport-y",Qe=xe&&(Ce||!g.hasIconData()||ye),it=Ce&&(xe||!g.hasTextData()||ue);!g.collisionArrays&&te&&g.deserializeCollisionBoxes(te);const Et=this._getTerrainElevationFunc(this.retainedQueryData[g.bucketInstanceId].tileID),Ut=(st,ft,jt)=>{var jr,Qt;if(h[st.crossTileID])return;if(K)return void(this.placements[st.crossTileID]=new di(!1,!1,!1));let ar=!1,Vr=!1,ji=!0,jn=null,Ur={box:null,placeable:!1,offscreen:null},fn={box:null,placeable:!1,offscreen:null},en=null,Vi=null,Ui=null,Vn=0,_s=0,Gl=0;ft.textFeatureIndex?Vn=ft.textFeatureIndex:st.useRuntimeCollisionCircles&&(Vn=st.featureIndex),ft.verticalTextFeatureIndex&&(_s=ft.verticalTextFeatureIndex);const Xs=ft.textBox;if(Xs){const Li=qi=>{let Gi=c.ai.horizontal;if(g.allowVerticalPlacement&&!qi&&this.prevPlacement){const Ii=this.prevPlacement.placedOrientations[st.crossTileID];Ii&&(this.placedOrientations[st.crossTileID]=Ii,Gi=Ii,this.markUsedOrientation(g,Gi,st))}return Gi},Un=(qi,Gi)=>{if(g.allowVerticalPlacement&&st.numVerticalGlyphVertices>0&&ft.verticalTextBox){for(const Ii of g.writingModes)if(Ii===c.ai.vertical?(Ur=Gi(),fn=Ur):Ur=qi(),Ur&&Ur.placeable)break}else Ur=qi()},Zo=st.textAnchorOffsetStartIndex,Js=st.textAnchorOffsetEndIndex;if(Js===Zo){const qi=(Gi,Ii)=>{const Wr=this.collisionIndex.placeCollisionBox(Gi,ne,H,C,L,Je,je,E,re.predicate,Et);return Wr&&Wr.placeable&&(this.markUsedOrientation(g,Ii,st),this.placedOrientations[st.crossTileID]=Ii),Wr};Un(()=>qi(Xs,c.ai.horizontal),()=>{const Gi=ft.verticalTextBox;return g.allowVerticalPlacement&&st.numVerticalGlyphVertices>0&&Gi?qi(Gi,c.ai.vertical):{box:null,offscreen:null}}),Li(Ur&&Ur.placeable)}else{let qi=c.ar[(Qt=(jr=this.prevPlacement)===null||jr===void 0?void 0:jr.variableOffsets[st.crossTileID])===null||Qt===void 0?void 0:Qt.anchor];const Gi=(Wr,Ks,zu)=>{const wi=Wr.x2-Wr.x1,bf=Wr.y2-Wr.y1,Hl=st.textBoxScale,Wl=gt&&Ie==="never"?Ks:null;let Ho=null,xf=ne==="never"?1:2,Lu="never";qi&&xf++;for(let Du=0;DuGi(Xs,ft.iconBox,c.ai.horizontal),()=>{const Wr=ft.verticalTextBox;return g.allowVerticalPlacement&&(!Ur||!Ur.placeable)&&st.numVerticalGlyphVertices>0&&Wr?Gi(Wr,ft.verticalIconBox,c.ai.vertical):{box:null,occluded:!0,offscreen:null}}),Ur&&(ar=Ur.placeable,ji=Ur.offscreen);const Ii=Li(Ur&&Ur.placeable);if(!ar&&this.prevPlacement){const Wr=this.prevPlacement.variableOffsets[st.crossTileID];Wr&&(this.variableOffsets[st.crossTileID]=Wr,this.markUsedJustification(g,Wr.anchor,st,Ii))}}}if(en=Ur,ar=en&&en.placeable,ji=en&&en.offscreen,st.useRuntimeCollisionCircles){const Li=g.text.placedSymbolArray.get(st.centerJustifiedTextSymbolIndex),Un=c.aj(g.textSizeData,se,Li),Zo=b.get("text-padding");Vi=this.collisionIndex.placeCollisionCircles(ne,Li,g.lineVertexArray,g.glyphOffsetArray,Un,C,L,$,O,p,Je,re.predicate,st.collisionCircleDiameter,Zo,E,Et),Vi.circles.length&&Vi.collisionDetected&&!p&&c.w("Collisions detected, but collision boxes are not shown"),ar=xe||Vi.circles.length>0&&!Vi.collisionDetected,ji=ji&&Vi.offscreen}if(ft.iconFeatureIndex&&(Gl=ft.iconFeatureIndex),ft.iconBox){const Li=Un=>this.collisionIndex.placeCollisionBox(Un,Ie,H,C,L,Je,je,I,re.predicate,Et,gt&&jn?jn:void 0);fn&&fn.placeable&&ft.verticalIconBox?(Ui=Li(ft.verticalIconBox),Vr=Ui.placeable):(Ui=Li(ft.iconBox),Vr=Ui.placeable),ji=ji&&Ui.offscreen}const vs=ue||st.numHorizontalGlyphVertices===0&&st.numVerticalGlyphVertices===0,Zl=ye||st.numIconVertices===0;vs||Zl?Zl?vs||(Vr=Vr&&ar):ar=Vr&&ar:Vr=ar=Vr&&ar;const Au=Vr&&Ui.placeable;if(ar&&en.placeable&&this.collisionIndex.insertCollisionBox(en.box,ne,b.get("text-ignore-placement"),g.bucketInstanceId,fn&&fn.placeable&&_s?_s:Vn,re.ID),Au&&this.collisionIndex.insertCollisionBox(Ui.box,Ie,b.get("icon-ignore-placement"),g.bucketInstanceId,Gl,re.ID),Vi&&ar&&this.collisionIndex.insertCollisionCircles(Vi.circles,ne,b.get("text-ignore-placement"),g.bucketInstanceId,Vn,re.ID),p&&this.storeCollisionData(g.bucketInstanceId,jt,ft,en,Ui,Vi),st.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(g.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[st.crossTileID]=new di(ar||Qe,Vr||it,ji||g.justReloaded),h[st.crossTileID]=!0};if(yt){if(i.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const st=g.getSortedSymbolIndexes(this.transform.angle);for(let ft=st.length-1;ft>=0;--ft){const jt=st[ft];Ut(g.symbolInstances.get(jt),g.collisionArrays[jt],jt)}}else for(let st=i.symbolInstanceStart;st=0&&(i.text.placedSymbolArray.get(I).crossTileID=b>=0&&I!==b?0:p.crossTileID)}markUsedOrientation(i,h,p){const g=h===c.ai.horizontal||h===c.ai.horizontalOnly?h:0,b=h===c.ai.vertical?h:0,E=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];for(const I of E)i.text.placedSymbolArray.get(I).placedOrientation=g;p.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(p.verticalPlacedTextSymbolIndex).placedOrientation=b)}commit(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let p=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const g=h?h.symbolFadeChange(i):1,b=h?h.opacities:{},E=h?h.variableOffsets:{},I=h?h.placedOrientations:{};for(const C in this.placements){const L=this.placements[C],$=b[C];$?(this.opacities[C]=new ri($,g,L.text,L.icon),p=p||L.text!==$.text.placed||L.icon!==$.icon.placed):(this.opacities[C]=new ri(null,g,L.text,L.icon,L.skipFade),p=p||L.text||L.icon)}for(const C in b){const L=b[C];if(!this.opacities[C]){const $=new ri(L,g,!1,!1);$.isHidden()||(this.opacities[C]=$,p=p||L.text.placed||L.icon.placed)}}for(const C in E)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=E[C]);for(const C in I)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=I[C]);if(h&&h.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");p?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:i)}updateLayerOpacities(i,h){const p={};for(const g of h){const b=g.getBucket(i);b&&g.latestFeatureIndex&&i.id===b.layerIds[0]&&this.updateBucketOpacities(b,g.tileID,p,g.collisionBoxArray)}}updateBucketOpacities(i,h,p,g){i.hasTextData()&&(i.text.opacityVertexArray.clear(),i.text.hasVisibleVertices=!1),i.hasIconData()&&(i.icon.opacityVertexArray.clear(),i.icon.hasVisibleVertices=!1),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();const b=i.layers[0],E=b.layout,I=new ri(null,0,!1,!1,!0),C=E.get("text-allow-overlap"),L=E.get("icon-allow-overlap"),$=b._unevaluatedLayout.hasValue("text-variable-anchor")||b._unevaluatedLayout.hasValue("text-variable-anchor-offset"),O=E.get("text-rotation-alignment")==="map",H=E.get("text-pitch-alignment")==="map",K=E.get("icon-text-fit")!=="none",te=new ri(null,0,C&&(L||!i.hasIconData()||E.get("icon-optional")),L&&(C||!i.hasTextData()||E.get("text-optional")),!0);!i.collisionArrays&&g&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(g);const se=(ue,ye,ne)=>{for(let xe=0;xe0,Je=this.placedOrientations[ye.crossTileID],gt=Je===c.ai.vertical,yt=Je===c.ai.horizontal||Je===c.ai.horizontalOnly;if(ne>0||xe>0){const it=Sn(Ce.text);se(i.text,ne,gt?Ni:it),se(i.text,xe,yt?Ni:it);const Et=Ce.text.isHidden();[ye.rightJustifiedTextSymbolIndex,ye.centerJustifiedTextSymbolIndex,ye.leftJustifiedTextSymbolIndex].forEach(ft=>{ft>=0&&(i.text.placedSymbolArray.get(ft).hidden=Et||gt?1:0)}),ye.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ye.verticalPlacedTextSymbolIndex).hidden=Et||yt?1:0);const Ut=this.variableOffsets[ye.crossTileID];Ut&&this.markUsedJustification(i,Ut.anchor,ye,Je);const st=this.placedOrientations[ye.crossTileID];st&&(this.markUsedJustification(i,"left",ye,st),this.markUsedOrientation(i,st,ye))}if(je){const it=Sn(Ce.icon),Et=!(K&&ye.verticalPlacedIconSymbolIndex&>);ye.placedIconSymbolIndex>=0&&(se(i.icon,ye.numIconVertices,Et?it:Ni),i.icon.placedSymbolArray.get(ye.placedIconSymbolIndex).hidden=Ce.icon.isHidden()),ye.verticalPlacedIconSymbolIndex>=0&&(se(i.icon,ye.numVerticalIconVertices,Et?Ni:it),i.icon.placedSymbolArray.get(ye.verticalPlacedIconSymbolIndex).hidden=Ce.icon.isHidden())}const Qe=re&&re.has(ue)?re.get(ue):{text:null,icon:null};if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){const it=i.collisionArrays[ue];if(it){let Et=new c.P(0,0);if(it.textBox||it.verticalTextBox){let Ut=!0;if($){const st=this.variableOffsets[Ie];st?(Et=xi(st.anchor,st.width,st.height,st.textOffset,st.textBoxScale),O&&Et._rotate(H?this.transform.angle:-this.transform.angle)):Ut=!1}if(it.textBox||it.verticalTextBox){let st;it.textBox&&(st=gt),it.verticalTextBox&&(st=yt),$i(i.textCollisionBox.collisionVertexArray,Ce.text.placed,!Ut||st,Qe.text,Et.x,Et.y)}}if(it.iconBox||it.verticalIconBox){const Ut=!!(!yt&&it.verticalIconBox);let st;it.iconBox&&(st=Ut),it.verticalIconBox&&(st=!Ut),$i(i.iconCollisionBox.collisionVertexArray,Ce.icon.placed,st,Qe.icon,K?Et.x:0,K?Et.y:0)}}}}if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.text.opacityVertexArray.length!==i.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${i.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${i.text.layoutVertexArray.length}) / 4`);if(i.icon.opacityVertexArray.length!==i.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${i.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${i.icon.layoutVertexArray.length}) / 4`);if(i.bucketInstanceId in this.collisionCircleArrays){const ue=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=ue.invProjMatrix,i.placementViewportMatrix=ue.viewportMatrix,i.collisionCircleArray=ue.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}}symbolFadeChange(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(i){return Math.max(0,(this.transform.zoom-i)/1.5)}hasTransitions(i){return this.stale||i-this.lastPlacementChangeTimei}setStale(){this.stale=!0}}function $i(v,i,h,p,g,b){p&&p.length!==0||(p=[0,0,0,0]);const E=p[0]-Kt,I=p[1]-Kt,C=p[2]-Kt,L=p[3]-Kt;v.emplaceBack(i?1:0,h?1:0,g||0,b||0,E,I),v.emplaceBack(i?1:0,h?1:0,g||0,b||0,C,I),v.emplaceBack(i?1:0,h?1:0,g||0,b||0,C,L),v.emplaceBack(i?1:0,h?1:0,g||0,b||0,E,L)}const Ma=Math.pow(2,25),kr=Math.pow(2,24),Oc=Math.pow(2,17),$c=Math.pow(2,16),xn=Math.pow(2,9),wn=Math.pow(2,8),pp=Math.pow(2,1);function Sn(v){if(v.opacity===0&&!v.placed)return 0;if(v.opacity===1&&v.placed)return 4294967295;const i=v.placed?1:0,h=Math.floor(127*v.opacity);return h*Ma+i*kr+h*Oc+i*$c+h*xn+i*wn+h*pp+i}const Ni=0;function ml(){return{isOccluded:(v,i,h)=>!1,getPitchedTextCorrection:(v,i,h)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(v,i,h,p){throw new Error("Not implemented.")},translatePosition:(v,i,h,p)=>function(g,b,E,I,C=!1){if(!E[0]&&!E[1])return[0,0];const L=C?I==="map"?g.angle:0:I==="viewport"?-g.angle:0;if(L){const $=Math.sin(L),O=Math.cos(L);E=[E[0]*O-E[1]*$,E[0]*$+E[1]*O]}return[C?E[0]:Xt(b,E[0],g.zoom),C?E[1]:Xt(b,E[1],g.zoom)]}(v,i,h,p),getCircleRadiusCorrection:v=>1}}class Ia{constructor(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&!i.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(i,h,p,g,b){const E=this._bucketParts;for(;this._currentTileIndexI.sortKey-C.sortKey));this._currentPartIndex!this._forceFullPlacement&&k.now()-g>2;for(;this._currentPlacementIndex>=0;){const E=h[i[this._currentPlacementIndex]],I=this.placement.collisionIndex.transform.zoom;if(E.type==="symbol"&&(!E.minzoom||E.minzoom<=I)&&(!E.maxzoom||E.maxzoom>I)){if(this._inProgressLayer||(this._inProgressLayer=new Ia(E)),this._inProgressLayer.continuePlacement(p[E.source],this.placement,this._showCollisionBoxes,E,b))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(i){return this.placement.commit(i),this.placement}}const ko=512/c.X/2;class ls{constructor(i,h,p){this.tileID=i,this.bucketInstanceId=p,this._symbolsByKey={};const g=new Map;for(let b=0;b({x:Math.floor(C.anchorX*ko),y:Math.floor(C.anchorY*ko)})),crossTileIDs:E.map(C=>C.crossTileID)};if(I.positions.length>128){const C=new c.aw(I.positions.length,16,Uint16Array);for(const{x:L,y:$}of I.positions)C.add(L,$);C.finish(),delete I.positions,I.index=C}this._symbolsByKey[b]=I}}getScaledCoordinates(i,h){const{x:p,y:g,z:b}=this.tileID.canonical,{x:E,y:I,z:C}=h.canonical,L=ko/Math.pow(2,C-b),$=(I*c.X+i.anchorY)*L,O=g*c.X*ko;return{x:Math.floor((E*c.X+i.anchorX)*L-p*c.X*ko),y:Math.floor($-O)}}findMatches(i,h,p){const g=this.tileID.canonical.zi)}}class ci{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class gl{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(i){const h=Math.round((i-this.lng)/360);if(h!==0)for(const p in this.indexes){const g=this.indexes[p],b={};for(const E in g){const I=g[E];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+h),b[I.tileID.key]=I}this.indexes[p]=b}this.lng=i}addBucket(i,h,p){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(let b=0;bi.overscaledZ)for(const I in E){const C=E[I];C.tileID.isChildOf(i)&&C.findMatches(h.symbolInstances,i,g)}else{const I=E[i.scaledTo(Number(b)).key];I&&I.findMatches(h.symbolInstances,i,g)}}for(let b=0;b{h[p]=!0});for(const p in this.layerIndexes)h[p]||delete this.layerIndexes[p]}}const Ta=(v,i)=>c.t(v,i&&i.filter(h=>h.identifier!=="source.canvas")),No=c.ax();class Nc extends c.E{constructor(i,h={}){super(),this._rtlPluginLoaded=()=>{for(const p in this.sourceCaches){const g=this.sourceCaches[p].getSource().type;g!=="vector"&&g!=="geojson"||this.sourceCaches[p].reload()}},this.map=i,this.dispatcher=new cr(ni(),i._getMapId()),this.dispatcher.registerMessageHandler("GG",(p,g)=>this.getGlyphs(p,g)),this.dispatcher.registerMessageHandler("GI",(p,g)=>this.getImages(p,g)),this.imageManager=new at,this.imageManager.setEventedParent(this),this.glyphManager=new Ue(i._requestManager,h.localIdeographFontFamily),this.lineAtlas=new wr(256,512),this.crossTileSymbolIndex=new Dn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",c.az()),no().on(nt,this._rtlPluginLoaded),this.on("data",p=>{if(p.dataType!=="source"||p.sourceDataType!=="metadata")return;const g=this.sourceCaches[p.sourceId];if(!g)return;const b=g.getSource();if(b&&b.vectorLayerIds)for(const E in this._layers){const I=this._layers[E];I.source===b.id&&this._validateLayer(I)}})}loadURL(i,h={},p){this.fire(new c.k("dataloading",{dataType:"style"})),h.validate=typeof h.validate!="boolean"||h.validate;const g=this.map._requestManager.transformRequest(i,"Style");this._loadStyleRequest=new AbortController,c.h(g,this._loadStyleRequest).then(b=>{this._loadStyleRequest=null,this._load(b.data,h,p)}).catch(b=>{this._loadStyleRequest=null,b&&this.fire(new c.j(b))})}loadJSON(i,h={},p){this.fire(new c.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,k.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,h.validate=h.validate!==!1,this._load(i,h,p)}).catch(()=>{})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(No,{validate:!1})}_load(i,h,p){var g;const b=h.transformStyle?h.transformStyle(p,i):i;if(!h.validate||!Ta(this,c.x(b))){this._loaded=!0,this.stylesheet=b;for(const E in b.sources)this.addSource(E,b.sources[E],{validate:!1});b.sprite?this._loadSprite(b.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(b.glyphs),this._createLayers(),this.light=new Gt(this.stylesheet.light),this.sky=new Jt(this.stylesheet.sky),this.map.setTerrain((g=this.stylesheet.terrain)!==null&&g!==void 0?g:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const i=c.aA(this.stylesheet.layers);this.dispatcher.broadcast("SL",i),this._order=i.map(h=>h.id),this._layers={},this._serializedLayers=null;for(const h of i){const p=c.aB(h);p.setEventedParent(this,{layer:{id:h.id}}),this._layers[h.id]=p}}_loadSprite(i,h=!1,p=void 0){let g;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(b,E,I,C){return c._(this,void 0,void 0,function*(){const L=$e(b),$=I>1?"@2x":"",O={},H={};for(const{id:K,url:te}of L){const se=E.transformRequest(Ye(te,$,".json"),"SpriteJSON");O[K]=c.h(se,C);const re=E.transformRequest(Ye(te,$,".png"),"SpriteImage");H[K]=V.getImage(re,C)}return yield Promise.all([...Object.values(O),...Object.values(H)]),function(K,te){return c._(this,void 0,void 0,function*(){const se={};for(const re in K){se[re]={};const ue=k.getImageCanvasContext((yield te[re]).data),ye=(yield K[re]).data;for(const ne in ye){const{width:xe,height:Ie,x:Ce,y:je,sdf:Je,pixelRatio:gt,stretchX:yt,stretchY:Qe,content:it,textFitWidth:Et,textFitHeight:Ut}=ye[ne];se[re][ne]={data:null,pixelRatio:gt,sdf:Je,stretchX:yt,stretchY:Qe,content:it,textFitWidth:Et,textFitHeight:Ut,spriteData:{width:xe,height:Ie,x:Ce,y:je,context:ue}}}}return se})}(O,H)})}(i,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(b=>{if(this._spriteRequest=null,b)for(const E in b){this._spritesImagesIds[E]=[];const I=this._spritesImagesIds[E]?this._spritesImagesIds[E].filter(C=>!(C in b)):[];for(const C of I)this.imageManager.removeImage(C),this._changedImages[C]=!0;for(const C in b[E]){const L=E==="default"?C:`${E}:${C}`;this._spritesImagesIds[E].push(L),L in this.imageManager.images?this.imageManager.updateImage(L,b[E][C],!1):this.imageManager.addImage(L,b[E][C]),h&&(this._changedImages[L]=!0)}}}).catch(b=>{this._spriteRequest=null,g=b,this.fire(new c.j(g))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),p&&p(g)})}_unloadSprite(){for(const i of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(i),this._changedImages[i]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(i){const h=this.sourceCaches[i.source];if(!h)return;const p=i.sourceLayer;if(!p)return;const g=h.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(p)===-1)&&this.fire(new c.j(new Error(`Source layer "${p}" does not exist on source "${g.id}" as specified by style layer "${i.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const i in this.sourceCaches)if(!this.sourceCaches[i].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(i){const h=this._serializedAllLayers();if(!i||i.length===0)return Object.values(h);const p=[];for(const g of i)h[g]&&p.push(h[g]);return p}_serializedAllLayers(){let i=this._serializedLayers;if(i)return i;i=this._serializedLayers={};const h=Object.keys(this._layers);for(const p of h){const g=this._layers[p];g.type!=="custom"&&(i[p]=g.serialize())}return i}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const i in this.sourceCaches)if(this.sourceCaches[i].hasTransition())return!0;for(const i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(i){if(!this._loaded)return;const h=this._changed;if(h){const g=Object.keys(this._updatedLayers),b=Object.keys(this._removedLayers);(g.length||b.length)&&this._updateWorkerLayers(g,b);for(const E in this._updatedSources){const I=this._updatedSources[E];if(I==="reload")this._reloadSource(E);else{if(I!=="clear")throw new Error(`Invalid action ${I}`);this._clearSource(E)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const E in this._updatedPaintProps)this._layers[E].updateTransitions(i);this.light.updateTransitions(i),this.sky.updateTransitions(i),this._resetUpdates()}const p={};for(const g in this.sourceCaches){const b=this.sourceCaches[g];p[g]=b.used,b.used=!1}for(const g of this._order){const b=this._layers[g];b.recalculate(i,this._availableImages),!b.isHidden(i.zoom)&&b.source&&(this.sourceCaches[b.source].used=!0)}for(const g in p){const b=this.sourceCaches[g];!!p[g]!=!!b.used&&b.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(i),this.sky.recalculate(i),this.z=i.zoom,h&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const i=Object.keys(this._changedImages);if(i.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],i);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const i in this.sourceCaches)this.sourceCaches[i].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(i,h){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(i),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(i,h={}){var p;this._checkLoaded();const g=this.serialize();if(i=h.transformStyle?h.transformStyle(g,i):i,((p=h.validate)===null||p===void 0||p)&&Ta(this,c.x(i)))return!1;(i=c.aC(i)).layers=c.aA(i.layers);const b=c.aD(g,i),E=this._getOperationsToPerform(b);if(E.unimplemented.length>0)throw new Error(`Unimplemented: ${E.unimplemented.join(", ")}.`);if(E.operations.length===0)return!1;for(const I of E.operations)I();return this.stylesheet=i,this._serializedLayers=null,!0}_getOperationsToPerform(i){const h=[],p=[];for(const g of i)switch(g.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":h.push(()=>this.addLayer.apply(this,g.args));break;case"removeLayer":h.push(()=>this.removeLayer.apply(this,g.args));break;case"setPaintProperty":h.push(()=>this.setPaintProperty.apply(this,g.args));break;case"setLayoutProperty":h.push(()=>this.setLayoutProperty.apply(this,g.args));break;case"setFilter":h.push(()=>this.setFilter.apply(this,g.args));break;case"addSource":h.push(()=>this.addSource.apply(this,g.args));break;case"removeSource":h.push(()=>this.removeSource.apply(this,g.args));break;case"setLayerZoomRange":h.push(()=>this.setLayerZoomRange.apply(this,g.args));break;case"setLight":h.push(()=>this.setLight.apply(this,g.args));break;case"setGeoJSONSourceData":h.push(()=>this.setGeoJSONSourceData.apply(this,g.args));break;case"setGlyphs":h.push(()=>this.setGlyphs.apply(this,g.args));break;case"setSprite":h.push(()=>this.setSprite.apply(this,g.args));break;case"setSky":h.push(()=>this.setSky.apply(this,g.args));break;case"setTerrain":h.push(()=>this.map.setTerrain.apply(this,g.args));break;case"setTransition":h.push(()=>{});break;default:p.push(g.command)}return{operations:h,unimplemented:p}}addImage(i,h){if(this.getImage(i))return this.fire(new c.j(new Error(`An image named "${i}" already exists.`)));this.imageManager.addImage(i,h),this._afterImageUpdated(i)}updateImage(i,h){this.imageManager.updateImage(i,h)}getImage(i){return this.imageManager.getImage(i)}removeImage(i){if(!this.getImage(i))return this.fire(new c.j(new Error(`An image named "${i}" does not exist.`)));this.imageManager.removeImage(i),this._afterImageUpdated(i)}_afterImageUpdated(i){this._availableImages=this.imageManager.listImages(),this._changedImages[i]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(i,h,p={}){if(this._checkLoaded(),this.sourceCaches[i]!==void 0)throw new Error(`Source "${i}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(c.x.source,`sources.${i}`,h,null,p))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const g=this.sourceCaches[i]=new Nt(i,h,this.dispatcher);g.style=this,g.setEventedParent(this,()=>({isSourceLoaded:g.loaded(),source:g.serialize(),sourceId:i})),g.onAdd(this.map),this._changed=!0}removeSource(i){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error("There is no source with this ID");for(const p in this._layers)if(this._layers[p].source===i)return this.fire(new c.j(new Error(`Source "${i}" cannot be removed while layer "${p}" is using it.`)));const h=this.sourceCaches[i];delete this.sourceCaches[i],delete this._updatedSources[i],h.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:i})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(i,h){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error(`There is no source with this ID=${i}`);const p=this.sourceCaches[i].getSource();if(p.type!=="geojson")throw new Error(`geojsonSource.type is ${p.type}, which is !== 'geojson`);p.setData(h),this._changed=!0}getSource(i){return this.sourceCaches[i]&&this.sourceCaches[i].getSource()}addLayer(i,h,p={}){this._checkLoaded();const g=i.id;if(this.getLayer(g))return void this.fire(new c.j(new Error(`Layer "${g}" already exists on this map.`)));let b;if(i.type==="custom"){if(Ta(this,c.aE(i)))return;b=c.aB(i)}else{if("source"in i&&typeof i.source=="object"&&(this.addSource(g,i.source),i=c.aC(i),i=c.e(i,{source:g})),this._validate(c.x.layer,`layers.${g}`,i,{arrayIndex:-1},p))return;b=c.aB(i),this._validateLayer(b),b.setEventedParent(this,{layer:{id:g}})}const E=h?this._order.indexOf(h):this._order.length;if(h&&E===-1)this.fire(new c.j(new Error(`Cannot add layer "${g}" before non-existing layer "${h}".`)));else{if(this._order.splice(E,0,g),this._layerOrderChanged=!0,this._layers[g]=b,this._removedLayers[g]&&b.source&&b.type!=="custom"){const I=this._removedLayers[g];delete this._removedLayers[g],I.type!==b.type?this._updatedSources[b.source]="clear":(this._updatedSources[b.source]="reload",this.sourceCaches[b.source].pause())}this._updateLayer(b),b.onAdd&&b.onAdd(this.map)}}moveLayer(i,h){if(this._checkLoaded(),this._changed=!0,!this._layers[i])return void this.fire(new c.j(new Error(`The layer '${i}' does not exist in the map's style and cannot be moved.`)));if(i===h)return;const p=this._order.indexOf(i);this._order.splice(p,1);const g=h?this._order.indexOf(h):this._order.length;h&&g===-1?this.fire(new c.j(new Error(`Cannot move layer "${i}" before non-existing layer "${h}".`))):(this._order.splice(g,0,i),this._layerOrderChanged=!0)}removeLayer(i){this._checkLoaded();const h=this._layers[i];if(!h)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${i}".`)));h.setEventedParent(null);const p=this._order.indexOf(i);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[i]=h,delete this._layers[i],this._serializedLayers&&delete this._serializedLayers[i],delete this._updatedLayers[i],delete this._updatedPaintProps[i],h.onRemove&&h.onRemove(this.map)}getLayer(i){return this._layers[i]}getLayersOrder(){return[...this._order]}hasLayer(i){return i in this._layers}setLayerZoomRange(i,h,p){this._checkLoaded();const g=this.getLayer(i);g?g.minzoom===h&&g.maxzoom===p||(h!=null&&(g.minzoom=h),p!=null&&(g.maxzoom=p),this._updateLayer(g)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${i}".`)))}setFilter(i,h,p={}){this._checkLoaded();const g=this.getLayer(i);if(g){if(!c.aF(g.filter,h))return h==null?(g.filter=void 0,void this._updateLayer(g)):void(this._validate(c.x.filter,`layers.${g.id}.filter`,h,null,p)||(g.filter=c.aC(h),this._updateLayer(g)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${i}".`)))}getFilter(i){return c.aC(this.getLayer(i).filter)}setLayoutProperty(i,h,p,g={}){this._checkLoaded();const b=this.getLayer(i);b?c.aF(b.getLayoutProperty(h),p)||(b.setLayoutProperty(h,p,g),this._updateLayer(b)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${i}".`)))}getLayoutProperty(i,h){const p=this.getLayer(i);if(p)return p.getLayoutProperty(h);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${i}".`)))}setPaintProperty(i,h,p,g={}){this._checkLoaded();const b=this.getLayer(i);b?c.aF(b.getPaintProperty(h),p)||(b.setPaintProperty(h,p,g)&&this._updateLayer(b),this._changed=!0,this._updatedPaintProps[i]=!0,this._serializedLayers=null):this.fire(new c.j(new Error(`Cannot style non-existing layer "${i}".`)))}getPaintProperty(i,h){return this.getLayer(i).getPaintProperty(h)}setFeatureState(i,h){this._checkLoaded();const p=i.source,g=i.sourceLayer,b=this.sourceCaches[p];if(b===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const E=b.getSource().type;E==="geojson"&&g?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):E!=="vector"||g?(i.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),b.setFeatureState(g,i.id,h)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(i,h){this._checkLoaded();const p=i.source,g=this.sourceCaches[p];if(g===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const b=g.getSource().type,E=b==="vector"?i.sourceLayer:void 0;b!=="vector"||E?h&&typeof i.id!="string"&&typeof i.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(E,i.id,h):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(i){this._checkLoaded();const h=i.source,p=i.sourceLayer,g=this.sourceCaches[h];if(g!==void 0)return g.getSource().type!=="vector"||p?(i.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),g.getFeatureState(p,i.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const i=c.aG(this.sourceCaches,b=>b.serialize()),h=this._serializeByIds(this._order),p=this.map.getTerrain()||void 0,g=this.stylesheet;return c.aH({version:g.version,name:g.name,metadata:g.metadata,light:g.light,sky:g.sky,center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch,sprite:g.sprite,glyphs:g.glyphs,transition:g.transition,sources:i,layers:h,terrain:p},b=>b!==void 0)}_updateLayer(i){this._updatedLayers[i.id]=!0,i.source&&!this._updatedSources[i.source]&&this.sourceCaches[i.source].getSource().type!=="raster"&&(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(i){const h=E=>this._layers[E].type==="fill-extrusion",p={},g=[];for(let E=this._order.length-1;E>=0;E--){const I=this._order[E];if(h(I)){p[I]=E;for(const C of i){const L=C[I];if(L)for(const $ of L)g.push($)}}}g.sort((E,I)=>I.intersectionZ-E.intersectionZ);const b=[];for(let E=this._order.length-1;E>=0;E--){const I=this._order[E];if(h(I))for(let C=g.length-1;C>=0;C--){const L=g[C].feature;if(p[L.layer.id]{const Je=ue.featureSortOrder;if(Je){const gt=Je.indexOf(Ce.featureIndex);return Je.indexOf(je.featureIndex)-gt}return je.featureIndex-Ce.featureIndex});for(const Ce of Ie)xe.push(Ce)}}for(const ue in te)te[ue].forEach(ye=>{const ne=ye.feature,xe=L[I[ue].source].getFeatureState(ne.layer["source-layer"],ne.id);ne.source=ne.layer.source,ne.layer["source-layer"]&&(ne.sourceLayer=ne.layer["source-layer"]),ne.state=xe});return te}(this._layers,E,this.sourceCaches,i,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(b)}querySourceFeatures(i,h){h&&h.filter&&this._validate(c.x.filter,"querySourceFeatures.filter",h.filter,null,h);const p=this.sourceCaches[i];return p?function(g,b){const E=g.getRenderableIds().map(L=>g.getTileByID(L)),I=[],C={};for(let L=0;LH.getTileByID(K)).sort((K,te)=>te.tileID.overscaledZ-K.tileID.overscaledZ||(K.tileID.isLessThan(te.tileID)?-1:1))}const O=this.crossTileSymbolIndex.addLayer($,C[$.source],i.center.lng);E=E||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((b=b||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(k.now(),i.zoom))&&(this.pauseablePlacement=new pi(i,this.map.terrain,this._order,b,h,p,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(k.now()),I=!0),E&&this.pauseablePlacement.placement.setStale()),I||E)for(const L of this._order){const $=this._layers[L];$.type==="symbol"&&this.placement.updateLayerOpacities($,C[$.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(k.now())}_releaseSymbolFadeTiles(){for(const i in this.sourceCaches)this.sourceCaches[i].releaseSymbolFadeTiles()}getImages(i,h){return c._(this,void 0,void 0,function*(){const p=yield this.imageManager.getImages(h.icons);this._updateTilesForChangedImages();const g=this.sourceCaches[h.source];return g&&g.setDependencies(h.tileID.key,h.type,h.icons),p})}getGlyphs(i,h){return c._(this,void 0,void 0,function*(){const p=yield this.glyphManager.getGlyphs(h.stacks),g=this.sourceCaches[h.source];return g&&g.setDependencies(h.tileID.key,h.type,[""]),p})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(i,h={}){this._checkLoaded(),i&&this._validate(c.x.glyphs,"glyphs",i,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=i,this.glyphManager.entries={},this.glyphManager.setURL(i))}addSprite(i,h,p={},g){this._checkLoaded();const b=[{id:i,url:h}],E=[...$e(this.stylesheet.sprite),...b];this._validate(c.x.sprite,"sprite",E,null,p)||(this.stylesheet.sprite=E,this._loadSprite(b,!0,g))}removeSprite(i){this._checkLoaded();const h=$e(this.stylesheet.sprite);if(h.find(p=>p.id===i)){if(this._spritesImagesIds[i])for(const p of this._spritesImagesIds[i])this.imageManager.removeImage(p),this._changedImages[p]=!0;h.splice(h.findIndex(p=>p.id===i),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[i],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${i}" doesn't exists on this map.`)))}getSprite(){return $e(this.stylesheet.sprite)}setSprite(i,h={},p){this._checkLoaded(),i&&this._validate(c.x.sprite,"sprite",i,null,h)||(this.stylesheet.sprite=i,i?this._loadSprite(i,!0,p):(this._unloadSprite(),p&&p(null)))}}var Ca=c.Y([{name:"a_pos",type:"Int16",components:2}]);const jo={prelude:_r(`#ifdef GL_ES + */(function(n,e){(function(t,o){n.exports=o()})(vc,function(){var t={},o={};function l(f,c,y){if(o[f]=y,f==="index"){var w="var sharedModule = {}; ("+o.shared+")(sharedModule); ("+o.worker+")(sharedModule);",M={};return o.shared(M),o.index(t,M),typeof window<"u"&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),t}}l("shared",["exports"],function(f){function c(s,r,a,d){return new(a||(a=Promise))(function(m,_){function x(A){try{P(d.next(A))}catch(D){_(D)}}function S(A){try{P(d.throw(A))}catch(D){_(D)}}function P(A){var D;A.done?m(A.value):(D=A.value,D instanceof a?D:new a(function(R){R(D)})).then(x,S)}P((d=d.apply(s,r||[])).next())})}function y(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}typeof SuppressedError=="function"&&SuppressedError;var w=M;function M(s,r){this.x=s,this.y=r}M.prototype={clone:function(){return new M(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,r){return this.clone()._rotateAround(s,r)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var r=s.x-this.x,a=s.y-this.y;return r*r+a*a},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,r){return Math.atan2(this.x*r-this.y*s,this.x*s+this.y*r)},_matMult:function(s){var r=s[2]*this.x+s[3]*this.y;return this.x=s[0]*this.x+s[1]*this.y,this.y=r,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var r=Math.cos(s),a=Math.sin(s),d=a*this.x+r*this.y;return this.x=r*this.x-a*this.y,this.y=d,this},_rotateAround:function(s,r){var a=Math.cos(s),d=Math.sin(s),m=r.y+d*(this.x-r.x)+a*(this.y-r.y);return this.x=r.x+a*(this.x-r.x)-d*(this.y-r.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},M.convert=function(s){return s instanceof M?s:Array.isArray(s)?new M(s[0],s[1]):s};var k=y(w),T=z;function z(s,r,a,d){this.cx=3*s,this.bx=3*(a-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(d-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=r,this.p2x=a,this.p2y=d}z.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,r){if(r===void 0&&(r=1e-6),s<0)return 0;if(s>1)return 1;for(var a=s,d=0;d<8;d++){var m=this.sampleCurveX(a)-s;if(Math.abs(m)m?x=a:S=a,a=.5*(S-x)+x;return a},solve:function(s,r){return this.sampleCurveY(this.solveCurveX(s,r))}};var F=y(T);let B,G;function J(){return B==null&&(B=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),B}function j(){if(G==null&&(G=!1,J())){const r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let d=0;d<5*5;d++){const m=4*d;r.fillStyle=`rgb(${m},${m+1},${m+2})`,r.fillRect(d%5,Math.floor(d/5),1,1)}const a=r.getImageData(0,0,5,5).data;for(let d=0;d<5*5*4;d++)if(d%4!=3&&a[d]!==d){G=!0;break}}}return G||!1}function V(s,r,a,d){const m=new F(s,r,a,d);return _=>m.solve(_)}const me=V(.25,.1,.25,1);function X(s,r,a){return Math.min(a,Math.max(r,s))}function pe(s,r,a){const d=a-r,m=((s-r)%d+d)%d+r;return m===r?a:m}function Ee(s,...r){for(const a of r)for(const d in a)s[d]=a[d];return s}let Pe=1;function $e(s,r,a){const d={};for(const m in s)d[m]=r.call(this,s[m],m,s);return d}function Ye(s,r,a){const d={};for(const m in s)r.call(this,s[m],m,s)&&(d[m]=s[m]);return d}function ve(s){return Array.isArray(s)?s.map(ve):typeof s=="object"&&s?$e(s,ve):s}const We={};function at(s){We[s]||(typeof console<"u"&&console.warn(s),We[s]=!0)}function mt(s,r,a){return(a.y-s.y)*(r.x-s.x)>(r.y-s.y)*(a.x-s.x)}function Ht(s){return typeof WorkerGlobalScope<"u"&&s!==void 0&&s instanceof WorkerGlobalScope}let qt=null;function Ue(s){return typeof ImageBitmap<"u"&&s instanceof ImageBitmap}const Xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Zt(s,r,a,d,m){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const _=new VideoFrame(s,{timestamp:0});try{const x=_==null?void 0:_.format;if(!x||!x.startsWith("BGR")&&!x.startsWith("RGB"))throw new Error(`Unrecognized format ${x}`);const S=x.startsWith("BGR"),P=new Uint8ClampedArray(d*m*4);if(yield _.copyTo(P,function(A,D,R,N,Z){const W=4*Math.max(-D,0),Q=(Math.max(0,R)-R)*N*4+W,ie=4*N,he=Math.max(0,D),ke=Math.max(0,R);return{rect:{x:he,y:ke,width:Math.min(A.width,D+N)-he,height:Math.min(A.height,R+Z)-ke},layout:[{offset:Q,stride:ie}]}}(s,r,a,d,m)),S)for(let A=0;AHt(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ni=function(s,r){if(/:\/\//.test(s.url)&&!/^https?:|^file:/.test(s.url)){const d=ct(s.url);if(d)return d(s,r);if(Ht(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,targetMapId:tr},r)}if(!(/^file:/.test(a=s.url)||/^file:/.test(rr())&&!/^\w+:/.test(a))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(d,m){return c(this,void 0,void 0,function*(){const _=new Request(d.url,{method:d.method||"GET",body:d.body,credentials:d.credentials,headers:d.headers,cache:d.cache,referrer:rr(),signal:m.signal});d.type!=="json"||_.headers.has("Accept")||_.headers.set("Accept","application/json");const x=yield fetch(_);if(!x.ok){const A=yield x.blob();throw new rt(x.status,x.statusText,d.url,A)}let S;S=d.type==="arrayBuffer"||d.type==="image"?x.arrayBuffer():d.type==="json"?x.json():x.text();const P=yield S;if(m.signal.aborted)throw wr();return{data:P,cacheControl:x.headers.get("Cache-Control"),expires:x.headers.get("Expires")}})}(s,r);if(Ht(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,mustQueue:!0,targetMapId:tr},r)}var a;return function(d,m){return new Promise((_,x)=>{var S;const P=new XMLHttpRequest;P.open(d.method||"GET",d.url,!0),d.type!=="arrayBuffer"&&d.type!=="image"||(P.responseType="arraybuffer");for(const A in d.headers)P.setRequestHeader(A,d.headers[A]);d.type==="json"&&(P.responseType="text",!((S=d.headers)===null||S===void 0)&&S.Accept||P.setRequestHeader("Accept","application/json")),P.withCredentials=d.credentials==="include",P.onerror=()=>{x(new Error(P.statusText))},P.onload=()=>{if(!m.signal.aborted)if((P.status>=200&&P.status<300||P.status===0)&&P.response!==null){let A=P.response;if(d.type==="json")try{A=JSON.parse(P.response)}catch(D){return void x(D)}_({data:A,cacheControl:P.getResponseHeader("Cache-Control"),expires:P.getResponseHeader("Expires")})}else{const A=new Blob([P.response],{type:P.getResponseHeader("Content-Type")});x(new rt(P.status,P.statusText,d.url,A))}},m.signal.addEventListener("abort",()=>{P.abort(),x(wr())}),P.send(d.body)})}(s,r)};function cr(s){if(!s||s.indexOf("://")<=0||s.indexOf("data:image/")===0||s.indexOf("blob:")===0)return!0;const r=new URL(s),a=window.location;return r.protocol===a.protocol&&r.host===a.host}function li(s,r,a){a[s]&&a[s].indexOf(r)!==-1||(a[s]=a[s]||[],a[s].push(r))}function Bi(s,r,a){if(a&&a[s]){const d=a[s].indexOf(r);d!==-1&&a[s].splice(d,1)}}class Se{constructor(r,a={}){Ee(this,a),this.type=r}}class Be extends Se{constructor(r,a={}){super("error",Ee({error:r},a))}}class nr{on(r,a){return this._listeners=this._listeners||{},li(r,a,this._listeners),this}off(r,a){return Bi(r,a,this._listeners),Bi(r,a,this._oneTimeListeners),this}once(r,a){return a?(this._oneTimeListeners=this._oneTimeListeners||{},li(r,a,this._oneTimeListeners),this):new Promise(d=>this.once(r,d))}fire(r,a){typeof r=="string"&&(r=new Se(r,a||{}));const d=r.type;if(this.listens(d)){r.target=this;const m=this._listeners&&this._listeners[d]?this._listeners[d].slice():[];for(const S of m)S.call(this,r);const _=this._oneTimeListeners&&this._oneTimeListeners[d]?this._oneTimeListeners[d].slice():[];for(const S of _)Bi(d,S,this._oneTimeListeners),S.call(this,r);const x=this._eventedParent;x&&(Ee(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(r))}else r instanceof Be&&console.error(r.error);return this}listens(r){return this._listeners&&this._listeners[r]&&this._listeners[r].length>0||this._oneTimeListeners&&this._oneTimeListeners[r]&&this._oneTimeListeners[r].length>0||this._eventedParent&&this._eventedParent.listens(r)}setEventedParent(r,a){return this._eventedParent=r,this._eventedParentData=a,this}}var Te={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const Mi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function cn(s,r){const a={};for(const d in s)d!=="ref"&&(a[d]=s[d]);return Mi.forEach(d=>{d in r&&(a[d]=r[d])}),a}function ur(s,r){if(Array.isArray(s)){if(!Array.isArray(r)||s.length!==r.length)return!1;for(let a=0;a`:s.itemType.kind==="value"?"array":`array<${r}>`}return s.kind}const Y=[Oo,lt,er,Nt,un,So,On,q(Wt),$o,so,le];function oe(s,r){if(r.kind==="error")return null;if(s.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!oe(s.itemType,r.itemType))&&(typeof s.N!="number"||s.N===r.N))return null}else{if(s.kind===r.kind)return null;if(s.kind==="value"){for(const a of Y)if(!oe(a,r))return null}}return`Expected ${U(s)} but found ${U(r)} instead.`}function _e(s,r){return r.some(a=>a.kind===s.kind)}function be(s,r){return r.some(a=>a==="null"?s===null:a==="array"?Array.isArray(s):a==="object"?s&&!Array.isArray(s)&&typeof s=="object":a===typeof s)}function Me(s,r){return s.kind==="array"&&r.kind==="array"?s.itemType.kind===r.itemType.kind&&typeof s.N=="number":s.kind===r.kind}const de=.96422,Oe=.82521,Ze=4/29,De=6/29,ot=3*De*De,Ct=De*De*De,Rt=Math.PI/180,Kt=180/Math.PI;function pr(s){return(s%=360)<0&&(s+=360),s}function Xt([s,r,a,d]){let m,_;const x=ri((.2225045*(s=Cr(s))+.7168786*(r=Cr(r))+.0606169*(a=Cr(a)))/1);s===r&&r===a?m=_=x:(m=ri((.4360747*s+.3850649*r+.1430804*a)/de),_=ri((.0139322*s+.0971045*r+.7141733*a)/Oe));const S=116*x-16;return[S<0?0:S,500*(m-x),200*(x-_),d]}function Cr(s){return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}function ri(s){return s>Ct?Math.pow(s,1/3):s/ot+Ze}function di([s,r,a,d]){let m=(s+16)/116,_=isNaN(r)?m:m+r/500,x=isNaN(a)?m:m-a/200;return m=1*Sr(m),_=de*Sr(_),x=Oe*Sr(x),[ir(3.1338561*_-1.6168667*m-.4906146*x),ir(-.9787684*_+1.9161415*m+.033454*x),ir(.0719453*_-.2289914*m+1.4052427*x),d]}function ir(s){return(s=s<=.00304?12.92*s:1.055*Math.pow(s,1/2.4)-.055)<0?0:s>1?1:s}function Sr(s){return s>De?s*s*s:ot*(s-Ze)}function Zr(s){return parseInt(s.padEnd(2,s),16)/255}function xi(s,r){return Oi(r?s/100:s,0,1)}function Oi(s,r,a){return Math.min(Math.max(r,s),a)}function $i(s){return!s.some(Number.isNaN)}const Ma={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class kr{constructor(r,a,d,m=1,_=!0){this.r=r,this.g=a,this.b=d,this.a=m,_||(this.r*=m,this.g*=m,this.b*=m,m||this.overwriteGetter("rgb",[r,a,d,m]))}static parse(r){if(r instanceof kr)return r;if(typeof r!="string")return;const a=function(d){if((d=d.toLowerCase().trim())==="transparent")return[0,0,0,0];const m=Ma[d];if(m){const[x,S,P]=m;return[x/255,S/255,P/255,1]}if(d.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(d)){const x=d.length<6?1:2;let S=1;return[Zr(d.slice(S,S+=x)),Zr(d.slice(S,S+=x)),Zr(d.slice(S,S+=x)),Zr(d.slice(S,S+x)||"ff")]}if(d.startsWith("rgb")){const x=d.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[S,P,A,D,R,N,Z,W,Q,ie,he,ke]=x,ge=[D||" ",Z||" ",ie].join("");if(ge===" "||ge===" /"||ge===",,"||ge===",,,"){const we=[A,N,Q].join(""),Re=we==="%%%"?100:we===""?255:0;if(Re){const He=[Oi(+P/Re,0,1),Oi(+R/Re,0,1),Oi(+W/Re,0,1),he?xi(+he,ke):1];if($i(He))return He}}return}}const _=d.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(_){const[x,S,P,A,D,R,N,Z,W]=_,Q=[P||" ",D||" ",N].join("");if(Q===" "||Q===" /"||Q===",,"||Q===",,,"){const ie=[+S,Oi(+A,0,100),Oi(+R,0,100),Z?xi(+Z,W):1];if($i(ie))return function([he,ke,ge,we]){function Re(He){const ht=(He+he/30)%12,zt=ke*Math.min(ge,1-ge);return ge-zt*Math.max(-1,Math.min(ht-3,9-ht,1))}return he=pr(he),ke/=100,ge/=100,[Re(0),Re(8),Re(4),we]}(ie)}}}(r);return a?new kr(...a,!1):void 0}get rgb(){const{r,g:a,b:d,a:m}=this,_=m||1/0;return this.overwriteGetter("rgb",[r/_,a/_,d/_,m])}get hcl(){return this.overwriteGetter("hcl",function(r){const[a,d,m,_]=Xt(r),x=Math.sqrt(d*d+m*m);return[Math.round(1e4*x)?pr(Math.atan2(m,d)*Kt):NaN,x,a,_]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Xt(this.rgb))}overwriteGetter(r,a){return Object.defineProperty(this,r,{value:a}),a}toString(){const[r,a,d,m]=this.rgb;return`rgba(${[r,a,d].map(_=>Math.round(255*_)).join(",")},${m})`}}kr.black=new kr(0,0,0,1),kr.white=new kr(1,1,1,1),kr.transparent=new kr(0,0,0,0),kr.red=new kr(1,0,0,1);class Oc{constructor(r,a,d){this.sensitivity=r?a?"variant":"case":a?"accent":"base",this.locale=d,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(r,a){return this.collator.compare(r,a)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class $c{constructor(r,a,d,m,_){this.text=r,this.image=a,this.scale=d,this.fontStack=m,this.textColor=_}}class xn{constructor(r){this.sections=r}static fromString(r){return new xn([new $c(r,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(r=>r.text.length!==0||r.image&&r.image.name.length!==0)}static factory(r){return r instanceof xn?r:xn.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}}class wn{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof wn)return r;if(typeof r=="number")return new wn([r,r,r,r]);if(Array.isArray(r)&&!(r.length<1||r.length>4)){for(const a of r)if(typeof a!="number")return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]]}return new wn(r)}}toString(){return JSON.stringify(this.values)}}const pp=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Sn{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof Sn)return r;if(Array.isArray(r)&&!(r.length<1)&&r.length%2==0){for(let a=0;a=0&&s<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof a=="number"&&a>=0&&a<=255?d===void 0||typeof d=="number"&&d>=0&&d<=1?null:`Invalid rgba value [${[s,r,a,d].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof d=="number"?[s,r,a,d]:[s,r,a]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ia(s){if(s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"||s instanceof kr||s instanceof Oc||s instanceof xn||s instanceof wn||s instanceof Sn||s instanceof Ni)return!0;if(Array.isArray(s)){for(const r of s)if(!Ia(r))return!1;return!0}if(typeof s=="object"){for(const r in s)if(!Ia(s[r]))return!1;return!0}return!1}function pi(s){if(s===null)return Oo;if(typeof s=="string")return er;if(typeof s=="boolean")return Nt;if(typeof s=="number")return lt;if(s instanceof kr)return un;if(s instanceof Oc)return oo;if(s instanceof xn)return So;if(s instanceof wn)return $o;if(s instanceof Sn)return le;if(s instanceof Ni)return so;if(Array.isArray(s)){const r=s.length;let a;for(const d of s){const m=pi(d);if(a){if(a===m)continue;a=Wt;break}a=m}return q(a||Wt,r)}return On}function ko(s){const r=typeof s;return s===null?"":r==="string"||r==="number"||r==="boolean"?String(s):s instanceof kr||s instanceof xn||s instanceof wn||s instanceof Sn||s instanceof Ni?s.toString():JSON.stringify(s)}class cs{constructor(r,a){this.type=r,this.value=a}static parse(r,a){if(r.length!==2)return a.error(`'literal' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!Ia(r[1]))return a.error("invalid value");const d=r[1];let m=pi(d);const _=a.expectedType;return m.kind!=="array"||m.N!==0||!_||_.kind!=="array"||typeof _.N=="number"&&_.N!==0||(m=_),new cs(m,d)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ci{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}}const gl={string:er,number:lt,boolean:Nt,object:On};class Dn{constructor(r,a){this.type=r,this.args=a}static parse(r,a){if(r.length<2)return a.error("Expected at least one argument.");let d,m=1;const _=r[0];if(_==="array"){let S,P;if(r.length>2){const A=r[1];if(typeof A!="string"||!(A in gl)||A==="object")return a.error('The item type argument of "array" must be one of string, number, boolean',1);S=gl[A],m++}else S=Wt;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return a.error('The length argument to "array" must be a positive integer literal',2);P=r[2],m++}d=q(S,P)}else{if(!gl[_])throw new Error(`Types doesn't contain name = ${_}`);d=gl[_]}const x=[];for(;mr.outputDefined())}}const Ta={"to-boolean":Nt,"to-color":un,"to-number":lt,"to-string":er};class No{constructor(r,a){this.type=r,this.args=a}static parse(r,a){if(r.length<2)return a.error("Expected at least one argument.");const d=r[0];if(!Ta[d])throw new Error(`Can't parse ${d} as it is not part of the known types`);if((d==="to-boolean"||d==="to-string")&&r.length!==2)return a.error("Expected one argument.");const m=Ta[d],_=[];for(let x=1;x4?`Invalid rbga value ${JSON.stringify(a)}: expected an array containing either three or four numeric values.`:ml(a[0],a[1],a[2],a[3]),!d))return new kr(a[0]/255,a[1]/255,a[2]/255,a[3])}throw new ci(d||`Could not parse color from value '${typeof a=="string"?a:JSON.stringify(a)}'`)}case"padding":{let a;for(const d of this.args){a=d.evaluate(r);const m=wn.parse(a);if(m)return m}throw new ci(`Could not parse padding from value '${typeof a=="string"?a:JSON.stringify(a)}'`)}case"variableAnchorOffsetCollection":{let a;for(const d of this.args){a=d.evaluate(r);const m=Sn.parse(a);if(m)return m}throw new ci(`Could not parse variableAnchorOffsetCollection from value '${typeof a=="string"?a:JSON.stringify(a)}'`)}case"number":{let a=null;for(const d of this.args){if(a=d.evaluate(r),a===null)return 0;const m=Number(a);if(!isNaN(m))return m}throw new ci(`Could not convert ${JSON.stringify(a)} to number.`)}case"formatted":return xn.fromString(ko(this.args[0].evaluate(r)));case"resolvedImage":return Ni.fromString(ko(this.args[0].evaluate(r)));default:return ko(this.args[0].evaluate(r))}}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}const Nc=["Unknown","Point","LineString","Polygon"];class Ca{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Nc[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(r){let a=this._parseColorCache[r];return a||(a=this._parseColorCache[r]=kr.parse(r)),a}}class jo{constructor(r,a,d=[],m,_=new no,x=[]){this.registry=r,this.path=d,this.key=d.map(S=>`[${S}]`).join(""),this.scope=_,this.errors=x,this.expectedType=m,this._isConstant=a}parse(r,a,d,m,_={}){return a?this.concat(a,d,m)._parse(r,_):this._parse(r,_)}_parse(r,a){function d(m,_,x){return x==="assert"?new Dn(_,[m]):x==="coerce"?new No(_,[m]):m}if(r!==null&&typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"||(r=["literal",r]),Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const m=r[0];if(typeof m!="string")return this.error(`Expression name must be a string, but found ${typeof m} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const _=this.registry[m];if(_){let x=_.parse(r,this);if(!x)return null;if(this.expectedType){const S=this.expectedType,P=x.type;if(S.kind!=="string"&&S.kind!=="number"&&S.kind!=="boolean"&&S.kind!=="object"&&S.kind!=="array"||P.kind!=="value")if(S.kind!=="color"&&S.kind!=="formatted"&&S.kind!=="resolvedImage"||P.kind!=="value"&&P.kind!=="string")if(S.kind!=="padding"||P.kind!=="value"&&P.kind!=="number"&&P.kind!=="array")if(S.kind!=="variableAnchorOffsetCollection"||P.kind!=="value"&&P.kind!=="array"){if(this.checkSubtype(S,P))return null}else x=d(x,S,a.typeAnnotation||"coerce");else x=d(x,S,a.typeAnnotation||"coerce");else x=d(x,S,a.typeAnnotation||"coerce");else x=d(x,S,a.typeAnnotation||"assert")}if(!(x instanceof cs)&&x.type.kind!=="resolvedImage"&&this._isConstant(x)){const S=new Ca;try{x=new cs(x.type,x.evaluate(S))}catch(P){return this.error(P.message),null}}return x}return this.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(r===void 0?"'undefined' value invalid. Use null instead.":typeof r=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof r} instead.`)}concat(r,a,d){const m=typeof r=="number"?this.path.concat(r):this.path,_=d?this.scope.concat(d):this.scope;return new jo(this.registry,this._isConstant,m,a||null,_,this.errors)}error(r,...a){const d=`${this.key}${a.map(m=>`[${m}]`).join("")}`;this.errors.push(new Yi(d,r))}checkSubtype(r,a){const d=oe(r,a);return d&&this.error(d),d}}class _r{constructor(r,a){this.type=a.type,this.bindings=[].concat(r),this.result=a}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(const a of this.bindings)r(a[1]);r(this.result)}static parse(r,a){if(r.length<4)return a.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);const d=[];for(let _=1;_=d.length)throw new ci(`Array index out of bounds: ${a} > ${d.length-1}.`);if(a!==Math.floor(a))throw new ci(`Array index must be an integer, but found ${a} instead.`);return d[a]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}}class Aa{constructor(r,a){this.type=Nt,this.needle=r,this.haystack=a}static parse(r,a){if(r.length!==3)return a.error(`Expected 2 arguments, but found ${r.length-1} instead.`);const d=a.parse(r[1],1,Wt),m=a.parse(r[2],2,Wt);return d&&m?_e(d.type,[Nt,er,lt,Oo,Wt])?new Aa(d,m):a.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(d.type)} instead`):null}evaluate(r){const a=this.needle.evaluate(r),d=this.haystack.evaluate(r);if(!d)return!1;if(!be(a,["boolean","string","number","null"]))throw new ci(`Expected first argument to be of type boolean, string, number or null, but found ${U(pi(a))} instead.`);if(!be(d,["string","array"]))throw new ci(`Expected second argument to be of type array or string, but found ${U(pi(d))} instead.`);return d.indexOf(a)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}}class _l{constructor(r,a,d){this.type=lt,this.needle=r,this.haystack=a,this.fromIndex=d}static parse(r,a){if(r.length<=2||r.length>=5)return a.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const d=a.parse(r[1],1,Wt),m=a.parse(r[2],2,Wt);if(!d||!m)return null;if(!_e(d.type,[Nt,er,lt,Oo,Wt]))return a.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(d.type)} instead`);if(r.length===4){const _=a.parse(r[3],3,lt);return _?new _l(d,m,_):null}return new _l(d,m)}evaluate(r){const a=this.needle.evaluate(r),d=this.haystack.evaluate(r);if(!be(a,["boolean","string","number","null"]))throw new ci(`Expected first argument to be of type boolean, string, number or null, but found ${U(pi(a))} instead.`);if(!be(d,["string","array"]))throw new ci(`Expected second argument to be of type array or string, but found ${U(pi(d))} instead.`);if(this.fromIndex){const m=this.fromIndex.evaluate(r);return d.indexOf(a,m)}return d.indexOf(a)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}}class vl{constructor(r,a,d,m,_,x){this.inputType=r,this.type=a,this.input=d,this.cases=m,this.outputs=_,this.otherwise=x}static parse(r,a){if(r.length<5)return a.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return a.error("Expected an even number of arguments.");let d,m;a.expectedType&&a.expectedType.kind!=="value"&&(m=a.expectedType);const _={},x=[];for(let A=2;ANumber.MAX_SAFE_INTEGER)return N.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof W=="number"&&Math.floor(W)!==W)return N.error("Numeric branch labels must be integer values.");if(d){if(N.checkSubtype(d,pi(W)))return null}else d=pi(W);if(_[String(W)]!==void 0)return N.error("Branch labels must be unique.");_[String(W)]=x.length}const Z=a.parse(R,A,m);if(!Z)return null;m=m||Z.type,x.push(Z)}const S=a.parse(r[1],1,Wt);if(!S)return null;const P=a.parse(r[r.length-1],r.length-1,m);return P?S.type.kind!=="value"&&a.concat(1).checkSubtype(d,S.type)?null:new vl(d,m,S,_,x,P):null}evaluate(r){const a=this.input.evaluate(r);return(pi(a)===this.inputType&&this.outputs[this.cases[a]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}}class bl{constructor(r,a,d){this.type=r,this.branches=a,this.otherwise=d}static parse(r,a){if(r.length<4)return a.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!=0)return a.error("Expected an odd number of arguments.");let d;a.expectedType&&a.expectedType.kind!=="value"&&(d=a.expectedType);const m=[];for(let x=1;xa.outputDefined())&&this.otherwise.outputDefined()}}class xl{constructor(r,a,d,m){this.type=r,this.input=a,this.beginIndex=d,this.endIndex=m}static parse(r,a){if(r.length<=2||r.length>=5)return a.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const d=a.parse(r[1],1,Wt),m=a.parse(r[2],2,lt);if(!d||!m)return null;if(!_e(d.type,[q(Wt),er,Wt]))return a.error(`Expected first argument to be of type array or string, but found ${U(d.type)} instead`);if(r.length===4){const _=a.parse(r[3],3,lt);return _?new xl(d.type,d,m,_):null}return new xl(d.type,d,m)}evaluate(r){const a=this.input.evaluate(r),d=this.beginIndex.evaluate(r);if(!be(a,["string","array"]))throw new ci(`Expected first argument to be of type array or string, but found ${U(pi(a))} instead.`);if(this.endIndex){const m=this.endIndex.evaluate(r);return a.slice(d,m)}return a.slice(d)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}}function za(s,r){const a=s.length-1;let d,m,_=0,x=a,S=0;for(;_<=x;)if(S=Math.floor((_+x)/2),d=s[S],m=s[S+1],d<=r){if(S===a||rr))throw new ci("Input is not a number.");x=S-1}return 0}class Os{constructor(r,a,d){this.type=r,this.input=a,this.labels=[],this.outputs=[];for(const[m,_]of d)this.labels.push(m),this.outputs.push(_)}static parse(r,a){if(r.length-1<4)return a.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return a.error("Expected an even number of arguments.");const d=a.parse(r[1],1,lt);if(!d)return null;const m=[];let _=null;a.expectedType&&a.expectedType.kind!=="value"&&(_=a.expectedType);for(let x=1;x=S)return a.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);const R=a.parse(P,D,_);if(!R)return null;_=_||R.type,m.push([S,R])}return new Os(_,d,m)}evaluate(r){const a=this.labels,d=this.outputs;if(a.length===1)return d[0].evaluate(r);const m=this.input.evaluate(r);if(m<=a[0])return d[0].evaluate(r);const _=a.length;return m>=a[_-1]?d[_-1].evaluate(r):d[za(a,m)].evaluate(r)}eachChild(r){r(this.input);for(const a of this.outputs)r(a)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function mp(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var gp=Oh;function Oh(s,r,a,d){this.cx=3*s,this.bx=3*(a-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(d-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=r,this.p2x=a,this.p2y=d}Oh.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,r){if(r===void 0&&(r=1e-6),s<0)return 0;if(s>1)return 1;for(var a=s,d=0;d<8;d++){var m=this.sampleCurveX(a)-s;if(Math.abs(m)m?x=a:S=a,a=.5*(S-x)+x;return a},solve:function(s,r){return this.sampleCurveY(this.solveCurveX(s,r))}};var yp=mp(gp);function Vo(s,r,a){return s+a*(r-s)}function La(s,r,a){return s.map((d,m)=>Vo(d,r[m],a))}const kn={number:Vo,color:function(s,r,a,d="rgb"){switch(d){case"rgb":{const[m,_,x,S]=La(s.rgb,r.rgb,a);return new kr(m,_,x,S,!1)}case"hcl":{const[m,_,x,S]=s.hcl,[P,A,D,R]=r.hcl;let N,Z;if(isNaN(m)||isNaN(P))isNaN(m)?isNaN(P)?N=NaN:(N=P,x!==1&&x!==0||(Z=A)):(N=m,D!==1&&D!==0||(Z=_));else{let ke=P-m;P>m&&ke>180?ke-=360:P180&&(ke+=360),N=m+a*ke}const[W,Q,ie,he]=function([ke,ge,we,Re]){return ke=isNaN(ke)?0:ke*Rt,di([we,Math.cos(ke)*ge,Math.sin(ke)*ge,Re])}([N,Z??Vo(_,A,a),Vo(x,D,a),Vo(S,R,a)]);return new kr(W,Q,ie,he,!1)}case"lab":{const[m,_,x,S]=di(La(s.lab,r.lab,a));return new kr(m,_,x,S,!1)}}},array:La,padding:function(s,r,a){return new wn(La(s.values,r.values,a))},variableAnchorOffsetCollection:function(s,r,a){const d=s.values,m=r.values;if(d.length!==m.length)throw new ci(`Cannot interpolate values of different length. from: ${s.toString()}, to: ${r.toString()}`);const _=[];for(let x=0;xtypeof D!="number"||D<0||D>1))return a.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:A}}}if(r.length-1<4)return a.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return a.error("Expected an even number of arguments.");if(_=a.parse(_,2,lt),!_)return null;const S=[];let P=null;d==="interpolate-hcl"||d==="interpolate-lab"?P=un:a.expectedType&&a.expectedType.kind!=="value"&&(P=a.expectedType);for(let A=0;A=D)return a.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',N);const W=a.parse(R,Z,P);if(!W)return null;P=P||W.type,S.push([D,W])}return Me(P,lt)||Me(P,un)||Me(P,$o)||Me(P,le)||Me(P,q(lt))?new En(P,d,m,_,S):a.error(`Type ${U(P)} is not interpolatable.`)}evaluate(r){const a=this.labels,d=this.outputs;if(a.length===1)return d[0].evaluate(r);const m=this.input.evaluate(r);if(m<=a[0])return d[0].evaluate(r);const _=a.length;if(m>=a[_-1])return d[_-1].evaluate(r);const x=za(a,m),S=En.interpolationFactor(this.interpolation,m,a[x],a[x+1]),P=d[x].evaluate(r),A=d[x+1].evaluate(r);switch(this.operator){case"interpolate":return kn[this.type.kind](P,A,S);case"interpolate-hcl":return kn.color(P,A,S,"hcl");case"interpolate-lab":return kn.color(P,A,S,"lab")}}eachChild(r){r(this.input);for(const a of this.outputs)r(a)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function Da(s,r,a,d){const m=d-a,_=s-a;return m===0?0:r===1?_/m:(Math.pow(r,_)-1)/(Math.pow(r,m)-1)}class wl{constructor(r,a){this.type=r,this.args=a}static parse(r,a){if(r.length<2)return a.error("Expectected at least one argument.");let d=null;const m=a.expectedType;m&&m.kind!=="value"&&(d=m);const _=[];for(const S of r.slice(1)){const P=a.parse(S,1+_.length,d,void 0,{typeAnnotation:"omit"});if(!P)return null;d=d||P.type,_.push(P)}if(!d)throw new Error("No output type");const x=m&&_.some(S=>oe(m,S.type));return new wl(x?Wt:d,_)}evaluate(r){let a,d=null,m=0;for(const _ of this.args)if(m++,d=_.evaluate(r),d&&d instanceof Ni&&!d.available&&(a||(a=d.name),d=null,m===this.args.length&&(d=a)),d!==null)break;return d}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}function $h(s,r){return s==="=="||s==="!="?r.kind==="boolean"||r.kind==="string"||r.kind==="number"||r.kind==="null"||r.kind==="value":r.kind==="string"||r.kind==="number"||r.kind==="value"}function Nh(s,r,a,d){return d.compare(r,a)===0}function us(s,r,a){const d=s!=="=="&&s!=="!=";return class Kb{constructor(_,x,S){this.type=Nt,this.lhs=_,this.rhs=x,this.collator=S,this.hasUntypedArgument=_.type.kind==="value"||x.type.kind==="value"}static parse(_,x){if(_.length!==3&&_.length!==4)return x.error("Expected two or three arguments.");const S=_[0];let P=x.parse(_[1],1,Wt);if(!P)return null;if(!$h(S,P.type))return x.concat(1).error(`"${S}" comparisons are not supported for type '${U(P.type)}'.`);let A=x.parse(_[2],2,Wt);if(!A)return null;if(!$h(S,A.type))return x.concat(2).error(`"${S}" comparisons are not supported for type '${U(A.type)}'.`);if(P.type.kind!==A.type.kind&&P.type.kind!=="value"&&A.type.kind!=="value")return x.error(`Cannot compare types '${U(P.type)}' and '${U(A.type)}'.`);d&&(P.type.kind==="value"&&A.type.kind!=="value"?P=new Dn(A.type,[P]):P.type.kind!=="value"&&A.type.kind==="value"&&(A=new Dn(P.type,[A])));let D=null;if(_.length===4){if(P.type.kind!=="string"&&A.type.kind!=="string"&&P.type.kind!=="value"&&A.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(D=x.parse(_[3],3,oo),!D)return null}return new Kb(P,A,D)}evaluate(_){const x=this.lhs.evaluate(_),S=this.rhs.evaluate(_);if(d&&this.hasUntypedArgument){const P=pi(x),A=pi(S);if(P.kind!==A.kind||P.kind!=="string"&&P.kind!=="number")throw new ci(`Expected arguments for "${s}" to be (string, string) or (number, number), but found (${P.kind}, ${A.kind}) instead.`)}if(this.collator&&!d&&this.hasUntypedArgument){const P=pi(x),A=pi(S);if(P.kind!=="string"||A.kind!=="string")return r(_,x,S)}return this.collator?a(_,x,S,this.collator.evaluate(_)):r(_,x,S)}eachChild(_){_(this.lhs),_(this.rhs),this.collator&&_(this.collator)}outputDefined(){return!0}}}const jh=us("==",function(s,r,a){return r===a},Nh),_p=us("!=",function(s,r,a){return r!==a},function(s,r,a,d){return!Nh(0,r,a,d)}),vp=us("<",function(s,r,a){return r",function(s,r,a){return r>a},function(s,r,a,d){return d.compare(r,a)>0}),Uh=us("<=",function(s,r,a){return r<=a},function(s,r,a,d){return d.compare(r,a)<=0}),bp=us(">=",function(s,r,a){return r>=a},function(s,r,a,d){return d.compare(r,a)>=0});class Sl{constructor(r,a,d){this.type=oo,this.locale=d,this.caseSensitive=r,this.diacriticSensitive=a}static parse(r,a){if(r.length!==2)return a.error("Expected one argument.");const d=r[1];if(typeof d!="object"||Array.isArray(d))return a.error("Collator options argument must be an object.");const m=a.parse(d["case-sensitive"]!==void 0&&d["case-sensitive"],1,Nt);if(!m)return null;const _=a.parse(d["diacritic-sensitive"]!==void 0&&d["diacritic-sensitive"],1,Nt);if(!_)return null;let x=null;return d.locale&&(x=a.parse(d.locale,1,er),!x)?null:new Sl(m,_,x)}evaluate(r){return new Oc(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}}class Vc{constructor(r,a,d,m,_){this.type=er,this.number=r,this.locale=a,this.currency=d,this.minFractionDigits=m,this.maxFractionDigits=_}static parse(r,a){if(r.length!==3)return a.error("Expected two arguments.");const d=a.parse(r[1],1,lt);if(!d)return null;const m=r[2];if(typeof m!="object"||Array.isArray(m))return a.error("NumberFormat options argument must be an object.");let _=null;if(m.locale&&(_=a.parse(m.locale,1,er),!_))return null;let x=null;if(m.currency&&(x=a.parse(m.currency,1,er),!x))return null;let S=null;if(m["min-fraction-digits"]&&(S=a.parse(m["min-fraction-digits"],1,lt),!S))return null;let P=null;return m["max-fraction-digits"]&&(P=a.parse(m["max-fraction-digits"],1,lt),!P)?null:new Vc(d,_,x,S,P)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}}class kl{constructor(r){this.type=So,this.sections=r}static parse(r,a){if(r.length<2)return a.error("Expected at least one argument.");const d=r[1];if(!Array.isArray(d)&&typeof d=="object")return a.error("First argument must be an image or text section.");const m=[];let _=!1;for(let x=1;x<=r.length-1;++x){const S=r[x];if(_&&typeof S=="object"&&!Array.isArray(S)){_=!1;let P=null;if(S["font-scale"]&&(P=a.parse(S["font-scale"],1,lt),!P))return null;let A=null;if(S["text-font"]&&(A=a.parse(S["text-font"],1,q(er)),!A))return null;let D=null;if(S["text-color"]&&(D=a.parse(S["text-color"],1,un),!D))return null;const R=m[m.length-1];R.scale=P,R.font=A,R.textColor=D}else{const P=a.parse(r[x],1,Wt);if(!P)return null;const A=P.type.kind;if(A!=="string"&&A!=="value"&&A!=="null"&&A!=="resolvedImage")return a.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");_=!0,m.push({content:P,scale:null,font:null,textColor:null})}}return new kl(m)}evaluate(r){return new xn(this.sections.map(a=>{const d=a.content.evaluate(r);return pi(d)===so?new $c("",d,null,null,null):new $c(ko(d),null,a.scale?a.scale.evaluate(r):null,a.font?a.font.evaluate(r).join(","):null,a.textColor?a.textColor.evaluate(r):null)}))}eachChild(r){for(const a of this.sections)r(a.content),a.scale&&r(a.scale),a.font&&r(a.font),a.textColor&&r(a.textColor)}outputDefined(){return!1}}class Uc{constructor(r){this.type=so,this.input=r}static parse(r,a){if(r.length!==2)return a.error("Expected two arguments.");const d=a.parse(r[1],1,er);return d?new Uc(d):a.error("No image name provided.")}evaluate(r){const a=this.input.evaluate(r),d=Ni.fromString(a);return d&&r.availableImages&&(d.available=r.availableImages.indexOf(a)>-1),d}eachChild(r){r(this.input)}outputDefined(){return!1}}class qc{constructor(r){this.type=lt,this.input=r}static parse(r,a){if(r.length!==2)return a.error(`Expected 1 argument, but found ${r.length-1} instead.`);const d=a.parse(r[1],1);return d?d.type.kind!=="array"&&d.type.kind!=="string"&&d.type.kind!=="value"?a.error(`Expected argument of type string or array, but found ${U(d.type)} instead.`):new qc(d):null}evaluate(r){const a=this.input.evaluate(r);if(typeof a=="string"||Array.isArray(a))return a.length;throw new ci(`Expected value to be of type string or array, but found ${U(pi(a))} instead.`)}eachChild(r){r(this.input)}outputDefined(){return!1}}const ao=8192;function Gc(s,r){const a=(180+s[0])/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s[1]*Math.PI/360)))/360,m=Math.pow(2,r.z);return[Math.round(a*m*ao),Math.round(d*m*ao)]}function $s(s,r){const a=Math.pow(2,r.z);return[(m=(s[0]/ao+r.x)/a,360*m-180),(d=(s[1]/ao+r.y)/a,360/Math.PI*Math.atan(Math.exp((180-360*d)*Math.PI/180))-90)];var d,m}function hr(s,r){s[0]=Math.min(s[0],r[0]),s[1]=Math.min(s[1],r[1]),s[2]=Math.max(s[2],r[0]),s[3]=Math.max(s[3],r[1])}function Fa(s,r){return!(s[0]<=r[0]||s[2]>=r[2]||s[1]<=r[1]||s[3]>=r[3])}function xp(s,r,a){const d=s[0]-r[0],m=s[1]-r[1],_=s[0]-a[0],x=s[1]-a[1];return d*x-_*m==0&&d*_<=0&&m*x<=0}function El(s,r,a,d){return(m=[d[0]-a[0],d[1]-a[1]])[0]*(_=[r[0]-s[0],r[1]-s[1]])[1]-m[1]*_[0]!=0&&!(!Gh(s,r,a,d)||!Gh(a,d,s,r));var m,_}function wp(s,r,a){for(const d of a)for(let m=0;m(m=s)[1]!=(x=S[P+1])[1]>m[1]&&m[0]<(x[0]-_[0])*(m[1]-_[1])/(x[1]-_[1])+_[0]&&(d=!d)}var m,_,x;return d}function Sp(s,r){for(const a of r)if(Ns(s,a))return!0;return!1}function qh(s,r){for(const a of s)if(!Ns(a,r))return!1;for(let a=0;a0&&S<0||x<0&&S>0}function Zc(s,r,a){const d=[];for(let m=0;ma[2]){const m=.5*d;let _=s[0]-a[0]>m?-d:a[0]-s[0]>m?d:0;_===0&&(_=s[0]-a[2]>m?-d:a[2]-s[0]>m?d:0),s[0]+=_}hr(r,s)}function Wh(s,r,a,d){const m=Math.pow(2,d.z)*ao,_=[d.x*ao,d.y*ao],x=[];for(const S of s)for(const P of S){const A=[P.x+_[0],P.y+_[1]];Hh(A,r,a,m),x.push(A)}return x}function Xh(s,r,a,d){const m=Math.pow(2,d.z)*ao,_=[d.x*ao,d.y*ao],x=[];for(const P of s){const A=[];for(const D of P){const R=[D.x+_[0],D.y+_[1]];hr(r,R),A.push(R)}x.push(A)}if(r[2]-r[0]<=m/2){(S=r)[0]=S[1]=1/0,S[2]=S[3]=-1/0;for(const P of x)for(const A of P)Hh(A,r,a,m)}var S;return x}class hs{constructor(r,a){this.type=Nt,this.geojson=r,this.geometries=a}static parse(r,a){if(r.length!==2)return a.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(Ia(r[1])){const d=r[1];if(d.type==="FeatureCollection"){const m=[];for(const _ of d.features){const{type:x,coordinates:S}=_.geometry;x==="Polygon"&&m.push(S),x==="MultiPolygon"&&m.push(...S)}if(m.length)return new hs(d,{type:"MultiPolygon",coordinates:m})}else if(d.type==="Feature"){const m=d.geometry.type;if(m==="Polygon"||m==="MultiPolygon")return new hs(d,d.geometry)}else if(d.type==="Polygon"||d.type==="MultiPolygon")return new hs(d,d)}return a.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return function(a,d){const m=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=a.canonicalID();if(d.type==="Polygon"){const S=Zc(d.coordinates,_,x),P=Wh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!Ns(A,S))return!1}if(d.type==="MultiPolygon"){const S=Zh(d.coordinates,_,x),P=Wh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!Sp(A,S))return!1}return!0}(r,this.geometries);if(r.geometryType()==="LineString")return function(a,d){const m=[1/0,1/0,-1/0,-1/0],_=[1/0,1/0,-1/0,-1/0],x=a.canonicalID();if(d.type==="Polygon"){const S=Zc(d.coordinates,_,x),P=Xh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!qh(A,S))return!1}if(d.type==="MultiPolygon"){const S=Zh(d.coordinates,_,x),P=Xh(a.geometry(),m,_,x);if(!Fa(m,_))return!1;for(const A of P)if(!kp(A,S))return!1}return!0}(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Jh=class{constructor(s=[],r=Ep){if(this.data=s,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const s=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:r,compare:a}=this,d=r[s];for(;s>0;){const m=s-1>>1,_=r[m];if(a(d,_)>=0)break;r[s]=_,s=m}r[s]=d}_down(s){const{data:r,compare:a}=this,d=this.length>>1,m=r[s];for(;s=0)break;r[s]=x,s=_}r[s]=m}};function Ep(s,r){return sr?1:0}function Pp(s,r,a,d,m){Kh(s,r,a,d||s.length-1,m||Mp)}function Kh(s,r,a,d,m){for(;d>a;){if(d-a>600){var _=d-a+1,x=r-a+1,S=Math.log(_),P=.5*Math.exp(2*S/3),A=.5*Math.sqrt(S*P*(_-P)/_)*(x-_/2<0?-1:1);Kh(s,r,Math.max(a,Math.floor(r-x*P/_+A)),Math.min(d,Math.floor(r+(_-x)*P/_+A)),m)}var D=s[r],R=a,N=d;for(Ra(s,a,r),m(s[d],D)>0&&Ra(s,a,d);R0;)N--}m(s[a],D)===0?Ra(s,a,N):Ra(s,++N,d),N<=r&&(a=N+1),r<=N&&(d=N-1)}}function Ra(s,r,a){var d=s[r];s[r]=s[a],s[a]=d}function Mp(s,r){return sr?1:0}function Pl(s,r){if(s.length<=1)return[s];const a=[];let d,m;for(const _ of s){const x=Tp(_);x!==0&&(_.area=Math.abs(x),m===void 0&&(m=x<0),m===x<0?(d&&a.push(d),d=[_]):d.push(_))}if(d&&a.push(d),r>1)for(let _=0;_1?(A=r[P+1][0],D=r[P+1][1]):Z>0&&(A+=R/this.kx*Z,D+=N/this.ky*Z)),R=this.wrap(a[0]-A)*this.kx,N=(a[1]-D)*this.ky;const W=R*R+N*N;W180;)r-=360;return r}}function tf(s,r){return r[0]-s[0]}function Ml(s){return s[1]-s[0]+1}function Eo(s,r){return s[1]>=s[0]&&s[1]s[1])return[null,null];const a=Ml(s);if(r){if(a===2)return[s,null];const m=Math.floor(a/2);return[[s[0],s[0]+m],[s[0]+m,s[1]]]}if(a===1)return[s,null];const d=Math.floor(a/2)-1;return[[s[0],s[0]+d],[s[0]+d+1,s[1]]]}function Wc(s,r){if(!Eo(r,s.length))return[1/0,1/0,-1/0,-1/0];const a=[1/0,1/0,-1/0,-1/0];for(let d=r[0];d<=r[1];++d)hr(a,s[d]);return a}function Xc(s){const r=[1/0,1/0,-1/0,-1/0];for(const a of s)for(const d of a)hr(r,d);return r}function rf(s){return s[0]!==-1/0&&s[1]!==-1/0&&s[2]!==1/0&&s[3]!==1/0}function Jc(s,r,a){if(!rf(s)||!rf(r))return NaN;let d=0,m=0;return s[2]r[2]&&(d=s[0]-r[2]),s[1]>r[3]&&(m=s[1]-r[3]),s[3]=d)return d;if(Fa(m,_)){if(Oa(s,r))return 0}else if(Oa(r,s))return 0;let x=1/0;for(const S of s)for(let P=0,A=S.length,D=A-1;P0;){const P=x.pop();if(P[0]>=_)continue;const A=P[1],D=r?50:100;if(Ml(A)<=D){if(!Eo(A,s.length))return NaN;if(r){const R=$r(s,A,a,d);if(isNaN(R)||R===0)return R;_=Math.min(_,R)}else for(let R=A[0];R<=A[1];++R){const N=Hr(s[R],a,d);if(_=Math.min(_,N),_===0)return 0}}else{const R=Ba(A,r);Qc(x,_,d,s,S,R[0]),Qc(x,_,d,s,S,R[1])}}return _}function Cl(s,r,a,d,m,_=1/0){let x=Math.min(_,m.distance(s[0],a[0]));if(x===0)return x;const S=new Jh([[0,[0,s.length-1],[0,a.length-1]]],tf);for(;S.length>0;){const P=S.pop();if(P[0]>=x)continue;const A=P[1],D=P[2],R=r?50:100,N=d?50:100;if(Ml(A)<=R&&Ml(D)<=N){if(!Eo(A,s.length)&&Eo(D,a.length))return NaN;let Z;if(r&&d)Z=sr(s,A,a,D,m),x=Math.min(x,Z);else if(r&&!d){const W=s.slice(A[0],A[1]+1);for(let Q=D[0];Q<=D[1];++Q)if(Z=Ar(a[Q],W,m),x=Math.min(x,Z),x===0)return x}else if(!r&&d){const W=a.slice(D[0],D[1]+1);for(let Q=A[0];Q<=A[1];++Q)if(Z=Ar(s[Q],W,m),x=Math.min(x,Z),x===0)return x}else Z=Yc(s,A,a,D,m),x=Math.min(x,Z)}else{const Z=Ba(A,r),W=Ba(D,d);Il(S,x,m,s,a,Z[0],W[0]),Il(S,x,m,s,a,Z[0],W[1]),Il(S,x,m,s,a,Z[1],W[0]),Il(S,x,m,s,a,Z[1],W[1])}}return x}function eu(s){return s.type==="MultiPolygon"?s.coordinates.map(r=>({type:"Polygon",coordinates:r})):s.type==="MultiLineString"?s.coordinates.map(r=>({type:"LineString",coordinates:r})):s.type==="MultiPoint"?s.coordinates.map(r=>({type:"Point",coordinates:r})):[s]}class Uo{constructor(r,a){this.type=lt,this.geojson=r,this.geometries=a}static parse(r,a){if(r.length!==2)return a.error(`'distance' expression requires exactly one argument, but found ${r.length-1} instead.`);if(Ia(r[1])){const d=r[1];if(d.type==="FeatureCollection")return new Uo(d,d.features.map(m=>eu(m.geometry)).flat());if(d.type==="Feature")return new Uo(d,eu(d.geometry));if("type"in d&&"coordinates"in d)return new Uo(d,eu(d))}return a.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return function(a,d){const m=a.geometry(),_=m.flat().map(P=>$s([P.x,P.y],a.canonical));if(m.length===0)return NaN;const x=new Hc(_[0][1]);let S=1/0;for(const P of d){switch(P.type){case"Point":S=Math.min(S,Cl(_,!1,[P.coordinates],!1,x,S));break;case"LineString":S=Math.min(S,Cl(_,!1,P.coordinates,!0,x,S));break;case"Polygon":S=Math.min(S,Tl(_,!1,P.coordinates,x,S))}if(S===0)return S}return S}(r,this.geometries);if(r.geometryType()==="LineString")return function(a,d){const m=a.geometry(),_=m.flat().map(P=>$s([P.x,P.y],a.canonical));if(m.length===0)return NaN;const x=new Hc(_[0][1]);let S=1/0;for(const P of d){switch(P.type){case"Point":S=Math.min(S,Cl(_,!0,[P.coordinates],!1,x,S));break;case"LineString":S=Math.min(S,Cl(_,!0,P.coordinates,!0,x,S));break;case"Polygon":S=Math.min(S,Tl(_,!0,P.coordinates,x,S))}if(S===0)return S}return S}(r,this.geometries);if(r.geometryType()==="Polygon")return function(a,d){const m=a.geometry();if(m.length===0||m[0].length===0)return NaN;const _=Pl(m,0).map(P=>P.map(A=>A.map(D=>$s([D.x,D.y],a.canonical)))),x=new Hc(_[0][0][0][1]);let S=1/0;for(const P of d)for(const A of _){switch(P.type){case"Point":S=Math.min(S,Tl([P.coordinates],!1,A,x,S));break;case"LineString":S=Math.min(S,Tl(P.coordinates,!0,A,x,S));break;case"Polygon":S=Math.min(S,nf(A,P.coordinates,x,S))}if(S===0)return S}return S}(r,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const fs={"==":jh,"!=":_p,">":Vh,"<":vp,">=":bp,"<=":Uh,array:Dn,at:jc,boolean:Dn,case:bl,coalesce:wl,collator:Sl,format:kl,image:Uc,in:Aa,"index-of":_l,interpolate:En,"interpolate-hcl":En,"interpolate-lab":En,length:qc,let:_r,literal:cs,match:vl,number:Dn,"number-format":Vc,object:Dn,slice:xl,step:Os,string:Dn,"to-boolean":No,"to-color":No,"to-number":No,"to-string":No,var:yl,within:hs,distance:Uo};class Pn{constructor(r,a,d,m){this.name=r,this.type=a,this._evaluate=d,this.args=m}evaluate(r){return this._evaluate(r,this.args)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,a){const d=r[0],m=Pn.definitions[d];if(!m)return a.error(`Unknown expression "${d}". If you wanted a literal array, use ["literal", [...]].`,0);const _=Array.isArray(m)?m[0]:m.type,x=Array.isArray(m)?[[m[1],m[2]]]:m.overloads,S=x.filter(([A])=>!Array.isArray(A)||A.length===r.length-1);let P=null;for(const[A,D]of S){P=new jo(a.registry,zl,a.path,null,a.scope);const R=[];let N=!1;for(let Z=1;Z{return N=R,Array.isArray(N)?`(${N.map(U).join(", ")})`:`(${U(N.type)}...)`;var N}).join(" | "),D=[];for(let R=1;R{a=r?a&&zl(d):a&&d instanceof cs}),!!a&&Ll(s)&&Dl(s,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ll(s){if(s instanceof Pn&&(s.name==="get"&&s.args.length===1||s.name==="feature-state"||s.name==="has"&&s.args.length===1||s.name==="properties"||s.name==="geometry-type"||s.name==="id"||/^filter-/.test(s.name))||s instanceof hs||s instanceof Uo)return!1;let r=!0;return s.eachChild(a=>{r&&!Ll(a)&&(r=!1)}),r}function $a(s){if(s instanceof Pn&&s.name==="feature-state")return!1;let r=!0;return s.eachChild(a=>{r&&!$a(a)&&(r=!1)}),r}function Dl(s,r){if(s instanceof Pn&&r.indexOf(s.name)>=0)return!1;let a=!0;return s.eachChild(d=>{a&&!Dl(d,r)&&(a=!1)}),a}function of(s){return{result:"success",value:s}}function js(s){return{result:"error",value:s}}function ps(s){return s["property-type"]==="data-driven"||s["property-type"]==="cross-faded-data-driven"}function iu(s){return!!s.expression&&s.expression.parameters.indexOf("zoom")>-1}function Vs(s){return!!s.expression&&s.expression.interpolated}function mr(s){return s instanceof Number?"number":s instanceof String?"string":s instanceof Boolean?"boolean":Array.isArray(s)?"array":s===null?"null":typeof s}function Na(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function sf(s){return s}function af(s,r){const a=r.type==="color",d=s.stops&&typeof s.stops[0][0]=="object",m=d||!(d||s.property!==void 0),_=s.type||(Vs(r)?"exponential":"interval");if(a||r.type==="padding"){const D=a?kr.parse:wn.parse;(s=io({},s)).stops&&(s.stops=s.stops.map(R=>[R[0],D(R[1])])),s.default=D(s.default?s.default:r.default)}if(s.colorSpace&&(x=s.colorSpace)!=="rgb"&&x!=="hcl"&&x!=="lab")throw new Error(`Unknown color space: "${s.colorSpace}"`);var x;let S,P,A;if(_==="exponential")S=nu;else if(_==="interval")S=Rl;else if(_==="categorical"){S=Fl,P=Object.create(null);for(const D of s.stops)P[D[0]]=D[1];A=typeof s.stops[0][0]}else{if(_!=="identity")throw new Error(`Unknown function type "${_}"`);S=ou}if(d){const D={},R=[];for(let W=0;WW[0]),evaluate:({zoom:W},Q)=>nu({stops:N,base:s.base},r,W).evaluate(W,Q)}}if(m){const D=_==="exponential"?{name:"exponential",base:s.base!==void 0?s.base:1}:null;return{kind:"camera",interpolationType:D,interpolationFactor:En.interpolationFactor.bind(void 0,D),zoomStops:s.stops.map(R=>R[0]),evaluate:({zoom:R})=>S(s,r,R,P,A)}}return{kind:"source",evaluate(D,R){const N=R&&R.properties?R.properties[s.property]:void 0;return N===void 0?ms(s.default,r.default):S(s,r,N,P,A)}}}function ms(s,r,a){return s!==void 0?s:r!==void 0?r:a!==void 0?a:void 0}function Fl(s,r,a,d,m){return ms(typeof a===m?d[a]:void 0,s.default,r.default)}function Rl(s,r,a){if(mr(a)!=="number")return ms(s.default,r.default);const d=s.stops.length;if(d===1||a<=s.stops[0][0])return s.stops[0][1];if(a>=s.stops[d-1][0])return s.stops[d-1][1];const m=za(s.stops.map(_=>_[0]),a);return s.stops[m][1]}function nu(s,r,a){const d=s.base!==void 0?s.base:1;if(mr(a)!=="number")return ms(s.default,r.default);const m=s.stops.length;if(m===1||a<=s.stops[0][0])return s.stops[0][1];if(a>=s.stops[m-1][0])return s.stops[m-1][1];const _=za(s.stops.map(D=>D[0]),a),x=function(D,R,N,Z){const W=Z-N,Q=D-N;return W===0?0:R===1?Q/W:(Math.pow(R,Q)-1)/(Math.pow(R,W)-1)}(a,d,s.stops[_][0],s.stops[_+1][0]),S=s.stops[_][1],P=s.stops[_+1][1],A=kn[r.type]||sf;return typeof S.evaluate=="function"?{evaluate(...D){const R=S.evaluate.apply(void 0,D),N=P.evaluate.apply(void 0,D);if(R!==void 0&&N!==void 0)return A(R,N,x,s.colorSpace)}}:A(S,P,x,s.colorSpace)}function ou(s,r,a){switch(r.type){case"color":a=kr.parse(a);break;case"formatted":a=xn.fromString(a.toString());break;case"resolvedImage":a=Ni.fromString(a.toString());break;case"padding":a=wn.parse(a);break;default:mr(a)===r.type||r.type==="enum"&&r.values[a]||(a=void 0)}return ms(a,s.default,r.default)}Pn.register(fs,{error:[{kind:"error"},[er],(s,[r])=>{throw new ci(r.evaluate(s))}],typeof:[er,[Wt],(s,[r])=>U(pi(r.evaluate(s)))],"to-rgba":[q(lt,4),[un],(s,[r])=>{const[a,d,m,_]=r.evaluate(s).rgb;return[255*a,255*d,255*m,_]}],rgb:[un,[lt,lt,lt],tu],rgba:[un,[lt,lt,lt,lt],tu],has:{type:Nt,overloads:[[[er],(s,[r])=>Al(r.evaluate(s),s.properties())],[[er,On],(s,[r,a])=>Al(r.evaluate(s),a.evaluate(s))]]},get:{type:Wt,overloads:[[[er],(s,[r])=>ru(r.evaluate(s),s.properties())],[[er,On],(s,[r,a])=>ru(r.evaluate(s),a.evaluate(s))]]},"feature-state":[Wt,[er],(s,[r])=>ru(r.evaluate(s),s.featureState||{})],properties:[On,[],s=>s.properties()],"geometry-type":[er,[],s=>s.geometryType()],id:[Wt,[],s=>s.id()],zoom:[lt,[],s=>s.globals.zoom],"heatmap-density":[lt,[],s=>s.globals.heatmapDensity||0],"line-progress":[lt,[],s=>s.globals.lineProgress||0],accumulated:[Wt,[],s=>s.globals.accumulated===void 0?null:s.globals.accumulated],"+":[lt,ds(lt),(s,r)=>{let a=0;for(const d of r)a+=d.evaluate(s);return a}],"*":[lt,ds(lt),(s,r)=>{let a=1;for(const d of r)a*=d.evaluate(s);return a}],"-":{type:lt,overloads:[[[lt,lt],(s,[r,a])=>r.evaluate(s)-a.evaluate(s)],[[lt],(s,[r])=>-r.evaluate(s)]]},"/":[lt,[lt,lt],(s,[r,a])=>r.evaluate(s)/a.evaluate(s)],"%":[lt,[lt,lt],(s,[r,a])=>r.evaluate(s)%a.evaluate(s)],ln2:[lt,[],()=>Math.LN2],pi:[lt,[],()=>Math.PI],e:[lt,[],()=>Math.E],"^":[lt,[lt,lt],(s,[r,a])=>Math.pow(r.evaluate(s),a.evaluate(s))],sqrt:[lt,[lt],(s,[r])=>Math.sqrt(r.evaluate(s))],log10:[lt,[lt],(s,[r])=>Math.log(r.evaluate(s))/Math.LN10],ln:[lt,[lt],(s,[r])=>Math.log(r.evaluate(s))],log2:[lt,[lt],(s,[r])=>Math.log(r.evaluate(s))/Math.LN2],sin:[lt,[lt],(s,[r])=>Math.sin(r.evaluate(s))],cos:[lt,[lt],(s,[r])=>Math.cos(r.evaluate(s))],tan:[lt,[lt],(s,[r])=>Math.tan(r.evaluate(s))],asin:[lt,[lt],(s,[r])=>Math.asin(r.evaluate(s))],acos:[lt,[lt],(s,[r])=>Math.acos(r.evaluate(s))],atan:[lt,[lt],(s,[r])=>Math.atan(r.evaluate(s))],min:[lt,ds(lt),(s,r)=>Math.min(...r.map(a=>a.evaluate(s)))],max:[lt,ds(lt),(s,r)=>Math.max(...r.map(a=>a.evaluate(s)))],abs:[lt,[lt],(s,[r])=>Math.abs(r.evaluate(s))],round:[lt,[lt],(s,[r])=>{const a=r.evaluate(s);return a<0?-Math.round(-a):Math.round(a)}],floor:[lt,[lt],(s,[r])=>Math.floor(r.evaluate(s))],ceil:[lt,[lt],(s,[r])=>Math.ceil(r.evaluate(s))],"filter-==":[Nt,[er,Wt],(s,[r,a])=>s.properties()[r.value]===a.value],"filter-id-==":[Nt,[Wt],(s,[r])=>s.id()===r.value],"filter-type-==":[Nt,[er],(s,[r])=>s.geometryType()===r.value],"filter-<":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d{const a=s.id(),d=r.value;return typeof a==typeof d&&a":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d>m}],"filter-id->":[Nt,[Wt],(s,[r])=>{const a=s.id(),d=r.value;return typeof a==typeof d&&a>d}],"filter-<=":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d<=m}],"filter-id-<=":[Nt,[Wt],(s,[r])=>{const a=s.id(),d=r.value;return typeof a==typeof d&&a<=d}],"filter->=":[Nt,[er,Wt],(s,[r,a])=>{const d=s.properties()[r.value],m=a.value;return typeof d==typeof m&&d>=m}],"filter-id->=":[Nt,[Wt],(s,[r])=>{const a=s.id(),d=r.value;return typeof a==typeof d&&a>=d}],"filter-has":[Nt,[Wt],(s,[r])=>r.value in s.properties()],"filter-has-id":[Nt,[],s=>s.id()!==null&&s.id()!==void 0],"filter-type-in":[Nt,[q(er)],(s,[r])=>r.value.indexOf(s.geometryType())>=0],"filter-id-in":[Nt,[q(Wt)],(s,[r])=>r.value.indexOf(s.id())>=0],"filter-in-small":[Nt,[er,q(Wt)],(s,[r,a])=>a.value.indexOf(s.properties()[r.value])>=0],"filter-in-large":[Nt,[er,q(Wt)],(s,[r,a])=>function(d,m,_,x){for(;_<=x;){const S=_+x>>1;if(m[S]===d)return!0;m[S]>d?x=S-1:_=S+1}return!1}(s.properties()[r.value],a.value,0,a.value.length-1)],all:{type:Nt,overloads:[[[Nt,Nt],(s,[r,a])=>r.evaluate(s)&&a.evaluate(s)],[ds(Nt),(s,r)=>{for(const a of r)if(!a.evaluate(s))return!1;return!0}]]},any:{type:Nt,overloads:[[[Nt,Nt],(s,[r,a])=>r.evaluate(s)||a.evaluate(s)],[ds(Nt),(s,r)=>{for(const a of r)if(a.evaluate(s))return!0;return!1}]]},"!":[Nt,[Nt],(s,[r])=>!r.evaluate(s)],"is-supported-script":[Nt,[er],(s,[r])=>{const a=s.globals&&s.globals.isSupportedScript;return!a||a(r.evaluate(s))}],upcase:[er,[er],(s,[r])=>r.evaluate(s).toUpperCase()],downcase:[er,[er],(s,[r])=>r.evaluate(s).toLowerCase()],concat:[er,ds(Wt),(s,r)=>r.map(a=>ko(a.evaluate(s))).join("")],"resolved-locale":[er,[oo],(s,[r])=>r.evaluate(s).resolvedLocale()]});class Bl{constructor(r,a){var d;this.expression=r,this._warningHistory={},this._evaluator=new Ca,this._defaultValue=a?(d=a).type==="color"&&Na(d.default)?new kr(0,0,0,0):d.type==="color"?kr.parse(d.default)||null:d.type==="padding"?wn.parse(d.default)||null:d.type==="variableAnchorOffsetCollection"?Sn.parse(d.default)||null:d.default===void 0?null:d.default:null,this._enumValues=a&&a.type==="enum"?a.values:null}evaluateWithoutErrorHandling(r,a,d,m,_,x){return this._evaluator.globals=r,this._evaluator.feature=a,this._evaluator.featureState=d,this._evaluator.canonical=m,this._evaluator.availableImages=_||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(r,a,d,m,_,x){this._evaluator.globals=r,this._evaluator.feature=a||null,this._evaluator.featureState=d||null,this._evaluator.canonical=m,this._evaluator.availableImages=_||null,this._evaluator.formattedSection=x||null;try{const S=this.expression.evaluate(this._evaluator);if(S==null||typeof S=="number"&&S!=S)return this._defaultValue;if(this._enumValues&&!(S in this._enumValues))throw new ci(`Expected value to be one of ${Object.keys(this._enumValues).map(P=>JSON.stringify(P)).join(", ")}, but found ${JSON.stringify(S)} instead.`);return S}catch(S){return this._warningHistory[S.message]||(this._warningHistory[S.message]=!0,typeof console<"u"&&console.warn(S.message)),this._defaultValue}}}function ja(s){return Array.isArray(s)&&s.length>0&&typeof s[0]=="string"&&s[0]in fs}function gs(s,r){const a=new jo(fs,zl,[],r?function(m){const _={color:un,string:er,number:lt,enum:er,boolean:Nt,formatted:So,padding:$o,resolvedImage:so,variableAnchorOffsetCollection:le};return m.type==="array"?q(_[m.value]||Wt,m.length):_[m.type]}(r):void 0),d=a.parse(s,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return d?of(new Bl(d,r)):js(a.errors)}class su{constructor(r,a){this.kind=r,this._styleExpression=a,this.isStateDependent=r!=="constant"&&!$a(a.expression)}evaluateWithoutErrorHandling(r,a,d,m,_,x){return this._styleExpression.evaluateWithoutErrorHandling(r,a,d,m,_,x)}evaluate(r,a,d,m,_,x){return this._styleExpression.evaluate(r,a,d,m,_,x)}}class au{constructor(r,a,d,m){this.kind=r,this.zoomStops=d,this._styleExpression=a,this.isStateDependent=r!=="camera"&&!$a(a.expression),this.interpolationType=m}evaluateWithoutErrorHandling(r,a,d,m,_,x){return this._styleExpression.evaluateWithoutErrorHandling(r,a,d,m,_,x)}evaluate(r,a,d,m,_,x){return this._styleExpression.evaluate(r,a,d,m,_,x)}interpolationFactor(r,a,d){return this.interpolationType?En.interpolationFactor(this.interpolationType,r,a,d):0}}function lf(s,r){const a=gs(s,r);if(a.result==="error")return a;const d=a.value.expression,m=Ll(d);if(!m&&!ps(r))return js([new Yi("","data expressions not supported")]);const _=Dl(d,["zoom"]);if(!_&&!iu(r))return js([new Yi("","zoom expressions not supported")]);const x=$l(d);return x||_?x instanceof Yi?js([x]):x instanceof En&&!Vs(r)?js([new Yi("",'"interpolate" expressions cannot be used with this property')]):of(x?new au(m?"camera":"composite",a.value,x.labels,x instanceof En?x.interpolation:void 0):new su(m?"constant":"source",a.value)):js([new Yi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ol{constructor(r,a){this._parameters=r,this._specification=a,io(this,af(this._parameters,this._specification))}static deserialize(r){return new Ol(r._parameters,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification}}}function $l(s){let r=null;if(s instanceof _r)r=$l(s.result);else if(s instanceof wl){for(const a of s.args)if(r=$l(a),r)break}else(s instanceof Os||s instanceof En)&&s.input instanceof Pn&&s.input.name==="zoom"&&(r=s);return r instanceof Yi||s.eachChild(a=>{const d=$l(a);d instanceof Yi?r=d:!r&&d?r=new Yi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&d&&r!==d&&(r=new Yi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function Us(s){if(s===!0||s===!1)return!0;if(!Array.isArray(s)||s.length===0)return!1;switch(s[0]){case"has":return s.length>=2&&s[1]!=="$id"&&s[1]!=="$type";case"in":return s.length>=3&&(typeof s[1]!="string"||Array.isArray(s[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return s.length!==3||Array.isArray(s[1])||Array.isArray(s[2]);case"any":case"all":for(const r of s.slice(1))if(!Us(r)&&typeof r!="boolean")return!1;return!0;default:return!0}}const Nl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Qi(s){if(s==null)return{filter:()=>!0,needGeometry:!1};Us(s)||(s=jl(s));const r=gs(s,Nl);if(r.result==="error")throw new Error(r.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,d,m)=>r.value.evaluate(a,d,{},m),needGeometry:lu(s)}}function Va(s,r){return sr?1:0}function lu(s){if(!Array.isArray(s))return!1;if(s[0]==="within"||s[0]==="distance")return!0;for(let r=1;r"||r==="<="||r===">="?cu(s[1],s[2],r):r==="any"?(a=s.slice(1),["any"].concat(a.map(jl))):r==="all"?["all"].concat(s.slice(1).map(jl)):r==="none"?["all"].concat(s.slice(1).map(jl).map(Gs)):r==="in"?qs(s[1],s.slice(2)):r==="!in"?Gs(qs(s[1],s.slice(2))):r==="has"?uu(s[1]):r!=="!has"||Gs(uu(s[1]));var a}function cu(s,r,a){switch(s){case"$type":return[`filter-type-${a}`,r];case"$id":return[`filter-id-${a}`,r];default:return[`filter-${a}`,s,r]}}function qs(s,r){if(r.length===0)return!1;switch(s){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(a=>typeof a!=typeof r[0])?["filter-in-large",s,["literal",r.sort(Va)]]:["filter-in-small",s,["literal",r]]}}function uu(s){switch(s){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",s]}}function Gs(s){return["!",s]}function hu(s){const r=typeof s;if(r==="number"||r==="boolean"||r==="string"||s==null)return JSON.stringify(s);if(Array.isArray(s)){let m="[";for(const _ of s)m+=`${hu(_)},`;return`${m}]`}const a=Object.keys(s).sort();let d="{";for(let m=0;md.maximum?[new nt(r,a,`${a} is greater than the maximum value ${d.maximum}`)]:[]}function du(s){const r=s.valueSpec,a=Nr(s.value.type);let d,m,_,x={};const S=a!=="categorical"&&s.value.property===void 0,P=!S,A=mr(s.value.stops)==="array"&&mr(s.value.stops[0])==="array"&&mr(s.value.stops[0][0])==="object",D=hn({key:s.key,value:s.value,valueSpec:s.styleSpec.function,validateSpec:s.validateSpec,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{stops:function(Z){if(a==="identity")return[new nt(Z.key,Z.value,'identity function may not have a "stops" property')];let W=[];const Q=Z.value;return W=W.concat(Vl({key:Z.key,value:Q,valueSpec:Z.valueSpec,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,arrayElementValidator:R})),mr(Q)==="array"&&Q.length===0&&W.push(new nt(Z.key,Q,"array must have at least one stop")),W},default:function(Z){return Z.validateSpec({key:Z.key,value:Z.value,valueSpec:r,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec})}}});return a==="identity"&&S&&D.push(new nt(s.key,s.value,'missing required property "property"')),a==="identity"||s.value.stops||D.push(new nt(s.key,s.value,'missing required property "stops"')),a==="exponential"&&s.valueSpec.expression&&!Vs(s.valueSpec)&&D.push(new nt(s.key,s.value,"exponential functions not supported")),s.styleSpec.$version>=8&&(P&&!ps(s.valueSpec)?D.push(new nt(s.key,s.value,"property functions not supported")):S&&!iu(s.valueSpec)&&D.push(new nt(s.key,s.value,"zoom functions not supported"))),a!=="categorical"&&!A||s.value.property!==void 0||D.push(new nt(s.key,s.value,'"property" property is required')),D;function R(Z){let W=[];const Q=Z.value,ie=Z.key;if(mr(Q)!=="array")return[new nt(ie,Q,`array expected, ${mr(Q)} found`)];if(Q.length!==2)return[new nt(ie,Q,`array length 2 expected, length ${Q.length} found`)];if(A){if(mr(Q[0])!=="object")return[new nt(ie,Q,`object expected, ${mr(Q[0])} found`)];if(Q[0].zoom===void 0)return[new nt(ie,Q,"object stop key must have zoom")];if(Q[0].value===void 0)return[new nt(ie,Q,"object stop key must have value")];if(_&&_>Nr(Q[0].zoom))return[new nt(ie,Q[0].zoom,"stop zoom values must appear in ascending order")];Nr(Q[0].zoom)!==_&&(_=Nr(Q[0].zoom),m=void 0,x={}),W=W.concat(hn({key:`${ie}[0]`,value:Q[0],valueSpec:{zoom:{}},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,objectElementValidators:{zoom:Ua,value:N}}))}else W=W.concat(N({key:`${ie}[0]`,value:Q[0],valueSpec:{},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec},Q));return ja(ys(Q[1]))?W.concat([new nt(`${ie}[1]`,Q[1],"expressions are not allowed in function stops.")]):W.concat(Z.validateSpec({key:`${ie}[1]`,value:Q[1],valueSpec:r,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec}))}function N(Z,W){const Q=mr(Z.value),ie=Nr(Z.value),he=Z.value!==null?Z.value:W;if(d){if(Q!==d)return[new nt(Z.key,he,`${Q} stop domain type must match previous stop domain type ${d}`)]}else d=Q;if(Q!=="number"&&Q!=="string"&&Q!=="boolean")return[new nt(Z.key,he,"stop domain value must be a number, string, or boolean")];if(Q!=="number"&&a!=="categorical"){let ke=`number expected, ${Q} found`;return ps(r)&&a===void 0&&(ke+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new nt(Z.key,he,ke)]}return a!=="categorical"||Q!=="number"||isFinite(ie)&&Math.floor(ie)===ie?a!=="categorical"&&Q==="number"&&m!==void 0&&ienew nt(`${s.key}${d.key}`,s.value,d.message));const a=r.value.expression||r.value._styleExpression.expression;if(s.expressionContext==="property"&&s.propertyKey==="text-font"&&!a.outputDefined())return[new nt(s.key,s.value,`Invalid data expression for "${s.propertyKey}". Output values must be contained as literals within the expression.`)];if(s.expressionContext==="property"&&s.propertyType==="layout"&&!$a(a))return[new nt(s.key,s.value,'"feature-state" data expressions are not supported with layout properties.')];if(s.expressionContext==="filter"&&!$a(a))return[new nt(s.key,s.value,'"feature-state" data expressions are not supported with filters.')];if(s.expressionContext&&s.expressionContext.indexOf("cluster")===0){if(!Dl(a,["zoom","feature-state"]))return[new nt(s.key,s.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(s.expressionContext==="cluster-initial"&&!Ll(a))return[new nt(s.key,s.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qa(s){const r=s.key,a=s.value,d=s.valueSpec,m=[];return Array.isArray(d.values)?d.values.indexOf(Nr(a))===-1&&m.push(new nt(r,a,`expected one of [${d.values.join(", ")}], ${JSON.stringify(a)} found`)):Object.keys(d.values).indexOf(Nr(a))===-1&&m.push(new nt(r,a,`expected one of [${Object.keys(d.values).join(", ")}], ${JSON.stringify(a)} found`)),m}function Ga(s){return Us(ys(s.value))?_s(io({},s,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Za(s)}function Za(s){const r=s.value,a=s.key;if(mr(r)!=="array")return[new nt(a,r,`array expected, ${mr(r)} found`)];const d=s.styleSpec;let m,_=[];if(r.length<1)return[new nt(a,r,"filter array must have at least 1 element")];switch(_=_.concat(qa({key:`${a}[0]`,value:r[0],valueSpec:d.filter_operator,style:s.style,styleSpec:s.styleSpec})),Nr(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&Nr(r[1])==="$type"&&_.push(new nt(a,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&_.push(new nt(a,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(m=mr(r[1]),m!=="string"&&_.push(new nt(`${a}[1]`,r[1],`string expected, ${m} found`)));for(let x=2;x{A in a&&r.push(new nt(d,a[A],`"${A}" is prohibited for ref layers`))}),m.layers.forEach(A=>{Nr(A.id)===S&&(P=A)}),P?P.ref?r.push(new nt(d,a.ref,"ref cannot reference another ref layer")):x=Nr(P.type):r.push(new nt(d,a.ref,`ref layer "${S}" not found`))}else if(x!=="background")if(a.source){const P=m.sources&&m.sources[a.source],A=P&&Nr(P.type);P?A==="vector"&&x==="raster"?r.push(new nt(d,a.source,`layer "${a.id}" requires a raster source`)):A!=="raster-dem"&&x==="hillshade"?r.push(new nt(d,a.source,`layer "${a.id}" requires a raster-dem source`)):A==="raster"&&x!=="raster"?r.push(new nt(d,a.source,`layer "${a.id}" requires a vector source`)):A!=="vector"||a["source-layer"]?A==="raster-dem"&&x!=="hillshade"?r.push(new nt(d,a.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!a.paint||!a.paint["line-gradient"]||A==="geojson"&&P.lineMetrics||r.push(new nt(d,a,`layer "${a.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new nt(d,a,`layer "${a.id}" must specify a "source-layer"`)):r.push(new nt(d,a.source,`source "${a.source}" not found`))}else r.push(new nt(d,a,'missing required property "source"'));return r=r.concat(hn({key:d,value:a,valueSpec:_.layer,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,objectElementValidators:{"*":()=>[],type:()=>s.validateSpec({key:`${d}.type`,value:a.type,valueSpec:_.layer.type,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,object:a,objectKey:"type"}),filter:Ga,layout:P=>hn({layer:a,key:P.key,value:P.value,style:P.style,styleSpec:P.styleSpec,validateSpec:P.validateSpec,objectElementValidators:{"*":A=>gu(io({layerType:x},A))}}),paint:P=>hn({layer:a,key:P.key,value:P.value,style:P.style,styleSpec:P.styleSpec,validateSpec:P.validateSpec,objectElementValidators:{"*":A=>mu(io({layerType:x},A))}})}})),r}function Po(s){const r=s.value,a=s.key,d=mr(r);return d!=="string"?[new nt(a,r,`string expected, ${d} found`)]:[]}const _u={promoteId:function({key:s,value:r}){if(mr(r)==="string")return Po({key:s,value:r});{const a=[];for(const d in r)a.push(...Po({key:`${s}.${d}`,value:r[d]}));return a}}};function uf(s){const r=s.value,a=s.key,d=s.styleSpec,m=s.style,_=s.validateSpec;if(!r.type)return[new nt(a,r,'"type" is required')];const x=Nr(r.type);let S;switch(x){case"vector":case"raster":return S=hn({key:a,value:r,valueSpec:d[`source_${x.replace("-","_")}`],style:s.style,styleSpec:d,objectElementValidators:_u,validateSpec:_}),S;case"raster-dem":return S=function(P){var A;const D=(A=P.sourceName)!==null&&A!==void 0?A:"",R=P.value,N=P.styleSpec,Z=N.source_raster_dem,W=P.style;let Q=[];const ie=mr(R);if(R===void 0)return Q;if(ie!=="object")return Q.push(new nt("source_raster_dem",R,`object expected, ${ie} found`)),Q;const he=Nr(R.encoding)==="custom",ke=["redFactor","greenFactor","blueFactor","baseShift"],ge=P.value.encoding?`"${P.value.encoding}"`:"Default";for(const we in R)!he&&ke.includes(we)?Q.push(new nt(we,R[we],`In "${D}": "${we}" is only valid when "encoding" is set to "custom". ${ge} encoding found`)):Z[we]?Q=Q.concat(P.validateSpec({key:we,value:R[we],valueSpec:Z[we],validateSpec:P.validateSpec,style:W,styleSpec:N})):Q.push(new nt(we,R[we],`unknown property "${we}"`));return Q}({sourceName:a,value:r,style:s.style,styleSpec:d,validateSpec:_}),S;case"geojson":if(S=hn({key:a,value:r,valueSpec:d.source_geojson,style:m,styleSpec:d,validateSpec:_,objectElementValidators:_u}),r.cluster)for(const P in r.clusterProperties){const[A,D]=r.clusterProperties[P],R=typeof A=="string"?[A,["accumulated"],["get",P]]:A;S.push(..._s({key:`${a}.${P}.map`,value:D,validateSpec:_,expressionContext:"cluster-map"})),S.push(..._s({key:`${a}.${P}.reduce`,value:R,validateSpec:_,expressionContext:"cluster-reduce"}))}return S;case"video":return hn({key:a,value:r,valueSpec:d.source_video,style:m,validateSpec:_,styleSpec:d});case"image":return hn({key:a,value:r,valueSpec:d.source_image,style:m,validateSpec:_,styleSpec:d});case"canvas":return[new nt(a,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qa({key:`${a}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:m,validateSpec:_,styleSpec:d})}}function vu(s){const r=s.value,a=s.styleSpec,d=a.light,m=s.style;let _=[];const x=mr(r);if(r===void 0)return _;if(x!=="object")return _=_.concat([new nt("light",r,`object expected, ${x} found`)]),_;for(const S in r){const P=S.match(/^(.*)-transition$/);_=_.concat(P&&d[P[1]]&&d[P[1]].transition?s.validateSpec({key:S,value:r[S],valueSpec:a.transition,validateSpec:s.validateSpec,style:m,styleSpec:a}):d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],validateSpec:s.validateSpec,style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)])}return _}function hf(s){const r=s.value,a=s.styleSpec,d=a.sky,m=s.style,_=mr(r);if(r===void 0)return[];if(_!=="object")return[new nt("sky",r,`object expected, ${_} found`)];let x=[];for(const S in r)x=x.concat(d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)]);return x}function bu(s){const r=s.value,a=s.styleSpec,d=a.terrain,m=s.style;let _=[];const x=mr(r);if(r===void 0)return _;if(x!=="object")return _=_.concat([new nt("terrain",r,`object expected, ${x} found`)]),_;for(const S in r)_=_.concat(d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],validateSpec:s.validateSpec,style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)]);return _}function xu(s){let r=[];const a=s.value,d=s.key;if(Array.isArray(a)){const m=[],_=[];for(const x in a)a[x].id&&m.includes(a[x].id)&&r.push(new nt(d,a,`all the sprites' ids must be unique, but ${a[x].id} is duplicated`)),m.push(a[x].id),a[x].url&&_.includes(a[x].url)&&r.push(new nt(d,a,`all the sprites' URLs must be unique, but ${a[x].url} is duplicated`)),_.push(a[x].url),r=r.concat(hn({key:`${d}[${x}]`,value:a[x],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:s.validateSpec}));return r}return Po({key:d,value:a})}const wu={"*":()=>[],array:Vl,boolean:function(s){const r=s.value,a=s.key,d=mr(r);return d!=="boolean"?[new nt(a,r,`boolean expected, ${d} found`)]:[]},number:Ua,color:function(s){const r=s.key,a=s.value,d=mr(a);return d!=="string"?[new nt(r,a,`color expected, ${d} found`)]:kr.parse(String(a))?[]:[new nt(r,a,`color expected, "${a}" found`)]},constants:cf,enum:qa,filter:Ga,function:du,layer:yu,object:hn,source:uf,light:vu,sky:hf,terrain:bu,projection:function(s){const r=s.value,a=s.styleSpec,d=a.projection,m=s.style,_=mr(r);if(r===void 0)return[];if(_!=="object")return[new nt("projection",r,`object expected, ${_} found`)];let x=[];for(const S in r)x=x.concat(d[S]?s.validateSpec({key:S,value:r[S],valueSpec:d[S],style:m,styleSpec:a}):[new nt(S,r[S],`unknown property "${S}"`)]);return x},string:Po,formatted:function(s){return Po(s).length===0?[]:_s(s)},resolvedImage:function(s){return Po(s).length===0?[]:_s(s)},padding:function(s){const r=s.key,a=s.value;if(mr(a)==="array"){if(a.length<1||a.length>4)return[new nt(r,a,`padding requires 1 to 4 values; ${a.length} values found`)];const d={type:"number"};let m=[];for(let _=0;_[]}})),s.constants&&(a=a.concat(cf({key:"constants",value:s.constants,style:s,styleSpec:r,validateSpec:Ha}))),Su(a)}function $n(s){return function(r){return s({...r,validateSpec:Ha})}}function Su(s){return[].concat(s).sort((r,a)=>r.line-a.line)}function Nn(s){return function(...r){return Su(s.apply(this,r))}}Fn.source=Nn($n(uf)),Fn.sprite=Nn($n(xu)),Fn.glyphs=Nn($n(ff)),Fn.light=Nn($n(vu)),Fn.sky=Nn($n(hf)),Fn.terrain=Nn($n(bu)),Fn.layer=Nn($n(yu)),Fn.filter=Nn($n(Ga)),Fn.paintProperty=Nn($n(mu)),Fn.layoutProperty=Nn($n(gu));const Mo=Fn,Cp=Mo.light,ku=Mo.sky,Ap=Mo.paintProperty,zp=Mo.layoutProperty;function Eu(s,r){let a=!1;if(r&&r.length)for(const d of r)s.fire(new Be(new Error(d.message))),a=!0;return a}class Zs{constructor(r,a,d){const m=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;const x=new Int32Array(this.arrayBuffer);r=x[0],this.d=(a=x[1])+2*(d=x[2]);for(let P=0;P=R[W+0]&&m>=R[W+1])?(S[Z]=!0,x.push(D[Z])):S[Z]=!1}}}}_forEachCell(r,a,d,m,_,x,S,P){const A=this._convertToCellCoord(r),D=this._convertToCellCoord(a),R=this._convertToCellCoord(d),N=this._convertToCellCoord(m);for(let Z=A;Z<=R;Z++)for(let W=D;W<=N;W++){const Q=this.d*W+Z;if((!P||P(this._convertFromCellCoord(Z),this._convertFromCellCoord(W),this._convertFromCellCoord(Z+1),this._convertFromCellCoord(W+1)))&&_.call(this,r,a,d,m,Q,x,S,P))return}}_convertFromCellCoord(r){return(r-this.padding)/this.scale}_convertToCellCoord(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const r=this.cells,a=3+this.cells.length+1+1;let d=0;for(let x=0;x=0)continue;const x=s[_];m[_]=lo[a].shallow.indexOf(_)>=0?x:Wa(x,r)}s instanceof Error&&(m.message=s.message)}if(m.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(m.$name=a),m}function co(s){if(pf(s))return s;if(Array.isArray(s))return s.map(co);if(typeof s!="object")throw new Error("can't deserialize object of type "+typeof s);const r=Pu(s)||"Object";if(!lo[r])throw new Error(`can't deserialize unregistered class ${r}`);const{klass:a}=lo[r];if(!a)throw new Error(`can't deserialize unregistered class ${r}`);if(a.deserialize)return a.deserialize(s);const d=Object.create(a.prototype);for(const m of Object.keys(s)){if(m==="$name")continue;const _=s[m];d[m]=lo[r].shallow.indexOf(m)>=0?_:co(_)}return d}class mf{constructor(){this.first=!0}update(r,a){const d=Math.floor(r);return this.first?(this.first=!1,this.lastIntegerZoom=d,this.lastIntegerZoomTime=0,this.lastZoom=r,this.lastFloorZoom=d,!0):(this.lastFloorZoom>d?(this.lastIntegerZoom=d+1,this.lastIntegerZoomTime=a):this.lastFloorZooms>=128&&s<=255,Arabic:s=>s>=1536&&s<=1791,"Arabic Supplement":s=>s>=1872&&s<=1919,"Arabic Extended-A":s=>s>=2208&&s<=2303,"Hangul Jamo":s=>s>=4352&&s<=4607,"Unified Canadian Aboriginal Syllabics":s=>s>=5120&&s<=5759,Khmer:s=>s>=6016&&s<=6143,"Unified Canadian Aboriginal Syllabics Extended":s=>s>=6320&&s<=6399,"General Punctuation":s=>s>=8192&&s<=8303,"Letterlike Symbols":s=>s>=8448&&s<=8527,"Number Forms":s=>s>=8528&&s<=8591,"Miscellaneous Technical":s=>s>=8960&&s<=9215,"Control Pictures":s=>s>=9216&&s<=9279,"Optical Character Recognition":s=>s>=9280&&s<=9311,"Enclosed Alphanumerics":s=>s>=9312&&s<=9471,"Geometric Shapes":s=>s>=9632&&s<=9727,"Miscellaneous Symbols":s=>s>=9728&&s<=9983,"Miscellaneous Symbols and Arrows":s=>s>=11008&&s<=11263,"CJK Radicals Supplement":s=>s>=11904&&s<=12031,"Kangxi Radicals":s=>s>=12032&&s<=12255,"Ideographic Description Characters":s=>s>=12272&&s<=12287,"CJK Symbols and Punctuation":s=>s>=12288&&s<=12351,Hiragana:s=>s>=12352&&s<=12447,Katakana:s=>s>=12448&&s<=12543,Bopomofo:s=>s>=12544&&s<=12591,"Hangul Compatibility Jamo":s=>s>=12592&&s<=12687,Kanbun:s=>s>=12688&&s<=12703,"Bopomofo Extended":s=>s>=12704&&s<=12735,"CJK Strokes":s=>s>=12736&&s<=12783,"Katakana Phonetic Extensions":s=>s>=12784&&s<=12799,"Enclosed CJK Letters and Months":s=>s>=12800&&s<=13055,"CJK Compatibility":s=>s>=13056&&s<=13311,"CJK Unified Ideographs Extension A":s=>s>=13312&&s<=19903,"Yijing Hexagram Symbols":s=>s>=19904&&s<=19967,"CJK Unified Ideographs":s=>s>=19968&&s<=40959,"Yi Syllables":s=>s>=40960&&s<=42127,"Yi Radicals":s=>s>=42128&&s<=42191,"Hangul Jamo Extended-A":s=>s>=43360&&s<=43391,"Hangul Syllables":s=>s>=44032&&s<=55215,"Hangul Jamo Extended-B":s=>s>=55216&&s<=55295,"Private Use Area":s=>s>=57344&&s<=63743,"CJK Compatibility Ideographs":s=>s>=63744&&s<=64255,"Arabic Presentation Forms-A":s=>s>=64336&&s<=65023,"Vertical Forms":s=>s>=65040&&s<=65055,"CJK Compatibility Forms":s=>s>=65072&&s<=65103,"Small Form Variants":s=>s>=65104&&s<=65135,"Arabic Presentation Forms-B":s=>s>=65136&&s<=65279,"Halfwidth and Fullwidth Forms":s=>s>=65280&&s<=65519};function Mu(s){for(const r of s)if(Iu(r.charCodeAt(0)))return!0;return!1}function Lp(s){for(const r of s)if(!gf(r.charCodeAt(0)))return!1;return!0}function gf(s){return!(pt.Arabic(s)||pt["Arabic Supplement"](s)||pt["Arabic Extended-A"](s)||pt["Arabic Presentation Forms-A"](s)||pt["Arabic Presentation Forms-B"](s))}function Iu(s){return!(s!==746&&s!==747&&(s<4352||!(pt["Bopomofo Extended"](s)||pt.Bopomofo(s)||pt["CJK Compatibility Forms"](s)&&!(s>=65097&&s<=65103)||pt["CJK Compatibility Ideographs"](s)||pt["CJK Compatibility"](s)||pt["CJK Radicals Supplement"](s)||pt["CJK Strokes"](s)||!(!pt["CJK Symbols and Punctuation"](s)||s>=12296&&s<=12305||s>=12308&&s<=12319||s===12336)||pt["CJK Unified Ideographs Extension A"](s)||pt["CJK Unified Ideographs"](s)||pt["Enclosed CJK Letters and Months"](s)||pt["Hangul Compatibility Jamo"](s)||pt["Hangul Jamo Extended-A"](s)||pt["Hangul Jamo Extended-B"](s)||pt["Hangul Jamo"](s)||pt["Hangul Syllables"](s)||pt.Hiragana(s)||pt["Ideographic Description Characters"](s)||pt.Kanbun(s)||pt["Kangxi Radicals"](s)||pt["Katakana Phonetic Extensions"](s)||pt.Katakana(s)&&s!==12540||!(!pt["Halfwidth and Fullwidth Forms"](s)||s===65288||s===65289||s===65293||s>=65306&&s<=65310||s===65339||s===65341||s===65343||s>=65371&&s<=65503||s===65507||s>=65512&&s<=65519)||!(!pt["Small Form Variants"](s)||s>=65112&&s<=65118||s>=65123&&s<=65126)||pt["Unified Canadian Aboriginal Syllabics"](s)||pt["Unified Canadian Aboriginal Syllabics Extended"](s)||pt["Vertical Forms"](s)||pt["Yijing Hexagram Symbols"](s)||pt["Yi Syllables"](s)||pt["Yi Radicals"](s))))}function yf(s){return!(Iu(s)||function(r){return!!(pt["Latin-1 Supplement"](r)&&(r===167||r===169||r===174||r===177||r===188||r===189||r===190||r===215||r===247)||pt["General Punctuation"](r)&&(r===8214||r===8224||r===8225||r===8240||r===8241||r===8251||r===8252||r===8258||r===8263||r===8264||r===8265||r===8273)||pt["Letterlike Symbols"](r)||pt["Number Forms"](r)||pt["Miscellaneous Technical"](r)&&(r>=8960&&r<=8967||r>=8972&&r<=8991||r>=8996&&r<=9e3||r===9003||r>=9085&&r<=9114||r>=9150&&r<=9165||r===9167||r>=9169&&r<=9179||r>=9186&&r<=9215)||pt["Control Pictures"](r)&&r!==9251||pt["Optical Character Recognition"](r)||pt["Enclosed Alphanumerics"](r)||pt["Geometric Shapes"](r)||pt["Miscellaneous Symbols"](r)&&!(r>=9754&&r<=9759)||pt["Miscellaneous Symbols and Arrows"](r)&&(r>=11026&&r<=11055||r>=11088&&r<=11097||r>=11192&&r<=11243)||pt["CJK Symbols and Punctuation"](r)||pt.Katakana(r)||pt["Private Use Area"](r)||pt["CJK Compatibility Forms"](r)||pt["Small Form Variants"](r)||pt["Halfwidth and Fullwidth Forms"](r)||r===8734||r===8756||r===8757||r>=9984&&r<=10087||r>=10102&&r<=10131||r===65532||r===65533)}(s))}function qo(s){return s>=1424&&s<=2303||pt["Arabic Presentation Forms-A"](s)||pt["Arabic Presentation Forms-B"](s)}function _f(s,r){return!(!r&&qo(s)||s>=2304&&s<=3583||s>=3840&&s<=4255||pt.Khmer(s))}function Tu(s){for(const r of s)if(qo(r.charCodeAt(0)))return!0;return!1}const Go=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(s){this.pluginStatus=s.pluginStatus,this.pluginURL=s.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(s){this.applyArabicShaping=s.applyArabicShaping,this.processBidirectionalText=s.processBidirectionalText,this.processStyledBidirectionalText=s.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class zr{constructor(r,a){this.zoom=r,a?(this.now=a.now,this.fadeDuration=a.fadeDuration,this.zoomHistory=a.zoomHistory,this.transition=a.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new mf,this.transition={})}isSupportedScript(r){return function(a,d){for(const m of a)if(!_f(m.charCodeAt(0),d))return!1;return!0}(r,Go.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const r=this.zoom,a=r-Math.floor(r),d=this.crossFadingFactor();return r>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:a+(1-a)*d}:{fromScale:.5,toScale:1,t:1-(1-d)*a}}}class Ul{constructor(r,a){this.property=r,this.value=a,this.expression=function(d,m){if(Na(d))return new Ol(d,m);if(ja(d)){const _=lf(d,m);if(_.result==="error")throw new Error(_.value.map(x=>`${x.key}: ${x.message}`).join(", "));return _.value}{let _=d;return m.type==="color"&&typeof d=="string"?_=kr.parse(d):m.type!=="padding"||typeof d!="number"&&!Array.isArray(d)?m.type==="variableAnchorOffsetCollection"&&Array.isArray(d)&&(_=Sn.parse(d)):_=wn.parse(d),{kind:"constant",evaluate:()=>_}}}(a===void 0?r.specification.default:a,r.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(r,a,d){return this.property.possiblyEvaluate(this,r,a,d)}}class Hs{constructor(r){this.property=r,this.value=new Ul(r,void 0)}transitioned(r,a){return new vf(this.property,this.value,a,Ee({},r.transition,this.transition),r.now)}untransitioned(){return new vf(this.property,this.value,null,{},0)}}class Ws{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitionablePropertyValues)}getValue(r){return ve(this._values[r].value.value)}setValue(r,a){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Hs(this._values[r].property)),this._values[r].value=new Ul(this._values[r].property,a===null?void 0:ve(a))}getTransition(r){return ve(this._values[r].transition)}setTransition(r,a){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Hs(this._values[r].property)),this._values[r].transition=ve(a)||void 0}serialize(){const r={};for(const a of Object.keys(this._values)){const d=this.getValue(a);d!==void 0&&(r[a]=d);const m=this.getTransition(a);m!==void 0&&(r[`${a}-transition`]=m)}return r}transitioned(r,a){const d=new Cu(this._properties);for(const m of Object.keys(this._values))d._values[m]=this._values[m].transitioned(r,a._values[m]);return d}untransitioned(){const r=new Cu(this._properties);for(const a of Object.keys(this._values))r._values[a]=this._values[a].untransitioned();return r}}class vf{constructor(r,a,d,m,_){this.property=r,this.value=a,this.begin=_+m.delay||0,this.end=this.begin+m.duration||0,r.specification.transition&&(m.delay||m.duration)&&(this.prior=d)}possiblyEvaluate(r,a,d){const m=r.now||0,_=this.value.possiblyEvaluate(r,a,d),x=this.prior;if(x){if(m>this.end)return this.prior=null,_;if(this.value.isDataDriven())return this.prior=null,_;if(m=1)return 1;const A=P*P,D=A*P;return 4*(P<.5?D:3*(P-A)+D-.75)}(S))}}return _}}class Cu{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitioningPropertyValues)}possiblyEvaluate(r,a,d){const m=new ql(this._properties);for(const _ of Object.keys(this._values))m._values[_]=this._values[_].possiblyEvaluate(r,a,d);return m}hasTransition(){for(const r of Object.keys(this._values))if(this._values[r].prior)return!0;return!1}}class Xa{constructor(r){this._properties=r,this._values=Object.create(r.defaultPropertyValues)}hasValue(r){return this._values[r].value!==void 0}getValue(r){return ve(this._values[r].value)}setValue(r,a){this._values[r]=new Ul(this._values[r].property,a===null?void 0:ve(a))}serialize(){const r={};for(const a of Object.keys(this._values)){const d=this.getValue(a);d!==void 0&&(r[a]=d)}return r}possiblyEvaluate(r,a,d){const m=new ql(this._properties);for(const _ of Object.keys(this._values))m._values[_]=this._values[_].possiblyEvaluate(r,a,d);return m}}class uo{constructor(r,a,d){this.property=r,this.value=a,this.parameters=d}isConstant(){return this.value.kind==="constant"}constantOr(r){return this.value.kind==="constant"?this.value.value:r}evaluate(r,a,d,m){return this.property.evaluate(this.value,this.parameters,r,a,d,m)}}class ql{constructor(r){this._properties=r,this._values=Object.create(r.defaultPossiblyEvaluatedValues)}get(r){return this._values[r]}}class It{constructor(r){this.specification=r}possiblyEvaluate(r,a){if(r.isDataDriven())throw new Error("Value should not be data driven");return r.expression.evaluate(a)}interpolate(r,a,d){const m=kn[this.specification.type];return m?m(r,a,d):r}}class Ot{constructor(r,a){this.specification=r,this.overrides=a}possiblyEvaluate(r,a,d,m){return new uo(this,r.expression.kind==="constant"||r.expression.kind==="camera"?{kind:"constant",value:r.expression.evaluate(a,null,{},d,m)}:r.expression,a)}interpolate(r,a,d){if(r.value.kind!=="constant"||a.value.kind!=="constant")return r;if(r.value.value===void 0||a.value.value===void 0)return new uo(this,{kind:"constant",value:void 0},r.parameters);const m=kn[this.specification.type];if(m){const _=m(r.value.value,a.value.value,d);return new uo(this,{kind:"constant",value:_},r.parameters)}return r}evaluate(r,a,d,m,_,x){return r.kind==="constant"?r.value:r.evaluate(a,d,m,_,x)}}class v extends Ot{possiblyEvaluate(r,a,d,m){if(r.value===void 0)return new uo(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){const _=r.expression.evaluate(a,null,{},d,m),x=r.property.specification.type==="resolvedImage"&&typeof _!="string"?_.name:_,S=this._calculate(x,x,x,a);return new uo(this,{kind:"constant",value:S},a)}if(r.expression.kind==="camera"){const _=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new uo(this,{kind:"constant",value:_},a)}return new uo(this,r.expression,a)}evaluate(r,a,d,m,_,x){if(r.kind==="source"){const S=r.evaluate(a,d,m,_,x);return this._calculate(S,S,S,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},d,m),r.evaluate({zoom:Math.floor(a.zoom)},d,m),r.evaluate({zoom:Math.floor(a.zoom)+1},d,m),a):r.value}_calculate(r,a,d,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:d,to:a}}interpolate(r){return r}}class i{constructor(r){this.specification=r}possiblyEvaluate(r,a,d,m){if(r.value!==void 0){if(r.expression.kind==="constant"){const _=r.expression.evaluate(a,null,{},d,m);return this._calculate(_,_,_,a)}return this._calculate(r.expression.evaluate(new zr(Math.floor(a.zoom-1),a)),r.expression.evaluate(new zr(Math.floor(a.zoom),a)),r.expression.evaluate(new zr(Math.floor(a.zoom+1),a)),a)}}_calculate(r,a,d,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:d,to:a}}interpolate(r){return r}}class h{constructor(r){this.specification=r}possiblyEvaluate(r,a,d,m){return!!r.expression.evaluate(a,null,{},d,m)}interpolate(){return!1}}class p{constructor(r){this.properties=r,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const a in r){const d=r[a];d.specification.overridable&&this.overridableProperties.push(a);const m=this.defaultPropertyValues[a]=new Ul(d,void 0),_=this.defaultTransitionablePropertyValues[a]=new Hs(d);this.defaultTransitioningPropertyValues[a]=_.untransitioned(),this.defaultPossiblyEvaluatedValues[a]=m.possiblyEvaluate({})}}}St("DataDrivenProperty",Ot),St("DataConstantProperty",It),St("CrossFadedDataDrivenProperty",v),St("CrossFadedProperty",i),St("ColorRampProperty",h);const g="-transition";class b extends nr{constructor(r,a){if(super(),this.id=r.id,this.type=r.type,this._featureFilter={filter:()=>!0,needGeometry:!1},r.type!=="custom"&&(this.metadata=r.metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new Xa(a.layout)),a.paint)){this._transitionablePaint=new Ws(a.paint);for(const d in r.paint)this.setPaintProperty(d,r.paint[d],{validate:!1});for(const d in r.layout)this.setLayoutProperty(d,r.layout[d],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ql(a.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)}setLayoutProperty(r,a,d={}){a!=null&&this._validate(zp,`layers.${this.id}.layout.${r}`,r,a,d)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)}getPaintProperty(r){return r.endsWith(g)?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)}setPaintProperty(r,a,d={}){if(a!=null&&this._validate(Ap,`layers.${this.id}.paint.${r}`,r,a,d))return!1;if(r.endsWith(g))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;{const m=this._transitionablePaint._values[r],_=m.property.specification["property-type"]==="cross-faded-data-driven",x=m.value.isDataDriven(),S=m.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);const P=this._transitionablePaint._values[r].value;return P.isDataDriven()||x||_||this._handleOverridablePaintPropertyUpdate(r,S,P)}}_handleSpecialPaintPropertyUpdate(r){}_handleOverridablePaintPropertyUpdate(r,a,d){return!1}isHidden(r){return!!(this.minzoom&&r=this.maxzoom)||this.visibility==="none"}updateTransitions(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)}serialize(){const r={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),Ye(r,(a,d)=>!(a===void 0||d==="layout"&&!Object.keys(a).length||d==="paint"&&!Object.keys(a).length))}_validate(r,a,d,m,_={}){return(!_||_.validate!==!1)&&Eu(this,r.call(Mo,{key:a,layerType:this.type,objectKey:d,value:m,styleSpec:Te,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const r in this.paint._values){const a=this.paint.get(r);if(a instanceof uo&&ps(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1}}const E={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class I{constructor(r,a){this._structArray=r,this._pos1=a*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class C{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(r,a){return r._trim(),a&&(r.isTransferred=!0,a.push(r.arrayBuffer)),{length:r.length,arrayBuffer:r.arrayBuffer}}static deserialize(r){const a=Object.create(this.prototype);return a.arrayBuffer=r.arrayBuffer,a.length=r.length,a.capacity=r.arrayBuffer.byteLength/a.bytesPerElement,a._refreshViews(),a}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(r){this.reserve(r),this.length=r}reserve(r){if(r>this.capacity){this.capacity=Math.max(r,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const a=this.uint8;this._refreshViews(),a&&this.uint8.set(a)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function L(s,r=1){let a=0,d=0;return{members:s.map(m=>{const _=E[m.type].BYTES_PER_ELEMENT,x=a=$(a,Math.max(r,_)),S=m.components||1;return d=Math.max(d,_),a+=_*S,{name:m.name,type:m.type,components:S,offset:x}}),size:$(a,Math.max(d,r)),alignment:r}}function $(s,r){return Math.ceil(s/r)*r}class O extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a){const d=this.length;return this.resize(d+1),this.emplace(d,r,a)}emplace(r,a,d){const m=2*r;return this.int16[m+0]=a,this.int16[m+1]=d,r}}O.prototype.bytesPerElement=4,St("StructArrayLayout2i4",O);class H extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.int16[_+0]=a,this.int16[_+1]=d,this.int16[_+2]=m,r}}H.prototype.bytesPerElement=6,St("StructArrayLayout3i6",H);class K extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,r,a,d,m)}emplace(r,a,d,m,_){const x=4*r;return this.int16[x+0]=a,this.int16[x+1]=d,this.int16[x+2]=m,this.int16[x+3]=_,r}}K.prototype.bytesPerElement=8,St("StructArrayLayout4i8",K);class te extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=6*r;return this.int16[P+0]=a,this.int16[P+1]=d,this.int16[P+2]=m,this.int16[P+3]=_,this.int16[P+4]=x,this.int16[P+5]=S,r}}te.prototype.bytesPerElement=12,St("StructArrayLayout2i4i12",te);class se extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=4*r,A=8*r;return this.int16[P+0]=a,this.int16[P+1]=d,this.uint8[A+4]=m,this.uint8[A+5]=_,this.uint8[A+6]=x,this.uint8[A+7]=S,r}}se.prototype.bytesPerElement=8,St("StructArrayLayout2i4ub8",se);class re extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a){const d=this.length;return this.resize(d+1),this.emplace(d,r,a)}emplace(r,a,d){const m=2*r;return this.float32[m+0]=a,this.float32[m+1]=d,r}}re.prototype.bytesPerElement=8,St("StructArrayLayout2f8",re);class ue extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D){const R=this.length;return this.resize(R+1),this.emplace(R,r,a,d,m,_,x,S,P,A,D)}emplace(r,a,d,m,_,x,S,P,A,D,R){const N=10*r;return this.uint16[N+0]=a,this.uint16[N+1]=d,this.uint16[N+2]=m,this.uint16[N+3]=_,this.uint16[N+4]=x,this.uint16[N+5]=S,this.uint16[N+6]=P,this.uint16[N+7]=A,this.uint16[N+8]=D,this.uint16[N+9]=R,r}}ue.prototype.bytesPerElement=20,St("StructArrayLayout10ui20",ue);class ye extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D,R,N){const Z=this.length;return this.resize(Z+1),this.emplace(Z,r,a,d,m,_,x,S,P,A,D,R,N)}emplace(r,a,d,m,_,x,S,P,A,D,R,N,Z){const W=12*r;return this.int16[W+0]=a,this.int16[W+1]=d,this.int16[W+2]=m,this.int16[W+3]=_,this.uint16[W+4]=x,this.uint16[W+5]=S,this.uint16[W+6]=P,this.uint16[W+7]=A,this.int16[W+8]=D,this.int16[W+9]=R,this.int16[W+10]=N,this.int16[W+11]=Z,r}}ye.prototype.bytesPerElement=24,St("StructArrayLayout4i4ui4i24",ye);class ne extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.float32[_+0]=a,this.float32[_+1]=d,this.float32[_+2]=m,r}}ne.prototype.bytesPerElement=12,St("StructArrayLayout3f12",ne);class xe extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r){const a=this.length;return this.resize(a+1),this.emplace(a,r)}emplace(r,a){return this.uint32[1*r+0]=a,r}}xe.prototype.bytesPerElement=4,St("StructArrayLayout1ul4",xe);class Ie extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A){const D=this.length;return this.resize(D+1),this.emplace(D,r,a,d,m,_,x,S,P,A)}emplace(r,a,d,m,_,x,S,P,A,D){const R=10*r,N=5*r;return this.int16[R+0]=a,this.int16[R+1]=d,this.int16[R+2]=m,this.int16[R+3]=_,this.int16[R+4]=x,this.int16[R+5]=S,this.uint32[N+3]=P,this.uint16[R+8]=A,this.uint16[R+9]=D,r}}Ie.prototype.bytesPerElement=20,St("StructArrayLayout6i1ul2ui20",Ie);class Ce extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=6*r;return this.int16[P+0]=a,this.int16[P+1]=d,this.int16[P+2]=m,this.int16[P+3]=_,this.int16[P+4]=x,this.int16[P+5]=S,r}}Ce.prototype.bytesPerElement=12,St("StructArrayLayout2i2i2i12",Ce);class je extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_){const x=this.length;return this.resize(x+1),this.emplace(x,r,a,d,m,_)}emplace(r,a,d,m,_,x){const S=4*r,P=8*r;return this.float32[S+0]=a,this.float32[S+1]=d,this.float32[S+2]=m,this.int16[P+6]=_,this.int16[P+7]=x,r}}je.prototype.bytesPerElement=16,St("StructArrayLayout2f1f2i16",je);class Je extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x){const S=this.length;return this.resize(S+1),this.emplace(S,r,a,d,m,_,x)}emplace(r,a,d,m,_,x,S){const P=16*r,A=4*r,D=8*r;return this.uint8[P+0]=a,this.uint8[P+1]=d,this.float32[A+1]=m,this.float32[A+2]=_,this.int16[D+6]=x,this.int16[D+7]=S,r}}Je.prototype.bytesPerElement=16,St("StructArrayLayout2ub2f2i16",Je);class gt extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.uint16[_+0]=a,this.uint16[_+1]=d,this.uint16[_+2]=m,r}}gt.prototype.bytesPerElement=6,St("StructArrayLayout3ui6",gt);class yt extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he){const ke=this.length;return this.resize(ke+1),this.emplace(ke,r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he)}emplace(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke){const ge=24*r,we=12*r,Re=48*r;return this.int16[ge+0]=a,this.int16[ge+1]=d,this.uint16[ge+2]=m,this.uint16[ge+3]=_,this.uint32[we+2]=x,this.uint32[we+3]=S,this.uint32[we+4]=P,this.uint16[ge+10]=A,this.uint16[ge+11]=D,this.uint16[ge+12]=R,this.float32[we+7]=N,this.float32[we+8]=Z,this.uint8[Re+36]=W,this.uint8[Re+37]=Q,this.uint8[Re+38]=ie,this.uint32[we+10]=he,this.int16[ge+22]=ke,r}}yt.prototype.bytesPerElement=48,St("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",yt);class Qe extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke,ge,we,Re,He,ht,zt,dt,ut,Mt,kt){const vt=this.length;return this.resize(vt+1),this.emplace(vt,r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke,ge,we,Re,He,ht,zt,dt,ut,Mt,kt)}emplace(r,a,d,m,_,x,S,P,A,D,R,N,Z,W,Q,ie,he,ke,ge,we,Re,He,ht,zt,dt,ut,Mt,kt,vt){const Ne=32*r,Tt=16*r;return this.int16[Ne+0]=a,this.int16[Ne+1]=d,this.int16[Ne+2]=m,this.int16[Ne+3]=_,this.int16[Ne+4]=x,this.int16[Ne+5]=S,this.int16[Ne+6]=P,this.int16[Ne+7]=A,this.uint16[Ne+8]=D,this.uint16[Ne+9]=R,this.uint16[Ne+10]=N,this.uint16[Ne+11]=Z,this.uint16[Ne+12]=W,this.uint16[Ne+13]=Q,this.uint16[Ne+14]=ie,this.uint16[Ne+15]=he,this.uint16[Ne+16]=ke,this.uint16[Ne+17]=ge,this.uint16[Ne+18]=we,this.uint16[Ne+19]=Re,this.uint16[Ne+20]=He,this.uint16[Ne+21]=ht,this.uint16[Ne+22]=zt,this.uint32[Tt+12]=dt,this.float32[Tt+13]=ut,this.float32[Tt+14]=Mt,this.uint16[Ne+30]=kt,this.uint16[Ne+31]=vt,r}}Qe.prototype.bytesPerElement=64,St("StructArrayLayout8i15ui1ul2f2ui64",Qe);class it extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r){const a=this.length;return this.resize(a+1),this.emplace(a,r)}emplace(r,a){return this.float32[1*r+0]=a,r}}it.prototype.bytesPerElement=4,St("StructArrayLayout1f4",it);class Et extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=3*r;return this.uint16[6*r+0]=a,this.float32[_+1]=d,this.float32[_+2]=m,r}}Et.prototype.bytesPerElement=12,St("StructArrayLayout1ui2f12",Et);class Ut extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a,d){const m=this.length;return this.resize(m+1),this.emplace(m,r,a,d)}emplace(r,a,d,m){const _=4*r;return this.uint32[2*r+0]=a,this.uint16[_+2]=d,this.uint16[_+3]=m,r}}Ut.prototype.bytesPerElement=8,St("StructArrayLayout1ul2ui8",Ut);class st extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,a){const d=this.length;return this.resize(d+1),this.emplace(d,r,a)}emplace(r,a,d){const m=2*r;return this.uint16[m+0]=a,this.uint16[m+1]=d,r}}st.prototype.bytesPerElement=4,St("StructArrayLayout2ui4",st);class ft extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r){const a=this.length;return this.resize(a+1),this.emplace(a,r)}emplace(r,a){return this.uint16[1*r+0]=a,r}}ft.prototype.bytesPerElement=2,St("StructArrayLayout1ui2",ft);class jt extends C{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,a,d,m){const _=this.length;return this.resize(_+1),this.emplace(_,r,a,d,m)}emplace(r,a,d,m,_){const x=4*r;return this.float32[x+0]=a,this.float32[x+1]=d,this.float32[x+2]=m,this.float32[x+3]=_,r}}jt.prototype.bytesPerElement=16,St("StructArrayLayout4f16",jt);class jr extends I{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new k(this.anchorPointX,this.anchorPointY)}}jr.prototype.size=20;class Qt extends Ie{get(r){return new jr(this,r)}}St("CollisionBoxArray",Qt);class ar extends I{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(r){this._structArray.uint8[this._pos1+37]=r}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(r){this._structArray.uint8[this._pos1+38]=r}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(r){this._structArray.uint32[this._pos4+10]=r}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ar.prototype.size=48;class Vr extends yt{get(r){return new ar(this,r)}}St("PlacedSymbolArray",Vr);class ji extends I{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(r){this._structArray.uint32[this._pos4+12]=r}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}ji.prototype.size=64;class jn extends Qe{get(r){return new ji(this,r)}}St("SymbolInstanceArray",jn);class Ur extends it{getoffsetX(r){return this.float32[1*r+0]}}St("GlyphOffsetArray",Ur);class fn extends H{getx(r){return this.int16[3*r+0]}gety(r){return this.int16[3*r+1]}gettileUnitDistanceFromAnchor(r){return this.int16[3*r+2]}}St("SymbolLineVertexArray",fn);class en extends I{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}en.prototype.size=12;class Vi extends Et{get(r){return new en(this,r)}}St("TextAnchorOffsetArray",Vi);class Ui extends I{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Ui.prototype.size=8;class Vn extends Ut{get(r){return new Ui(this,r)}}St("FeatureIndexArray",Vn);class vs extends O{}class Gl extends O{}class Xs extends O{}class bs extends te{}class Zl extends se{}class Au extends re{}class Li extends ue{}class Un extends ye{}class Zo extends ne{}class Js extends xe{}class qi extends Ce{}class Gi extends Je{}class Ii extends gt{}class Xr extends st{}const Ks=L([{name:"a_pos",components:2,type:"Int16"}],4),{members:zu}=Ks;class wi{constructor(r=[]){this.segments=r}prepareSegment(r,a,d,m){let _=this.segments[this.segments.length-1];return r>wi.MAX_VERTEX_ARRAY_LENGTH&&at(`Max vertices per segment is ${wi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}`),(!_||_.vertexLength+r>wi.MAX_VERTEX_ARRAY_LENGTH||_.sortKey!==m)&&(_={vertexOffset:a.length,primitiveOffset:d.length,vertexLength:0,primitiveLength:0},m!==void 0&&(_.sortKey=m),this.segments.push(_)),_}get(){return this.segments}destroy(){for(const r of this.segments)for(const a in r.vaos)r.vaos[a].destroy()}static simpleSegment(r,a,d,m){return new wi([{vertexOffset:r,primitiveOffset:a,vertexLength:d,primitiveLength:m,vaos:{},sortKey:0}])}}function bf(s,r){return 256*(s=X(Math.floor(s),0,255))+X(Math.floor(r),0,255)}wi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,St("SegmentVector",wi);const Hl=L([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Wl={exports:{}},Ho={exports:{}};Ho.exports=function(s,r){var a,d,m,_,x,S,P,A;for(d=s.length-(a=3&s.length),m=r,x=3432918353,S=461845907,A=0;A>>16)*x&65535)<<16)&4294967295)<<15|P>>>17))*S+(((P>>>16)*S&65535)<<16)&4294967295)<<13|m>>>19))+((5*(m>>>16)&65535)<<16)&4294967295))+((58964+(_>>>16)&65535)<<16);switch(P=0,a){case 3:P^=(255&s.charCodeAt(A+2))<<16;case 2:P^=(255&s.charCodeAt(A+1))<<8;case 1:m^=P=(65535&(P=(P=(65535&(P^=255&s.charCodeAt(A)))*x+(((P>>>16)*x&65535)<<16)&4294967295)<<15|P>>>17))*S+(((P>>>16)*S&65535)<<16)&4294967295}return m^=s.length,m=2246822507*(65535&(m^=m>>>16))+((2246822507*(m>>>16)&65535)<<16)&4294967295,m=3266489909*(65535&(m^=m>>>13))+((3266489909*(m>>>16)&65535)<<16)&4294967295,(m^=m>>>16)>>>0};var xf=Ho.exports,Lu={exports:{}};Lu.exports=function(s,r){for(var a,d=s.length,m=r^d,_=0;d>=4;)a=1540483477*(65535&(a=255&s.charCodeAt(_)|(255&s.charCodeAt(++_))<<8|(255&s.charCodeAt(++_))<<16|(255&s.charCodeAt(++_))<<24))+((1540483477*(a>>>16)&65535)<<16),m=1540483477*(65535&m)+((1540483477*(m>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),d-=4,++_;switch(d){case 3:m^=(255&s.charCodeAt(_+2))<<16;case 2:m^=(255&s.charCodeAt(_+1))<<8;case 1:m=1540483477*(65535&(m^=255&s.charCodeAt(_)))+((1540483477*(m>>>16)&65535)<<16)}return m=1540483477*(65535&(m^=m>>>13))+((1540483477*(m>>>16)&65535)<<16),(m^=m>>>15)>>>0};var Du=xf,Fu=Lu.exports;Wl.exports=Du,Wl.exports.murmur3=Du,Wl.exports.murmur2=Fu;var Xl=y(Wl.exports);class Ys{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(r,a,d,m){this.ids.push(Qy(r)),this.positions.push(a,d,m)}getPositions(r){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const a=Qy(r);let d=0,m=this.ids.length-1;for(;d>1;this.ids[x]>=a?m=x:d=x+1}const _=[];for(;this.ids[d]===a;)_.push({index:this.positions[3*d],start:this.positions[3*d+1],end:this.positions[3*d+2]}),d++;return _}static serialize(r,a){const d=new Float64Array(r.ids),m=new Uint32Array(r.positions);return Dp(d,m,0,d.length-1),a&&a.push(d.buffer,m.buffer),{ids:d,positions:m}}static deserialize(r){const a=new Ys;return a.ids=r.ids,a.positions=r.positions,a.indexed=!0,a}}function Qy(s){const r=+s;return!isNaN(r)&&r<=Number.MAX_SAFE_INTEGER?r:Xl(String(s))}function Dp(s,r,a,d){for(;a>1];let _=a-1,x=d+1;for(;;){do _++;while(s[_]m);if(_>=x)break;wf(s,_,x),wf(r,3*_,3*x),wf(r,3*_+1,3*x+1),wf(r,3*_+2,3*x+2)}x-a`u_${m}`),this.type=d}setUniform(r,a,d){r.set(d.constantOr(this.value))}getBinding(r,a,d){return this.type==="color"?new t_(r,a):new Sf(r,a)}}class Jl{constructor(r,a){this.uniformNames=a.map(d=>`u_${d}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(r,a){this.pixelRatioFrom=a.pixelRatio,this.pixelRatioTo=r.pixelRatio,this.patternFrom=a.tlbr,this.patternTo=r.tlbr}setUniform(r,a,d,m){const _=m==="u_pattern_to"?this.patternTo:m==="u_pattern_from"?this.patternFrom:m==="u_pixel_ratio_to"?this.pixelRatioTo:m==="u_pixel_ratio_from"?this.pixelRatioFrom:null;_&&r.set(_)}getBinding(r,a,d){return d.substr(0,9)==="u_pattern"?new e_(r,a):new Sf(r,a)}}class xs{constructor(r,a,d,m){this.expression=r,this.type=d,this.maxValue=0,this.paintVertexAttributes=a.map(_=>({name:`a_${_}`,type:"Float32",components:d==="color"?2:1,offset:0})),this.paintVertexArray=new m}populatePaintArray(r,a,d,m,_){const x=this.paintVertexArray.length,S=this.expression.evaluate(new zr(0),a,{},m,[],_);this.paintVertexArray.resize(r),this._setPaintValue(x,r,S)}updatePaintArray(r,a,d,m){const _=this.expression.evaluate({zoom:0},d,m);this._setPaintValue(r,a,_)}_setPaintValue(r,a,d){if(this.type==="color"){const m=Fp(d);for(let _=r;_`u_${S}_t`),this.type=d,this.useIntegerZoom=m,this.zoom=_,this.maxValue=0,this.paintVertexAttributes=a.map(S=>({name:`a_${S}`,type:"Float32",components:d==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(r,a,d,m,_){const x=this.expression.evaluate(new zr(this.zoom),a,{},m,[],_),S=this.expression.evaluate(new zr(this.zoom+1),a,{},m,[],_),P=this.paintVertexArray.length;this.paintVertexArray.resize(r),this._setPaintValue(P,r,x,S)}updatePaintArray(r,a,d,m){const _=this.expression.evaluate({zoom:this.zoom},d,m),x=this.expression.evaluate({zoom:this.zoom+1},d,m);this._setPaintValue(r,a,_,x)}_setPaintValue(r,a,d,m){if(this.type==="color"){const _=Fp(d),x=Fp(m);for(let S=r;S`#define HAS_UNIFORM_${m}`))}return r}getBinderAttributes(){const r=[];for(const a in this.binders){const d=this.binders[a];if(d instanceof xs||d instanceof Io)for(let m=0;m!0){this.programConfigurations={};for(const m of r)this.programConfigurations[m.id]=new r_(m,a,d);this.needsUpload=!1,this._featureMap=new Ys,this._bufferOffset=0}populatePaintArrays(r,a,d,m,_,x){for(const S in this.programConfigurations)this.programConfigurations[S].populatePaintArrays(r,a,m,_,x);a.id!==void 0&&this._featureMap.add(a.id,d,this._bufferOffset,r),this._bufferOffset=r,this.needsUpload=!0}updatePaintArrays(r,a,d,m){for(const _ of d)this.needsUpload=this.programConfigurations[_.id].updatePaintArrays(r,this._featureMap,a,_,m)||this.needsUpload}get(r){return this.programConfigurations[r]}upload(r){if(this.needsUpload){for(const a in this.programConfigurations)this.programConfigurations[a].upload(r);this.needsUpload=!1}}destroy(){for(const r in this.programConfigurations)this.programConfigurations[r].destroy()}}function G2(s,r){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[s]||[s.replace(`${r}-`,"").replace(/-/g,"_")]}function i_(s,r,a){const d={color:{source:re,composite:jt},number:{source:it,composite:re}},m=function(_){return{"line-pattern":{source:Li,composite:Li},"fill-pattern":{source:Li,composite:Li},"fill-extrusion-pattern":{source:Li,composite:Li}}[_]}(s);return m&&m[a]||d[r][a]}St("ConstantBinder",Ru),St("CrossFadedConstantBinder",Jl),St("SourceExpressionBinder",xs),St("CrossFadedCompositeBinder",Qs),St("CompositeExpressionBinder",Io),St("ProgramConfiguration",r_,{omit:["_buffers"]}),St("ProgramConfigurationSet",Ka);const mi=8192,Rp=Math.pow(2,14)-1,n_=-Rp-1;function Ya(s){const r=mi/s.extent,a=s.loadGeometry();for(let d=0;dx.x+1||Px.y+1)&&at("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return a}function Qa(s,r){return{type:s.type,id:s.id,properties:s.properties,geometry:r?Ya(s):[]}}function kf(s,r,a,d,m){s.emplaceBack(2*r+(d+1)/2,2*a+(m+1)/2)}class Bp{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(a=>a.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new Gl,this.indexArray=new Ii,this.segments=new wi,this.programConfigurations=new Ka(r.layers,r.zoom),this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){const m=this.layers[0],_=[];let x=null,S=!1;m.type==="circle"&&(x=m.layout.get("circle-sort-key"),S=!x.isConstant());for(const{feature:P,id:A,index:D,sourceLayerIndex:R}of r){const N=this.layers[0]._featureFilter.needGeometry,Z=Qa(P,N);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),Z,d))continue;const W=S?x.evaluate(Z,{},d):void 0,Q={id:A,properties:P.properties,type:P.type,sourceLayerIndex:R,index:D,geometry:N?Z.geometry:Ya(P),patterns:{},sortKey:W};_.push(Q)}S&&_.sort((P,A)=>P.sortKey-A.sortKey);for(const P of _){const{geometry:A,index:D,sourceLayerIndex:R}=P,N=r[D].feature;this.addFeature(P,A,D,d),a.featureIndex.insert(N,A,D,R,this.index)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,zu),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(r,a,d,m){for(const _ of a)for(const x of _){const S=x.x,P=x.y;if(S<0||S>=mi||P<0||P>=mi)continue;const A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,r.sortKey),D=A.vertexLength;kf(this.layoutVertexArray,S,P,-1,-1),kf(this.layoutVertexArray,S,P,1,-1),kf(this.layoutVertexArray,S,P,1,1),kf(this.layoutVertexArray,S,P,-1,1),this.indexArray.emplaceBack(D,D+1,D+2),this.indexArray.emplaceBack(D,D+3,D+2),A.vertexLength+=4,A.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,d,{},m)}}function o_(s,r){for(let a=0;a1){if(Op(s,r))return!0;for(let d=0;d1?a:a.sub(r)._mult(m)._add(r))}function l_(s,r){let a,d,m,_=!1;for(let x=0;xr.y!=m.y>r.y&&r.x<(m.x-d.x)*(r.y-d.y)/(m.y-d.y)+d.x&&(_=!_)}return _}function Kl(s,r){let a=!1;for(let d=0,m=s.length-1;dr.y!=x.y>r.y&&r.x<(x.x-_.x)*(r.y-_.y)/(x.y-_.y)+_.x&&(a=!a)}return a}function X2(s,r,a){const d=a[0],m=a[2];if(s.xm.x&&r.x>m.x||s.ym.y&&r.y>m.y)return!1;const _=mt(s,r,a[0]);return _!==mt(s,r,a[1])||_!==mt(s,r,a[2])||_!==mt(s,r,a[3])}function Bu(s,r,a){const d=r.paint.get(s).value;return d.kind==="constant"?d.value:a.programConfigurations.get(r.id).getMaxValue(s)}function Ef(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}function Pf(s,r,a,d,m){if(!r[0]&&!r[1])return s;const _=k.convert(r)._mult(m);a==="viewport"&&_._rotate(-d);const x=[];for(let S=0;Sf_(ie,Q))}(A,P),Z=R?D*S:D;for(const W of m)for(const Q of W){const ie=R?Q:f_(Q,P);let he=Z;const ke=Mf([],[Q.x,Q.y,0,1],P);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?he*=ke[3]/x.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(he*=x.cameraToCenterDistance/ke[3]),Z2(N,ie,he))return!0}return!1}}function f_(s,r){const a=Mf([],[s.x,s.y,0,1],r);return new k(a[0]/a[3],a[1]/a[3])}class d_ extends Bp{}let p_;St("HeatmapBucket",d_,{omit:["layers"]});var Q2={get paint(){return p_=p_||new p({"heatmap-radius":new Ot(Te.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ot(Te.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new It(Te.paint_heatmap["heatmap-intensity"]),"heatmap-color":new h(Te.paint_heatmap["heatmap-color"]),"heatmap-opacity":new It(Te.paint_heatmap["heatmap-opacity"])})}};function jp(s,{width:r,height:a},d,m){if(m){if(m instanceof Uint8ClampedArray)m=new Uint8Array(m.buffer);else if(m.length!==r*a*d)throw new RangeError(`mismatched image size. expected: ${m.length} but got: ${r*a*d}`)}else m=new Uint8Array(r*a*d);return s.width=r,s.height=a,s.data=m,s}function m_(s,{width:r,height:a},d){if(r===s.width&&a===s.height)return;const m=jp({},{width:r,height:a},d);Vp(s,m,{x:0,y:0},{x:0,y:0},{width:Math.min(s.width,r),height:Math.min(s.height,a)},d),s.width=r,s.height=a,s.data=m.data}function Vp(s,r,a,d,m,_){if(m.width===0||m.height===0)return r;if(m.width>s.width||m.height>s.height||a.x>s.width-m.width||a.y>s.height-m.height)throw new RangeError("out of range source coordinates for image copy");if(m.width>r.width||m.height>r.height||d.x>r.width-m.width||d.y>r.height-m.height)throw new RangeError("out of range destination coordinates for image copy");const x=s.data,S=r.data;if(x===S)throw new Error("srcData equals dstData, so image is already copied");for(let P=0;P{r[s.evaluationKey]=P;const A=s.expression.evaluate(r);m.data[x+S+0]=Math.floor(255*A.r/A.a),m.data[x+S+1]=Math.floor(255*A.g/A.a),m.data[x+S+2]=Math.floor(255*A.b/A.a),m.data[x+S+3]=Math.floor(255*A.a)};if(s.clips)for(let x=0,S=0;x80*a){d=_=s[0],m=x=s[1];for(var W=a;W_&&(_=S),P>x&&(x=P);A=(A=Math.max(_-d,x-m))!==0?32767/A:0}return Nu(N,Z,a,d,m,A,0),Z}function __(s,r,a,d,m){var _,x;if(m===Zp(s,r,a,d)>0)for(_=r;_=r;_-=d)x=x_(_,s[_],s[_+1],x);return x&&Tf(x,x.next)&&(Vu(x),x=x.next),x}function el(s,r){if(!s)return s;r||(r=s);var a,d=s;do if(a=!1,d.steiner||!Tf(d,d.next)&&ui(d.prev,d,d.next)!==0)d=d.next;else{if(Vu(d),(d=r=d.prev)===d.next)break;a=!0}while(a||d!==r);return r}function Nu(s,r,a,d,m,_,x){if(s){!x&&_&&function(D,R,N,Z){var W=D;do W.z===0&&(W.z=qp(W.x,W.y,R,N,Z)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==D);W.prevZ.nextZ=null,W.prevZ=null,function(Q){var ie,he,ke,ge,we,Re,He,ht,zt=1;do{for(he=Q,Q=null,we=null,Re=0;he;){for(Re++,ke=he,He=0,ie=0;ie0||ht>0&&ke;)He!==0&&(ht===0||!ke||he.z<=ke.z)?(ge=he,he=he.nextZ,He--):(ge=ke,ke=ke.nextZ,ht--),we?we.nextZ=ge:Q=ge,ge.prevZ=we,we=ge;he=ke}we.nextZ=null,zt*=2}while(Re>1)}(W)}(s,d,m,_);for(var S,P,A=s;s.prev!==s.next;)if(S=s.prev,P=s.next,_?sS(s,d,m,_):oS(s))r.push(S.i/a|0),r.push(s.i/a|0),r.push(P.i/a|0),Vu(s),s=P.next,A=P.next;else if((s=P)===A){x?x===1?Nu(s=aS(el(s),r,a),r,a,d,m,_,2):x===2&&lS(s,r,a,d,m,_):Nu(el(s),r,a,d,m,_,1);break}}}function oS(s){var r=s.prev,a=s,d=s.next;if(ui(r,a,d)>=0)return!1;for(var m=r.x,_=a.x,x=d.x,S=r.y,P=a.y,A=d.y,D=m<_?m_?m>x?m:x:_>x?_:x,Z=S>P?S>A?S:A:P>A?P:A,W=d.next;W!==r;){if(W.x>=D&&W.x<=N&&W.y>=R&&W.y<=Z&&Ql(m,S,_,P,x,A,W.x,W.y)&&ui(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function sS(s,r,a,d){var m=s.prev,_=s,x=s.next;if(ui(m,_,x)>=0)return!1;for(var S=m.x,P=_.x,A=x.x,D=m.y,R=_.y,N=x.y,Z=SP?S>A?S:A:P>A?P:A,ie=D>R?D>N?D:N:R>N?R:N,he=qp(Z,W,r,a,d),ke=qp(Q,ie,r,a,d),ge=s.prevZ,we=s.nextZ;ge&&ge.z>=he&&we&&we.z<=ke;){if(ge.x>=Z&&ge.x<=Q&&ge.y>=W&&ge.y<=ie&&ge!==m&&ge!==x&&Ql(S,D,P,R,A,N,ge.x,ge.y)&&ui(ge.prev,ge,ge.next)>=0||(ge=ge.prevZ,we.x>=Z&&we.x<=Q&&we.y>=W&&we.y<=ie&&we!==m&&we!==x&&Ql(S,D,P,R,A,N,we.x,we.y)&&ui(we.prev,we,we.next)>=0))return!1;we=we.nextZ}for(;ge&&ge.z>=he;){if(ge.x>=Z&&ge.x<=Q&&ge.y>=W&&ge.y<=ie&&ge!==m&&ge!==x&&Ql(S,D,P,R,A,N,ge.x,ge.y)&&ui(ge.prev,ge,ge.next)>=0)return!1;ge=ge.prevZ}for(;we&&we.z<=ke;){if(we.x>=Z&&we.x<=Q&&we.y>=W&&we.y<=ie&&we!==m&&we!==x&&Ql(S,D,P,R,A,N,we.x,we.y)&&ui(we.prev,we,we.next)>=0)return!1;we=we.nextZ}return!0}function aS(s,r,a){var d=s;do{var m=d.prev,_=d.next.next;!Tf(m,_)&&v_(m,d,d.next,_)&&ju(m,_)&&ju(_,m)&&(r.push(m.i/a|0),r.push(d.i/a|0),r.push(_.i/a|0),Vu(d),Vu(d.next),d=s=_),d=d.next}while(d!==s);return el(d)}function lS(s,r,a,d,m,_){var x=s;do{for(var S=x.next.next;S!==x.prev;){if(x.i!==S.i&&dS(x,S)){var P=b_(x,S);return x=el(x,x.next),P=el(P,P.next),Nu(x,r,a,d,m,_,0),void Nu(P,r,a,d,m,_,0)}S=S.next}x=x.next}while(x!==s)}function cS(s,r){return s.x-r.x}function uS(s,r){var a=function(m,_){var x,S=_,P=m.x,A=m.y,D=-1/0;do{if(A<=S.y&&A>=S.next.y&&S.next.y!==S.y){var R=S.x+(A-S.y)*(S.next.x-S.x)/(S.next.y-S.y);if(R<=P&&R>D&&(D=R,x=S.x=S.x&&S.x>=W&&P!==S.x&&Ql(Ax.x||S.x===x.x&&hS(x,S)))&&(x=S,ie=N)),S=S.next;while(S!==Z);return x}(s,r);if(!a)return r;var d=b_(a,s);return el(d,d.next),el(a,a.next)}function hS(s,r){return ui(s.prev,s,r.prev)<0&&ui(r.next,s,s.next)<0}function qp(s,r,a,d,m){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-a)*m|0)|s<<8))|s<<4))|s<<2))|s<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-d)*m|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function fS(s){var r=s,a=s;do(r.x=(s-x)*(_-S)&&(s-x)*(d-S)>=(a-x)*(r-S)&&(a-x)*(_-S)>=(m-x)*(d-S)}function dS(s,r){return s.next.i!==r.i&&s.prev.i!==r.i&&!function(a,d){var m=a;do{if(m.i!==a.i&&m.next.i!==a.i&&m.i!==d.i&&m.next.i!==d.i&&v_(m,m.next,a,d))return!0;m=m.next}while(m!==a);return!1}(s,r)&&(ju(s,r)&&ju(r,s)&&function(a,d){var m=a,_=!1,x=(a.x+d.x)/2,S=(a.y+d.y)/2;do m.y>S!=m.next.y>S&&m.next.y!==m.y&&x<(m.next.x-m.x)*(S-m.y)/(m.next.y-m.y)+m.x&&(_=!_),m=m.next;while(m!==a);return _}(s,r)&&(ui(s.prev,s,r.prev)||ui(s,r.prev,r))||Tf(s,r)&&ui(s.prev,s,s.next)>0&&ui(r.prev,r,r.next)>0)}function ui(s,r,a){return(r.y-s.y)*(a.x-r.x)-(r.x-s.x)*(a.y-r.y)}function Tf(s,r){return s.x===r.x&&s.y===r.y}function v_(s,r,a,d){var m=Af(ui(s,r,a)),_=Af(ui(s,r,d)),x=Af(ui(a,d,s)),S=Af(ui(a,d,r));return m!==_&&x!==S||!(m!==0||!Cf(s,a,r))||!(_!==0||!Cf(s,d,r))||!(x!==0||!Cf(a,s,d))||!(S!==0||!Cf(a,r,d))}function Cf(s,r,a){return r.x<=Math.max(s.x,a.x)&&r.x>=Math.min(s.x,a.x)&&r.y<=Math.max(s.y,a.y)&&r.y>=Math.min(s.y,a.y)}function Af(s){return s>0?1:s<0?-1:0}function ju(s,r){return ui(s.prev,s,s.next)<0?ui(s,r,s.next)>=0&&ui(s,s.prev,r)>=0:ui(s,r,s.prev)<0||ui(s,s.next,r)<0}function b_(s,r){var a=new Gp(s.i,s.x,s.y),d=new Gp(r.i,r.x,r.y),m=s.next,_=r.prev;return s.next=r,r.prev=s,a.next=m,m.prev=a,d.next=a,a.prev=d,_.next=d,d.prev=_,d}function x_(s,r,a,d){var m=new Gp(s,r,a);return d?(m.next=d.next,m.prev=d,d.next.prev=m,d.next=m):(m.prev=m,m.next=m),m}function Vu(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Gp(s,r,a){this.i=s,this.x=r,this.y=a,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Zp(s,r,a,d){for(var m=0,_=r,x=a-d;_0&&a.holes.push(d+=s[m-1].length)}return a};var w_=y(Up.exports);function Hp(s,r,a){const d=a.patternDependencies;let m=!1;for(const _ of r){const x=_.paint.get(`${s}-pattern`);x.isConstant()||(m=!0);const S=x.constantOr(null);S&&(m=!0,d[S.to]=!0,d[S.from]=!0)}return m}function Wp(s,r,a,d,m){const _=m.patternDependencies;for(const x of r){const S=x.paint.get(`${s}-pattern`).value;if(S.kind!=="constant"){let P=S.evaluate({zoom:d-1},a,{},m.availableImages),A=S.evaluate({zoom:d},a,{},m.availableImages),D=S.evaluate({zoom:d+1},a,{},m.availableImages);P=P&&P.name?P.name:P,A=A&&A.name?A.name:A,D=D&&D.name?D.name:D,_[P]=!0,_[A]=!0,_[D]=!0,a.patterns[x.id]={min:P,mid:A,max:D}}}return a}class Xp{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(a=>a.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Xs,this.indexArray=new Ii,this.indexArray2=new Xr,this.programConfigurations=new Ka(r.layers,r.zoom),this.segments=new wi,this.segments2=new wi,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){this.hasPattern=Hp("fill",this.layers,a);const m=this.layers[0].layout.get("fill-sort-key"),_=!m.isConstant(),x=[];for(const{feature:S,id:P,index:A,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,N=Qa(S,R);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),N,d))continue;const Z=_?m.evaluate(N,{},d,a.availableImages):void 0,W={id:P,properties:S.properties,type:S.type,sourceLayerIndex:D,index:A,geometry:R?N.geometry:Ya(S),patterns:{},sortKey:Z};x.push(W)}_&&x.sort((S,P)=>S.sortKey-P.sortKey);for(const S of x){const{geometry:P,index:A,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Wp("fill",this.layers,S,this.zoom,a);this.patternFeatures.push(R)}else this.addFeature(S,P,A,d,{});a.featureIndex.insert(r[A].feature,P,A,D,this.index)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}addFeatures(r,a,d){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,a,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,nS),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.indexBuffer2=r.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(r,a,d,m,_){for(const x of Pl(a,500)){let S=0;for(const Z of x)S+=Z.length;const P=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray),A=P.vertexLength,D=[],R=[];for(const Z of x){if(Z.length===0)continue;Z!==x[0]&&R.push(D.length/2);const W=this.segments2.prepareSegment(Z.length,this.layoutVertexArray,this.indexArray2),Q=W.vertexLength;this.layoutVertexArray.emplaceBack(Z[0].x,Z[0].y),this.indexArray2.emplaceBack(Q+Z.length-1,Q),D.push(Z[0].x),D.push(Z[0].y);for(let ie=1;ie>3}if(m--,d===1||d===2)_+=s.readSVarint(),x+=s.readSVarint(),d===1&&(r&&S.push(r),r=[]),r.push(new vS(_,x));else{if(d!==7)throw new Error("unknown command "+d);r&&r.push(r[0].clone())}}return r&&S.push(r),S},ec.prototype.bbox=function(){var s=this._pbf;s.pos=this._geometry;for(var r=s.readVarint()+s.pos,a=1,d=0,m=0,_=0,x=1/0,S=-1/0,P=1/0,A=-1/0;s.pos>3}if(d--,a===1||a===2)(m+=s.readSVarint())S&&(S=m),(_+=s.readSVarint())A&&(A=_);else if(a!==7)throw new Error("unknown command "+a)}return[x,P,S,A]},ec.prototype.toGeoJSON=function(s,r,a){var d,m,_=this.extent*Math.pow(2,a),x=this.extent*s,S=this.extent*r,P=this.loadGeometry(),A=ec.types[this.type];function D(Z){for(var W=0;W>3;m=x===1?d.readString():x===2?d.readFloat():x===3?d.readDouble():x===4?d.readVarint64():x===5?d.readVarint():x===6?d.readSVarint():x===7?d.readBoolean():null}return m}(a))}M_.prototype.feature=function(s){if(s<0||s>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[s];var r=this._pbf.readVarint()+this._pbf.pos;return new wS(this._pbf,r,this.extent,this._keys,this._values)};var kS=P_;function ES(s,r,a){if(s===3){var d=new kS(a,a.readVarint()+a.pos);d.length&&(r[d.name]=d)}}ea.VectorTile=function(s,r){this.layers=s.readFields(ES,{},r)},ea.VectorTileFeature=E_,ea.VectorTileLayer=P_;const PS=ea.VectorTileFeature.types,Jp=Math.pow(2,13);function Uu(s,r,a,d,m,_,x,S){s.emplaceBack(r,a,2*Math.floor(d*Jp)+x,m*Jp*2,_*Jp*2,Math.round(S))}class Kp{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(a=>a.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new bs,this.centroidVertexArray=new vs,this.indexArray=new Ii,this.programConfigurations=new Ka(r.layers,r.zoom),this.segments=new wi,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){this.features=[],this.hasPattern=Hp("fill-extrusion",this.layers,a);for(const{feature:m,id:_,index:x,sourceLayerIndex:S}of r){const P=this.layers[0]._featureFilter.needGeometry,A=Qa(m,P);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),A,d))continue;const D={id:_,sourceLayerIndex:S,index:x,geometry:P?A.geometry:Ya(m),properties:m.properties,type:m.type,patterns:{}};this.hasPattern?this.features.push(Wp("fill-extrusion",this.layers,D,this.zoom,a)):this.addFeature(D,D.geometry,x,d,{}),a.featureIndex.insert(m,D.geometry,x,S,this.index,!0)}}addFeatures(r,a,d){for(const m of this.features){const{geometry:_}=m;this.addFeature(m,_,m.index,a,d)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,_S),this.centroidVertexBuffer=r.createVertexBuffer(this.centroidVertexArray,yS.members,!0),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(r,a,d,m,_){for(const x of Pl(a,500)){const S={x:0,y:0,vertexCount:0};let P=0;for(const W of x)P+=W.length;let A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const W of x){if(W.length===0||IS(W))continue;let Q=0;for(let ie=0;ie=1){const ke=W[ie-1];if(!MS(he,ke)){A.vertexLength+4>wi.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ge=he.sub(ke)._perp()._unit(),we=ke.dist(he);Q+we>32768&&(Q=0),Uu(this.layoutVertexArray,he.x,he.y,ge.x,ge.y,0,0,Q),Uu(this.layoutVertexArray,he.x,he.y,ge.x,ge.y,0,1,Q),S.x+=2*he.x,S.y+=2*he.y,S.vertexCount+=2,Q+=we,Uu(this.layoutVertexArray,ke.x,ke.y,ge.x,ge.y,0,0,Q),Uu(this.layoutVertexArray,ke.x,ke.y,ge.x,ge.y,0,1,Q),S.x+=2*ke.x,S.y+=2*ke.y,S.vertexCount+=2;const Re=A.vertexLength;this.indexArray.emplaceBack(Re,Re+2,Re+1),this.indexArray.emplaceBack(Re+1,Re+2,Re+3),A.vertexLength+=4,A.primitiveLength+=2}}}}if(A.vertexLength+P>wi.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(P,this.layoutVertexArray,this.indexArray)),PS[r.type]!=="Polygon")continue;const D=[],R=[],N=A.vertexLength;for(const W of x)if(W.length!==0){W!==x[0]&&R.push(D.length/2);for(let Q=0;Qmi)||s.y===r.y&&(s.y<0||s.y>mi)}function IS(s){return s.every(r=>r.x<0)||s.every(r=>r.x>mi)||s.every(r=>r.y<0)||s.every(r=>r.y>mi)}let I_;St("FillExtrusionBucket",Kp,{omit:["layers","features"]});var TS={get paint(){return I_=I_||new p({"fill-extrusion-opacity":new It(Te["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ot(Te["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new It(Te["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new It(Te["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new v(Te["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ot(Te["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ot(Te["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new It(Te["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class CS extends b{constructor(r){super(r,TS)}createBucket(r){return new Kp(r)}queryRadius(){return Ef(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(r,a,d,m,_,x,S,P){const A=Pf(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,S),D=this.paint.get("fill-extrusion-height").evaluate(a,d),R=this.paint.get("fill-extrusion-base").evaluate(a,d),N=function(W,Q,ie,he){const ke=[];for(const ge of W){const we=[ge.x,ge.y,0,1];Mf(we,we,Q),ke.push(new k(we[0]/we[3],we[1]/we[3]))}return ke}(A,P),Z=function(W,Q,ie,he){const ke=[],ge=[],we=he[8]*Q,Re=he[9]*Q,He=he[10]*Q,ht=he[11]*Q,zt=he[8]*ie,dt=he[9]*ie,ut=he[10]*ie,Mt=he[11]*ie;for(const kt of W){const vt=[],Ne=[];for(const Tt of kt){const Pt=Tt.x,Vt=Tt.y,Tr=he[0]*Pt+he[4]*Vt+he[12],Mr=he[1]*Pt+he[5]*Vt+he[13],Ti=he[2]*Pt+he[6]*Vt+he[14],ho=he[3]*Pt+he[7]*Vt+he[15],Hi=Ti+He,oi=ho+ht,pn=Tr+zt,mn=Mr+dt,gn=Ti+ut,si=ho+Mt,Ci=new k((Tr+we)/oi,(Mr+Re)/oi);Ci.z=Hi/oi,vt.push(Ci);const tn=new k(pn/si,mn/si);tn.z=gn/si,Ne.push(tn)}ke.push(vt),ge.push(Ne)}return[ke,ge]}(m,R,D,P);return function(W,Q,ie){let he=1/0;s_(ie,Q)&&(he=T_(ie,Q[0]));for(let ke=0;kea.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(a=>{this.gradients[a.id]={}}),this.layoutVertexArray=new Zl,this.layoutVertexArray2=new Au,this.indexArray=new Ii,this.programConfigurations=new Ka(r.layers,r.zoom),this.segments=new wi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(r,a,d){this.hasPattern=Hp("line",this.layers,a);const m=this.layers[0].layout.get("line-sort-key"),_=!m.isConstant(),x=[];for(const{feature:S,id:P,index:A,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,N=Qa(S,R);if(!this.layers[0]._featureFilter.filter(new zr(this.zoom),N,d))continue;const Z=_?m.evaluate(N,{},d):void 0,W={id:P,properties:S.properties,type:S.type,sourceLayerIndex:D,index:A,geometry:R?N.geometry:Ya(S),patterns:{},sortKey:Z};x.push(W)}_&&x.sort((S,P)=>S.sortKey-P.sortKey);for(const S of x){const{geometry:P,index:A,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Wp("line",this.layers,S,this.zoom,a);this.patternFeatures.push(R)}else this.addFeature(S,P,A,d,{});a.featureIndex.insert(r[A].feature,P,A,D,this.index)}}update(r,a,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,a,this.stateDependentLayers,d)}addFeatures(r,a,d){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,a,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=r.createVertexBuffer(this.layoutVertexArray2,DS)),this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,zS),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(r){if(r.properties&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_end"))return{start:+r.properties.mapbox_clip_start,end:+r.properties.mapbox_clip_end}}addFeature(r,a,d,m,_){const x=this.layers[0].layout,S=x.get("line-join").evaluate(r,{}),P=x.get("line-cap"),A=x.get("line-miter-limit"),D=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(r);for(const R of a)this.addLine(R,r,S,P,A,D);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,d,_,m)}addLine(r,a,d,m,_,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let he=0;he=2&&r[P-1].equals(r[P-2]);)P--;let A=0;for(;A0;if(ht&&he>A){const Mt=N.dist(Z);if(Mt>2*D){const kt=N.sub(N.sub(Z)._mult(D/Mt)._round());this.updateDistance(Z,kt),this.addCurrentVertex(kt,Q,0,0,R),Z=kt}}const dt=Z&&W;let ut=dt?d:S?"butt":m;if(dt&&ut==="round"&&(Re_&&(ut="bevel"),ut==="bevel"&&(Re>2&&(ut="flipbevel"),Re<_&&(ut="miter")),Z&&this.updateDistance(Z,N),ut==="miter")ke._mult(Re),this.addCurrentVertex(N,ke,0,0,R);else if(ut==="flipbevel"){if(Re>100)ke=ie.mult(-1);else{const Mt=Re*Q.add(ie).mag()/Q.sub(ie).mag();ke._perp()._mult(Mt*(zt?-1:1))}this.addCurrentVertex(N,ke,0,0,R),this.addCurrentVertex(N,ke.mult(-1),0,0,R)}else if(ut==="bevel"||ut==="fakeround"){const Mt=-Math.sqrt(Re*Re-1),kt=zt?Mt:0,vt=zt?0:Mt;if(Z&&this.addCurrentVertex(N,Q,kt,vt,R),ut==="fakeround"){const Ne=Math.round(180*He/Math.PI/20);for(let Tt=1;Tt2*D){const kt=N.add(W.sub(N)._mult(D/Mt)._round());this.updateDistance(N,kt),this.addCurrentVertex(kt,ie,0,0,R),N=kt}}}}addCurrentVertex(r,a,d,m,_,x=!1){const S=a.y*m-a.x,P=-a.y-a.x*m;this.addHalfVertex(r,a.x+a.y*d,a.y-a.x*d,x,!1,d,_),this.addHalfVertex(r,S,P,x,!0,-m,_),this.distance>C_/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(r,a,d,m,_,x))}addHalfVertex({x:r,y:a},d,m,_,x,S,P){const A=.5*(this.lineClips?this.scaledDistance*(C_-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((r<<1)+(_?1:0),(a<<1)+(x?1:0),Math.round(63*d)+128,Math.round(63*m)+128,1+(S===0?0:S<0?-1:1)|(63&A)<<2,A>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const D=P.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),P.primitiveLength++),x?this.e2=D:this.e1=D}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(r,a){this.distance+=r.dist(a),this.updateScaledDistance()}}let A_,z_;St("LineBucket",Yp,{omit:["layers","patternFeatures"]});var L_={get paint(){return z_=z_||new p({"line-opacity":new Ot(Te.paint_line["line-opacity"]),"line-color":new Ot(Te.paint_line["line-color"]),"line-translate":new It(Te.paint_line["line-translate"]),"line-translate-anchor":new It(Te.paint_line["line-translate-anchor"]),"line-width":new Ot(Te.paint_line["line-width"]),"line-gap-width":new Ot(Te.paint_line["line-gap-width"]),"line-offset":new Ot(Te.paint_line["line-offset"]),"line-blur":new Ot(Te.paint_line["line-blur"]),"line-dasharray":new i(Te.paint_line["line-dasharray"]),"line-pattern":new v(Te.paint_line["line-pattern"]),"line-gradient":new h(Te.paint_line["line-gradient"])})},get layout(){return A_=A_||new p({"line-cap":new It(Te.layout_line["line-cap"]),"line-join":new Ot(Te.layout_line["line-join"]),"line-miter-limit":new It(Te.layout_line["line-miter-limit"]),"line-round-limit":new It(Te.layout_line["line-round-limit"]),"line-sort-key":new Ot(Te.layout_line["line-sort-key"])})}};class BS extends Ot{possiblyEvaluate(r,a){return a=new zr(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),super.possiblyEvaluate(r,a)}evaluate(r,a,d,m){return a=Ee({},a,{zoom:Math.floor(a.zoom)}),super.evaluate(r,a,d,m)}}let zf;class OS extends b{constructor(r){super(r,L_),this.gradientVersion=0,zf||(zf=new BS(L_.paint.properties["line-width"].specification),zf.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(r){if(r==="line-gradient"){const a=this.gradientExpression();this.stepInterpolant=!!function(d){return d._styleExpression!==void 0}(a)&&a._styleExpression.expression instanceof Os,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(r,a){super.recalculate(r,a),this.paint._values["line-floorwidth"]=zf.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)}createBucket(r){return new Yp(r)}queryRadius(r){const a=r,d=D_(Bu("line-width",this,a),Bu("line-gap-width",this,a)),m=Bu("line-offset",this,a);return d/2+Math.abs(m)+Ef(this.paint.get("line-translate"))}queryIntersectsFeature(r,a,d,m,_,x,S){const P=Pf(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),x.angle,S),A=S/2*D_(this.paint.get("line-width").evaluate(a,d),this.paint.get("line-gap-width").evaluate(a,d)),D=this.paint.get("line-offset").evaluate(a,d);return D&&(m=function(R,N){const Z=[];for(let W=0;W=3){for(let ie=0;ie0?r+2*s:s}const $S=L([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),NS=L([{name:"a_projected_pos",components:3,type:"Float32"}],4);L([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const jS=L([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);L([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const F_=L([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),VS=L([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function US(s,r,a){return s.sections.forEach(d=>{d.text=function(m,_,x){const S=_.layout.get("text-transform").evaluate(x,{});return S==="uppercase"?m=m.toLocaleUpperCase():S==="lowercase"&&(m=m.toLocaleLowerCase()),Go.applyArabicShaping&&(m=Go.applyArabicShaping(m)),m}(d.text,r,a)}),s}L([{name:"triangle",components:3,type:"Uint16"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),L([{type:"Float32",name:"offsetX"}]),L([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),L([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Gu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Si=24,R_=Pr,B_=function(s,r,a,d,m){var _,x,S=8*m-d-1,P=(1<>1,D=-7,R=a?m-1:0,N=a?-1:1,Z=s[r+R];for(R+=N,_=Z&(1<<-D)-1,Z>>=-D,D+=S;D>0;_=256*_+s[r+R],R+=N,D-=8);for(x=_&(1<<-D)-1,_>>=-D,D+=d;D>0;x=256*x+s[r+R],R+=N,D-=8);if(_===0)_=1-A;else{if(_===P)return x?NaN:1/0*(Z?-1:1);x+=Math.pow(2,d),_-=A}return(Z?-1:1)*x*Math.pow(2,_-d)},O_=function(s,r,a,d,m,_){var x,S,P,A=8*_-m-1,D=(1<>1,N=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,Z=d?0:_-1,W=d?1:-1,Q=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(S=isNaN(r)?1:0,x=D):(x=Math.floor(Math.log(r)/Math.LN2),r*(P=Math.pow(2,-x))<1&&(x--,P*=2),(r+=x+R>=1?N/P:N*Math.pow(2,1-R))*P>=2&&(x++,P/=2),x+R>=D?(S=0,x=D):x+R>=1?(S=(r*P-1)*Math.pow(2,m),x+=R):(S=r*Math.pow(2,R-1)*Math.pow(2,m),x=0));m>=8;s[a+Z]=255&S,Z+=W,S/=256,m-=8);for(x=x<0;s[a+Z]=255&x,Z+=W,x/=256,A-=8);s[a+Z-W]|=128*Q};function Pr(s){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(s)?s:new Uint8Array(s||0),this.pos=0,this.type=0,this.length=this.buf.length}Pr.Varint=0,Pr.Fixed64=1,Pr.Bytes=2,Pr.Fixed32=5;var Qp=4294967296,$_=1/Qp,N_=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ws(s){return s.type===Pr.Bytes?s.readVarint()+s.pos:s.pos+1}function tc(s,r,a){return a?4294967296*r+(s>>>0):4294967296*(r>>>0)+(s>>>0)}function j_(s,r,a){var d=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(7*Math.LN2));a.realloc(d);for(var m=a.pos-1;m>=s;m--)a.buf[m+d]=a.buf[m]}function qS(s,r){for(var a=0;a>>8,s[a+2]=r>>>16,s[a+3]=r>>>24}function V_(s,r){return(s[r]|s[r+1]<<8|s[r+2]<<16)+(s[r+3]<<24)}Pr.prototype={destroy:function(){this.buf=null},readFields:function(s,r,a){for(a=a||this.length;this.pos>3,_=this.pos;this.type=7&d,s(m,r,this),this.pos===_&&this.skip(d)}return r},readMessage:function(s,r){return this.readFields(s,r,this.readVarint()+this.pos)},readFixed32:function(){var s=Lf(this.buf,this.pos);return this.pos+=4,s},readSFixed32:function(){var s=V_(this.buf,this.pos);return this.pos+=4,s},readFixed64:function(){var s=Lf(this.buf,this.pos)+Lf(this.buf,this.pos+4)*Qp;return this.pos+=8,s},readSFixed64:function(){var s=Lf(this.buf,this.pos)+V_(this.buf,this.pos+4)*Qp;return this.pos+=8,s},readFloat:function(){var s=B_(this.buf,this.pos,!0,23,4);return this.pos+=4,s},readDouble:function(){var s=B_(this.buf,this.pos,!0,52,8);return this.pos+=8,s},readVarint:function(s){var r,a,d=this.buf;return r=127&(a=d[this.pos++]),a<128?r:(r|=(127&(a=d[this.pos++]))<<7,a<128?r:(r|=(127&(a=d[this.pos++]))<<14,a<128?r:(r|=(127&(a=d[this.pos++]))<<21,a<128?r:function(m,_,x){var S,P,A=x.buf;if(S=(112&(P=A[x.pos++]))>>4,P<128||(S|=(127&(P=A[x.pos++]))<<3,P<128)||(S|=(127&(P=A[x.pos++]))<<10,P<128)||(S|=(127&(P=A[x.pos++]))<<17,P<128)||(S|=(127&(P=A[x.pos++]))<<24,P<128)||(S|=(1&(P=A[x.pos++]))<<31,P<128))return tc(m,S,_);throw new Error("Expected varint not more than 10 bytes")}(r|=(15&(a=d[this.pos]))<<28,s,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var s=this.readVarint();return s%2==1?(s+1)/-2:s/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var s=this.readVarint()+this.pos,r=this.pos;return this.pos=s,s-r>=12&&N_?function(a,d,m){return N_.decode(a.subarray(d,m))}(this.buf,r,s):function(a,d,m){for(var _="",x=d;x239?4:D>223?3:D>191?2:1;if(x+N>m)break;N===1?D<128&&(R=D):N===2?(192&(S=a[x+1]))==128&&(R=(31&D)<<6|63&S)<=127&&(R=null):N===3?(P=a[x+2],(192&(S=a[x+1]))==128&&(192&P)==128&&((R=(15&D)<<12|(63&S)<<6|63&P)<=2047||R>=55296&&R<=57343)&&(R=null)):N===4&&(P=a[x+2],A=a[x+3],(192&(S=a[x+1]))==128&&(192&P)==128&&(192&A)==128&&((R=(15&D)<<18|(63&S)<<12|(63&P)<<6|63&A)<=65535||R>=1114112)&&(R=null)),R===null?(R=65533,N=1):R>65535&&(R-=65536,_+=String.fromCharCode(R>>>10&1023|55296),R=56320|1023&R),_+=String.fromCharCode(R),x+=N}return _}(this.buf,r,s)},readBytes:function(){var s=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,s);return this.pos=s,r},readPackedVarint:function(s,r){if(this.type!==Pr.Bytes)return s.push(this.readVarint(r));var a=ws(this);for(s=s||[];this.pos127;);else if(r===Pr.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Pr.Fixed32)this.pos+=4;else{if(r!==Pr.Fixed64)throw new Error("Unimplemented type: "+r);this.pos+=8}},writeTag:function(s,r){this.writeVarint(s<<3|r)},realloc:function(s){for(var r=this.length||16;r268435455||s<0?function(r,a){var d,m;if(r>=0?(d=r%4294967296|0,m=r/4294967296|0):(m=~(-r/4294967296),4294967295^(d=~(-r%4294967296))?d=d+1|0:(d=0,m=m+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");a.realloc(10),function(_,x,S){S.buf[S.pos++]=127&_|128,_>>>=7,S.buf[S.pos++]=127&_|128,_>>>=7,S.buf[S.pos++]=127&_|128,_>>>=7,S.buf[S.pos++]=127&_|128,S.buf[S.pos]=127&(_>>>=7)}(d,0,a),function(_,x){var S=(7&_)<<4;x.buf[x.pos++]|=S|((_>>>=3)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_|((_>>>=7)?128:0),_&&(x.buf[x.pos++]=127&_)))))}(m,a)}(s,this):(this.realloc(4),this.buf[this.pos++]=127&s|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=s>>>7&127))))},writeSVarint:function(s){this.writeVarint(s<0?2*-s-1:2*s)},writeBoolean:function(s){this.writeVarint(!!s)},writeString:function(s){s=String(s),this.realloc(4*s.length),this.pos++;var r=this.pos;this.pos=function(d,m,_){for(var x,S,P=0;P55295&&x<57344){if(!S){x>56319||P+1===m.length?(d[_++]=239,d[_++]=191,d[_++]=189):S=x;continue}if(x<56320){d[_++]=239,d[_++]=191,d[_++]=189,S=x;continue}x=S-55296<<10|x-56320|65536,S=null}else S&&(d[_++]=239,d[_++]=191,d[_++]=189,S=null);x<128?d[_++]=x:(x<2048?d[_++]=x>>6|192:(x<65536?d[_++]=x>>12|224:(d[_++]=x>>18|240,d[_++]=x>>12&63|128),d[_++]=x>>6&63|128),d[_++]=63&x|128)}return _}(this.buf,s,this.pos);var a=this.pos-r;a>=128&&j_(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeFloat:function(s){this.realloc(4),O_(this.buf,s,this.pos,!0,23,4),this.pos+=4},writeDouble:function(s){this.realloc(8),O_(this.buf,s,this.pos,!0,52,8),this.pos+=8},writeBytes:function(s){var r=s.length;this.writeVarint(r),this.realloc(r);for(var a=0;a=128&&j_(a,d,this),this.pos=a-1,this.writeVarint(d),this.pos+=d},writeMessage:function(s,r,a){this.writeTag(s,Pr.Bytes),this.writeRawMessage(r,a)},writePackedVarint:function(s,r){r.length&&this.writeMessage(s,qS,r)},writePackedSVarint:function(s,r){r.length&&this.writeMessage(s,GS,r)},writePackedBoolean:function(s,r){r.length&&this.writeMessage(s,WS,r)},writePackedFloat:function(s,r){r.length&&this.writeMessage(s,ZS,r)},writePackedDouble:function(s,r){r.length&&this.writeMessage(s,HS,r)},writePackedFixed32:function(s,r){r.length&&this.writeMessage(s,XS,r)},writePackedSFixed32:function(s,r){r.length&&this.writeMessage(s,JS,r)},writePackedFixed64:function(s,r){r.length&&this.writeMessage(s,KS,r)},writePackedSFixed64:function(s,r){r.length&&this.writeMessage(s,YS,r)},writeBytesField:function(s,r){this.writeTag(s,Pr.Bytes),this.writeBytes(r)},writeFixed32Field:function(s,r){this.writeTag(s,Pr.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(s,r){this.writeTag(s,Pr.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(s,r){this.writeTag(s,Pr.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(s,r){this.writeTag(s,Pr.Fixed64),this.writeSFixed64(r)},writeVarintField:function(s,r){this.writeTag(s,Pr.Varint),this.writeVarint(r)},writeSVarintField:function(s,r){this.writeTag(s,Pr.Varint),this.writeSVarint(r)},writeStringField:function(s,r){this.writeTag(s,Pr.Bytes),this.writeString(r)},writeFloatField:function(s,r){this.writeTag(s,Pr.Fixed32),this.writeFloat(r)},writeDoubleField:function(s,r){this.writeTag(s,Pr.Fixed64),this.writeDouble(r)},writeBooleanField:function(s,r){this.writeVarintField(s,!!r)}};var em=y(R_);const tm=3;function QS(s,r,a){s===1&&a.readMessage(ek,r)}function ek(s,r,a){if(s===3){const{id:d,bitmap:m,width:_,height:x,left:S,top:P,advance:A}=a.readMessage(tk,{});r.push({id:d,bitmap:new $u({width:_+2*tm,height:x+2*tm},m),metrics:{width:_,height:x,left:S,top:P,advance:A}})}}function tk(s,r,a){s===1?r.id=a.readVarint():s===2?r.bitmap=a.readBytes():s===3?r.width=a.readVarint():s===4?r.height=a.readVarint():s===5?r.left=a.readSVarint():s===6?r.top=a.readSVarint():s===7&&(r.advance=a.readVarint())}const U_=tm;function q_(s){let r=0,a=0;for(const x of s)r+=x.w*x.h,a=Math.max(a,x.w);s.sort((x,S)=>S.h-x.h);const d=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),a),h:1/0}];let m=0,_=0;for(const x of s)for(let S=d.length-1;S>=0;S--){const P=d[S];if(!(x.w>P.w||x.h>P.h)){if(x.x=P.x,x.y=P.y,_=Math.max(_,x.y+x.h),m=Math.max(m,x.x+x.w),x.w===P.w&&x.h===P.h){const A=d.pop();S=0&&d>=r&&Ff[this.text.charCodeAt(d)];d--)a--;this.text=this.text.substring(r,a),this.sectionIndex=this.sectionIndex.slice(r,a)}substring(r,a){const d=new ic;return d.text=this.text.substring(r,a),d.sectionIndex=this.sectionIndex.slice(r,a),d.sections=this.sections,d}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((r,a)=>Math.max(r,this.sections[a].scale),0)}addTextSection(r,a){this.text+=r.text,this.sections.push(Hu.forText(r.scale,r.fontStack||a));const d=this.sections.length-1;for(let m=0;m=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Df(s,r,a,d,m,_,x,S,P,A,D,R,N,Z,W){const Q=ic.fromFeature(s,m);let ie;R===f.ai.vertical&&Q.verticalizePunctuation();const{processBidirectionalText:he,processStyledBidirectionalText:ke}=Go;if(he&&Q.sections.length===1){ie=[];const Re=he(Q.toString(),im(Q,A,_,r,d,Z));for(const He of Re){const ht=new ic;ht.text=He,ht.sections=Q.sections;for(let zt=0;zt0&&Ss>Xi&&(Xi=Ss)}else{const Hn=ht[gr.fontStack],Di=Hn&&Hn[qr];if(Di&&Di.rect)ac=Di.rect,ii=Di.metrics;else{const Ss=He[gr.fontStack],Yu=Ss&&Ss[qr];if(!Yu)continue;ii=Yu.metrics}Rn=(Ci-gr.scale)*Si}fo?(Re.verticalizable=!0,yn.push({glyph:qr,imageName:Xo,x:Vt,y:Tr+Rn,vertical:fo,scale:gr.scale,fontStack:gr.fontStack,sectionIndex:Lr,metrics:ii,rect:ac}),Vt+=Jo*gr.scale+Ne):(yn.push({glyph:qr,imageName:Xo,x:Vt,y:Tr+Rn,vertical:fo,scale:gr.scale,fontStack:gr.fontStack,sectionIndex:Lr,metrics:ii,rect:ac}),Vt+=ii.advance*gr.scale+Ne)}yn.length!==0&&(Mr=Math.max(Vt-Ne,Mr),ok(yn,0,yn.length-1,ho,Xi)),Vt=0;const Zn=ut*Ci+Xi;Wi.lineOffset=Math.max(Xi,tn),Tr+=Zn,Ti=Math.max(Zn,Ti),++Hi}var oi;const pn=Tr-Zu,{horizontalAlign:mn,verticalAlign:gn}=nm(Mt);(function(si,Ci,tn,Wi,yn,Xi,Zn,In,gr){const Lr=(Ci-tn)*yn;let qr=0;qr=Xi!==Zn?-In*Wi-Zu:(-Wi*gr+.5)*Zn;for(const Rn of si)for(const ii of Rn.positionedGlyphs)ii.x+=Lr,ii.y+=qr})(Re.positionedLines,ho,mn,gn,Mr,Ti,ut,pn,dt.length),Re.top+=-gn*pn,Re.bottom=Re.top+pn,Re.left+=-mn*Mr,Re.right=Re.left+Mr}(we,r,a,d,ie,x,S,P,R,A,N,W),!function(Re){for(const He of Re)if(He.positionedGlyphs.length!==0)return!1;return!0}(ge)&&we}const Ff={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},rk={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},ik={40:!0};function Z_(s,r,a,d,m,_){if(r.imageName){const x=d[r.imageName];return x?x.displaySize[0]*r.scale*Si/_+m:0}{const x=a[r.fontStack],S=x&&x[s];return S?S.metrics.advance*r.scale+m:0}}function H_(s,r,a,d){const m=Math.pow(s-r,2);return d?s=0;let A=0;for(let R=0;RA){const D=Math.ceil(_/A);m*=D/x,x=D}return{x1:d,y1:m,x2:d+_,y2:m+x}}function K_(s,r,a,d,m,_){const x=s.image;let S;if(x.content){const ie=x.content,he=x.pixelRatio||1;S=[ie[0]/he,ie[1]/he,x.displaySize[0]-ie[2]/he,x.displaySize[1]-ie[3]/he]}const P=r.left*_,A=r.right*_;let D,R,N,Z;a==="width"||a==="both"?(Z=m[0]+P-d[3],R=m[0]+A+d[1]):(Z=m[0]+(P+A-x.displaySize[0])/2,R=Z+x.displaySize[0]);const W=r.top*_,Q=r.bottom*_;return a==="height"||a==="both"?(D=m[1]+W-d[0],N=m[1]+Q+d[2]):(D=m[1]+(W+Q-x.displaySize[1])/2,N=D+x.displaySize[1]),{image:x,top:D,right:R,bottom:N,left:Z,collisionPadding:S}}const Wu=255,Wo=128,ra=Wu*Wo;function Y_(s,r){const{expression:a}=r;if(a.kind==="constant")return{kind:"constant",layoutSize:a.evaluate(new zr(s+1))};if(a.kind==="source")return{kind:"source"};{const{zoomStops:d,interpolationType:m}=a;let _=0;for(;_x.id),this.index=r.index,this.pixelRatio=r.pixelRatio,this.sourceLayerIndex=r.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Np([]),this.placementViewportMatrix=Np([]);const a=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Y_(this.zoom,a["text-size"]),this.iconSizeData=Y_(this.zoom,a["icon-size"]);const d=this.layers[0].layout,m=d.get("symbol-sort-key"),_=d.get("symbol-z-order");this.canOverlap=om(d,"text-overlap","text-allow-overlap")!=="never"||om(d,"icon-overlap","icon-allow-overlap")!=="never"||d.get("text-ignore-placement")||d.get("icon-ignore-placement"),this.sortFeaturesByKey=_!=="viewport-y"&&!m.isConstant(),this.sortFeaturesByY=(_==="viewport-y"||_==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,d.get("symbol-placement")==="point"&&(this.writingModes=d.get("text-writing-mode").map(x=>f.ai[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=r.sourceID}createArrays(){this.text=new am(new Ka(this.layers,this.zoom,r=>/^text/.test(r))),this.icon=new am(new Ka(this.layers,this.zoom,r=>/^icon/.test(r))),this.glyphOffsetArray=new Ur,this.lineVertexArray=new fn,this.symbolInstances=new jn,this.textAnchorOffsets=new Vi}calculateGlyphDependencies(r,a,d,m,_){for(let x=0;x0)&&(x.value.kind!=="constant"||x.value.value.length>0),D=P.value.kind!=="constant"||!!P.value.value||Object.keys(P.parameters).length>0,R=_.get("symbol-sort-key");if(this.features=[],!A&&!D)return;const N=a.iconDependencies,Z=a.glyphDependencies,W=a.availableImages,Q=new zr(this.zoom);for(const{feature:ie,id:he,index:ke,sourceLayerIndex:ge}of r){const we=m._featureFilter.needGeometry,Re=Qa(ie,we);if(!m._featureFilter.filter(Q,Re,d))continue;let He,ht;if(we||(Re.geometry=Ya(ie)),A){const dt=m.getValueAndResolveTokens("text-field",Re,d,W),ut=xn.factory(dt),Mt=this.hasRTLText=this.hasRTLText||ck(ut);(!Mt||Go.getRTLTextPluginStatus()==="unavailable"||Mt&&Go.isParsed())&&(He=US(ut,m,Re))}if(D){const dt=m.getValueAndResolveTokens("icon-image",Re,d,W);ht=dt instanceof Ni?dt:Ni.fromString(dt)}if(!He&&!ht)continue;const zt=this.sortFeaturesByKey?R.evaluate(Re,{},d):void 0;if(this.features.push({id:he,text:He,icon:ht,index:ke,sourceLayerIndex:ge,geometry:Re.geometry,properties:ie.properties,type:ak[ie.type],sortKey:zt}),ht&&(N[ht.name]=!0),He){const dt=x.evaluate(Re,{},d).join(","),ut=_.get("text-rotation-alignment")!=="viewport"&&_.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(f.ai.vertical)>=0;for(const Mt of He.sections)if(Mt.image)N[Mt.image.name]=!0;else{const kt=Mu(He.toString()),vt=Mt.fontStack||dt,Ne=Z[vt]=Z[vt]||{};this.calculateGlyphDependencies(Mt.text,Ne,ut,this.allowVerticalPlacement,kt)}}}_.get("symbol-placement")==="line"&&(this.features=function(ie){const he={},ke={},ge=[];let we=0;function Re(dt){ge.push(ie[dt]),we++}function He(dt,ut,Mt){const kt=ke[dt];return delete ke[dt],ke[ut]=kt,ge[kt].geometry[0].pop(),ge[kt].geometry[0]=ge[kt].geometry[0].concat(Mt[0]),kt}function ht(dt,ut,Mt){const kt=he[ut];return delete he[ut],he[dt]=kt,ge[kt].geometry[0].shift(),ge[kt].geometry[0]=Mt[0].concat(ge[kt].geometry[0]),kt}function zt(dt,ut,Mt){const kt=Mt?ut[0][ut[0].length-1]:ut[0][0];return`${dt}:${kt.x}:${kt.y}`}for(let dt=0;dtdt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ie,he)=>ie.sortKey-he.sortKey)}update(r,a,d){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(r,a,this.layers,d),this.icon.programConfigurations.updatePaintArrays(r,a,this.layers,d))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(r){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(r),this.iconCollisionBox.upload(r)),this.text.upload(r,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(r,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(r,a){const d=this.lineVertexArray.length;if(r.segment!==void 0){let m=r.dist(a[r.segment+1]),_=r.dist(a[r.segment]);const x={};for(let S=r.segment+1;S=0;S--)x[S]={x:a[S].x,y:a[S].y,tileUnitDistanceFromAnchor:_},S>0&&(_+=a[S-1].dist(a[S]));for(let S=0;S0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(r,a){const d=r.placedSymbolArray.get(a),m=d.vertexStartIndex+4*d.numGlyphs;for(let _=d.vertexStartIndex;_m[S]-m[P]||_[P]-_[S]),x}addToSortKeyRanges(r,a){const d=this.sortKeyRanges[this.sortKeyRanges.length-1];d&&d.sortKey===a?d.symbolInstanceEnd=r+1:this.sortKeyRanges.push({sortKey:a,symbolInstanceStart:r,symbolInstanceEnd:r+1})}sortFeatures(r){if(this.sortFeaturesByY&&this.sortedAngle!==r&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(r),this.sortedAngle=r,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const a of this.symbolInstanceIndexes){const d=this.symbolInstances.get(a);this.featureSortOrder.push(d.featureIndex),[d.rightJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.leftJustifiedTextSymbolIndex].forEach((m,_,x)=>{m>=0&&x.indexOf(m)===_&&this.addIndicesForPlacedSymbol(this.text,m)}),d.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,d.verticalPlacedTextSymbolIndex),d.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.placedIconSymbolIndex),d.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Q_,e0;St("SymbolBucket",nc,{omit:["layers","collisionBoxArray","features","compareText"]}),nc.MAX_GLYPHS=65535,nc.addDynamicAttributes=sm;var cm={get paint(){return e0=e0||new p({"icon-opacity":new Ot(Te.paint_symbol["icon-opacity"]),"icon-color":new Ot(Te.paint_symbol["icon-color"]),"icon-halo-color":new Ot(Te.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ot(Te.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ot(Te.paint_symbol["icon-halo-blur"]),"icon-translate":new It(Te.paint_symbol["icon-translate"]),"icon-translate-anchor":new It(Te.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ot(Te.paint_symbol["text-opacity"]),"text-color":new Ot(Te.paint_symbol["text-color"],{runtimeType:un,getOverride:s=>s.textColor,hasOverride:s=>!!s.textColor}),"text-halo-color":new Ot(Te.paint_symbol["text-halo-color"]),"text-halo-width":new Ot(Te.paint_symbol["text-halo-width"]),"text-halo-blur":new Ot(Te.paint_symbol["text-halo-blur"]),"text-translate":new It(Te.paint_symbol["text-translate"]),"text-translate-anchor":new It(Te.paint_symbol["text-translate-anchor"])})},get layout(){return Q_=Q_||new p({"symbol-placement":new It(Te.layout_symbol["symbol-placement"]),"symbol-spacing":new It(Te.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new It(Te.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ot(Te.layout_symbol["symbol-sort-key"]),"symbol-z-order":new It(Te.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new It(Te.layout_symbol["icon-allow-overlap"]),"icon-overlap":new It(Te.layout_symbol["icon-overlap"]),"icon-ignore-placement":new It(Te.layout_symbol["icon-ignore-placement"]),"icon-optional":new It(Te.layout_symbol["icon-optional"]),"icon-rotation-alignment":new It(Te.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ot(Te.layout_symbol["icon-size"]),"icon-text-fit":new It(Te.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new It(Te.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ot(Te.layout_symbol["icon-image"]),"icon-rotate":new Ot(Te.layout_symbol["icon-rotate"]),"icon-padding":new Ot(Te.layout_symbol["icon-padding"]),"icon-keep-upright":new It(Te.layout_symbol["icon-keep-upright"]),"icon-offset":new Ot(Te.layout_symbol["icon-offset"]),"icon-anchor":new Ot(Te.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new It(Te.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new It(Te.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new It(Te.layout_symbol["text-rotation-alignment"]),"text-field":new Ot(Te.layout_symbol["text-field"]),"text-font":new Ot(Te.layout_symbol["text-font"]),"text-size":new Ot(Te.layout_symbol["text-size"]),"text-max-width":new Ot(Te.layout_symbol["text-max-width"]),"text-line-height":new It(Te.layout_symbol["text-line-height"]),"text-letter-spacing":new Ot(Te.layout_symbol["text-letter-spacing"]),"text-justify":new Ot(Te.layout_symbol["text-justify"]),"text-radial-offset":new Ot(Te.layout_symbol["text-radial-offset"]),"text-variable-anchor":new It(Te.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ot(Te.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ot(Te.layout_symbol["text-anchor"]),"text-max-angle":new It(Te.layout_symbol["text-max-angle"]),"text-writing-mode":new It(Te.layout_symbol["text-writing-mode"]),"text-rotate":new Ot(Te.layout_symbol["text-rotate"]),"text-padding":new It(Te.layout_symbol["text-padding"]),"text-keep-upright":new It(Te.layout_symbol["text-keep-upright"]),"text-transform":new Ot(Te.layout_symbol["text-transform"]),"text-offset":new Ot(Te.layout_symbol["text-offset"]),"text-allow-overlap":new It(Te.layout_symbol["text-allow-overlap"]),"text-overlap":new It(Te.layout_symbol["text-overlap"]),"text-ignore-placement":new It(Te.layout_symbol["text-ignore-placement"]),"text-optional":new It(Te.layout_symbol["text-optional"])})}};class t0{constructor(r){if(r.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=r.property.overrides?r.property.overrides.runtimeType:Oo,this.defaultValue=r}evaluate(r){if(r.formattedSection){const a=this.defaultValue.property.overrides;if(a&&a.hasOverride(r.formattedSection))return a.getOverride(r.formattedSection)}return r.feature&&r.featureState?this.defaultValue.evaluate(r.feature,r.featureState):this.defaultValue.property.specification.default}eachChild(r){this.defaultValue.isConstant()||r(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}St("FormatSectionOverride",t0,{omit:["defaultValue"]});class Bf extends b{constructor(r){super(r,cm)}recalculate(r,a){if(super.recalculate(r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const d=this.layout.get("text-writing-mode");if(d){const m=[];for(const _ of d)m.indexOf(_)<0&&m.push(_);this.layout._values["text-writing-mode"]=m}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,a,d,m){const _=this.layout.get(r).evaluate(a,{},d,m),x=this._unevaluatedLayout._values[r];return x.isDataDriven()||ja(x.value)||!_?_:function(S,P){return P.replace(/{([^{}]+)}/g,(A,D)=>S&&D in S?String(S[D]):"")}(a.properties,_)}createBucket(r){return new nc(r)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const r of cm.paint.overridableProperties){if(!Bf.hasPaintOverride(this.layout,r))continue;const a=this.paint.get(r),d=new t0(a),m=new Bl(d,a.property.specification);let _=null;_=a.value.kind==="constant"||a.value.kind==="source"?new su("source",m):new au("composite",m,a.value.zoomStops),this.paint._values[r]=new uo(a.property,_,a.parameters)}}_handleOverridablePaintPropertyUpdate(r,a,d){return!(!this.layout||a.isDataDriven()||d.isDataDriven())&&Bf.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,a){const d=r.get("text-field"),m=cm.paint.properties[a];let _=!1;const x=S=>{for(const P of S)if(m.overrides&&m.overrides.hasOverride(P))return void(_=!0)};if(d.value.kind==="constant"&&d.value.value instanceof xn)x(d.value.value.sections);else if(d.value.kind==="source"){const S=A=>{_||(A instanceof cs&&pi(A.value)===So?x(A.value.sections):A instanceof kl?x(A.sections):A.eachChild(S))},P=d.value;P._styleExpression&&S(P._styleExpression.expression)}return _}}let r0;var uk={get paint(){return r0=r0||new p({"background-color":new It(Te.paint_background["background-color"]),"background-pattern":new i(Te.paint_background["background-pattern"]),"background-opacity":new It(Te.paint_background["background-opacity"])})}};class hk extends b{constructor(r){super(r,uk)}}let i0;var fk={get paint(){return i0=i0||new p({"raster-opacity":new It(Te.paint_raster["raster-opacity"]),"raster-hue-rotate":new It(Te.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new It(Te.paint_raster["raster-brightness-min"]),"raster-brightness-max":new It(Te.paint_raster["raster-brightness-max"]),"raster-saturation":new It(Te.paint_raster["raster-saturation"]),"raster-contrast":new It(Te.paint_raster["raster-contrast"]),"raster-resampling":new It(Te.paint_raster["raster-resampling"]),"raster-fade-duration":new It(Te.paint_raster["raster-fade-duration"])})}};class dk extends b{constructor(r){super(r,fk)}}class pk extends b{constructor(r){super(r,{}),this.onAdd=a=>{this.implementation.onAdd&&this.implementation.onAdd(a,a.painter.context.gl)},this.onRemove=a=>{this.implementation.onRemove&&this.implementation.onRemove(a,a.painter.context.gl)},this.implementation=r}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class mk{constructor(r){this._methodToThrottle=r,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const um=63710088e-1;class ia{constructor(r,a){if(isNaN(r)||isNaN(a))throw new Error(`Invalid LngLat object: (${r}, ${a})`);if(this.lng=+r,this.lat=+a,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ia(pe(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(r){const a=Math.PI/180,d=this.lat*a,m=r.lat*a,_=Math.sin(d)*Math.sin(m)+Math.cos(d)*Math.cos(m)*Math.cos((r.lng-this.lng)*a);return um*Math.acos(Math.min(_,1))}static convert(r){if(r instanceof ia)return r;if(Array.isArray(r)&&(r.length===2||r.length===3))return new ia(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&typeof r=="object"&&r!==null)return new ia(Number("lng"in r?r.lng:r.lon),Number(r.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const n0=2*Math.PI*um;function o0(s){return n0*Math.cos(s*Math.PI/180)}function s0(s){return(180+s)/360}function a0(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function l0(s,r){return s/o0(r)}function hm(s){return 360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90}class Of{constructor(r,a,d=0){this.x=+r,this.y=+a,this.z=+d}static fromLngLat(r,a=0){const d=ia.convert(r);return new Of(s0(d.lng),a0(d.lat),l0(a,d.lat))}toLngLat(){return new ia(360*this.x-180,hm(this.y))}toAltitude(){return this.z*o0(hm(this.y))}meterInMercatorCoordinateUnits(){return 1/n0*(r=hm(this.y),1/Math.cos(r*Math.PI/180));var r}}function c0(s,r,a){var d=2*Math.PI*6378137/256/Math.pow(2,a);return[s*d-2*Math.PI*6378137/2,r*d-2*Math.PI*6378137/2]}class fm{constructor(r,a,d){if(r<0||r>25||d<0||d>=Math.pow(2,r)||a<0||a>=Math.pow(2,r))throw new Error(`x=${a}, y=${d}, z=${r} outside of bounds. 0<=x<${Math.pow(2,r)}, 0<=y<${Math.pow(2,r)} 0<=z<=25 `);this.z=r,this.x=a,this.y=d,this.key=Xu(0,r,r,a,d)}equals(r){return this.z===r.z&&this.x===r.x&&this.y===r.y}url(r,a,d){const m=(x=this.y,S=this.z,P=c0(256*(_=this.x),256*(x=Math.pow(2,S)-x-1),S),A=c0(256*(_+1),256*(x+1),S),P[0]+","+P[1]+","+A[0]+","+A[1]);var _,x,S,P,A;const D=function(R,N,Z){let W,Q="";for(let ie=R;ie>0;ie--)W=1<1?"@2x":"").replace(/{quadkey}/g,D).replace(/{bbox-epsg-3857}/g,m)}isChildOf(r){const a=this.z-r.z;return a>0&&r.x===this.x>>a&&r.y===this.y>>a}getTilePoint(r){const a=Math.pow(2,this.z);return new k((r.x*a-this.x)*mi,(r.y*a-this.y)*mi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class u0{constructor(r,a){this.wrap=r,this.canonical=a,this.key=Xu(r,a.z,a.z,a.x,a.y)}}class Gn{constructor(r,a,d,m,_){if(r= z; overscaledZ = ${r}; z = ${d}`);this.overscaledZ=r,this.wrap=a,this.canonical=new fm(d,+m,+_),this.key=Xu(a,r,d,m,_)}clone(){return new Gn(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(r){return this.overscaledZ===r.overscaledZ&&this.wrap===r.wrap&&this.canonical.equals(r.canonical)}scaledTo(r){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-r;return r>this.canonical.z?new Gn(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gn(r,this.wrap,r,this.canonical.x>>a,this.canonical.y>>a)}calculateScaledKey(r,a){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const d=this.canonical.z-r;return r>this.canonical.z?Xu(this.wrap*+a,r,this.canonical.z,this.canonical.x,this.canonical.y):Xu(this.wrap*+a,r,r,this.canonical.x>>d,this.canonical.y>>d)}isChildOf(r){if(r.wrap!==this.wrap)return!1;const a=this.canonical.z-r.canonical.z;return r.overscaledZ===0||r.overscaledZ>a&&r.canonical.y===this.canonical.y>>a}children(r){if(this.overscaledZ>=r)return[new Gn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const a=this.canonical.z+1,d=2*this.canonical.x,m=2*this.canonical.y;return[new Gn(a,this.wrap,a,d,m),new Gn(a,this.wrap,a,d+1,m),new Gn(a,this.wrap,a,d,m+1),new Gn(a,this.wrap,a,d+1,m+1)]}isLessThan(r){return this.wrapr.wrap)&&(this.overscaledZr.overscaledZ)&&(this.canonical.xr.canonical.x)&&this.canonical.ythis.max&&(this.max=R),R=this.dim+1||a<-1||a>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(a+1)*this.stride+(r+1)}unpack(r,a,d){return r*this.redFactor+a*this.greenFactor+d*this.blueFactor-this.baseShift}getPixels(){return new qn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(r,a,d){if(this.dim!==r.dim)throw new Error("dem dimension mismatch");let m=a*this.dim,_=a*this.dim+this.dim,x=d*this.dim,S=d*this.dim+this.dim;switch(a){case-1:m=_-1;break;case 1:_=m+1}switch(d){case-1:x=S-1;break;case 1:S=x+1}const P=-a*this.dim,A=-d*this.dim;for(let D=x;D=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${r} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[r]}}class d0{constructor(r,a,d,m,_){this.type="Feature",this._vectorTileFeature=r,r._z=a,r._x=d,r._y=m,this.properties=r.properties,this.id=_}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(r){this._geometry=r}toJSON(){const r={geometry:this.geometry};for(const a in this)a!=="_geometry"&&a!=="_vectorTileFeature"&&(r[a]=this[a]);return r}}class p0{constructor(r,a){this.tileID=r,this.x=r.canonical.x,this.y=r.canonical.y,this.z=r.canonical.z,this.grid=new Zs(mi,16,0),this.grid3D=new Zs(mi,16,0),this.featureIndexArray=new Vn,this.promoteId=a}insert(r,a,d,m,_,x){const S=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(d,m,_);const P=x?this.grid3D:this.grid;for(let A=0;A=0&&R[3]>=0&&P.insert(S,R[0],R[1],R[2],R[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ea.VectorTile(new em(this.rawTileData)).layers,this.sourceLayerCoder=new f0(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(r,a,d,m){this.loadVTLayers();const _=r.params||{},x=mi/r.tileSize/r.scale,S=Qi(_.filter),P=r.queryGeometry,A=r.queryPadding*x,D=g0(P),R=this.grid.query(D.minX-A,D.minY-A,D.maxX+A,D.maxY+A),N=g0(r.cameraQueryGeometry),Z=this.grid3D.query(N.minX-A,N.minY-A,N.maxX+A,N.maxY+A,(ie,he,ke,ge)=>function(we,Re,He,ht,zt){for(const ut of we)if(Re<=ut.x&&He<=ut.y&&ht>=ut.x&&zt>=ut.y)return!0;const dt=[new k(Re,He),new k(Re,zt),new k(ht,zt),new k(ht,He)];if(we.length>2){for(const ut of dt)if(Kl(we,ut))return!0}for(let ut=0;ut(ge||(ge=Ya(we)),Re.queryIntersectsFeature(P,we,He,ge,this.z,r.transform,x,r.pixelPosMatrix)))}return W}loadMatchingFeature(r,a,d,m,_,x,S,P,A,D,R){const N=this.bucketLayerIDs[a];if(x&&!function(ie,he){for(let ke=0;ke=0)return!0;return!1}(x,N))return;const Z=this.sourceLayerCoder.decode(d),W=this.vtLayers[Z].feature(m);if(_.needGeometry){const ie=Qa(W,!0);if(!_.filter(new zr(this.tileID.overscaledZ),ie,this.tileID.canonical))return}else if(!_.filter(new zr(this.tileID.overscaledZ),W))return;const Q=this.getId(W,Z);for(let ie=0;ie{const S=r instanceof ql?r.get(x):null;return S&&S.evaluate?S.evaluate(a,d,m):S})}function g0(s){let r=1/0,a=1/0,d=-1/0,m=-1/0;for(const _ of s)r=Math.min(r,_.x),a=Math.min(a,_.y),d=Math.max(d,_.x),m=Math.max(m,_.y);return{minX:r,minY:a,maxX:d,maxY:m}}function gk(s,r){return r-s}function y0(s,r,a,d,m){const _=[];for(let x=0;x=d&&R.x>=d||(D.x>=d?D=new k(d,D.y+(d-D.x)/(R.x-D.x)*(R.y-D.y))._round():R.x>=d&&(R=new k(d,D.y+(d-D.x)/(R.x-D.x)*(R.y-D.y))._round()),D.y>=m&&R.y>=m||(D.y>=m?D=new k(D.x+(m-D.y)/(R.y-D.y)*(R.x-D.x),m)._round():R.y>=m&&(R=new k(D.x+(m-D.y)/(R.y-D.y)*(R.x-D.x),m)._round()),P&&D.equals(P[P.length-1])||(P=[D],_.push(P)),P.push(R)))))}}return _}St("FeatureIndex",p0,{omit:["rawTileData","sourceLayerCoder"]});class na extends k{constructor(r,a,d,m){super(r,a),this.angle=d,m!==void 0&&(this.segment=m)}clone(){return new na(this.x,this.y,this.angle,this.segment)}}function _0(s,r,a,d,m){if(r.segment===void 0||a===0)return!0;let _=r,x=r.segment+1,S=0;for(;S>-a/2;){if(x--,x<0)return!1;S-=s[x].dist(_),_=s[x]}S+=s[x].dist(s[x+1]),x++;const P=[];let A=0;for(;Sd;)A-=P.shift().angleDelta;if(A>m)return!1;x++,S+=D.dist(R)}return!0}function v0(s){let r=0;for(let a=0;aA){const W=(A-P)/Z,Q=kn.number(R.x,N.x,W),ie=kn.number(R.y,N.y,W),he=new na(Q,ie,N.angleTo(R),D);return he._round(),!x||_0(s,he,S,x,r)?he:void 0}P+=Z}}function _k(s,r,a,d,m,_,x,S,P){const A=b0(d,_,x),D=x0(d,m),R=D*x,N=s[0].x===0||s[0].x===P||s[0].y===0||s[0].y===P;return r-R=0&&we=0&&Re=0&&N+A<=D){const He=new na(we,Re,ke,W);He._round(),d&&!_0(s,He,_,d,m)||Z.push(He)}}R+=he}return S||Z.length||x||(Z=w0(s,R/2,a,d,m,_,x,!0,P)),Z}St("Anchor",na);const oc=Mn;function S0(s,r,a,d){const m=[],_=s.image,x=_.pixelRatio,S=_.paddedRect.w-2*oc,P=_.paddedRect.h-2*oc;let A={x1:s.left,y1:s.top,x2:s.right,y2:s.bottom};const D=_.stretchX||[[0,S]],R=_.stretchY||[[0,P]],N=(Ne,Tt)=>Ne+Tt[1]-Tt[0],Z=D.reduce(N,0),W=R.reduce(N,0),Q=S-Z,ie=P-W;let he=0,ke=Z,ge=0,we=W,Re=0,He=Q,ht=0,zt=ie;if(_.content&&d){const Ne=_.content,Tt=Ne[2]-Ne[0],Pt=Ne[3]-Ne[1];(_.textFitWidth||_.textFitHeight)&&(A=J_(s)),he=$f(D,0,Ne[0]),ge=$f(R,0,Ne[1]),ke=$f(D,Ne[0],Ne[2]),we=$f(R,Ne[1],Ne[3]),Re=Ne[0]-he,ht=Ne[1]-ge,He=Tt-ke,zt=Pt-we}const dt=A.x1,ut=A.y1,Mt=A.x2-dt,kt=A.y2-ut,vt=(Ne,Tt,Pt,Vt)=>{const Tr=Nf(Ne.stretch-he,ke,Mt,dt),Mr=jf(Ne.fixed-Re,He,Ne.stretch,Z),Ti=Nf(Tt.stretch-ge,we,kt,ut),ho=jf(Tt.fixed-ht,zt,Tt.stretch,W),Hi=Nf(Pt.stretch-he,ke,Mt,dt),oi=jf(Pt.fixed-Re,He,Pt.stretch,Z),pn=Nf(Vt.stretch-ge,we,kt,ut),mn=jf(Vt.fixed-ht,zt,Vt.stretch,W),gn=new k(Tr,Ti),si=new k(Hi,Ti),Ci=new k(Hi,pn),tn=new k(Tr,pn),Wi=new k(Mr/x,ho/x),yn=new k(oi/x,mn/x),Xi=r*Math.PI/180;if(Xi){const gr=Math.sin(Xi),Lr=Math.cos(Xi),qr=[Lr,-gr,gr,Lr];gn._matMult(qr),si._matMult(qr),tn._matMult(qr),Ci._matMult(qr)}const Zn=Ne.stretch+Ne.fixed,In=Tt.stretch+Tt.fixed;return{tl:gn,tr:si,bl:tn,br:Ci,tex:{x:_.paddedRect.x+oc+Zn,y:_.paddedRect.y+oc+In,w:Pt.stretch+Pt.fixed-Zn,h:Vt.stretch+Vt.fixed-In},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Wi,pixelOffsetBR:yn,minFontScaleX:He/x/Mt,minFontScaleY:zt/x/kt,isSDF:a}};if(d&&(_.stretchX||_.stretchY)){const Ne=k0(D,Q,Z),Tt=k0(R,ie,W);for(let Pt=0;Pt0&&(Q=Math.max(10,Q),this.circleDiameter=Q)}else{const N=!((R=x.image)===null||R===void 0)&&R.content&&(x.image.textFitWidth||x.image.textFitHeight)?J_(x):{x1:x.left,y1:x.top,x2:x.right,y2:x.bottom};N.y1=N.y1*S-P[0],N.y2=N.y2*S+P[2],N.x1=N.x1*S-P[3],N.x2=N.x2*S+P[1];const Z=x.collisionPadding;if(Z&&(N.x1-=Z[0]*S,N.y1-=Z[1]*S,N.x2+=Z[2]*S,N.y2+=Z[3]*S),D){const W=new k(N.x1,N.y1),Q=new k(N.x2,N.y1),ie=new k(N.x1,N.y2),he=new k(N.x2,N.y2),ke=D*Math.PI/180;W._rotate(ke),Q._rotate(ke),ie._rotate(ke),he._rotate(ke),N.x1=Math.min(W.x,Q.x,ie.x,he.x),N.x2=Math.max(W.x,Q.x,ie.x,he.x),N.y1=Math.min(W.y,Q.y,ie.y,he.y),N.y2=Math.max(W.y,Q.y,ie.y,he.y)}r.emplaceBack(a.x,a.y,N.x1,N.y1,N.x2,N.y2,d,m,_)}this.boxEndIndex=r.length}}class vk{constructor(r=[],a=bk){if(this.data=r,this.length=this.data.length,this.compare=a,this.length>0)for(let d=(this.length>>1)-1;d>=0;d--)this._down(d)}push(r){this.data.push(r),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const r=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:a,compare:d}=this,m=a[r];for(;r>0;){const _=r-1>>1,x=a[_];if(d(m,x)>=0)break;a[r]=x,r=_}a[r]=m}_down(r){const{data:a,compare:d}=this,m=this.length>>1,_=a[r];for(;r=0)break;a[r]=S,r=x}a[r]=_}}function bk(s,r){return sr?1:0}function xk(s,r=1,a=!1){let d=1/0,m=1/0,_=-1/0,x=-1/0;const S=s[0];for(let Z=0;Z_)&&(_=W.x),(!Z||W.y>x)&&(x=W.y)}const P=Math.min(_-d,x-m);let A=P/2;const D=new vk([],wk);if(P===0)return new k(d,m);for(let Z=d;Z<_;Z+=P)for(let W=m;WR.d||!R.d)&&(R=Z,a&&console.log("found best %d after %d probes",Math.round(1e4*Z.d)/1e4,N)),Z.max-R.d<=r||(A=Z.h/2,D.push(new sc(Z.p.x-A,Z.p.y-A,A,s)),D.push(new sc(Z.p.x+A,Z.p.y-A,A,s)),D.push(new sc(Z.p.x-A,Z.p.y+A,A,s)),D.push(new sc(Z.p.x+A,Z.p.y+A,A,s)),N+=4)}return a&&(console.log(`num probes: ${N}`),console.log(`best distance: ${R.d}`)),R.p}function wk(s,r){return r.max-s.max}function sc(s,r,a,d){this.p=new k(s,r),this.h=a,this.d=function(m,_){let x=!1,S=1/0;for(let P=0;P<_.length;P++){const A=_[P];for(let D=0,R=A.length,N=R-1;Dm.y!=W.y>m.y&&m.x<(W.x-Z.x)*(m.y-Z.y)/(W.y-Z.y)+Z.x&&(x=!x),S=Math.min(S,a_(m,Z,W))}}return(x?1:-1)*Math.sqrt(S)}(this.p,d),this.max=this.d+this.h*Math.SQRT2}var Zi;f.ar=void 0,(Zi=f.ar||(f.ar={}))[Zi.center=1]="center",Zi[Zi.left=2]="left",Zi[Zi.right=3]="right",Zi[Zi.top=4]="top",Zi[Zi.bottom=5]="bottom",Zi[Zi["top-left"]=6]="top-left",Zi[Zi["top-right"]=7]="top-right",Zi[Zi["bottom-left"]=8]="bottom-left",Zi[Zi["bottom-right"]=9]="bottom-right";const oa=7,dm=Number.POSITIVE_INFINITY;function E0(s,r){return r[1]!==dm?function(a,d,m){let _=0,x=0;switch(d=Math.abs(d),m=Math.abs(m),a){case"top-right":case"top-left":case"top":x=m-oa;break;case"bottom-right":case"bottom-left":case"bottom":x=-m+oa}switch(a){case"top-right":case"bottom-right":case"right":_=-d;break;case"top-left":case"bottom-left":case"left":_=d}return[_,x]}(s,r[0],r[1]):function(a,d){let m=0,_=0;d<0&&(d=0);const x=d/Math.SQRT2;switch(a){case"top-right":case"top-left":_=x-oa;break;case"bottom-right":case"bottom-left":_=-x+oa;break;case"bottom":_=-d+oa;break;case"top":_=d-oa}switch(a){case"top-right":case"bottom-right":m=-x;break;case"top-left":case"bottom-left":m=x;break;case"left":m=d;break;case"right":m=-d}return[m,_]}(s,r[0])}function P0(s,r,a){var d;const m=s.layout,_=(d=m.get("text-variable-anchor-offset"))===null||d===void 0?void 0:d.evaluate(r,{},a);if(_){const S=_.values,P=[];for(let A=0;AN*Si);D.startsWith("top")?R[1]-=oa:D.startsWith("bottom")&&(R[1]+=oa),P[A+1]=R}return new Sn(P)}const x=m.get("text-variable-anchor");if(x){let S;S=s._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[m.get("text-radial-offset").evaluate(r,{},a)*Si,dm]:m.get("text-offset").evaluate(r,{},a).map(A=>A*Si);const P=[];for(const A of x)P.push(A,E0(A,S));return new Sn(P)}return null}function pm(s){switch(s){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Sk(s,r,a,d,m,_,x,S,P,A,D){let R=_.textMaxSize.evaluate(r,{});R===void 0&&(R=x);const N=s.layers[0].layout,Z=N.get("icon-offset").evaluate(r,{},D),W=I0(a.horizontal),Q=x/24,ie=s.tilePixelRatio*Q,he=s.tilePixelRatio*R/24,ke=s.tilePixelRatio*S,ge=s.tilePixelRatio*N.get("symbol-spacing"),we=N.get("text-padding")*s.tilePixelRatio,Re=function(Ne,Tt,Pt,Vt=1){const Tr=Ne.get("icon-padding").evaluate(Tt,{},Pt),Mr=Tr&&Tr.values;return[Mr[0]*Vt,Mr[1]*Vt,Mr[2]*Vt,Mr[3]*Vt]}(N,r,D,s.tilePixelRatio),He=N.get("text-max-angle")/180*Math.PI,ht=N.get("text-rotation-alignment")!=="viewport"&&N.get("symbol-placement")!=="point",zt=N.get("icon-rotation-alignment")==="map"&&N.get("symbol-placement")!=="point",dt=N.get("symbol-placement"),ut=ge/2,Mt=N.get("icon-text-fit");let kt;d&&Mt!=="none"&&(s.allowVerticalPlacement&&a.vertical&&(kt=K_(d,a.vertical,Mt,N.get("icon-text-fit-padding"),Z,Q)),W&&(d=K_(d,W,Mt,N.get("icon-text-fit-padding"),Z,Q)));const vt=(Ne,Tt)=>{Tt.x<0||Tt.x>=mi||Tt.y<0||Tt.y>=mi||function(Pt,Vt,Tr,Mr,Ti,ho,Hi,oi,pn,mn,gn,si,Ci,tn,Wi,yn,Xi,Zn,In,gr,Lr,qr,Rn,ii,ac){const Xo=Pt.addToLineVertexArray(Vt,Tr);let Jo,fo,Hn,Di,Ss=0,Yu=0,z0=0,L0=0,wm=-1,Sm=-1;const ks={};let D0=Xl("");if(Pt.allowVerticalPlacement&&Mr.vertical){const rn=oi.layout.get("text-rotate").evaluate(Lr,{},ii)+90;Hn=new Vf(pn,Vt,mn,gn,si,Mr.vertical,Ci,tn,Wi,rn),Hi&&(Di=new Vf(pn,Vt,mn,gn,si,Hi,Xi,Zn,Wi,rn))}if(Ti){const rn=oi.layout.get("icon-rotate").evaluate(Lr,{}),Wn=oi.layout.get("icon-text-fit")!=="none",tl=S0(Ti,rn,Rn,Wn),Co=Hi?S0(Hi,rn,Rn,Wn):void 0;fo=new Vf(pn,Vt,mn,gn,si,Ti,Xi,Zn,!1,rn),Ss=4*tl.length;const rl=Pt.iconSizeData;let Ko=null;rl.kind==="source"?(Ko=[Wo*oi.layout.get("icon-size").evaluate(Lr,{})],Ko[0]>ra&&at(`${Pt.layerIds[0]}: Value for "icon-size" is >= ${Wu}. Reduce your "icon-size".`)):rl.kind==="composite"&&(Ko=[Wo*qr.compositeIconSizes[0].evaluate(Lr,{},ii),Wo*qr.compositeIconSizes[1].evaluate(Lr,{},ii)],(Ko[0]>ra||Ko[1]>ra)&&at(`${Pt.layerIds[0]}: Value for "icon-size" is >= ${Wu}. Reduce your "icon-size".`)),Pt.addSymbols(Pt.icon,tl,Ko,gr,In,Lr,f.ai.none,Vt,Xo.lineStartIndex,Xo.lineLength,-1,ii),wm=Pt.icon.placedSymbolArray.length-1,Co&&(Yu=4*Co.length,Pt.addSymbols(Pt.icon,Co,Ko,gr,In,Lr,f.ai.vertical,Vt,Xo.lineStartIndex,Xo.lineLength,-1,ii),Sm=Pt.icon.placedSymbolArray.length-1)}const F0=Object.keys(Mr.horizontal);for(const rn of F0){const Wn=Mr.horizontal[rn];if(!Jo){D0=Xl(Wn.text);const Co=oi.layout.get("text-rotate").evaluate(Lr,{},ii);Jo=new Vf(pn,Vt,mn,gn,si,Wn,Ci,tn,Wi,Co)}const tl=Wn.positionedLines.length===1;if(z0+=M0(Pt,Vt,Wn,ho,oi,Wi,Lr,yn,Xo,Mr.vertical?f.ai.horizontal:f.ai.horizontalOnly,tl?F0:[rn],ks,wm,qr,ii),tl)break}Mr.vertical&&(L0+=M0(Pt,Vt,Mr.vertical,ho,oi,Wi,Lr,yn,Xo,f.ai.vertical,["vertical"],ks,Sm,qr,ii));const Pk=Jo?Jo.boxStartIndex:Pt.collisionBoxArray.length,Mk=Jo?Jo.boxEndIndex:Pt.collisionBoxArray.length,Ik=Hn?Hn.boxStartIndex:Pt.collisionBoxArray.length,Tk=Hn?Hn.boxEndIndex:Pt.collisionBoxArray.length,Ck=fo?fo.boxStartIndex:Pt.collisionBoxArray.length,Ak=fo?fo.boxEndIndex:Pt.collisionBoxArray.length,zk=Di?Di.boxStartIndex:Pt.collisionBoxArray.length,Lk=Di?Di.boxEndIndex:Pt.collisionBoxArray.length;let To=-1;const qf=(rn,Wn)=>rn&&rn.circleDiameter?Math.max(rn.circleDiameter,Wn):Wn;To=qf(Jo,To),To=qf(Hn,To),To=qf(fo,To),To=qf(Di,To);const R0=To>-1?1:0;R0&&(To*=ac/Si),Pt.glyphOffsetArray.length>=nc.MAX_GLYPHS&&at("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Lr.sortKey!==void 0&&Pt.addToSortKeyRanges(Pt.symbolInstances.length,Lr.sortKey);const Dk=P0(oi,Lr,ii),[Fk,Rk]=function(rn,Wn){const tl=rn.length,Co=Wn==null?void 0:Wn.values;if((Co==null?void 0:Co.length)>0)for(let rl=0;rl=0?ks.right:-1,ks.center>=0?ks.center:-1,ks.left>=0?ks.left:-1,ks.vertical||-1,wm,Sm,D0,Pk,Mk,Ik,Tk,Ck,Ak,zk,Lk,mn,z0,L0,Ss,Yu,R0,0,Ci,To,Fk,Rk)}(s,Tt,Ne,a,d,m,kt,s.layers[0],s.collisionBoxArray,r.index,r.sourceLayerIndex,s.index,ie,[we,we,we,we],ht,P,ke,Re,zt,Z,r,_,A,D,x)};if(dt==="line")for(const Ne of y0(r.geometry,0,0,mi,mi)){const Tt=_k(Ne,ge,He,a.vertical||W,d,24,he,s.overscaling,mi);for(const Pt of Tt)W&&kk(s,W.text,ut,Pt)||vt(Ne,Pt)}else if(dt==="line-center"){for(const Ne of r.geometry)if(Ne.length>1){const Tt=yk(Ne,He,a.vertical||W,d,24,he);Tt&&vt(Ne,Tt)}}else if(r.type==="Polygon")for(const Ne of Pl(r.geometry,0)){const Tt=xk(Ne,16);vt(Ne[0],new na(Tt.x,Tt.y,0))}else if(r.type==="LineString")for(const Ne of r.geometry)vt(Ne,new na(Ne[0].x,Ne[0].y,0));else if(r.type==="Point")for(const Ne of r.geometry)for(const Tt of Ne)vt([Tt],new na(Tt.x,Tt.y,0))}function M0(s,r,a,d,m,_,x,S,P,A,D,R,N,Z,W){const Q=function(ke,ge,we,Re,He,ht,zt,dt){const ut=Re.layout.get("text-rotate").evaluate(ht,{})*Math.PI/180,Mt=[];for(const kt of ge.positionedLines)for(const vt of kt.positionedGlyphs){if(!vt.rect)continue;const Ne=vt.rect||{};let Tt=U_+1,Pt=!0,Vt=1,Tr=0;const Mr=(He||dt)&&vt.vertical,Ti=vt.metrics.advance*vt.scale/2;if(dt&&ge.verticalizable&&(Tr=kt.lineOffset/2-(vt.imageName?-(Si-vt.metrics.width*vt.scale)/2:(vt.scale-1)*Si)),vt.imageName){const gr=zt[vt.imageName];Pt=gr.sdf,Vt=gr.pixelRatio,Tt=Mn/Vt}const ho=He?[vt.x+Ti,vt.y]:[0,0];let Hi=He?[0,0]:[vt.x+Ti+we[0],vt.y+we[1]-Tr],oi=[0,0];Mr&&(oi=Hi,Hi=[0,0]);const pn=vt.metrics.isDoubleResolution?2:1,mn=(vt.metrics.left-Tt)*vt.scale-Ti+Hi[0],gn=(-vt.metrics.top-Tt)*vt.scale+Hi[1],si=mn+Ne.w/pn*vt.scale/Vt,Ci=gn+Ne.h/pn*vt.scale/Vt,tn=new k(mn,gn),Wi=new k(si,gn),yn=new k(mn,Ci),Xi=new k(si,Ci);if(Mr){const gr=new k(-Ti,Ti-Zu),Lr=-Math.PI/2,qr=Si/2-Ti,Rn=new k(5-Zu-qr,-(vt.imageName?qr:0)),ii=new k(...oi);tn._rotateAround(Lr,gr)._add(Rn)._add(ii),Wi._rotateAround(Lr,gr)._add(Rn)._add(ii),yn._rotateAround(Lr,gr)._add(Rn)._add(ii),Xi._rotateAround(Lr,gr)._add(Rn)._add(ii)}if(ut){const gr=Math.sin(ut),Lr=Math.cos(ut),qr=[Lr,-gr,gr,Lr];tn._matMult(qr),Wi._matMult(qr),yn._matMult(qr),Xi._matMult(qr)}const Zn=new k(0,0),In=new k(0,0);Mt.push({tl:tn,tr:Wi,bl:yn,br:Xi,tex:Ne,writingMode:ge.writingMode,glyphOffset:ho,sectionIndex:vt.sectionIndex,isSDF:Pt,pixelOffsetTL:Zn,pixelOffsetBR:In,minFontScaleX:0,minFontScaleY:0})}return Mt}(0,a,S,m,_,x,d,s.allowVerticalPlacement),ie=s.textSizeData;let he=null;ie.kind==="source"?(he=[Wo*m.layout.get("text-size").evaluate(x,{})],he[0]>ra&&at(`${s.layerIds[0]}: Value for "text-size" is >= ${Wu}. Reduce your "text-size".`)):ie.kind==="composite"&&(he=[Wo*Z.compositeTextSizes[0].evaluate(x,{},W),Wo*Z.compositeTextSizes[1].evaluate(x,{},W)],(he[0]>ra||he[1]>ra)&&at(`${s.layerIds[0]}: Value for "text-size" is >= ${Wu}. Reduce your "text-size".`)),s.addSymbols(s.text,Q,he,S,_,x,A,r,P.lineStartIndex,P.lineLength,N,W);for(const ke of D)R[ke]=s.text.placedSymbolArray.length-1;return 4*Q.length}function I0(s){for(const r in s)return s[r];return null}function kk(s,r,a,d){const m=s.compareText;if(r in m){const _=m[r];for(let x=_.length-1;x>=0;x--)if(d.dist(_[x])>4;if(m!==1)throw new Error(`Got v${m} data when expected v1.`);const _=T0[15&d];if(!_)throw new Error("Unrecognized array type.");const[x]=new Uint16Array(r,2,1),[S]=new Uint32Array(r,4,1);return new mm(S,x,_,r)}constructor(r,a=64,d=Float64Array,m){if(isNaN(r)||r<0)throw new Error(`Unpexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+a,2),65535),this.ArrayType=d,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;const _=T0.indexOf(this.ArrayType),x=2*r*this.ArrayType.BYTES_PER_ELEMENT,S=r*this.IndexArrayType.BYTES_PER_ELEMENT,P=(8-S%8)%8;if(_<0)throw new Error(`Unexpected typed array class: ${d}.`);m&&m instanceof ArrayBuffer?(this.data=m,this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+P,2*r),this._pos=2*r,this._finished=!0):(this.data=new ArrayBuffer(8+x+S+P),this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+P,2*r),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+_]),new Uint16Array(this.data,2,1)[0]=a,new Uint32Array(this.data,4,1)[0]=r)}add(r,a){const d=this._pos>>1;return this.ids[d]=d,this.coords[this._pos++]=r,this.coords[this._pos++]=a,d}finish(){const r=this._pos>>1;if(r!==this.numItems)throw new Error(`Added ${r} items when expected ${this.numItems}.`);return gm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,a,d,m){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:_,coords:x,nodeSize:S}=this,P=[0,_.length-1,0],A=[];for(;P.length;){const D=P.pop()||0,R=P.pop()||0,N=P.pop()||0;if(R-N<=S){for(let ie=N;ie<=R;ie++){const he=x[2*ie],ke=x[2*ie+1];he>=r&&he<=d&&ke>=a&&ke<=m&&A.push(_[ie])}continue}const Z=N+R>>1,W=x[2*Z],Q=x[2*Z+1];W>=r&&W<=d&&Q>=a&&Q<=m&&A.push(_[Z]),(D===0?r<=W:a<=Q)&&(P.push(N),P.push(Z-1),P.push(1-D)),(D===0?d>=W:m>=Q)&&(P.push(Z+1),P.push(R),P.push(1-D))}return A}within(r,a,d){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:_,nodeSize:x}=this,S=[0,m.length-1,0],P=[],A=d*d;for(;S.length;){const D=S.pop()||0,R=S.pop()||0,N=S.pop()||0;if(R-N<=x){for(let ie=N;ie<=R;ie++)A0(_[2*ie],_[2*ie+1],r,a)<=A&&P.push(m[ie]);continue}const Z=N+R>>1,W=_[2*Z],Q=_[2*Z+1];A0(W,Q,r,a)<=A&&P.push(m[Z]),(D===0?r-d<=W:a-d<=Q)&&(S.push(N),S.push(Z-1),S.push(1-D)),(D===0?r+d>=W:a+d>=Q)&&(S.push(Z+1),S.push(R),S.push(1-D))}return P}}function gm(s,r,a,d,m,_){if(m-d<=a)return;const x=d+m>>1;C0(s,r,x,d,m,_),gm(s,r,a,d,x-1,1-_),gm(s,r,a,x+1,m,1-_)}function C0(s,r,a,d,m,_){for(;m>d;){if(m-d>600){const A=m-d+1,D=a-d+1,R=Math.log(A),N=.5*Math.exp(2*R/3),Z=.5*Math.sqrt(R*N*(A-N)/A)*(D-A/2<0?-1:1);C0(s,r,a,Math.max(d,Math.floor(a-D*N/A+Z)),Math.min(m,Math.floor(a+(A-D)*N/A+Z)),_)}const x=r[2*a+_];let S=d,P=m;for(Ju(s,r,d,a),r[2*m+_]>x&&Ju(s,r,d,m);Sx;)P--}r[2*d+_]===x?Ju(s,r,d,P):(P++,Ju(s,r,P,m)),P<=a&&(d=P+1),a<=P&&(m=P-1)}}function Ju(s,r,a,d){ym(s,a,d),ym(r,2*a,2*d),ym(r,2*a+1,2*d+1)}function ym(s,r,a){const d=s[r];s[r]=s[a],s[a]=d}function A0(s,r,a,d){const m=s-a,_=r-d;return m*m+_*_}var _m;f.bf=void 0,(_m=f.bf||(f.bf={})).create="create",_m.load="load",_m.fullLoad="fullLoad";let Uf=null,Ku=[];const vm=1e3/60,bm="loadTime",xm="fullLoadTime",Ek={mark(s){performance.mark(s)},frame(s){const r=s;Uf!=null&&Ku.push(r-Uf),Uf=r},clearMetrics(){Uf=null,Ku=[],performance.clearMeasures(bm),performance.clearMeasures(xm);for(const s in f.bf)performance.clearMarks(f.bf[s])},getPerformanceMetrics(){performance.measure(bm,f.bf.create,f.bf.load),performance.measure(xm,f.bf.create,f.bf.fullLoad);const s=performance.getEntriesByName(bm)[0].duration,r=performance.getEntriesByName(xm)[0].duration,a=Ku.length,d=1/(Ku.reduce((_,x)=>_+x,0)/a/1e3),m=Ku.filter(_=>_>vm).reduce((_,x)=>_+(x-vm)/vm,0);return{loadTime:s,fullLoadTime:r,fps:d,percentDroppedFrames:m/(a+m)*100,totalFrames:a}}};f.$=class extends K{},f.A=Yl,f.B=ku,f.C=function(s){if(qt==null){const r=s.navigator?s.navigator.userAgent:null;qt=!!s.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return qt},f.D=It,f.E=nr,f.F=class{constructor(s,r){this.target=s,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new mk(()=>this.process()),this.subscription=function(a,d,m,_){return a.addEventListener(d,m,!1),{unsubscribe:()=>{a.removeEventListener(d,m,!1)}}}(this.target,"message",a=>this.receive(a)),this.globalScope=Ht(self)?s:window}registerMessageHandler(s,r){this.messageHandlers[s]=r}sendAsync(s,r){return new Promise((a,d)=>{const m=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[m]={resolve:a,reject:d},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[m];const S={id:m,type:"",origin:location.origin,targetMapId:s.targetMapId,sourceMapId:this.mapId};this.target.postMessage(S)},{once:!0});const _=[],x=Object.assign(Object.assign({},s),{id:m,sourceMapId:this.mapId,origin:location.origin,data:Wa(s.data,_)});this.target.postMessage(x,{transfer:_})})}receive(s){const r=s.data,a=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!==location.origin||r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type===""){delete this.tasks[a];const d=this.abortControllers[a];return delete this.abortControllers[a],void(d&&d.abort())}if(Ht(self)||r.mustQueue)return this.tasks[a]=r,this.taskQueue.push(a),void this.invoker.trigger();this.processTask(a,r)}}process(){if(this.taskQueue.length===0)return;const s=this.taskQueue.shift(),r=this.tasks[s];delete this.tasks[s],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(s,r)}processTask(s,r){return c(this,void 0,void 0,function*(){if(r.type===""){const m=this.resolveRejects[s];return delete this.resolveRejects[s],m?void(r.error?m.reject(co(r.error)):m.resolve(co(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(s,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const a=co(r.data),d=new AbortController;this.abortControllers[s]=d;try{const m=yield this.messageHandlers[r.type](r.sourceMapId,a,d);this.completeTask(s,null,m)}catch(m){this.completeTask(s,m)}})}completeTask(s,r,a){const d=[];delete this.abortControllers[s];const m={id:s,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?Wa(r):null,data:Wa(a,d)};this.target.postMessage(m,{transfer:d})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},f.G=tr,f.H=function(){var s=new Yl(16);return Yl!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s},f.I=rm,f.J=function(s,r,a){var d,m,_,x,S,P,A,D,R,N,Z,W,Q=a[0],ie=a[1],he=a[2];return r===s?(s[12]=r[0]*Q+r[4]*ie+r[8]*he+r[12],s[13]=r[1]*Q+r[5]*ie+r[9]*he+r[13],s[14]=r[2]*Q+r[6]*ie+r[10]*he+r[14],s[15]=r[3]*Q+r[7]*ie+r[11]*he+r[15]):(m=r[1],_=r[2],x=r[3],S=r[4],P=r[5],A=r[6],D=r[7],R=r[8],N=r[9],Z=r[10],W=r[11],s[0]=d=r[0],s[1]=m,s[2]=_,s[3]=x,s[4]=S,s[5]=P,s[6]=A,s[7]=D,s[8]=R,s[9]=N,s[10]=Z,s[11]=W,s[12]=d*Q+S*ie+R*he+r[12],s[13]=m*Q+P*ie+N*he+r[13],s[14]=_*Q+A*ie+Z*he+r[14],s[15]=x*Q+D*ie+W*he+r[15]),s},f.K=function(s,r,a){var d=a[0],m=a[1],_=a[2];return s[0]=r[0]*d,s[1]=r[1]*d,s[2]=r[2]*d,s[3]=r[3]*d,s[4]=r[4]*m,s[5]=r[5]*m,s[6]=r[6]*m,s[7]=r[7]*m,s[8]=r[8]*_,s[9]=r[9]*_,s[10]=r[10]*_,s[11]=r[11]*_,s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15],s},f.L=h_,f.M=function(s,r){const a={};for(let d=0;d{const r=window.document.createElement("video");return r.muted=!0,new Promise(a=>{r.onloadstart=()=>{a(r)};for(const d of s){const m=window.document.createElement("source");cr(d)||(r.crossOrigin="Anonymous"),m.src=d,r.appendChild(m)}})},f.a4=function(){return Pe++},f.a5=Qt,f.a6=nc,f.a7=Qi,f.a8=Qa,f.a9=zr,f.aA=function(s){s=s.slice();const r=Object.create(null);for(let a=0;a{"source"in x&&d[x.source]?a.push({command:"removeLayer",args:[x.id]}):_.push(x)}),a=a.concat(m),function(x,S,P){S=S||[];const A=(x=x||[]).map(Ea),D=S.map(Ea),R=x.reduce(Pa,{}),N=S.reduce(Pa,{}),Z=A.slice(),W=Object.create(null);let Q,ie,he,ke,ge;for(let we=0,Re=0;we@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(a,d,m,_)=>{const x=m||_;return r[d]=!x||x.toLowerCase(),""}),r["max-age"]){const a=parseInt(r["max-age"],10);isNaN(a)?delete r["max-age"]:r["max-age"]=a}return r},f.ac=function(s,r){const a=[];for(const d in s)d in r||a.push(d);return a},f.ad=X,f.ae=function(s,r,a){var d=Math.sin(a),m=Math.cos(a),_=r[0],x=r[1],S=r[2],P=r[3],A=r[4],D=r[5],R=r[6],N=r[7];return r!==s&&(s[8]=r[8],s[9]=r[9],s[10]=r[10],s[11]=r[11],s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15]),s[0]=_*m+A*d,s[1]=x*m+D*d,s[2]=S*m+R*d,s[3]=P*m+N*d,s[4]=A*m-_*d,s[5]=D*m-x*d,s[6]=R*m-S*d,s[7]=N*m-P*d,s},f.af=function(s){var r=new Yl(16);return r[0]=s[0],r[1]=s[1],r[2]=s[2],r[3]=s[3],r[4]=s[4],r[5]=s[5],r[6]=s[6],r[7]=s[7],r[8]=s[8],r[9]=s[9],r[10]=s[10],r[11]=s[11],r[12]=s[12],r[13]=s[13],r[14]=s[14],r[15]=s[15],r},f.ag=Mf,f.ah=function(s,r){let a=0,d=0;if(s.kind==="constant")d=s.layoutSize;else if(s.kind!=="source"){const{interpolationType:m,minZoom:_,maxZoom:x}=s,S=m?X(En.interpolationFactor(m,r,_,x),0,1):0;s.kind==="camera"?d=kn.number(s.minSize,s.maxSize,S):a=S}return{uSizeT:a,uSize:d}},f.aj=function(s,{uSize:r,uSizeT:a},{lowerSize:d,upperSize:m}){return s.kind==="source"?d/Wo:s.kind==="composite"?kn.number(d/Wo,m/Wo,a):r},f.ak=sm,f.al=function(s,r,a,d){const m=r.y-s.y,_=r.x-s.x,x=d.y-a.y,S=d.x-a.x,P=x*_-S*m;if(P===0)return null;const A=(S*(s.y-a.y)-x*(s.x-a.x))/P;return new k(s.x+A*_,s.y+A*m)},f.am=y0,f.an=o_,f.ao=Np,f.ap=function(s){let r=1/0,a=1/0,d=-1/0,m=-1/0;for(const _ of s)r=Math.min(r,_.x),a=Math.min(a,_.y),d=Math.max(d,_.x),m=Math.max(m,_.y);return[r,a,d,m]},f.aq=Si,f.as=om,f.at=function(s,r){var a=r[0],d=r[1],m=r[2],_=r[3],x=r[4],S=r[5],P=r[6],A=r[7],D=r[8],R=r[9],N=r[10],Z=r[11],W=r[12],Q=r[13],ie=r[14],he=r[15],ke=a*S-d*x,ge=a*P-m*x,we=a*A-_*x,Re=d*P-m*S,He=d*A-_*S,ht=m*A-_*P,zt=D*Q-R*W,dt=D*ie-N*W,ut=D*he-Z*W,Mt=R*ie-N*Q,kt=R*he-Z*Q,vt=N*he-Z*ie,Ne=ke*vt-ge*kt+we*Mt+Re*ut-He*dt+ht*zt;return Ne?(s[0]=(S*vt-P*kt+A*Mt)*(Ne=1/Ne),s[1]=(m*kt-d*vt-_*Mt)*Ne,s[2]=(Q*ht-ie*He+he*Re)*Ne,s[3]=(N*He-R*ht-Z*Re)*Ne,s[4]=(P*ut-x*vt-A*dt)*Ne,s[5]=(a*vt-m*ut+_*dt)*Ne,s[6]=(ie*we-W*ht-he*ge)*Ne,s[7]=(D*ht-N*we+Z*ge)*Ne,s[8]=(x*kt-S*ut+A*zt)*Ne,s[9]=(d*ut-a*kt-_*zt)*Ne,s[10]=(W*He-Q*we+he*ke)*Ne,s[11]=(R*we-D*He-Z*ke)*Ne,s[12]=(S*dt-x*Mt-P*zt)*Ne,s[13]=(a*Mt-d*dt+m*zt)*Ne,s[14]=(Q*ge-W*Re-ie*ke)*Ne,s[15]=(D*Re-R*ge+N*ke)*Ne,s):null},f.au=pm,f.av=nm,f.aw=mm,f.ax=function(){const s={},r=Te.$version;for(const a in Te.$root){const d=Te.$root[a];if(d.required){let m=null;m=a==="version"?r:d.type==="array"?[]:{},m!=null&&(s[a]=m)}}return s},f.ay=mf,f.az=rr,f.b=Ue,f.b0=function(s,r){return s[0]=r[0],s[1]=r[1],s[2]=r[2],s[3]=r[3],s[4]=r[4],s[5]=r[5],s[6]=r[6],s[7]=r[7],s[8]=r[8],s[9]=r[9],s[10]=r[10],s[11]=r[11],s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15],s},f.b1=function(s,r,a){return s[0]=r[0]*a[0],s[1]=r[1]*a[1],s[2]=r[2]*a[2],s[3]=r[3]*a[3],s},f.b2=function(s,r){return s[0]*r[0]+s[1]*r[1]+s[2]*r[2]+s[3]*r[3]},f.b3=pe,f.b4=u0,f.b5=l0,f.b6=function(s,r,a,d,m){var _,x=1/Math.tan(r/2);return s[0]=x/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=x,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=-1,s[12]=0,s[13]=0,s[15]=0,m!=null&&m!==1/0?(s[10]=(m+d)*(_=1/(d-m)),s[14]=2*m*d*_):(s[10]=-1,s[14]=-2*d),s},f.b7=function(s,r,a){var d=Math.sin(a),m=Math.cos(a),_=r[4],x=r[5],S=r[6],P=r[7],A=r[8],D=r[9],R=r[10],N=r[11];return r!==s&&(s[0]=r[0],s[1]=r[1],s[2]=r[2],s[3]=r[3],s[12]=r[12],s[13]=r[13],s[14]=r[14],s[15]=r[15]),s[4]=_*m+A*d,s[5]=x*m+D*d,s[6]=S*m+R*d,s[7]=P*m+N*d,s[8]=A*m-_*d,s[9]=D*m-x*d,s[10]=R*m-S*d,s[11]=N*m-P*d,s},f.b8=V,f.b9=me,f.bA=function(s){return s.message===Jt},f.bB=gs,f.bC=Go,f.ba=function(s){return s*Math.PI/180},f.bb=function(s,r){return s[0]=r[0],s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r[1],s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=r[2],s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s},f.bc=class extends H{},f.bd=um,f.be=Ek,f.bg=rt,f.bh=function(s,r){Ve.REGISTERED_PROTOCOLS[s]=r},f.bi=function(s){delete Ve.REGISTERED_PROTOCOLS[s]},f.bj=function(s,r){const a={};for(let m=0;mvt*Si)}let dt=x?"center":a.get("text-justify").evaluate(A,{},s.canonical);const ut=a.get("symbol-placement")==="point"?a.get("text-max-width").evaluate(A,{},s.canonical)*Si:1/0,Mt=()=>{s.bucket.allowVerticalPlacement&&Mu(we)&&(W.vertical=Df(Q,s.glyphMap,s.glyphPositions,s.imagePositions,D,ut,_,ht,"left",He,he,f.ai.vertical,!0,N,R))};if(!x&&zt){const kt=new Set;if(dt==="auto")for(let Ne=0;Nec(void 0,void 0,void 0,function*(){if(s.byteLength===0)return createImageBitmap(new ImageData(1,1));const r=new Blob([new Uint8Array(s)],{type:"image/png"});try{return createImageBitmap(r)}catch(a){throw new Error(`Could not load image because of ${a.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),f.e=Ee,f.f=s=>new Promise((r,a)=>{const d=new Image;d.onload=()=>{r(d),URL.revokeObjectURL(d.src),d.onload=null,window.requestAnimationFrame(()=>{d.src=Xe})},d.onerror=()=>a(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const m=new Blob([new Uint8Array(s)],{type:"image/png"});d.src=s.byteLength?URL.createObjectURL(m):Xe}),f.g=ct,f.h=(s,r)=>ni(Ee(s,{type:"json"}),r),f.i=Ht,f.j=Be,f.k=Se,f.l=(s,r)=>ni(Ee(s,{type:"arrayBuffer"}),r),f.m=ni,f.n=function(s){return new em(s).readFields(QS,[])},f.o=$u,f.p=q_,f.q=p,f.r=Cp,f.s=cr,f.t=Eu,f.u=pt,f.v=Te,f.w=at,f.x=Mo,f.y=function([s,r,a]){return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:s*Math.cos(r)*Math.sin(a),y:s*Math.sin(r)*Math.sin(a),z:s*Math.cos(a)}},f.z=kn}),l("worker",["./shared"],function(f){class c{constructor(q){this.keyCache={},q&&this.replace(q)}replace(q){this._layerConfigs={},this._layers={},this.update(q,[])}update(q,U){for(const oe of q){this._layerConfigs[oe.id]=oe;const _e=this._layers[oe.id]=f.aB(oe);_e._featureFilter=f.a7(_e.filter),this.keyCache[oe.id]&&delete this.keyCache[oe.id]}for(const oe of U)delete this.keyCache[oe],delete this._layerConfigs[oe],delete this._layers[oe];this.familiesBySource={};const Y=f.bj(Object.values(this._layerConfigs),this.keyCache);for(const oe of Y){const _e=oe.map(De=>this._layers[De.id]),be=_e[0];if(be.visibility==="none")continue;const Me=be.source||"";let de=this.familiesBySource[Me];de||(de=this.familiesBySource[Me]={});const Oe=be.sourceLayer||"_geojsonTileLayer";let Ze=de[Oe];Ze||(Ze=de[Oe]=[]),Ze.push(_e)}}}class y{constructor(q){const U={},Y=[];for(const Me in q){const de=q[Me],Oe=U[Me]={};for(const Ze in de){const De=de[+Ze];if(!De||De.bitmap.width===0||De.bitmap.height===0)continue;const ot={x:0,y:0,w:De.bitmap.width+2,h:De.bitmap.height+2};Y.push(ot),Oe[Ze]={rect:ot,metrics:De.metrics}}}const{w:oe,h:_e}=f.p(Y),be=new f.o({width:oe||1,height:_e||1});for(const Me in q){const de=q[Me];for(const Oe in de){const Ze=de[+Oe];if(!Ze||Ze.bitmap.width===0||Ze.bitmap.height===0)continue;const De=U[Me][Oe].rect;f.o.copy(Ze.bitmap,be,{x:0,y:0},{x:De.x+1,y:De.y+1},Ze.bitmap)}}this.image=be,this.positions=U}}f.bk("GlyphAtlas",y);class w{constructor(q){this.tileID=new f.S(q.tileID.overscaledZ,q.tileID.wrap,q.tileID.canonical.z,q.tileID.canonical.x,q.tileID.canonical.y),this.uid=q.uid,this.zoom=q.zoom,this.pixelRatio=q.pixelRatio,this.tileSize=q.tileSize,this.source=q.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=q.showCollisionBoxes,this.collectResourceTiming=!!q.collectResourceTiming,this.returnDependencies=!!q.returnDependencies,this.promoteId=q.promoteId,this.inFlightDependencies=[]}parse(q,U,Y,oe){return f._(this,void 0,void 0,function*(){this.status="parsing",this.data=q,this.collisionBoxArray=new f.a5;const _e=new f.bl(Object.keys(q.layers).sort()),be=new f.bm(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Me={},de={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Y},Oe=U.familiesBySource[this.source];for(const ir in Oe){const Sr=q.layers[ir];if(!Sr)continue;Sr.version===1&&f.w(`Vector tile source "${this.source}" layer "${ir}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Zr=_e.encode(ir),xi=[];for(let Oi=0;Oi=$i.maxzoom||$i.visibility!=="none"&&(M(Oi,this.zoom,Y),(Me[$i.id]=$i.createBucket({index:be.bucketLayerIDs.length,layers:Oi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Zr,sourceID:this.source})).populate(xi,de,this.tileID.canonical),be.bucketLayerIDs.push(Oi.map(Ma=>Ma.id)))}}const Ze=f.aG(de.glyphDependencies,ir=>Object.keys(ir).map(Number));this.inFlightDependencies.forEach(ir=>ir==null?void 0:ir.abort()),this.inFlightDependencies=[];let De=Promise.resolve({});if(Object.keys(Ze).length){const ir=new AbortController;this.inFlightDependencies.push(ir),De=oe.sendAsync({type:"GG",data:{stacks:Ze,source:this.source,tileID:this.tileID,type:"glyphs"}},ir)}const ot=Object.keys(de.iconDependencies);let Ct=Promise.resolve({});if(ot.length){const ir=new AbortController;this.inFlightDependencies.push(ir),Ct=oe.sendAsync({type:"GI",data:{icons:ot,source:this.source,tileID:this.tileID,type:"icons"}},ir)}const Rt=Object.keys(de.patternDependencies);let Kt=Promise.resolve({});if(Rt.length){const ir=new AbortController;this.inFlightDependencies.push(ir),Kt=oe.sendAsync({type:"GI",data:{icons:Rt,source:this.source,tileID:this.tileID,type:"patterns"}},ir)}const[pr,Xt,Cr]=yield Promise.all([De,Ct,Kt]),ri=new y(pr),di=new f.bn(Xt,Cr);for(const ir in Me){const Sr=Me[ir];Sr instanceof f.a6?(M(Sr.layers,this.zoom,Y),f.bo({bucket:Sr,glyphMap:pr,glyphPositions:ri.positions,imageMap:Xt,imagePositions:di.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Sr.hasPattern&&(Sr instanceof f.bp||Sr instanceof f.bq||Sr instanceof f.br)&&(M(Sr.layers,this.zoom,Y),Sr.addFeatures(de,this.tileID.canonical,di.patternPositions))}return this.status="done",{buckets:Object.values(Me).filter(ir=>!ir.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ri.image,imageAtlas:di,glyphMap:this.returnDependencies?pr:null,iconMap:this.returnDependencies?Xt:null,glyphPositions:this.returnDependencies?ri.positions:null}})}}function M(le,q,U){const Y=new f.a9(q);for(const oe of le)oe.recalculate(Y,U)}class k{constructor(q,U,Y){this.actor=q,this.layerIndex=U,this.availableImages=Y,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(q,U){return f._(this,void 0,void 0,function*(){const Y=yield f.l(q.request,U);try{return{vectorTile:new f.bs.VectorTile(new f.bt(Y.data)),rawData:Y.data,cacheControl:Y.cacheControl,expires:Y.expires}}catch(oe){const _e=new Uint8Array(Y.data);let be=`Unable to parse the tile at ${q.request.url}, `;throw be+=_e[0]===31&&_e[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${oe.message}`,new Error(be)}})}loadTile(q){return f._(this,void 0,void 0,function*(){const U=q.uid,Y=!!(q&&q.request&&q.request.collectResourceTiming)&&new f.bu(q.request),oe=new w(q);this.loading[U]=oe;const _e=new AbortController;oe.abort=_e;try{const be=yield this.loadVectorTile(q,_e);if(delete this.loading[U],!be)return null;const Me=be.rawData,de={};be.expires&&(de.expires=be.expires),be.cacheControl&&(de.cacheControl=be.cacheControl);const Oe={};if(Y){const De=Y.finish();De&&(Oe.resourceTiming=JSON.parse(JSON.stringify(De)))}oe.vectorTile=be.vectorTile;const Ze=oe.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[U]=oe,this.fetching[U]={rawTileData:Me,cacheControl:de,resourceTiming:Oe};try{const De=yield Ze;return f.e({rawTileData:Me.slice(0)},De,de,Oe)}finally{delete this.fetching[U]}}catch(be){throw delete this.loading[U],oe.status="done",this.loaded[U]=oe,be}})}reloadTile(q){return f._(this,void 0,void 0,function*(){const U=q.uid;if(!this.loaded||!this.loaded[U])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Y=this.loaded[U];if(Y.showCollisionBoxes=q.showCollisionBoxes,Y.status==="parsing"){const oe=yield Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor);let _e;if(this.fetching[U]){const{rawTileData:be,cacheControl:Me,resourceTiming:de}=this.fetching[U];delete this.fetching[U],_e=f.e({rawTileData:be.slice(0)},oe,Me,de)}else _e=oe;return _e}if(Y.status==="done"&&Y.vectorTile)return Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(q){return f._(this,void 0,void 0,function*(){const U=this.loading,Y=q.uid;U&&U[Y]&&U[Y].abort&&(U[Y].abort.abort(),delete U[Y])})}removeTile(q){return f._(this,void 0,void 0,function*(){this.loaded&&this.loaded[q.uid]&&delete this.loaded[q.uid]})}}class T{constructor(){this.loaded={}}loadTile(q){return f._(this,void 0,void 0,function*(){const{uid:U,encoding:Y,rawImageData:oe,redFactor:_e,greenFactor:be,blueFactor:Me,baseShift:de}=q,Oe=oe.width+2,Ze=oe.height+2,De=f.b(oe)?new f.R({width:Oe,height:Ze},yield f.bv(oe,-1,-1,Oe,Ze)):oe,ot=new f.bw(U,De,Y,_e,be,Me,de);return this.loaded=this.loaded||{},this.loaded[U]=ot,ot})}removeTile(q){const U=this.loaded,Y=q.uid;U&&U[Y]&&delete U[Y]}}function z(le,q){if(le.length!==0){F(le[0],q);for(var U=1;U=Math.abs(Me)?U-de+Me:Me-de+U,U=de}U+Y>=0!=!!q&&le.reverse()}var B=f.bx(function le(q,U){var Y,oe=q&&q.type;if(oe==="FeatureCollection")for(Y=0;Y>31}function Ht(le,q){for(var U=le.loadGeometry(),Y=le.type,oe=0,_e=0,be=U.length,Me=0;Mele},Zt=Math.fround||(Gt=new Float32Array(1),le=>(Gt[0]=+le,Gt[0]));var Gt;const or=3,Jt=5,wr=6;class Ve{constructor(q){this.options=Object.assign(Object.create(Xe),q),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(q){const{log:U,minZoom:Y,maxZoom:oe}=this.options;U&&console.time("total time");const _e=`prepare ${q.length} points`;U&&console.time(_e),this.points=q;const be=[];for(let de=0;de=Y;de--){const Oe=+Date.now();Me=this.trees[de]=this._createTree(this._cluster(Me,de)),U&&console.log("z%d: %d clusters in %dms",de,Me.numItems,+Date.now()-Oe)}return U&&console.timeEnd("total time"),this}getClusters(q,U){let Y=((q[0]+180)%360+360)%360-180;const oe=Math.max(-90,Math.min(90,q[1]));let _e=q[2]===180?180:((q[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,q[3]));if(q[2]-q[0]>=360)Y=-180,_e=180;else if(Y>_e){const De=this.getClusters([Y,oe,180,be],U),ot=this.getClusters([-180,oe,_e,be],U);return De.concat(ot)}const Me=this.trees[this._limitZoom(U)],de=Me.range(rt(Y),rr(be),rt(_e),rr(oe)),Oe=Me.data,Ze=[];for(const De of de){const ot=this.stride*De;Ze.push(Oe[ot+Jt]>1?ct(Oe,ot,this.clusterProps):this.points[Oe[ot+or]])}return Ze}getChildren(q){const U=this._getOriginId(q),Y=this._getOriginZoom(q),oe="No cluster with the specified id.",_e=this.trees[Y];if(!_e)throw new Error(oe);const be=_e.data;if(U*this.stride>=be.length)throw new Error(oe);const Me=this.options.radius/(this.options.extent*Math.pow(2,Y-1)),de=_e.within(be[U*this.stride],be[U*this.stride+1],Me),Oe=[];for(const Ze of de){const De=Ze*this.stride;be[De+4]===q&&Oe.push(be[De+Jt]>1?ct(be,De,this.clusterProps):this.points[be[De+or]])}if(Oe.length===0)throw new Error(oe);return Oe}getLeaves(q,U,Y){const oe=[];return this._appendLeaves(oe,q,U=U||10,Y=Y||0,0),oe}getTile(q,U,Y){const oe=this.trees[this._limitZoom(q)],_e=Math.pow(2,q),{extent:be,radius:Me}=this.options,de=Me/be,Oe=(Y-de)/_e,Ze=(Y+1+de)/_e,De={features:[]};return this._addTileFeatures(oe.range((U-de)/_e,Oe,(U+1+de)/_e,Ze),oe.data,U,Y,_e,De),U===0&&this._addTileFeatures(oe.range(1-de/_e,Oe,1,Ze),oe.data,_e,Y,_e,De),U===_e-1&&this._addTileFeatures(oe.range(0,Oe,de/_e,Ze),oe.data,-1,Y,_e,De),De.features.length?De:null}getClusterExpansionZoom(q){let U=this._getOriginZoom(q)-1;for(;U<=this.options.maxZoom;){const Y=this.getChildren(q);if(U++,Y.length!==1)break;q=Y[0].properties.cluster_id}return U}_appendLeaves(q,U,Y,oe,_e){const be=this.getChildren(U);for(const Me of be){const de=Me.properties;if(de&&de.cluster?_e+de.point_count<=oe?_e+=de.point_count:_e=this._appendLeaves(q,de.cluster_id,Y,oe,_e):_e1;let Ze,De,ot;if(Oe)Ze=tr(U,de,this.clusterProps),De=U[de],ot=U[de+1];else{const Kt=this.points[U[de+or]];Ze=Kt.properties;const[pr,Xt]=Kt.geometry.coordinates;De=rt(pr),ot=rr(Xt)}const Ct={type:1,geometry:[[Math.round(this.options.extent*(De*_e-Y)),Math.round(this.options.extent*(ot*_e-oe))]],tags:Ze};let Rt;Rt=Oe||this.options.generateId?U[de+or]:this.points[U[de+or]].id,Rt!==void 0&&(Ct.id=Rt),be.features.push(Ct)}}_limitZoom(q){return Math.max(this.options.minZoom,Math.min(Math.floor(+q),this.options.maxZoom+1))}_cluster(q,U){const{radius:Y,extent:oe,reduce:_e,minPoints:be}=this.options,Me=Y/(oe*Math.pow(2,U)),de=q.data,Oe=[],Ze=this.stride;for(let De=0;DeU&&(pr+=de[Cr+Jt])}if(pr>Kt&&pr>=be){let Xt,Cr=ot*Kt,ri=Ct*Kt,di=-1;const ir=((De/Ze|0)<<5)+(U+1)+this.points.length;for(const Sr of Rt){const Zr=Sr*Ze;if(de[Zr+2]<=U)continue;de[Zr+2]=U;const xi=de[Zr+Jt];Cr+=de[Zr]*xi,ri+=de[Zr+1]*xi,de[Zr+4]=ir,_e&&(Xt||(Xt=this._map(de,De,!0),di=this.clusterProps.length,this.clusterProps.push(Xt)),_e(Xt,this._map(de,Zr)))}de[De+4]=ir,Oe.push(Cr/pr,ri/pr,1/0,ir,-1,pr),_e&&Oe.push(di)}else{for(let Xt=0;Xt1)for(const Xt of Rt){const Cr=Xt*Ze;if(!(de[Cr+2]<=U)){de[Cr+2]=U;for(let ri=0;ri>5}_getOriginZoom(q){return(q-this.points.length)%32}_map(q,U,Y){if(q[U+Jt]>1){const be=this.clusterProps[q[U+wr]];return Y?Object.assign({},be):be}const oe=this.points[q[U+or]].properties,_e=this.options.map(oe);return Y&&_e===oe?Object.assign({},_e):_e}}function ct(le,q,U){return{type:"Feature",id:le[q+or],properties:tr(le,q,U),geometry:{type:"Point",coordinates:[(Y=le[q],360*(Y-.5)),ni(le[q+1])]}};var Y}function tr(le,q,U){const Y=le[q+Jt],oe=Y>=1e4?`${Math.round(Y/1e3)}k`:Y>=1e3?Math.round(Y/100)/10+"k":Y,_e=le[q+wr],be=_e===-1?{}:Object.assign({},U[_e]);return Object.assign(be,{cluster:!0,cluster_id:le[q+or],point_count:Y,point_count_abbreviated:oe})}function rt(le){return le/360+.5}function rr(le){const q=Math.sin(le*Math.PI/180),U=.5-.25*Math.log((1+q)/(1-q))/Math.PI;return U<0?0:U>1?1:U}function ni(le){const q=(180-360*le)*Math.PI/180;return 360*Math.atan(Math.exp(q))/Math.PI-90}function cr(le,q,U,Y){let oe=Y;const _e=q+(U-q>>1);let be,Me=U-q;const de=le[q],Oe=le[q+1],Ze=le[U],De=le[U+1];for(let ot=q+3;otoe)be=ot,oe=Ct;else if(Ct===oe){const Rt=Math.abs(ot-_e);RtY&&(be-q>3&&cr(le,q,be,Y),le[be+2]=oe,U-be>3&&cr(le,be,U,Y))}function li(le,q,U,Y,oe,_e){let be=oe-U,Me=_e-Y;if(be!==0||Me!==0){const de=((le-U)*be+(q-Y)*Me)/(be*be+Me*Me);de>1?(U=oe,Y=_e):de>0&&(U+=be*de,Y+=Me*de)}return be=le-U,Me=q-Y,be*be+Me*Me}function Bi(le,q,U,Y){const oe={id:le??null,type:q,geometry:U,tags:Y,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(q==="Point"||q==="MultiPoint"||q==="LineString")Se(oe,U);else if(q==="Polygon")Se(oe,U[0]);else if(q==="MultiLineString")for(const _e of U)Se(oe,_e);else if(q==="MultiPolygon")for(const _e of U)Se(oe,_e[0]);return oe}function Se(le,q){for(let U=0;U0&&(be+=Y?(oe*Ze-Oe*_e)/2:Math.sqrt(Math.pow(Oe-oe,2)+Math.pow(Ze-_e,2))),oe=Oe,_e=Ze}const Me=q.length-3;q[2]=1,cr(q,0,Me,U),q[Me+2]=1,q.size=Math.abs(be),q.start=0,q.end=q.size}function Mi(le,q,U,Y){for(let oe=0;oe1?1:U}function ti(le,q,U,Y,oe,_e,be,Me){if(Y/=q,_e>=(U/=q)&&be=Y)return null;const de=[];for(const Oe of le){const Ze=Oe.geometry;let De=Oe.type;const ot=oe===0?Oe.minX:Oe.minY,Ct=oe===0?Oe.maxX:Oe.maxY;if(ot>=U&&Ct=Y)continue;let Rt=[];if(De==="Point"||De==="MultiPoint")ka(Ze,Rt,U,Y,oe);else if(De==="LineString")Bo(Ze,Rt,U,Y,oe,!1,Me.lineMetrics);else if(De==="MultiLineString")Bs(Ze,Rt,U,Y,oe,!1);else if(De==="Polygon")Bs(Ze,Rt,U,Y,oe,!0);else if(De==="MultiPolygon")for(const Kt of Ze){const pr=[];Bs(Kt,pr,U,Y,oe,!0),pr.length&&Rt.push(pr)}if(Rt.length){if(Me.lineMetrics&&De==="LineString"){for(const Kt of Rt)de.push(Bi(Oe.id,De,Kt,Oe.tags));continue}De!=="LineString"&&De!=="MultiLineString"||(Rt.length===1?(De="LineString",Rt=Rt[0]):De="MultiLineString"),De!=="Point"&&De!=="MultiPoint"||(De=Rt.length===3?"Point":"MultiPoint"),de.push(Bi(Oe.id,De,Rt,Oe.tags))}}return de.length?de:null}function ka(le,q,U,Y,oe){for(let _e=0;_e=U&&be<=Y&&Ln(q,le[_e],le[_e+1],le[_e+2])}}function Bo(le,q,U,Y,oe,_e,be){let Me=wo(le);const de=oe===0?Ea:Pa;let Oe,Ze,De=le.start;for(let pr=0;prU&&(Ze=de(Me,Xt,Cr,di,ir,U),be&&(Me.start=De+Oe*Ze)):Sr>Y?Zr=U&&(Ze=de(Me,Xt,Cr,di,ir,U),xi=!0),Zr>Y&&Sr<=Y&&(Ze=de(Me,Xt,Cr,di,ir,Y),xi=!0),!_e&&xi&&(be&&(Me.end=De+Oe*Ze),q.push(Me),Me=wo(le)),be&&(De+=Oe)}let ot=le.length-3;const Ct=le[ot],Rt=le[ot+1],Kt=oe===0?Ct:Rt;Kt>=U&&Kt<=Y&&Ln(Me,Ct,Rt,le[ot+2]),ot=Me.length-3,_e&&ot>=3&&(Me[ot]!==Me[0]||Me[ot+1]!==Me[1])&&Ln(Me,Me[0],Me[1],Me[2]),Me.length&&q.push(Me)}function wo(le){const q=[];return q.size=le.size,q.start=le.start,q.end=le.end,q}function Bs(le,q,U,Y,oe,_e){for(const be of le)Bo(be,q,U,Y,oe,_e,!1)}function Ln(le,q,U,Y){le.push(q,U,Y)}function Ea(le,q,U,Y,oe,_e){const be=(_e-q)/(Y-q);return Ln(le,_e,U+(oe-U)*be,1),be}function Pa(le,q,U,Y,oe,_e){const be=(_e-U)/(oe-U);return Ln(le,q+(Y-q)*be,_e,1),be}function nt(le,q){const U=[];for(let Y=0;Y0&&q.size<(oe?be:Y))return void(U.numPoints+=q.length/3);const Me=[];for(let de=0;debe)&&(U.numSimplified++,Me.push(q[de],q[de+1])),U.numPoints++;oe&&function(de,Oe){let Ze=0;for(let De=0,ot=de.length,Ct=ot-2;De0===Oe)for(let De=0,ot=de.length;De24)throw new Error("maxZoom should be in the 0-24 range");if(U.promoteId&&U.generateId)throw new Error("promoteId and generateId cannot be used together.");let oe=function(_e,be){const Me=[];if(_e.type==="FeatureCollection")for(let de=0;de<_e.features.length;de++)Be(Me,_e.features[de],be,de);else Be(Me,_e.type==="Feature"?_e:{geometry:_e},be);return Me}(q,U);this.tiles={},this.tileCoords=[],Y&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",U.indexMaxZoom,U.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),oe=function(_e,be){const Me=be.buffer/be.extent;let de=_e;const Oe=ti(_e,1,-1-Me,Me,0,-1,2,be),Ze=ti(_e,1,1-Me,2+Me,0,-1,2,be);return(Oe||Ze)&&(de=ti(_e,1,-Me,1+Me,0,-1,2,be)||[],Oe&&(de=nt(Oe,1).concat(de)),Ze&&(de=de.concat(nt(Ze,-1)))),de}(oe,U),oe.length&&this.splitTile(oe,0,0,0),Y&&(oe.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(q,U,Y,oe,_e,be,Me){const de=[q,U,Y,oe],Oe=this.options,Ze=Oe.debug;for(;de.length;){oe=de.pop(),Y=de.pop(),U=de.pop(),q=de.pop();const De=1<1&&console.time("creation"),Ct=this.tiles[ot]=Oo(q,U,Y,oe,Oe),this.tileCoords.push({z:U,x:Y,y:oe}),Ze)){Ze>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",U,Y,oe,Ct.numFeatures,Ct.numPoints,Ct.numSimplified),console.timeEnd("creation"));const xi=`z${U}`;this.stats[xi]=(this.stats[xi]||0)+1,this.total++}if(Ct.source=q,_e==null){if(U===Oe.indexMaxZoom||Ct.numPoints<=Oe.indexMaxPoints)continue}else{if(U===Oe.maxZoom||U===_e)continue;if(_e!=null){const xi=_e-U;if(Y!==be>>xi||oe!==Me>>xi)continue}}if(Ct.source=null,q.length===0)continue;Ze>1&&console.time("clipping");const Rt=.5*Oe.buffer/Oe.extent,Kt=.5-Rt,pr=.5+Rt,Xt=1+Rt;let Cr=null,ri=null,di=null,ir=null,Sr=ti(q,De,Y-Rt,Y+pr,0,Ct.minX,Ct.maxX,Oe),Zr=ti(q,De,Y+Kt,Y+Xt,0,Ct.minX,Ct.maxX,Oe);q=null,Sr&&(Cr=ti(Sr,De,oe-Rt,oe+pr,1,Ct.minY,Ct.maxY,Oe),ri=ti(Sr,De,oe+Kt,oe+Xt,1,Ct.minY,Ct.maxY,Oe),Sr=null),Zr&&(di=ti(Zr,De,oe-Rt,oe+pr,1,Ct.minY,Ct.maxY,Oe),ir=ti(Zr,De,oe+Kt,oe+Xt,1,Ct.minY,Ct.maxY,Oe),Zr=null),Ze>1&&console.timeEnd("clipping"),de.push(Cr||[],U+1,2*Y,2*oe),de.push(ri||[],U+1,2*Y,2*oe+1),de.push(di||[],U+1,2*Y+1,2*oe),de.push(ir||[],U+1,2*Y+1,2*oe+1)}}getTile(q,U,Y){q=+q,U=+U,Y=+Y;const oe=this.options,{extent:_e,debug:be}=oe;if(q<0||q>24)return null;const Me=1<1&&console.log("drilling down to z%d-%d-%d",q,U,Y);let Oe,Ze=q,De=U,ot=Y;for(;!Oe&&Ze>0;)Ze--,De>>=1,ot>>=1,Oe=this.tiles[On(Ze,De,ot)];return Oe&&Oe.source?(be>1&&(console.log("found parent tile z%d-%d-%d",Ze,De,ot),console.time("drilling down")),this.splitTile(Oe.source,Ze,De,ot,q,U,Y),be>1&&console.timeEnd("drilling down"),this.tiles[de]?Yi(this.tiles[de],_e):null):null}}function On(le,q,U){return 32*((1<{De.properties=Ct;const Rt={};for(const Kt of ot)Rt[Kt]=de[Kt].evaluate(Ze,De);return Rt},be.reduce=(Ct,Rt)=>{De.properties=Rt;for(const Kt of ot)Ze.accumulated=Ct[Kt],Ct[Kt]=Oe[Kt].evaluate(Ze,De)},be}(q)).load((yield this._pendingData).features):(oe=yield this._pendingData,new un(oe,q.geojsonVtOptions)),this.loaded={};const _e={};if(Y){const be=Y.finish();be&&(_e.resourceTiming={},_e.resourceTiming[q.source]=JSON.parse(JSON.stringify(be)))}return _e}catch(_e){if(delete this._pendingRequest,f.bA(_e))return{abandoned:!0};throw _e}var oe})}getData(){return f._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(q){const U=this.loaded;return U&&U[q.uid]?super.reloadTile(q):this.loadTile(q)}loadAndProcessGeoJSON(q,U){return f._(this,void 0,void 0,function*(){let Y=yield this.loadGeoJSON(q,U);if(delete this._pendingRequest,typeof Y!="object")throw new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`);if(B(Y,!0),q.filter){const oe=f.bB(q.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(oe.result==="error")throw new Error(oe.value.map(be=>`${be.key}: ${be.message}`).join(", "));Y={type:"FeatureCollection",features:Y.features.filter(be=>oe.value.evaluate({zoom:0},be))}}return Y})}loadGeoJSON(q,U){return f._(this,void 0,void 0,function*(){const{promoteId:Y}=q;if(q.request){const oe=yield f.h(q.request,U);return this._dataUpdateable=oo(oe.data,Y)?So(oe.data,Y):void 0,oe.data}if(typeof q.data=="string")try{const oe=JSON.parse(q.data);return this._dataUpdateable=oo(oe,Y)?So(oe,Y):void 0,oe}catch{throw new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`)}if(!q.dataDiff)throw new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${q.source}`);return function(oe,_e,be){var Me,de,Oe,Ze;if(_e.removeAll&&oe.clear(),_e.remove)for(const De of _e.remove)oe.delete(De);if(_e.add)for(const De of _e.add){const ot=Wt(De,be);ot!=null&&oe.set(ot,De)}if(_e.update)for(const De of _e.update){let ot=oe.get(De.id);if(ot==null)continue;const Ct=!De.removeAllProperties&&(((Me=De.removeProperties)===null||Me===void 0?void 0:Me.length)>0||((de=De.addOrUpdateProperties)===null||de===void 0?void 0:de.length)>0);if((De.newGeometry||De.removeAllProperties||Ct)&&(ot=Object.assign({},ot),oe.set(De.id,ot),Ct&&(ot.properties=Object.assign({},ot.properties))),De.newGeometry&&(ot.geometry=De.newGeometry),De.removeAllProperties)ot.properties={};else if(((Oe=De.removeProperties)===null||Oe===void 0?void 0:Oe.length)>0)for(const Rt of De.removeProperties)Object.prototype.hasOwnProperty.call(ot.properties,Rt)&&delete ot.properties[Rt];if(((Ze=De.addOrUpdateProperties)===null||Ze===void 0?void 0:Ze.length)>0)for(const{key:Rt,value:Kt}of De.addOrUpdateProperties)ot.properties[Rt]=Kt}}(this._dataUpdateable,q.dataDiff,Y),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(q){return f._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(q){return this._geoJSONIndex.getClusterExpansionZoom(q.clusterId)}getClusterChildren(q){return this._geoJSONIndex.getChildren(q.clusterId)}getClusterLeaves(q){return this._geoJSONIndex.getLeaves(q.clusterId,q.limit,q.offset)}}class so{constructor(q){this.self=q,this.actor=new f.F(q),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(U,Y)=>{if(this.externalWorkerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.externalWorkerSourceTypes[U]=Y},this.self.addProtocol=f.bh,this.self.removeProtocol=f.bi,this.self.registerRTLTextPlugin=U=>{if(f.bC.isParsed())throw new Error("RTL text plugin already registered.");f.bC.setMethods(U)},this.actor.registerMessageHandler("LDT",(U,Y)=>this._getDEMWorkerSource(U,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RDT",(U,Y)=>f._(this,void 0,void 0,function*(){this._getDEMWorkerSource(U,Y.source).removeTile(Y)})),this.actor.registerMessageHandler("GCEZ",(U,Y)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterExpansionZoom(Y)})),this.actor.registerMessageHandler("GCC",(U,Y)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterChildren(Y)})),this.actor.registerMessageHandler("GCL",(U,Y)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterLeaves(Y)})),this.actor.registerMessageHandler("LD",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).loadData(Y)),this.actor.registerMessageHandler("GD",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).getData()),this.actor.registerMessageHandler("LT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).reloadTile(Y)),this.actor.registerMessageHandler("AT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).abortTile(Y)),this.actor.registerMessageHandler("RMT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).removeTile(Y)),this.actor.registerMessageHandler("RS",(U,Y)=>f._(this,void 0,void 0,function*(){if(!this.workerSources[U]||!this.workerSources[U][Y.type]||!this.workerSources[U][Y.type][Y.source])return;const oe=this.workerSources[U][Y.type][Y.source];delete this.workerSources[U][Y.type][Y.source],oe.removeSource!==void 0&&oe.removeSource(Y)})),this.actor.registerMessageHandler("RM",U=>f._(this,void 0,void 0,function*(){delete this.layerIndexes[U],delete this.availableImages[U],delete this.workerSources[U],delete this.demWorkerSources[U]})),this.actor.registerMessageHandler("SR",(U,Y)=>f._(this,void 0,void 0,function*(){this.referrer=Y})),this.actor.registerMessageHandler("SRPS",(U,Y)=>this._syncRTLPluginState(U,Y)),this.actor.registerMessageHandler("IS",(U,Y)=>f._(this,void 0,void 0,function*(){this.self.importScripts(Y)})),this.actor.registerMessageHandler("SI",(U,Y)=>this._setImages(U,Y)),this.actor.registerMessageHandler("UL",(U,Y)=>f._(this,void 0,void 0,function*(){this._getLayerIndex(U).update(Y.layers,Y.removedIds)})),this.actor.registerMessageHandler("SL",(U,Y)=>f._(this,void 0,void 0,function*(){this._getLayerIndex(U).replace(Y)}))}_setImages(q,U){return f._(this,void 0,void 0,function*(){this.availableImages[q]=U;for(const Y in this.workerSources[q]){const oe=this.workerSources[q][Y];for(const _e in oe)oe[_e].availableImages=U}})}_syncRTLPluginState(q,U){return f._(this,void 0,void 0,function*(){if(f.bC.isParsed())return f.bC.getState();if(U.pluginStatus!=="loading")return f.bC.setState(U),U;const Y=U.pluginURL;if(this.self.importScripts(Y),f.bC.isParsed()){const oe={pluginStatus:"loaded",pluginURL:Y};return f.bC.setState(oe),oe}throw f.bC.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Y}`)})}_getAvailableImages(q){let U=this.availableImages[q];return U||(U=[]),U}_getLayerIndex(q){let U=this.layerIndexes[q];return U||(U=this.layerIndexes[q]=new c),U}_getWorkerSource(q,U,Y){if(this.workerSources[q]||(this.workerSources[q]={}),this.workerSources[q][U]||(this.workerSources[q][U]={}),!this.workerSources[q][U][Y]){const oe={sendAsync:(_e,be)=>(_e.targetMapId=q,this.actor.sendAsync(_e,be))};switch(U){case"vector":this.workerSources[q][U][Y]=new k(oe,this._getLayerIndex(q),this._getAvailableImages(q));break;case"geojson":this.workerSources[q][U][Y]=new $o(oe,this._getLayerIndex(q),this._getAvailableImages(q));break;default:this.workerSources[q][U][Y]=new this.externalWorkerSourceTypes[U](oe,this._getLayerIndex(q),this._getAvailableImages(q))}}return this.workerSources[q][U][Y]}_getDEMWorkerSource(q,U){return this.demWorkerSources[q]||(this.demWorkerSources[q]={}),this.demWorkerSources[q][U]||(this.demWorkerSources[q][U]=new T),this.demWorkerSources[q][U]}}return f.i(self)&&(self.worker=new so(self)),so}),l("index",["exports","./shared"],function(f,c){var y="4.5.0";let w,M;const k={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:v=>new Promise((i,h)=>{const p=requestAnimationFrame(i);v.signal.addEventListener("abort",()=>{cancelAnimationFrame(p),h(c.c())})}),getImageData(v,i=0){return this.getImageCanvasContext(v).getImageData(-i,-i,v.width+2*i,v.height+2*i)},getImageCanvasContext(v){const i=window.document.createElement("canvas"),h=i.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("failed to create canvas 2d context");return i.width=v.width,i.height=v.height,h.drawImage(v,0,0,v.width,v.height),h},resolveURL:v=>(w||(w=document.createElement("a")),w.href=v,w.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(M==null&&(M=matchMedia("(prefers-reduced-motion: reduce)")),M.matches)}};class T{static testProp(i){if(!T.docStyle)return i[0];for(let h=0;h{window.removeEventListener("click",T.suppressClickInternal,!0)},0)}static getScale(i){const h=i.getBoundingClientRect();return{x:h.width/i.offsetWidth||1,y:h.height/i.offsetHeight||1,boundingClientRect:h}}static getPoint(i,h,p){const g=h.boundingClientRect;return new c.P((p.clientX-g.left)/h.x-i.clientLeft,(p.clientY-g.top)/h.y-i.clientTop)}static mousePos(i,h){const p=T.getScale(i);return T.getPoint(i,p,h)}static touchPos(i,h){const p=[],g=T.getScale(i);for(let b=0;b{F&&j(F),F=null,J=!0},B.onerror=()=>{G=!0,F=null},B.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(v){let i,h,p,g;v.resetRequestQueue=()=>{i=[],h=0,p=0,g={}},v.addThrottleControl=C=>{const L=p++;return g[L]=C,L},v.removeThrottleControl=C=>{delete g[C],E()},v.getImage=(C,L,$=!0)=>new Promise((O,H)=>{z.supported&&(C.headers||(C.headers={}),C.headers.accept="image/webp,*/*"),c.e(C,{type:"image"}),i.push({abortController:L,requestParameters:C,supportImageRefresh:$,state:"queued",onError:K=>{H(K)},onSuccess:K=>{O(K)}}),E()});const b=C=>c._(this,void 0,void 0,function*(){C.state="running";const{requestParameters:L,supportImageRefresh:$,onError:O,onSuccess:H,abortController:K}=C,te=$===!1&&!c.i(self)&&!c.g(L.url)&&(!L.headers||Object.keys(L.headers).reduce((ue,ye)=>ue&&ye==="accept",!0));h++;const se=te?I(L,K):c.m(L,K);try{const ue=yield se;delete C.abortController,C.state="completed",ue.data instanceof HTMLImageElement||c.b(ue.data)?H(ue):ue.data&&H({data:yield(re=ue.data,typeof createImageBitmap=="function"?c.d(re):c.f(re)),cacheControl:ue.cacheControl,expires:ue.expires})}catch(ue){delete C.abortController,O(ue)}finally{h--,E()}var re}),E=()=>{const C=(()=>{for(const L of Object.keys(g))if(g[L]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let L=h;L0;L++){const $=i.shift();$.abortController.signal.aborted?L--:b($)}},I=(C,L)=>new Promise(($,O)=>{const H=new Image,K=C.url,te=C.credentials;te&&te==="include"?H.crossOrigin="use-credentials":(te&&te==="same-origin"||!c.s(K))&&(H.crossOrigin="anonymous"),L.signal.addEventListener("abort",()=>{H.src="",O(c.c())}),H.fetchPriority="high",H.onload=()=>{H.onerror=H.onload=null,$({data:H})},H.onerror=()=>{H.onerror=H.onload=null,L.signal.aborted||O(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},H.src=K})}(V||(V={})),V.resetRequestQueue();class me{constructor(i){this._transformRequestFn=i}transformRequest(i,h){return this._transformRequestFn&&this._transformRequestFn(i,h)||{url:i}}setTransformRequest(i){this._transformRequestFn=i}}function X(v){var i=new c.A(3);return i[0]=v[0],i[1]=v[1],i[2]=v[2],i}var pe,Ee=function(v,i,h){return v[0]=i[0]-h[0],v[1]=i[1]-h[1],v[2]=i[2]-h[2],v};pe=new c.A(3),c.A!=Float32Array&&(pe[0]=0,pe[1]=0,pe[2]=0);var Pe=function(v){var i=v[0],h=v[1];return i*i+h*h};function $e(v){const i=[];if(typeof v=="string")i.push({id:"default",url:v});else if(v&&v.length>0){const h=[];for(const{id:p,url:g}of v){const b=`${p}${g}`;h.indexOf(b)===-1&&(h.push(b),i.push({id:p,url:g}))}}return i}function Ye(v,i,h){const p=v.split("?");return p[0]+=`${i}${h}`,p.join("?")}(function(){var v=new c.A(2);c.A!=Float32Array&&(v[0]=0,v[1]=0)})();class ve{constructor(i,h,p,g){this.context=i,this.format=p,this.texture=i.gl.createTexture(),this.update(h,g)}update(i,h,p){const{width:g,height:b}=i,E=!(this.size&&this.size[0]===g&&this.size[1]===b||p),{context:I}=this,{gl:C}=I;if(this.useMipmap=!!(h&&h.useMipmap),C.bindTexture(C.TEXTURE_2D,this.texture),I.pixelStoreUnpackFlipY.set(!1),I.pixelStoreUnpack.set(1),I.pixelStoreUnpackPremultiplyAlpha.set(this.format===C.RGBA&&(!h||h.premultiply!==!1)),E)this.size=[g,b],i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||c.b(i)?C.texImage2D(C.TEXTURE_2D,0,this.format,this.format,C.UNSIGNED_BYTE,i):C.texImage2D(C.TEXTURE_2D,0,this.format,g,b,0,this.format,C.UNSIGNED_BYTE,i.data);else{const{x:L,y:$}=p||{x:0,y:0};i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||c.b(i)?C.texSubImage2D(C.TEXTURE_2D,0,L,$,C.RGBA,C.UNSIGNED_BYTE,i):C.texSubImage2D(C.TEXTURE_2D,0,L,$,g,b,C.RGBA,C.UNSIGNED_BYTE,i.data)}this.useMipmap&&this.isSizePowerOfTwo()&&C.generateMipmap(C.TEXTURE_2D)}bind(i,h,p){const{context:g}=this,{gl:b}=g;b.bindTexture(b.TEXTURE_2D,this.texture),p!==b.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(p=b.LINEAR),i!==this.filter&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,i),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,p||i),this.filter=i),h!==this.wrap&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,h),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:i}=this.context;i.deleteTexture(this.texture),this.texture=null}}function We(v){const{userImage:i}=v;return!!(i&&i.render&&i.render())&&(v.data.replace(new Uint8Array(i.data.buffer)),!0)}class at extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(i){if(this.loaded!==i&&(this.loaded=i,i)){for(const{ids:h,promiseResolve:p}of this.requestors)p(this._getImagesForIds(h));this.requestors=[]}}getImage(i){const h=this.images[i];if(h&&!h.data&&h.spriteData){const p=h.spriteData;h.data=new c.R({width:p.width,height:p.height},p.context.getImageData(p.x,p.y,p.width,p.height).data),h.spriteData=null}return h}addImage(i,h){if(this.images[i])throw new Error(`Image id ${i} already exist, use updateImage instead`);this._validate(i,h)&&(this.images[i]=h)}_validate(i,h){let p=!0;const g=h.data||h.spriteData;return this._validateStretch(h.stretchX,g&&g.width)||(this.fire(new c.j(new Error(`Image "${i}" has invalid "stretchX" value`))),p=!1),this._validateStretch(h.stretchY,g&&g.height)||(this.fire(new c.j(new Error(`Image "${i}" has invalid "stretchY" value`))),p=!1),this._validateContent(h.content,h)||(this.fire(new c.j(new Error(`Image "${i}" has invalid "content" value`))),p=!1),p}_validateStretch(i,h){if(!i)return!0;let p=0;for(const g of i){if(g[0]{let g=!0;if(!this.isLoaded())for(const b of i)this.images[b]||(g=!1);this.isLoaded()||g?h(this._getImagesForIds(i)):this.requestors.push({ids:i,promiseResolve:h})})}_getImagesForIds(i){const h={};for(const p of i){let g=this.getImage(p);g||(this.fire(new c.k("styleimagemissing",{id:p})),g=this.getImage(p)),g?h[p]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,textFitWidth:g.textFitWidth,textFitHeight:g.textFitHeight,hasRenderCallback:!!(g.userImage&&g.userImage.render)}:c.w(`Image "${p}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return h}getPixelSize(){const{width:i,height:h}=this.atlasImage;return{width:i,height:h}}getPattern(i){const h=this.patterns[i],p=this.getImage(i);if(!p)return null;if(h&&h.position.version===p.version)return h.position;if(h)h.position.version=p.version;else{const g={w:p.data.width+2,h:p.data.height+2,x:0,y:0},b=new c.I(g,p);this.patterns[i]={bin:g,position:b}}return this._updatePatternAtlas(),this.patterns[i].position}bind(i){const h=i.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new ve(i,this.atlasImage,h.RGBA),this.atlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE)}_updatePatternAtlas(){const i=[];for(const b in this.patterns)i.push(this.patterns[b].bin);const{w:h,h:p}=c.p(i),g=this.atlasImage;g.resize({width:h||1,height:p||1});for(const b in this.patterns){const{bin:E}=this.patterns[b],I=E.x+1,C=E.y+1,L=this.getImage(b).data,$=L.width,O=L.height;c.R.copy(L,g,{x:0,y:0},{x:I,y:C},{width:$,height:O}),c.R.copy(L,g,{x:0,y:O-1},{x:I,y:C-1},{width:$,height:1}),c.R.copy(L,g,{x:0,y:0},{x:I,y:C+O},{width:$,height:1}),c.R.copy(L,g,{x:$-1,y:0},{x:I-1,y:C},{width:1,height:O}),c.R.copy(L,g,{x:0,y:0},{x:I+$,y:C},{width:1,height:O})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(i){for(const h of i){if(this.callbackDispatchedThisFrame[h])continue;this.callbackDispatchedThisFrame[h]=!0;const p=this.getImage(h);p||c.w(`Image with ID: "${h}" was not found`),We(p)&&this.updateImage(h,p)}}}const mt=1e20;function Ht(v,i,h,p,g,b,E,I,C){for(let L=i;L-1);C++,b[C]=I,E[C]=L,E[C+1]=mt}for(let I=0,C=0;I65535)throw new Error("glyphs > 65535 not supported");if(p.ranges[b])return{stack:i,id:h,glyph:g};if(!this.url)throw new Error("glyphsUrl is not set");if(!p.requests[b]){const I=Ue.loadGlyphRange(i,b,this.url,this.requestManager);p.requests[b]=I}const E=yield p.requests[b];for(const I in E)this._doesCharSupportLocalGlyph(+I)||(p.glyphs[+I]=E[+I]);return p.ranges[b]=!0,{stack:i,id:h,glyph:E[h]||null}})}_doesCharSupportLocalGlyph(i){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](i)||c.u["Hangul Syllables"](i)||c.u.Hiragana(i)||c.u.Katakana(i))}_tinySDF(i,h,p){const g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(p))return;let b=i.tinySDF;if(!b){let I="400";/bold/i.test(h)?I="900":/medium/i.test(h)?I="500":/light/i.test(h)&&(I="200"),b=i.tinySDF=new Ue.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:g,fontWeight:I})}const E=b.draw(String.fromCharCode(p));return{id:p,bitmap:new c.o({width:E.width||60,height:E.height||60},E.data),metrics:{width:E.glyphWidth/2||24,height:E.glyphHeight/2||24,left:E.glyphLeft/2+.5||0,top:E.glyphTop/2-27.5||-8,advance:E.glyphAdvance/2||24,isDoubleResolution:!0}}}}Ue.loadGlyphRange=function(v,i,h,p){return c._(this,void 0,void 0,function*(){const g=256*i,b=g+255,E=p.transformRequest(h.replace("{fontstack}",v).replace("{range}",`${g}-${b}`),"Glyphs"),I=yield c.l(E,new AbortController);if(!I||!I.data)throw new Error(`Could not load glyph range. range: ${i}, ${g}-${b}`);const C={};for(const L of c.n(I.data))C[L.id]=L;return C})},Ue.TinySDF=class{constructor({fontSize:v=24,buffer:i=3,radius:h=8,cutoff:p=.25,fontFamily:g="sans-serif",fontWeight:b="normal",fontStyle:E="normal"}={}){this.buffer=i,this.cutoff=p,this.radius=h;const I=this.size=v+4*i,C=this._createCanvas(I),L=this.ctx=C.getContext("2d",{willReadFrequently:!0});L.font=`${E} ${b} ${v}px ${g}`,L.textBaseline="alphabetic",L.textAlign="left",L.fillStyle="black",this.gridOuter=new Float64Array(I*I),this.gridInner=new Float64Array(I*I),this.f=new Float64Array(I),this.z=new Float64Array(I+1),this.v=new Uint16Array(I)}_createCanvas(v){const i=document.createElement("canvas");return i.width=i.height=v,i}draw(v){const{width:i,actualBoundingBoxAscent:h,actualBoundingBoxDescent:p,actualBoundingBoxLeft:g,actualBoundingBoxRight:b}=this.ctx.measureText(v),E=Math.ceil(h),I=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(b-g))),C=Math.min(this.size-this.buffer,E+Math.ceil(p)),L=I+2*this.buffer,$=C+2*this.buffer,O=Math.max(L*$,0),H=new Uint8ClampedArray(O),K={data:H,width:L,height:$,glyphWidth:I,glyphHeight:C,glyphTop:E,glyphLeft:0,glyphAdvance:i};if(I===0||C===0)return K;const{ctx:te,buffer:se,gridInner:re,gridOuter:ue}=this;te.clearRect(se,se,I,C),te.fillText(v,se,se+E);const ye=te.getImageData(se,se,I,C);ue.fill(mt,0,O),re.fill(0,0,O);for(let ne=0;ne0?je*je:0,re[Ce]=je<0?je*je:0}}Ht(ue,0,0,L,$,L,this.f,this.v,this.z),Ht(re,se,se,I,C,L,this.f,this.v,this.z);for(let ne=0;ne1&&(C=i[++I]);const $=Math.abs(L-C.left),O=Math.abs(L-C.right),H=Math.min($,O);let K;const te=b/p*(g+1);if(C.isDash){const se=g-Math.abs(te);K=Math.sqrt(H*H+se*se)}else K=g-Math.sqrt(H*H+te*te);this.data[E+L]=Math.max(0,Math.min(255,K+128))}}}addRegularDash(i){for(let I=i.length-1;I>=0;--I){const C=i[I],L=i[I+1];C.zeroLength?i.splice(I,1):L&&L.isDash===C.isDash&&(L.left=C.left,i.splice(I,1))}const h=i[0],p=i[i.length-1];h.isDash===p.isDash&&(h.left=p.left-this.width,p.right=h.right+this.width);const g=this.width*this.nextRow;let b=0,E=i[b];for(let I=0;I1&&(E=i[++b]);const C=Math.abs(I-E.left),L=Math.abs(I-E.right),$=Math.min(C,L);this.data[g+I]=Math.max(0,Math.min(255,(E.isDash?$:-$)+128))}}addDash(i,h){const p=h?7:0,g=2*p+1;if(this.nextRow+g>this.height)return c.w("LineAtlas out of space"),null;let b=0;for(let I=0;I{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ve]}numActive(){return Object.keys(this.active).length}}const tr=Math.floor(k.hardwareConcurrency/2);let rt,rr;function ni(){return rt||(rt=new ct),rt}ct.workerCount=c.C(globalThis)?Math.max(Math.min(tr,3),1):1;class cr{constructor(i,h){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=h;const p=this.workerPool.acquire(h);for(let g=0;g{h.remove()}),this.actors=[],i&&this.workerPool.release(this.id)}registerMessageHandler(i,h){for(const p of this.actors)p.registerMessageHandler(i,h)}}function li(){return rr||(rr=new cr(ni(),c.G),rr.registerMessageHandler("GR",(v,i,h)=>c.m(i,h))),rr}function Bi(v,i){const h=c.H();return c.J(h,h,[1,1,0]),c.K(h,h,[.5*v.width,.5*v.height,1]),c.L(h,h,v.calculatePosMatrix(i.toUnwrapped()))}function Se(v,i,h,p,g,b){const E=function(O,H,K){if(O)for(const te of O){const se=H[te];if(se&&se.source===K&&se.type==="fill-extrusion")return!0}else for(const te in H){const se=H[te];if(se.source===K&&se.type==="fill-extrusion")return!0}return!1}(g&&g.layers,i,v.id),I=b.maxPitchScaleFactor(),C=v.tilesIn(p,I,E);C.sort(Be);const L=[];for(const O of C)L.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(i,h,v._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,g,b,I,Bi(v.transform,O.tileID))});const $=function(O){const H={},K={};for(const te of O){const se=te.queryResults,re=te.wrappedTileID,ue=K[re]=K[re]||{};for(const ye in se){const ne=se[ye],xe=ue[ye]=ue[ye]||{},Ie=H[ye]=H[ye]||[];for(const Ce of ne)xe[Ce.featureIndex]||(xe[Ce.featureIndex]=!0,Ie.push(Ce))}}return H}(L);for(const O in $)$[O].forEach(H=>{const K=H.feature,te=v.getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=te});return $}function Be(v,i){const h=v.tileID,p=i.tileID;return h.overscaledZ-p.overscaledZ||h.canonical.y-p.canonical.y||h.wrap-p.wrap||h.canonical.x-p.canonical.x}function nr(v,i,h){return c._(this,void 0,void 0,function*(){let p=v;if(v.url?p=(yield c.h(i.transformRequest(v.url,"Source"),h)).data:yield k.frameAsync(h),!p)return null;const g=c.M(c.e(p,v),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in p&&p.vector_layers&&(g.vectorLayerIds=p.vector_layers.map(b=>b.id)),g})}class Te{constructor(i,h){i&&(h?this.setSouthWest(i).setNorthEast(h):Array.isArray(i)&&(i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1])))}setNorthEast(i){return this._ne=i instanceof c.N?new c.N(i.lng,i.lat):c.N.convert(i),this}setSouthWest(i){return this._sw=i instanceof c.N?new c.N(i.lng,i.lat):c.N.convert(i),this}extend(i){const h=this._sw,p=this._ne;let g,b;if(i instanceof c.N)g=i,b=i;else{if(!(i instanceof Te))return Array.isArray(i)?i.length===4||i.every(Array.isArray)?this.extend(Te.convert(i)):this.extend(c.N.convert(i)):i&&("lng"in i||"lon"in i)&&"lat"in i?this.extend(c.N.convert(i)):this;if(g=i._sw,b=i._ne,!g||!b)return this}return h||p?(h.lng=Math.min(g.lng,h.lng),h.lat=Math.min(g.lat,h.lat),p.lng=Math.max(b.lng,p.lng),p.lat=Math.max(b.lat,p.lat)):(this._sw=new c.N(g.lng,g.lat),this._ne=new c.N(b.lng,b.lat)),this}getCenter(){return new c.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new c.N(this.getWest(),this.getNorth())}getSouthEast(){return new c.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(i){const{lng:h,lat:p}=c.N.convert(i);let g=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(g=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=p&&p<=this._ne.lat&&g}static convert(i){return i instanceof Te?i:i&&new Te(i)}static fromLngLat(i,h=0){const p=360*h/40075017,g=p/Math.cos(Math.PI/180*i.lat);return new Te(new c.N(i.lng-g,i.lat-p),new c.N(i.lng+g,i.lat+p))}}class Mi{constructor(i,h,p){this.bounds=Te.convert(this.validateBounds(i)),this.minzoom=h||0,this.maxzoom=p||24}validateBounds(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]}contains(i){const h=Math.pow(2,i.z),p=Math.floor(c.O(this.bounds.getWest())*h),g=Math.floor(c.Q(this.bounds.getNorth())*h),b=Math.ceil(c.O(this.bounds.getEast())*h),E=Math.ceil(c.Q(this.bounds.getSouth())*h);return i.x>=p&&i.x=g&&i.y{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p={request:this.map._requestManager.transformRequest(h,"Tile"),uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,tileSize:this.tileSize*i.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};p.request.collectResourceTiming=this._collectResourceTiming;let g="RT";if(i.actor&&i.state!=="expired"){if(i.state==="loading")return new Promise((b,E)=>{i.reloadPromise={resolve:b,reject:E}})}else i.actor=this.dispatcher.getActor(),g="LT";i.abortController=new AbortController;try{const b=yield i.actor.sendAsync({type:g,data:p},i.abortController);if(delete i.abortController,i.aborted)return;this._afterTileLoadWorkerResponse(i,b)}catch(b){if(delete i.abortController,i.aborted)return;if(b&&b.status!==404)throw b;this._afterTileLoadWorkerResponse(i,null)}})}_afterTileLoadWorkerResponse(i,h){if(h&&h.resourceTiming&&(i.resourceTiming=h.resourceTiming),h&&this.map._refreshExpiredTiles&&i.setExpiryData(h),i.loadVectorData(h,this.map.painter),i.reloadPromise){const p=i.reloadPromise;i.reloadPromise=null,this.loadTile(i).then(p.resolve).catch(p.reject)}}abortTile(i){return c._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.actor&&(yield i.actor.sendAsync({type:"AT",data:{uid:i.uid,type:this.type,source:this.id}}))})}unloadTile(i){return c._(this,void 0,void 0,function*(){i.unloadVectorData(),i.actor&&(yield i.actor.sendAsync({type:"RMT",data:{uid:i.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class ur extends c.E{constructor(i,h,p,g){super(),this.id=i,this.dispatcher=p,this.setEventedParent(g),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},h),c.e(this,c.M(h,["url","scheme","tileSize"]))}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const i=yield nr(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,i&&(c.e(this,i),i.bounds&&(this.tileBounds=new Mi(i.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))}catch(i){this._tileJSONRequest=null,this.fire(new c.j(i))}})}loaded(){return this._loaded}onAdd(i){this.map=i,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(i){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),i(),this.load()}setTiles(i){return this.setSourceProperty(()=>{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}serialize(){return c.e({},this._options)}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);i.abortController=new AbortController;try{const p=yield V.getImage(this.map._requestManager.transformRequest(h,"Tile"),i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(p&&p.data){this.map._refreshExpiredTiles&&p.cacheControl&&p.expires&&i.setExpiryData({cacheControl:p.cacheControl,expires:p.expires});const g=this.map.painter.context,b=g.gl,E=p.data;i.texture=this.map.painter.getTileTexture(E.width),i.texture?i.texture.update(E,{useMipmap:!0}):(i.texture=new ve(g,E,b.RGBA,{useMipmap:!0}),i.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE,b.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&b.texParameterf(b.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),i.state="loaded"}}catch(p){if(delete i.abortController,i.aborted)i.state="unloaded";else if(p)throw i.state="errored",p}})}abortTile(i){return c._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController)})}unloadTile(i){return c._(this,void 0,void 0,function*(){i.texture&&this.map.painter.saveTileTexture(i.texture)})}hasTransition(){return!1}}class ti extends ur{constructor(i,h,p,g){super(i,h,p,g),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox",this.redFactor=h.redFactor,this.greenFactor=h.greenFactor,this.blueFactor=h.blueFactor,this.baseShift=h.baseShift}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p=this.map._requestManager.transformRequest(h,"Tile");i.neighboringTiles=this._getNeighboringTiles(i.tileID),i.abortController=new AbortController;try{const g=yield V.getImage(p,i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(g&&g.data){const b=g.data;this.map._refreshExpiredTiles&&g.cacheControl&&g.expires&&i.setExpiryData({cacheControl:g.cacheControl,expires:g.expires});const E=c.b(b)&&c.U()?b:yield this.readImageNow(b),I={type:this.type,uid:i.uid,source:this.id,rawImageData:E,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!i.actor||i.state==="expired"){i.actor=this.dispatcher.getActor();const C=yield i.actor.sendAsync({type:"LDT",data:I});i.dem=C,i.needsHillshadePrepare=!0,i.needsTerrainPrepare=!0,i.state="loaded"}}}catch(g){if(delete i.abortController,i.aborted)i.state="unloaded";else if(g)throw i.state="errored",g}})}readImageNow(i){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.V()){const h=i.width+2,p=i.height+2;try{return new c.R({width:h,height:p},yield c.W(i,-1,-1,h,p))}catch{}}return k.getImageData(i,1)})}_getNeighboringTiles(i){const h=i.canonical,p=Math.pow(2,h.z),g=(h.x-1+p)%p,b=h.x===0?i.wrap-1:i.wrap,E=(h.x+1+p)%p,I=h.x+1===p?i.wrap+1:i.wrap,C={};return C[new c.S(i.overscaledZ,b,h.z,g,h.y).key]={backfilled:!1},C[new c.S(i.overscaledZ,I,h.z,E,h.y).key]={backfilled:!1},h.y>0&&(C[new c.S(i.overscaledZ,b,h.z,g,h.y-1).key]={backfilled:!1},C[new c.S(i.overscaledZ,i.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},C[new c.S(i.overscaledZ,I,h.z,E,h.y-1).key]={backfilled:!1}),h.y+10&&c.e(b,{resourceTiming:g}),this.fire(new c.k("data",Object.assign(Object.assign({},b),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},b),{sourceDataType:"content"})))}catch(p){if(this._pendingLoads--,this._removed)return void this.fire(new c.k("dataabort",{dataType:"source"}));this.fire(new c.j(p))}})}loaded(){return this._pendingLoads===0}loadTile(i){return c._(this,void 0,void 0,function*(){const h=i.actor?"RT":"LT";i.actor=this.actor;const p={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.abortController=new AbortController;const g=yield this.actor.sendAsync({type:h,data:p},i.abortController);delete i.abortController,i.unloadVectorData(),i.aborted||i.loadVectorData(g,this.map.painter,h==="RT")})}abortTile(i){return c._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.aborted=!0})}unloadTile(i){return c._(this,void 0,void 0,function*(){i.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:i.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Bo=c.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class wo extends c.E{constructor(i,h,p,g){super(),this.id=i,this.dispatcher=p,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=h}load(i){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const h=yield V.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,h&&h.data&&(this.image=h.data,i&&(this.coordinates=i),this._finishLoading())}catch(h){this._request=null,this._loaded=!0,this.fire(new c.j(h))}})}loaded(){return this._loaded}updateImage(i){return i.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=i.url,this.load(i.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(i){this.map=i,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(i){this.coordinates=i;const h=i.map(c.Z.fromLngLat);this.tileID=function(g){let b=1/0,E=1/0,I=-1/0,C=-1/0;for(const H of g)b=Math.min(b,H.x),E=Math.min(E,H.y),I=Math.max(I,H.x),C=Math.max(C,H.y);const L=Math.max(I-b,C-E),$=Math.max(0,Math.floor(-Math.log(L)/Math.LN2)),O=Math.pow(2,$);return new c.a1($,Math.floor((b+I)/2*O),Math.floor((E+C)/2*O))}(h),this.minzoom=this.maxzoom=this.tileID.z;const p=h.map(g=>this.tileID.getTilePoint(g)._round());return this._boundsArray=new c.$,this._boundsArray.emplaceBack(p[0].x,p[0].y,0,0),this._boundsArray.emplaceBack(p[1].x,p[1].y,c.X,0),this._boundsArray.emplaceBack(p[3].x,p[3].y,0,c.X),this._boundsArray.emplaceBack(p[2].x,p[2].y,c.X,c.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const i=this.map.painter.context,h=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Bo.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ve(i,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let p=!1;for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(i){return c._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(i.tileID.canonical)?(this.tiles[String(i.tileID.wrap)]=i,i.buckets={}):i.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Bs extends wo{constructor(i,h,p,g){super(i,h,p,g),this.roundZoom=!0,this.type="video",this.options=h}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1;const i=this.options;this.urls=[];for(const h of i.urls)this.urls.push(this.map._requestManager.transformRequest(h,"Source").url);try{const h=yield c.a3(this.urls);if(this._loaded=!0,!h)return;this.video=h,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(h){this.fire(new c.j(h))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(i){if(this.video){const h=this.video.seekable;ih.end(0)?this.fire(new c.j(new c.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=i}}getVideo(){return this.video}onAdd(i){this.map||(this.map=i,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const i=this.map.painter.context,h=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Bo.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new ve(i,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let p=!1;for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ln extends wo{constructor(i,h,p,g){super(i,h,p,g),h.coordinates?Array.isArray(h.coordinates)&&h.coordinates.length===4&&!h.coordinates.some(b=>!Array.isArray(b)||b.length!==2||b.some(E=>typeof E!="number"))||this.fire(new c.j(new c.a2(`sources.${i}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.a2(`sources.${i}`,null,'missing required property "coordinates"'))),h.animate&&typeof h.animate!="boolean"&&this.fire(new c.j(new c.a2(`sources.${i}`,null,'optional "animate" property must be a boolean value'))),h.canvas?typeof h.canvas=="string"||h.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.a2(`sources.${i}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new c.j(new c.a2(`sources.${i}`,null,'missing required property "canvas"'))),this.options=h,this.animate=h.animate===void 0||h.animate}load(){return c._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(i){this.map=i,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let i=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,i=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,i=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const h=this.map.painter.context,p=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,Bo.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?(i||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ve(h,this.canvas,p.RGBA,{premultiply:!0});let g=!1;for(const b in this.tiles){const E=this.tiles[b];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,g=!0)}g&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const i of[this.canvas.width,this.canvas.height])if(isNaN(i)||i<=0)return!0;return!1}}const Ea={},Pa=v=>{switch(v){case"geojson":return ka;case"image":return wo;case"raster":return ur;case"raster-dem":return ti;case"vector":return cn;case"video":return Bs;case"canvas":return Ln}return Ea[v]},nt="RTLPluginLoaded";class io extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=li()}_syncState(i){return this.status=i,this.dispatcher.broadcast("SRPS",{pluginStatus:i,pluginURL:this.url}).catch(h=>{throw this.status="error",h})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(i){return c._(this,arguments,void 0,function*(h,p=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=k.resolveURL(h),!this.url)throw new Error(`requested url ${h} is invalid`);if(this.status==="unavailable"){if(!p)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return c._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.k(nt))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Yi=null;function no(){return Yi||(Yi=new io),Yi}class Oo{constructor(i,h){this.timeAdded=0,this.fadeEndTime=0,this.tileID=i,this.uid=c.a4(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(i){const h=i+this.timeAdded;hb.getLayer(L)).filter(Boolean);if(C.length!==0){I.layers=C,I.stateDependentLayerIds&&(I.stateDependentLayers=I.stateDependentLayerIds.map(L=>C.filter($=>$.id===L)[0]));for(const L of C)E[L.id]=I}}return E}(i.buckets,h.style),this.hasSymbolBuckets=!1;for(const g in this.buckets){const b=this.buckets[g];if(b instanceof c.a6){if(this.hasSymbolBuckets=!0,!p)break;b.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const g in this.buckets){const b=this.buckets[g];if(b instanceof c.a6&&b.hasRTLText){this.hasRTLText=!0,no().lazyLoad();break}}this.queryPadding=0;for(const g in this.buckets){const b=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(g).queryRadius(b))}i.imageAtlas&&(this.imageAtlas=i.imageAtlas),i.glyphAtlasImage&&(this.glyphAtlasImage=i.glyphAtlasImage)}else this.collisionBoxArray=new c.a5}unloadVectorData(){for(const i in this.buckets)this.buckets[i].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(i){return this.buckets[i.id]}upload(i){for(const p in this.buckets){const g=this.buckets[p];g.uploadPending()&&g.upload(i)}const h=i.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ve(i,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ve(i,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(i){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(i,this.imageAtlasTexture)}queryRenderedFeatures(i,h,p,g,b,E,I,C,L,$){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:b,scale:E,tileSize:this.tileSize,pixelPosMatrix:$,transform:C,params:I,queryPadding:this.queryPadding*L},i,h,p):{}}querySourceFeatures(i,h){const p=this.latestFeatureIndex;if(!p||!p.rawTileData)return;const g=p.loadVTLayers(),b=h&&h.sourceLayer?h.sourceLayer:"",E=g._geojsonTileLayer||g[b];if(!E)return;const I=c.a7(h&&h.filter),{z:C,x:L,y:$}=this.tileID.canonical,O={z:C,x:L,y:$};for(let H=0;Hp)g=!1;else if(h)if(this.expirationTime{this.remove(i,b)},p)),this.data[g].push(b),this.order.push(g),this.order.length>this.max){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}return this}has(i){return i.wrapped().key in this.data}getAndRemove(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null}_getAndRemoveByKey(i){const h=this.data[i].shift();return h.timeout&&clearTimeout(h.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),h.value}getByKey(i){const h=this.data[i];return h?h[0].value:null}get(i){return this.has(i)?this.data[i.wrapped().key][0].value:null}remove(i,h){if(!this.has(i))return this;const p=i.wrapped().key,g=h===void 0?0:this.data[p].indexOf(h),b=this.data[p][g];return this.data[p].splice(g,1),b.timeout&&clearTimeout(b.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(b.value),this.order.splice(this.order.indexOf(p),1),this}setMaxSize(i){for(this.max=i;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(i){const h=[];for(const p in this.data)for(const g of this.data[p])i(g.value)||h.push(g);for(const p of h)this.remove(p.value.tileID,p)}}class er{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(i,h,p){const g=String(h);if(this.stateChanges[i]=this.stateChanges[i]||{},this.stateChanges[i][g]=this.stateChanges[i][g]||{},c.e(this.stateChanges[i][g],p),this.deletedStates[i]===null){this.deletedStates[i]={};for(const b in this.state[i])b!==g&&(this.deletedStates[i][b]=null)}else if(this.deletedStates[i]&&this.deletedStates[i][g]===null){this.deletedStates[i][g]={};for(const b in this.state[i][g])p[b]||(this.deletedStates[i][g][b]=null)}else for(const b in p)this.deletedStates[i]&&this.deletedStates[i][g]&&this.deletedStates[i][g][b]===null&&delete this.deletedStates[i][g][b]}removeFeatureState(i,h,p){if(this.deletedStates[i]===null)return;const g=String(h);if(this.deletedStates[i]=this.deletedStates[i]||{},p&&h!==void 0)this.deletedStates[i][g]!==null&&(this.deletedStates[i][g]=this.deletedStates[i][g]||{},this.deletedStates[i][g][p]=null);else if(h!==void 0)if(this.stateChanges[i]&&this.stateChanges[i][g])for(p in this.deletedStates[i][g]={},this.stateChanges[i][g])this.deletedStates[i][g][p]=null;else this.deletedStates[i][g]=null;else this.deletedStates[i]=null}getState(i,h){const p=String(h),g=c.e({},(this.state[i]||{})[p],(this.stateChanges[i]||{})[p]);if(this.deletedStates[i]===null)return{};if(this.deletedStates[i]){const b=this.deletedStates[i][h];if(b===null)return{};for(const E in b)delete g[E]}return g}initializeTileState(i,h){i.setFeatureState(this.state,h)}coalesceChanges(i,h){const p={};for(const g in this.stateChanges){this.state[g]=this.state[g]||{};const b={};for(const E in this.stateChanges[g])this.state[g][E]||(this.state[g][E]={}),c.e(this.state[g][E],this.stateChanges[g][E]),b[E]=this.state[g][E];p[g]=b}for(const g in this.deletedStates){this.state[g]=this.state[g]||{};const b={};if(this.deletedStates[g]===null)for(const E in this.state[g])b[E]={},this.state[g][E]={};else for(const E in this.deletedStates[g]){if(this.deletedStates[g][E]===null)this.state[g][E]={};else for(const I of Object.keys(this.deletedStates[g][E]))delete this.state[g][E][I];b[E]=this.state[g][E]}p[g]=p[g]||{},c.e(p[g],b)}if(this.stateChanges={},this.deletedStates={},Object.keys(p).length!==0)for(const g in i)i[g].setFeatureState(p,h)}}class Nt extends c.E{constructor(i,h,p){super(),this.id=i,this.dispatcher=p,this.on("data",g=>this._dataHandler(g)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((g,b,E,I)=>{const C=new(Pa(b.type))(g,b,E,I);if(C.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${C.id}`);return C})(i,h,p,this),this._tiles={},this._cache=new lt(0,g=>this._unloadTile(g)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new er,this._didEmitContent=!1,this._updated=!1}onAdd(i){this.map=i,this._maxTileCacheSize=i?i._maxTileCacheSize:null,this._maxTileCacheZoomLevels=i?i._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(i)}onRemove(i){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(i)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const i in this._tiles){const h=this._tiles[i];if(h.state!=="loaded"&&h.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const i=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,i&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(i,h,p){return c._(this,void 0,void 0,function*(){try{yield this._source.loadTile(i),this._tileLoaded(i,h,p)}catch(g){i.state="errored",g.status!==404?this._source.fire(new c.j(g,{tile:i})):this.update(this.transform,this.terrain)}})}_unloadTile(i){this._source.unloadTile&&this._source.unloadTile(i)}_abortTile(i){this._source.abortTile&&this._source.abortTile(i),this._source.fire(new c.k("dataabort",{tile:i,coord:i.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(i){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const p=this._tiles[h];p.upload(i),p.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(i=>i.tileID).sort(un).map(i=>i.key)}getRenderableIds(i){const h=[];for(const p in this._tiles)this._isIdRenderable(p,i)&&h.push(this._tiles[p]);return i?h.sort((p,g)=>{const b=p.tileID,E=g.tileID,I=new c.P(b.canonical.x,b.canonical.y)._rotate(this.transform.angle),C=new c.P(E.canonical.x,E.canonical.y)._rotate(this.transform.angle);return b.overscaledZ-E.overscaledZ||C.y-I.y||C.x-I.x}).map(p=>p.tileID.key):h.map(p=>p.tileID).sort(un).map(p=>p.key)}hasRenderableParent(i){const h=this.findLoadedParent(i,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(i,h){return this._tiles[i]&&this._tiles[i].hasData()&&!this._coveredTiles[i]&&(h||!this._tiles[i].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const i in this._tiles)this._tiles[i].state!=="errored"&&this._reloadTile(i,"reloading")}}_reloadTile(i,h){return c._(this,void 0,void 0,function*(){const p=this._tiles[i];p&&(p.state!=="loading"&&(p.state=h),yield this._loadTile(p,i,h))})}_tileLoaded(i,h,p){i.timeAdded=k.now(),p==="expired"&&(i.refreshedUponExpiration=!0),this._setTileReloadTimer(h,i),this.getSource().type==="raster-dem"&&i.dem&&this._backfillDEM(i),this._state.initializeTileState(i,this.map?this.map.painter:null),i.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:i,coord:i.tileID}))}_backfillDEM(i){const h=this.getRenderableIds();for(let g=0;g1||(Math.abs(E)>1&&(Math.abs(E+C)===1?E+=C:Math.abs(E-C)===1&&(E-=C)),b.dem&&g.dem&&(g.dem.backfillBorder(b.dem,E,I),g.neighboringTiles&&g.neighboringTiles[L]&&(g.neighboringTiles[L].backfilled=!0)))}}getTile(i){return this.getTileByID(i.key)}getTileByID(i){return this._tiles[i]}_retainLoadedChildren(i,h,p,g){for(const b in this._tiles){let E=this._tiles[b];if(g[b]||!E.hasData()||E.tileID.overscaledZ<=h||E.tileID.overscaledZ>p)continue;let I=E.tileID;for(;E&&E.tileID.overscaledZ>h+1;){const L=E.tileID.scaledTo(E.tileID.overscaledZ-1);E=this._tiles[L.key],E&&E.hasData()&&(I=L)}let C=I;for(;C.overscaledZ>h;)if(C=C.scaledTo(C.overscaledZ-1),i[C.key]){g[I.key]=I;break}}}findLoadedParent(i,h){if(i.key in this._loadedParentTiles){const p=this._loadedParentTiles[i.key];return p&&p.tileID.overscaledZ>=h?p:null}for(let p=i.overscaledZ-1;p>=h;p--){const g=i.scaledTo(p),b=this._getLoadedTile(g);if(b)return b}}findLoadedSibling(i){return this._getLoadedTile(i)}_getLoadedTile(i){const h=this._tiles[i.key];return h&&h.hasData()?h:this._cache.getByKey(i.wrapped().key)}updateCacheSize(i){const h=Math.ceil(i.width/this._source.tileSize)+1,p=Math.ceil(i.height/this._source.tileSize)+1,g=Math.floor(h*p*(this._maxTileCacheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),b=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(b)}handleWrapJump(i){const h=Math.round((i-(this._prevLng===void 0?i:this._prevLng))/360);if(this._prevLng=i,h){const p={};for(const g in this._tiles){const b=this._tiles[g];b.tileID=b.tileID.unwrapTo(b.tileID.wrap+h),p[b.tileID.key]=b}this._tiles=p;for(const g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(const g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}_updateCoveredAndRetainedTiles(i,h,p,g,b,E){const I={},C={},L=Object.keys(i),$=k.now();for(const O of L){const H=i[O],K=this._tiles[O];if(!K||K.fadeEndTime!==0&&K.fadeEndTime<=$)continue;const te=this.findLoadedParent(H,h),se=this.findLoadedSibling(H),re=te||se||null;re&&(this._addTile(re.tileID),I[re.tileID.key]=re.tileID),C[O]=H}this._retainLoadedChildren(C,g,p,i);for(const O in I)i[O]||(this._coveredTiles[O]=!0,i[O]=I[O]);if(E){const O={},H={};for(const K of b)this._tiles[K.key].hasData()?O[K.key]=K:H[K.key]=K;for(const K in H){const te=H[K].children(this._source.maxzoom);this._tiles[te[0].key]&&this._tiles[te[1].key]&&this._tiles[te[2].key]&&this._tiles[te[3].key]&&(O[te[0].key]=i[te[0].key]=te[0],O[te[1].key]=i[te[1].key]=te[1],O[te[2].key]=i[te[2].key]=te[2],O[te[3].key]=i[te[3].key]=te[3],delete H[K])}for(const K in H){const te=H[K],se=this.findLoadedParent(te,this._source.minzoom),re=this.findLoadedSibling(te),ue=se||re||null;if(ue){O[ue.tileID.key]=i[ue.tileID.key]=ue.tileID;for(const ye in O)O[ye].isChildOf(ue.tileID)&&delete O[ye]}}for(const K in this._tiles)O[K]||(this._coveredTiles[K]=!0)}}update(i,h){if(!this._sourceLoaded||this._paused)return;let p;this.transform=i,this.terrain=h,this.updateCacheSize(i),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?p=i.getVisibleUnwrappedCoordinates(this._source.tileID).map($=>new c.S($.canonical.z,$.wrap,$.canonical.z,$.canonical.x,$.canonical.y)):(p=i.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(p=p.filter($=>this._source.hasTile($)))):p=[];const g=i.coveringZoomLevel(this._source),b=Math.max(g-Nt.maxOverzooming,this._source.minzoom),E=Math.max(g+Nt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const $={};for(const O of p)if(O.canonical.z>this._source.minzoom){const H=O.scaledTo(O.canonical.z-1);$[H.key]=H;const K=O.scaledTo(Math.max(this._source.minzoom,Math.min(O.canonical.z,5)));$[K.key]=K}p=p.concat(Object.values($))}const I=p.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,I&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const C=this._updateRetainedTiles(p,g);On(this._source.type)&&this._updateCoveredAndRetainedTiles(C,b,E,g,p,h);for(const $ in C)this._tiles[$].clearFadeHold();const L=c.ac(this._tiles,C);for(const $ of L){const O=this._tiles[$];O.hasSymbolBuckets&&!O.holdingForFade()?O.setHoldDuration(this.map._fadeDuration):O.hasSymbolBuckets&&!O.symbolFadeFinished()||this._removeTile($)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const i in this._tiles)this._tiles[i].holdingForFade()&&this._removeTile(i)}_updateRetainedTiles(i,h){var p;const g={},b={},E=Math.max(h-Nt.maxOverzooming,this._source.minzoom),I=Math.max(h+Nt.maxUnderzooming,this._source.minzoom),C={};for(const L of i){const $=this._addTile(L);g[L.key]=L,$.hasData()||hthis._source.maxzoom){const H=L.children(this._source.maxzoom)[0],K=this.getTile(H);if(K&&K.hasData()){g[H.key]=H;continue}}else{const H=L.children(this._source.maxzoom);if(g[H[0].key]&&g[H[1].key]&&g[H[2].key]&&g[H[3].key])continue}let O=$.wasRequested();for(let H=L.overscaledZ-1;H>=E;--H){const K=L.scaledTo(H);if(b[K.key])break;if(b[K.key]=!0,$=this.getTile(K),!$&&O&&($=this._addTile(K)),$){const te=$.hasData();if((te||!(!((p=this.map)===null||p===void 0)&&p.cancelPendingTileRequestsWhileZooming)||O)&&(g[K.key]=K),O=$.wasRequested(),te)break}}}return g}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const i in this._tiles){const h=[];let p,g=this._tiles[i].tileID;for(;g.overscaledZ>0;){if(g.key in this._loadedParentTiles){p=this._loadedParentTiles[g.key];break}h.push(g.key);const b=g.scaledTo(g.overscaledZ-1);if(p=this._getLoadedTile(b),p)break;g=b}for(const b of h)this._loadedParentTiles[b]=p}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const i in this._tiles){const h=this._tiles[i].tileID,p=this._getLoadedTile(h);this._loadedSiblingTiles[h.key]=p}}_addTile(i){let h=this._tiles[i.key];if(h)return h;h=this._cache.getAndRemove(i),h&&(this._setTileReloadTimer(i.key,h),h.tileID=i,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[i.key]&&(clearTimeout(this._cacheTimers[i.key]),delete this._cacheTimers[i.key],this._setTileReloadTimer(i.key,h)));const p=h;return h||(h=new Oo(i,this._source.tileSize*i.overscaleFactor()),this._loadTile(h,i.key,h.state)),h.uses++,this._tiles[i.key]=h,p||this._source.fire(new c.k("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(i,h){i in this._timers&&(clearTimeout(this._timers[i]),delete this._timers[i]);const p=h.getExpiryTimeout();p&&(this._timers[i]=setTimeout(()=>{this._reloadTile(i,"expired"),delete this._timers[i]},p))}_removeTile(i){const h=this._tiles[i];h&&(h.uses--,delete this._tiles[i],this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]),h.uses>0||(h.hasData()&&h.state!=="reloading"?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}_dataHandler(i){const h=i.sourceDataType;i.dataType==="source"&&h==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&i.dataType==="source"&&h==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const i in this._tiles)this._removeTile(i);this._cache.reset()}tilesIn(i,h,p){const g=[],b=this.transform;if(!b)return g;const E=p?b.getCameraQueryGeometry(i):i,I=i.map(te=>b.pointCoordinate(te,this.terrain)),C=E.map(te=>b.pointCoordinate(te,this.terrain)),L=this.getIds();let $=1/0,O=1/0,H=-1/0,K=-1/0;for(const te of C)$=Math.min($,te.x),O=Math.min(O,te.y),H=Math.max(H,te.x),K=Math.max(K,te.y);for(let te=0;te=0&&ne[1].y+ye>=0){const xe=I.map(Ce=>re.getTilePoint(Ce)),Ie=C.map(Ce=>re.getTilePoint(Ce));g.push({tile:se,tileID:re,queryGeometry:xe,cameraQueryGeometry:Ie,scale:ue})}}return g}getVisibleCoordinates(i){const h=this.getRenderableIds(i).map(p=>this._tiles[p].tileID);for(const p of h)p.posMatrix=this.transform.calculatePosMatrix(p.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(On(this._source.type)){const i=k.now();for(const h in this._tiles)if(this._tiles[h].fadeEndTime>=i)return!0}return!1}setFeatureState(i,h,p){this._state.updateState(i=i||"_geojsonTileLayer",h,p)}removeFeatureState(i,h,p){this._state.removeFeatureState(i=i||"_geojsonTileLayer",h,p)}getFeatureState(i,h){return this._state.getState(i=i||"_geojsonTileLayer",h)}setDependencies(i,h,p){const g=this._tiles[i];g&&g.setDependencies(h,p)}reloadTilesForDependencies(i,h){for(const p in this._tiles)this._tiles[p].hasDependency(i,h)&&this._reloadTile(p,"reloading");this._cache.filter(p=>!p.hasDependency(i,h))}}function un(v,i){const h=Math.abs(2*v.wrap)-+(v.wrap<0),p=Math.abs(2*i.wrap)-+(i.wrap<0);return v.overscaledZ-i.overscaledZ||p-h||i.canonical.y-v.canonical.y||i.canonical.x-v.canonical.x}function On(v){return v==="raster"||v==="image"||v==="video"}Nt.maxOverzooming=10,Nt.maxUnderzooming=3;class Wt{constructor(i,h){this.reset(i,h)}reset(i,h){this.points=i||[],this._distances=[0];for(let p=1;p0?(g-E)/I:0;return this.points[b].mult(1-C).add(this.points[h].mult(C))}}function oo(v,i){let h=!0;return v==="always"||v!=="never"&&i!=="never"||(h=!1),h}class So{constructor(i,h,p){const g=this.boxCells=[],b=this.circleCells=[];this.xCellCount=Math.ceil(i/p),this.yCellCount=Math.ceil(h/p);for(let E=0;Ethis.width||g<0||h>this.height)return[];const C=[];if(i<=0&&h<=0&&this.width<=p&&this.height<=g){if(b)return[{key:null,x1:i,y1:h,x2:p,y2:g}];for(let L=0;L0}hitTestCircle(i,h,p,g,b){const E=i-p,I=i+p,C=h-p,L=h+p;if(I<0||E>this.width||L<0||C>this.height)return!1;const $=[];return this._forEachCell(E,C,I,L,this._queryCellCircle,$,{hitTest:!0,overlapMode:g,circle:{x:i,y:h,radius:p},seenUids:{box:{},circle:{}}},b),$.length>0}_queryCell(i,h,p,g,b,E,I,C){const{seenUids:L,hitTest:$,overlapMode:O}=I,H=this.boxCells[b];if(H!==null){const te=this.bboxes;for(const se of H)if(!L.box[se]){L.box[se]=!0;const re=4*se,ue=this.boxKeys[se];if(i<=te[re+2]&&h<=te[re+3]&&p>=te[re+0]&&g>=te[re+1]&&(!C||C(ue))&&(!$||!oo(O,ue.overlapMode))&&(E.push({key:ue,x1:te[re],y1:te[re+1],x2:te[re+2],y2:te[re+3]}),$))return!0}}const K=this.circleCells[b];if(K!==null){const te=this.circles;for(const se of K)if(!L.circle[se]){L.circle[se]=!0;const re=3*se,ue=this.circleKeys[se];if(this._circleAndRectCollide(te[re],te[re+1],te[re+2],i,h,p,g)&&(!C||C(ue))&&(!$||!oo(O,ue.overlapMode))){const ye=te[re],ne=te[re+1],xe=te[re+2];if(E.push({key:ue,x1:ye-xe,y1:ne-xe,x2:ye+xe,y2:ne+xe}),$)return!0}}}return!1}_queryCellCircle(i,h,p,g,b,E,I,C){const{circle:L,seenUids:$,overlapMode:O}=I,H=this.boxCells[b];if(H!==null){const te=this.bboxes;for(const se of H)if(!$.box[se]){$.box[se]=!0;const re=4*se,ue=this.boxKeys[se];if(this._circleAndRectCollide(L.x,L.y,L.radius,te[re+0],te[re+1],te[re+2],te[re+3])&&(!C||C(ue))&&!oo(O,ue.overlapMode))return E.push(!0),!0}}const K=this.circleCells[b];if(K!==null){const te=this.circles;for(const se of K)if(!$.circle[se]){$.circle[se]=!0;const re=3*se,ue=this.circleKeys[se];if(this._circlesCollide(te[re],te[re+1],te[re+2],L.x,L.y,L.radius)&&(!C||C(ue))&&!oo(O,ue.overlapMode))return E.push(!0),!0}}}_forEachCell(i,h,p,g,b,E,I,C){const L=this._convertToXCellCoord(i),$=this._convertToYCellCoord(h),O=this._convertToXCellCoord(p),H=this._convertToYCellCoord(g);for(let K=L;K<=O;K++)for(let te=$;te<=H;te++)if(b.call(this,i,h,p,g,this.xCellCount*te+K,E,I,C))return}_convertToXCellCoord(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))}_convertToYCellCoord(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))}_circlesCollide(i,h,p,g,b,E){const I=g-i,C=b-h,L=p+E;return L*L>I*I+C*C}_circleAndRectCollide(i,h,p,g,b,E,I){const C=(E-g)/2,L=Math.abs(i-(g+C));if(L>C+p)return!1;const $=(I-b)/2,O=Math.abs(h-(b+$));if(O>$+p)return!1;if(L<=C||O<=$)return!0;const H=L-C,K=O-$;return H*H+K*K<=p*p}}function $o(v,i,h,p,g){const b=c.H();return i?(c.K(b,b,[1/g,1/g,1]),h||c.ae(b,b,p.angle)):c.L(b,p.labelPlaneMatrix,v),b}function so(v,i,h,p,g){if(i){const b=c.af(v);return c.K(b,b,[g,g,1]),h||c.ae(b,b,-p.angle),b}return p.glCoordMatrix}function le(v,i,h){let p;h?(p=[v.x,v.y,h(v.x,v.y),1],c.ag(p,p,i)):(p=[v.x,v.y,0,1],function(b,E,I){const C=E[0],L=E[1];b[0]=I[0]*C+I[4]*L+I[12],b[1]=I[1]*C+I[5]*L+I[13],b[3]=I[3]*C+I[7]*L+I[15]}(p,p,i));const g=p[3];return{point:new c.P(p[0]/g,p[1]/g),signedDistanceFromCamera:g,isOccluded:!1}}function q(v,i){return .5+v/i*.5}function U(v,i){return v.x>=-i[0]&&v.x<=i[0]&&v.y>=-i[1]&&v.y<=i[1]}function Y(v,i,h,p,g,b,E,I,C,L,$,O,H,K,te){const se=p?v.textSizeData:v.iconSizeData,re=c.ah(se,h.transform.zoom),ue=[256/h.width*2+1,256/h.height*2+1],ye=p?v.text.dynamicLayoutVertexArray:v.icon.dynamicLayoutVertexArray;ye.clear();const ne=v.lineVertexArray,xe=p?v.text.placedSymbolArray:v.icon.placedSymbolArray,Ie=h.transform.width/h.transform.height;let Ce=!1;for(let je=0;jeMath.abs(h.x-i.x)*p?{useVertical:!0}:(v===c.ai.vertical?i.yh.x)?{needsFlipping:!0}:null}function be(v,i,h,p,g,b,E,I,C,L,$){const O=h/24,H=i.lineOffsetX*O,K=i.lineOffsetY*O;let te;if(i.numGlyphs>1){const se=i.glyphStartIndex+i.numGlyphs,re=i.lineStartIndex,ue=i.lineStartIndex+i.lineLength,ye=oe(O,I,H,K,p,i,$,v);if(!ye)return{notEnoughRoom:!0};const ne=le(ye.first.point,E,v.getElevation).point,xe=le(ye.last.point,E,v.getElevation).point;if(g&&!p){const Ie=_e(i.writingMode,ne,xe,L);if(Ie)return Ie}te=[ye.first];for(let Ie=i.glyphStartIndex+1;Ie0?ne.point:function(Ce,je,Je,gt,yt,Qe){return Me(Ce,je,Je,1,yt,Qe)}(v.tileAnchorPoint,ye,re,0,b,v),Ie=_e(i.writingMode,re,xe,L);if(Ie)return Ie}const se=ot(O*I.getoffsetX(i.glyphStartIndex),H,K,p,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,v,$);if(!se||v.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};te=[se]}for(const se of te)c.ak(C,se.point,se.angle);return{}}function Me(v,i,h,p,g,b){const E=v.add(v.sub(i)._unit()),I=g!==void 0?le(E,g,b.getElevation).point:Oe(E.x,E.y,b).point,C=h.sub(I);return h.add(C._mult(p/C.mag()))}function de(v,i,h){const p=i.projectionCache;if(p.projections[v])return p.projections[v];const g=new c.P(i.lineVertexArray.getx(v),i.lineVertexArray.gety(v)),b=Oe(g.x,g.y,i);if(b.signedDistanceFromCamera>0)return p.projections[v]=b.point,p.anyProjectionOccluded=p.anyProjectionOccluded||b.isOccluded,b.point;const E=v-h.direction;return function(I,C,L,$,O){return Me(I,C,L,$,void 0,O)}(h.distanceFromAnchor===0?i.tileAnchorPoint:new c.P(i.lineVertexArray.getx(E),i.lineVertexArray.gety(E)),g,h.previousVertex,h.absOffsetX-h.distanceFromAnchor+1,i)}function Oe(v,i,h){const p=v+h.translation[0],g=i+h.translation[1];let b;return!h.pitchWithMap&&h.projection.useSpecialProjectionForSymbols?(b=h.projection.projectTileCoordinates(p,g,h.unwrappedTileID,h.getElevation),b.point.x=(.5*b.point.x+.5)*h.width,b.point.y=(.5*-b.point.y+.5)*h.height):(b=le(new c.P(p,g),h.labelPlaneMatrix,h.getElevation),b.isOccluded=!1),b}function Ze(v,i,h){return v._unit()._perp()._mult(i*h)}function De(v,i,h,p,g,b,E,I,C){if(I.projectionCache.offsets[v])return I.projectionCache.offsets[v];const L=h.add(i);if(v+C.direction=g)return I.projectionCache.offsets[v]=L,L;const $=de(v+C.direction,I,C),O=Ze($.sub(h),E,C.direction),H=h.add(O),K=$.add(O);return I.projectionCache.offsets[v]=c.al(b,L,H,K)||L,I.projectionCache.offsets[v]}function ot(v,i,h,p,g,b,E,I,C){const L=p?v-i:v+i;let $=L>0?1:-1,O=0;p&&($*=-1,O=Math.PI),$<0&&(O+=Math.PI);let H,K=$>0?b+g:b+g+1;I.projectionCache.cachedAnchorPoint?H=I.projectionCache.cachedAnchorPoint:(H=Oe(I.tileAnchorPoint.x,I.tileAnchorPoint.y,I).point,I.projectionCache.cachedAnchorPoint=H);let te,se,re=H,ue=H,ye=0,ne=0;const xe=Math.abs(L),Ie=[];let Ce;for(;ye+ne<=xe;){if(K+=$,K=E)return null;ye+=ne,ue=re,se=te;const gt={absOffsetX:xe,direction:$,distanceFromAnchor:ye,previousVertex:ue};if(re=de(K,I,gt),h===0)Ie.push(ue),Ce=re.sub(ue);else{let yt;const Qe=re.sub(ue);yt=Qe.mag()===0?Ze(de(K+$,I,gt).sub(re),h,$):Ze(Qe,h,$),se||(se=ue.add(yt)),te=De(K,yt,re,b,E,se,h,I,gt),Ie.push(se),Ce=te.sub(se)}ne=Ce.mag()}const je=Ce._mult((xe-ye)/ne)._add(se||ue),Je=O+Math.atan2(re.y-ue.y,re.x-ue.x);return Ie.push(je),{point:je,angle:C?Je:0,path:Ie}}const Ct=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Rt(v,i){for(let h=0;h=1;Qt--)ft.push(Ut.path[Qt]);for(let Qt=1;Qtar.signedDistanceFromCamera<=0)?[]:Qt.map(ar=>ar.point)}let jr=[];if(ft.length>0){const Qt=ft[0].clone(),ar=ft[0].clone();for(let Vr=1;Vr=Qe.x&&ar.x<=it.x&&Qt.y>=Qe.y&&ar.y<=it.y?[ft]:ar.xit.x||ar.yit.y?[]:c.am([ft],Qe.x,Qe.y,it.x,it.y)}for(const Qt of jr){Et.reset(Qt,.25*yt);let ar=0;ar=Et.length<=.5*yt?1:Math.ceil(Et.paddedLength/jt)+1;for(let Vr=0;Vrle(g,p,h.getElevation))}queryRenderedSymbols(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const h=[];let p=1/0,g=1/0,b=-1/0,E=-1/0;for(const $ of i){const O=new c.P($.x+Kt,$.y+Kt);p=Math.min(p,O.x),g=Math.min(g,O.y),b=Math.max(b,O.x),E=Math.max(E,O.y),h.push(O)}const I=this.grid.query(p,g,b,E).concat(this.ignoredGrid.query(p,g,b,E)),C={},L={};for(const $ of I){const O=$.key;if(C[O.bucketInstanceId]===void 0&&(C[O.bucketInstanceId]={}),C[O.bucketInstanceId][O.featureIndex])continue;const H=[new c.P($.x1,$.y1),new c.P($.x2,$.y1),new c.P($.x2,$.y2),new c.P($.x1,$.y2)];c.an(h,H)&&(C[O.bucketInstanceId][O.featureIndex]=!0,L[O.bucketInstanceId]===void 0&&(L[O.bucketInstanceId]=[]),L[O.bucketInstanceId].push(O.featureIndex))}return L}insertCollisionBox(i,h,p,g,b,E){(p?this.ignoredGrid:this.grid).insert({bucketInstanceId:g,featureIndex:b,collisionGroupID:E,overlapMode:h},i[0],i[1],i[2],i[3])}insertCollisionCircles(i,h,p,g,b,E){const I=p?this.ignoredGrid:this.grid,C={bucketInstanceId:g,featureIndex:b,collisionGroupID:E,overlapMode:h};for(let L=0;L=this.screenRightBoundary||gthis.screenBottomBoundary}isInsideGrid(i,h,p,g){return p>=0&&i=0&&hthis.projectAndGetPerspectiveRatio(p,Qe.x,Qe.y,g,L));gt=yt.some(Qe=>!Qe.isOccluded),Je=yt.map(Qe=>Qe.point)}else gt=!0;return{box:c.ap(Je),allPointsOccluded:!gt}}}function Xt(v,i,h){return i*(c.X/(v.tileSize*Math.pow(2,h-v.tileID.overscaledZ)))}class Cr{constructor(i,h,p,g){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?h:-h))):g&&p?1:0,this.placed=p}isHidden(){return this.opacity===0&&!this.placed}}class ri{constructor(i,h,p,g,b){this.text=new Cr(i?i.text:null,h,p,b),this.icon=new Cr(i?i.icon:null,h,g,b)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class di{constructor(i,h,p){this.text=i,this.icon=h,this.skipFade=p}}class ir{constructor(){this.invProjMatrix=c.H(),this.viewportMatrix=c.H(),this.circles=[]}}class Sr{constructor(i,h,p,g,b){this.bucketInstanceId=i,this.featureIndex=h,this.sourceLayerIndex=p,this.bucketIndex=g,this.tileID=b}}class Zr{constructor(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}}get(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){const h=++this.maxGroupID;this.collisionGroups[i]={ID:h,predicate:p=>p.collisionGroupID===h}}return this.collisionGroups[i]}}function xi(v,i,h,p,g){const{horizontalAlign:b,verticalAlign:E}=c.av(v);return new c.P(-(b-.5)*i+p[0]*g,-(E-.5)*h+p[1]*g)}class Oi{constructor(i,h,p,g,b,E){this.transform=i.clone(),this.terrain=p,this.collisionIndex=new pr(this.transform,h),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=g,this.retainedQueryData={},this.collisionGroups=new Zr(b),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=E,E&&(E.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(i){const h=this.terrain;return h?(p,g)=>h.getElevation(i,p,g):null}getBucketParts(i,h,p,g){const b=p.getBucket(h),E=p.latestFeatureIndex;if(!b||!E||h.id!==b.layerIds[0])return;const I=p.collisionBoxArray,C=b.layers[0].layout,L=b.layers[0].paint,$=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),O=p.tileSize/c.X,H=p.tileID.toUnwrapped(),K=this.transform.calculatePosMatrix(H),te=C.get("text-pitch-alignment")==="map",se=C.get("text-rotation-alignment")==="map",re=Xt(p,1,this.transform.zoom),ue=this.collisionIndex.mapProjection.translatePosition(this.transform,p,L.get("text-translate"),L.get("text-translate-anchor")),ye=this.collisionIndex.mapProjection.translatePosition(this.transform,p,L.get("icon-translate"),L.get("icon-translate-anchor")),ne=$o(K,te,se,this.transform,re);let xe=null;if(te){const Ce=so(K,te,se,this.transform,re);xe=c.L([],this.transform.labelPlaneMatrix,Ce)}this.retainedQueryData[b.bucketInstanceId]=new Sr(b.bucketInstanceId,E,b.sourceLayerIndex,b.index,p.tileID);const Ie={bucket:b,layout:C,translationText:ue,translationIcon:ye,posMatrix:K,unwrappedTileID:H,textLabelPlaneMatrix:ne,labelToScreenMatrix:xe,scale:$,textPixelRatio:O,holdingForFade:p.holdingForFade(),collisionBoxArray:I,partiallyEvaluatedTextSize:c.ah(b.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(b.sourceID)};if(g)for(const Ce of b.sortKeyRanges){const{sortKey:je,symbolInstanceStart:Je,symbolInstanceEnd:gt}=Ce;i.push({sortKey:je,symbolInstanceStart:Je,symbolInstanceEnd:gt,parameters:Ie})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:b.symbolInstances.length,parameters:Ie})}attemptAnchorPlacement(i,h,p,g,b,E,I,C,L,$,O,H,K,te,se,re,ue,ye,ne){const xe=c.ar[i.textAnchor],Ie=[i.textOffset0,i.textOffset1],Ce=xi(xe,p,g,Ie,b),je=this.collisionIndex.placeCollisionBox(h,H,C,L,$,I,E,re,O.predicate,ne,Ce);if((!ye||this.collisionIndex.placeCollisionBox(ye,H,C,L,$,I,E,ue,O.predicate,ne,Ce).placeable)&&je.placeable){let Je;if(this.prevPlacement&&this.prevPlacement.variableOffsets[K.crossTileID]&&this.prevPlacement.placements[K.crossTileID]&&this.prevPlacement.placements[K.crossTileID].text&&(Je=this.prevPlacement.variableOffsets[K.crossTileID].anchor),K.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[K.crossTileID]={textOffset:Ie,width:p,height:g,anchor:xe,textBoxScale:b,prevAnchor:Je},this.markUsedJustification(te,xe,K,se),te.allowVerticalPlacement&&(this.markUsedOrientation(te,se,K),this.placedOrientations[K.crossTileID]=se),{shift:Ce,placedGlyphBoxes:je}}}placeLayerBucketPart(i,h,p){const{bucket:g,layout:b,translationText:E,translationIcon:I,posMatrix:C,unwrappedTileID:L,textLabelPlaneMatrix:$,labelToScreenMatrix:O,textPixelRatio:H,holdingForFade:K,collisionBoxArray:te,partiallyEvaluatedTextSize:se,collisionGroup:re}=i.parameters,ue=b.get("text-optional"),ye=b.get("icon-optional"),ne=c.as(b,"text-overlap","text-allow-overlap"),xe=ne==="always",Ie=c.as(b,"icon-overlap","icon-allow-overlap"),Ce=Ie==="always",je=b.get("text-rotation-alignment")==="map",Je=b.get("text-pitch-alignment")==="map",gt=b.get("icon-text-fit")!=="none",yt=b.get("symbol-z-order")==="viewport-y",Qe=xe&&(Ce||!g.hasIconData()||ye),it=Ce&&(xe||!g.hasTextData()||ue);!g.collisionArrays&&te&&g.deserializeCollisionBoxes(te);const Et=this._getTerrainElevationFunc(this.retainedQueryData[g.bucketInstanceId].tileID),Ut=(st,ft,jt)=>{var jr,Qt;if(h[st.crossTileID])return;if(K)return void(this.placements[st.crossTileID]=new di(!1,!1,!1));let ar=!1,Vr=!1,ji=!0,jn=null,Ur={box:null,placeable:!1,offscreen:null},fn={box:null,placeable:!1,offscreen:null},en=null,Vi=null,Ui=null,Vn=0,vs=0,Gl=0;ft.textFeatureIndex?Vn=ft.textFeatureIndex:st.useRuntimeCollisionCircles&&(Vn=st.featureIndex),ft.verticalTextFeatureIndex&&(vs=ft.verticalTextFeatureIndex);const Xs=ft.textBox;if(Xs){const Li=qi=>{let Gi=c.ai.horizontal;if(g.allowVerticalPlacement&&!qi&&this.prevPlacement){const Ii=this.prevPlacement.placedOrientations[st.crossTileID];Ii&&(this.placedOrientations[st.crossTileID]=Ii,Gi=Ii,this.markUsedOrientation(g,Gi,st))}return Gi},Un=(qi,Gi)=>{if(g.allowVerticalPlacement&&st.numVerticalGlyphVertices>0&&ft.verticalTextBox){for(const Ii of g.writingModes)if(Ii===c.ai.vertical?(Ur=Gi(),fn=Ur):Ur=qi(),Ur&&Ur.placeable)break}else Ur=qi()},Zo=st.textAnchorOffsetStartIndex,Js=st.textAnchorOffsetEndIndex;if(Js===Zo){const qi=(Gi,Ii)=>{const Xr=this.collisionIndex.placeCollisionBox(Gi,ne,H,C,L,Je,je,E,re.predicate,Et);return Xr&&Xr.placeable&&(this.markUsedOrientation(g,Ii,st),this.placedOrientations[st.crossTileID]=Ii),Xr};Un(()=>qi(Xs,c.ai.horizontal),()=>{const Gi=ft.verticalTextBox;return g.allowVerticalPlacement&&st.numVerticalGlyphVertices>0&&Gi?qi(Gi,c.ai.vertical):{box:null,offscreen:null}}),Li(Ur&&Ur.placeable)}else{let qi=c.ar[(Qt=(jr=this.prevPlacement)===null||jr===void 0?void 0:jr.variableOffsets[st.crossTileID])===null||Qt===void 0?void 0:Qt.anchor];const Gi=(Xr,Ks,zu)=>{const wi=Xr.x2-Xr.x1,bf=Xr.y2-Xr.y1,Hl=st.textBoxScale,Wl=gt&&Ie==="never"?Ks:null;let Ho=null,xf=ne==="never"?1:2,Lu="never";qi&&xf++;for(let Du=0;DuGi(Xs,ft.iconBox,c.ai.horizontal),()=>{const Xr=ft.verticalTextBox;return g.allowVerticalPlacement&&(!Ur||!Ur.placeable)&&st.numVerticalGlyphVertices>0&&Xr?Gi(Xr,ft.verticalIconBox,c.ai.vertical):{box:null,occluded:!0,offscreen:null}}),Ur&&(ar=Ur.placeable,ji=Ur.offscreen);const Ii=Li(Ur&&Ur.placeable);if(!ar&&this.prevPlacement){const Xr=this.prevPlacement.variableOffsets[st.crossTileID];Xr&&(this.variableOffsets[st.crossTileID]=Xr,this.markUsedJustification(g,Xr.anchor,st,Ii))}}}if(en=Ur,ar=en&&en.placeable,ji=en&&en.offscreen,st.useRuntimeCollisionCircles){const Li=g.text.placedSymbolArray.get(st.centerJustifiedTextSymbolIndex),Un=c.aj(g.textSizeData,se,Li),Zo=b.get("text-padding");Vi=this.collisionIndex.placeCollisionCircles(ne,Li,g.lineVertexArray,g.glyphOffsetArray,Un,C,L,$,O,p,Je,re.predicate,st.collisionCircleDiameter,Zo,E,Et),Vi.circles.length&&Vi.collisionDetected&&!p&&c.w("Collisions detected, but collision boxes are not shown"),ar=xe||Vi.circles.length>0&&!Vi.collisionDetected,ji=ji&&Vi.offscreen}if(ft.iconFeatureIndex&&(Gl=ft.iconFeatureIndex),ft.iconBox){const Li=Un=>this.collisionIndex.placeCollisionBox(Un,Ie,H,C,L,Je,je,I,re.predicate,Et,gt&&jn?jn:void 0);fn&&fn.placeable&&ft.verticalIconBox?(Ui=Li(ft.verticalIconBox),Vr=Ui.placeable):(Ui=Li(ft.iconBox),Vr=Ui.placeable),ji=ji&&Ui.offscreen}const bs=ue||st.numHorizontalGlyphVertices===0&&st.numVerticalGlyphVertices===0,Zl=ye||st.numIconVertices===0;bs||Zl?Zl?bs||(Vr=Vr&&ar):ar=Vr&&ar:Vr=ar=Vr&&ar;const Au=Vr&&Ui.placeable;if(ar&&en.placeable&&this.collisionIndex.insertCollisionBox(en.box,ne,b.get("text-ignore-placement"),g.bucketInstanceId,fn&&fn.placeable&&vs?vs:Vn,re.ID),Au&&this.collisionIndex.insertCollisionBox(Ui.box,Ie,b.get("icon-ignore-placement"),g.bucketInstanceId,Gl,re.ID),Vi&&ar&&this.collisionIndex.insertCollisionCircles(Vi.circles,ne,b.get("text-ignore-placement"),g.bucketInstanceId,Vn,re.ID),p&&this.storeCollisionData(g.bucketInstanceId,jt,ft,en,Ui,Vi),st.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(g.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[st.crossTileID]=new di(ar||Qe,Vr||it,ji||g.justReloaded),h[st.crossTileID]=!0};if(yt){if(i.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const st=g.getSortedSymbolIndexes(this.transform.angle);for(let ft=st.length-1;ft>=0;--ft){const jt=st[ft];Ut(g.symbolInstances.get(jt),g.collisionArrays[jt],jt)}}else for(let st=i.symbolInstanceStart;st=0&&(i.text.placedSymbolArray.get(I).crossTileID=b>=0&&I!==b?0:p.crossTileID)}markUsedOrientation(i,h,p){const g=h===c.ai.horizontal||h===c.ai.horizontalOnly?h:0,b=h===c.ai.vertical?h:0,E=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];for(const I of E)i.text.placedSymbolArray.get(I).placedOrientation=g;p.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(p.verticalPlacedTextSymbolIndex).placedOrientation=b)}commit(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let p=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const g=h?h.symbolFadeChange(i):1,b=h?h.opacities:{},E=h?h.variableOffsets:{},I=h?h.placedOrientations:{};for(const C in this.placements){const L=this.placements[C],$=b[C];$?(this.opacities[C]=new ri($,g,L.text,L.icon),p=p||L.text!==$.text.placed||L.icon!==$.icon.placed):(this.opacities[C]=new ri(null,g,L.text,L.icon,L.skipFade),p=p||L.text||L.icon)}for(const C in b){const L=b[C];if(!this.opacities[C]){const $=new ri(L,g,!1,!1);$.isHidden()||(this.opacities[C]=$,p=p||L.text.placed||L.icon.placed)}}for(const C in E)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=E[C]);for(const C in I)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=I[C]);if(h&&h.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");p?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:i)}updateLayerOpacities(i,h){const p={};for(const g of h){const b=g.getBucket(i);b&&g.latestFeatureIndex&&i.id===b.layerIds[0]&&this.updateBucketOpacities(b,g.tileID,p,g.collisionBoxArray)}}updateBucketOpacities(i,h,p,g){i.hasTextData()&&(i.text.opacityVertexArray.clear(),i.text.hasVisibleVertices=!1),i.hasIconData()&&(i.icon.opacityVertexArray.clear(),i.icon.hasVisibleVertices=!1),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();const b=i.layers[0],E=b.layout,I=new ri(null,0,!1,!1,!0),C=E.get("text-allow-overlap"),L=E.get("icon-allow-overlap"),$=b._unevaluatedLayout.hasValue("text-variable-anchor")||b._unevaluatedLayout.hasValue("text-variable-anchor-offset"),O=E.get("text-rotation-alignment")==="map",H=E.get("text-pitch-alignment")==="map",K=E.get("icon-text-fit")!=="none",te=new ri(null,0,C&&(L||!i.hasIconData()||E.get("icon-optional")),L&&(C||!i.hasTextData()||E.get("text-optional")),!0);!i.collisionArrays&&g&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(g);const se=(ue,ye,ne)=>{for(let xe=0;xe0,Je=this.placedOrientations[ye.crossTileID],gt=Je===c.ai.vertical,yt=Je===c.ai.horizontal||Je===c.ai.horizontalOnly;if(ne>0||xe>0){const it=Sn(Ce.text);se(i.text,ne,gt?Ni:it),se(i.text,xe,yt?Ni:it);const Et=Ce.text.isHidden();[ye.rightJustifiedTextSymbolIndex,ye.centerJustifiedTextSymbolIndex,ye.leftJustifiedTextSymbolIndex].forEach(ft=>{ft>=0&&(i.text.placedSymbolArray.get(ft).hidden=Et||gt?1:0)}),ye.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ye.verticalPlacedTextSymbolIndex).hidden=Et||yt?1:0);const Ut=this.variableOffsets[ye.crossTileID];Ut&&this.markUsedJustification(i,Ut.anchor,ye,Je);const st=this.placedOrientations[ye.crossTileID];st&&(this.markUsedJustification(i,"left",ye,st),this.markUsedOrientation(i,st,ye))}if(je){const it=Sn(Ce.icon),Et=!(K&&ye.verticalPlacedIconSymbolIndex&>);ye.placedIconSymbolIndex>=0&&(se(i.icon,ye.numIconVertices,Et?it:Ni),i.icon.placedSymbolArray.get(ye.placedIconSymbolIndex).hidden=Ce.icon.isHidden()),ye.verticalPlacedIconSymbolIndex>=0&&(se(i.icon,ye.numVerticalIconVertices,Et?Ni:it),i.icon.placedSymbolArray.get(ye.verticalPlacedIconSymbolIndex).hidden=Ce.icon.isHidden())}const Qe=re&&re.has(ue)?re.get(ue):{text:null,icon:null};if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){const it=i.collisionArrays[ue];if(it){let Et=new c.P(0,0);if(it.textBox||it.verticalTextBox){let Ut=!0;if($){const st=this.variableOffsets[Ie];st?(Et=xi(st.anchor,st.width,st.height,st.textOffset,st.textBoxScale),O&&Et._rotate(H?this.transform.angle:-this.transform.angle)):Ut=!1}if(it.textBox||it.verticalTextBox){let st;it.textBox&&(st=gt),it.verticalTextBox&&(st=yt),$i(i.textCollisionBox.collisionVertexArray,Ce.text.placed,!Ut||st,Qe.text,Et.x,Et.y)}}if(it.iconBox||it.verticalIconBox){const Ut=!!(!yt&&it.verticalIconBox);let st;it.iconBox&&(st=Ut),it.verticalIconBox&&(st=!Ut),$i(i.iconCollisionBox.collisionVertexArray,Ce.icon.placed,st,Qe.icon,K?Et.x:0,K?Et.y:0)}}}}if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.text.opacityVertexArray.length!==i.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${i.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${i.text.layoutVertexArray.length}) / 4`);if(i.icon.opacityVertexArray.length!==i.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${i.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${i.icon.layoutVertexArray.length}) / 4`);if(i.bucketInstanceId in this.collisionCircleArrays){const ue=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=ue.invProjMatrix,i.placementViewportMatrix=ue.viewportMatrix,i.collisionCircleArray=ue.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}}symbolFadeChange(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(i){return Math.max(0,(this.transform.zoom-i)/1.5)}hasTransitions(i){return this.stale||i-this.lastPlacementChangeTimei}setStale(){this.stale=!0}}function $i(v,i,h,p,g,b){p&&p.length!==0||(p=[0,0,0,0]);const E=p[0]-Kt,I=p[1]-Kt,C=p[2]-Kt,L=p[3]-Kt;v.emplaceBack(i?1:0,h?1:0,g||0,b||0,E,I),v.emplaceBack(i?1:0,h?1:0,g||0,b||0,C,I),v.emplaceBack(i?1:0,h?1:0,g||0,b||0,C,L),v.emplaceBack(i?1:0,h?1:0,g||0,b||0,E,L)}const Ma=Math.pow(2,25),kr=Math.pow(2,24),Oc=Math.pow(2,17),$c=Math.pow(2,16),xn=Math.pow(2,9),wn=Math.pow(2,8),pp=Math.pow(2,1);function Sn(v){if(v.opacity===0&&!v.placed)return 0;if(v.opacity===1&&v.placed)return 4294967295;const i=v.placed?1:0,h=Math.floor(127*v.opacity);return h*Ma+i*kr+h*Oc+i*$c+h*xn+i*wn+h*pp+i}const Ni=0;function ml(){return{isOccluded:(v,i,h)=>!1,getPitchedTextCorrection:(v,i,h)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(v,i,h,p){throw new Error("Not implemented.")},translatePosition:(v,i,h,p)=>function(g,b,E,I,C=!1){if(!E[0]&&!E[1])return[0,0];const L=C?I==="map"?g.angle:0:I==="viewport"?-g.angle:0;if(L){const $=Math.sin(L),O=Math.cos(L);E=[E[0]*O-E[1]*$,E[0]*$+E[1]*O]}return[C?E[0]:Xt(b,E[0],g.zoom),C?E[1]:Xt(b,E[1],g.zoom)]}(v,i,h,p),getCircleRadiusCorrection:v=>1}}class Ia{constructor(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&!i.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(i,h,p,g,b){const E=this._bucketParts;for(;this._currentTileIndexI.sortKey-C.sortKey));this._currentPartIndex!this._forceFullPlacement&&k.now()-g>2;for(;this._currentPlacementIndex>=0;){const E=h[i[this._currentPlacementIndex]],I=this.placement.collisionIndex.transform.zoom;if(E.type==="symbol"&&(!E.minzoom||E.minzoom<=I)&&(!E.maxzoom||E.maxzoom>I)){if(this._inProgressLayer||(this._inProgressLayer=new Ia(E)),this._inProgressLayer.continuePlacement(p[E.source],this.placement,this._showCollisionBoxes,E,b))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(i){return this.placement.commit(i),this.placement}}const ko=512/c.X/2;class cs{constructor(i,h,p){this.tileID=i,this.bucketInstanceId=p,this._symbolsByKey={};const g=new Map;for(let b=0;b({x:Math.floor(C.anchorX*ko),y:Math.floor(C.anchorY*ko)})),crossTileIDs:E.map(C=>C.crossTileID)};if(I.positions.length>128){const C=new c.aw(I.positions.length,16,Uint16Array);for(const{x:L,y:$}of I.positions)C.add(L,$);C.finish(),delete I.positions,I.index=C}this._symbolsByKey[b]=I}}getScaledCoordinates(i,h){const{x:p,y:g,z:b}=this.tileID.canonical,{x:E,y:I,z:C}=h.canonical,L=ko/Math.pow(2,C-b),$=(I*c.X+i.anchorY)*L,O=g*c.X*ko;return{x:Math.floor((E*c.X+i.anchorX)*L-p*c.X*ko),y:Math.floor($-O)}}findMatches(i,h,p){const g=this.tileID.canonical.zi)}}class ci{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class gl{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(i){const h=Math.round((i-this.lng)/360);if(h!==0)for(const p in this.indexes){const g=this.indexes[p],b={};for(const E in g){const I=g[E];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+h),b[I.tileID.key]=I}this.indexes[p]=b}this.lng=i}addBucket(i,h,p){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(let b=0;bi.overscaledZ)for(const I in E){const C=E[I];C.tileID.isChildOf(i)&&C.findMatches(h.symbolInstances,i,g)}else{const I=E[i.scaledTo(Number(b)).key];I&&I.findMatches(h.symbolInstances,i,g)}}for(let b=0;b{h[p]=!0});for(const p in this.layerIndexes)h[p]||delete this.layerIndexes[p]}}const Ta=(v,i)=>c.t(v,i&&i.filter(h=>h.identifier!=="source.canvas")),No=c.ax();class Nc extends c.E{constructor(i,h={}){super(),this._rtlPluginLoaded=()=>{for(const p in this.sourceCaches){const g=this.sourceCaches[p].getSource().type;g!=="vector"&&g!=="geojson"||this.sourceCaches[p].reload()}},this.map=i,this.dispatcher=new cr(ni(),i._getMapId()),this.dispatcher.registerMessageHandler("GG",(p,g)=>this.getGlyphs(p,g)),this.dispatcher.registerMessageHandler("GI",(p,g)=>this.getImages(p,g)),this.imageManager=new at,this.imageManager.setEventedParent(this),this.glyphManager=new Ue(i._requestManager,h.localIdeographFontFamily),this.lineAtlas=new wr(256,512),this.crossTileSymbolIndex=new Dn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",c.az()),no().on(nt,this._rtlPluginLoaded),this.on("data",p=>{if(p.dataType!=="source"||p.sourceDataType!=="metadata")return;const g=this.sourceCaches[p.sourceId];if(!g)return;const b=g.getSource();if(b&&b.vectorLayerIds)for(const E in this._layers){const I=this._layers[E];I.source===b.id&&this._validateLayer(I)}})}loadURL(i,h={},p){this.fire(new c.k("dataloading",{dataType:"style"})),h.validate=typeof h.validate!="boolean"||h.validate;const g=this.map._requestManager.transformRequest(i,"Style");this._loadStyleRequest=new AbortController,c.h(g,this._loadStyleRequest).then(b=>{this._loadStyleRequest=null,this._load(b.data,h,p)}).catch(b=>{this._loadStyleRequest=null,b&&this.fire(new c.j(b))})}loadJSON(i,h={},p){this.fire(new c.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,k.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,h.validate=h.validate!==!1,this._load(i,h,p)}).catch(()=>{})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(No,{validate:!1})}_load(i,h,p){var g;const b=h.transformStyle?h.transformStyle(p,i):i;if(!h.validate||!Ta(this,c.x(b))){this._loaded=!0,this.stylesheet=b;for(const E in b.sources)this.addSource(E,b.sources[E],{validate:!1});b.sprite?this._loadSprite(b.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(b.glyphs),this._createLayers(),this.light=new Gt(this.stylesheet.light),this.sky=new Jt(this.stylesheet.sky),this.map.setTerrain((g=this.stylesheet.terrain)!==null&&g!==void 0?g:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const i=c.aA(this.stylesheet.layers);this.dispatcher.broadcast("SL",i),this._order=i.map(h=>h.id),this._layers={},this._serializedLayers=null;for(const h of i){const p=c.aB(h);p.setEventedParent(this,{layer:{id:h.id}}),this._layers[h.id]=p}}_loadSprite(i,h=!1,p=void 0){let g;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(b,E,I,C){return c._(this,void 0,void 0,function*(){const L=$e(b),$=I>1?"@2x":"",O={},H={};for(const{id:K,url:te}of L){const se=E.transformRequest(Ye(te,$,".json"),"SpriteJSON");O[K]=c.h(se,C);const re=E.transformRequest(Ye(te,$,".png"),"SpriteImage");H[K]=V.getImage(re,C)}return yield Promise.all([...Object.values(O),...Object.values(H)]),function(K,te){return c._(this,void 0,void 0,function*(){const se={};for(const re in K){se[re]={};const ue=k.getImageCanvasContext((yield te[re]).data),ye=(yield K[re]).data;for(const ne in ye){const{width:xe,height:Ie,x:Ce,y:je,sdf:Je,pixelRatio:gt,stretchX:yt,stretchY:Qe,content:it,textFitWidth:Et,textFitHeight:Ut}=ye[ne];se[re][ne]={data:null,pixelRatio:gt,sdf:Je,stretchX:yt,stretchY:Qe,content:it,textFitWidth:Et,textFitHeight:Ut,spriteData:{width:xe,height:Ie,x:Ce,y:je,context:ue}}}}return se})}(O,H)})}(i,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(b=>{if(this._spriteRequest=null,b)for(const E in b){this._spritesImagesIds[E]=[];const I=this._spritesImagesIds[E]?this._spritesImagesIds[E].filter(C=>!(C in b)):[];for(const C of I)this.imageManager.removeImage(C),this._changedImages[C]=!0;for(const C in b[E]){const L=E==="default"?C:`${E}:${C}`;this._spritesImagesIds[E].push(L),L in this.imageManager.images?this.imageManager.updateImage(L,b[E][C],!1):this.imageManager.addImage(L,b[E][C]),h&&(this._changedImages[L]=!0)}}}).catch(b=>{this._spriteRequest=null,g=b,this.fire(new c.j(g))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),p&&p(g)})}_unloadSprite(){for(const i of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(i),this._changedImages[i]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(i){const h=this.sourceCaches[i.source];if(!h)return;const p=i.sourceLayer;if(!p)return;const g=h.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(p)===-1)&&this.fire(new c.j(new Error(`Source layer "${p}" does not exist on source "${g.id}" as specified by style layer "${i.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const i in this.sourceCaches)if(!this.sourceCaches[i].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(i){const h=this._serializedAllLayers();if(!i||i.length===0)return Object.values(h);const p=[];for(const g of i)h[g]&&p.push(h[g]);return p}_serializedAllLayers(){let i=this._serializedLayers;if(i)return i;i=this._serializedLayers={};const h=Object.keys(this._layers);for(const p of h){const g=this._layers[p];g.type!=="custom"&&(i[p]=g.serialize())}return i}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const i in this.sourceCaches)if(this.sourceCaches[i].hasTransition())return!0;for(const i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(i){if(!this._loaded)return;const h=this._changed;if(h){const g=Object.keys(this._updatedLayers),b=Object.keys(this._removedLayers);(g.length||b.length)&&this._updateWorkerLayers(g,b);for(const E in this._updatedSources){const I=this._updatedSources[E];if(I==="reload")this._reloadSource(E);else{if(I!=="clear")throw new Error(`Invalid action ${I}`);this._clearSource(E)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const E in this._updatedPaintProps)this._layers[E].updateTransitions(i);this.light.updateTransitions(i),this.sky.updateTransitions(i),this._resetUpdates()}const p={};for(const g in this.sourceCaches){const b=this.sourceCaches[g];p[g]=b.used,b.used=!1}for(const g of this._order){const b=this._layers[g];b.recalculate(i,this._availableImages),!b.isHidden(i.zoom)&&b.source&&(this.sourceCaches[b.source].used=!0)}for(const g in p){const b=this.sourceCaches[g];!!p[g]!=!!b.used&&b.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(i),this.sky.recalculate(i),this.z=i.zoom,h&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const i=Object.keys(this._changedImages);if(i.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],i);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const i in this.sourceCaches)this.sourceCaches[i].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(i,h){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(i),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(i,h={}){var p;this._checkLoaded();const g=this.serialize();if(i=h.transformStyle?h.transformStyle(g,i):i,((p=h.validate)===null||p===void 0||p)&&Ta(this,c.x(i)))return!1;(i=c.aC(i)).layers=c.aA(i.layers);const b=c.aD(g,i),E=this._getOperationsToPerform(b);if(E.unimplemented.length>0)throw new Error(`Unimplemented: ${E.unimplemented.join(", ")}.`);if(E.operations.length===0)return!1;for(const I of E.operations)I();return this.stylesheet=i,this._serializedLayers=null,!0}_getOperationsToPerform(i){const h=[],p=[];for(const g of i)switch(g.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":h.push(()=>this.addLayer.apply(this,g.args));break;case"removeLayer":h.push(()=>this.removeLayer.apply(this,g.args));break;case"setPaintProperty":h.push(()=>this.setPaintProperty.apply(this,g.args));break;case"setLayoutProperty":h.push(()=>this.setLayoutProperty.apply(this,g.args));break;case"setFilter":h.push(()=>this.setFilter.apply(this,g.args));break;case"addSource":h.push(()=>this.addSource.apply(this,g.args));break;case"removeSource":h.push(()=>this.removeSource.apply(this,g.args));break;case"setLayerZoomRange":h.push(()=>this.setLayerZoomRange.apply(this,g.args));break;case"setLight":h.push(()=>this.setLight.apply(this,g.args));break;case"setGeoJSONSourceData":h.push(()=>this.setGeoJSONSourceData.apply(this,g.args));break;case"setGlyphs":h.push(()=>this.setGlyphs.apply(this,g.args));break;case"setSprite":h.push(()=>this.setSprite.apply(this,g.args));break;case"setSky":h.push(()=>this.setSky.apply(this,g.args));break;case"setTerrain":h.push(()=>this.map.setTerrain.apply(this,g.args));break;case"setTransition":h.push(()=>{});break;default:p.push(g.command)}return{operations:h,unimplemented:p}}addImage(i,h){if(this.getImage(i))return this.fire(new c.j(new Error(`An image named "${i}" already exists.`)));this.imageManager.addImage(i,h),this._afterImageUpdated(i)}updateImage(i,h){this.imageManager.updateImage(i,h)}getImage(i){return this.imageManager.getImage(i)}removeImage(i){if(!this.getImage(i))return this.fire(new c.j(new Error(`An image named "${i}" does not exist.`)));this.imageManager.removeImage(i),this._afterImageUpdated(i)}_afterImageUpdated(i){this._availableImages=this.imageManager.listImages(),this._changedImages[i]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(i,h,p={}){if(this._checkLoaded(),this.sourceCaches[i]!==void 0)throw new Error(`Source "${i}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(c.x.source,`sources.${i}`,h,null,p))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const g=this.sourceCaches[i]=new Nt(i,h,this.dispatcher);g.style=this,g.setEventedParent(this,()=>({isSourceLoaded:g.loaded(),source:g.serialize(),sourceId:i})),g.onAdd(this.map),this._changed=!0}removeSource(i){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error("There is no source with this ID");for(const p in this._layers)if(this._layers[p].source===i)return this.fire(new c.j(new Error(`Source "${i}" cannot be removed while layer "${p}" is using it.`)));const h=this.sourceCaches[i];delete this.sourceCaches[i],delete this._updatedSources[i],h.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:i})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(i,h){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error(`There is no source with this ID=${i}`);const p=this.sourceCaches[i].getSource();if(p.type!=="geojson")throw new Error(`geojsonSource.type is ${p.type}, which is !== 'geojson`);p.setData(h),this._changed=!0}getSource(i){return this.sourceCaches[i]&&this.sourceCaches[i].getSource()}addLayer(i,h,p={}){this._checkLoaded();const g=i.id;if(this.getLayer(g))return void this.fire(new c.j(new Error(`Layer "${g}" already exists on this map.`)));let b;if(i.type==="custom"){if(Ta(this,c.aE(i)))return;b=c.aB(i)}else{if("source"in i&&typeof i.source=="object"&&(this.addSource(g,i.source),i=c.aC(i),i=c.e(i,{source:g})),this._validate(c.x.layer,`layers.${g}`,i,{arrayIndex:-1},p))return;b=c.aB(i),this._validateLayer(b),b.setEventedParent(this,{layer:{id:g}})}const E=h?this._order.indexOf(h):this._order.length;if(h&&E===-1)this.fire(new c.j(new Error(`Cannot add layer "${g}" before non-existing layer "${h}".`)));else{if(this._order.splice(E,0,g),this._layerOrderChanged=!0,this._layers[g]=b,this._removedLayers[g]&&b.source&&b.type!=="custom"){const I=this._removedLayers[g];delete this._removedLayers[g],I.type!==b.type?this._updatedSources[b.source]="clear":(this._updatedSources[b.source]="reload",this.sourceCaches[b.source].pause())}this._updateLayer(b),b.onAdd&&b.onAdd(this.map)}}moveLayer(i,h){if(this._checkLoaded(),this._changed=!0,!this._layers[i])return void this.fire(new c.j(new Error(`The layer '${i}' does not exist in the map's style and cannot be moved.`)));if(i===h)return;const p=this._order.indexOf(i);this._order.splice(p,1);const g=h?this._order.indexOf(h):this._order.length;h&&g===-1?this.fire(new c.j(new Error(`Cannot move layer "${i}" before non-existing layer "${h}".`))):(this._order.splice(g,0,i),this._layerOrderChanged=!0)}removeLayer(i){this._checkLoaded();const h=this._layers[i];if(!h)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${i}".`)));h.setEventedParent(null);const p=this._order.indexOf(i);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[i]=h,delete this._layers[i],this._serializedLayers&&delete this._serializedLayers[i],delete this._updatedLayers[i],delete this._updatedPaintProps[i],h.onRemove&&h.onRemove(this.map)}getLayer(i){return this._layers[i]}getLayersOrder(){return[...this._order]}hasLayer(i){return i in this._layers}setLayerZoomRange(i,h,p){this._checkLoaded();const g=this.getLayer(i);g?g.minzoom===h&&g.maxzoom===p||(h!=null&&(g.minzoom=h),p!=null&&(g.maxzoom=p),this._updateLayer(g)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${i}".`)))}setFilter(i,h,p={}){this._checkLoaded();const g=this.getLayer(i);if(g){if(!c.aF(g.filter,h))return h==null?(g.filter=void 0,void this._updateLayer(g)):void(this._validate(c.x.filter,`layers.${g.id}.filter`,h,null,p)||(g.filter=c.aC(h),this._updateLayer(g)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${i}".`)))}getFilter(i){return c.aC(this.getLayer(i).filter)}setLayoutProperty(i,h,p,g={}){this._checkLoaded();const b=this.getLayer(i);b?c.aF(b.getLayoutProperty(h),p)||(b.setLayoutProperty(h,p,g),this._updateLayer(b)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${i}".`)))}getLayoutProperty(i,h){const p=this.getLayer(i);if(p)return p.getLayoutProperty(h);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${i}".`)))}setPaintProperty(i,h,p,g={}){this._checkLoaded();const b=this.getLayer(i);b?c.aF(b.getPaintProperty(h),p)||(b.setPaintProperty(h,p,g)&&this._updateLayer(b),this._changed=!0,this._updatedPaintProps[i]=!0,this._serializedLayers=null):this.fire(new c.j(new Error(`Cannot style non-existing layer "${i}".`)))}getPaintProperty(i,h){return this.getLayer(i).getPaintProperty(h)}setFeatureState(i,h){this._checkLoaded();const p=i.source,g=i.sourceLayer,b=this.sourceCaches[p];if(b===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const E=b.getSource().type;E==="geojson"&&g?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):E!=="vector"||g?(i.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),b.setFeatureState(g,i.id,h)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(i,h){this._checkLoaded();const p=i.source,g=this.sourceCaches[p];if(g===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const b=g.getSource().type,E=b==="vector"?i.sourceLayer:void 0;b!=="vector"||E?h&&typeof i.id!="string"&&typeof i.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(E,i.id,h):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(i){this._checkLoaded();const h=i.source,p=i.sourceLayer,g=this.sourceCaches[h];if(g!==void 0)return g.getSource().type!=="vector"||p?(i.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),g.getFeatureState(p,i.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const i=c.aG(this.sourceCaches,b=>b.serialize()),h=this._serializeByIds(this._order),p=this.map.getTerrain()||void 0,g=this.stylesheet;return c.aH({version:g.version,name:g.name,metadata:g.metadata,light:g.light,sky:g.sky,center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch,sprite:g.sprite,glyphs:g.glyphs,transition:g.transition,sources:i,layers:h,terrain:p},b=>b!==void 0)}_updateLayer(i){this._updatedLayers[i.id]=!0,i.source&&!this._updatedSources[i.source]&&this.sourceCaches[i.source].getSource().type!=="raster"&&(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(i){const h=E=>this._layers[E].type==="fill-extrusion",p={},g=[];for(let E=this._order.length-1;E>=0;E--){const I=this._order[E];if(h(I)){p[I]=E;for(const C of i){const L=C[I];if(L)for(const $ of L)g.push($)}}}g.sort((E,I)=>I.intersectionZ-E.intersectionZ);const b=[];for(let E=this._order.length-1;E>=0;E--){const I=this._order[E];if(h(I))for(let C=g.length-1;C>=0;C--){const L=g[C].feature;if(p[L.layer.id]{const Je=ue.featureSortOrder;if(Je){const gt=Je.indexOf(Ce.featureIndex);return Je.indexOf(je.featureIndex)-gt}return je.featureIndex-Ce.featureIndex});for(const Ce of Ie)xe.push(Ce)}}for(const ue in te)te[ue].forEach(ye=>{const ne=ye.feature,xe=L[I[ue].source].getFeatureState(ne.layer["source-layer"],ne.id);ne.source=ne.layer.source,ne.layer["source-layer"]&&(ne.sourceLayer=ne.layer["source-layer"]),ne.state=xe});return te}(this._layers,E,this.sourceCaches,i,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(b)}querySourceFeatures(i,h){h&&h.filter&&this._validate(c.x.filter,"querySourceFeatures.filter",h.filter,null,h);const p=this.sourceCaches[i];return p?function(g,b){const E=g.getRenderableIds().map(L=>g.getTileByID(L)),I=[],C={};for(let L=0;LH.getTileByID(K)).sort((K,te)=>te.tileID.overscaledZ-K.tileID.overscaledZ||(K.tileID.isLessThan(te.tileID)?-1:1))}const O=this.crossTileSymbolIndex.addLayer($,C[$.source],i.center.lng);E=E||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((b=b||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(k.now(),i.zoom))&&(this.pauseablePlacement=new pi(i,this.map.terrain,this._order,b,h,p,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(k.now()),I=!0),E&&this.pauseablePlacement.placement.setStale()),I||E)for(const L of this._order){const $=this._layers[L];$.type==="symbol"&&this.placement.updateLayerOpacities($,C[$.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(k.now())}_releaseSymbolFadeTiles(){for(const i in this.sourceCaches)this.sourceCaches[i].releaseSymbolFadeTiles()}getImages(i,h){return c._(this,void 0,void 0,function*(){const p=yield this.imageManager.getImages(h.icons);this._updateTilesForChangedImages();const g=this.sourceCaches[h.source];return g&&g.setDependencies(h.tileID.key,h.type,h.icons),p})}getGlyphs(i,h){return c._(this,void 0,void 0,function*(){const p=yield this.glyphManager.getGlyphs(h.stacks),g=this.sourceCaches[h.source];return g&&g.setDependencies(h.tileID.key,h.type,[""]),p})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(i,h={}){this._checkLoaded(),i&&this._validate(c.x.glyphs,"glyphs",i,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=i,this.glyphManager.entries={},this.glyphManager.setURL(i))}addSprite(i,h,p={},g){this._checkLoaded();const b=[{id:i,url:h}],E=[...$e(this.stylesheet.sprite),...b];this._validate(c.x.sprite,"sprite",E,null,p)||(this.stylesheet.sprite=E,this._loadSprite(b,!0,g))}removeSprite(i){this._checkLoaded();const h=$e(this.stylesheet.sprite);if(h.find(p=>p.id===i)){if(this._spritesImagesIds[i])for(const p of this._spritesImagesIds[i])this.imageManager.removeImage(p),this._changedImages[p]=!0;h.splice(h.findIndex(p=>p.id===i),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[i],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${i}" doesn't exists on this map.`)))}getSprite(){return $e(this.stylesheet.sprite)}setSprite(i,h={},p){this._checkLoaded(),i&&this._validate(c.x.sprite,"sprite",i,null,h)||(this.stylesheet.sprite=i,i?this._loadSprite(i,!0,p):(this._unloadSprite(),p&&p(null)))}}var Ca=c.Y([{name:"a_pos",type:"Int16",components:2}]);const jo={prelude:_r(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -577,11 +577,11 @@ uniform ${$} ${O} u_${H}; #endif `}),staticAttributes:p,staticUniforms:E}}class yl{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(i,h,p,g,b,E,I,C,L){this.context=i;let $=this.boundPaintVertexBuffers.length!==g.length;for(let O=0;!$&&O({u_matrix:v,u_texture:0,u_ele_delta:i,u_fog_matrix:h,u_fog_color:p?p.properties.get("fog-color"):c.aN.white,u_fog_ground_blend:p?p.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:p?p.calculateFogBlendOpacity(g):0,u_horizon_color:p?p.properties.get("horizon-color"):c.aN.white,u_horizon_fog_blend:p?p.properties.get("horizon-fog-blend"):1});function Aa(v){const i=[];for(let h=0;h({u_depth:new c.aI(Ce,je.u_depth),u_terrain:new c.aI(Ce,je.u_terrain),u_terrain_dim:new c.aJ(Ce,je.u_terrain_dim),u_terrain_matrix:new c.aK(Ce,je.u_terrain_matrix),u_terrain_unpack:new c.aL(Ce,je.u_terrain_unpack),u_terrain_exaggeration:new c.aJ(Ce,je.u_terrain_exaggeration)}))(i,Ie),this.binderUniforms=p?p.getUniforms(i,Ie):[]}draw(i,h,p,g,b,E,I,C,L,$,O,H,K,te,se,re,ue,ye){const ne=i.gl;if(this.failedToCreate)return;if(i.program.set(this.program),i.setDepthMode(p),i.setStencilMode(g),i.setColorMode(b),i.setCullFace(E),C){i.activeTexture.set(ne.TEXTURE2),ne.bindTexture(ne.TEXTURE_2D,C.depthTexture),i.activeTexture.set(ne.TEXTURE3),ne.bindTexture(ne.TEXTURE_2D,C.texture);for(const Ie in this.terrainUniforms)this.terrainUniforms[Ie].set(C[Ie])}for(const Ie in this.fixedUniforms)this.fixedUniforms[Ie].set(I[Ie]);se&&se.setUniforms(i,this.binderUniforms,K,{zoom:te});let xe=0;switch(h){case ne.LINES:xe=2;break;case ne.TRIANGLES:xe=3;break;case ne.LINE_STRIP:xe=1}for(const Ie of H.get()){const Ce=Ie.vaos||(Ie.vaos={});(Ce[L]||(Ce[L]=new yl)).bind(i,this,$,se?se.getPaintVertexBuffers():[],O,Ie.vertexOffset,re,ue,ye),ne.drawElements(h,Ie.primitiveLength*xe,ne.UNSIGNED_SHORT,Ie.primitiveOffset*xe*2)}}}function vl(v,i,h){const p=1/Xt(h,1,i.transform.tileZoom),g=Math.pow(2,h.tileID.overscaledZ),b=h.tileSize*Math.pow(2,i.transform.tileZoom)/g,E=b*(h.tileID.canonical.x+h.tileID.wrap*g),I=b*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[p,v.fromScale,v.toScale],u_fade:v.t,u_pixel_coord_upper:[E>>16,I>>16],u_pixel_coord_lower:[65535&E,65535&I]}}const bl=(v,i,h,p)=>{const g=i.style.light,b=g.properties.get("position"),E=[b.x,b.y,b.z],I=function(){var L=new c.A(9);return c.A!=Float32Array&&(L[1]=0,L[2]=0,L[3]=0,L[5]=0,L[6]=0,L[7]=0),L[0]=1,L[4]=1,L[8]=1,L}();g.properties.get("anchor")==="viewport"&&function(L,$){var O=Math.sin($),H=Math.cos($);L[0]=H,L[1]=O,L[2]=0,L[3]=-O,L[4]=H,L[5]=0,L[6]=0,L[7]=0,L[8]=1}(I,-i.transform.angle),function(L,$,O){var H=$[0],K=$[1],te=$[2];L[0]=H*O[0]+K*O[3]+te*O[6],L[1]=H*O[1]+K*O[4]+te*O[7],L[2]=H*O[2]+K*O[5]+te*O[8]}(E,E,I);const C=g.properties.get("color");return{u_matrix:v,u_lightpos:E,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[C.r,C.g,C.b],u_vertical_gradient:+h,u_opacity:p}},xl=(v,i,h,p,g,b,E)=>c.e(bl(v,i,h,p),vl(b,i,E),{u_height_factor:-Math.pow(2,g.overscaledZ)/E.tileSize/8}),za=v=>({u_matrix:v}),Os=(v,i,h,p)=>c.e(za(v),vl(h,i,p)),mp=(v,i)=>({u_matrix:v,u_world:i}),gp=(v,i,h,p,g)=>c.e(Os(v,i,h,p),{u_world:g}),Oh=(v,i,h,p)=>{const g=v.transform;let b,E;if(p.paint.get("circle-pitch-alignment")==="map"){const I=Xt(h,1,g.zoom);b=!0,E=[I,I]}else b=!1,E=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(p.paint.get("circle-pitch-scale")==="map"),u_matrix:v.translatePosMatrix(i.posMatrix,h,p.paint.get("circle-translate"),p.paint.get("circle-translate-anchor")),u_pitch_with_map:+b,u_device_pixel_ratio:v.pixelRatio,u_extrude_scale:E}},yp=(v,i,h)=>({u_matrix:v,u_inv_matrix:i,u_camera_to_center_distance:h.cameraToCenterDistance,u_viewport_size:[h.width,h.height]}),Vo=(v,i,h=1)=>({u_matrix:v,u_color:i,u_overlay:0,u_overlay_scale:h}),La=v=>({u_matrix:v}),kn=(v,i,h,p)=>({u_matrix:v,u_extrude_scale:Xt(i,1,h),u_intensity:p});function En(v,i){const h=Math.pow(2,i.canonical.z),p=i.canonical.y;return[new c.Z(0,p/h).toLngLat().lat,new c.Z(0,(p+1)/h).toLngLat().lat]}const Da=(v,i,h,p)=>{const g=v.transform;return{u_matrix:jh(v,i,h,p),u_ratio:1/Xt(i,1,g.zoom),u_device_pixel_ratio:v.pixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},wl=(v,i,h,p,g)=>c.e(Da(v,i,h,g),{u_image:0,u_image_height:p}),$h=(v,i,h,p,g)=>{const b=v.transform,E=cs(i,b);return{u_matrix:jh(v,i,h,g),u_texsize:i.imageAtlasTexture.size,u_ratio:1/Xt(i,1,b.zoom),u_device_pixel_ratio:v.pixelRatio,u_image:0,u_scale:[E,p.fromScale,p.toScale],u_fade:p.t,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},Nh=(v,i,h,p,g,b)=>{const E=v.lineAtlas,I=cs(i,v.transform),C=h.layout.get("line-cap")==="round",L=E.getDash(p.from,C),$=E.getDash(p.to,C),O=L.width*g.fromScale,H=$.width*g.toScale;return c.e(Da(v,i,h,b),{u_patternscale_a:[I/O,-L.height/2],u_patternscale_b:[I/H,-$.height/2],u_sdfgamma:E.width/(256*Math.min(O,H)*v.pixelRatio)/2,u_image:0,u_tex_y_a:L.y,u_tex_y_b:$.y,u_mix:g.t})};function cs(v,i){return 1/Xt(v,1,i.tileZoom)}function jh(v,i,h,p){return v.translatePosMatrix(p?p.posMatrix:i.tileID.posMatrix,i,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const _p=(v,i,h,p,g)=>{return{u_matrix:v,u_tl_parent:i,u_scale_parent:h,u_buffer_scale:1,u_fade_t:p.mix,u_opacity:p.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(E=g.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(b=g.paint.get("raster-contrast"),b>0?1/(1-b):1+b),u_spin_weights:vp(g.paint.get("raster-hue-rotate"))};var b,E};function vp(v){v*=Math.PI/180;const i=Math.sin(v),h=Math.cos(v);return[(2*h+1)/3,(-Math.sqrt(3)*i-h+1)/3,(Math.sqrt(3)*i-h+1)/3]}const Vh=(v,i,h,p,g,b,E,I,C,L,$,O,H,K)=>{const te=E.transform;return{u_is_size_zoom_constant:+(v==="constant"||v==="source"),u_is_size_feature_constant:+(v==="constant"||v==="camera"),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:te.cameraToCenterDistance,u_pitch:te.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:te.width/te.height,u_fade_change:E.options.fadeDuration?E.symbolFadeChange:1,u_matrix:I,u_label_plane_matrix:C,u_coord_matrix:L,u_is_text:+O,u_pitch_with_map:+p,u_is_along_line:g,u_is_variable_anchor:b,u_texsize:H,u_texture:0,u_translation:$,u_pitched_scale:K}},Uh=(v,i,h,p,g,b,E,I,C,L,$,O,H,K,te)=>{const se=E.transform;return c.e(Vh(v,i,h,p,g,b,E,I,C,L,$,O,H,te),{u_gamma_scale:p?Math.cos(se._pitch)*se.cameraToCenterDistance:1,u_device_pixel_ratio:E.pixelRatio,u_is_halo:+K})},bp=(v,i,h,p,g,b,E,I,C,L,$,O,H,K)=>c.e(Uh(v,i,h,p,g,b,E,I,C,L,$,!0,O,!0,K),{u_texsize_icon:H,u_texture_icon:1}),Sl=(v,i,h)=>({u_matrix:v,u_opacity:i,u_color:h}),Vc=(v,i,h,p,g,b)=>c.e(function(E,I,C,L){const $=C.imageManager.getPattern(E.from.toString()),O=C.imageManager.getPattern(E.to.toString()),{width:H,height:K}=C.imageManager.getPixelSize(),te=Math.pow(2,L.tileID.overscaledZ),se=L.tileSize*Math.pow(2,C.transform.tileZoom)/te,re=se*(L.tileID.canonical.x+L.tileID.wrap*te),ue=se*L.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:$.tl,u_pattern_br_a:$.br,u_pattern_tl_b:O.tl,u_pattern_br_b:O.br,u_texsize:[H,K],u_mix:I.t,u_pattern_size_a:$.displaySize,u_pattern_size_b:O.displaySize,u_scale_a:I.fromScale,u_scale_b:I.toScale,u_tile_units_to_pixels:1/Xt(L,1,C.transform.tileZoom),u_pixel_coord_upper:[re>>16,ue>>16],u_pixel_coord_lower:[65535&re,65535&ue]}}(p,b,h,g),{u_matrix:v,u_opacity:i}),kl={fillExtrusion:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_lightpos:new c.aO(v,i.u_lightpos),u_lightintensity:new c.aJ(v,i.u_lightintensity),u_lightcolor:new c.aO(v,i.u_lightcolor),u_vertical_gradient:new c.aJ(v,i.u_vertical_gradient),u_opacity:new c.aJ(v,i.u_opacity)}),fillExtrusionPattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_lightpos:new c.aO(v,i.u_lightpos),u_lightintensity:new c.aJ(v,i.u_lightintensity),u_lightcolor:new c.aO(v,i.u_lightcolor),u_vertical_gradient:new c.aJ(v,i.u_vertical_gradient),u_height_factor:new c.aJ(v,i.u_height_factor),u_image:new c.aI(v,i.u_image),u_texsize:new c.aP(v,i.u_texsize),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade),u_opacity:new c.aJ(v,i.u_opacity)}),fill:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix)}),fillPattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_image:new c.aI(v,i.u_image),u_texsize:new c.aP(v,i.u_texsize),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade)}),fillOutline:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_world:new c.aP(v,i.u_world)}),fillOutlinePattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_world:new c.aP(v,i.u_world),u_image:new c.aI(v,i.u_image),u_texsize:new c.aP(v,i.u_texsize),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade)}),circle:(v,i)=>({u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_scale_with_map:new c.aI(v,i.u_scale_with_map),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_extrude_scale:new c.aP(v,i.u_extrude_scale),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_matrix:new c.aK(v,i.u_matrix)}),collisionBox:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_pixel_extrude_scale:new c.aP(v,i.u_pixel_extrude_scale)}),collisionCircle:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_inv_matrix:new c.aK(v,i.u_inv_matrix),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_viewport_size:new c.aP(v,i.u_viewport_size)}),debug:(v,i)=>({u_color:new c.aM(v,i.u_color),u_matrix:new c.aK(v,i.u_matrix),u_overlay:new c.aI(v,i.u_overlay),u_overlay_scale:new c.aJ(v,i.u_overlay_scale)}),clippingMask:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix)}),heatmap:(v,i)=>({u_extrude_scale:new c.aJ(v,i.u_extrude_scale),u_intensity:new c.aJ(v,i.u_intensity),u_matrix:new c.aK(v,i.u_matrix)}),heatmapTexture:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_world:new c.aP(v,i.u_world),u_image:new c.aI(v,i.u_image),u_color_ramp:new c.aI(v,i.u_color_ramp),u_opacity:new c.aJ(v,i.u_opacity)}),hillshade:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_image:new c.aI(v,i.u_image),u_latrange:new c.aP(v,i.u_latrange),u_light:new c.aP(v,i.u_light),u_shadow:new c.aM(v,i.u_shadow),u_highlight:new c.aM(v,i.u_highlight),u_accent:new c.aM(v,i.u_accent)}),hillshadePrepare:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_image:new c.aI(v,i.u_image),u_dimension:new c.aP(v,i.u_dimension),u_zoom:new c.aJ(v,i.u_zoom),u_unpack:new c.aL(v,i.u_unpack)}),line:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels)}),lineGradient:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels),u_image:new c.aI(v,i.u_image),u_image_height:new c.aJ(v,i.u_image_height)}),linePattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_texsize:new c.aP(v,i.u_texsize),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_image:new c.aI(v,i.u_image),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade)}),lineSDF:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels),u_patternscale_a:new c.aP(v,i.u_patternscale_a),u_patternscale_b:new c.aP(v,i.u_patternscale_b),u_sdfgamma:new c.aJ(v,i.u_sdfgamma),u_image:new c.aI(v,i.u_image),u_tex_y_a:new c.aJ(v,i.u_tex_y_a),u_tex_y_b:new c.aJ(v,i.u_tex_y_b),u_mix:new c.aJ(v,i.u_mix)}),raster:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_tl_parent:new c.aP(v,i.u_tl_parent),u_scale_parent:new c.aJ(v,i.u_scale_parent),u_buffer_scale:new c.aJ(v,i.u_buffer_scale),u_fade_t:new c.aJ(v,i.u_fade_t),u_opacity:new c.aJ(v,i.u_opacity),u_image0:new c.aI(v,i.u_image0),u_image1:new c.aI(v,i.u_image1),u_brightness_low:new c.aJ(v,i.u_brightness_low),u_brightness_high:new c.aJ(v,i.u_brightness_high),u_saturation_factor:new c.aJ(v,i.u_saturation_factor),u_contrast_factor:new c.aJ(v,i.u_contrast_factor),u_spin_weights:new c.aO(v,i.u_spin_weights)}),symbolIcon:(v,i)=>({u_is_size_zoom_constant:new c.aI(v,i.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(v,i.u_is_size_feature_constant),u_size_t:new c.aJ(v,i.u_size_t),u_size:new c.aJ(v,i.u_size),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_pitch:new c.aJ(v,i.u_pitch),u_rotate_symbol:new c.aI(v,i.u_rotate_symbol),u_aspect_ratio:new c.aJ(v,i.u_aspect_ratio),u_fade_change:new c.aJ(v,i.u_fade_change),u_matrix:new c.aK(v,i.u_matrix),u_label_plane_matrix:new c.aK(v,i.u_label_plane_matrix),u_coord_matrix:new c.aK(v,i.u_coord_matrix),u_is_text:new c.aI(v,i.u_is_text),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_is_along_line:new c.aI(v,i.u_is_along_line),u_is_variable_anchor:new c.aI(v,i.u_is_variable_anchor),u_texsize:new c.aP(v,i.u_texsize),u_texture:new c.aI(v,i.u_texture),u_translation:new c.aP(v,i.u_translation),u_pitched_scale:new c.aJ(v,i.u_pitched_scale)}),symbolSDF:(v,i)=>({u_is_size_zoom_constant:new c.aI(v,i.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(v,i.u_is_size_feature_constant),u_size_t:new c.aJ(v,i.u_size_t),u_size:new c.aJ(v,i.u_size),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_pitch:new c.aJ(v,i.u_pitch),u_rotate_symbol:new c.aI(v,i.u_rotate_symbol),u_aspect_ratio:new c.aJ(v,i.u_aspect_ratio),u_fade_change:new c.aJ(v,i.u_fade_change),u_matrix:new c.aK(v,i.u_matrix),u_label_plane_matrix:new c.aK(v,i.u_label_plane_matrix),u_coord_matrix:new c.aK(v,i.u_coord_matrix),u_is_text:new c.aI(v,i.u_is_text),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_is_along_line:new c.aI(v,i.u_is_along_line),u_is_variable_anchor:new c.aI(v,i.u_is_variable_anchor),u_texsize:new c.aP(v,i.u_texsize),u_texture:new c.aI(v,i.u_texture),u_gamma_scale:new c.aJ(v,i.u_gamma_scale),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_is_halo:new c.aI(v,i.u_is_halo),u_translation:new c.aP(v,i.u_translation),u_pitched_scale:new c.aJ(v,i.u_pitched_scale)}),symbolTextAndIcon:(v,i)=>({u_is_size_zoom_constant:new c.aI(v,i.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(v,i.u_is_size_feature_constant),u_size_t:new c.aJ(v,i.u_size_t),u_size:new c.aJ(v,i.u_size),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_pitch:new c.aJ(v,i.u_pitch),u_rotate_symbol:new c.aI(v,i.u_rotate_symbol),u_aspect_ratio:new c.aJ(v,i.u_aspect_ratio),u_fade_change:new c.aJ(v,i.u_fade_change),u_matrix:new c.aK(v,i.u_matrix),u_label_plane_matrix:new c.aK(v,i.u_label_plane_matrix),u_coord_matrix:new c.aK(v,i.u_coord_matrix),u_is_text:new c.aI(v,i.u_is_text),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_is_along_line:new c.aI(v,i.u_is_along_line),u_is_variable_anchor:new c.aI(v,i.u_is_variable_anchor),u_texsize:new c.aP(v,i.u_texsize),u_texsize_icon:new c.aP(v,i.u_texsize_icon),u_texture:new c.aI(v,i.u_texture),u_texture_icon:new c.aI(v,i.u_texture_icon),u_gamma_scale:new c.aJ(v,i.u_gamma_scale),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_is_halo:new c.aI(v,i.u_is_halo),u_translation:new c.aP(v,i.u_translation),u_pitched_scale:new c.aJ(v,i.u_pitched_scale)}),background:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_opacity:new c.aJ(v,i.u_opacity),u_color:new c.aM(v,i.u_color)}),backgroundPattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_opacity:new c.aJ(v,i.u_opacity),u_image:new c.aI(v,i.u_image),u_pattern_tl_a:new c.aP(v,i.u_pattern_tl_a),u_pattern_br_a:new c.aP(v,i.u_pattern_br_a),u_pattern_tl_b:new c.aP(v,i.u_pattern_tl_b),u_pattern_br_b:new c.aP(v,i.u_pattern_br_b),u_texsize:new c.aP(v,i.u_texsize),u_mix:new c.aJ(v,i.u_mix),u_pattern_size_a:new c.aP(v,i.u_pattern_size_a),u_pattern_size_b:new c.aP(v,i.u_pattern_size_b),u_scale_a:new c.aJ(v,i.u_scale_a),u_scale_b:new c.aJ(v,i.u_scale_b),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aJ(v,i.u_tile_units_to_pixels)}),terrain:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_texture:new c.aI(v,i.u_texture),u_ele_delta:new c.aJ(v,i.u_ele_delta),u_fog_matrix:new c.aK(v,i.u_fog_matrix),u_fog_color:new c.aM(v,i.u_fog_color),u_fog_ground_blend:new c.aJ(v,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.aJ(v,i.u_fog_ground_blend_opacity),u_horizon_color:new c.aM(v,i.u_horizon_color),u_horizon_fog_blend:new c.aJ(v,i.u_horizon_fog_blend)}),terrainDepth:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ele_delta:new c.aJ(v,i.u_ele_delta)}),terrainCoords:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_texture:new c.aI(v,i.u_texture),u_terrain_coords_id:new c.aJ(v,i.u_terrain_coords_id),u_ele_delta:new c.aJ(v,i.u_ele_delta)}),sky:(v,i)=>({u_sky_color:new c.aM(v,i.u_sky_color),u_horizon_color:new c.aM(v,i.u_horizon_color),u_horizon:new c.aJ(v,i.u_horizon),u_sky_horizon_blend:new c.aJ(v,i.u_sky_horizon_blend)})};class Uc{constructor(i,h,p){this.context=i;const g=i.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(i){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const qc={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ao{constructor(i,h,p,g){this.length=h.length,this.attributes=p,this.itemSize=h.bytesPerElement,this.dynamicDraw=g,this.context=i;const b=i.gl;this.buffer=b.createBuffer(),i.bindVertexBuffer.set(this.buffer),b.bufferData(b.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(i){if(i.length!==this.length)throw new Error(`Length of new data is ${i.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,i.arrayBuffer)}enableAttributes(i,h){for(let p=0;p0){const Ce=c.H();c.aR(Ce,ne.placementInvProjMatrix,v.transform.glCoordMatrix),c.aR(Ce,Ce,ne.placementViewportMatrix),C.push({circleArray:Ie,circleOffset:$,transform:ye.posMatrix,invTransform:Ce,coord:ye}),L+=Ie.length/4,$=L}xe&&I.draw(b,E.LINES,sr.disabled,Zr.disabled,v.colorModeForRenderPass(),$r.disabled,{u_matrix:ye.posMatrix,u_pixel_extrude_scale:[1/(O=v.transform).width,1/O.height]},v.style.map.terrain&&v.style.map.terrain.getTerrainData(ye),h.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,null,v.transform.zoom,null,null,xe.collisionVertexBuffer)}var O;if(!g||!C.length)return;const H=v.useProgram("collisionCircle"),K=new c.aS;K.resize(4*L),K._trim();let te=0;for(const ue of C)for(let ye=0;ye=0&&(ue[ne.associatedIconIndex]={shiftedAnchor:jt,angle:jr})}else Rt(ne.numGlyphs,se)}if(L){re.clear();const ye=v.icon.placedSymbolArray;for(let ne=0;nev.style.map.terrain.getElevation(Qe,zu,wi):null,Ks=h.layout.get("text-rotation-alignment")==="map";Y(Et,Qe.posMatrix,v,g,_s,Xs,ue,L,Ks,se,Qe.toUnwrapped(),te.width,te.height,vs,Wr)}const Li=Qe.posMatrix,Un=g&&Je||Au,Zo=ye||Un?Qc:_s,Js=Gl,qi=ft&&h.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Gi;Gi=ft?Et.iconsInText?bp(jt.kind,ar,ne,ue,ye,Un,v,Li,Zo,Js,vs,ji,en,yt):Uh(jt.kind,ar,ne,ue,ye,Un,v,Li,Zo,Js,vs,g,ji,!0,yt):Vh(jt.kind,ar,ne,ue,ye,Un,v,Li,Zo,Js,vs,g,ji,yt);const Ii={program:Qt,buffers:Ut,uniformValues:Gi,atlasTexture:jn,atlasTextureIcon:Vi,atlasInterpolation:Ur,atlasInterpolationIcon:fn,isSDF:ft,hasHalo:qi};if(Ie&&Et.canOverlap){Ce=!0;const Wr=Ut.segments.get();for(const Ks of Wr)gt.push({segments:new c.a0([Ks]),sortKey:Ks.sortKey,state:Ii,terrainData:Vr})}else gt.push({segments:Ut.segments,sortKey:0,state:Ii,terrainData:Vr})}Ce&>.sort((Qe,it)=>Qe.sortKey-it.sortKey);for(const Qe of gt){const it=Qe.state;if(H.activeTexture.set(K.TEXTURE0),it.atlasTexture.bind(it.atlasInterpolation,K.CLAMP_TO_EDGE),it.atlasTextureIcon&&(H.activeTexture.set(K.TEXTURE1),it.atlasTextureIcon&&it.atlasTextureIcon.bind(it.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),it.isSDF){const Et=it.uniformValues;it.hasHalo&&(Et.u_is_halo=1,hs(it.buffers,Qe.segments,h,v,it.program,je,$,O,Et,Qe.terrainData)),Et.u_is_halo=0}hs(it.buffers,Qe.segments,h,v,it.program,je,$,O,it.uniformValues,Qe.terrainData)}}function hs(v,i,h,p,g,b,E,I,C,L){const $=p.context;g.draw($,$.gl.TRIANGLES,b,E,I,$r.disabled,C,L,h.id,v.layoutVertexBuffer,v.indexBuffer,i,h.paint,p.transform.zoom,v.programConfigurations.get(h.id),v.dynamicLayoutVertexBuffer,v.opacityVertexBuffer)}function Pn(v,i,h,p,g){if(!h||!p||!p.imageAtlas)return;const b=p.imageAtlas.patternPositions;let E=b[h.to.toString()],I=b[h.from.toString()];if(!E&&I&&(E=I),!I&&E&&(I=E),!E||!I){const C=g.getPaintProperty(i);E=b[C],I=b[C]}E&&I&&v.setConstantPatternPositions(E,I)}function tu(v,i,h,p,g,b,E){const I=v.context.gl,C="fill-pattern",L=h.paint.get(C),$=L&&L.constantOr(1),O=h.getCrossfadeParameters();let H,K,te,se,re;E?(K=$&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",H=I.LINES):(K=$?"fillPattern":"fill",H=I.TRIANGLES);const ue=L.constantOr(null);for(const ye of p){const ne=i.getTile(ye);if($&&!ne.patternsLoaded())continue;const xe=ne.getBucket(h);if(!xe)continue;const Ie=xe.programConfigurations.get(h.id),Ce=v.useProgram(K,Ie),je=v.style.map.terrain&&v.style.map.terrain.getTerrainData(ye);$&&(v.context.activeTexture.set(I.TEXTURE0),ne.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),Ie.updatePaintBuffers(O)),Pn(Ie,C,ue,ne,h);const Je=je?ye:null,gt=v.translatePosMatrix(Je?Je.posMatrix:ye.posMatrix,ne,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(E){se=xe.indexBuffer2,re=xe.segments2;const yt=[I.drawingBufferWidth,I.drawingBufferHeight];te=K==="fillOutlinePattern"&&$?gp(gt,v,O,ne,yt):mp(gt,yt)}else se=xe.indexBuffer,re=xe.segments,te=$?Os(gt,v,O,ne):za(gt);Ce.draw(v.context,H,g,v.stencilModeForClipping(ye),b,$r.disabled,te,je,h.id,xe.layoutVertexBuffer,se,re,h.paint,v.transform.zoom,Ie)}}function Al(v,i,h,p,g,b,E){const I=v.context,C=I.gl,L="fill-extrusion-pattern",$=h.paint.get(L),O=$.constantOr(1),H=h.getCrossfadeParameters(),K=h.paint.get("fill-extrusion-opacity"),te=$.constantOr(null);for(const se of p){const re=i.getTile(se),ue=re.getBucket(h);if(!ue)continue;const ye=v.style.map.terrain&&v.style.map.terrain.getTerrainData(se),ne=ue.programConfigurations.get(h.id),xe=v.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ne);O&&(v.context.activeTexture.set(C.TEXTURE0),re.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),ne.updatePaintBuffers(H)),Pn(ne,L,te,re,h);const Ie=v.translatePosMatrix(se.posMatrix,re,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Ce=h.paint.get("fill-extrusion-vertical-gradient"),je=O?xl(Ie,v,Ce,K,se,H,re):bl(Ie,v,Ce,K);xe.draw(I,I.gl.TRIANGLES,g,b,E,$r.backCCW,je,ye,h.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,h.paint,v.transform.zoom,ne,v.style.map.terrain&&ue.centroidVertexBuffer)}}function ru(v,i,h,p,g,b,E){const I=v.context,C=I.gl,L=h.fbo;if(!L)return;const $=v.useProgram("hillshade"),O=v.style.map.terrain&&v.style.map.terrain.getTerrainData(i);I.activeTexture.set(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,L.colorAttachment.get()),$.draw(I,C.TRIANGLES,g,b,E,$r.disabled,((H,K,te,se)=>{const re=te.paint.get("hillshade-shadow-color"),ue=te.paint.get("hillshade-highlight-color"),ye=te.paint.get("hillshade-accent-color");let ne=te.paint.get("hillshade-illumination-direction")*(Math.PI/180);te.paint.get("hillshade-illumination-anchor")==="viewport"&&(ne-=H.transform.angle);const xe=!H.options.moving;return{u_matrix:se?se.posMatrix:H.transform.calculatePosMatrix(K.tileID.toUnwrapped(),xe),u_image:0,u_latrange:En(0,K.tileID),u_light:[te.paint.get("hillshade-exaggeration"),ne],u_shadow:re,u_highlight:ue,u_accent:ye}})(v,h,p,O?i:null),O,p.id,v.rasterBoundsBuffer,v.quadTriangleIndexBuffer,v.rasterBoundsSegments)}function fs(v,i,h,p,g,b){const E=v.context,I=E.gl,C=i.dem;if(C&&C.data){const L=C.dim,$=C.stride,O=C.getPixels();if(E.activeTexture.set(I.TEXTURE1),E.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||v.getTileTexture($),i.demTexture){const K=i.demTexture;K.update(O,{premultiply:!1}),K.bind(I.NEAREST,I.CLAMP_TO_EDGE)}else i.demTexture=new ve(E,O,I.RGBA,{premultiply:!1}),i.demTexture.bind(I.NEAREST,I.CLAMP_TO_EDGE);E.activeTexture.set(I.TEXTURE0);let H=i.fbo;if(!H){const K=new ve(E,{width:L,height:L,data:null},I.RGBA);K.bind(I.LINEAR,I.CLAMP_TO_EDGE),H=i.fbo=E.createFramebuffer(L,L,!0,!1),H.colorAttachment.set(K.texture)}E.bindFramebuffer.set(H.framebuffer),E.viewport.set([0,0,L,L]),v.useProgram("hillshadePrepare").draw(E,I.TRIANGLES,p,g,b,$r.disabled,((K,te)=>{const se=te.stride,re=c.H();return c.aQ(re,0,c.X,-c.X,0,0,1),c.J(re,re,[0,-c.X,0]),{u_matrix:re,u_image:1,u_dimension:[se,se],u_zoom:K.overscaledZ,u_unpack:te.getUnpackVector()}})(i.tileID,C),null,h.id,v.rasterBoundsBuffer,v.quadTriangleIndexBuffer,v.rasterBoundsSegments),i.needsHillshadePrepare=!1}}function zl(v,i,h,p,g,b){const E=p.paint.get("raster-fade-duration");if(!b&&E>0){const I=k.now(),C=(I-v.timeAdded)/E,L=i?(I-i.timeAdded)/E:-1,$=h.getSource(),O=g.coveringZoomLevel({tileSize:$.tileSize,roundZoom:$.roundZoom}),H=!i||Math.abs(i.tileID.overscaledZ-O)>Math.abs(v.tileID.overscaledZ-O),K=H&&v.refreshedUponExpiration?1:c.ad(H?C:1-L,0,1);return v.refreshedUponExpiration&&C>=1&&(v.refreshedUponExpiration=!1),i?{opacity:1,mix:1-K}:{opacity:K,mix:0}}return{opacity:1,mix:0}}const Ll=new c.aN(1,0,0,1),$a=new c.aN(0,1,0,1),Dl=new c.aN(0,0,1,1),of=new c.aN(1,0,1,1),js=new c.aN(0,1,1,1);function ds(v,i,h,p){Vs(v,0,i+h/2,v.transform.width,h,p)}function iu(v,i,h,p){Vs(v,i-h/2,0,h,v.transform.height,p)}function Vs(v,i,h,p,g,b){const E=v.context,I=E.gl;I.enable(I.SCISSOR_TEST),I.scissor(i*v.pixelRatio,h*v.pixelRatio,p*v.pixelRatio,g*v.pixelRatio),E.clear({color:b}),I.disable(I.SCISSOR_TEST)}function mr(v,i,h){const p=v.context,g=p.gl,b=h.posMatrix,E=v.useProgram("debug"),I=sr.disabled,C=Zr.disabled,L=v.colorModeForRenderPass(),$="$debug",O=v.style.map.terrain&&v.style.map.terrain.getTerrainData(h);p.activeTexture.set(g.TEXTURE0);const H=i.getTileByID(h.key).latestRawTileData,K=Math.floor((H&&H.byteLength||0)/1024),te=i.getTile(h).tileSize,se=512/Math.min(te,512)*(h.overscaledZ/v.transform.zoom)*.5;let re=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(re+=` => ${h.overscaledZ}`),function(ue,ye){ue.initDebugOverlayCanvas();const ne=ue.debugOverlayCanvas,xe=ue.context.gl,Ie=ue.debugOverlayCanvas.getContext("2d");Ie.clearRect(0,0,ne.width,ne.height),Ie.shadowColor="white",Ie.shadowBlur=2,Ie.lineWidth=1.5,Ie.strokeStyle="white",Ie.textBaseline="top",Ie.font="bold 36px Open Sans, sans-serif",Ie.fillText(ye,5,5),Ie.strokeText(ye,5,5),ue.debugOverlayTexture.update(ne),ue.debugOverlayTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE)}(v,`${re} ${K}kB`),E.draw(p,g.TRIANGLES,I,C,Ar.alphaBlended,$r.disabled,Vo(b,c.aN.transparent,se),null,$,v.debugBuffer,v.quadTriangleIndexBuffer,v.debugSegments),E.draw(p,g.LINE_STRIP,I,C,L,$r.disabled,Vo(b,c.aN.red),O,$,v.debugBuffer,v.tileBorderIndexBuffer,v.debugSegments)}function Na(v,i,h){const p=v.context,g=p.gl,b=v.colorModeForRenderPass(),E=new sr(g.LEQUAL,sr.ReadWrite,v.depthRangeFor3D),I=v.useProgram("terrain"),C=i.getTerrainMesh();p.bindFramebuffer.set(null),p.viewport.set([0,0,v.width,v.height]);for(const L of h){const $=v.renderToTexture.getTexture(L),O=i.getTerrainData(L.tileID);p.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,$.texture);const H=v.transform.calculatePosMatrix(L.tileID.toUnwrapped()),K=i.getMeshFrameDelta(v.transform.zoom),te=v.transform.calculateFogMatrix(L.tileID.toUnwrapped()),se=jc(H,K,te,v.style.sky,v.transform.pitch);I.draw(p,g.TRIANGLES,E,Zr.disabled,b,$r.backCCW,se,O,"terrain",C.vertexBuffer,C.indexBuffer,C.segments)}}class sf{constructor(i,h,p){this.vertexBuffer=i,this.indexBuffer=h,this.segments=p}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class af{constructor(i,h){this.context=new Kc(i),this.transform=h,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Nt.maxUnderzooming+Nt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Dn}resize(i,h,p){if(this.width=Math.floor(i*p),this.height=Math.floor(h*p),this.pixelRatio=p,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const g of this.style._order)this.style._layers[g].resize()}setup(){const i=this.context,h=new c.aX;h.emplaceBack(0,0),h.emplaceBack(c.X,0),h.emplaceBack(0,c.X),h.emplaceBack(c.X,c.X),this.tileExtentBuffer=i.createVertexBuffer(h,Ca.members),this.tileExtentSegments=c.a0.simpleSegment(0,0,4,2);const p=new c.aX;p.emplaceBack(0,0),p.emplaceBack(c.X,0),p.emplaceBack(0,c.X),p.emplaceBack(c.X,c.X),this.debugBuffer=i.createVertexBuffer(p,Ca.members),this.debugSegments=c.a0.simpleSegment(0,0,4,5);const g=new c.$;g.emplaceBack(0,0,0,0),g.emplaceBack(c.X,0,c.X,0),g.emplaceBack(0,c.X,0,c.X),g.emplaceBack(c.X,c.X,c.X,c.X),this.rasterBoundsBuffer=i.createVertexBuffer(g,Bo.members),this.rasterBoundsSegments=c.a0.simpleSegment(0,0,4,2);const b=new c.aX;b.emplaceBack(0,0),b.emplaceBack(1,0),b.emplaceBack(0,1),b.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(b,Ca.members),this.viewportSegments=c.a0.simpleSegment(0,0,4,2);const E=new c.aZ;E.emplaceBack(0),E.emplaceBack(1),E.emplaceBack(3),E.emplaceBack(2),E.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(E);const I=new c.aY;I.emplaceBack(0,1,2),I.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(I);const C=this.context.gl;this.stencilClearMode=new Zr({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO)}clearStencil(){const i=this.context,h=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const p=c.H();c.aQ(p,0,this.width,this.height,0,0,1),c.K(p,p,[h.drawingBufferWidth,h.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,h.TRIANGLES,sr.disabled,this.stencilClearMode,Ar.disabled,$r.disabled,La(p),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(i,h){if(this.currentStencilSource===i.source||!i.isTileClipped()||!h||!h.length)return;this.currentStencilSource=i.source;const p=this.context,g=p.gl;this.nextStencilID+h.length>256&&this.clearStencil(),p.setColorMode(Ar.disabled),p.setDepthMode(sr.disabled);const b=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const E of h){const I=this._tileClippingMaskIDs[E.key]=this.nextStencilID++,C=this.style.map.terrain&&this.style.map.terrain.getTerrainData(E);b.draw(p,g.TRIANGLES,sr.disabled,new Zr({func:g.ALWAYS,mask:0},I,255,g.KEEP,g.KEEP,g.REPLACE),Ar.disabled,$r.disabled,La(E.posMatrix),C,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const i=this.nextStencilID++,h=this.context.gl;return new Zr({func:h.NOTEQUAL,mask:255},i,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(i){const h=this.context.gl;return new Zr({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(i){const h=this.context.gl,p=i.sort((E,I)=>I.overscaledZ-E.overscaledZ),g=p[p.length-1].overscaledZ,b=p[0].overscaledZ-g+1;if(b>1){this.currentStencilSource=void 0,this.nextStencilID+b>256&&this.clearStencil();const E={};for(let I=0;I({u_sky_color:ue.properties.get("sky-color"),u_horizon_color:ue.properties.get("horizon-color"),u_horizon:(ye.height/2+ye.getHorizon())*ne,u_sky_horizon_blend:ue.properties.get("sky-horizon-blend")*ye.height/2*ne}))(L,C.style.map.transform,C.pixelRatio),K=new sr(O.LEQUAL,sr.ReadWrite,[0,1]),te=Zr.disabled,se=C.colorModeForRenderPass(),re=C.useProgram("sky");if(!L.mesh){const ue=new c.aX;ue.emplaceBack(-1,-1),ue.emplaceBack(1,-1),ue.emplaceBack(1,1),ue.emplaceBack(-1,1);const ye=new c.aY;ye.emplaceBack(0,1,2),ye.emplaceBack(0,2,3),L.mesh=new sf($.createVertexBuffer(ue,Ca.members),$.createIndexBuffer(ye),c.a0.simpleSegment(0,0,ue.length,ye.length))}re.draw($,O.TRIANGLES,K,te,se,$r.disabled,H,void 0,"sky",L.mesh.vertexBuffer,L.mesh.indexBuffer,L.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=h.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=p.length-1;this.currentLayer>=0;this.currentLayer--){const C=this.style._layers[p[this.currentLayer]],L=g[C.source],$=b[C.source];this._renderTileClippingMasks(C,$),this.renderLayer(this,L,C,$)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerre.source&&!re.isHidden($)?[L.sourceCaches[re.source]]:[]),K=H.filter(re=>re.getSource().type==="vector"),te=H.filter(re=>re.getSource().type!=="vector"),se=re=>{(!O||O.getSource().maxzoomse(re)),O||te.forEach(re=>se(re)),O}(this.style,this.transform.zoom);C&&function(L,$,O){for(let H=0;H0),g&&(c.b0(h,p),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(b,E){const I=b.context,C=I.gl,L=Ar.unblended,$=new sr(C.LEQUAL,sr.ReadWrite,[0,1]),O=E.getTerrainMesh(),H=E.sourceCache.getRenderableTiles(),K=b.useProgram("terrainDepth");I.bindFramebuffer.set(E.getFramebuffer("depth").framebuffer),I.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),I.clear({color:c.aN.transparent,depth:1});for(const te of H){const se=E.getTerrainData(te.tileID),re={u_matrix:b.transform.calculatePosMatrix(te.tileID.toUnwrapped()),u_ele_delta:E.getMeshFrameDelta(b.transform.zoom)};K.draw(I,C.TRIANGLES,$,Zr.disabled,L,$r.backCCW,re,se,"terrain",O.vertexBuffer,O.indexBuffer,O.segments)}I.bindFramebuffer.set(null),I.viewport.set([0,0,b.width,b.height])}(this,this.style.map.terrain),function(b,E){const I=b.context,C=I.gl,L=Ar.unblended,$=new sr(C.LEQUAL,sr.ReadWrite,[0,1]),O=E.getTerrainMesh(),H=E.getCoordsTexture(),K=E.sourceCache.getRenderableTiles(),te=b.useProgram("terrainCoords");I.bindFramebuffer.set(E.getFramebuffer("coords").framebuffer),I.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),I.clear({color:c.aN.transparent,depth:1}),E.coordsIndex=[];for(const se of K){const re=E.getTerrainData(se.tileID);I.activeTexture.set(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,H.texture);const ue={u_matrix:b.transform.calculatePosMatrix(se.tileID.toUnwrapped()),u_terrain_coords_id:(255-E.coordsIndex.length)/255,u_texture:0,u_ele_delta:E.getMeshFrameDelta(b.transform.zoom)};te.draw(I,C.TRIANGLES,$,Zr.disabled,L,$r.backCCW,ue,re,"terrain",O.vertexBuffer,O.indexBuffer,O.segments),E.coordsIndex.push(se.tileID.key)}I.bindFramebuffer.set(null),I.viewport.set([0,0,b.width,b.height])}(this,this.style.map.terrain))}renderLayer(i,h,p,g){if(!p.isHidden(this.transform.zoom)&&(p.type==="background"||p.type==="custom"||(g||[]).length))switch(this.id=p.id,p.type){case"symbol":(function(b,E,I,C,L){if(b.renderPass!=="translucent")return;const $=Zr.disabled,O=b.colorModeForRenderPass();(I._unevaluatedLayout.hasValue("text-variable-anchor")||I._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(H,K,te,se,re,ue,ye,ne,xe){const Ie=K.transform,Ce=ml(),je=re==="map",Je=ue==="map";for(const gt of H){const yt=se.getTile(gt),Qe=yt.getBucket(te);if(!Qe||!Qe.text||!Qe.text.segments.get().length)continue;const it=c.ah(Qe.textSizeData,Ie.zoom),Et=Xt(yt,1,K.transform.zoom),Ut=$o(gt.posMatrix,Je,je,K.transform,Et),st=te.layout.get("icon-text-fit")!=="none"&&Qe.hasIconData();if(it){const ft=Math.pow(2,Ie.zoom-yt.tileID.overscaledZ),jt=K.style.map.terrain?(Qt,ar)=>K.style.map.terrain.getElevation(gt,Qt,ar):null,jr=Ce.translatePosition(Ie,yt,ye,ne);Cl(Qe,je,Je,xe,Ie,Ut,gt.posMatrix,ft,it,st,Ce,jr,gt.toUnwrapped(),jt)}}}(C,b,I,E,I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),L),I.paint.get("icon-opacity").constantOr(1)!==0&&Uo(b,E,I,C,!1,I.paint.get("icon-translate"),I.paint.get("icon-translate-anchor"),I.layout.get("icon-rotation-alignment"),I.layout.get("icon-pitch-alignment"),I.layout.get("icon-keep-upright"),$,O),I.paint.get("text-opacity").constantOr(1)!==0&&Uo(b,E,I,C,!0,I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.layout.get("text-keep-upright"),$,O),E.map.showCollisionBoxes&&(nf(b,E,I,C,!0),nf(b,E,I,C,!1))})(i,h,p,g,this.style.placement.variableOffsets);break;case"circle":(function(b,E,I,C){if(b.renderPass!=="translucent")return;const L=I.paint.get("circle-opacity"),$=I.paint.get("circle-stroke-width"),O=I.paint.get("circle-stroke-opacity"),H=!I.layout.get("circle-sort-key").isConstant();if(L.constantOr(1)===0&&($.constantOr(1)===0||O.constantOr(1)===0))return;const K=b.context,te=K.gl,se=b.depthModeForSublayer(0,sr.ReadOnly),re=Zr.disabled,ue=b.colorModeForRenderPass(),ye=[];for(let ne=0;nene.sortKey-xe.sortKey);for(const ne of ye){const{programConfiguration:xe,program:Ie,layoutVertexBuffer:Ce,indexBuffer:je,uniformValues:Je,terrainData:gt}=ne.state;Ie.draw(K,te.TRIANGLES,se,re,ue,$r.disabled,Je,gt,I.id,Ce,je,ne.segments,I.paint,b.transform.zoom,xe)}})(i,h,p,g);break;case"heatmap":(function(b,E,I,C){if(I.paint.get("heatmap-opacity")!==0)if(b.renderPass==="offscreen"){const L=b.context,$=L.gl,O=Zr.disabled,H=new Ar([$.ONE,$.ONE],c.aN.transparent,[!0,!0,!0,!0]);(function(K,te,se){const re=K.gl;K.activeTexture.set(re.TEXTURE1),K.viewport.set([0,0,te.width/4,te.height/4]);let ue=se.heatmapFbo;if(ue)re.bindTexture(re.TEXTURE_2D,ue.colorAttachment.get()),K.bindFramebuffer.set(ue.framebuffer);else{const ye=re.createTexture();re.bindTexture(re.TEXTURE_2D,ye),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_WRAP_S,re.CLAMP_TO_EDGE),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_WRAP_T,re.CLAMP_TO_EDGE),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_MIN_FILTER,re.LINEAR),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_MAG_FILTER,re.LINEAR),ue=se.heatmapFbo=K.createFramebuffer(te.width/4,te.height/4,!1,!1),function(ne,xe,Ie,Ce){var je,Je;const gt=ne.gl,yt=(je=ne.HALF_FLOAT)!==null&&je!==void 0?je:gt.UNSIGNED_BYTE,Qe=(Je=ne.RGBA16F)!==null&&Je!==void 0?Je:gt.RGBA;gt.texImage2D(gt.TEXTURE_2D,0,Qe,xe.width/4,xe.height/4,0,gt.RGBA,yt,null),Ce.colorAttachment.set(Ie)}(K,te,ye,ue)}})(L,b,I),L.clear({color:c.aN.transparent});for(let K=0;K{const ne=c.H();c.aQ(ne,0,se.width,se.height,0,0,1);const xe=se.context.gl;return{u_matrix:ne,u_world:[xe.drawingBufferWidth,xe.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:re.paint.get("heatmap-opacity")}})(L,$),null,$.id,L.viewportBuffer,L.quadTriangleIndexBuffer,L.viewportSegments,$.paint,L.transform.zoom)}(b,I))})(i,h,p,g);break;case"line":(function(b,E,I,C){if(b.renderPass!=="translucent")return;const L=I.paint.get("line-opacity"),$=I.paint.get("line-width");if(L.constantOr(1)===0||$.constantOr(1)===0)return;const O=b.depthModeForSublayer(0,sr.ReadOnly),H=b.colorModeForRenderPass(),K=I.paint.get("line-dasharray"),te=I.paint.get("line-pattern"),se=te.constantOr(1),re=I.paint.get("line-gradient"),ue=I.getCrossfadeParameters(),ye=se?"linePattern":K?"lineSDF":re?"lineGradient":"line",ne=b.context,xe=ne.gl;let Ie=!0;for(const Ce of C){const je=E.getTile(Ce);if(se&&!je.patternsLoaded())continue;const Je=je.getBucket(I);if(!Je)continue;const gt=Je.programConfigurations.get(I.id),yt=b.context.program.get(),Qe=b.useProgram(ye,gt),it=Ie||Qe.program!==yt,Et=b.style.map.terrain&&b.style.map.terrain.getTerrainData(Ce),Ut=te.constantOr(null);if(Ut&&je.imageAtlas){const jt=je.imageAtlas,jr=jt.patternPositions[Ut.to.toString()],Qt=jt.patternPositions[Ut.from.toString()];jr&&Qt&>.setConstantPatternPositions(jr,Qt)}const st=Et?Ce:null,ft=se?$h(b,je,I,ue,st):K?Nh(b,je,I,K,ue,st):re?wl(b,je,I,Je.lineClipsArray.length,st):Da(b,je,I,st);if(se)ne.activeTexture.set(xe.TEXTURE0),je.imageAtlasTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE),gt.updatePaintBuffers(ue);else if(K&&(it||b.lineAtlas.dirty))ne.activeTexture.set(xe.TEXTURE0),b.lineAtlas.bind(ne);else if(re){const jt=Je.gradients[I.id];let jr=jt.texture;if(I.gradientVersion!==jt.version){let Qt=256;if(I.stepInterpolant){const ar=E.getSource().maxzoom,Vr=Ce.canonical.z===ar?Math.ceil(1<0?h.pop():null}isPatternMissing(i){if(!i)return!1;if(!i.from||!i.to)return!0;const h=this.imageManager.getPattern(i.from.toString()),p=this.imageManager.getPattern(i.to.toString());return!h||!p}useProgram(i,h){this.cache=this.cache||{};const p=i+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[p]||(this.cache[p]=new _l(this.context,jo[i],h,kl[i],this._showOverdrawInspector,this.style.map.terrain)),this.cache[p]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new ve(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:i,drawingBufferHeight:h}=this.context.gl;return this.width!==i||this.height!==h}}class ps{constructor(i,h){this.points=i,this.planes=h}static fromInvProjectionMatrix(i,h,p){const g=Math.pow(2,p),b=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(I=>{const C=1/(I=c.ag([],I,i))[3]/h*g;return c.b1(I,I,[C,C,1/I[3],C])}),E=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const C=function(H,K){var te=K[0],se=K[1],re=K[2],ue=te*te+se*se+re*re;return ue>0&&(ue=1/Math.sqrt(ue)),H[0]=K[0]*ue,H[1]=K[1]*ue,H[2]=K[2]*ue,H}([],function(H,K,te){var se=K[0],re=K[1],ue=K[2],ye=te[0],ne=te[1],xe=te[2];return H[0]=re*xe-ue*ne,H[1]=ue*ye-se*xe,H[2]=se*ne-re*ye,H}([],Ee([],b[I[0]],b[I[1]]),Ee([],b[I[2]],b[I[1]]))),L=-(($=C)[0]*(O=b[I[1]])[0]+$[1]*O[1]+$[2]*O[2]);var $,O;return C.concat(L)});return new ps(b,E)}}class Fl{constructor(i,h){this.min=i,this.max=h,this.center=function(p,g,b){return p[0]=.5*g[0],p[1]=.5*g[1],p[2]=.5*g[2],p}([],function(p,g,b){return p[0]=g[0]+b[0],p[1]=g[1]+b[1],p[2]=g[2]+b[2],p}([],this.min,this.max))}quadrant(i){const h=[i%2==0,i<2],p=X(this.min),g=X(this.max);for(let b=0;b=0&&E++;if(E===0)return 0;E!==h.length&&(p=!1)}if(p)return 2;for(let g=0;g<3;g++){let b=Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let I=0;Ithis.max[g]-this.min[g])return 0}return 1}}class Rl{constructor(i=0,h=0,p=0,g=0){if(isNaN(i)||i<0||isNaN(h)||h<0||isNaN(p)||p<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=h,this.left=p,this.right=g}interpolate(i,h,p){return h.top!=null&&i.top!=null&&(this.top=c.z.number(i.top,h.top,p)),h.bottom!=null&&i.bottom!=null&&(this.bottom=c.z.number(i.bottom,h.bottom,p)),h.left!=null&&i.left!=null&&(this.left=c.z.number(i.left,h.left,p)),h.right!=null&&i.right!=null&&(this.right=c.z.number(i.right,h.right,p)),this}getCenter(i,h){const p=c.ad((this.left+i-this.right)/2,0,i),g=c.ad((this.top+h-this.bottom)/2,0,h);return new c.P(p,g)}equals(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right}clone(){return new Rl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const nu=85.051129;class ou{constructor(i,h,p,g,b){this.tileSize=512,this._renderWorldCopies=b===void 0||!!b,this._minZoom=i||0,this._maxZoom=h||22,this._minPitch=p??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const i=new ou(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.apply(this),i}apply(i){this.tileSize=i.tileSize,this.latRange=i.latRange,this.width=i.width,this.height=i.height,this._center=i._center,this._elevation=i._elevation,this.minElevationForCurrentTile=i.minElevationForCurrentTile,this.zoom=i.zoom,this.angle=i.angle,this._fov=i._fov,this._pitch=i._pitch,this._unmodified=i._unmodified,this._edgeInsets=i._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))}get maxZoom(){return this._maxZoom}set maxZoom(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))}get minPitch(){return this._minPitch}set minPitch(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))}get maxPitch(){return this._maxPitch}set maxPitch(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(i){const h=-c.b3(i,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=function(){var p=new c.A(4);return c.A!=Float32Array&&(p[1]=0,p[2]=0),p[0]=1,p[3]=1,p}(),function(p,g,b){var E=g[0],I=g[1],C=g[2],L=g[3],$=Math.sin(b),O=Math.cos(b);p[0]=E*O+C*$,p[1]=I*O+L*$,p[2]=E*-$+C*O,p[3]=I*-$+L*O}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(i){const h=c.ad(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(i){const h=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(i){i!==this._elevation&&(this._elevation=i,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(i){return this._edgeInsets.equals(i)}interpolatePadding(i,h,p){this._unmodified=!1,this._edgeInsets.interpolate(i,h,p),this._constrain(),this._calcMatrices()}coveringZoomLevel(i){const h=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(i){const h=[new c.b4(0,i)];if(this._renderWorldCopies){const p=this.pointCoordinate(new c.P(0,0)),g=this.pointCoordinate(new c.P(this.width,0)),b=this.pointCoordinate(new c.P(this.width,this.height)),E=this.pointCoordinate(new c.P(0,this.height)),I=Math.floor(Math.min(p.x,g.x,b.x,E.x)),C=Math.floor(Math.max(p.x,g.x,b.x,E.x)),L=1;for(let $=I-L;$<=C+L;$++)$!==0&&h.push(new c.b4($,i))}return h}coveringTiles(i){var h,p;let g=this.coveringZoomLevel(i);const b=g;if(i.minzoom!==void 0&&gi.maxzoom&&(g=i.maxzoom);const E=this.pointCoordinate(this.getCameraPoint()),I=c.Z.fromLngLat(this.center),C=Math.pow(2,g),L=[C*E.x,C*E.y,0],$=[C*I.x,C*I.y,0],O=ps.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,g);let H=i.minzoom||0;!i.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(H=g);const K=i.terrain?2/Math.min(this.tileSize,i.tileSize)*this.tileSize:3,te=ne=>({aabb:new Fl([ne*C,0,0],[(ne+1)*C,C,0]),zoom:0,x:0,y:0,wrap:ne,fullyVisible:!1}),se=[],re=[],ue=g,ye=i.reparseOverscaled?b:g;if(this._renderWorldCopies)for(let ne=1;ne<=3;ne++)se.push(te(-ne)),se.push(te(ne));for(se.push(te(0));se.length>0;){const ne=se.pop(),xe=ne.x,Ie=ne.y;let Ce=ne.fullyVisible;if(!Ce){const Qe=ne.aabb.intersects(O);if(Qe===0)continue;Ce=Qe===2}const je=i.terrain?L:$,Je=ne.aabb.distanceX(je),gt=ne.aabb.distanceY(je),yt=Math.max(Math.abs(Je),Math.abs(gt));if(ne.zoom===ue||yt>K+(1<=H){const Qe=ue-ne.zoom,it=L[0]-.5-(xe<>1),Ut=ne.zoom+1;let st=ne.aabb.quadrant(Qe);if(i.terrain){const ft=new c.S(Ut,ne.wrap,Ut,it,Et),jt=i.terrain.getMinMaxElevation(ft),jr=(h=jt.minElevation)!==null&&h!==void 0?h:this.elevation,Qt=(p=jt.maxElevation)!==null&&p!==void 0?p:this.elevation;st=new Fl([st.min[0],st.min[1],jr],[st.max[0],st.max[1],Qt])}se.push({aabb:st,zoom:Ut,x:it,y:Et,wrap:ne.wrap,fullyVisible:Ce})}}return re.sort((ne,xe)=>ne.distanceSq-xe.distanceSq).map(ne=>ne.tileID)}resize(i,h){this.width=i,this.height=h,this.pixelsToGLUnits=[2/i,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(i){return Math.pow(2,i)}scaleZoom(i){return Math.log(i)/Math.LN2}project(i){const h=c.ad(i.lat,-85.051129,nu);return new c.P(c.O(i.lng)*this.worldSize,c.Q(h)*this.worldSize)}unproject(i){return new c.Z(i.x/this.worldSize,i.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(i){const h=this.elevation,p=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,g=this.pointLocation(this.centerPoint,i),b=i.getElevationForLngLatZoom(g,this.tileZoom);if(!(this.elevation-b))return;const E=p+h-b,I=Math.cos(this._pitch)*this.cameraToCenterDistance/E/c.b5(1,g.lat),C=this.scaleZoom(I/this.tileSize);this._elevation=b,this._center=g,this.zoom=C}setLocationAtPoint(i,h){const p=this.pointCoordinate(h),g=this.pointCoordinate(this.centerPoint),b=this.locationCoordinate(i),E=new c.Z(b.x-(p.x-g.x),b.y-(p.y-g.y));this.center=this.coordinateLocation(E),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(i,h){return h?this.coordinatePoint(this.locationCoordinate(i),h.getElevationForLngLatZoom(i,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(i))}pointLocation(i,h){return this.coordinateLocation(this.pointCoordinate(i,h))}locationCoordinate(i){return c.Z.fromLngLat(i)}coordinateLocation(i){return i&&i.toLngLat()}pointCoordinate(i,h){if(h){const H=h.pointCoordinate(i);if(H!=null)return H}const p=[i.x,i.y,0,1],g=[i.x,i.y,1,1];c.ag(p,p,this.pixelMatrixInverse),c.ag(g,g,this.pixelMatrixInverse);const b=p[3],E=g[3],I=p[1]/b,C=g[1]/E,L=p[2]/b,$=g[2]/E,O=L===$?0:(0-L)/($-L);return new c.Z(c.z.number(p[0]/b,g[0]/E,O)/this.worldSize,c.z.number(I,C,O)/this.worldSize)}coordinatePoint(i,h=0,p=this.pixelMatrix){const g=[i.x*this.worldSize,i.y*this.worldSize,h,1];return c.ag(g,g,p),new c.P(g[0]/g[3],g[1]/g[3])}getBounds(){const i=Math.max(0,this.height/2-this.getHorizon());return new Te().extend(this.pointLocation(new c.P(0,i))).extend(this.pointLocation(new c.P(this.width,i))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Te([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,nu])}calculateTileMatrix(i){const h=i.canonical,p=this.worldSize/this.zoomScale(h.z),g=h.x+Math.pow(2,h.z)*i.wrap,b=c.ao(new Float64Array(16));return c.J(b,b,[g*p,h.y*p,0]),c.K(b,b,[p/c.X,p/c.X,1]),b}calculatePosMatrix(i,h=!1){const p=i.key,g=h?this._alignedPosMatrixCache:this._posMatrixCache;if(g[p])return g[p];const b=this.calculateTileMatrix(i);return c.L(b,h?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,b),g[p]=new Float32Array(b),g[p]}calculateFogMatrix(i){const h=i.key,p=this._fogMatrixCache;if(p[h])return p[h];const g=this.calculateTileMatrix(i);return c.L(g,this.fogMatrix,g),p[h]=new Float32Array(g),p[h]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(i,h){h=c.ad(+h,this.minZoom,this.maxZoom);const p={center:new c.N(i.lng,i.lat),zoom:h};let g=this.lngRange;if(!this._renderWorldCopies&&g===null){const ne=179.9999999999;g=[-ne,ne]}const b=this.tileSize*this.zoomScale(p.zoom);let E=0,I=b,C=0,L=b,$=0,O=0;const{x:H,y:K}=this.size;if(this.latRange){const ne=this.latRange;E=c.Q(ne[1])*b,I=c.Q(ne[0])*b,I-EI&&(ue=I-ne)}if(g){const ne=(C+L)/2;let xe=te;this._renderWorldCopies&&(xe=c.b3(te,ne-b/2,ne+b/2));const Ie=H/2;xe-IeL&&(re=L-Ie)}if(re!==void 0||ue!==void 0){const ne=new c.P(re??te,ue??se);p.center=this.unproject.call({worldSize:b},ne).wrap()}return p}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const i=this._unmodified,{center:h,zoom:p}=this.getConstrained(this.center,this.zoom);this.center=h,this.zoom=p,this._unmodified=i,this._constraining=!1}_calcMatrices(){if(!this.height)return;const i=this.centerOffset,h=this.point.x,p=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b5(1,this.center.lat)*this.worldSize;let g=c.ao(new Float64Array(16));c.K(g,g,[this.width/2,-this.height/2,1]),c.J(g,g,[1,-1,0]),this.labelPlaneMatrix=g,g=c.ao(new Float64Array(16)),c.K(g,g,[1,-1,1]),c.J(g,g,[-1,-1,0]),c.K(g,g,[2/this.width,2/this.height,1]),this.glCoordMatrix=g;const b=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),E=Math.min(this.elevation,this.minElevationForCurrentTile),I=b-E*this._pixelPerMeter/Math.cos(this._pitch),C=E<0?I:b,L=Math.PI/2+this._pitch,$=this._fov*(.5+i.y/this.height),O=Math.sin($)*C/Math.sin(c.ad(Math.PI-L-$,.01,Math.PI-.01)),H=this.getHorizon(),K=2*Math.atan(H/this.cameraToCenterDistance)*(.5+i.y/(2*H)),te=Math.sin(K)*C/Math.sin(c.ad(Math.PI-L-K,.01,Math.PI-.01)),se=Math.min(O,te),re=1.01*(Math.cos(Math.PI/2-this._pitch)*se+C),ue=this.height/50;g=new Float64Array(16),c.b6(g,this._fov,this.width/this.height,ue,re),g[8]=2*-i.x/this.width,g[9]=2*i.y/this.height,c.K(g,g,[1,-1,1]),c.J(g,g,[0,0,-this.cameraToCenterDistance]),c.b7(g,g,this._pitch),c.ae(g,g,this.angle),c.J(g,g,[-h,-p,0]),this.mercatorMatrix=c.K([],g,[this.worldSize,this.worldSize,this.worldSize]),c.K(g,g,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.L(new Float64Array(16),this.labelPlaneMatrix,g),c.J(g,g,[0,0,-this.elevation]),this.modelViewProjectionMatrix=g,this.invModelViewProjectionMatrix=c.at([],g),this.fogMatrix=new Float64Array(16),c.b6(this.fogMatrix,this._fov,this.width/this.height,b,re),this.fogMatrix[8]=2*-i.x/this.width,this.fogMatrix[9]=2*i.y/this.height,c.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),c.b7(this.fogMatrix,this.fogMatrix,this._pitch),c.ae(this.fogMatrix,this.fogMatrix,this.angle),c.J(this.fogMatrix,this.fogMatrix,[-h,-p,0]),c.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=c.L(new Float64Array(16),this.labelPlaneMatrix,g);const ye=this.width%2/2,ne=this.height%2/2,xe=Math.cos(this.angle),Ie=Math.sin(this.angle),Ce=h-Math.round(h)+xe*ye+Ie*ne,je=p-Math.round(p)+xe*ne+Ie*ye,Je=new Float64Array(g);if(c.J(Je,Je,[Ce>.5?Ce-1:Ce,je>.5?je-1:je,0]),this.alignedModelViewProjectionMatrix=Je,g=c.at(new Float64Array(16),this.pixelMatrix),!g)throw new Error("failed to invert matrix");this.pixelMatrixInverse=g,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const i=this.pointCoordinate(new c.P(0,0)),h=[i.x*this.worldSize,i.y*this.worldSize,0,1];return c.ag(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,i))}getCameraQueryGeometry(i){const h=this.getCameraPoint();if(i.length===1)return[i[0],h];{let p=h.x,g=h.y,b=h.x,E=h.y;for(const I of i)p=Math.min(p,I.x),g=Math.min(g,I.y),b=Math.max(b,I.x),E=Math.max(E,I.y);return[new c.P(p,g),new c.P(b,g),new c.P(b,E),new c.P(p,E),new c.P(p,g)]}}lngLatToCameraDepth(i,h){const p=this.locationCoordinate(i),g=[p.x*this.worldSize,p.y*this.worldSize,h,1];return c.ag(g,g,this.modelViewProjectionMatrix),g[2]/g[3]}}function Bl(v,i){let h,p=!1,g=null,b=null;const E=()=>{g=null,p&&(v.apply(b,h),g=setTimeout(E,i),p=!1)};return(...I)=>(p=!0,b=this,h=I,g||E(),g)}class ja{constructor(i){this._getCurrentHash=()=>{const h=window.location.hash.replace("#","");if(this._hashName){let p;return h.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(p=g)}),(p&&p[1]||"").split("/")}return h.split("/")},this._onHashChange=()=>{const h=this._getCurrentHash();if(h.length>=3&&!h.some(p=>isNaN(p))){const p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:p,pitch:+(h[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const h=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,h)}catch{}},this._updateHash=Bl(this._updateHashUnthrottled,300),this._hashName=i&&encodeURIComponent(i)}addTo(i){return this._map=i,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(i){const h=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,g=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),b=Math.pow(10,g),E=Math.round(h.lng*b)/b,I=Math.round(h.lat*b)/b,C=this._map.getBearing(),L=this._map.getPitch();let $="";if($+=i?`/${E}/${I}/${p}`:`${p}/${I}/${E}`,(C||L)&&($+="/"+Math.round(10*C)/10),L&&($+=`/${Math.round(L)}`),this._hashName){const O=this._hashName;let H=!1;const K=window.location.hash.slice(1).split("&").map(te=>{const se=te.split("=")[0];return se===O?(H=!0,`${se}=${$}`):te}).filter(te=>te);return H||K.push(`${O}=${$}`),`#${K.join("&")}`}return`#${$}`}}const ms={linearity:.3,easing:c.b8(0,0,.3,1)},su=c.e({deceleration:2500,maxSpeed:1400},ms),au=c.e({deceleration:20,maxSpeed:1400},ms),lf=c.e({deceleration:1e3,maxSpeed:360},ms),Ol=c.e({deceleration:1e3,maxSpeed:90},ms);class $l{constructor(i){this._map=i,this.clear()}clear(){this._inertiaBuffer=[]}record(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:k.now(),settings:i})}_drainInertiaBuffer(){const i=this._inertiaBuffer,h=k.now();for(;i.length>0&&h-i[0].time>160;)i.shift()}_onMoveEnd(i){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:b}of this._inertiaBuffer)h.zoom+=b.zoomDelta||0,h.bearing+=b.bearingDelta||0,h.pitch+=b.pitchDelta||0,b.panDelta&&h.pan._add(b.panDelta),b.around&&(h.around=b.around),b.pinchAround&&(h.pinchAround=b.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(h.pan.mag()){const b=Nl(h.pan.mag(),p,c.e({},su,i||{}));g.offset=h.pan.mult(b.amount/h.pan.mag()),g.center=this._map.transform.center,Us(g,b)}if(h.zoom){const b=Nl(h.zoom,p,au);g.zoom=this._map.transform.zoom+b.amount,Us(g,b)}if(h.bearing){const b=Nl(h.bearing,p,lf);g.bearing=this._map.transform.bearing+c.ad(b.amount,-179,179),Us(g,b)}if(h.pitch){const b=Nl(h.pitch,p,Ol);g.pitch=this._map.transform.pitch+b.amount,Us(g,b)}if(g.zoom||g.bearing){const b=h.pinchAround===void 0?h.around:h.pinchAround;g.around=b?this._map.unproject(b):this._map.getCenter()}return this.clear(),c.e(g,{noMoveStart:!0})}}function Us(v,i){(!v.duration||v.durationh.unproject(C)),I=b.reduce((C,L,$,O)=>C.add(L.div(O.length)),new c.P(0,0));super(i,{points:b,point:I,lngLats:E,lngLat:h.unproject(I),originalEvent:p}),this._defaultPrevented=!1}}class lu extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,h,p){super(i,{originalEvent:p}),this._defaultPrevented=!1}}class jl{constructor(i,h){this._map=i,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(i){return this._firePreventable(new lu(i.type,this._map,i))}mousedown(i,h){return this._mousedownPos=h,this._firePreventable(new Qi(i.type,this._map,i))}mouseup(i){this._map.fire(new Qi(i.type,this._map,i))}click(i,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Qi(i.type,this._map,i))}dblclick(i){return this._firePreventable(new Qi(i.type,this._map,i))}mouseover(i){this._map.fire(new Qi(i.type,this._map,i))}mouseout(i){this._map.fire(new Qi(i.type,this._map,i))}touchstart(i){return this._firePreventable(new Va(i.type,this._map,i))}touchmove(i){this._map.fire(new Va(i.type,this._map,i))}touchend(i){this._map.fire(new Va(i.type,this._map,i))}touchcancel(i){this._map.fire(new Va(i.type,this._map,i))}_firePreventable(i){if(this._map.fire(i),i.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cu{constructor(i){this._map=i}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(i){this._map.fire(new Qi(i.type,this._map,i))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Qi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(i){this._delayContextMenu?this._contextMenuEvent=i:this._ignoreContextMenu||this._map.fire(new Qi(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class qs{constructor(i){this._map=i}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(i){return this.transform.pointLocation(c.P.convert(i),this._map.terrain)}}class uu{constructor(i,h){this._map=i,this._tr=new qs(i),this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(i,h){this.isEnabled()&&i.shiftKey&&i.button===0&&(T.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(i,h){if(!this._active)return;const p=h;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)b.fitScreenCoordinates(p,g,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",i)}keydown(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(T.remove(this._box),this._box=null),T.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(i,h){return this._map.fire(new c.k(i,{originalEvent:h}))}}function Gs(v,i){if(v.length!==i.length)throw new Error(`The number of touches and points are not equal - touches ${v.length}, points ${i.length}`);const h={};for(let p=0;pthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),p.length===this.numTouches&&(this.centroid=function(g){const b=new c.P(0,0);for(const E of g)b._add(E);return b.div(g.length)}(h),this.touches=Gs(p,h)))}touchmove(i,h,p){if(this.aborted||!this.centroid)return;const g=Gs(p,h);for(const b in this.touches){const E=g[b];(!E||E.dist(this.touches[b])>30)&&(this.aborted=!0)}}touchend(i,h,p){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class fu{constructor(i){this.singleTap=new hu(i),this.numTaps=i.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(i,h,p){this.singleTap.touchstart(i,h,p)}touchmove(i,h,p){this.singleTap.touchmove(i,h,p)}touchend(i,h,p){const g=this.singleTap.touchend(i,h,p);if(g){const b=i.timeStamp-this.lastTime<500,E=!this.lastTap||this.lastTap.dist(g)<30;if(b&&E||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class cf{constructor(i){this._tr=new qs(i),this._zoomIn=new fu({numTouches:1,numTaps:2}),this._zoomOut=new fu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(i,h,p){this._zoomIn.touchstart(i,h,p),this._zoomOut.touchstart(i,h,p)}touchmove(i,h,p){this._zoomIn.touchmove(i,h,p),this._zoomOut.touchmove(i,h,p)}touchend(i,h,p){const g=this._zoomIn.touchend(i,h,p),b=this._zoomOut.touchend(i,h,p),E=this._tr;return g?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom+1,around:E.unproject(g)},{originalEvent:i})}):b?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom-1,around:E.unproject(b)},{originalEvent:i})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Nr{constructor(i){this._enabled=!!i.enable,this._moveStateManager=i.moveStateManager,this._clickTolerance=i.clickTolerance||1,this._moveFunction=i.move,this._activateOnStart=!!i.activateOnStart,i.assignEvents(this),this.reset()}reset(i){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(i)}_move(...i){const h=this._moveFunction(...i);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(i,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(i)&&(this._moveStateManager.startMove(i),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(i,h){if(!this.isEnabled())return;const p=this._lastPoint;if(!p)return;if(i.preventDefault(),!this._moveStateManager.isValidMoveEvent(i))return void this.reset(i);const g=h.length?h[0]:h;return!this._moved&&g.dist(p){v.mousedown=v.dragStart,v.mousemoveWindow=v.dragMove,v.mouseup=v.dragEnd,v.contextmenu=i=>{i.preventDefault()}},du=({enable:v,clickTolerance:i,bearingDegreesPerPixelMoved:h=.8})=>{const p=new hn({checkCorrectEvent:g=>T.mouseButton(g)===0&&g.ctrlKey||T.mouseButton(g)===2});return new Nr({clickTolerance:i,move:(g,b)=>({bearingDelta:(b.x-g.x)*h}),moveStateManager:p,enable:v,assignEvents:Ua})},ys=({enable:v,clickTolerance:i,pitchDegreesPerPixelMoved:h=-.5})=>{const p=new hn({checkCorrectEvent:g=>T.mouseButton(g)===0&&g.ctrlKey||T.mouseButton(g)===2});return new Nr({clickTolerance:i,move:(g,b)=>({pitchDelta:(b.y-g.y)*h}),moveStateManager:p,enable:v,assignEvents:Ua})};class qa{constructor(i,h){this._clickTolerance=i.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(i,h,p){return this._calculateTransform(i,h,p)}touchmove(i,h,p){if(this._active&&!(p.length0&&(this._active=!0);const g=Gs(p,h),b=new c.P(0,0),E=new c.P(0,0);let I=0;for(const L in g){const $=g[L],O=this._touches[L];O&&(b._add($),E._add($.sub(O)),I++,g[L]=$)}if(this._touches=g,IMath.abs(v.x)}class _u extends Ga{constructor(i){super(),this._currentTouchCount=0,this._map=i}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(i,h,p){super.touchstart(i,h,p),this._currentTouchCount=p.length}_start(i){this._lastPoints=i,Po(i[0].sub(i[1]))&&(this._valid=!1)}_move(i,h,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const g=i[0].sub(this._lastPoints[0]),b=i[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(g,b,p.timeStamp),this._valid?(this._lastPoints=i,this._active=!0,{pitchDelta:(g.y+b.y)/2*-.5}):void 0}gestureBeginsVertically(i,h,p){if(this._valid!==void 0)return this._valid;const g=i.mag()>=2,b=h.mag()>=2;if(!g&&!b)return;if(!g||!b)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;const E=i.y>0==h.y>0;return Po(i)&&Po(h)&&E}}const uf={panStep:100,bearingStep:15,pitchStep:10};class vu{constructor(i){this._tr=new qs(i);const h=uf;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(i){if(i.altKey||i.ctrlKey||i.metaKey)return;let h=0,p=0,g=0,b=0,E=0;switch(i.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:i.shiftKey?p=-1:(i.preventDefault(),b=-1);break;case 39:i.shiftKey?p=1:(i.preventDefault(),b=1);break;case 38:i.shiftKey?g=1:(i.preventDefault(),E=-1);break;case 40:i.shiftKey?g=-1:(i.preventDefault(),E=1);break;default:return}return this._rotationDisabled&&(p=0,g=0),{cameraAnimation:I=>{const C=this._tr;I.easeTo({duration:300,easeId:"keyboardHandler",easing:hf,zoom:h?Math.round(C.zoom)+h*(i.shiftKey?2:1):C.zoom,bearing:C.bearing+p*this._bearingStep,pitch:C.pitch+g*this._pitchStep,offset:[-b*this._panStep,-E*this._panStep],center:C.center},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function hf(v){return v*(2-v)}const bu=4.000244140625;class xu{constructor(i,h){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=i,this._tr=new qs(i),this._triggerRenderFrame=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(i){this._defaultZoomRate=i}setWheelZoomRate(i){this._wheelZoomRate=i}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!i&&i.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(i){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!i[this._map.cooperativeGestures._bypassKey])return;let h=i.deltaMode===WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY;const p=k.now(),g=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,h!==0&&h%bu==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(g*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),i.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=i,this._delta-=h,this._active||this._start(i)),i.preventDefault()}_start(i){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const h=T.mousePos(this._map.getCanvas(),i),p=this._tr;this._around=h.y>p.transform.height/2-p.transform.getHorizon()?c.N.convert(this._aroundCenter?p.center:p.unproject(h)):c.N.convert(p.center),this._aroundPoint=p.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const i=this._tr.transform;if(this._delta!==0){const I=this._type==="wheel"&&Math.abs(this._delta)>bu?this._wheelZoomRate:this._defaultZoomRate;let C=2/(1+Math.exp(-Math.abs(this._delta*I)));this._delta<0&&C!==0&&(C=1/C);const L=typeof this._targetZoom=="number"?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(L*C))),this._type==="wheel"&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:i.zoom,p=this._startZoom,g=this._easing;let b,E=!1;if(this._type==="wheel"&&p&&g){const I=Math.min((k.now()-this._lastWheelEventTime)/200,1),C=g(I);b=c.z.number(p,h,C),I<1?this._frameId||(this._frameId=!0):E=!0}else b=h,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:b-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(i){let h=c.b9;if(this._prevEase){const p=this._prevEase,g=(k.now()-p.start)/p.duration,b=p.easing(g+.01)-p.easing(g),E=.27/Math.sqrt(b*b+1e-4)*.01,I=Math.sqrt(.0729-E*E);h=c.b8(E,I,.25,1)}return this._prevEase={start:k.now(),duration:i,easing:h},h}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class wu{constructor(i,h){this._clickZoom=i,this._tapZoom=h}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Ha{constructor(i){this._tr=new qs(i),this.reset()}reset(){this._active=!1}dblclick(i,h){return i.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:this._tr.zoom+(i.shiftKey?-1:1),around:this._tr.unproject(h)},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ff{constructor(){this._tap=new fu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(i,h,p){if(!this._swipePoint)if(this._tapTime){const g=h[0],b=i.timeStamp-this._tapTime<500,E=this._tapPoint.dist(g)<30;b&&E?p.length>0&&(this._swipePoint=g,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(i,h,p)}touchmove(i,h,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const g=h[0],b=g.y-this._swipePoint.y;return this._swipePoint=g,i.preventDefault(),this._active=!0,{zoomDelta:b/128}}}else this._tap.touchmove(i,h,p)}touchend(i,h,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{const g=this._tap.touchend(i,h,p);g&&(this._tapTime=i.timeStamp,this._tapPoint=g)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fn{constructor(i,h,p){this._el=i,this._mousePan=h,this._touchPan=p}enable(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class $n{constructor(i,h,p){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=h,this._mousePitch=p}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Su{constructor(i,h,p,g){this._el=i,this._touchZoom=h,this._touchRotate=p,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Nn{constructor(i,h){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=i,this._options=h,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const i=this._map.getCanvasContainer();i.classList.add("maplibregl-cooperative-gestures"),this._container=T.create("div","maplibregl-cooperative-gesture-screen",i);let h=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(h=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),g=document.createElement("div");g.className="maplibregl-desktop-message",g.textContent=h,this._container.appendChild(g);const b=document.createElement("div");b.className="maplibregl-mobile-message",b.textContent=p,this._container.appendChild(b),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(T.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(i){this._onCooperativeGesture(i.touches.length===1)}wheel(i){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!i[this._bypassKey])}_onCooperativeGesture(i){this._enabled&&i&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Mo=v=>v.zoom||v.drag||v.pitch||v.rotate;class Cp extends c.k{}function ku(v){return v.panDelta&&v.panDelta.mag()||v.zoomDelta||v.bearingDelta||v.pitchDelta}class Ap{constructor(i,h){this.handleWindowEvent=g=>{this.handleEvent(g,`${g.type}Window`)},this.handleEvent=(g,b)=>{if(g.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const E=g.type==="renderFrame"?void 0:g,I={needsRenderFrame:!1},C={},L={},$=g.touches,O=$?this._getMapTouches($):void 0,H=O?T.touchPos(this._map.getCanvas(),O):T.mousePos(this._map.getCanvas(),g);for(const{handlerName:se,handler:re,allowed:ue}of this._handlers){if(!re.isEnabled())continue;let ye;this._blockedByActive(L,ue,se)?re.reset():re[b||g.type]&&(ye=re[b||g.type](g,H,O),this.mergeHandlerResult(I,C,ye,se,E),ye&&ye.needsRenderFrame&&this._triggerRenderFrame()),(ye||re.isActive())&&(L[se]=re)}const K={};for(const se in this._previousActiveHandlers)L[se]||(K[se]=E);this._previousActiveHandlers=L,(Object.keys(K).length||ku(I))&&(this._changes.push([I,C,K]),this._triggerRenderFrame()),(Object.keys(L).length||ku(I))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:te}=I;te&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],te(this._map))},this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new $l(i),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[g,b,E]of this._listeners)T.addEventListener(g,b,g===document?this.handleWindowEvent:this.handleEvent,E)}destroy(){for(const[i,h,p]of this._listeners)T.removeEventListener(i,h,i===document?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(i){const h=this._map,p=h.getCanvasContainer();this._add("mapEvent",new jl(h,i));const g=h.boxZoom=new uu(h,i);this._add("boxZoom",g),i.interactive&&i.boxZoom&&g.enable();const b=h.cooperativeGestures=new Nn(h,i.cooperativeGestures);this._add("cooperativeGestures",b),i.cooperativeGestures&&b.enable();const E=new cf(h),I=new Ha(h);h.doubleClickZoom=new wu(I,E),this._add("tapZoom",E),this._add("clickZoom",I),i.interactive&&i.doubleClickZoom&&h.doubleClickZoom.enable();const C=new ff;this._add("tapDragZoom",C);const L=h.touchPitch=new _u(h);this._add("touchPitch",L),i.interactive&&i.touchPitch&&h.touchPitch.enable(i.touchPitch);const $=du(i),O=ys(i);h.dragRotate=new $n(i,$,O),this._add("mouseRotate",$,["mousePitch"]),this._add("mousePitch",O,["mouseRotate"]),i.interactive&&i.dragRotate&&h.dragRotate.enable();const H=(({enable:ye,clickTolerance:ne})=>{const xe=new hn({checkCorrectEvent:Ie=>T.mouseButton(Ie)===0&&!Ie.ctrlKey});return new Nr({clickTolerance:ne,move:(Ie,Ce)=>({around:Ce,panDelta:Ce.sub(Ie)}),activateOnStart:!0,moveStateManager:xe,enable:ye,assignEvents:Ua})})(i),K=new qa(i,h);h.dragPan=new Fn(p,H,K),this._add("mousePan",H),this._add("touchPan",K,["touchZoom","touchRotate"]),i.interactive&&i.dragPan&&h.dragPan.enable(i.dragPan);const te=new yu,se=new mu;h.touchZoomRotate=new Su(p,se,te,C),this._add("touchRotate",te,["touchPan","touchZoom"]),this._add("touchZoom",se,["touchPan","touchRotate"]),i.interactive&&i.touchZoomRotate&&h.touchZoomRotate.enable(i.touchZoomRotate);const re=h.scrollZoom=new xu(h,()=>this._triggerRenderFrame());this._add("scrollZoom",re,["mousePan"]),i.interactive&&i.scrollZoom&&h.scrollZoom.enable(i.scrollZoom);const ue=h.keyboard=new vu(h);this._add("keyboard",ue),i.interactive&&i.keyboard&&h.keyboard.enable(),this._add("blockableMapEvent",new cu(h))}_add(i,h,p){this._handlers.push({handlerName:i,handler:h,allowed:p}),this._handlersById[i]=h}stop(i){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}}isActive(){for(const{handler:i}of this._handlers)if(i.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Mo(this._eventsInProgress)||this.isZooming()}_blockedByActive(i,h,p){for(const g in i)if(g!==p&&(!h||h.indexOf(g)<0))return!0;return!1}_getMapTouches(i){const h=[];for(const p of i)this._el.contains(p.target)&&h.push(p);return h}mergeHandlerResult(i,h,p,g,b){if(!p)return;c.e(i,p);const E={handlerName:g,originalEvent:p.originalEvent||b};p.zoomDelta!==void 0&&(h.zoom=E),p.panDelta!==void 0&&(h.drag=E),p.pitchDelta!==void 0&&(h.pitch=E),p.bearingDelta!==void 0&&(h.rotate=E)}_applyChanges(){const i={},h={},p={};for(const[g,b,E]of this._changes)g.panDelta&&(i.panDelta=(i.panDelta||new c.P(0,0))._add(g.panDelta)),g.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(i.around=g.around),g.pinchAround!==void 0&&(i.pinchAround=g.pinchAround),g.noInertia&&(i.noInertia=g.noInertia),c.e(h,b),c.e(p,E);this._updateMapTransform(i,h,p),this._changes=[]}_updateMapTransform(i,h,p){const g=this._map,b=g._getTransformForUpdate(),E=g.terrain;if(!(ku(i)||E&&this._terrainMovement))return this._fireEvents(h,p,!0);let{panDelta:I,zoomDelta:C,bearingDelta:L,pitchDelta:$,around:O,pinchAround:H}=i;H!==void 0&&(O=H),g._stop(!0),O=O||g.transform.centerPoint;const K=b.pointLocation(I?O.sub(I):O);L&&(b.bearing+=L),$&&(b.pitch+=$),C&&(b.zoom+=C),E?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?b.center=b.pointLocation(b.centerPoint.sub(I)):b.setLocationAtPoint(K,O):(this._terrainMovement=!0,this._map._elevationFreeze=!0,b.setLocationAtPoint(K,O)):b.setLocationAtPoint(K,O),g._applyUpdatedTransform(b),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(h,p,!0)}_fireEvents(i,h,p){const g=Mo(this._eventsInProgress),b=Mo(i),E={};for(const O in i){const{originalEvent:H}=i[O];this._eventsInProgress[O]||(E[`${O}start`]=H),this._eventsInProgress[O]=i[O]}!g&&b&&this._fireEvent("movestart",b.originalEvent);for(const O in E)this._fireEvent(O,E[O]);b&&this._fireEvent("move",b.originalEvent);for(const O in i){const{originalEvent:H}=i[O];this._fireEvent(O,H)}const I={};let C;for(const O in this._eventsInProgress){const{handlerName:H,originalEvent:K}=this._eventsInProgress[O];this._handlersById[H].isActive()||(delete this._eventsInProgress[O],C=h[H]||K,I[`${O}end`]=C)}for(const O in I)this._fireEvent(O,I[O]);const L=Mo(this._eventsInProgress),$=(g||b)&&!L;if($&&this._terrainMovement&&(this._map._elevationFreeze=!1,this._terrainMovement=!1,this._map.transform.recalculateZoom(this._map.terrain)),p&&$){this._updatingCamera=!0;const O=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),H=K=>K!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Cp("renderFrame",{timeStamp:i})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class zp extends c.E{constructor(i,h){super(),this._renderFrameCallback=()=>{const p=Math.min((k.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=h.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.N(this.transform.center.lng,this.transform.center.lat)}setCenter(i,h){return this.jumpTo({center:i},h)}panBy(i,h,p){return i=c.P.convert(i).mult(-1),this.panTo(this.transform.center,c.e({offset:i},h),p)}panTo(i,h,p){return this.easeTo(c.e({center:i},h),p)}getZoom(){return this.transform.zoom}setZoom(i,h){return this.jumpTo({zoom:i},h),this}zoomTo(i,h,p){return this.easeTo(c.e({zoom:i},h),p)}zoomIn(i,h){return this.zoomTo(this.getZoom()+1,i,h),this}zoomOut(i,h){return this.zoomTo(this.getZoom()-1,i,h),this}getBearing(){return this.transform.bearing}setBearing(i,h){return this.jumpTo({bearing:i},h),this}getPadding(){return this.transform.padding}setPadding(i,h){return this.jumpTo({padding:i},h),this}rotateTo(i,h,p){return this.easeTo(c.e({bearing:i},h),p)}resetNorth(i,h){return this.rotateTo(0,c.e({duration:1e3},i),h),this}resetNorthPitch(i,h){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},i),h),this}snapToNorth(i,h){return Math.abs(this.getBearing()){if(this._zooming&&(g.zoom=c.z.number(b,re,je)),this._rotating&&(g.bearing=c.z.number(E,L,je)),this._pitching&&(g.pitch=c.z.number(I,$,je)),this._padding&&(g.interpolatePadding(C,O,je),K=g.centerPoint.add(H)),this.terrain&&!i.freezeElevation&&this._updateElevation(je),xe)g.setLocationAtPoint(xe,Ie);else{const Je=g.zoomScale(g.zoom-b),gt=re>b?Math.min(2,ne):Math.max(.5,ne),yt=Math.pow(gt,1-je),Qe=g.unproject(ue.add(ye.mult(je*yt)).mult(Je));g.setLocationAtPoint(g.renderWorldCopies?Qe.wrap():Qe,K)}this._applyUpdatedTransform(g),this._fireMoveEvents(h)},je=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(h,je)},i),this}_prepareEase(i,h,p={}){this._moving=!0,h||p.moving||this.fire(new c.k("movestart",i)),this._zooming&&!p.zooming&&this.fire(new c.k("zoomstart",i)),this._rotating&&!p.rotating&&this.fire(new c.k("rotatestart",i)),this._pitching&&!p.pitching&&this.fire(new c.k("pitchstart",i))}_prepareElevation(i){this._elevationCenter=i,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(i){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const h=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(i<1&&h!==this._elevationTarget){const p=this._elevationTarget-this._elevationStart;this._elevationStart+=i*(p-(h-(p*i+this._elevationStart))/(1-i)),this._elevationTarget=h}this.transform.elevation=c.z.number(this._elevationStart,this._elevationTarget,i)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(i){if(!this.transformCameraUpdate)return;const h=i.clone(),{center:p,zoom:g,pitch:b,bearing:E,elevation:I}=this.transformCameraUpdate(h);p&&(h.center=p),g!==void 0&&(h.zoom=g),b!==void 0&&(h.pitch=b),E!==void 0&&(h.bearing=E),I!==void 0&&(h.elevation=I),this.transform.apply(h)}_fireMoveEvents(i){this.fire(new c.k("move",i)),this._zooming&&this.fire(new c.k("zoom",i)),this._rotating&&this.fire(new c.k("rotate",i)),this._pitching&&this.fire(new c.k("pitch",i))}_afterEase(i,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const p=this._zooming,g=this._rotating,b=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new c.k("zoomend",i)),g&&this.fire(new c.k("rotateend",i)),b&&this.fire(new c.k("pitchend",i)),this.fire(new c.k("moveend",i))}flyTo(i,h){var p;if(!i.essential&&k.prefersReducedMotion){const ft=c.M(i,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ft,h)}this.stop(),i=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.b9},i);const g=this._getTransformForUpdate(),b=this.getZoom(),E=this.getBearing(),I=this.getPitch(),C=this.getPadding(),L="bearing"in i?this._normalizeBearing(i.bearing,E):E,$="pitch"in i?+i.pitch:I,O="padding"in i?i.padding:g.padding,H=c.P.convert(i.offset);let K=g.centerPoint.add(H);const te=g.pointLocation(K),{center:se,zoom:re}=g.getConstrained(c.N.convert(i.center||te),(p=i.zoom)!==null&&p!==void 0?p:b);this._normalizeCenter(se);const ue=g.zoomScale(re-b),ye=g.project(te),ne=g.project(se).sub(ye);let xe=i.curve;const Ie=Math.max(g.width,g.height),Ce=Ie/ue,je=ne.mag();if("minZoom"in i){const ft=c.ad(Math.min(i.minZoom,b,re),g.minZoom,g.maxZoom),jt=Ie/g.zoomScale(ft-b);xe=Math.sqrt(jt/je*2)}const Je=xe*xe;function gt(ft){const jt=(Ce*Ce-Ie*Ie+(ft?-1:1)*Je*Je*je*je)/(2*(ft?Ce:Ie)*Je*je);return Math.log(Math.sqrt(jt*jt+1)-jt)}function yt(ft){return(Math.exp(ft)-Math.exp(-ft))/2}function Qe(ft){return(Math.exp(ft)+Math.exp(-ft))/2}const it=gt(!1);let Et=function(ft){return Qe(it)/Qe(it+xe*ft)},Ut=function(ft){return Ie*((Qe(it)*(yt(jt=it+xe*ft)/Qe(jt))-yt(it))/Je)/je;var jt},st=(gt(!0)-it)/xe;if(Math.abs(je)<1e-6||!isFinite(st)){if(Math.abs(Ie-Ce)<1e-6)return this.easeTo(i,h);const ft=Ce0,Et=jt=>Math.exp(ft*xe*jt)}return i.duration="duration"in i?+i.duration:1e3*st/("screenSpeed"in i?+i.screenSpeed/xe:+i.speed),i.maxDuration&&i.duration>i.maxDuration&&(i.duration=0),this._zooming=!0,this._rotating=E!==L,this._pitching=$!==I,this._padding=!g.isPaddingEqual(O),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(se),this._ease(ft=>{const jt=ft*st,jr=1/Et(jt);g.zoom=ft===1?re:b+g.scaleZoom(jr),this._rotating&&(g.bearing=c.z.number(E,L,ft)),this._pitching&&(g.pitch=c.z.number(I,$,ft)),this._padding&&(g.interpolatePadding(C,O,ft),K=g.centerPoint.add(H)),this.terrain&&!i.freezeElevation&&this._updateElevation(ft);const Qt=ft===1?se:g.unproject(ye.add(ne.mult(Ut(jt))).mult(jr));g.setLocationAtPoint(g.renderWorldCopies?Qt.wrap():Qt,K),this._applyUpdatedTransform(g),this._fireMoveEvents(h)},()=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(h)},i),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(i,h){var p;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const g=this._onEaseEnd;delete this._onEaseEnd,g.call(this,h)}return i||(p=this.handlers)===null||p===void 0||p.stop(!1),this}_ease(i,h,p){p.animate===!1||p.duration===0?(i(1),h()):(this._easeStart=k.now(),this._easeOptions=p,this._onEaseFrame=i,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(i,h){i=c.b3(i,-180,180);const p=Math.abs(i-h);return Math.abs(i-360-h)180?-360:p<-180?360:0}queryTerrainElevation(i){return this.terrain?this.terrain.getElevationForLngLatZoom(c.N.convert(i),this.transform.tileZoom)-this.transform.elevation:null}}const Eu={compact:!0,customAttribution:'MapLibre'};class Zs{constructor(i=Eu){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=h=>{!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"&&h.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=i}getDefaultPosition(){return"bottom-right"}onAdd(i){return this._map=i,this._compact=this.options.compact,this._container=T.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=T.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=T.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){T.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(i,h){const p=this._map._getUIString(`AttributionControl.${h}`);i.title=p,i.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){const g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}const h=this._map.style.sourceCaches;for(const g in h){const b=h[g];if(b.used||b.usedForTerrain){const E=b.getSource();E.attribution&&i.indexOf(E.attribution)<0&&i.push(E.attribution)}}i=i.filter(g=>String(g).trim()),i.sort((g,b)=>g.length-b.length),i=i.filter((g,b)=>{for(let E=b+1;E=0)return!1;return!0});const p=i.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,i.length?(this._innerContainer.innerHTML=p,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class lo{constructor(i={}){this._updateCompact=()=>{const h=this._container.children;if(h.length){const p=h[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=i}getDefaultPosition(){return"bottom-left"}onAdd(i){this._map=i,this._compact=this.options&&this.options.compact,this._container=T.create("div","maplibregl-ctrl");const h=T.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){T.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class St{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(i){const h=++this._id;return this._queue.push({callback:i,id:h,cancelled:!1}),h}remove(i){const h=this._currentlyRunning,p=h?this._queue.concat(h):this._queue;for(const g of p)if(g.id===i)return void(g.cancelled=!0)}run(i=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const p of h)if(!p.cancelled&&(p.callback(i),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var df=c.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Pu extends c.E{constructor(i){super(),this.sourceCache=i,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,i.usedForTerrain=!0,i.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(i,h){this.sourceCache.update(i,h),this._renderableTilesKeys=[];const p={};for(const g of i.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))p[g.key]=!0,this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),c.aQ(g.posMatrix,0,c.X,0,c.X,0,1),this._tiles[g.key]=new Oo(g,this.tileSize));for(const g in this._tiles)p[g]||delete this._tiles[g]}freeRtt(i){for(const h in this._tiles){const p=this._tiles[h];(!i||p.tileID.equals(i)||p.tileID.isChildOf(i)||i.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(i=>this.getTileByID(i))}getTileByID(i){return this._tiles[i]}getTerrainCoords(i){const h={};for(const p of this._renderableTilesKeys){const g=this._tiles[p].tileID;if(g.canonical.equals(i.canonical)){const b=i.clone();b.posMatrix=new Float64Array(16),c.aQ(b.posMatrix,0,c.X,0,c.X,0,1),h[p]=b}else if(g.canonical.isChildOf(i.canonical)){const b=i.clone();b.posMatrix=new Float64Array(16);const E=g.canonical.z-i.canonical.z,I=g.canonical.x-(g.canonical.x>>E<>E<>E;c.aQ(b.posMatrix,0,L,0,L,0,1),c.J(b.posMatrix,b.posMatrix,[-I*L,-C*L,0]),h[p]=b}else if(i.canonical.isChildOf(g.canonical)){const b=i.clone();b.posMatrix=new Float64Array(16);const E=i.canonical.z-g.canonical.z,I=i.canonical.x-(i.canonical.x>>E<>E<>E;c.aQ(b.posMatrix,0,c.X,0,c.X,0,1),c.J(b.posMatrix,b.posMatrix,[I*L,C*L,0]),c.K(b.posMatrix,b.posMatrix,[1/2**E,1/2**E,0]),h[p]=b}}return h}getSourceTile(i,h){const p=this.sourceCache._source;let g=i.overscaledZ-this.deltaZoom;if(g>p.maxzoom&&(g=p.maxzoom),g=p.minzoom&&(!b||!b.dem);)b=this.sourceCache.getTileByID(i.scaledTo(g--).key);return b}tilesAfterTime(i=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=i)}}class pf{constructor(i,h,p){this.painter=i,this.sourceCache=new Pu(h),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(i,h,p,g=c.X){var b;if(!(h>=0&&h=0&&pi.canonical.z&&(i.canonical.z>=g?b=i.canonical.z-g:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const E=i.canonical.x-(i.canonical.x>>b<>b<>8<<4|b>>8,h[E+3]=0;const p=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),g=new ve(i,p,i.gl.RGBA,{premultiply:!1});return g.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._coordsTexture=g,g}pointCoordinate(i){this.painter.maybeDrawDepthAndCoords(!0);const h=new Uint8Array(4),p=this.painter.context,g=p.gl,b=Math.round(i.x*this.painter.pixelRatio/devicePixelRatio),E=Math.round(i.y*this.painter.pixelRatio/devicePixelRatio),I=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(b,I-E-1,1,1,g.RGBA,g.UNSIGNED_BYTE,h),p.bindFramebuffer.set(null);const C=h[0]+(h[2]>>4<<8),L=h[1]+((15&h[2])<<8),$=this.coordsIndex[255-h[3]],O=$&&this.sourceCache.getTileByID($);if(!O)return null;const H=this._coordsTextureSize,K=(1<i.id!==h),this._recentlyUsed.push(i.id)}stampObject(i){i.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const i=this._createObject(this._objects.length);return this._objects.push(i),i}freeObject(i){i.inUse=!1}freeAllObjects(){for(const i of this._objects)this.freeObject(i)}isFull(){return!(this._objects.length!i.inUse)===!1}}const co={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class mf{constructor(i,h){this.painter=i,this.terrain=h,this.pool=new Wa(i.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(i){return this.pool.getObjectForId(i.rtt[this._stacks.length-1].id).texture}prepareForRender(i,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=i._order.filter(p=>!i._layers[p].isHidden(h)),this._coordsDescendingInv={};for(const p in i.sourceCaches){this._coordsDescendingInv[p]={};const g=i.sourceCaches[p].getVisibleCoordinates();for(const b of g){const E=this.terrain.sourceCache.getTerrainCoords(b);for(const I in E)this._coordsDescendingInv[p][I]||(this._coordsDescendingInv[p][I]=[]),this._coordsDescendingInv[p][I].push(E[I])}}this._coordsDescendingInvStr={};for(const p of i._order){const g=i._layers[p],b=g.source;if(co[g.type]&&!this._coordsDescendingInvStr[b]){this._coordsDescendingInvStr[b]={};for(const E in this._coordsDescendingInv[b])this._coordsDescendingInvStr[b][E]=this._coordsDescendingInv[b][E].map(I=>I.key).sort().join()}}for(const p of this._renderableTiles)for(const g in this._coordsDescendingInvStr){const b=this._coordsDescendingInvStr[g][p.tileID.key];b&&b!==p.rttCoords[g]&&(p.rtt=[])}}renderLayer(i){if(i.isHidden(this.painter.transform.zoom))return!1;const h=i.type,p=this.painter,g=this._renderableLayerIds[this._renderableLayerIds.length-1]===i.id;if(co[h]&&(this._prevType&&co[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(i.id),!g))return!0;if(co[this._prevType]||co[h]&&g){this._prevType=h;const b=this._stacks.length-1,E=this._stacks[b]||[];for(const I of this._renderableTiles){if(this.pool.isFull()&&(Na(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(I),I.rtt[b]){const L=this.pool.getObjectForId(I.rtt[b].id);if(L.stamp===I.rtt[b].stamp){this.pool.useObject(L);continue}}const C=this.pool.getOrCreateFreeObject();this.pool.useObject(C),this.pool.stampObject(C),I.rtt[b]={id:C.id,stamp:C.stamp},p.context.bindFramebuffer.set(C.fbo.framebuffer),p.context.clear({color:c.aN.transparent,stencil:0}),p.currentStencilSource=void 0;for(let L=0;L{v.touchstart=v.dragStart,v.touchmoveWindow=v.dragMove,v.touchend=v.dragEnd},Iu={showCompass:!0,showZoom:!0,visualizePitch:!1};class yf{constructor(i,h,p=!1){this.mousedown=E=>{this.startMouse(c.e({},E,{ctrlKey:!0,preventDefault:()=>E.preventDefault()}),T.mousePos(this.element,E)),T.addEventListener(window,"mousemove",this.mousemove),T.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=E=>{this.moveMouse(E,T.mousePos(this.element,E))},this.mouseup=E=>{this.mouseRotate.dragEnd(E),this.mousePitch&&this.mousePitch.dragEnd(E),this.offTemp()},this.touchstart=E=>{E.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=T.touchPos(this.element,E.targetTouches)[0],this.startTouch(E,this._startPos),T.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),T.addEventListener(window,"touchend",this.touchend))},this.touchmove=E=>{E.targetTouches.length!==1?this.reset():(this._lastPos=T.touchPos(this.element,E.targetTouches)[0],this.moveTouch(E,this._lastPos))},this.touchend=E=>{E.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const g=i.dragRotate._mouseRotate.getClickTolerance(),b=i.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=du({clickTolerance:g,enable:!0}),this.touchRotate=(({enable:E,clickTolerance:I,bearingDegreesPerPixelMoved:C=.8})=>{const L=new Vl;return new Nr({clickTolerance:I,move:($,O)=>({bearingDelta:(O.x-$.x)*C}),moveStateManager:L,enable:E,assignEvents:gf})})({clickTolerance:g,enable:!0}),this.map=i,p&&(this.mousePitch=ys({clickTolerance:b,enable:!0}),this.touchPitch=(({enable:E,clickTolerance:I,pitchDegreesPerPixelMoved:C=-.5})=>{const L=new Vl;return new Nr({clickTolerance:I,move:($,O)=>({pitchDelta:(O.y-$.y)*C}),moveStateManager:L,enable:E,assignEvents:gf})})({clickTolerance:b,enable:!0})),T.addEventListener(h,"mousedown",this.mousedown),T.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),T.addEventListener(h,"touchcancel",this.reset)}startMouse(i,h){this.mouseRotate.dragStart(i,h),this.mousePitch&&this.mousePitch.dragStart(i,h),T.disableDrag()}startTouch(i,h){this.touchRotate.dragStart(i,h),this.touchPitch&&this.touchPitch.dragStart(i,h),T.disableDrag()}moveMouse(i,h){const p=this.map,{bearingDelta:g}=this.mouseRotate.dragMove(i,h)||{};if(g&&p.setBearing(p.getBearing()+g),this.mousePitch){const{pitchDelta:b}=this.mousePitch.dragMove(i,h)||{};b&&p.setPitch(p.getPitch()+b)}}moveTouch(i,h){const p=this.map,{bearingDelta:g}=this.touchRotate.dragMove(i,h)||{};if(g&&p.setBearing(p.getBearing()+g),this.touchPitch){const{pitchDelta:b}=this.touchPitch.dragMove(i,h)||{};b&&p.setPitch(p.getPitch()+b)}}off(){const i=this.element;T.removeEventListener(i,"mousedown",this.mousedown),T.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),T.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),T.removeEventListener(window,"touchend",this.touchend),T.removeEventListener(i,"touchcancel",this.reset),this.offTemp()}offTemp(){T.enableDrag(),T.removeEventListener(window,"mousemove",this.mousemove),T.removeEventListener(window,"mouseup",this.mouseup),T.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),T.removeEventListener(window,"touchend",this.touchend)}}let qo;function _f(v,i,h){const p=new c.N(v.lng,v.lat);if(v=new c.N(v.lng,v.lat),i){const g=new c.N(v.lng-360,v.lat),b=new c.N(v.lng+360,v.lat),E=h.locationPoint(v).distSqr(i);h.locationPoint(g).distSqr(i)180;){const g=h.locationPoint(v);if(g.x>=0&&g.y>=0&&g.x<=h.width&&g.y<=h.height)break;v.lng>h.center.lng?v.lng-=360:v.lng+=360}return v.lng!==p.lng&&h.locationPoint(v).y>h.height/2-h.getHorizon()?v:p}const Tu={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Go(v,i,h){const p=v.classList;for(const g in Tu)p.remove(`maplibregl-${h}-anchor-${g}`);p.add(`maplibregl-${h}-anchor-${i}`)}class zr extends c.E{constructor(i){if(super(),this._onKeyPress=h=>{const p=h.code,g=h.charCode||h.keyCode;p!=="Space"&&p!=="Enter"&&g!==32&&g!==13||this.togglePopup()},this._onMapClick=h=>{const p=h.originalEvent.target,g=this._element;this._popup&&(p===g||g.contains(p))&&this.togglePopup()},this._update=h=>{var p;if(!this._map)return;const g=this._map.loaded()&&!this._map.isMoving();((h==null?void 0:h.type)==="terrain"||(h==null?void 0:h.type)==="render"&&!g)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?_f(this._lngLat,this._flatPos,this._map.transform):(p=this._lngLat)===null||p===void 0?void 0:p.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let b="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?b=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(b=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let E="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?E="rotateX(0deg)":this._pitchAlignment==="map"&&(E=`rotateX(${this._map.getPitch()}deg)`),h&&h.type!=="moveend"||(this._pos=this._pos.round()),T.setTransform(this._element,`${Tu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${E} ${b}`),k.frameAsync(new AbortController).then(()=>{this._updateOpacity(h&&h.type==="moveend")}).catch(()=>{})},this._onMove=h=>{if(!this._isDragging){const p=this._clickTolerance||this._map._clickTolerance;this._isDragging=h.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=h.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=h=>{this._element.contains(h.originalEvent.target)&&(h.preventDefault(),this._positionDelta=h.point.sub(this._pos).add(this._offset),this._pointerdownPos=h.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&i.pitchAlignment!=="auto"?i.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(i==null?void 0:i.opacity,i==null?void 0:i.opacityWhenCovered),i&&i.element)this._element=i.element,this._offset=c.P.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=T.create("div");const h=T.createNS("http://www.w3.org/2000/svg","svg"),p=41,g=27;h.setAttributeNS(null,"display","block"),h.setAttributeNS(null,"height",`${p}px`),h.setAttributeNS(null,"width",`${g}px`),h.setAttributeNS(null,"viewBox",`0 0 ${g} ${p}`);const b=T.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"stroke","none"),b.setAttributeNS(null,"stroke-width","1"),b.setAttributeNS(null,"fill","none"),b.setAttributeNS(null,"fill-rule","evenodd");const E=T.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");const I=T.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(3.0, 29.0)"),I.setAttributeNS(null,"fill","#000000");const C=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ue of C){const ye=T.createNS("http://www.w3.org/2000/svg","ellipse");ye.setAttributeNS(null,"opacity","0.04"),ye.setAttributeNS(null,"cx","10.5"),ye.setAttributeNS(null,"cy","5.80029008"),ye.setAttributeNS(null,"rx",ue.rx),ye.setAttributeNS(null,"ry",ue.ry),I.appendChild(ye)}const L=T.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"fill",this._color);const $=T.createNS("http://www.w3.org/2000/svg","path");$.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),L.appendChild($);const O=T.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"opacity","0.25"),O.setAttributeNS(null,"fill","#000000");const H=T.createNS("http://www.w3.org/2000/svg","path");H.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),O.appendChild(H);const K=T.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(6.0, 7.0)"),K.setAttributeNS(null,"fill","#FFFFFF");const te=T.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"transform","translate(8.0, 8.0)");const se=T.createNS("http://www.w3.org/2000/svg","circle");se.setAttributeNS(null,"fill","#000000"),se.setAttributeNS(null,"opacity","0.25"),se.setAttributeNS(null,"cx","5.5"),se.setAttributeNS(null,"cy","5.5"),se.setAttributeNS(null,"r","5.4999962");const re=T.createNS("http://www.w3.org/2000/svg","circle");re.setAttributeNS(null,"fill","#FFFFFF"),re.setAttributeNS(null,"cx","5.5"),re.setAttributeNS(null,"cy","5.5"),re.setAttributeNS(null,"r","5.4999962"),te.appendChild(se),te.appendChild(re),E.appendChild(I),E.appendChild(L),E.appendChild(O),E.appendChild(K),E.appendChild(te),h.appendChild(E),h.setAttributeNS(null,"height",p*this._scale+"px"),h.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(h),this._offset=c.P.convert(i&&i.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",h=>{h.preventDefault()}),this._element.addEventListener("mousedown",h=>{h.preventDefault()}),Go(this._element,this._anchor,"marker"),i&&i.className)for(const h of i.className.split(" "))this._element.classList.add(h);this._popup=null}addTo(i){return this.remove(),this._map=i,this._element.setAttribute("aria-label",i._getUIString("Marker.Title")),i.getCanvasContainer().appendChild(this._element),i.on("move",this._update),i.on("moveend",this._update),i.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),T.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=c.N.convert(i),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(i){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),i){if(!("offset"in i.options)){const g=Math.abs(13.5)/Math.SQRT2;i.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=i,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const i=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:i?(i.isOpen()?i.remove():(i.setLngLat(this._lngLat),i.addTo(this._map)),this):this}_updateOpacity(i=!1){var h,p;if(!(!((h=this._map)===null||h===void 0)&&h.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(i)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const g=this._map,b=g.terrain.depthAtPoint(this._pos),E=g.terrain.getElevationForLngLatZoom(this._lngLat,g.transform.tileZoom);if(g.transform.lngLatToCameraDepth(this._lngLat,E)-b<.006)return void(this._element.style.opacity=this._opacity);const I=-this._offset.y/g.transform._pixelPerMeter,C=Math.sin(g.getPitch()*Math.PI/180)*I,L=g.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),$=g.transform.lngLatToCameraDepth(this._lngLat,E+C)-L>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&$&&this._popup.remove(),this._element.style.opacity=$?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(i){return this._offset=c.P.convert(i),this._update(),this}addClassName(i){this._element.classList.add(i)}removeClassName(i){this._element.classList.remove(i)}toggleClassName(i){return this._element.classList.toggle(i)}setDraggable(i){return this._draggable=!!i,this._map&&(i?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(i){return this._rotation=i||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(i){return this._rotationAlignment=i||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(i){return this._pitchAlignment=i&&i!=="auto"?i:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(i,h){return i===void 0&&h===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),i!==void 0&&(this._opacity=i),h!==void 0&&(this._opacityWhenCovered=h),this._map&&this._updateOpacity(!0),this}}const Ul={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Hs=0,Ws=!1;const vf={maxWidth:100,unit:"metric"};function Cu(v,i,h){const p=h&&h.maxWidth||100,g=v._container.clientHeight/2,b=v.unproject([0,g]),E=v.unproject([p,g]),I=b.distanceTo(E);if(h&&h.unit==="imperial"){const C=3.2808*I;C>5280?Xa(i,p,C/5280,v._getUIString("ScaleControl.Miles")):Xa(i,p,C,v._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?Xa(i,p,I/1852,v._getUIString("ScaleControl.NauticalMiles")):I>=1e3?Xa(i,p,I/1e3,v._getUIString("ScaleControl.Kilometers")):Xa(i,p,I,v._getUIString("ScaleControl.Meters"))}function Xa(v,i,h,p){const g=function(b){const E=Math.pow(10,`${Math.floor(b)}`.length-1);let I=b/E;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:function(C){const L=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*L)/L}(I),E*I}(h);v.style.width=i*(g/h)+"px",v.innerHTML=`${g} ${p}`}const uo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ql=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function It(v){if(v){if(typeof v=="number"){const i=Math.round(Math.abs(v)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,v),"top-left":new c.P(i,i),"top-right":new c.P(-i,i),bottom:new c.P(0,-v),"bottom-left":new c.P(i,-i),"bottom-right":new c.P(-i,-i),left:new c.P(v,0),right:new c.P(-v,0)}}if(v instanceof c.P||Array.isArray(v)){const i=c.P.convert(v);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:c.P.convert(v.center||[0,0]),top:c.P.convert(v.top||[0,0]),"top-left":c.P.convert(v["top-left"]||[0,0]),"top-right":c.P.convert(v["top-right"]||[0,0]),bottom:c.P.convert(v.bottom||[0,0]),"bottom-left":c.P.convert(v["bottom-left"]||[0,0]),"bottom-right":c.P.convert(v["bottom-right"]||[0,0]),left:c.P.convert(v.left||[0,0]),right:c.P.convert(v.right||[0,0])}}return It(new c.P(0,0))}const Bt=y;f.AJAXError=c.bg,f.Evented=c.E,f.LngLat=c.N,f.MercatorCoordinate=c.Z,f.Point=c.P,f.addProtocol=c.bh,f.config=c.a,f.removeProtocol=c.bi,f.AttributionControl=Zs,f.BoxZoomHandler=uu,f.CanvasSource=Ln,f.CooperativeGesturesHandler=Nn,f.DoubleClickZoomHandler=wu,f.DragPanHandler=Fn,f.DragRotateHandler=$n,f.EdgeInsets=Rl,f.FullscreenControl=class extends c.E{constructor(v={}){super(),this._onFullscreenChange=()=>{var i;let h=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((i=h==null?void 0:h.shadowRoot)===null||i===void 0)&&i.fullscreenElement;)h=h.shadowRoot.fullscreenElement;h===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,v&&v.container&&(v.container instanceof HTMLElement?this._container=v.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(v){return this._map=v,this._container||(this._container=this._map.getContainer()),this._controlContainer=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){T.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const v=this._fullscreenButton=T.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);T.create("span","maplibregl-ctrl-icon",v).setAttribute("aria-hidden","true"),v.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const v=this._getTitle();this._fullscreenButton.setAttribute("aria-label",v),this._fullscreenButton.title=v}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},f.GeoJSONSource=ka,f.GeolocateControl=class extends c.E{constructor(v){super(),this._onSuccess=i=>{if(this._map){if(this._isOutOfMapMaxBounds(i))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",i)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=i,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(i),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(i),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",i)),this._finish()}},this._updateCamera=i=>{const h=new c.N(i.coords.longitude,i.coords.latitude),p=i.coords.accuracy,g=this._map.getBearing(),b=c.e({bearing:g},this.options.fitBoundsOptions),E=Te.fromLngLat(h,p);this._map.fitBounds(E,b,{geolocateSource:!0})},this._updateMarker=i=>{if(i){const h=new c.N(i.coords.longitude,i.coords.latitude);this._accuracyCircleMarker.setLngLat(h).addTo(this._map),this._userLocationDotMarker.setLngLat(h).addTo(this._map),this._accuracy=i.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=i=>{if(this._map){if(this.options.trackUserLocation)if(i.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(i.code===3&&Ws)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",i)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=i=>{if(this._map){if(this._container.addEventListener("contextmenu",h=>h.preventDefault()),this._geolocateButton=T.create("button","maplibregl-ctrl-geolocate",this._container),T.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",i===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}else{const h=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=T.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new zr({element:this._dotElement}),this._circleElement=T.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new zr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",h=>{h.geolocateSource||this._watchState!=="ACTIVE_LOCK"||h.originalEvent&&h.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")),this.fire(new c.k("userlocationlostfocus")))})}},this.options=c.e({},Ul,v)}onAdd(v){return this._map=v,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return c._(this,arguments,void 0,function*(i=!1){if(qo!==void 0&&!i)return qo;if(window.navigator.permissions===void 0)return qo=!!window.navigator.geolocation,qo;try{qo=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{qo=!!window.navigator.geolocation}return qo})}().then(i=>this._setupUI(i)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),T.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Hs=0,Ws=!1}_isOutOfMapMaxBounds(v){const i=this._map.getMaxBounds(),h=v.coords;return i&&(h.longitudei.getEast()||h.latitudei.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const v=this._map.getBounds(),i=v.getSouthEast(),h=v.getNorthEast(),p=i.distanceTo(h),g=Math.ceil(this._accuracy/(p/this._map._container.clientHeight)*2);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}px`}trigger(){if(!this._setup)return c.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Hs--,Ws=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart")),this.fire(new c.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let v;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Hs++,Hs>1?(v={maximumAge:6e5,timeout:0},Ws=!0):(v=this.options.positionOptions,Ws=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,v)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},f.Hash=ja,f.ImageSource=wo,f.KeyboardHandler=vu,f.LngLatBounds=Te,f.LogoControl=lo,f.Map=class extends zp{constructor(v){c.be.mark(c.bf.create);const i=Object.assign(Object.assign({},Lp),v);if(i.minZoom!=null&&i.maxZoom!=null&&i.minZoom>i.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(i.minPitch!=null&&i.maxPitch!=null&&i.minPitch>i.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(i.minPitch!=null&&i.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(i.maxPitch!=null&&i.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ou(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new St,this._controls=[],this._mapId=c.a4(),this._contextLost=h=>{h.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.k("webglcontextlost",{originalEvent:h}))},this._contextRestored=h=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:h}))},this._onMapScroll=h=>{if(h.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=i.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=i.preserveDrawingBuffer===!0,this._antialias=i.antialias===!0,this._trackResize=i.trackResize===!0,this._bearingSnap=i.bearingSnap,this._refreshExpiredTiles=i.refreshExpiredTiles===!0,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=i.crossSourceCollisions===!0,this._collectResourceTiming=i.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},pt),i.locale),this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=i.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=V.addThrottleControl(()=>this.isMoving()),this._requestManager=new me(i.transformRequest),typeof i.container=="string"){if(this._container=document.getElementById(i.container),!this._container)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let h=!1;const p=Bl(g=>{this._trackResize&&!this._removed&&this.resize(g)._update()},50);this._resizeObserver=new ResizeObserver(g=>{h?p(g):h=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Ap(this,i),this._hash=i.hash&&new ja(typeof i.hash=="string"&&i.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,c.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new Zs(typeof i.attributionControl=="boolean"?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new lo,i.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update(h.dataType==="style"),this.fire(new c.k(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new c.k(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new c.k("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(v,i){if(i===void 0&&(i=v.getDefaultPosition?v.getDefaultPosition():"top-right"),!v||!v.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=v.onAdd(this);this._controls.push(v);const p=this._controlPositions[i];return i.indexOf("bottom")!==-1?p.insertBefore(h,p.firstChild):p.appendChild(h),this}removeControl(v){if(!v||!v.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(v);return i>-1&&this._controls.splice(i,1),v.onRemove(this),this}hasControl(v){return this._controls.indexOf(v)>-1}calculateCameraOptionsFromTo(v,i,h,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLatZoom(h,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(v,i,h,p)}resize(v){var i;const h=this._containerDimensions(),p=h[0],g=h[1],b=this._getClampedPixelRatio(p,g);if(this._resizeCanvas(p,g,b),this.painter.resize(p,g,b),this.painter.overLimit()){const I=this.painter.context.gl;this._maxCanvasSize=[I.drawingBufferWidth,I.drawingBufferHeight];const C=this._getClampedPixelRatio(p,g);this._resizeCanvas(p,g,C),this.painter.resize(p,g,C)}this.transform.resize(p,g),(i=this._requestedCameraState)===null||i===void 0||i.resize(p,g);const E=!this._moving;return E&&(this.stop(),this.fire(new c.k("movestart",v)).fire(new c.k("move",v))),this.fire(new c.k("resize",v)),E&&this.fire(new c.k("moveend",v)),this}_getClampedPixelRatio(v,i){const{0:h,1:p}=this._maxCanvasSize,g=this.getPixelRatio(),b=v*g,E=i*g;return Math.min(b>h?h/b:1,E>p?p/E:1)*g}getPixelRatio(){var v;return(v=this._overridePixelRatio)!==null&&v!==void 0?v:devicePixelRatio}setPixelRatio(v){this._overridePixelRatio=v,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(v){return this.transform.setMaxBounds(Te.convert(v)),this._update()}setMinZoom(v){if((v=v??-2)>=-2&&v<=this.transform.maxZoom)return this.transform.minZoom=v,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=v,this._update(),this.getZoom()>v&&this.setZoom(v),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(v){if((v=v??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(v>=0&&v<=this.transform.maxPitch)return this.transform.minPitch=v,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(v>=this.transform.minPitch)return this.transform.maxPitch=v,this._update(),this.getPitch()>v&&this.setPitch(v),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(v){return this.transform.renderWorldCopies=v,this._update()}project(v){return this.transform.locationPoint(c.N.convert(v),this.style&&this.terrain)}unproject(v){return this.transform.pointLocation(c.P.convert(v),this.terrain)}isMoving(){var v;return this._moving||((v=this.handlers)===null||v===void 0?void 0:v.isMoving())}isZooming(){var v;return this._zooming||((v=this.handlers)===null||v===void 0?void 0:v.isZooming())}isRotating(){var v;return this._rotating||((v=this.handlers)===null||v===void 0?void 0:v.isRotating())}_createDelegatedListener(v,i,h){if(v==="mouseenter"||v==="mouseover"){let p=!1;return{layer:i,listener:h,delegates:{mousemove:b=>{const E=this.getLayer(i)?this.queryRenderedFeatures(b.point,{layers:[i]}):[];E.length?p||(p=!0,h.call(this,new Qi(v,this,b.originalEvent,{features:E}))):p=!1},mouseout:()=>{p=!1}}}}if(v==="mouseleave"||v==="mouseout"){let p=!1;return{layer:i,listener:h,delegates:{mousemove:E=>{(this.getLayer(i)?this.queryRenderedFeatures(E.point,{layers:[i]}):[]).length?p=!0:p&&(p=!1,h.call(this,new Qi(v,this,E.originalEvent)))},mouseout:E=>{p&&(p=!1,h.call(this,new Qi(v,this,E.originalEvent)))}}}}{const p=g=>{const b=this.getLayer(i)?this.queryRenderedFeatures(g.point,{layers:[i]}):[];b.length&&(g.features=b,h.call(this,g),delete g.features)};return{layer:i,listener:h,delegates:{[v]:p}}}}on(v,i,h){if(h===void 0)return super.on(v,i);const p=this._createDelegatedListener(v,i,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[v]=this._delegatedListeners[v]||[],this._delegatedListeners[v].push(p);for(const g in p.delegates)this.on(g,p.delegates[g]);return this}once(v,i,h){if(h===void 0)return super.once(v,i);const p=this._createDelegatedListener(v,i,h);for(const g in p.delegates)this.once(g,p.delegates[g]);return this}off(v,i,h){return h===void 0?super.off(v,i):(this._delegatedListeners&&this._delegatedListeners[v]&&(p=>{const g=this._delegatedListeners[v];for(let b=0;bthis._updateStyle(v,i));const h=this.style&&i.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!v)),v?(this.style=new Nc(this,i||{}),this.style.setEventedParent(this,{style:this.style}),typeof v=="string"?this.style.loadURL(v,i,h):this.style.loadJSON(v,i,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Nc(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(v,i){if(typeof v=="string"){const h=this._requestManager.transformRequest(v,"Style");c.h(h,new AbortController).then(p=>{this._updateDiff(p.data,i)}).catch(p=>{p&&this.fire(new c.j(p))})}else typeof v=="object"&&this._updateDiff(v,i)}_updateDiff(v,i){try{this.style.setState(v,i)&&this._update(!0)}catch(h){c.w(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(v,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(v,i){return this._lazyInitEmptyStyle(),this.style.addSource(v,i),this._update(!0)}isSourceLoaded(v){const i=this.style&&this.style.sourceCaches[v];if(i!==void 0)return i.loaded();this.fire(new c.j(new Error(`There is no source with ID '${v}'`)))}setTerrain(v){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),v){const i=this.style.sourceCaches[v.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${v.source}`);this.terrain===null&&i.reload();for(const h in this.style._layers){const p=this.style._layers[h];p.type==="hillshade"&&p.source===v.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new pf(this.painter,i,v),this.painter.renderToTexture=new mf(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=h=>{h.dataType==="style"?this.terrain.sourceCache.freeRtt():h.dataType==="source"&&h.tile&&(h.sourceId!==v.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:v})),this}getTerrain(){var v,i;return(i=(v=this.terrain)===null||v===void 0?void 0:v.options)!==null&&i!==void 0?i:null}areTilesLoaded(){const v=this.style&&this.style.sourceCaches;for(const i in v){const h=v[i]._tiles;for(const p in h){const g=h[p];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}removeSource(v){return this.style.removeSource(v),this._update(!0)}getSource(v){return this.style.getSource(v)}addImage(v,i,h={}){const{pixelRatio:p=1,sdf:g=!1,stretchX:b,stretchY:E,content:I,textFitWidth:C,textFitHeight:L}=h;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||c.b(i))){if(i.width===void 0||i.height===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:$,height:O,data:H}=i,K=i;return this.style.addImage(v,{data:new c.R({width:$,height:O},new Uint8Array(H)),pixelRatio:p,stretchX:b,stretchY:E,content:I,textFitWidth:C,textFitHeight:L,sdf:g,version:0,userImage:K}),K.onAdd&&K.onAdd(this,v),this}}{const{width:$,height:O,data:H}=k.getImageData(i);this.style.addImage(v,{data:new c.R({width:$,height:O},H),pixelRatio:p,stretchX:b,stretchY:E,content:I,textFitWidth:C,textFitHeight:L,sdf:g,version:0})}}updateImage(v,i){const h=this.style.getImage(v);if(!h)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const p=i instanceof HTMLImageElement||c.b(i)?k.getImageData(i):i,{width:g,height:b,data:E}=p;if(g===void 0||b===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(g!==h.data.width||b!==h.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(i instanceof HTMLImageElement||c.b(i));return h.data.replace(E,I),this.style.updateImage(v,h),this}getImage(v){return this.style.getImage(v)}hasImage(v){return v?!!this.style.getImage(v):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(v){this.style.removeImage(v)}loadImage(v){return V.getImage(this._requestManager.transformRequest(v,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(v,i){return this._lazyInitEmptyStyle(),this.style.addLayer(v,i),this._update(!0)}moveLayer(v,i){return this.style.moveLayer(v,i),this._update(!0)}removeLayer(v){return this.style.removeLayer(v),this._update(!0)}getLayer(v){return this.style.getLayer(v)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(v,i,h){return this.style.setLayerZoomRange(v,i,h),this._update(!0)}setFilter(v,i,h={}){return this.style.setFilter(v,i,h),this._update(!0)}getFilter(v){return this.style.getFilter(v)}setPaintProperty(v,i,h,p={}){return this.style.setPaintProperty(v,i,h,p),this._update(!0)}getPaintProperty(v,i){return this.style.getPaintProperty(v,i)}setLayoutProperty(v,i,h,p={}){return this.style.setLayoutProperty(v,i,h,p),this._update(!0)}getLayoutProperty(v,i){return this.style.getLayoutProperty(v,i)}setGlyphs(v,i={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(v,i),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(v,i,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(v,i,h,p=>{p||this._update(!0)}),this}removeSprite(v){return this._lazyInitEmptyStyle(),this.style.removeSprite(v),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(v,i={}){return this._lazyInitEmptyStyle(),this.style.setSprite(v,i,h=>{h||this._update(!0)}),this}setLight(v,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(v,i),this._update(!0)}getLight(){return this.style.getLight()}setSky(v){return this._lazyInitEmptyStyle(),this.style.setSky(v),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(v,i){return this.style.setFeatureState(v,i),this._update()}removeFeatureState(v,i){return this.style.removeFeatureState(v,i),this._update()}getFeatureState(v){return this.style.getFeatureState(v)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let v=0,i=0;return this._container&&(v=this._container.clientWidth||400,i=this._container.clientHeight||300),[v,i]}_setupContainer(){const v=this._container;v.classList.add("maplibregl-map");const i=this._canvasContainer=T.create("div","maplibregl-canvas-container",v);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=T.create("canvas","maplibregl-canvas",i),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const h=this._containerDimensions(),p=this._getClampedPixelRatio(h[0],h[1]);this._resizeCanvas(h[0],h[1],p);const g=this._controlContainer=T.create("div","maplibregl-control-container",v),b=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(E=>{b[E]=T.create("div",`maplibregl-ctrl-${E} `,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(v,i,h){this._canvas.width=Math.floor(h*v),this._canvas.height=Math.floor(h*i),this._canvas.style.width=`${v}px`,this._canvas.style.height=`${i}px`}_setupPainter(){const v={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let i=null;this._canvas.addEventListener("webglcontextcreationerror",p=>{i={requestedAttributes:v},p&&(i.statusMessage=p.statusMessage,i.type=p.type)},{once:!0});const h=this._canvas.getContext("webgl2",v)||this._canvas.getContext("webgl",v);if(!h){const p="Failed to initialize WebGL";throw i?(i.message=p,new Error(JSON.stringify(i))):new Error(p)}this.painter=new af(h,this.transform),z.testSupport(h)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(v){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||v,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(v){return this._update(),this._renderTaskQueue.add(v)}_cancelRenderFrame(v){this._renderTaskQueue.remove(v)}_render(v){const i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(v),this._removed)return;let h=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const g=this.transform.zoom,b=k.now();this.style.zoomHistory.update(g,b);const E=new c.a9(g,{now:b,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),I=E.crossFadingFactor();I===1&&I===this._crossFadingFactor||(h=!0,this._crossFadingFactor=I),this.style.update(E)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.be.mark(c.bf.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0,c.be.mark(c.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var v;this._hash&&this._hash.remove();for(const h of this._controls)h.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),V.removeThrottleControl(this._imageQueueHandle),(v=this._resizeObserver)===null||v===void 0||v.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");i!=null&&i.loseContext&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),T.remove(this._canvasContainer),T.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),c.be.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,k.frameAsync(this._frameRequest).then(v=>{c.be.frame(v),this._frameRequest=null,this._render(v)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(v){this._showTileBoundaries!==v&&(this._showTileBoundaries=v,this._update())}get showPadding(){return!!this._showPadding}set showPadding(v){this._showPadding!==v&&(this._showPadding=v,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(v){this._showCollisionBoxes!==v&&(this._showCollisionBoxes=v,v?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(v){this._showOverdrawInspector!==v&&(this._showOverdrawInspector=v,this._update())}get repaint(){return!!this._repaint}set repaint(v){this._repaint!==v&&(this._repaint=v,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(v){this._vertices=v,this._update()}get version(){return Mu}getCameraTargetElevation(){return this.transform.elevation}},f.MapMouseEvent=Qi,f.MapTouchEvent=Va,f.MapWheelEvent=lu,f.Marker=zr,f.NavigationControl=class{constructor(v){this._updateZoomButtons=()=>{const i=this._map.getZoom(),h=i===this._map.getMaxZoom(),p=i===this._map.getMinZoom();this._zoomInButton.disabled=h,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",h.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},this._rotateCompassArrow=()=>{const i=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${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=i},this._setButtonTitle=(i,h)=>{const p=this._map._getUIString(`NavigationControl.${h}`);i.title=p,i.setAttribute("aria-label",p)},this.options=c.e({},Iu,v),this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",i=>i.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",i=>this._map.zoomIn({},{originalEvent:i})),T.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",i=>this._map.zoomOut({},{originalEvent:i})),T.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",i=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:i}):this._map.resetNorth({},{originalEvent:i})}),this._compassIcon=T.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(v){return this._map=v,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new yf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){T.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(v,i){const h=T.create("button",v,this._container);return h.type="button",h.addEventListener("click",i),h}},f.Popup=class extends c.E{constructor(v){super(),this.remove=()=>(this._content&&T.remove(this._content),this._container&&(T.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.k("close"))),this),this._onMouseUp=i=>{this._update(i.point)},this._onMouseMove=i=>{this._update(i.point)},this._onDrag=i=>{this._update(i.point)},this._update=i=>{var h;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=T.create("div","maplibregl-popup",this._map.getContainer()),this._tip=T.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const I of this.options.className.split(" "))this._container.classList.add(I);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?_f(this._lngLat,this._flatPos,this._map.transform):(h=this._lngLat)===null||h===void 0?void 0:h.wrap(),this._trackPointer&&!i)return;const p=this._flatPos=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&i?i:this._map.transform.locationPoint(this._lngLat));let g=this.options.anchor;const b=It(this.options.offset);if(!g){const I=this._container.offsetWidth,C=this._container.offsetHeight;let L;L=p.y+b.bottom.ythis._map.transform.height-C?["bottom"]:[],p.xthis._map.transform.width-I/2&&L.push("right"),g=L.length===0?"bottom":L.join("-")}let E=p.add(b[g]);this.options.subpixelPositioning||(E=E.round()),T.setTransform(this._container,`${Tu[g]} translate(${E.x}px,${E.y}px)`),Go(this._container,g,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(uo),v)}addTo(v){return this._map&&this.remove(),this._map=v,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(v){return this._lngLat=c.N.convert(v),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(v){return this.setDOMContent(document.createTextNode(v))}setHTML(v){const i=document.createDocumentFragment(),h=document.createElement("body");let p;for(h.innerHTML=v;p=h.firstChild,p;)i.appendChild(p);return this.setDOMContent(i)}getMaxWidth(){var v;return(v=this._container)===null||v===void 0?void 0:v.style.maxWidth}setMaxWidth(v){return this.options.maxWidth=v,this._update(),this}setDOMContent(v){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=T.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(v),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(v){return this._container&&this._container.classList.add(v),this}removeClassName(v){return this._container&&this._container.classList.remove(v),this}setOffset(v){return this.options.offset=v,this._update(),this}toggleClassName(v){if(this._container)return this._container.classList.toggle(v)}setSubpixelPositioning(v){this.options.subpixelPositioning=v}_createCloseButton(){this.options.closeButton&&(this._closeButton=T.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const v=this._container.querySelector(ql);v&&v.focus()}},f.RasterDEMTileSource=ti,f.RasterTileSource=ur,f.ScaleControl=class{constructor(v){this._onMove=()=>{Cu(this._map,this._container,this.options)},this.setUnit=i=>{this.options.unit=i,Cu(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},vf),v)}getDefaultPosition(){return"bottom-left"}onAdd(v){return this._map=v,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-scale",v.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){T.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},f.ScrollZoomHandler=xu,f.Style=Nc,f.TerrainControl=class{constructor(v){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(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"))},this.options=v}onAdd(v){return this._map=v,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=T.create("button","maplibregl-ctrl-terrain",this._container),T.create("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(){T.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},f.TwoFingersTouchPitchHandler=_u,f.TwoFingersTouchRotateHandler=yu,f.TwoFingersTouchZoomHandler=mu,f.TwoFingersTouchZoomRotateHandler=Su,f.VectorTileSource=cn,f.VideoSource=Bs,f.addSourceType=(v,i)=>c._(void 0,void 0,void 0,function*(){if(Pa(v))throw new Error(`A source type called "${v}" already exists.`);((h,p)=>{Ea[h]=p})(v,i)}),f.clearPrewarmedResources=function(){const v=rt;v&&(v.isPreloaded()&&v.numActive()===1?(v.release(Ve),rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},f.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},f.getRTLTextPluginStatus=function(){return no().getRTLTextPluginStatus()},f.getVersion=function(){return Bt},f.getWorkerCount=function(){return ct.workerCount},f.getWorkerUrl=function(){return c.a.WORKER_URL},f.importScriptInWorkers=function(v){return li().broadcast("IS",v)},f.prewarm=function(){ni().acquire(Ve)},f.setMaxParallelImageRequests=function(v){c.a.MAX_PARALLEL_IMAGE_REQUESTS=v},f.setRTLTextPlugin=function(v,i){return no().setRTLTextPlugin(v,i)},f.setWorkerCount=function(v){ct.workerCount=v},f.setWorkerUrl=function(v){c.a.WORKER_URL=v}});var u=t;return u})})(Jb);var Kk=Jb.exports;const mo=Yg(Kk);function N0(n){let e;return t=>{if(t)for(let o in t){let l=e==null?void 0:e[o],u=t[o];l!==u&&n(o,u,l)}else if(e)for(let o in e)n(o,void 0,e[o]);e=t}}function Yb(n,...e){let t=[n];for(let o of e)if(o)Array.isArray(o)&&o[0]===n?t.push(...o.slice(1)):t.push(o);else continue;if(t.length!==1)return t.length===2?t[1]:t}function Qb(n){return n===!0?["has","point_count"]:n===!1?["!",["has","point_count"]]:void 0}var wh=Yk;function Yk(n){var e,t,o;if(n){if(Array.isArray(n)){for(e=[],t=n.length,o=0;o{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function eE(n,e,t){let o,l,u,f,c,y,w,M,k,T,z,F,{$$slots:B={},$$scope:G}=e,{id:J=pa("layer")}=e,{source:j=void 0}=e,{sourceLayer:V=void 0}=e,{beforeId:me=void 0}=e,{beforeLayerType:X=void 0}=e,{type:pe}=e,{paint:Ee=void 0}=e,{layout:Pe=void 0}=e,{filter:$e=void 0}=e,{applyToClusters:Ye=void 0}=e,{minzoom:ve=void 0}=e,{maxzoom:We=void 0}=e,{manageHoverState:at=!1}=e,{hovered:mt=null}=e,{interactive:Ht=!0}=e,{hoverCursor:qt=void 0}=e,{eventsIfTopMost:Ue=!1}=e;const Xe=zc(),{map:Zt,source:Gt,self:or,minzoom:Jt,maxzoom:wr,eventTopMost:Ve,layerInfo:ct}=Wk();bt(n,Zt,Se=>t(31,k=Se)),bt(n,Gt,Se=>t(32,T=Se)),bt(n,or,Se=>t(0,M=Se)),bt(n,Jt,Se=>t(34,F=Se)),bt(n,wr,Se=>t(33,z=Se)),Ei(()=>{M&&k&&(ct.delete(M),k==null||k.removeLayer(M))});let tr;function rt(Se){var Mi,cn;if(!Ht||!M||!k||Ue&&Ve(Se)!==M)return;let Be=Se.features??[],nr=(cn=(Mi=Be[0])==null?void 0:Mi.properties)==null?void 0:cn.cluster_id,Te={event:Se,map:k,clusterId:nr,layer:M,source:c,features:Be};Xe(Se.type,Te)}function rr(Se){var Mi,cn;if(!Ht||!M||!k||Ue&&Ve(Se)!==M)return;qt&&(k.getCanvas().style.cursor=qt);let Be=Se.features??[];t(6,mt=Be[0]??null);let nr=(cn=(Mi=Be[0])==null?void 0:Mi.properties)==null?void 0:cn.cluster_id;Xe("mouseenter",{event:Se,map:k,clusterId:nr,layer:M,source:c,features:Be})}function ni(Se){var Mi,cn,ur;if(!Ht||!k)return;if(Ue&&Ve(Se)!==M){t(6,mt=null),at&&tr!==void 0&&(k==null||k.setFeatureState({source:c,sourceLayer:V,id:tr},{hover:!1}),tr=void 0);return}k.getCanvas().style.cursor=qt;let Be=Se.features??[],nr=(cn=(Mi=Be[0])==null?void 0:Mi.properties)==null?void 0:cn.cluster_id,Te=(ur=Be[0])==null?void 0:ur.id;Te!==tr&&(at&&(tr!==void 0&&(k==null||k.setFeatureState({source:c,id:tr,sourceLayer:V},{hover:!1})),k==null||k.setFeatureState({source:c,id:Te,sourceLayer:V},{hover:!0})),tr=Te,t(6,mt=Be[0]??null)),Xe("mousemove",{event:Se,map:k,clusterId:nr,layer:M,source:c,features:Be})}function cr(Se){if(!(!Ht||!M||!k)){if(qt&&(k.getCanvas().style.cursor=""),t(6,mt=null),at&&tr!==void 0){const Be={source:c,id:tr,sourceLayer:V};k==null||k.setFeatureState(Be,{hover:!1}),tr=void 0}Xe("mouseleave",{map:k,layer:M,source:c})}}let li=!0;function Bi(Se){k&&(k.off("click",Se,rt),k.off("dblclick",Se,rt),k.off("contextmenu",Se,rt),k.off("mouseenter",Se,rr),k.off("mousemove",Se,ni),k.off("mouseleave",Se,cr))}return Ei(()=>{k&&M&&Bi(M)}),n.$$set=Se=>{"id"in Se&&t(7,J=Se.id),"source"in Se&&t(8,j=Se.source),"sourceLayer"in Se&&t(9,V=Se.sourceLayer),"beforeId"in Se&&t(10,me=Se.beforeId),"beforeLayerType"in Se&&t(11,X=Se.beforeLayerType),"type"in Se&&t(12,pe=Se.type),"paint"in Se&&t(13,Ee=Se.paint),"layout"in Se&&t(14,Pe=Se.layout),"filter"in Se&&t(15,$e=Se.filter),"applyToClusters"in Se&&t(16,Ye=Se.applyToClusters),"minzoom"in Se&&t(17,ve=Se.minzoom),"maxzoom"in Se&&t(18,We=Se.maxzoom),"manageHoverState"in Se&&t(19,at=Se.manageHoverState),"hovered"in Se&&t(6,mt=Se.hovered),"interactive"in Se&&t(20,Ht=Se.interactive),"hoverCursor"in Se&&t(21,qt=Se.hoverCursor),"eventsIfTopMost"in Se&&t(22,Ue=Se.eventsIfTopMost),"$$scope"in Se&&t(35,G=Se.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&65536&&t(30,o=Qb(Ye)),n.$$.dirty[0]&1073774592&&t(24,l=Yb("all",o,$e)),n.$$.dirty[0]&131072|n.$$.dirty[1]&8&&t(26,u=ve??F),n.$$.dirty[0]&262144|n.$$.dirty[1]&4&&t(25,f=We??z),n.$$.dirty[0]&256|n.$$.dirty[1]&2&&t(29,c=j||T),n.$$.dirty[0]&654343809|n.$$.dirty[1]&1&&k&&M!==J&&c){M&&(Bi(M),ct.delete(M));let Se=me;if(!me&&X){let Be=k.getStyle().layers,nr=typeof X=="function"?X:Mi=>Mi.type===X,Te=Be==null?void 0:Be.find(nr);Te&&(Se=Te.id)}zi(or,M=J,M),k.addLayer(wh({id:M,type:pe,source:c,"source-layer":V,filter:l,paint:Ee,layout:Pe,minzoom:u,maxzoom:f}),Se),t(23,li=!0),k.on("click",M,rt),k.on("dblclick",M,rt),k.on("contextmenu",M,rt),k.on("mouseenter",M,rr),k.on("mousemove",M,ni),k.on("mouseleave",M,cr)}n.$$.dirty[0]&1048577&&M&&ct.set(M,{interactive:Ht}),n.$$.dirty[0]&1|n.$$.dirty[1]&1&&t(28,y=M?N0((Se,Be)=>k==null?void 0:k.setPaintProperty(M,Se,Be)):void 0),n.$$.dirty[0]&1|n.$$.dirty[1]&1&&t(27,w=M?N0((Se,Be)=>k==null?void 0:k.setLayoutProperty(M,Se,Be)):void 0),n.$$.dirty[0]&268443648&&(y==null||y(Ee)),n.$$.dirty[0]&134234112&&(w==null||w(Pe)),n.$$.dirty[0]&100663297|n.$$.dirty[1]&1&&M&&(k==null||k.setLayerZoomRange(M,u,f)),n.$$.dirty[0]&25165825|n.$$.dirty[1]&1&&M&&(li?t(23,li=!1):k==null||k.setFilter(M,l))},[M,Zt,Gt,or,Jt,wr,mt,J,j,V,me,X,pe,Ee,Pe,$e,Ye,ve,We,at,Ht,qt,Ue,li,l,f,u,w,y,c,o,k,T,z,F,G,B]}class Yd extends Dt{constructor(e){super(),Ft(this,e,eE,Qk,At,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function tE(n){let e;const t=n[16].default,o=yi(t,n,n[24],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&16777216)&&_i(o,t,l,l[24],e?bi(t,l[24],u,null):vi(l[24]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function rE(n){let e,t,o;function l(f){n[17](f)}let u={id:n[1],type:"circle",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],applyToClusters:n[9],minzoom:n[10],maxzoom:n[11],hoverCursor:n[12],manageHoverState:n[13],eventsIfTopMost:n[14],interactive:n[15],$$slots:{default:[tE]},$$scope:{ctx:n}};return n[0]!==void 0&&(u.hovered=n[0]),e=new Yd({props:u}),Hr.push(()=>fi(e,"hovered",l)),e.$on("click",n[18]),e.$on("dblclick",n[19]),e.$on("contextmenu",n[20]),e.$on("mouseenter",n[21]),e.$on("mousemove",n[22]),e.$on("mouseleave",n[23]),{c(){Ae(e.$$.fragment)},l(f){Fe(e.$$.fragment,f)},m(f,c){ze(e,f,c),o=!0},p(f,[c]){const y={};c&2&&(y.id=f[1]),c&4&&(y.source=f[2]),c&8&&(y.sourceLayer=f[3]),c&16&&(y.beforeId=f[4]),c&32&&(y.beforeLayerType=f[5]),c&64&&(y.paint=f[6]),c&128&&(y.layout=f[7]),c&256&&(y.filter=f[8]),c&512&&(y.applyToClusters=f[9]),c&1024&&(y.minzoom=f[10]),c&2048&&(y.maxzoom=f[11]),c&4096&&(y.hoverCursor=f[12]),c&8192&&(y.manageHoverState=f[13]),c&16384&&(y.eventsIfTopMost=f[14]),c&32768&&(y.interactive=f[15]),c&16777216&&(y.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,y.hovered=f[0],gi(()=>t=!1)),e.$set(y)},i(f){o||(ae(e.$$.fragment,f),o=!0)},o(f){fe(e.$$.fragment,f),o=!1},d(f){Le(e,f)}}}function iE(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("circle")}=e,{source:f=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:y=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:M}=e,{layout:k=void 0}=e,{filter:T=void 0}=e,{applyToClusters:z=void 0}=e,{minzoom:F=void 0}=e,{maxzoom:B=void 0}=e,{hoverCursor:G=void 0}=e,{manageHoverState:J=!1}=e,{hovered:j=null}=e,{eventsIfTopMost:V=!1}=e,{interactive:me=!0}=e;function X(We){j=We,t(0,j)}function pe(We){Er.call(this,n,We)}function Ee(We){Er.call(this,n,We)}function Pe(We){Er.call(this,n,We)}function $e(We){Er.call(this,n,We)}function Ye(We){Er.call(this,n,We)}function ve(We){Er.call(this,n,We)}return n.$$set=We=>{"id"in We&&t(1,u=We.id),"source"in We&&t(2,f=We.source),"sourceLayer"in We&&t(3,c=We.sourceLayer),"beforeId"in We&&t(4,y=We.beforeId),"beforeLayerType"in We&&t(5,w=We.beforeLayerType),"paint"in We&&t(6,M=We.paint),"layout"in We&&t(7,k=We.layout),"filter"in We&&t(8,T=We.filter),"applyToClusters"in We&&t(9,z=We.applyToClusters),"minzoom"in We&&t(10,F=We.minzoom),"maxzoom"in We&&t(11,B=We.maxzoom),"hoverCursor"in We&&t(12,G=We.hoverCursor),"manageHoverState"in We&&t(13,J=We.manageHoverState),"hovered"in We&&t(0,j=We.hovered),"eventsIfTopMost"in We&&t(14,V=We.eventsIfTopMost),"interactive"in We&&t(15,me=We.interactive),"$$scope"in We&&t(24,l=We.$$scope)},[j,u,f,c,y,w,M,k,T,z,F,B,G,J,V,me,o,X,pe,Ee,Pe,$e,Ye,ve,l]}class bc extends Dt{constructor(e){super(),Ft(this,e,iE,rE,At,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function nE(n){let e;const t=n[15].default,o=yi(t,n,n[23],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&8388608)&&_i(o,t,l,l[23],e?bi(t,l[23],u,null):vi(l[23]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function oE(n){let e,t,o;function l(f){n[16](f)}let u={id:n[1],type:"fill",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],minzoom:n[9],maxzoom:n[10],hoverCursor:n[11],manageHoverState:n[12],eventsIfTopMost:n[13],interactive:n[14],$$slots:{default:[nE]},$$scope:{ctx:n}};return n[0]!==void 0&&(u.hovered=n[0]),e=new Yd({props:u}),Hr.push(()=>fi(e,"hovered",l)),e.$on("click",n[17]),e.$on("dblclick",n[18]),e.$on("contextmenu",n[19]),e.$on("mouseenter",n[20]),e.$on("mousemove",n[21]),e.$on("mouseleave",n[22]),{c(){Ae(e.$$.fragment)},l(f){Fe(e.$$.fragment,f)},m(f,c){ze(e,f,c),o=!0},p(f,[c]){const y={};c&2&&(y.id=f[1]),c&4&&(y.source=f[2]),c&8&&(y.sourceLayer=f[3]),c&16&&(y.beforeId=f[4]),c&32&&(y.beforeLayerType=f[5]),c&64&&(y.paint=f[6]),c&128&&(y.layout=f[7]),c&256&&(y.filter=f[8]),c&512&&(y.minzoom=f[9]),c&1024&&(y.maxzoom=f[10]),c&2048&&(y.hoverCursor=f[11]),c&4096&&(y.manageHoverState=f[12]),c&8192&&(y.eventsIfTopMost=f[13]),c&16384&&(y.interactive=f[14]),c&8388608&&(y.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,y.hovered=f[0],gi(()=>t=!1)),e.$set(y)},i(f){o||(ae(e.$$.fragment,f),o=!0)},o(f){fe(e.$$.fragment,f),o=!1},d(f){Le(e,f)}}}function sE(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("fill")}=e,{source:f=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:y=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:M}=e,{layout:k=void 0}=e,{filter:T=void 0}=e,{minzoom:z=void 0}=e,{maxzoom:F=void 0}=e,{hoverCursor:B=void 0}=e,{manageHoverState:G=!1}=e,{hovered:J=null}=e,{eventsIfTopMost:j=!1}=e,{interactive:V=!0}=e;function me(ve){J=ve,t(0,J)}function X(ve){Er.call(this,n,ve)}function pe(ve){Er.call(this,n,ve)}function Ee(ve){Er.call(this,n,ve)}function Pe(ve){Er.call(this,n,ve)}function $e(ve){Er.call(this,n,ve)}function Ye(ve){Er.call(this,n,ve)}return n.$$set=ve=>{"id"in ve&&t(1,u=ve.id),"source"in ve&&t(2,f=ve.source),"sourceLayer"in ve&&t(3,c=ve.sourceLayer),"beforeId"in ve&&t(4,y=ve.beforeId),"beforeLayerType"in ve&&t(5,w=ve.beforeLayerType),"paint"in ve&&t(6,M=ve.paint),"layout"in ve&&t(7,k=ve.layout),"filter"in ve&&t(8,T=ve.filter),"minzoom"in ve&&t(9,z=ve.minzoom),"maxzoom"in ve&&t(10,F=ve.maxzoom),"hoverCursor"in ve&&t(11,B=ve.hoverCursor),"manageHoverState"in ve&&t(12,G=ve.manageHoverState),"hovered"in ve&&t(0,J=ve.hovered),"eventsIfTopMost"in ve&&t(13,j=ve.eventsIfTopMost),"interactive"in ve&&t(14,V=ve.interactive),"$$scope"in ve&&t(23,l=ve.$$scope)},[J,u,f,c,y,w,M,k,T,z,F,B,G,j,V,o,me,X,pe,Ee,Pe,$e,Ye,l]}class Ih extends Dt{constructor(e){super(),Ft(this,e,sE,oE,At,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function aE(n,e,t){let o;const{map:l}=ma();bt(n,l,y=>t(4,o=y));let{position:u="top-left"}=e,{container:f=void 0}=e,c=null;return Ei(()=>{o!=null&&o.loaded()&&c&&o.removeControl(c)}),n.$$set=y=>{"position"in y&&t(1,u=y.position),"container"in y&&t(2,f=y.container)},n.$$.update=()=>{if(n.$$.dirty&30&&o&&!c){let y;typeof f=="string"?y=document.querySelector(f)??void 0:y=f,t(3,c=new mo.FullscreenControl({container:y})),o.addControl(c,u)}},[l,u,f,c,o]}class lE extends Dt{constructor(e){super(),Ft(this,e,aE,null,At,{position:1,container:2})}}function ex(n,e,t,o,l){let u=!1;n.getSource(e)&&(u=!0,n.removeSource(e));const f=()=>{o(e)&&(n.addSource(e,t),l())};if(u){const c=()=>{e&&(n.getSource(e)?setTimeout(c,1):f())};c()}else f()}function tx(n,e,t){$k().then(()=>{let o=Hb(n);if(!o)return;o.getSource(e)===t&&o.removeSource(e)})}function U0(n){let e=n[0],t,o,l=q0(n);return{c(){l.c(),t=Ot()},l(u){l.l(u),t=Ot()},m(u,f){l.m(u,f),ce(u,t,f),o=!0},p(u,f){f&1&&At(e,e=u[0])?(vr(),fe(l,1,1,Yt),br(),l=q0(u),l.c(),ae(l,1),l.m(t.parentNode,t)):l.p(u,f)},i(u){o||(ae(l),o=!0)},o(u){fe(l),o=!1},d(u){u&&ee(t),l.d(u)}}}function q0(n){let e;const t=n[19].default,o=yi(t,n,n[18],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&262144)&&_i(o,t,l,l[18],e?bi(t,l[18],u,null):vi(l[18]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function cE(n){let e,t,o=n[0]&&U0(n);return{c(){o&&o.c(),e=Ot()},l(l){o&&o.l(l),e=Ot()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,[u]){l[0]?o?(o.p(l,u),u&1&&ae(o,1)):(o=U0(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function uE(n,e,t){let o,l,u,{$$slots:f={},$$scope:c}=e,{id:y=pa("geojson")}=e,{data:w}=e,{generateId:M=!1}=e,{promoteId:k=void 0}=e,{filter:T=void 0}=e,{lineMetrics:z=void 0}=e,{cluster:F=void 0}=e,{maxzoom:B=void 0}=e,{attribution:G=void 0}=e,{buffer:J=void 0}=e,{tolerance:j=void 0}=e;const{map:V,cluster:me,self:X}=Xb();bt(n,V,Pe=>t(17,l=Pe)),bt(n,me,Pe=>t(20,u=Pe)),bt(n,X,Pe=>t(0,o=Pe));let pe,Ee=!0;return Ei(()=>{o&&pe&&l&&(tx(V,o,pe),zi(X,o=null,o),t(15,pe=void 0))}),n.$$set=Pe=>{"id"in Pe&&t(4,y=Pe.id),"data"in Pe&&t(5,w=Pe.data),"generateId"in Pe&&t(6,M=Pe.generateId),"promoteId"in Pe&&t(7,k=Pe.promoteId),"filter"in Pe&&t(8,T=Pe.filter),"lineMetrics"in Pe&&t(9,z=Pe.lineMetrics),"cluster"in Pe&&t(10,F=Pe.cluster),"maxzoom"in Pe&&t(11,B=Pe.maxzoom),"attribution"in Pe&&t(12,G=Pe.attribution),"buffer"in Pe&&t(13,J=Pe.buffer),"tolerance"in Pe&&t(14,j=Pe.tolerance),"$$scope"in Pe&&t(18,c=Pe.$$scope)},n.$$.update=()=>{n.$$.dirty&1024&&zi(me,u=F,u),n.$$.dirty&196593&&l&&o!==y&&(zi(X,o=y,o),ex(l,o,wh({type:"geojson",data:w,filter:T,lineMetrics:z,generateId:M,promoteId:k,cluster:!!F,clusterMinPoints:F==null?void 0:F.minPoints,clusterMaxZoom:F==null?void 0:F.maxZoom,clusterRadius:F==null?void 0:F.radius,clusterProperties:F==null?void 0:F.properties,maxzoom:B,attribution:G,buffer:J,tolerance:j}),Pe=>l&&Pe===o,()=>{o&&(t(15,pe=l==null?void 0:l.getSource(o)),t(16,Ee=!0))})),n.$$.dirty&131088&&(l==null||l.on("style.load",()=>{t(15,pe=l==null?void 0:l.getSource(y))})),n.$$.dirty&98336&&pe&&(Ee?t(16,Ee=!1):pe.setData(w)),n.$$.dirty&33792&&(pe==null||pe.setClusterOptions(wh({cluster:!!F,clusterMaxZoom:F==null?void 0:F.maxZoom,clusterRadius:F==null?void 0:F.radius})))},[o,V,me,X,y,w,M,k,T,z,F,B,G,J,j,pe,Ee,l,c,f]}class cl extends Dt{constructor(e){super(),Ft(this,e,uE,cE,At,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10,maxzoom:11,attribution:12,buffer:13,tolerance:14})}}function hE(n,e,t){let o;const{map:l}=ma();bt(n,l,T=>t(8,o=T));let{position:u="top-left"}=e,{positionOptions:f=void 0}=e,{fitBoundsOptions:c=void 0}=e,{trackUserLocation:y=!1}=e,{showAccuracyCircle:w=!0}=e,{showUserLocation:M=!0}=e,{control:k=null}=e;return Ei(()=>{o!=null&&o.loaded()&&k&&o.removeControl(k)}),n.$$set=T=>{"position"in T&&t(2,u=T.position),"positionOptions"in T&&t(3,f=T.positionOptions),"fitBoundsOptions"in T&&t(4,c=T.fitBoundsOptions),"trackUserLocation"in T&&t(5,y=T.trackUserLocation),"showAccuracyCircle"in T&&t(6,w=T.showAccuracyCircle),"showUserLocation"in T&&t(7,M=T.showUserLocation),"control"in T&&t(1,k=T.control)},n.$$.update=()=>{n.$$.dirty&510&&o&&!k&&(t(1,k=new mo.GeolocateControl({positionOptions:f,fitBoundsOptions:c,trackUserLocation:y,showAccuracyCircle:w,showUserLocation:M})),o.addControl(k,u))},[l,k,u,f,c,y,w,M,o]}class fE extends Dt{constructor(e){super(),Ft(this,e,hE,null,At,{position:2,positionOptions:3,fitBoundsOptions:4,trackUserLocation:5,showAccuracyCircle:6,showUserLocation:7,control:1})}}function G0(n){let e=n[0],t,o,l=Z0(n);return{c(){l.c(),t=Ot()},l(u){l.l(u),t=Ot()},m(u,f){l.m(u,f),ce(u,t,f),o=!0},p(u,f){f&1&&At(e,e=u[0])?(vr(),fe(l,1,1,Yt),br(),l=Z0(u),l.c(),ae(l,1),l.m(t.parentNode,t)):l.p(u,f)},i(u){o||(ae(l),o=!0)},o(u){fe(l),o=!1},d(u){u&&ee(t),l.d(u)}}}function Z0(n){let e;const t=n[10].default,o=yi(t,n,n[9],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&512)&&_i(o,t,l,l[9],e?bi(t,l[9],u,null):vi(l[9]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function dE(n){let e,t,o=n[0]&&G0(n);return{c(){o&&o.c(),e=Ot()},l(l){o&&o.l(l),e=Ot()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,[u]){l[0]?o?(o.p(l,u),u&1&&ae(o,1)):(o=G0(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function pE(n,e,t){let o,l,{$$slots:u={},$$scope:f}=e,{id:c=pa("image")}=e,{url:y}=e,{coordinates:w}=e;const{map:M,self:k}=Xb();bt(n,M,F=>t(8,l=F)),bt(n,k,F=>t(0,o=F));let T,z=!0;return Ei(()=>{o&&l&&(tx(M,o,T),zi(k,o=null,o),t(6,T=void 0))}),n.$$set=F=>{"id"in F&&t(3,c=F.id),"url"in F&&t(4,y=F.url),"coordinates"in F&&t(5,w=F.coordinates),"$$scope"in F&&t(9,f=F.$$scope)},n.$$.update=()=>{n.$$.dirty&313&&l&&o!==c&&(zi(k,o=c,o),ex(l,o,wh({type:"image",url:y,coordinates:w}),F=>l&&F===o,()=>{o&&(t(6,T=l==null?void 0:l.getSource(o)),t(7,z=!0))})),n.$$.dirty&264&&(l==null||l.on("style.load",()=>{t(6,T=l==null?void 0:l.getSource(c))})),n.$$.dirty&224&&T&&(z?t(7,z=!1):T.setCoordinates(w))},[o,M,k,c,y,w,T,z,l,f,u]}class mE extends Dt{constructor(e){super(),Ft(this,e,pE,dE,At,{id:3,url:4,coordinates:5})}}function gE(n){let e;const t=n[15].default,o=yi(t,n,n[23],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&8388608)&&_i(o,t,l,l[23],e?bi(t,l[23],u,null):vi(l[23]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function yE(n){let e,t,o;function l(f){n[16](f)}let u={id:n[1],type:"line",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],minzoom:n[9],maxzoom:n[10],hoverCursor:n[11],manageHoverState:n[12],eventsIfTopMost:n[13],interactive:n[14],$$slots:{default:[gE]},$$scope:{ctx:n}};return n[0]!==void 0&&(u.hovered=n[0]),e=new Yd({props:u}),Hr.push(()=>fi(e,"hovered",l)),e.$on("click",n[17]),e.$on("dblclick",n[18]),e.$on("contextmenu",n[19]),e.$on("mouseenter",n[20]),e.$on("mousemove",n[21]),e.$on("mouseleave",n[22]),{c(){Ae(e.$$.fragment)},l(f){Fe(e.$$.fragment,f)},m(f,c){ze(e,f,c),o=!0},p(f,[c]){const y={};c&2&&(y.id=f[1]),c&4&&(y.source=f[2]),c&8&&(y.sourceLayer=f[3]),c&16&&(y.beforeId=f[4]),c&32&&(y.beforeLayerType=f[5]),c&64&&(y.paint=f[6]),c&128&&(y.layout=f[7]),c&256&&(y.filter=f[8]),c&512&&(y.minzoom=f[9]),c&1024&&(y.maxzoom=f[10]),c&2048&&(y.hoverCursor=f[11]),c&4096&&(y.manageHoverState=f[12]),c&8192&&(y.eventsIfTopMost=f[13]),c&16384&&(y.interactive=f[14]),c&8388608&&(y.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,y.hovered=f[0],gi(()=>t=!1)),e.$set(y)},i(f){o||(ae(e.$$.fragment,f),o=!0)},o(f){fe(e.$$.fragment,f),o=!1},d(f){Le(e,f)}}}function _E(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("line")}=e,{source:f=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:y=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:M}=e,{layout:k=void 0}=e,{filter:T=void 0}=e,{minzoom:z=void 0}=e,{maxzoom:F=void 0}=e,{hoverCursor:B=void 0}=e,{manageHoverState:G=!1}=e,{hovered:J=null}=e,{eventsIfTopMost:j=!1}=e,{interactive:V=!0}=e;function me(ve){J=ve,t(0,J)}function X(ve){Er.call(this,n,ve)}function pe(ve){Er.call(this,n,ve)}function Ee(ve){Er.call(this,n,ve)}function Pe(ve){Er.call(this,n,ve)}function $e(ve){Er.call(this,n,ve)}function Ye(ve){Er.call(this,n,ve)}return n.$$set=ve=>{"id"in ve&&t(1,u=ve.id),"source"in ve&&t(2,f=ve.source),"sourceLayer"in ve&&t(3,c=ve.sourceLayer),"beforeId"in ve&&t(4,y=ve.beforeId),"beforeLayerType"in ve&&t(5,w=ve.beforeLayerType),"paint"in ve&&t(6,M=ve.paint),"layout"in ve&&t(7,k=ve.layout),"filter"in ve&&t(8,T=ve.filter),"minzoom"in ve&&t(9,z=ve.minzoom),"maxzoom"in ve&&t(10,F=ve.maxzoom),"hoverCursor"in ve&&t(11,B=ve.hoverCursor),"manageHoverState"in ve&&t(12,G=ve.manageHoverState),"hovered"in ve&&t(0,J=ve.hovered),"eventsIfTopMost"in ve&&t(13,j=ve.eventsIfTopMost),"interactive"in ve&&t(14,V=ve.interactive),"$$scope"in ve&&t(23,l=ve.$$scope)},[J,u,f,c,y,w,M,k,T,z,F,B,G,j,V,o,me,X,pe,Ee,Pe,$e,Ye,l]}class xc extends Dt{constructor(e){super(),Ft(this,e,_E,yE,At,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function vE(n,e,t){let o;const l=zc();let{layer:u=void 0}=e;const{map:f}=ma();bt(n,f,M=>t(2,o=M));function c(M){l(M.type,{...M,map:f})}const y=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","contextmenu","mouseover","mouseout"],w=["click","dblclick","contextmenu","mousemove","movestart","moveend","zoomstart","zoom","zoomend"];return Ei(()=>{if(o)if(u)for(const M of y)o.off(M,u,c);else for(const M of w)o.off(M,c)}),n.$$set=M=>{"layer"in M&&t(1,u=M.layer)},n.$$.update=()=>{if(n.$$.dirty&6&&o)if(u)for(const M of y)o.on(M,u,c);else for(const M of w)o.on(M,c)},[f,u,o]}class bE extends Dt{constructor(e){super(),Ft(this,e,vE,null,At,{layer:1})}}function xE(n){let e=n.getCenter(),t=Math.round(n.getZoom()*100)/100,o=Math.ceil((t*Math.LN2+Math.log(512/360/.5))/Math.LN10),l=Math.pow(10,o),u=Math.round(e.lat*l)/l,f=Math.round(e.lng*l)/l,c=`${t}/${u}/${f}`,y=n.getBearing(),w=n.getPitch();return(y||w)&&(c+=`/${Math.round(y*10)/10}`),w&&(c+=`/${Math.round(w)}`),`#${c}`}function wE(n){return n.replace("#","").split("/").map(parseFloat)}var lc=Qg;function Qg(n,e){return n===e||n!==n&&e!==e?!0:typeof n!=typeof e||{}.toString.call(n)!={}.toString.call(e)||n!==Object(n)||!n?!1:Array.isArray(n)?H0(n,e):{}.toString.call(n)=="[object Set]"?H0(Array.from(n),Array.from(e)):{}.toString.call(n)=="[object Object]"?kE(n,e):SE(n,e)}function SE(n,e){return n.toString()===e.toString()}function H0(n,e){var t=n.length;if(t!=e.length)return!1;for(var o=0;ot(6,o=M));let{position:u="top-left"}=e,{showCompass:f=!0}=e,{showZoom:c=!0}=e,{visualizePitch:y=!1}=e,w=null;return Ei(()=>{o!=null&&o.loaded()&&w&&o.removeControl(w)}),n.$$set=M=>{"position"in M&&t(1,u=M.position),"showCompass"in M&&t(2,f=M.showCompass),"showZoom"in M&&t(3,c=M.showZoom),"visualizePitch"in M&&t(4,y=M.visualizePitch)},n.$$.update=()=>{n.$$.dirty&126&&o&&!w&&(t(5,w=new mo.NavigationControl({showCompass:f,showZoom:c,visualizePitch:y})),o.addControl(w,u))},[l,u,f,c,y,w,o]}class PE extends Dt{constructor(e){super(),Ft(this,e,EE,null,At,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function ME(n,e,t){let o;const{map:l}=ma();bt(n,l,w=>t(5,o=w));let{position:u="bottom-left"}=e,{maxWidth:f=void 0}=e,{unit:c="metric"}=e,y=null;return Ei(()=>{o!=null&&o.loaded()&&y&&o.removeControl(y)}),n.$$set=w=>{"position"in w&&t(1,u=w.position),"maxWidth"in w&&t(2,f=w.maxWidth),"unit"in w&&t(3,c=w.unit)},n.$$.update=()=>{n.$$.dirty&62&&o&&!y&&(t(4,y=new mo.ScaleControl({maxWidth:f,unit:c})),o.addControl(y,u))},[l,u,f,c,y,o]}class IE extends Dt{constructor(e){super(),Ft(this,e,ME,null,At,{position:1,maxWidth:2,unit:3})}}const{window:TE}=Hg,CE=n=>({map:n[0]&16,loadedImages:n[0]&32,allImagesLoaded:n[0]&64}),W0=n=>({map:n[4],loadedImages:n[5],allImagesLoaded:n[6]});function X0(n){let e,t,o=n[3]&&J0(n);const l=n[40].default,u=yi(l,n,n[39],W0);return{c(){o&&o.c(),e=qe(),u&&u.c()},l(f){o&&o.l(f),e=Ge(f),u&&u.l(f)},m(f,c){o&&o.m(f,c),ce(f,e,c),u&&u.m(f,c),t=!0},p(f,c){f[3]?o?(o.p(f,c),c[0]&8&&ae(o,1)):(o=J0(f),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br()),u&&u.p&&(!t||c[0]&112|c[1]&256)&&_i(u,l,f,f[39],t?bi(l,f[39],c,CE):vi(f[39]),W0)},i(f){t||(ae(o),ae(u,f),t=!0)},o(f){fe(o),fe(u,f),t=!1},d(f){f&&ee(e),o&&o.d(f),u&&u.d(f)}}}function J0(n){let e,t,o,l,u,f,c,y;return e=new PE({props:{position:n[7]}}),o=new fE({props:{position:n[7],fitBoundsOptions:{maxZoom:12}}}),u=new lE({props:{position:n[7]}}),c=new IE({props:{position:n[7]}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),Ae(u.$$.fragment),f=qe(),Ae(c.$$.fragment)},l(w){Fe(e.$$.fragment,w),t=Ge(w),Fe(o.$$.fragment,w),l=Ge(w),Fe(u.$$.fragment,w),f=Ge(w),Fe(c.$$.fragment,w)},m(w,M){ze(e,w,M),ce(w,t,M),ze(o,w,M),ce(w,l,M),ze(u,w,M),ce(w,f,M),ze(c,w,M),y=!0},p(w,M){const k={};M[0]&128&&(k.position=w[7]),e.$set(k);const T={};M[0]&128&&(T.position=w[7]),o.$set(T);const z={};M[0]&128&&(z.position=w[7]),u.$set(z);const F={};M[0]&128&&(F.position=w[7]),c.$set(F)},i(w){y||(ae(e.$$.fragment,w),ae(o.$$.fragment,w),ae(u.$$.fragment,w),ae(c.$$.fragment,w),y=!0)},o(w){fe(e.$$.fragment,w),fe(o.$$.fragment,w),fe(u.$$.fragment,w),fe(c.$$.fragment,w),y=!1},d(w){w&&(ee(t),ee(l),ee(f)),Le(e,w),Le(o,w),Le(u,w),Le(c,w)}}}function AE(n){let e,t,o,l,u,f=n[4]&&n[0]&&X0(n);return{c(){e=et("div"),f&&f.c(),this.h()},l(c){e=tt(c,"DIV",{class:!0,"data-testid":!0});var y=Lt(e);f&&f.l(y),y.forEach(ee),this.h()},h(){Ke(e,"class",t=B0(n[2])+" svelte-p00lfq"),Ke(e,"data-testid","map-container"),es(e,"expand-map",!n[2])},m(c,y){ce(c,e,y),f&&f.m(e,null),n[41](e),o=!0,l||(u=[fr(TE,"hashchange",n[11]),Ym(n[10].call(null,e))],l=!0)},p(c,y){c[4]&&c[0]?f?(f.p(c,y),y[0]&17&&ae(f,1)):(f=X0(c),f.c(),ae(f,1),f.m(e,null)):f&&(vr(),fe(f,1,1,()=>{f=null}),br()),(!o||y[0]&4&&t!==(t=B0(c[2])+" svelte-p00lfq"))&&Ke(e,"class",t),(!o||y[0]&4)&&es(e,"expand-map",!c[2])},i(c){o||(ae(f),o=!0)},o(c){fe(f),o=!1},d(c){c&&ee(e),f&&f.d(),n[41](null),l=!1,os(u)}}}function zE(n,e,t){let o,l,u,f,{$$slots:c={},$$scope:y}=e,{map:w=null}=e,{mapContainer:M=void 0}=e,{class:k=void 0}=e,{style:T}=e,{diffStyleUpdates:z=!1}=e,{center:F=void 0}=e,{zoom:B=void 0}=e,{pitch:G=0}=e,{bearing:J=0}=e,{bounds:j=void 0}=e,{hash:V=!1}=e,{updateHash:me=Se=>{window.history.replaceState(window.history.state,"",Se)}}=e,{loaded:X=!1}=e,{minZoom:pe=0}=e,{maxZoom:Ee=22}=e,{antialias:Pe=void 0}=e,{zoomOnDoubleClick:$e=!0}=e,{locale:Ye=void 0}=e,{interactive:ve=!0}=e,{attributionControl:We=!0}=e,{cooperativeGestures:at=!1}=e,{preserveDrawingBuffer:mt=!1}=e,{maxBounds:Ht=void 0}=e,{images:qt=[]}=e,{standardControls:Ue=!1}=e,{filterLayers:Xe=void 0}=e,{transformRequest:Zt=void 0}=e;const Gt=zc(),{map:or,loadedImages:Jt}=Hk();bt(n,or,Se=>t(4,u=Se)),bt(n,Jt,Se=>t(5,f=Se));let wr=new Set;async function Ve(Se,Be=!1){if(u&&!(!u.loaded()&&!Be))if("url"in Se){wr.add(Se.id);try{let nr=await u.loadImage(Se.url);u==null||u.addImage(Se.id,nr.data,Se.options),f.add(Se.id),Jt.set(f)}catch(nr){Gt("error",nr)}finally{wr.delete(Se.id)}}else u.addImage(Se.id,Se.data,Se.options),f.add(Se.id),Jt.set(f)}let ct,tr,rt,rr;function ni(Se){return li(),zi(or,u=new mo.Map(wh({container:Se,style:T,locale:Ye,center:F,zoom:B,pitch:G,bearing:J,minZoom:pe,maxZoom:Ee,antialias:Pe,interactive:ve,preserveDrawingBuffer:mt,maxBounds:Ht,bounds:j,attributionControl:We,transformRequest:Zt,cooperativeGestures:at})),u),u.on("load",Be=>{Be.target.getContainer().setAttribute("data-testid","map"),Be.target.getCanvas().setAttribute("data-testid","map-canvas"),t(0,X=!0),Gt("load",u)}),u.on("error",Be=>Gt("error",{...Be,map:u})),u.on("movestart",Be=>Gt("movestart",{...Be,map:u})),u.on("moveend",Be=>{if(t(12,F=Be.target.getCenter()),t(13,B=Be.target.getZoom()),t(14,G=Be.target.getPitch()),t(15,J=Be.target.getBearing()),t(16,j=Be.target.getBounds()),Gt("moveend",{...Be,map:u}),V){let nr=new URL(window.location.href.replace(/(#.+)?$/,xE(u)));me(nr)}}),u.on("click",Be=>Gt("click",{...Be,map:u})),u.on("dblclick",Be=>Gt("dblclick",{...Be,map:u})),u.on("contextmenu",Be=>Gt("contextmenu",{...Be,map:u})),u.on("zoomstart",Be=>Gt("zoomstart",{...Be,map:u})),u.on("zoom",Be=>{Gt("zoom",{...Be,map:u})}),u.on("zoomend",Be=>{Gt("zoomend",{...Be,map:u})}),u.on("style.load",()=>{if(u){const Be=u.getStyle();if(t(36,ct=Be.layers.map(nr=>nr.id)),t(37,tr=Object.keys(Be.sources)),rr)for(const[nr,Te]of Object.entries(rr))u.addSource(nr,Te);if(rt)for(const nr of rt)u.addLayer(nr);for(const nr of qt)Ve(nr,!0)}}),u.on("styledata",Be=>{if(u&&Xe){const nr=u.getStyle().layers;if(nr)for(let Te of nr)Xe(Te)||u.setLayoutProperty(Te.id,"visibility","none")}Gt("styledata",{...Be,map:u})}),{destroy(){t(0,X=!1),u==null||u.remove(),zi(or,u=null,u)}}}let cr=T;function li(){if(V){let Se=wE(window.location.hash);Se.length>=3&&(t(13,B=Se[0]),t(12,F=[Se[2],Se[1]])),Se.length==5&&(t(15,J=Se[3]),t(14,G=Se[4]))}}function Bi(Se){Hr[Se?"unshift":"push"](()=>{M=Se,t(1,M)})}return n.$$set=Se=>{"map"in Se&&t(17,w=Se.map),"mapContainer"in Se&&t(1,M=Se.mapContainer),"class"in Se&&t(2,k=Se.class),"style"in Se&&t(18,T=Se.style),"diffStyleUpdates"in Se&&t(19,z=Se.diffStyleUpdates),"center"in Se&&t(12,F=Se.center),"zoom"in Se&&t(13,B=Se.zoom),"pitch"in Se&&t(14,G=Se.pitch),"bearing"in Se&&t(15,J=Se.bearing),"bounds"in Se&&t(16,j=Se.bounds),"hash"in Se&&t(20,V=Se.hash),"updateHash"in Se&&t(21,me=Se.updateHash),"loaded"in Se&&t(0,X=Se.loaded),"minZoom"in Se&&t(22,pe=Se.minZoom),"maxZoom"in Se&&t(23,Ee=Se.maxZoom),"antialias"in Se&&t(24,Pe=Se.antialias),"zoomOnDoubleClick"in Se&&t(25,$e=Se.zoomOnDoubleClick),"locale"in Se&&t(26,Ye=Se.locale),"interactive"in Se&&t(27,ve=Se.interactive),"attributionControl"in Se&&t(28,We=Se.attributionControl),"cooperativeGestures"in Se&&t(29,at=Se.cooperativeGestures),"preserveDrawingBuffer"in Se&&t(30,mt=Se.preserveDrawingBuffer),"maxBounds"in Se&&t(31,Ht=Se.maxBounds),"images"in Se&&t(32,qt=Se.images),"standardControls"in Se&&t(3,Ue=Se.standardControls),"filterLayers"in Se&&t(33,Xe=Se.filterLayers),"transformRequest"in Se&&t(34,Zt=Se.transformRequest),"$$scope"in Se&&t(39,y=Se.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&8&&t(7,o=typeof Ue=="boolean"?void 0:Ue),n.$$.dirty[0]&16&&t(17,w=u),n.$$.dirty[0]&786448|n.$$.dirty[1]&224&&u&&!lc(T,cr)){const Se=u.getStyle();if(ct&&(rt=Se.layers.filter(Be=>!ct.includes(Be.id))),tr){const Be=Object.keys(Se.sources).filter(nr=>!tr.includes(nr));rr={};for(const nr of Be)rr[nr]=Se.sources[nr]}t(38,cr=T),u.setStyle(T,{diff:z}),zi(Jt,f=new Set,f),t(35,wr=new Set)}if(n.$$.dirty[0]&49|n.$$.dirty[1]&18&&X&&u!=null&&u.loaded())for(let Se of qt)!f.has(Se.id)&&!wr.has(Se.id)&&!u.hasImage(Se.id)&&Ve(Se);if(n.$$.dirty[0]&32|n.$$.dirty[1]&2&&t(6,l=qt.every(Se=>f.has(Se.id))),n.$$.dirty[0]&61456&&u){let Se={};F!=null&&!lc(F,u==null?void 0:u.getCenter())&&(Se.center=F),B!=null&&!lc(B,u==null?void 0:u.getZoom())&&(Se.zoom=B),J!=null&&!lc(J,u==null?void 0:u.getBearing())&&(Se.bearing=J),G!=null&&!lc(G,u==null?void 0:u.getPitch())&&(Se.pitch=G),Object.keys(Se).length&&u.easeTo(Se)}n.$$.dirty[0]&65552&&j&&!lc(j,u==null?void 0:u.getBounds())&&(u==null||u.fitBounds(j)),n.$$.dirty[0]&33554448&&($e?u==null||u.doubleClickZoom.enable():u==null||u.doubleClickZoom.disable())},[X,M,k,Ue,u,f,l,o,or,Jt,ni,li,F,B,G,J,j,w,T,z,V,me,pe,Ee,Pe,$e,Ye,ve,We,at,mt,Ht,qt,Xe,Zt,wr,ct,tr,cr,y,c,Bi]}class LE extends Dt{constructor(e){super(),Ft(this,e,zE,AE,At,{map:17,mapContainer:1,class:2,style:18,diffStyleUpdates:19,center:12,zoom:13,pitch:14,bearing:15,bounds:16,hash:20,updateHash:21,loaded:0,minZoom:22,maxZoom:23,antialias:24,zoomOnDoubleClick:25,locale:26,interactive:27,attributionControl:28,cooperativeGestures:29,preserveDrawingBuffer:30,maxBounds:31,images:32,standardControls:3,filterLayers:33,transformRequest:34},null,[-1,-1])}}const DE=n=>({marker:n&8}),K0=n=>({marker:n[3]});function FE(n){let e,t,o,l,u,f,c;const y=n[19].default,w=yi(y,n,n[18],K0);return{c(){e=et("div"),w&&w.c(),this.h()},l(M){e=tt(M,"DIV",{tabindex:!0,role:!0});var k=Lt(e);w&&w.l(k),k.forEach(ee),this.h()},h(){Ke(e,"tabindex",t=n[1]?0:void 0),Ke(e,"role",o=n[1]?"button":void 0),ki(e,"z-index",n[2])},m(M,k){ce(M,e,k),w&&w.m(e,null),u=!0,f||(c=[Ym(n[7].call(null,e)),Ym(l=RE.call(null,e,n[0])),fr(e,"click",td(n[20])),fr(e,"dblclick",td(n[21])),fr(e,"contextmenu",td(n[22])),fr(e,"mouseenter",n[23]),fr(e,"mouseleave",n[24]),fr(e,"mousemove",n[25]),fr(e,"keydown",n[8])],f=!0)},p(M,[k]){w&&w.p&&(!u||k&262152)&&_i(w,y,M,M[18],u?bi(y,M[18],k,DE):vi(M[18]),K0),(!u||k&2&&t!==(t=M[1]?0:void 0))&&Ke(e,"tabindex",t),(!u||k&2&&o!==(o=M[1]?"button":void 0))&&Ke(e,"role",o),l&&Nk(l.update)&&k&1&&l.update.call(null,M[0]),k&4&&ki(e,"z-index",M[2])},i(M){u||(ae(w,M),u=!0)},o(M){fe(w,M),u=!1},d(M){M&&ee(e),w&&w.d(M),f=!1,os(c)}}}function RE(n,e){const t=n.className;function o(l){l?n.className=`${t} ${l}`:n.className=t}return o(e),{update:o}}function BE(n,e,t){let o,l,u,{$$slots:f={},$$scope:c}=e,{marker:y=void 0}=e,{lngLat:w}=e,{class:M=void 0}=e,{interactive:k=!0}=e,{asButton:T=!1}=e,{draggable:z=!1}=e,{feature:F=null}=e,{offset:B=void 0}=e,{zIndex:G=void 0}=e,{rotation:J=0}=e,{opacity:j=1}=e;const V=zc(),{map:me,layerEvent:X,self:pe}=Xk();bt(n,me,Ue=>t(27,u=Ue)),bt(n,X,Ue=>t(26,o=Ue)),bt(n,pe,Ue=>t(3,l=Ue));function Ee(Ue){zi(pe,l=new mo.Marker({element:Ue,rotation:J,draggable:z,offset:B,opacity:j.toString()}).setLngLat(w).addTo(u),l),t(11,y=l);const Xe=()=>Ye("dragstart"),Zt=()=>{Pe(),Ye("drag")},Gt=()=>{Pe(),Ye("dragend")};return z&&(l.on("dragstart",Xe),l.on("drag",Zt),l.on("dragend",Gt)),{destroy(){z&&(l==null||l.off("dragstart",Xe),l==null||l.off("drag",Zt),l==null||l.off("dragend",Gt)),t(11,y=void 0),l==null||l.remove()}}}function Pe(){let Ue=l==null?void 0:l.getLngLat();Ue&&(Array.isArray(w)?t(10,w=[Ue.lng,Ue.lat]):w&&"lon"in w?t(10,w={lon:Ue.lng,lat:Ue.lat}):t(10,w=Ue))}function $e(Ue){Ue.key===" "&&(Ue.preventDefault(),Ue.stopPropagation(),Ye("click"))}function Ye(Ue){if(!k)return;let Xe=l==null?void 0:l.getLngLat();if(!Xe)return;const Zt=[Xe.lng,Xe.lat];let Gt={map:u,marker:l,lngLat:Zt,features:[{type:"Feature",properties:(F==null?void 0:F.properties)??{},geometry:{type:"Point",coordinates:Zt}}]};zi(X,o={...Gt,layerType:"marker",type:Ue},o),V(Ue,Gt)}const ve=()=>Ye("click"),We=()=>Ye("dblclick"),at=()=>Ye("contextmenu"),mt=Ue=>{Ye("mouseenter")},Ht=()=>{Ye("mouseleave")},qt=()=>Ye("mousemove");return n.$$set=Ue=>{"marker"in Ue&&t(11,y=Ue.marker),"lngLat"in Ue&&t(10,w=Ue.lngLat),"class"in Ue&&t(0,M=Ue.class),"interactive"in Ue&&t(12,k=Ue.interactive),"asButton"in Ue&&t(1,T=Ue.asButton),"draggable"in Ue&&t(13,z=Ue.draggable),"feature"in Ue&&t(14,F=Ue.feature),"offset"in Ue&&t(15,B=Ue.offset),"zIndex"in Ue&&t(2,G=Ue.zIndex),"rotation"in Ue&&t(16,J=Ue.rotation),"opacity"in Ue&&t(17,j=Ue.opacity),"$$scope"in Ue&&t(18,c=Ue.$$scope)},n.$$.update=()=>{n.$$.dirty&1032&&(l==null||l.setLngLat(w)),n.$$.dirty&32776&&(l==null||l.setOffset(B??[0,0])),n.$$.dirty&65544&&(l==null||l.setRotation(J)),n.$$.dirty&131080&&(l==null||l.setOpacity(j.toString()))},[M,T,G,l,me,X,pe,Ee,$e,Ye,w,y,k,z,F,B,J,j,c,f,ve,We,at,mt,Ht,qt]}class Qm extends Dt{constructor(e){super(),Ft(this,e,BE,FE,At,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}class Em{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let o=0;for(let l=0;l0){for(f=e[--t];t>0&&(o=f,l=e[--t],f=o+l,u=l-(f-o),!u););t>0&&(u<0&&e[t-1]<0||u>0&&e[t-1]>0)&&(l=u*2,o=f+l,l==o-f&&(f=o))}return f}}var OE=1e-6,Y0=1e-12,ey=Math.PI,Q0=ey/2,ev=180/ey,ts=ey/180,rx=Math.atan2,rs=Math.cos,eg=Math.hypot,is=Math.sin,$E=Math.sqrt;function ix(n){return n>1?Q0:n<-1?-Q0:Math.asin(n)}function NE(){}function xd(n,e){n&&rv.hasOwnProperty(n.type)&&rv[n.type](n,e)}var tv={Feature:function(n,e){xd(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,o=-1,l=t.length;++o({feature:n[0]&1024,position:n[0]&1026}),av=n=>({feature:n[40],position:n[41]});function lv(n){let e=[],t=new WE,o,l,u=_o(n[10]);const f=c=>c[40].id;for(let c=0;c=n[13]&&n[11]<=n[12]&&lv(n);return{c(){Ae(e.$$.fragment),t=qe(),u&&u.c(),o=Ot()},l(f){Fe(e.$$.fragment,f),t=Ge(f),u&&u.l(f),o=Ot()},m(f,c){ze(e,f,c),ce(f,t,c),u&&u.m(f,c),ce(f,o,c),l=!0},p(f,c){const y={};c[0]&32&&(y.minzoom=f[5]),c[0]&64&&(y.maxzoom=f[6]),e.$set(y),f[11]>=f[13]&&f[11]<=f[12]?u?(u.p(f,c),c[0]&14336&&ae(u,1)):(u=lv(f),u.c(),ae(u,1),u.m(o.parentNode,o)):u&&(vr(),fe(u,1,1,()=>{u=null}),br())},i(f){l||(ae(e.$$.fragment,f),ae(u),l=!0)},o(f){fe(e.$$.fragment,f),fe(u),l=!1},d(f){f&&(ee(t),ee(o)),Le(e,f),u&&u.d(f)}}}function YE(n,e,t){let o,l,u,f,c,y,w,{$$slots:M={},$$scope:k}=e;const{map:T,source:z,minzoom:F,maxzoom:B}=ma();bt(n,T,rt=>t(21,f=rt)),bt(n,z,rt=>t(9,c=rt)),bt(n,F,rt=>t(23,w=rt)),bt(n,B,rt=>t(22,y=rt));const G=zc();let{applyToClusters:J=void 0}=e,{filter:j=void 0}=e,{markerLngLat:V=HE}=e,{interactive:me=!0}=e,{asButton:X=!1}=e,{draggable:pe=!1}=e,{minzoom:Ee=void 0}=e,{maxzoom:Pe=void 0}=e,{hovered:$e=null}=e,{zIndex:Ye=void 0}=e,{class:ve=void 0}=e,We=!1;function at(){f&&(We=!0,f.on("zoom",Xe),f.on("move",qt),f.on("moveend",qt),f.loaded()?f.once("load",qt):qt())}function mt(rt){rt.sourceId===c&&rt.isSourceLoaded&&(We?qt():at())}Ei(()=>{f&&(f.off("zoom",Xe),f.off("move",qt),f.off("moveend",qt),f.off("sourcedata",mt))});let Ht=[];function qt(){var ni;if(!f||!c)return;let rt=f.querySourceFeatures(c,{filter:u}),rr=new Map;for(let cr of rt)cr.id||((ni=cr.properties)!=null&&ni.cluster_id?cr.id="autocluster_"+cr.properties.cluster_id:cr.id=pa("autofeat")),rr.set(cr.id,cr);t(10,Ht=[...rr.values()].sort((cr,li)=>cr.id.toString().localeCompare(li.id.toString())))}let Ue=(f==null?void 0:f.getZoom())??0;function Xe(rt){t(11,Ue=f.getZoom()),qt()}const Zt=rt=>{t(0,$e=rt)},Gt=rt=>{($e==null?void 0:$e.id)===rt.id&&t(0,$e=null)},or=(rt,rr)=>G("dragstart",{...rr.detail,source:c,feature:rt}),Jt=(rt,rr)=>G("drag",{...rr.detail,source:c,feature:rt}),wr=(rt,rr)=>G("dragend",{...rr.detail,source:c,feature:rt}),Ve=(rt,rr)=>G("click",{...rr.detail,source:c,feature:rt}),ct=(rt,rr)=>G("dblclick",{...rr.detail,source:c,feature:rt}),tr=(rt,rr)=>G("contextmenu",{...rr.detail,source:c,feature:rt});return n.$$set=rt=>{"applyToClusters"in rt&&t(19,J=rt.applyToClusters),"filter"in rt&&t(20,j=rt.filter),"markerLngLat"in rt&&t(1,V=rt.markerLngLat),"interactive"in rt&&t(2,me=rt.interactive),"asButton"in rt&&t(3,X=rt.asButton),"draggable"in rt&&t(4,pe=rt.draggable),"minzoom"in rt&&t(5,Ee=rt.minzoom),"maxzoom"in rt&&t(6,Pe=rt.maxzoom),"hovered"in rt&&t(0,$e=rt.hovered),"zIndex"in rt&&t(7,Ye=rt.zIndex),"class"in rt&&t(8,ve=rt.class),"$$scope"in rt&&t(33,k=rt.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&8388640&&t(13,o=Ee??w),n.$$.dirty[0]&4194368&&t(12,l=Pe??y),n.$$.dirty[0]&1572864&&(u=Yb("all",Qb(J),j)),n.$$.dirty[0]&2097664&&f&&c){let rt=f.getSource(c);rt!=null&&rt.loaded()?at():f.on("sourcedata",mt)}},[$e,V,me,X,pe,Ee,Pe,Ye,ve,c,Ht,Ue,l,o,T,z,F,B,G,J,j,f,y,w,M,Zt,Gt,or,Jt,wr,Ve,ct,tr,k]}class QE extends Dt{constructor(e){super(),Ft(this,e,YE,KE,At,{applyToClusters:19,filter:20,markerLngLat:1,interactive:2,asButton:3,draggable:4,minzoom:5,maxzoom:6,hovered:0,zIndex:7,class:8},null,[-1,-1])}}const eP=n=>({features:n[0]&16,data:n[0]&16,map:n[0]&4,close:n[0]&1}),uv=n=>{var e;return{features:n[4],data:(e=n[4])==null?void 0:e[0],map:n[2],close:n[31]}};function hv(n){let e,t,o=(n[4]||n[3]instanceof mo.Marker)&&fv(n);return{c(){e=et("div"),o&&o.c()},l(l){e=tt(l,"DIV",{});var u=Lt(e);o&&o.l(u),u.forEach(ee)},m(l,u){ce(l,e,u),o&&o.m(e,null),n[32](e),t=!0},p(l,u){l[4]||l[3]instanceof mo.Marker?o?(o.p(l,u),u[0]&24&&ae(o,1)):(o=fv(l),o.c(),ae(o,1),o.m(e,null)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(),n[32](null)}}}function fv(n){let e;const t=n[30].default,o=yi(t,n,n[29],uv);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u[0]&536870933)&&_i(o,t,l,l[29],e?bi(t,l[29],u,eP):vi(l[29]),uv)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function tP(n){let e,t,o=n[9].default&&hv(n);return{c(){o&&o.c(),e=Ot()},l(l){o&&o.l(l),e=Ot()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[9].default?o?(o.p(l,u),u[0]&512&&ae(o,1)):(o=hv(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function rP(n,e,t){let o,l,u,f,c,y,{$$slots:w={},$$scope:M}=e;const k=Wb(w);let{closeButton:T=void 0}=e,{closeOnClickOutside:z=!0}=e,{closeOnClickInside:F=!1}=e,{closeOnMove:B=!1}=e,{openOn:G="click"}=e,{openIfTopMost:J=!0}=e,{focusAfterOpen:j=!0}=e,{anchor:V=void 0}=e,{offset:me=void 0}=e,{popupClass:X=void 0}=e,{maxWidth:pe=void 0}=e,{lngLat:Ee=void 0}=e,{html:Pe=void 0}=e,{open:$e=!1}=e;const Ye=zc(),{map:ve,popupTarget:We,layerEvent:at,layer:mt,eventTopMost:Ht}=ma();bt(n,ve,Be=>t(2,u=Be)),bt(n,We,Be=>t(3,c=Be)),bt(n,at,Be=>t(28,f=Be)),bt(n,mt,Be=>t(35,y=Be));const qt=["click","dblclick","contextmenu"];let Ue,Xe=!1,Zt;function Gt(){if(!Ue)return;let Be=Ue.getElement();!Be||Be===Zt||(Zt=Be,G==="hover"&&(Zt.style.pointerEvents="none"),Zt.addEventListener("mouseenter",()=>{t(24,Xe=!0)},{passive:!0}),Zt.addEventListener("mouseleave",()=>{t(24,Xe=!1)},{passive:!0}),Zt.addEventListener("click",()=>{F&&t(0,$e=!1)},{passive:!0}))}As(()=>{if(u)return u.on("click",cr),u.on("contextmenu",cr),typeof c=="string"&&(u.on("click",c,Ve),u.on("dblclick",c,Ve),u.on("contextmenu",c,Ve),u.on("mousemove",c,ni),u.on("mouseleave",c,rr),u.on("touchstart",c,tr),u.on("touchend",c,rt)),()=>{u!=null&&u.loaded()&&(Ue==null||Ue.remove(),u.off("click",cr),u.off("contextmenu",cr),c instanceof mo.Marker?c.getPopup()===Ue&&c.setPopup(void 0):typeof c=="string"&&(u.off("click",c,Ve),u.off("dblclick",c,Ve),u.off("contextmenu",c,Ve),u.off("mousemove",c,ni),u.off("mouseleave",c,rr),u.off("touchstart",c,tr),u.off("touchend",c,rt)))}});function or(Be){return J?!("marker"in Be)&&!Jk(Be)&&Ht(Be)!==y:!1}let Jt=null,wr="normal";function Ve(Be){Be.type===G&&(or(Be)||("layerType"in Be?Be.layerType==="deckgl"?(t(10,Ee=Be.coordinate),t(4,Jt=Be.object?[Be.object]:null)):(t(10,Ee=Be.lngLat),t(4,Jt=Be.features??[])):(t(10,Ee=Be.lngLat),t(4,Jt=Be.features??[])),setTimeout(()=>t(0,$e=!0))))}let ct=null;function tr(Be){ct=Be.point}function rt(Be){if(!ct||G!=="hover")return;let nr=ct.dist(Be.point);ct=null,nr<3&&(t(10,Ee=Be.lngLat),t(4,Jt=Be.features??[]),Ue.isOpen()?t(25,wr="justOpened"):(t(25,wr="opening"),t(0,$e=!0)))}function rr(Be){G!=="hover"||ct||wr!=="normal"||(t(0,$e=!1),t(4,Jt=null))}function ni(Be){if(!(G!=="hover"||ct||wr!=="normal")){if(or(Be)){t(0,$e=!1),t(4,Jt=null);return}t(0,$e=!0),t(4,Jt=Be.features??[]),t(10,Ee=Be.lngLat)}}function cr(Be){if(wr==="justOpened"){t(25,wr="normal");return}if(!z)return;let nr=[Zt,c instanceof mo.Marker?c==null?void 0:c.getElement():null];$e&&Ue.isOpen()&&!nr.some(Te=>Te==null?void 0:Te.contains(Be.originalEvent.target))&&(Be.type==="contextmenu"&&G==="contextmenu"||Be.type!=="contextmenu")&&t(0,$e=!1)}Ei(()=>{u&&(Ue!=null&&Ue.isOpen())&&Ue.remove()});let li;const Bi=()=>t(0,$e=!1);function Se(Be){Hr[Be?"unshift":"push"](()=>{li=Be,t(1,li)})}return n.$$set=Be=>{"closeButton"in Be&&t(11,T=Be.closeButton),"closeOnClickOutside"in Be&&t(12,z=Be.closeOnClickOutside),"closeOnClickInside"in Be&&t(13,F=Be.closeOnClickInside),"closeOnMove"in Be&&t(14,B=Be.closeOnMove),"openOn"in Be&&t(15,G=Be.openOn),"openIfTopMost"in Be&&t(16,J=Be.openIfTopMost),"focusAfterOpen"in Be&&t(17,j=Be.focusAfterOpen),"anchor"in Be&&t(18,V=Be.anchor),"offset"in Be&&t(19,me=Be.offset),"popupClass"in Be&&t(20,X=Be.popupClass),"maxWidth"in Be&&t(21,pe=Be.maxWidth),"lngLat"in Be&&t(10,Ee=Be.lngLat),"html"in Be&&t(22,Pe=Be.html),"open"in Be&&t(0,$e=Be.open),"$$scope"in Be&&t(29,M=Be.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&14336&&t(27,o=T??(!z&&!F)),n.$$.dirty[0]&146685952&&(Ue||(t(23,Ue=new mo.Popup({closeButton:o,closeOnClick:!1,closeOnMove:B,focusAfterOpen:j,maxWidth:pe,className:X,anchor:V,offset:me})),Zt=Ue.getElement(),Ue.on("open",()=>{t(0,$e=!0),Gt(),Ye("open",Ue)}),Ue.on("close",()=>{t(0,$e=!1),Ye("close",Ue)}),Ue.on("hover",()=>{Ye("hover",Ue)}))),n.$$.dirty[0]&8421384&&Ue&&c instanceof mo.Marker&&(G==="click"?c.setPopup(Ue):c.getPopup()===Ue&&c.setPopup(void 0)),n.$$.dirty[0]&268468224&&qt.includes(G)&&(f==null?void 0:f.type)===G&&(Ve(f),zi(at,f=null,f)),n.$$.dirty[0]&268468224&&t(26,l=G==="hover"&&((f==null?void 0:f.type)==="mousemove"||(f==null?void 0:f.type)==="mouseenter")),n.$$.dirty[0]&352354304&&G==="hover"&&at&&(l&&f&&(f.layerType==="deckgl"?(t(10,Ee=f.coordinate),t(4,Jt=f.object?[f.object]:null)):(t(10,Ee=f.lngLat),t(4,Jt=f.features??[]))),t(0,$e=(l||Xe)??!1)),n.$$.dirty[0]&12582914&&(li?Ue.setDOMContent(li):Pe&&Ue.setHTML(Pe)),n.$$.dirty[0]&8389632&&Ee&&Ue.setLngLat(Ee),n.$$.dirty[0]&41943045&&u){let Be=Ue.isOpen();$e&&!Be?(Ue.addTo(u),wr==="opening"&&t(25,wr="justOpened")):!$e&&Be&&Ue.remove()}},[$e,li,u,c,Jt,ve,We,at,mt,k,Ee,T,z,F,B,G,J,j,V,me,X,pe,Pe,Ue,Xe,wr,l,o,f,M,w,Bi,Se]}class ry extends Dt{constructor(e){super(),Ft(this,e,rP,tP,At,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}function iP(n){let e;const t=n[8].default,o=yi(t,n,n[15],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&32768)&&_i(o,t,l,l[15],e?bi(t,l[15],u,null):vi(l[15]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function nP(n){let e,t;return e=new Yd({props:{id:n[0],type:"raster",source:n[1],beforeId:n[2],beforeLayerType:n[3],paint:n[4],layout:n[5],minzoom:n[6],maxzoom:n[7],$$slots:{default:[iP]},$$scope:{ctx:n}}}),e.$on("click",n[9]),e.$on("dblclick",n[10]),e.$on("contextmenu",n[11]),e.$on("mouseenter",n[12]),e.$on("mousemove",n[13]),e.$on("mouseleave",n[14]),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&1&&(u.id=o[0]),l&2&&(u.source=o[1]),l&4&&(u.beforeId=o[2]),l&8&&(u.beforeLayerType=o[3]),l&16&&(u.paint=o[4]),l&32&&(u.layout=o[5]),l&64&&(u.minzoom=o[6]),l&128&&(u.maxzoom=o[7]),l&32768&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function oP(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("raster-layer")}=e,{source:f=void 0}=e,{beforeId:c=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:w}=e,{layout:M=void 0}=e,{minzoom:k=void 0}=e,{maxzoom:T=void 0}=e;function z(V){Er.call(this,n,V)}function F(V){Er.call(this,n,V)}function B(V){Er.call(this,n,V)}function G(V){Er.call(this,n,V)}function J(V){Er.call(this,n,V)}function j(V){Er.call(this,n,V)}return n.$$set=V=>{"id"in V&&t(0,u=V.id),"source"in V&&t(1,f=V.source),"beforeId"in V&&t(2,c=V.beforeId),"beforeLayerType"in V&&t(3,y=V.beforeLayerType),"paint"in V&&t(4,w=V.paint),"layout"in V&&t(5,M=V.layout),"minzoom"in V&&t(6,k=V.minzoom),"maxzoom"in V&&t(7,T=V.maxzoom),"$$scope"in V&&t(15,l=V.$$scope)},[u,f,c,y,w,M,k,T,o,z,F,B,G,J,j,l]}class sP extends Dt{constructor(e){super(),Ft(this,e,oP,nP,At,{id:0,source:1,beforeId:2,beforeLayerType:3,paint:4,layout:5,minzoom:6,maxzoom:7})}}var Ch=Uint8Array,ax=Uint16Array,aP=Int32Array,lP=new Ch([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),cP=new Ch([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),lx=function(n,e){for(var t=new ax(31),o=0;o<31;++o)t[o]=e+=1<>1|(Ir&21845)<<1,ks=(ks&52428)>>2|(ks&13107)<<2,ks=(ks&61680)>>4|(ks&3855)<<4,fP[Ir]=((ks&65280)>>8|(ks&255)<<8)>>1;var ks,Ir,Qd=new Ch(288);for(Ir=0;Ir<144;++Ir)Qd[Ir]=8;var Ir;for(Ir=144;Ir<256;++Ir)Qd[Ir]=9;var Ir;for(Ir=256;Ir<280;++Ir)Qd[Ir]=7;var Ir;for(Ir=280;Ir<288;++Ir)Qd[Ir]=8;var Ir,dP=new Ch(32);for(Ir=0;Ir<32;++Ir)dP[Ir]=5;var Ir,pP=new Ch(0),mP=typeof TextDecoder<"u"&&new TextDecoder,gP=0;try{mP.decode(pP,{stream:!0}),gP=1}catch{}let ro=Yr(null);class yP{constructor(e){Xr(this,"map");Xr(this,"active");Xr(this,"eventListenersSuccess");Xr(this,"eventListenersFailure");Xr(this,"cursor");Xr(this,"onMouseMove",e=>{this.active&&(this.cursor={type:"Feature",properties:{},geometry:{type:"Point",coordinates:Vw(e.lngLat.toArray())}})});Xr(this,"onClick",()=>{if(this.active&&this.cursor){for(let e of this.eventListenersSuccess)e(this.cursor);this.stop()}});Xr(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersFailure=[],this.cursor=null,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),document.removeEventListener("keydown",this.onKeyDown)}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersFailure=[]}start(){this.map.getCanvas().style.cursor="crosshair",this.active=!0}stop(){this.map.getCanvas().style.cursor="inherit",this.cursor=null,this.active=!1}}var vn=63710088e-1,iy={centimeters:vn*100,centimetres:vn*100,degrees:vn/111325,feet:vn*3.28084,inches:vn*39.37,kilometers:vn/1e3,kilometres:vn/1e3,meters:vn,metres:vn,miles:vn/1609.344,millimeters:vn*1e3,millimetres:vn*1e3,nauticalmiles:vn/1852,radians:1,yards:vn*1.0936},_P={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/vn,yards:1.0936133},og={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function vo(n,e,t){t===void 0&&(t={});var o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}function vP(n,e,t){switch(n){case"Point":return hi(e).geometry;case"LineString":return Ri(e).geometry;case"Polygon":return ny(e).geometry;case"MultiPoint":return hx(e).geometry;case"MultiLineString":return ux(e).geometry;case"MultiPolygon":return fx(e).geometry;default:throw new Error(n+" is invalid")}}function hi(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Td(n[0])||!Td(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return vo(o,e,t)}function bP(n,e,t){return t===void 0&&(t={}),go(n.map(function(o){return hi(o,e)}),t)}function ny(n,e,t){t===void 0&&(t={});for(var o=0,l=n;o=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(n*t)/t}function oy(n,e){e===void 0&&(e="kilometers");var t=iy[e];if(!t)throw new Error(e+" units is invalid");return n*t}function Lc(n,e){e===void 0&&(e="kilometers");var t=iy[e];if(!t)throw new Error(e+" units is invalid");return n/t}function EP(n,e){return Ro(Lc(n,e))}function PP(n){var e=n%360;return e<0&&(e+=360),e}function Ro(n){var e=n%(2*Math.PI);return e*180/Math.PI}function ei(n){var e=n%360;return e*Math.PI/180}function MP(n,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("length must be a positive number");return oy(Lc(n,e),t)}function IP(n,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("area must be a positive number");var o=og[e];if(!o)throw new Error("invalid original units");var l=og[t];if(!l)throw new Error("invalid final units");return n/o*l}function Td(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function sy(n){return!!n&&n.constructor===Object}function TP(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(e){if(!Td(e))throw new Error("bbox must only contain numbers")})}function CP(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}const AP=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:og,bearingToAzimuth:PP,convertArea:IP,convertLength:MP,degreesToRadians:ei,earthRadius:vn,factors:iy,feature:vo,featureCollection:go,geometry:vP,geometryCollection:SP,isNumber:Td,isObject:sy,lengthToDegrees:EP,lengthToRadians:Lc,lineString:Ri,lineStrings:wP,multiLineString:ux,multiPoint:hx,multiPolygon:fx,point:hi,points:bP,polygon:ny,polygons:xP,radiansToDegrees:Ro,radiansToLength:oy,round:kP,unitsFactors:_P,validateBBox:TP,validateId:CP},Symbol.toStringTag,{value:"Module"}));function Bn(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function yo(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function sg(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}function dx(n,e,t){if(t===void 0&&(t={}),t.final===!0)return zP(n,e);var o=Bn(n),l=Bn(e),u=ei(o[0]),f=ei(l[0]),c=ei(o[1]),y=ei(l[1]),w=Math.sin(f-u)*Math.cos(y),M=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(f-u);return Ro(Math.atan2(w,M))}function zP(n,e){var t=dx(e,n);return t=(t+180)%360,t}function Ki(n,e,t){t===void 0&&(t={});var o=Bn(n),l=Bn(e),u=ei(l[1]-o[1]),f=ei(l[0]-o[0]),c=ei(o[1]),y=ei(l[1]),w=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(f/2),2)*Math.cos(c)*Math.cos(y);return oy(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),t.units)}function dv(n,e,t,o){o===void 0&&(o={});var l=Bn(n),u=ei(l[0]),f=ei(l[1]),c=ei(t),y=Lc(e,o.units),w=Math.asin(Math.sin(f)*Math.cos(y)+Math.cos(f)*Math.sin(y)*Math.cos(c)),M=u+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(f),Math.cos(y)-Math.sin(f)*Math.sin(w)),k=Ro(M),T=Ro(w);return hi([k,T],o.properties)}function hl(n,e,t){if(n!==null)for(var o,l,u,f,c,y,w,M=0,k=0,T,z=n.type,F=z==="FeatureCollection",B=z==="Feature",G=F?n.features.length:1,J=0;Jy||F>w||B>M){c=k,y=o,w=F,M=B,u=0;return}var G=Ri([c,k],t.properties);if(e(G,o,l,B,u)===!1)return!1;u++,c=k})===!1)return!1}}})}function yx(n,e,t){var o=t,l=!1;return gx(n,function(u,f,c,y,w){l===!1&&t===void 0?o=u:o=e(o,u,f,c,y,w),l=!0}),o}function _x(n,e){if(!n)throw new Error("geojson is required");Ls(n,function(t,o,l){if(t.geometry!==null){var u=t.geometry.type,f=t.geometry.coordinates;switch(u){case"LineString":if(e(t,o,l,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cl?t:l,w=o>u?o:u;return[f,c,y,w]}var ly={exports:{}},vx={exports:{}};(function(n,e){(function(t,o){n.exports=o()})(vc,function(){function t(j,V,me,X,pe){(function Ee(Pe,$e,Ye,ve,We){for(;ve>Ye;){if(ve-Ye>600){var at=ve-Ye+1,mt=$e-Ye+1,Ht=Math.log(at),qt=.5*Math.exp(2*Ht/3),Ue=.5*Math.sqrt(Ht*qt*(at-qt)/at)*(mt-at/2<0?-1:1),Xe=Math.max(Ye,Math.floor($e-mt*qt/at+Ue)),Zt=Math.min(ve,Math.floor($e+(at-mt)*qt/at+Ue));Ee(Pe,$e,Xe,Zt,We)}var Gt=Pe[$e],or=Ye,Jt=ve;for(o(Pe,Ye,$e),We(Pe[ve],Gt)>0&&o(Pe,Ye,ve);or0;)Jt--}We(Pe[Ye],Gt)===0?o(Pe,Ye,Jt):o(Pe,++Jt,ve),Jt<=$e&&(Ye=Jt+1),$e<=Jt&&(ve=Jt-1)}})(j,V,me||0,X||j.length-1,pe||l)}function o(j,V,me){var X=j[V];j[V]=j[me],j[me]=X}function l(j,V){return jV?1:0}var u=function(j){j===void 0&&(j=9),this._maxEntries=Math.max(4,j),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function f(j,V,me){if(!me)return V.indexOf(j);for(var X=0;X=j.minX&&V.maxY>=j.minY}function G(j){return{children:j,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function J(j,V,me,X,pe){for(var Ee=[V,me];Ee.length;)if(!((me=Ee.pop())-(V=Ee.pop())<=X)){var Pe=V+Math.ceil((me-V)/X/2)*X;t(j,Pe,V,me,pe),Ee.push(V,Pe,Pe,me)}}return u.prototype.all=function(){return this._all(this.data,[])},u.prototype.search=function(j){var V=this.data,me=[];if(!B(j,V))return me;for(var X=this.toBBox,pe=[];V;){for(var Ee=0;Ee=0&&pe[V].children.length>this._maxEntries;)this._split(pe,V),V--;this._adjustParentBBoxes(X,pe,V)},u.prototype._split=function(j,V){var me=j[V],X=me.children.length,pe=this._minEntries;this._chooseSplitAxis(me,pe,X);var Ee=this._chooseSplitIndex(me,pe,X),Pe=G(me.children.splice(Ee,me.children.length-Ee));Pe.height=me.height,Pe.leaf=me.leaf,c(me,this.toBBox),c(Pe,this.toBBox),V?j[V-1].children.push(Pe):this._splitRoot(me,Pe)},u.prototype._splitRoot=function(j,V){this.data=G([j,V]),this.data.height=j.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},u.prototype._chooseSplitIndex=function(j,V,me){for(var X,pe,Ee,Pe,$e,Ye,ve,We=1/0,at=1/0,mt=V;mt<=me-V;mt++){var Ht=y(j,0,mt,this.toBBox),qt=y(j,mt,me,this.toBBox),Ue=(pe=Ht,Ee=qt,Pe=void 0,$e=void 0,Ye=void 0,ve=void 0,Pe=Math.max(pe.minX,Ee.minX),$e=Math.max(pe.minY,Ee.minY),Ye=Math.min(pe.maxX,Ee.maxX),ve=Math.min(pe.maxY,Ee.maxY),Math.max(0,Ye-Pe)*Math.max(0,ve-$e)),Xe=T(Ht)+T(qt);Ue=V;We--){var at=j.children[We];w(Pe,j.leaf?pe(at):at),$e+=z(Pe)}return $e},u.prototype._adjustParentBBoxes=function(j,V,me){for(var X=me;X>=0;X--)w(V[X],j)},u.prototype._condense=function(j){for(var V=j.length-1,me=void 0;V>=0;V--)j[V].children.length===0?V>0?(me=j[V-1].children).splice(me.indexOf(j[V]),1):this.clear():c(j[V],this.toBBox)},u})})(vx);var GP=vx.exports;const ZP=Kd(AP),HP=Kd(jP);var pv=Object.prototype.toString,bx=function(e){var t=pv.call(e),o=t==="[object Arguments]";return o||(o=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&pv.call(e.callee)==="[object Function]"),o},Pm,mv;function WP(){if(mv)return Pm;mv=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,o=bx,l=Object.prototype.propertyIsEnumerable,u=!l.call({toString:null},"toString"),f=l.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],y=function(T){var z=T.constructor;return z&&z.prototype===T},w={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},M=function(){if(typeof window>"u")return!1;for(var T in window)try{if(!w["$"+T]&&e.call(window,T)&&window[T]!==null&&typeof window[T]=="object")try{y(window[T])}catch{return!0}}catch{return!0}return!1}(),k=function(T){if(typeof window>"u"||!M)return y(T);try{return y(T)}catch{return!1}};n=function(z){var F=z!==null&&typeof z=="object",B=t.call(z)==="[object Function]",G=o(z),J=F&&t.call(z)==="[object String]",j=[];if(!F&&!B&&!G)throw new TypeError("Object.keys called on a non-object");var V=f&&B;if(J&&z.length>0&&!e.call(z,0))for(var me=0;me0)for(var X=0;X"u"||!Ji?yr:Ji(Uint8Array),ll={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?yr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?yr:ArrayBuffer,"%ArrayIteratorPrototype%":cc&&Ji?Ji([][Symbol.iterator]()):yr,"%AsyncFromSyncIteratorPrototype%":yr,"%AsyncFunction%":dc,"%AsyncGenerator%":dc,"%AsyncGeneratorFunction%":dc,"%AsyncIteratorPrototype%":dc,"%Atomics%":typeof Atomics>"u"?yr:Atomics,"%BigInt%":typeof BigInt>"u"?yr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?yr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?yr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?yr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":gM,"%eval%":eval,"%EvalError%":yM,"%Float32Array%":typeof Float32Array>"u"?yr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?yr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?yr:FinalizationRegistry,"%Function%":Sx,"%GeneratorFunction%":dc,"%Int8Array%":typeof Int8Array>"u"?yr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?yr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?yr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cc&&Ji?Ji(Ji([][Symbol.iterator]())):yr,"%JSON%":typeof JSON=="object"?JSON:yr,"%Map%":typeof Map>"u"?yr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!cc||!Ji?yr:Ji(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?yr:Promise,"%Proxy%":typeof Proxy>"u"?yr:Proxy,"%RangeError%":_M,"%ReferenceError%":vM,"%Reflect%":typeof Reflect>"u"?yr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?yr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!cc||!Ji?yr:Ji(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?yr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cc&&Ji?Ji(""[Symbol.iterator]()):yr,"%Symbol%":cc?Symbol:yr,"%SyntaxError%":Sc,"%ThrowTypeError%":xM,"%TypedArray%":SM,"%TypeError%":gc,"%Uint8Array%":typeof Uint8Array>"u"?yr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?yr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?yr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?yr:Uint32Array,"%URIError%":bM,"%WeakMap%":typeof WeakMap>"u"?yr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?yr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?yr:WeakSet};if(Ji)try{null.error}catch(n){var kM=Ji(Ji(n));ll["%Error.prototype%"]=kM}var EM=function n(e){var t;if(e==="%AsyncFunction%")t=Im("async function () {}");else if(e==="%GeneratorFunction%")t=Im("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Im("async function* () {}");else if(e==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(t=o.prototype)}else if(e==="%AsyncIteratorPrototype%"){var l=n("%AsyncGenerator%");l&&Ji&&(t=Ji(l.prototype))}return ll[e]=t,t},bv={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ah=hy,Cd=wx,PM=Ah.call(Function.call,Array.prototype.concat),MM=Ah.call(Function.apply,Array.prototype.splice),xv=Ah.call(Function.call,String.prototype.replace),Ad=Ah.call(Function.call,String.prototype.slice),IM=Ah.call(Function.call,RegExp.prototype.exec),TM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,CM=/\\(\\)?/g,AM=function(e){var t=Ad(e,0,1),o=Ad(e,-1);if(t==="%"&&o!=="%")throw new Sc("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&t!=="%")throw new Sc("invalid intrinsic syntax, expected opening `%`");var l=[];return xv(e,TM,function(u,f,c,y){l[l.length]=c?xv(y,CM,"$1"):f||u}),l},zM=function(e,t){var o=e,l;if(Cd(bv,o)&&(l=bv[o],o="%"+l[0]+"%"),Cd(ll,o)){var u=ll[o];if(u===dc&&(u=EM(o)),typeof u>"u"&&!t)throw new gc("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:l,name:o,value:u}}throw new Sc("intrinsic "+e+" does not exist!")},ss=function(e,t){if(typeof e!="string"||e.length===0)throw new gc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new gc('"allowMissing" argument must be a boolean');if(IM(/^%?[^%]*%?$/,e)===null)throw new Sc("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=AM(e),l=o.length>0?o[0]:"",u=zM("%"+l+"%",t),f=u.name,c=u.value,y=!1,w=u.alias;w&&(l=w[0],MM(o,PM([0,1],w)));for(var M=1,k=!0;M=o.length){var B=al(c,T);k=!!B,k&&"get"in B&&!("originalValue"in B.get)?c=B.get:c=c[T]}else k=Cd(c,T),c=c[T];k&&!y&&(ll[f]=c)}}return c},LM=ss,id=LM("%Object.defineProperty%",!0)||!1;if(id)try{id({},"a",{value:1})}catch{id=!1}var fy=id,DM=ss,nd=DM("%Object.getOwnPropertyDescriptor%",!0);if(nd)try{nd([],"length")}catch{nd=null}var dy=nd,wv=fy,FM=xx,uc=ga,Sv=dy,py=function(e,t,o){if(!e||typeof e!="object"&&typeof e!="function")throw new uc("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new uc("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new uc("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new uc("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new uc("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new uc("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,y=!!Sv&&Sv(e,t);if(wv)wv(e,t,{configurable:f===null&&y?y.configurable:!f,enumerable:l===null&&y?y.enumerable:!l,value:o,writable:u===null&&y?y.writable:!u});else if(c||!l&&!u&&!f)e[t]=o;else throw new FM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},lg=fy,kx=function(){return!!lg};kx.hasArrayLengthDefineBug=function(){if(!lg)return null;try{return lg([],"length",{value:1}).length!==1}catch{return!0}};var my=kx,RM=cy,BM=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",OM=Object.prototype.toString,$M=Array.prototype.concat,kv=py,NM=function(n){return typeof n=="function"&&OM.call(n)==="[object Function]"},Ex=my(),jM=function(n,e,t,o){if(e in n){if(o===!0){if(n[e]===t)return}else if(!NM(o)||!o())return}Ex?kv(n,e,t,!0):kv(n,e,t)},Px=function(n,e){var t=arguments.length>2?arguments[2]:{},o=RM(e);BM&&(o=$M.call(o,Object.getOwnPropertySymbols(e)));for(var l=0;l4294967295||qM(t)!==t)throw new Mv("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&Pv){var f=Pv(e,"length");f&&!f.configurable&&(l=!1),f&&!f.writable&&(u=!1)}return(l||u||!o)&&(UM?Ev(e,"length",t,!0,!0):Ev(e,"length",t)),e};(function(n){var e=hy,t=ss,o=GM,l=ga,u=t("%Function.prototype.apply%"),f=t("%Function.prototype.call%"),c=t("%Reflect.apply%",!0)||e.call(f,u),y=fy,w=t("%Math.max%");n.exports=function(T){if(typeof T!="function")throw new l("a function is required");var z=c(e,f,arguments);return o(z,1+w(0,T.length-(arguments.length-1)),!0)};var M=function(){return c(e,u,arguments)};y?y(n.exports,"apply",{value:M}):n.exports.apply=M})(Mx);var Dc=Mx.exports,Ix=ss,Tx=Dc,ZM=Tx(Ix("String.prototype.indexOf")),xo=function(e,t){var o=Ix(e,!!t);return typeof o=="function"&&ZM(e,".prototype.")>-1?Tx(o):o},HM=cy,Cx=ep(),Ax=xo,Iv=Object,WM=Ax("Array.prototype.push"),Tv=Ax("Object.prototype.propertyIsEnumerable"),XM=Cx?Object.getOwnPropertySymbols:null,zx=function(e,t){if(e==null)throw new TypeError("target must be an object");var o=Iv(e);if(arguments.length===1)return o;for(var l=1;l2&&!!arguments[2];return(!o||uI)&&(cI?Cv(e,"name",t,!0,!0):Cv(e,"name",t)),e},dI=fI,pI=ga,mI=Object,Rx=dI(function(){if(this==null||this!==mI(this))throw new pI("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),gI=Rx,yI=fl.supportsDescriptors,_I=Object.getOwnPropertyDescriptor,Bx=function(){if(yI&&/a/mig.flags==="gim"){var e=_I(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var t="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(o,"sticky",{get:function(){t+="y"}}),t==="dy")return e.get}}return gI},vI=fl.supportsDescriptors,bI=Bx,xI=Object.getOwnPropertyDescriptor,wI=Object.defineProperty,SI=TypeError,Av=Object.getPrototypeOf,kI=/a/,EI=function(){if(!vI||!Av)throw new SI("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=bI(),t=Av(kI),o=xI(t,"flags");return(!o||o.get!==e)&&wI(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},PI=fl,MI=Dc,II=Rx,Ox=Bx,TI=EI,$x=MI(Ox());PI($x,{getPolyfill:Ox,implementation:II,shim:TI});var CI=$x,od={exports:{}},AI=ep,dl=function(){return AI()&&!!Symbol.toStringTag},zI=dl(),LI=xo,cg=LI("Object.prototype.toString"),tp=function(e){return zI&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:cg(e)==="[object Arguments]"},Nx=function(e){return tp(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&cg(e)!=="[object Array]"&&cg(e.callee)==="[object Function]"},DI=function(){return tp(arguments)}();tp.isLegacyArguments=Nx;var jx=DI?tp:Nx;const FI={},RI=Object.freeze(Object.defineProperty({__proto__:null,default:FI},Symbol.toStringTag,{value:"Module"})),BI=Kd(RI);var gy=typeof Map=="function"&&Map.prototype,Am=Object.getOwnPropertyDescriptor&&gy?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,zd=gy&&Am&&typeof Am.get=="function"?Am.get:null,zv=gy&&Map.prototype.forEach,yy=typeof Set=="function"&&Set.prototype,zm=Object.getOwnPropertyDescriptor&&yy?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ld=yy&&zm&&typeof zm.get=="function"?zm.get:null,Lv=yy&&Set.prototype.forEach,OI=typeof WeakMap=="function"&&WeakMap.prototype,gh=OI?WeakMap.prototype.has:null,$I=typeof WeakSet=="function"&&WeakSet.prototype,yh=$I?WeakSet.prototype.has:null,NI=typeof WeakRef=="function"&&WeakRef.prototype,Dv=NI?WeakRef.prototype.deref:null,jI=Boolean.prototype.valueOf,VI=Object.prototype.toString,UI=Function.prototype.toString,qI=String.prototype.match,_y=String.prototype.slice,la=String.prototype.replace,GI=String.prototype.toUpperCase,Fv=String.prototype.toLowerCase,Vx=RegExp.prototype.test,Rv=Array.prototype.concat,Qo=Array.prototype.join,ZI=Array.prototype.slice,Bv=Math.floor,ug=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Lm=Object.getOwnPropertySymbols,hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,kc=typeof Symbol=="function"&&typeof Symbol.iterator=="object",bn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===kc||!0)?Symbol.toStringTag:null,Ux=Object.prototype.propertyIsEnumerable,Ov=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function $v(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||Vx.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var o=n<0?-Bv(-n):Bv(n);if(o!==n){var l=String(o),u=_y.call(e,l.length+1);return la.call(l,t,"$&_")+"."+la.call(la.call(u,/([0-9]{3})/g,"$&_"),/_$/,"")}}return la.call(e,t,"$&_")}var fg=BI,Nv=fg.custom,jv=Gx(Nv)?Nv:null,HI=function n(e,t,o,l){var u=t||{};if(sa(u,"quoteStyle")&&u.quoteStyle!=="single"&&u.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(sa(u,"maxStringLength")&&(typeof u.maxStringLength=="number"?u.maxStringLength<0&&u.maxStringLength!==1/0:u.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=sa(u,"customInspect")?u.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(sa(u,"indent")&&u.indent!==null&&u.indent!==" "&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(sa(u,"numericSeparator")&&typeof u.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=u.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Hx(e,u);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var y=String(e);return c?$v(e,y):y}if(typeof e=="bigint"){var w=String(e)+"n";return c?$v(e,w):w}var M=typeof u.depth>"u"?5:u.depth;if(typeof o>"u"&&(o=0),o>=M&&M>0&&typeof e=="object")return dg(e)?"[Array]":"[Object]";var k=hT(u,o);if(typeof l>"u")l=[];else if(Zx(l,e)>=0)return"[Circular]";function T(at,mt,Ht){if(mt&&(l=ZI.call(l),l.push(mt)),Ht){var qt={depth:u.depth};return sa(u,"quoteStyle")&&(qt.quoteStyle=u.quoteStyle),n(at,qt,o+1,l)}return n(at,u,o+1,l)}if(typeof e=="function"&&!Vv(e)){var z=rT(e),F=Gf(e,T);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(F.length>0?" { "+Qo.call(F,", ")+" }":"")}if(Gx(e)){var B=kc?la.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):hg.call(e);return typeof e=="object"&&!kc?Qu(B):B}if(lT(e)){for(var G="<"+Fv.call(String(e.nodeName)),J=e.attributes||[],j=0;j",G}if(dg(e)){if(e.length===0)return"[]";var V=Gf(e,T);return k&&!uT(V)?"["+pg(V,k)+"]":"[ "+Qo.call(V,", ")+" ]"}if(JI(e)){var me=Gf(e,T);return!("cause"in Error.prototype)&&"cause"in e&&!Ux.call(e,"cause")?"{ ["+String(e)+"] "+Qo.call(Rv.call("[cause]: "+T(e.cause),me),", ")+" }":me.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Qo.call(me,", ")+" }"}if(typeof e=="object"&&f){if(jv&&typeof e[jv]=="function"&&fg)return fg(e,{depth:M-o});if(f!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(iT(e)){var X=[];return zv&&zv.call(e,function(at,mt){X.push(T(mt,e,!0)+" => "+T(at,e))}),Uv("Map",zd.call(e),X,k)}if(sT(e)){var pe=[];return Lv&&Lv.call(e,function(at){pe.push(T(at,e))}),Uv("Set",Ld.call(e),pe,k)}if(nT(e))return Dm("WeakMap");if(aT(e))return Dm("WeakSet");if(oT(e))return Dm("WeakRef");if(YI(e))return Qu(T(Number(e)));if(eT(e))return Qu(T(ug.call(e)));if(QI(e))return Qu(jI.call(e));if(KI(e))return Qu(T(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof vc<"u"&&e===vc)return"{ [object globalThis] }";if(!XI(e)&&!Vv(e)){var Ee=Gf(e,T),Pe=Ov?Ov(e)===Object.prototype:e instanceof Object||e.constructor===Object,$e=e instanceof Object?"":"null prototype",Ye=!Pe&&bn&&Object(e)===e&&bn in e?_y.call(ya(e),8,-1):$e?"Object":"",ve=Pe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",We=ve+(Ye||$e?"["+Qo.call(Rv.call([],Ye||[],$e||[]),": ")+"] ":"");return Ee.length===0?We+"{}":k?We+"{"+pg(Ee,k)+"}":We+"{ "+Qo.call(Ee,", ")+" }"}return String(e)};function qx(n,e,t){var o=(t.quoteStyle||e)==="double"?'"':"'";return o+n+o}function WI(n){return la.call(String(n),/"/g,""")}function dg(n){return ya(n)==="[object Array]"&&(!bn||!(typeof n=="object"&&bn in n))}function XI(n){return ya(n)==="[object Date]"&&(!bn||!(typeof n=="object"&&bn in n))}function Vv(n){return ya(n)==="[object RegExp]"&&(!bn||!(typeof n=="object"&&bn in n))}function JI(n){return ya(n)==="[object Error]"&&(!bn||!(typeof n=="object"&&bn in n))}function KI(n){return ya(n)==="[object String]"&&(!bn||!(typeof n=="object"&&bn in n))}function YI(n){return ya(n)==="[object Number]"&&(!bn||!(typeof n=="object"&&bn in n))}function QI(n){return ya(n)==="[object Boolean]"&&(!bn||!(typeof n=="object"&&bn in n))}function Gx(n){if(kc)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!hg)return!1;try{return hg.call(n),!0}catch{}return!1}function eT(n){if(!n||typeof n!="object"||!ug)return!1;try{return ug.call(n),!0}catch{}return!1}var tT=Object.prototype.hasOwnProperty||function(n){return n in this};function sa(n,e){return tT.call(n,e)}function ya(n){return VI.call(n)}function rT(n){if(n.name)return n.name;var e=qI.call(UI.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function Zx(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,o=n.length;te.maxStringLength){var t=n.length-e.maxStringLength,o="... "+t+" more character"+(t>1?"s":"");return Hx(_y.call(n,0,e.maxStringLength),e)+o}var l=la.call(la.call(n,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,cT);return qx(l,"single",e)}function cT(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+GI.call(e.toString(16))}function Qu(n){return"Object("+n+")"}function Dm(n){return n+" { ? }"}function Uv(n,e,t,o){var l=o?pg(t,o):Qo.call(t,", ");return n+" ("+e+") {"+l+"}"}function uT(n){for(var e=0;e({u_depth:new c.aI(Ce,je.u_depth),u_terrain:new c.aI(Ce,je.u_terrain),u_terrain_dim:new c.aJ(Ce,je.u_terrain_dim),u_terrain_matrix:new c.aK(Ce,je.u_terrain_matrix),u_terrain_unpack:new c.aL(Ce,je.u_terrain_unpack),u_terrain_exaggeration:new c.aJ(Ce,je.u_terrain_exaggeration)}))(i,Ie),this.binderUniforms=p?p.getUniforms(i,Ie):[]}draw(i,h,p,g,b,E,I,C,L,$,O,H,K,te,se,re,ue,ye){const ne=i.gl;if(this.failedToCreate)return;if(i.program.set(this.program),i.setDepthMode(p),i.setStencilMode(g),i.setColorMode(b),i.setCullFace(E),C){i.activeTexture.set(ne.TEXTURE2),ne.bindTexture(ne.TEXTURE_2D,C.depthTexture),i.activeTexture.set(ne.TEXTURE3),ne.bindTexture(ne.TEXTURE_2D,C.texture);for(const Ie in this.terrainUniforms)this.terrainUniforms[Ie].set(C[Ie])}for(const Ie in this.fixedUniforms)this.fixedUniforms[Ie].set(I[Ie]);se&&se.setUniforms(i,this.binderUniforms,K,{zoom:te});let xe=0;switch(h){case ne.LINES:xe=2;break;case ne.TRIANGLES:xe=3;break;case ne.LINE_STRIP:xe=1}for(const Ie of H.get()){const Ce=Ie.vaos||(Ie.vaos={});(Ce[L]||(Ce[L]=new yl)).bind(i,this,$,se?se.getPaintVertexBuffers():[],O,Ie.vertexOffset,re,ue,ye),ne.drawElements(h,Ie.primitiveLength*xe,ne.UNSIGNED_SHORT,Ie.primitiveOffset*xe*2)}}}function vl(v,i,h){const p=1/Xt(h,1,i.transform.tileZoom),g=Math.pow(2,h.tileID.overscaledZ),b=h.tileSize*Math.pow(2,i.transform.tileZoom)/g,E=b*(h.tileID.canonical.x+h.tileID.wrap*g),I=b*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[p,v.fromScale,v.toScale],u_fade:v.t,u_pixel_coord_upper:[E>>16,I>>16],u_pixel_coord_lower:[65535&E,65535&I]}}const bl=(v,i,h,p)=>{const g=i.style.light,b=g.properties.get("position"),E=[b.x,b.y,b.z],I=function(){var L=new c.A(9);return c.A!=Float32Array&&(L[1]=0,L[2]=0,L[3]=0,L[5]=0,L[6]=0,L[7]=0),L[0]=1,L[4]=1,L[8]=1,L}();g.properties.get("anchor")==="viewport"&&function(L,$){var O=Math.sin($),H=Math.cos($);L[0]=H,L[1]=O,L[2]=0,L[3]=-O,L[4]=H,L[5]=0,L[6]=0,L[7]=0,L[8]=1}(I,-i.transform.angle),function(L,$,O){var H=$[0],K=$[1],te=$[2];L[0]=H*O[0]+K*O[3]+te*O[6],L[1]=H*O[1]+K*O[4]+te*O[7],L[2]=H*O[2]+K*O[5]+te*O[8]}(E,E,I);const C=g.properties.get("color");return{u_matrix:v,u_lightpos:E,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[C.r,C.g,C.b],u_vertical_gradient:+h,u_opacity:p}},xl=(v,i,h,p,g,b,E)=>c.e(bl(v,i,h,p),vl(b,i,E),{u_height_factor:-Math.pow(2,g.overscaledZ)/E.tileSize/8}),za=v=>({u_matrix:v}),Os=(v,i,h,p)=>c.e(za(v),vl(h,i,p)),mp=(v,i)=>({u_matrix:v,u_world:i}),gp=(v,i,h,p,g)=>c.e(Os(v,i,h,p),{u_world:g}),Oh=(v,i,h,p)=>{const g=v.transform;let b,E;if(p.paint.get("circle-pitch-alignment")==="map"){const I=Xt(h,1,g.zoom);b=!0,E=[I,I]}else b=!1,E=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(p.paint.get("circle-pitch-scale")==="map"),u_matrix:v.translatePosMatrix(i.posMatrix,h,p.paint.get("circle-translate"),p.paint.get("circle-translate-anchor")),u_pitch_with_map:+b,u_device_pixel_ratio:v.pixelRatio,u_extrude_scale:E}},yp=(v,i,h)=>({u_matrix:v,u_inv_matrix:i,u_camera_to_center_distance:h.cameraToCenterDistance,u_viewport_size:[h.width,h.height]}),Vo=(v,i,h=1)=>({u_matrix:v,u_color:i,u_overlay:0,u_overlay_scale:h}),La=v=>({u_matrix:v}),kn=(v,i,h,p)=>({u_matrix:v,u_extrude_scale:Xt(i,1,h),u_intensity:p});function En(v,i){const h=Math.pow(2,i.canonical.z),p=i.canonical.y;return[new c.Z(0,p/h).toLngLat().lat,new c.Z(0,(p+1)/h).toLngLat().lat]}const Da=(v,i,h,p)=>{const g=v.transform;return{u_matrix:jh(v,i,h,p),u_ratio:1/Xt(i,1,g.zoom),u_device_pixel_ratio:v.pixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},wl=(v,i,h,p,g)=>c.e(Da(v,i,h,g),{u_image:0,u_image_height:p}),$h=(v,i,h,p,g)=>{const b=v.transform,E=us(i,b);return{u_matrix:jh(v,i,h,g),u_texsize:i.imageAtlasTexture.size,u_ratio:1/Xt(i,1,b.zoom),u_device_pixel_ratio:v.pixelRatio,u_image:0,u_scale:[E,p.fromScale,p.toScale],u_fade:p.t,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},Nh=(v,i,h,p,g,b)=>{const E=v.lineAtlas,I=us(i,v.transform),C=h.layout.get("line-cap")==="round",L=E.getDash(p.from,C),$=E.getDash(p.to,C),O=L.width*g.fromScale,H=$.width*g.toScale;return c.e(Da(v,i,h,b),{u_patternscale_a:[I/O,-L.height/2],u_patternscale_b:[I/H,-$.height/2],u_sdfgamma:E.width/(256*Math.min(O,H)*v.pixelRatio)/2,u_image:0,u_tex_y_a:L.y,u_tex_y_b:$.y,u_mix:g.t})};function us(v,i){return 1/Xt(v,1,i.tileZoom)}function jh(v,i,h,p){return v.translatePosMatrix(p?p.posMatrix:i.tileID.posMatrix,i,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const _p=(v,i,h,p,g)=>{return{u_matrix:v,u_tl_parent:i,u_scale_parent:h,u_buffer_scale:1,u_fade_t:p.mix,u_opacity:p.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(E=g.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(b=g.paint.get("raster-contrast"),b>0?1/(1-b):1+b),u_spin_weights:vp(g.paint.get("raster-hue-rotate"))};var b,E};function vp(v){v*=Math.PI/180;const i=Math.sin(v),h=Math.cos(v);return[(2*h+1)/3,(-Math.sqrt(3)*i-h+1)/3,(Math.sqrt(3)*i-h+1)/3]}const Vh=(v,i,h,p,g,b,E,I,C,L,$,O,H,K)=>{const te=E.transform;return{u_is_size_zoom_constant:+(v==="constant"||v==="source"),u_is_size_feature_constant:+(v==="constant"||v==="camera"),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:te.cameraToCenterDistance,u_pitch:te.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:te.width/te.height,u_fade_change:E.options.fadeDuration?E.symbolFadeChange:1,u_matrix:I,u_label_plane_matrix:C,u_coord_matrix:L,u_is_text:+O,u_pitch_with_map:+p,u_is_along_line:g,u_is_variable_anchor:b,u_texsize:H,u_texture:0,u_translation:$,u_pitched_scale:K}},Uh=(v,i,h,p,g,b,E,I,C,L,$,O,H,K,te)=>{const se=E.transform;return c.e(Vh(v,i,h,p,g,b,E,I,C,L,$,O,H,te),{u_gamma_scale:p?Math.cos(se._pitch)*se.cameraToCenterDistance:1,u_device_pixel_ratio:E.pixelRatio,u_is_halo:+K})},bp=(v,i,h,p,g,b,E,I,C,L,$,O,H,K)=>c.e(Uh(v,i,h,p,g,b,E,I,C,L,$,!0,O,!0,K),{u_texsize_icon:H,u_texture_icon:1}),Sl=(v,i,h)=>({u_matrix:v,u_opacity:i,u_color:h}),Vc=(v,i,h,p,g,b)=>c.e(function(E,I,C,L){const $=C.imageManager.getPattern(E.from.toString()),O=C.imageManager.getPattern(E.to.toString()),{width:H,height:K}=C.imageManager.getPixelSize(),te=Math.pow(2,L.tileID.overscaledZ),se=L.tileSize*Math.pow(2,C.transform.tileZoom)/te,re=se*(L.tileID.canonical.x+L.tileID.wrap*te),ue=se*L.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:$.tl,u_pattern_br_a:$.br,u_pattern_tl_b:O.tl,u_pattern_br_b:O.br,u_texsize:[H,K],u_mix:I.t,u_pattern_size_a:$.displaySize,u_pattern_size_b:O.displaySize,u_scale_a:I.fromScale,u_scale_b:I.toScale,u_tile_units_to_pixels:1/Xt(L,1,C.transform.tileZoom),u_pixel_coord_upper:[re>>16,ue>>16],u_pixel_coord_lower:[65535&re,65535&ue]}}(p,b,h,g),{u_matrix:v,u_opacity:i}),kl={fillExtrusion:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_lightpos:new c.aO(v,i.u_lightpos),u_lightintensity:new c.aJ(v,i.u_lightintensity),u_lightcolor:new c.aO(v,i.u_lightcolor),u_vertical_gradient:new c.aJ(v,i.u_vertical_gradient),u_opacity:new c.aJ(v,i.u_opacity)}),fillExtrusionPattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_lightpos:new c.aO(v,i.u_lightpos),u_lightintensity:new c.aJ(v,i.u_lightintensity),u_lightcolor:new c.aO(v,i.u_lightcolor),u_vertical_gradient:new c.aJ(v,i.u_vertical_gradient),u_height_factor:new c.aJ(v,i.u_height_factor),u_image:new c.aI(v,i.u_image),u_texsize:new c.aP(v,i.u_texsize),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade),u_opacity:new c.aJ(v,i.u_opacity)}),fill:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix)}),fillPattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_image:new c.aI(v,i.u_image),u_texsize:new c.aP(v,i.u_texsize),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade)}),fillOutline:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_world:new c.aP(v,i.u_world)}),fillOutlinePattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_world:new c.aP(v,i.u_world),u_image:new c.aI(v,i.u_image),u_texsize:new c.aP(v,i.u_texsize),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade)}),circle:(v,i)=>({u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_scale_with_map:new c.aI(v,i.u_scale_with_map),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_extrude_scale:new c.aP(v,i.u_extrude_scale),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_matrix:new c.aK(v,i.u_matrix)}),collisionBox:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_pixel_extrude_scale:new c.aP(v,i.u_pixel_extrude_scale)}),collisionCircle:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_inv_matrix:new c.aK(v,i.u_inv_matrix),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_viewport_size:new c.aP(v,i.u_viewport_size)}),debug:(v,i)=>({u_color:new c.aM(v,i.u_color),u_matrix:new c.aK(v,i.u_matrix),u_overlay:new c.aI(v,i.u_overlay),u_overlay_scale:new c.aJ(v,i.u_overlay_scale)}),clippingMask:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix)}),heatmap:(v,i)=>({u_extrude_scale:new c.aJ(v,i.u_extrude_scale),u_intensity:new c.aJ(v,i.u_intensity),u_matrix:new c.aK(v,i.u_matrix)}),heatmapTexture:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_world:new c.aP(v,i.u_world),u_image:new c.aI(v,i.u_image),u_color_ramp:new c.aI(v,i.u_color_ramp),u_opacity:new c.aJ(v,i.u_opacity)}),hillshade:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_image:new c.aI(v,i.u_image),u_latrange:new c.aP(v,i.u_latrange),u_light:new c.aP(v,i.u_light),u_shadow:new c.aM(v,i.u_shadow),u_highlight:new c.aM(v,i.u_highlight),u_accent:new c.aM(v,i.u_accent)}),hillshadePrepare:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_image:new c.aI(v,i.u_image),u_dimension:new c.aP(v,i.u_dimension),u_zoom:new c.aJ(v,i.u_zoom),u_unpack:new c.aL(v,i.u_unpack)}),line:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels)}),lineGradient:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels),u_image:new c.aI(v,i.u_image),u_image_height:new c.aJ(v,i.u_image_height)}),linePattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_texsize:new c.aP(v,i.u_texsize),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_image:new c.aI(v,i.u_image),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels),u_scale:new c.aO(v,i.u_scale),u_fade:new c.aJ(v,i.u_fade)}),lineSDF:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ratio:new c.aJ(v,i.u_ratio),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_units_to_pixels:new c.aP(v,i.u_units_to_pixels),u_patternscale_a:new c.aP(v,i.u_patternscale_a),u_patternscale_b:new c.aP(v,i.u_patternscale_b),u_sdfgamma:new c.aJ(v,i.u_sdfgamma),u_image:new c.aI(v,i.u_image),u_tex_y_a:new c.aJ(v,i.u_tex_y_a),u_tex_y_b:new c.aJ(v,i.u_tex_y_b),u_mix:new c.aJ(v,i.u_mix)}),raster:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_tl_parent:new c.aP(v,i.u_tl_parent),u_scale_parent:new c.aJ(v,i.u_scale_parent),u_buffer_scale:new c.aJ(v,i.u_buffer_scale),u_fade_t:new c.aJ(v,i.u_fade_t),u_opacity:new c.aJ(v,i.u_opacity),u_image0:new c.aI(v,i.u_image0),u_image1:new c.aI(v,i.u_image1),u_brightness_low:new c.aJ(v,i.u_brightness_low),u_brightness_high:new c.aJ(v,i.u_brightness_high),u_saturation_factor:new c.aJ(v,i.u_saturation_factor),u_contrast_factor:new c.aJ(v,i.u_contrast_factor),u_spin_weights:new c.aO(v,i.u_spin_weights)}),symbolIcon:(v,i)=>({u_is_size_zoom_constant:new c.aI(v,i.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(v,i.u_is_size_feature_constant),u_size_t:new c.aJ(v,i.u_size_t),u_size:new c.aJ(v,i.u_size),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_pitch:new c.aJ(v,i.u_pitch),u_rotate_symbol:new c.aI(v,i.u_rotate_symbol),u_aspect_ratio:new c.aJ(v,i.u_aspect_ratio),u_fade_change:new c.aJ(v,i.u_fade_change),u_matrix:new c.aK(v,i.u_matrix),u_label_plane_matrix:new c.aK(v,i.u_label_plane_matrix),u_coord_matrix:new c.aK(v,i.u_coord_matrix),u_is_text:new c.aI(v,i.u_is_text),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_is_along_line:new c.aI(v,i.u_is_along_line),u_is_variable_anchor:new c.aI(v,i.u_is_variable_anchor),u_texsize:new c.aP(v,i.u_texsize),u_texture:new c.aI(v,i.u_texture),u_translation:new c.aP(v,i.u_translation),u_pitched_scale:new c.aJ(v,i.u_pitched_scale)}),symbolSDF:(v,i)=>({u_is_size_zoom_constant:new c.aI(v,i.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(v,i.u_is_size_feature_constant),u_size_t:new c.aJ(v,i.u_size_t),u_size:new c.aJ(v,i.u_size),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_pitch:new c.aJ(v,i.u_pitch),u_rotate_symbol:new c.aI(v,i.u_rotate_symbol),u_aspect_ratio:new c.aJ(v,i.u_aspect_ratio),u_fade_change:new c.aJ(v,i.u_fade_change),u_matrix:new c.aK(v,i.u_matrix),u_label_plane_matrix:new c.aK(v,i.u_label_plane_matrix),u_coord_matrix:new c.aK(v,i.u_coord_matrix),u_is_text:new c.aI(v,i.u_is_text),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_is_along_line:new c.aI(v,i.u_is_along_line),u_is_variable_anchor:new c.aI(v,i.u_is_variable_anchor),u_texsize:new c.aP(v,i.u_texsize),u_texture:new c.aI(v,i.u_texture),u_gamma_scale:new c.aJ(v,i.u_gamma_scale),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_is_halo:new c.aI(v,i.u_is_halo),u_translation:new c.aP(v,i.u_translation),u_pitched_scale:new c.aJ(v,i.u_pitched_scale)}),symbolTextAndIcon:(v,i)=>({u_is_size_zoom_constant:new c.aI(v,i.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(v,i.u_is_size_feature_constant),u_size_t:new c.aJ(v,i.u_size_t),u_size:new c.aJ(v,i.u_size),u_camera_to_center_distance:new c.aJ(v,i.u_camera_to_center_distance),u_pitch:new c.aJ(v,i.u_pitch),u_rotate_symbol:new c.aI(v,i.u_rotate_symbol),u_aspect_ratio:new c.aJ(v,i.u_aspect_ratio),u_fade_change:new c.aJ(v,i.u_fade_change),u_matrix:new c.aK(v,i.u_matrix),u_label_plane_matrix:new c.aK(v,i.u_label_plane_matrix),u_coord_matrix:new c.aK(v,i.u_coord_matrix),u_is_text:new c.aI(v,i.u_is_text),u_pitch_with_map:new c.aI(v,i.u_pitch_with_map),u_is_along_line:new c.aI(v,i.u_is_along_line),u_is_variable_anchor:new c.aI(v,i.u_is_variable_anchor),u_texsize:new c.aP(v,i.u_texsize),u_texsize_icon:new c.aP(v,i.u_texsize_icon),u_texture:new c.aI(v,i.u_texture),u_texture_icon:new c.aI(v,i.u_texture_icon),u_gamma_scale:new c.aJ(v,i.u_gamma_scale),u_device_pixel_ratio:new c.aJ(v,i.u_device_pixel_ratio),u_is_halo:new c.aI(v,i.u_is_halo),u_translation:new c.aP(v,i.u_translation),u_pitched_scale:new c.aJ(v,i.u_pitched_scale)}),background:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_opacity:new c.aJ(v,i.u_opacity),u_color:new c.aM(v,i.u_color)}),backgroundPattern:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_opacity:new c.aJ(v,i.u_opacity),u_image:new c.aI(v,i.u_image),u_pattern_tl_a:new c.aP(v,i.u_pattern_tl_a),u_pattern_br_a:new c.aP(v,i.u_pattern_br_a),u_pattern_tl_b:new c.aP(v,i.u_pattern_tl_b),u_pattern_br_b:new c.aP(v,i.u_pattern_br_b),u_texsize:new c.aP(v,i.u_texsize),u_mix:new c.aJ(v,i.u_mix),u_pattern_size_a:new c.aP(v,i.u_pattern_size_a),u_pattern_size_b:new c.aP(v,i.u_pattern_size_b),u_scale_a:new c.aJ(v,i.u_scale_a),u_scale_b:new c.aJ(v,i.u_scale_b),u_pixel_coord_upper:new c.aP(v,i.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(v,i.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aJ(v,i.u_tile_units_to_pixels)}),terrain:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_texture:new c.aI(v,i.u_texture),u_ele_delta:new c.aJ(v,i.u_ele_delta),u_fog_matrix:new c.aK(v,i.u_fog_matrix),u_fog_color:new c.aM(v,i.u_fog_color),u_fog_ground_blend:new c.aJ(v,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.aJ(v,i.u_fog_ground_blend_opacity),u_horizon_color:new c.aM(v,i.u_horizon_color),u_horizon_fog_blend:new c.aJ(v,i.u_horizon_fog_blend)}),terrainDepth:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_ele_delta:new c.aJ(v,i.u_ele_delta)}),terrainCoords:(v,i)=>({u_matrix:new c.aK(v,i.u_matrix),u_texture:new c.aI(v,i.u_texture),u_terrain_coords_id:new c.aJ(v,i.u_terrain_coords_id),u_ele_delta:new c.aJ(v,i.u_ele_delta)}),sky:(v,i)=>({u_sky_color:new c.aM(v,i.u_sky_color),u_horizon_color:new c.aM(v,i.u_horizon_color),u_horizon:new c.aJ(v,i.u_horizon),u_sky_horizon_blend:new c.aJ(v,i.u_sky_horizon_blend)})};class Uc{constructor(i,h,p){this.context=i;const g=i.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(i){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const qc={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ao{constructor(i,h,p,g){this.length=h.length,this.attributes=p,this.itemSize=h.bytesPerElement,this.dynamicDraw=g,this.context=i;const b=i.gl;this.buffer=b.createBuffer(),i.bindVertexBuffer.set(this.buffer),b.bufferData(b.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(i){if(i.length!==this.length)throw new Error(`Length of new data is ${i.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,i.arrayBuffer)}enableAttributes(i,h){for(let p=0;p0){const Ce=c.H();c.aR(Ce,ne.placementInvProjMatrix,v.transform.glCoordMatrix),c.aR(Ce,Ce,ne.placementViewportMatrix),C.push({circleArray:Ie,circleOffset:$,transform:ye.posMatrix,invTransform:Ce,coord:ye}),L+=Ie.length/4,$=L}xe&&I.draw(b,E.LINES,sr.disabled,Hr.disabled,v.colorModeForRenderPass(),$r.disabled,{u_matrix:ye.posMatrix,u_pixel_extrude_scale:[1/(O=v.transform).width,1/O.height]},v.style.map.terrain&&v.style.map.terrain.getTerrainData(ye),h.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,null,v.transform.zoom,null,null,xe.collisionVertexBuffer)}var O;if(!g||!C.length)return;const H=v.useProgram("collisionCircle"),K=new c.aS;K.resize(4*L),K._trim();let te=0;for(const ue of C)for(let ye=0;ye=0&&(ue[ne.associatedIconIndex]={shiftedAnchor:jt,angle:jr})}else Rt(ne.numGlyphs,se)}if(L){re.clear();const ye=v.icon.placedSymbolArray;for(let ne=0;nev.style.map.terrain.getElevation(Qe,zu,wi):null,Ks=h.layout.get("text-rotation-alignment")==="map";Y(Et,Qe.posMatrix,v,g,vs,Xs,ue,L,Ks,se,Qe.toUnwrapped(),te.width,te.height,bs,Xr)}const Li=Qe.posMatrix,Un=g&&Je||Au,Zo=ye||Un?Qc:vs,Js=Gl,qi=ft&&h.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Gi;Gi=ft?Et.iconsInText?bp(jt.kind,ar,ne,ue,ye,Un,v,Li,Zo,Js,bs,ji,en,yt):Uh(jt.kind,ar,ne,ue,ye,Un,v,Li,Zo,Js,bs,g,ji,!0,yt):Vh(jt.kind,ar,ne,ue,ye,Un,v,Li,Zo,Js,bs,g,ji,yt);const Ii={program:Qt,buffers:Ut,uniformValues:Gi,atlasTexture:jn,atlasTextureIcon:Vi,atlasInterpolation:Ur,atlasInterpolationIcon:fn,isSDF:ft,hasHalo:qi};if(Ie&&Et.canOverlap){Ce=!0;const Xr=Ut.segments.get();for(const Ks of Xr)gt.push({segments:new c.a0([Ks]),sortKey:Ks.sortKey,state:Ii,terrainData:Vr})}else gt.push({segments:Ut.segments,sortKey:0,state:Ii,terrainData:Vr})}Ce&>.sort((Qe,it)=>Qe.sortKey-it.sortKey);for(const Qe of gt){const it=Qe.state;if(H.activeTexture.set(K.TEXTURE0),it.atlasTexture.bind(it.atlasInterpolation,K.CLAMP_TO_EDGE),it.atlasTextureIcon&&(H.activeTexture.set(K.TEXTURE1),it.atlasTextureIcon&&it.atlasTextureIcon.bind(it.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),it.isSDF){const Et=it.uniformValues;it.hasHalo&&(Et.u_is_halo=1,fs(it.buffers,Qe.segments,h,v,it.program,je,$,O,Et,Qe.terrainData)),Et.u_is_halo=0}fs(it.buffers,Qe.segments,h,v,it.program,je,$,O,it.uniformValues,Qe.terrainData)}}function fs(v,i,h,p,g,b,E,I,C,L){const $=p.context;g.draw($,$.gl.TRIANGLES,b,E,I,$r.disabled,C,L,h.id,v.layoutVertexBuffer,v.indexBuffer,i,h.paint,p.transform.zoom,v.programConfigurations.get(h.id),v.dynamicLayoutVertexBuffer,v.opacityVertexBuffer)}function Pn(v,i,h,p,g){if(!h||!p||!p.imageAtlas)return;const b=p.imageAtlas.patternPositions;let E=b[h.to.toString()],I=b[h.from.toString()];if(!E&&I&&(E=I),!I&&E&&(I=E),!E||!I){const C=g.getPaintProperty(i);E=b[C],I=b[C]}E&&I&&v.setConstantPatternPositions(E,I)}function tu(v,i,h,p,g,b,E){const I=v.context.gl,C="fill-pattern",L=h.paint.get(C),$=L&&L.constantOr(1),O=h.getCrossfadeParameters();let H,K,te,se,re;E?(K=$&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",H=I.LINES):(K=$?"fillPattern":"fill",H=I.TRIANGLES);const ue=L.constantOr(null);for(const ye of p){const ne=i.getTile(ye);if($&&!ne.patternsLoaded())continue;const xe=ne.getBucket(h);if(!xe)continue;const Ie=xe.programConfigurations.get(h.id),Ce=v.useProgram(K,Ie),je=v.style.map.terrain&&v.style.map.terrain.getTerrainData(ye);$&&(v.context.activeTexture.set(I.TEXTURE0),ne.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),Ie.updatePaintBuffers(O)),Pn(Ie,C,ue,ne,h);const Je=je?ye:null,gt=v.translatePosMatrix(Je?Je.posMatrix:ye.posMatrix,ne,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(E){se=xe.indexBuffer2,re=xe.segments2;const yt=[I.drawingBufferWidth,I.drawingBufferHeight];te=K==="fillOutlinePattern"&&$?gp(gt,v,O,ne,yt):mp(gt,yt)}else se=xe.indexBuffer,re=xe.segments,te=$?Os(gt,v,O,ne):za(gt);Ce.draw(v.context,H,g,v.stencilModeForClipping(ye),b,$r.disabled,te,je,h.id,xe.layoutVertexBuffer,se,re,h.paint,v.transform.zoom,Ie)}}function Al(v,i,h,p,g,b,E){const I=v.context,C=I.gl,L="fill-extrusion-pattern",$=h.paint.get(L),O=$.constantOr(1),H=h.getCrossfadeParameters(),K=h.paint.get("fill-extrusion-opacity"),te=$.constantOr(null);for(const se of p){const re=i.getTile(se),ue=re.getBucket(h);if(!ue)continue;const ye=v.style.map.terrain&&v.style.map.terrain.getTerrainData(se),ne=ue.programConfigurations.get(h.id),xe=v.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ne);O&&(v.context.activeTexture.set(C.TEXTURE0),re.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),ne.updatePaintBuffers(H)),Pn(ne,L,te,re,h);const Ie=v.translatePosMatrix(se.posMatrix,re,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Ce=h.paint.get("fill-extrusion-vertical-gradient"),je=O?xl(Ie,v,Ce,K,se,H,re):bl(Ie,v,Ce,K);xe.draw(I,I.gl.TRIANGLES,g,b,E,$r.backCCW,je,ye,h.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,h.paint,v.transform.zoom,ne,v.style.map.terrain&&ue.centroidVertexBuffer)}}function ru(v,i,h,p,g,b,E){const I=v.context,C=I.gl,L=h.fbo;if(!L)return;const $=v.useProgram("hillshade"),O=v.style.map.terrain&&v.style.map.terrain.getTerrainData(i);I.activeTexture.set(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,L.colorAttachment.get()),$.draw(I,C.TRIANGLES,g,b,E,$r.disabled,((H,K,te,se)=>{const re=te.paint.get("hillshade-shadow-color"),ue=te.paint.get("hillshade-highlight-color"),ye=te.paint.get("hillshade-accent-color");let ne=te.paint.get("hillshade-illumination-direction")*(Math.PI/180);te.paint.get("hillshade-illumination-anchor")==="viewport"&&(ne-=H.transform.angle);const xe=!H.options.moving;return{u_matrix:se?se.posMatrix:H.transform.calculatePosMatrix(K.tileID.toUnwrapped(),xe),u_image:0,u_latrange:En(0,K.tileID),u_light:[te.paint.get("hillshade-exaggeration"),ne],u_shadow:re,u_highlight:ue,u_accent:ye}})(v,h,p,O?i:null),O,p.id,v.rasterBoundsBuffer,v.quadTriangleIndexBuffer,v.rasterBoundsSegments)}function ds(v,i,h,p,g,b){const E=v.context,I=E.gl,C=i.dem;if(C&&C.data){const L=C.dim,$=C.stride,O=C.getPixels();if(E.activeTexture.set(I.TEXTURE1),E.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||v.getTileTexture($),i.demTexture){const K=i.demTexture;K.update(O,{premultiply:!1}),K.bind(I.NEAREST,I.CLAMP_TO_EDGE)}else i.demTexture=new ve(E,O,I.RGBA,{premultiply:!1}),i.demTexture.bind(I.NEAREST,I.CLAMP_TO_EDGE);E.activeTexture.set(I.TEXTURE0);let H=i.fbo;if(!H){const K=new ve(E,{width:L,height:L,data:null},I.RGBA);K.bind(I.LINEAR,I.CLAMP_TO_EDGE),H=i.fbo=E.createFramebuffer(L,L,!0,!1),H.colorAttachment.set(K.texture)}E.bindFramebuffer.set(H.framebuffer),E.viewport.set([0,0,L,L]),v.useProgram("hillshadePrepare").draw(E,I.TRIANGLES,p,g,b,$r.disabled,((K,te)=>{const se=te.stride,re=c.H();return c.aQ(re,0,c.X,-c.X,0,0,1),c.J(re,re,[0,-c.X,0]),{u_matrix:re,u_image:1,u_dimension:[se,se],u_zoom:K.overscaledZ,u_unpack:te.getUnpackVector()}})(i.tileID,C),null,h.id,v.rasterBoundsBuffer,v.quadTriangleIndexBuffer,v.rasterBoundsSegments),i.needsHillshadePrepare=!1}}function zl(v,i,h,p,g,b){const E=p.paint.get("raster-fade-duration");if(!b&&E>0){const I=k.now(),C=(I-v.timeAdded)/E,L=i?(I-i.timeAdded)/E:-1,$=h.getSource(),O=g.coveringZoomLevel({tileSize:$.tileSize,roundZoom:$.roundZoom}),H=!i||Math.abs(i.tileID.overscaledZ-O)>Math.abs(v.tileID.overscaledZ-O),K=H&&v.refreshedUponExpiration?1:c.ad(H?C:1-L,0,1);return v.refreshedUponExpiration&&C>=1&&(v.refreshedUponExpiration=!1),i?{opacity:1,mix:1-K}:{opacity:K,mix:0}}return{opacity:1,mix:0}}const Ll=new c.aN(1,0,0,1),$a=new c.aN(0,1,0,1),Dl=new c.aN(0,0,1,1),of=new c.aN(1,0,1,1),js=new c.aN(0,1,1,1);function ps(v,i,h,p){Vs(v,0,i+h/2,v.transform.width,h,p)}function iu(v,i,h,p){Vs(v,i-h/2,0,h,v.transform.height,p)}function Vs(v,i,h,p,g,b){const E=v.context,I=E.gl;I.enable(I.SCISSOR_TEST),I.scissor(i*v.pixelRatio,h*v.pixelRatio,p*v.pixelRatio,g*v.pixelRatio),E.clear({color:b}),I.disable(I.SCISSOR_TEST)}function mr(v,i,h){const p=v.context,g=p.gl,b=h.posMatrix,E=v.useProgram("debug"),I=sr.disabled,C=Hr.disabled,L=v.colorModeForRenderPass(),$="$debug",O=v.style.map.terrain&&v.style.map.terrain.getTerrainData(h);p.activeTexture.set(g.TEXTURE0);const H=i.getTileByID(h.key).latestRawTileData,K=Math.floor((H&&H.byteLength||0)/1024),te=i.getTile(h).tileSize,se=512/Math.min(te,512)*(h.overscaledZ/v.transform.zoom)*.5;let re=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(re+=` => ${h.overscaledZ}`),function(ue,ye){ue.initDebugOverlayCanvas();const ne=ue.debugOverlayCanvas,xe=ue.context.gl,Ie=ue.debugOverlayCanvas.getContext("2d");Ie.clearRect(0,0,ne.width,ne.height),Ie.shadowColor="white",Ie.shadowBlur=2,Ie.lineWidth=1.5,Ie.strokeStyle="white",Ie.textBaseline="top",Ie.font="bold 36px Open Sans, sans-serif",Ie.fillText(ye,5,5),Ie.strokeText(ye,5,5),ue.debugOverlayTexture.update(ne),ue.debugOverlayTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE)}(v,`${re} ${K}kB`),E.draw(p,g.TRIANGLES,I,C,Ar.alphaBlended,$r.disabled,Vo(b,c.aN.transparent,se),null,$,v.debugBuffer,v.quadTriangleIndexBuffer,v.debugSegments),E.draw(p,g.LINE_STRIP,I,C,L,$r.disabled,Vo(b,c.aN.red),O,$,v.debugBuffer,v.tileBorderIndexBuffer,v.debugSegments)}function Na(v,i,h){const p=v.context,g=p.gl,b=v.colorModeForRenderPass(),E=new sr(g.LEQUAL,sr.ReadWrite,v.depthRangeFor3D),I=v.useProgram("terrain"),C=i.getTerrainMesh();p.bindFramebuffer.set(null),p.viewport.set([0,0,v.width,v.height]);for(const L of h){const $=v.renderToTexture.getTexture(L),O=i.getTerrainData(L.tileID);p.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,$.texture);const H=v.transform.calculatePosMatrix(L.tileID.toUnwrapped()),K=i.getMeshFrameDelta(v.transform.zoom),te=v.transform.calculateFogMatrix(L.tileID.toUnwrapped()),se=jc(H,K,te,v.style.sky,v.transform.pitch);I.draw(p,g.TRIANGLES,E,Hr.disabled,b,$r.backCCW,se,O,"terrain",C.vertexBuffer,C.indexBuffer,C.segments)}}class sf{constructor(i,h,p){this.vertexBuffer=i,this.indexBuffer=h,this.segments=p}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class af{constructor(i,h){this.context=new Kc(i),this.transform=h,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Nt.maxUnderzooming+Nt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Dn}resize(i,h,p){if(this.width=Math.floor(i*p),this.height=Math.floor(h*p),this.pixelRatio=p,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const g of this.style._order)this.style._layers[g].resize()}setup(){const i=this.context,h=new c.aX;h.emplaceBack(0,0),h.emplaceBack(c.X,0),h.emplaceBack(0,c.X),h.emplaceBack(c.X,c.X),this.tileExtentBuffer=i.createVertexBuffer(h,Ca.members),this.tileExtentSegments=c.a0.simpleSegment(0,0,4,2);const p=new c.aX;p.emplaceBack(0,0),p.emplaceBack(c.X,0),p.emplaceBack(0,c.X),p.emplaceBack(c.X,c.X),this.debugBuffer=i.createVertexBuffer(p,Ca.members),this.debugSegments=c.a0.simpleSegment(0,0,4,5);const g=new c.$;g.emplaceBack(0,0,0,0),g.emplaceBack(c.X,0,c.X,0),g.emplaceBack(0,c.X,0,c.X),g.emplaceBack(c.X,c.X,c.X,c.X),this.rasterBoundsBuffer=i.createVertexBuffer(g,Bo.members),this.rasterBoundsSegments=c.a0.simpleSegment(0,0,4,2);const b=new c.aX;b.emplaceBack(0,0),b.emplaceBack(1,0),b.emplaceBack(0,1),b.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(b,Ca.members),this.viewportSegments=c.a0.simpleSegment(0,0,4,2);const E=new c.aZ;E.emplaceBack(0),E.emplaceBack(1),E.emplaceBack(3),E.emplaceBack(2),E.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(E);const I=new c.aY;I.emplaceBack(0,1,2),I.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(I);const C=this.context.gl;this.stencilClearMode=new Hr({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO)}clearStencil(){const i=this.context,h=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const p=c.H();c.aQ(p,0,this.width,this.height,0,0,1),c.K(p,p,[h.drawingBufferWidth,h.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,h.TRIANGLES,sr.disabled,this.stencilClearMode,Ar.disabled,$r.disabled,La(p),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(i,h){if(this.currentStencilSource===i.source||!i.isTileClipped()||!h||!h.length)return;this.currentStencilSource=i.source;const p=this.context,g=p.gl;this.nextStencilID+h.length>256&&this.clearStencil(),p.setColorMode(Ar.disabled),p.setDepthMode(sr.disabled);const b=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const E of h){const I=this._tileClippingMaskIDs[E.key]=this.nextStencilID++,C=this.style.map.terrain&&this.style.map.terrain.getTerrainData(E);b.draw(p,g.TRIANGLES,sr.disabled,new Hr({func:g.ALWAYS,mask:0},I,255,g.KEEP,g.KEEP,g.REPLACE),Ar.disabled,$r.disabled,La(E.posMatrix),C,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const i=this.nextStencilID++,h=this.context.gl;return new Hr({func:h.NOTEQUAL,mask:255},i,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(i){const h=this.context.gl;return new Hr({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(i){const h=this.context.gl,p=i.sort((E,I)=>I.overscaledZ-E.overscaledZ),g=p[p.length-1].overscaledZ,b=p[0].overscaledZ-g+1;if(b>1){this.currentStencilSource=void 0,this.nextStencilID+b>256&&this.clearStencil();const E={};for(let I=0;I({u_sky_color:ue.properties.get("sky-color"),u_horizon_color:ue.properties.get("horizon-color"),u_horizon:(ye.height/2+ye.getHorizon())*ne,u_sky_horizon_blend:ue.properties.get("sky-horizon-blend")*ye.height/2*ne}))(L,C.style.map.transform,C.pixelRatio),K=new sr(O.LEQUAL,sr.ReadWrite,[0,1]),te=Hr.disabled,se=C.colorModeForRenderPass(),re=C.useProgram("sky");if(!L.mesh){const ue=new c.aX;ue.emplaceBack(-1,-1),ue.emplaceBack(1,-1),ue.emplaceBack(1,1),ue.emplaceBack(-1,1);const ye=new c.aY;ye.emplaceBack(0,1,2),ye.emplaceBack(0,2,3),L.mesh=new sf($.createVertexBuffer(ue,Ca.members),$.createIndexBuffer(ye),c.a0.simpleSegment(0,0,ue.length,ye.length))}re.draw($,O.TRIANGLES,K,te,se,$r.disabled,H,void 0,"sky",L.mesh.vertexBuffer,L.mesh.indexBuffer,L.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=h.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=p.length-1;this.currentLayer>=0;this.currentLayer--){const C=this.style._layers[p[this.currentLayer]],L=g[C.source],$=b[C.source];this._renderTileClippingMasks(C,$),this.renderLayer(this,L,C,$)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerre.source&&!re.isHidden($)?[L.sourceCaches[re.source]]:[]),K=H.filter(re=>re.getSource().type==="vector"),te=H.filter(re=>re.getSource().type!=="vector"),se=re=>{(!O||O.getSource().maxzoomse(re)),O||te.forEach(re=>se(re)),O}(this.style,this.transform.zoom);C&&function(L,$,O){for(let H=0;H0),g&&(c.b0(h,p),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(b,E){const I=b.context,C=I.gl,L=Ar.unblended,$=new sr(C.LEQUAL,sr.ReadWrite,[0,1]),O=E.getTerrainMesh(),H=E.sourceCache.getRenderableTiles(),K=b.useProgram("terrainDepth");I.bindFramebuffer.set(E.getFramebuffer("depth").framebuffer),I.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),I.clear({color:c.aN.transparent,depth:1});for(const te of H){const se=E.getTerrainData(te.tileID),re={u_matrix:b.transform.calculatePosMatrix(te.tileID.toUnwrapped()),u_ele_delta:E.getMeshFrameDelta(b.transform.zoom)};K.draw(I,C.TRIANGLES,$,Hr.disabled,L,$r.backCCW,re,se,"terrain",O.vertexBuffer,O.indexBuffer,O.segments)}I.bindFramebuffer.set(null),I.viewport.set([0,0,b.width,b.height])}(this,this.style.map.terrain),function(b,E){const I=b.context,C=I.gl,L=Ar.unblended,$=new sr(C.LEQUAL,sr.ReadWrite,[0,1]),O=E.getTerrainMesh(),H=E.getCoordsTexture(),K=E.sourceCache.getRenderableTiles(),te=b.useProgram("terrainCoords");I.bindFramebuffer.set(E.getFramebuffer("coords").framebuffer),I.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),I.clear({color:c.aN.transparent,depth:1}),E.coordsIndex=[];for(const se of K){const re=E.getTerrainData(se.tileID);I.activeTexture.set(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,H.texture);const ue={u_matrix:b.transform.calculatePosMatrix(se.tileID.toUnwrapped()),u_terrain_coords_id:(255-E.coordsIndex.length)/255,u_texture:0,u_ele_delta:E.getMeshFrameDelta(b.transform.zoom)};te.draw(I,C.TRIANGLES,$,Hr.disabled,L,$r.backCCW,ue,re,"terrain",O.vertexBuffer,O.indexBuffer,O.segments),E.coordsIndex.push(se.tileID.key)}I.bindFramebuffer.set(null),I.viewport.set([0,0,b.width,b.height])}(this,this.style.map.terrain))}renderLayer(i,h,p,g){if(!p.isHidden(this.transform.zoom)&&(p.type==="background"||p.type==="custom"||(g||[]).length))switch(this.id=p.id,p.type){case"symbol":(function(b,E,I,C,L){if(b.renderPass!=="translucent")return;const $=Hr.disabled,O=b.colorModeForRenderPass();(I._unevaluatedLayout.hasValue("text-variable-anchor")||I._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(H,K,te,se,re,ue,ye,ne,xe){const Ie=K.transform,Ce=ml(),je=re==="map",Je=ue==="map";for(const gt of H){const yt=se.getTile(gt),Qe=yt.getBucket(te);if(!Qe||!Qe.text||!Qe.text.segments.get().length)continue;const it=c.ah(Qe.textSizeData,Ie.zoom),Et=Xt(yt,1,K.transform.zoom),Ut=$o(gt.posMatrix,Je,je,K.transform,Et),st=te.layout.get("icon-text-fit")!=="none"&&Qe.hasIconData();if(it){const ft=Math.pow(2,Ie.zoom-yt.tileID.overscaledZ),jt=K.style.map.terrain?(Qt,ar)=>K.style.map.terrain.getElevation(gt,Qt,ar):null,jr=Ce.translatePosition(Ie,yt,ye,ne);Cl(Qe,je,Je,xe,Ie,Ut,gt.posMatrix,ft,it,st,Ce,jr,gt.toUnwrapped(),jt)}}}(C,b,I,E,I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),L),I.paint.get("icon-opacity").constantOr(1)!==0&&Uo(b,E,I,C,!1,I.paint.get("icon-translate"),I.paint.get("icon-translate-anchor"),I.layout.get("icon-rotation-alignment"),I.layout.get("icon-pitch-alignment"),I.layout.get("icon-keep-upright"),$,O),I.paint.get("text-opacity").constantOr(1)!==0&&Uo(b,E,I,C,!0,I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.layout.get("text-keep-upright"),$,O),E.map.showCollisionBoxes&&(nf(b,E,I,C,!0),nf(b,E,I,C,!1))})(i,h,p,g,this.style.placement.variableOffsets);break;case"circle":(function(b,E,I,C){if(b.renderPass!=="translucent")return;const L=I.paint.get("circle-opacity"),$=I.paint.get("circle-stroke-width"),O=I.paint.get("circle-stroke-opacity"),H=!I.layout.get("circle-sort-key").isConstant();if(L.constantOr(1)===0&&($.constantOr(1)===0||O.constantOr(1)===0))return;const K=b.context,te=K.gl,se=b.depthModeForSublayer(0,sr.ReadOnly),re=Hr.disabled,ue=b.colorModeForRenderPass(),ye=[];for(let ne=0;nene.sortKey-xe.sortKey);for(const ne of ye){const{programConfiguration:xe,program:Ie,layoutVertexBuffer:Ce,indexBuffer:je,uniformValues:Je,terrainData:gt}=ne.state;Ie.draw(K,te.TRIANGLES,se,re,ue,$r.disabled,Je,gt,I.id,Ce,je,ne.segments,I.paint,b.transform.zoom,xe)}})(i,h,p,g);break;case"heatmap":(function(b,E,I,C){if(I.paint.get("heatmap-opacity")!==0)if(b.renderPass==="offscreen"){const L=b.context,$=L.gl,O=Hr.disabled,H=new Ar([$.ONE,$.ONE],c.aN.transparent,[!0,!0,!0,!0]);(function(K,te,se){const re=K.gl;K.activeTexture.set(re.TEXTURE1),K.viewport.set([0,0,te.width/4,te.height/4]);let ue=se.heatmapFbo;if(ue)re.bindTexture(re.TEXTURE_2D,ue.colorAttachment.get()),K.bindFramebuffer.set(ue.framebuffer);else{const ye=re.createTexture();re.bindTexture(re.TEXTURE_2D,ye),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_WRAP_S,re.CLAMP_TO_EDGE),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_WRAP_T,re.CLAMP_TO_EDGE),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_MIN_FILTER,re.LINEAR),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_MAG_FILTER,re.LINEAR),ue=se.heatmapFbo=K.createFramebuffer(te.width/4,te.height/4,!1,!1),function(ne,xe,Ie,Ce){var je,Je;const gt=ne.gl,yt=(je=ne.HALF_FLOAT)!==null&&je!==void 0?je:gt.UNSIGNED_BYTE,Qe=(Je=ne.RGBA16F)!==null&&Je!==void 0?Je:gt.RGBA;gt.texImage2D(gt.TEXTURE_2D,0,Qe,xe.width/4,xe.height/4,0,gt.RGBA,yt,null),Ce.colorAttachment.set(Ie)}(K,te,ye,ue)}})(L,b,I),L.clear({color:c.aN.transparent});for(let K=0;K{const ne=c.H();c.aQ(ne,0,se.width,se.height,0,0,1);const xe=se.context.gl;return{u_matrix:ne,u_world:[xe.drawingBufferWidth,xe.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:re.paint.get("heatmap-opacity")}})(L,$),null,$.id,L.viewportBuffer,L.quadTriangleIndexBuffer,L.viewportSegments,$.paint,L.transform.zoom)}(b,I))})(i,h,p,g);break;case"line":(function(b,E,I,C){if(b.renderPass!=="translucent")return;const L=I.paint.get("line-opacity"),$=I.paint.get("line-width");if(L.constantOr(1)===0||$.constantOr(1)===0)return;const O=b.depthModeForSublayer(0,sr.ReadOnly),H=b.colorModeForRenderPass(),K=I.paint.get("line-dasharray"),te=I.paint.get("line-pattern"),se=te.constantOr(1),re=I.paint.get("line-gradient"),ue=I.getCrossfadeParameters(),ye=se?"linePattern":K?"lineSDF":re?"lineGradient":"line",ne=b.context,xe=ne.gl;let Ie=!0;for(const Ce of C){const je=E.getTile(Ce);if(se&&!je.patternsLoaded())continue;const Je=je.getBucket(I);if(!Je)continue;const gt=Je.programConfigurations.get(I.id),yt=b.context.program.get(),Qe=b.useProgram(ye,gt),it=Ie||Qe.program!==yt,Et=b.style.map.terrain&&b.style.map.terrain.getTerrainData(Ce),Ut=te.constantOr(null);if(Ut&&je.imageAtlas){const jt=je.imageAtlas,jr=jt.patternPositions[Ut.to.toString()],Qt=jt.patternPositions[Ut.from.toString()];jr&&Qt&>.setConstantPatternPositions(jr,Qt)}const st=Et?Ce:null,ft=se?$h(b,je,I,ue,st):K?Nh(b,je,I,K,ue,st):re?wl(b,je,I,Je.lineClipsArray.length,st):Da(b,je,I,st);if(se)ne.activeTexture.set(xe.TEXTURE0),je.imageAtlasTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE),gt.updatePaintBuffers(ue);else if(K&&(it||b.lineAtlas.dirty))ne.activeTexture.set(xe.TEXTURE0),b.lineAtlas.bind(ne);else if(re){const jt=Je.gradients[I.id];let jr=jt.texture;if(I.gradientVersion!==jt.version){let Qt=256;if(I.stepInterpolant){const ar=E.getSource().maxzoom,Vr=Ce.canonical.z===ar?Math.ceil(1<0?h.pop():null}isPatternMissing(i){if(!i)return!1;if(!i.from||!i.to)return!0;const h=this.imageManager.getPattern(i.from.toString()),p=this.imageManager.getPattern(i.to.toString());return!h||!p}useProgram(i,h){this.cache=this.cache||{};const p=i+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[p]||(this.cache[p]=new _l(this.context,jo[i],h,kl[i],this._showOverdrawInspector,this.style.map.terrain)),this.cache[p]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new ve(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:i,drawingBufferHeight:h}=this.context.gl;return this.width!==i||this.height!==h}}class ms{constructor(i,h){this.points=i,this.planes=h}static fromInvProjectionMatrix(i,h,p){const g=Math.pow(2,p),b=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(I=>{const C=1/(I=c.ag([],I,i))[3]/h*g;return c.b1(I,I,[C,C,1/I[3],C])}),E=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const C=function(H,K){var te=K[0],se=K[1],re=K[2],ue=te*te+se*se+re*re;return ue>0&&(ue=1/Math.sqrt(ue)),H[0]=K[0]*ue,H[1]=K[1]*ue,H[2]=K[2]*ue,H}([],function(H,K,te){var se=K[0],re=K[1],ue=K[2],ye=te[0],ne=te[1],xe=te[2];return H[0]=re*xe-ue*ne,H[1]=ue*ye-se*xe,H[2]=se*ne-re*ye,H}([],Ee([],b[I[0]],b[I[1]]),Ee([],b[I[2]],b[I[1]]))),L=-(($=C)[0]*(O=b[I[1]])[0]+$[1]*O[1]+$[2]*O[2]);var $,O;return C.concat(L)});return new ms(b,E)}}class Fl{constructor(i,h){this.min=i,this.max=h,this.center=function(p,g,b){return p[0]=.5*g[0],p[1]=.5*g[1],p[2]=.5*g[2],p}([],function(p,g,b){return p[0]=g[0]+b[0],p[1]=g[1]+b[1],p[2]=g[2]+b[2],p}([],this.min,this.max))}quadrant(i){const h=[i%2==0,i<2],p=X(this.min),g=X(this.max);for(let b=0;b=0&&E++;if(E===0)return 0;E!==h.length&&(p=!1)}if(p)return 2;for(let g=0;g<3;g++){let b=Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let I=0;Ithis.max[g]-this.min[g])return 0}return 1}}class Rl{constructor(i=0,h=0,p=0,g=0){if(isNaN(i)||i<0||isNaN(h)||h<0||isNaN(p)||p<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=h,this.left=p,this.right=g}interpolate(i,h,p){return h.top!=null&&i.top!=null&&(this.top=c.z.number(i.top,h.top,p)),h.bottom!=null&&i.bottom!=null&&(this.bottom=c.z.number(i.bottom,h.bottom,p)),h.left!=null&&i.left!=null&&(this.left=c.z.number(i.left,h.left,p)),h.right!=null&&i.right!=null&&(this.right=c.z.number(i.right,h.right,p)),this}getCenter(i,h){const p=c.ad((this.left+i-this.right)/2,0,i),g=c.ad((this.top+h-this.bottom)/2,0,h);return new c.P(p,g)}equals(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right}clone(){return new Rl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const nu=85.051129;class ou{constructor(i,h,p,g,b){this.tileSize=512,this._renderWorldCopies=b===void 0||!!b,this._minZoom=i||0,this._maxZoom=h||22,this._minPitch=p??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const i=new ou(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.apply(this),i}apply(i){this.tileSize=i.tileSize,this.latRange=i.latRange,this.width=i.width,this.height=i.height,this._center=i._center,this._elevation=i._elevation,this.minElevationForCurrentTile=i.minElevationForCurrentTile,this.zoom=i.zoom,this.angle=i.angle,this._fov=i._fov,this._pitch=i._pitch,this._unmodified=i._unmodified,this._edgeInsets=i._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))}get maxZoom(){return this._maxZoom}set maxZoom(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))}get minPitch(){return this._minPitch}set minPitch(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))}get maxPitch(){return this._maxPitch}set maxPitch(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(i){const h=-c.b3(i,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=function(){var p=new c.A(4);return c.A!=Float32Array&&(p[1]=0,p[2]=0),p[0]=1,p[3]=1,p}(),function(p,g,b){var E=g[0],I=g[1],C=g[2],L=g[3],$=Math.sin(b),O=Math.cos(b);p[0]=E*O+C*$,p[1]=I*O+L*$,p[2]=E*-$+C*O,p[3]=I*-$+L*O}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(i){const h=c.ad(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(i){const h=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(i){i!==this._elevation&&(this._elevation=i,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(i){return this._edgeInsets.equals(i)}interpolatePadding(i,h,p){this._unmodified=!1,this._edgeInsets.interpolate(i,h,p),this._constrain(),this._calcMatrices()}coveringZoomLevel(i){const h=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(i){const h=[new c.b4(0,i)];if(this._renderWorldCopies){const p=this.pointCoordinate(new c.P(0,0)),g=this.pointCoordinate(new c.P(this.width,0)),b=this.pointCoordinate(new c.P(this.width,this.height)),E=this.pointCoordinate(new c.P(0,this.height)),I=Math.floor(Math.min(p.x,g.x,b.x,E.x)),C=Math.floor(Math.max(p.x,g.x,b.x,E.x)),L=1;for(let $=I-L;$<=C+L;$++)$!==0&&h.push(new c.b4($,i))}return h}coveringTiles(i){var h,p;let g=this.coveringZoomLevel(i);const b=g;if(i.minzoom!==void 0&&gi.maxzoom&&(g=i.maxzoom);const E=this.pointCoordinate(this.getCameraPoint()),I=c.Z.fromLngLat(this.center),C=Math.pow(2,g),L=[C*E.x,C*E.y,0],$=[C*I.x,C*I.y,0],O=ms.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,g);let H=i.minzoom||0;!i.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(H=g);const K=i.terrain?2/Math.min(this.tileSize,i.tileSize)*this.tileSize:3,te=ne=>({aabb:new Fl([ne*C,0,0],[(ne+1)*C,C,0]),zoom:0,x:0,y:0,wrap:ne,fullyVisible:!1}),se=[],re=[],ue=g,ye=i.reparseOverscaled?b:g;if(this._renderWorldCopies)for(let ne=1;ne<=3;ne++)se.push(te(-ne)),se.push(te(ne));for(se.push(te(0));se.length>0;){const ne=se.pop(),xe=ne.x,Ie=ne.y;let Ce=ne.fullyVisible;if(!Ce){const Qe=ne.aabb.intersects(O);if(Qe===0)continue;Ce=Qe===2}const je=i.terrain?L:$,Je=ne.aabb.distanceX(je),gt=ne.aabb.distanceY(je),yt=Math.max(Math.abs(Je),Math.abs(gt));if(ne.zoom===ue||yt>K+(1<=H){const Qe=ue-ne.zoom,it=L[0]-.5-(xe<>1),Ut=ne.zoom+1;let st=ne.aabb.quadrant(Qe);if(i.terrain){const ft=new c.S(Ut,ne.wrap,Ut,it,Et),jt=i.terrain.getMinMaxElevation(ft),jr=(h=jt.minElevation)!==null&&h!==void 0?h:this.elevation,Qt=(p=jt.maxElevation)!==null&&p!==void 0?p:this.elevation;st=new Fl([st.min[0],st.min[1],jr],[st.max[0],st.max[1],Qt])}se.push({aabb:st,zoom:Ut,x:it,y:Et,wrap:ne.wrap,fullyVisible:Ce})}}return re.sort((ne,xe)=>ne.distanceSq-xe.distanceSq).map(ne=>ne.tileID)}resize(i,h){this.width=i,this.height=h,this.pixelsToGLUnits=[2/i,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(i){return Math.pow(2,i)}scaleZoom(i){return Math.log(i)/Math.LN2}project(i){const h=c.ad(i.lat,-85.051129,nu);return new c.P(c.O(i.lng)*this.worldSize,c.Q(h)*this.worldSize)}unproject(i){return new c.Z(i.x/this.worldSize,i.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(i){const h=this.elevation,p=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,g=this.pointLocation(this.centerPoint,i),b=i.getElevationForLngLatZoom(g,this.tileZoom);if(!(this.elevation-b))return;const E=p+h-b,I=Math.cos(this._pitch)*this.cameraToCenterDistance/E/c.b5(1,g.lat),C=this.scaleZoom(I/this.tileSize);this._elevation=b,this._center=g,this.zoom=C}setLocationAtPoint(i,h){const p=this.pointCoordinate(h),g=this.pointCoordinate(this.centerPoint),b=this.locationCoordinate(i),E=new c.Z(b.x-(p.x-g.x),b.y-(p.y-g.y));this.center=this.coordinateLocation(E),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(i,h){return h?this.coordinatePoint(this.locationCoordinate(i),h.getElevationForLngLatZoom(i,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(i))}pointLocation(i,h){return this.coordinateLocation(this.pointCoordinate(i,h))}locationCoordinate(i){return c.Z.fromLngLat(i)}coordinateLocation(i){return i&&i.toLngLat()}pointCoordinate(i,h){if(h){const H=h.pointCoordinate(i);if(H!=null)return H}const p=[i.x,i.y,0,1],g=[i.x,i.y,1,1];c.ag(p,p,this.pixelMatrixInverse),c.ag(g,g,this.pixelMatrixInverse);const b=p[3],E=g[3],I=p[1]/b,C=g[1]/E,L=p[2]/b,$=g[2]/E,O=L===$?0:(0-L)/($-L);return new c.Z(c.z.number(p[0]/b,g[0]/E,O)/this.worldSize,c.z.number(I,C,O)/this.worldSize)}coordinatePoint(i,h=0,p=this.pixelMatrix){const g=[i.x*this.worldSize,i.y*this.worldSize,h,1];return c.ag(g,g,p),new c.P(g[0]/g[3],g[1]/g[3])}getBounds(){const i=Math.max(0,this.height/2-this.getHorizon());return new Te().extend(this.pointLocation(new c.P(0,i))).extend(this.pointLocation(new c.P(this.width,i))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Te([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,nu])}calculateTileMatrix(i){const h=i.canonical,p=this.worldSize/this.zoomScale(h.z),g=h.x+Math.pow(2,h.z)*i.wrap,b=c.ao(new Float64Array(16));return c.J(b,b,[g*p,h.y*p,0]),c.K(b,b,[p/c.X,p/c.X,1]),b}calculatePosMatrix(i,h=!1){const p=i.key,g=h?this._alignedPosMatrixCache:this._posMatrixCache;if(g[p])return g[p];const b=this.calculateTileMatrix(i);return c.L(b,h?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,b),g[p]=new Float32Array(b),g[p]}calculateFogMatrix(i){const h=i.key,p=this._fogMatrixCache;if(p[h])return p[h];const g=this.calculateTileMatrix(i);return c.L(g,this.fogMatrix,g),p[h]=new Float32Array(g),p[h]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(i,h){h=c.ad(+h,this.minZoom,this.maxZoom);const p={center:new c.N(i.lng,i.lat),zoom:h};let g=this.lngRange;if(!this._renderWorldCopies&&g===null){const ne=179.9999999999;g=[-ne,ne]}const b=this.tileSize*this.zoomScale(p.zoom);let E=0,I=b,C=0,L=b,$=0,O=0;const{x:H,y:K}=this.size;if(this.latRange){const ne=this.latRange;E=c.Q(ne[1])*b,I=c.Q(ne[0])*b,I-EI&&(ue=I-ne)}if(g){const ne=(C+L)/2;let xe=te;this._renderWorldCopies&&(xe=c.b3(te,ne-b/2,ne+b/2));const Ie=H/2;xe-IeL&&(re=L-Ie)}if(re!==void 0||ue!==void 0){const ne=new c.P(re??te,ue??se);p.center=this.unproject.call({worldSize:b},ne).wrap()}return p}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const i=this._unmodified,{center:h,zoom:p}=this.getConstrained(this.center,this.zoom);this.center=h,this.zoom=p,this._unmodified=i,this._constraining=!1}_calcMatrices(){if(!this.height)return;const i=this.centerOffset,h=this.point.x,p=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b5(1,this.center.lat)*this.worldSize;let g=c.ao(new Float64Array(16));c.K(g,g,[this.width/2,-this.height/2,1]),c.J(g,g,[1,-1,0]),this.labelPlaneMatrix=g,g=c.ao(new Float64Array(16)),c.K(g,g,[1,-1,1]),c.J(g,g,[-1,-1,0]),c.K(g,g,[2/this.width,2/this.height,1]),this.glCoordMatrix=g;const b=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),E=Math.min(this.elevation,this.minElevationForCurrentTile),I=b-E*this._pixelPerMeter/Math.cos(this._pitch),C=E<0?I:b,L=Math.PI/2+this._pitch,$=this._fov*(.5+i.y/this.height),O=Math.sin($)*C/Math.sin(c.ad(Math.PI-L-$,.01,Math.PI-.01)),H=this.getHorizon(),K=2*Math.atan(H/this.cameraToCenterDistance)*(.5+i.y/(2*H)),te=Math.sin(K)*C/Math.sin(c.ad(Math.PI-L-K,.01,Math.PI-.01)),se=Math.min(O,te),re=1.01*(Math.cos(Math.PI/2-this._pitch)*se+C),ue=this.height/50;g=new Float64Array(16),c.b6(g,this._fov,this.width/this.height,ue,re),g[8]=2*-i.x/this.width,g[9]=2*i.y/this.height,c.K(g,g,[1,-1,1]),c.J(g,g,[0,0,-this.cameraToCenterDistance]),c.b7(g,g,this._pitch),c.ae(g,g,this.angle),c.J(g,g,[-h,-p,0]),this.mercatorMatrix=c.K([],g,[this.worldSize,this.worldSize,this.worldSize]),c.K(g,g,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.L(new Float64Array(16),this.labelPlaneMatrix,g),c.J(g,g,[0,0,-this.elevation]),this.modelViewProjectionMatrix=g,this.invModelViewProjectionMatrix=c.at([],g),this.fogMatrix=new Float64Array(16),c.b6(this.fogMatrix,this._fov,this.width/this.height,b,re),this.fogMatrix[8]=2*-i.x/this.width,this.fogMatrix[9]=2*i.y/this.height,c.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),c.b7(this.fogMatrix,this.fogMatrix,this._pitch),c.ae(this.fogMatrix,this.fogMatrix,this.angle),c.J(this.fogMatrix,this.fogMatrix,[-h,-p,0]),c.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=c.L(new Float64Array(16),this.labelPlaneMatrix,g);const ye=this.width%2/2,ne=this.height%2/2,xe=Math.cos(this.angle),Ie=Math.sin(this.angle),Ce=h-Math.round(h)+xe*ye+Ie*ne,je=p-Math.round(p)+xe*ne+Ie*ye,Je=new Float64Array(g);if(c.J(Je,Je,[Ce>.5?Ce-1:Ce,je>.5?je-1:je,0]),this.alignedModelViewProjectionMatrix=Je,g=c.at(new Float64Array(16),this.pixelMatrix),!g)throw new Error("failed to invert matrix");this.pixelMatrixInverse=g,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const i=this.pointCoordinate(new c.P(0,0)),h=[i.x*this.worldSize,i.y*this.worldSize,0,1];return c.ag(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,i))}getCameraQueryGeometry(i){const h=this.getCameraPoint();if(i.length===1)return[i[0],h];{let p=h.x,g=h.y,b=h.x,E=h.y;for(const I of i)p=Math.min(p,I.x),g=Math.min(g,I.y),b=Math.max(b,I.x),E=Math.max(E,I.y);return[new c.P(p,g),new c.P(b,g),new c.P(b,E),new c.P(p,E),new c.P(p,g)]}}lngLatToCameraDepth(i,h){const p=this.locationCoordinate(i),g=[p.x*this.worldSize,p.y*this.worldSize,h,1];return c.ag(g,g,this.modelViewProjectionMatrix),g[2]/g[3]}}function Bl(v,i){let h,p=!1,g=null,b=null;const E=()=>{g=null,p&&(v.apply(b,h),g=setTimeout(E,i),p=!1)};return(...I)=>(p=!0,b=this,h=I,g||E(),g)}class ja{constructor(i){this._getCurrentHash=()=>{const h=window.location.hash.replace("#","");if(this._hashName){let p;return h.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(p=g)}),(p&&p[1]||"").split("/")}return h.split("/")},this._onHashChange=()=>{const h=this._getCurrentHash();if(h.length>=3&&!h.some(p=>isNaN(p))){const p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:p,pitch:+(h[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const h=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,h)}catch{}},this._updateHash=Bl(this._updateHashUnthrottled,300),this._hashName=i&&encodeURIComponent(i)}addTo(i){return this._map=i,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(i){const h=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,g=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),b=Math.pow(10,g),E=Math.round(h.lng*b)/b,I=Math.round(h.lat*b)/b,C=this._map.getBearing(),L=this._map.getPitch();let $="";if($+=i?`/${E}/${I}/${p}`:`${p}/${I}/${E}`,(C||L)&&($+="/"+Math.round(10*C)/10),L&&($+=`/${Math.round(L)}`),this._hashName){const O=this._hashName;let H=!1;const K=window.location.hash.slice(1).split("&").map(te=>{const se=te.split("=")[0];return se===O?(H=!0,`${se}=${$}`):te}).filter(te=>te);return H||K.push(`${O}=${$}`),`#${K.join("&")}`}return`#${$}`}}const gs={linearity:.3,easing:c.b8(0,0,.3,1)},su=c.e({deceleration:2500,maxSpeed:1400},gs),au=c.e({deceleration:20,maxSpeed:1400},gs),lf=c.e({deceleration:1e3,maxSpeed:360},gs),Ol=c.e({deceleration:1e3,maxSpeed:90},gs);class $l{constructor(i){this._map=i,this.clear()}clear(){this._inertiaBuffer=[]}record(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:k.now(),settings:i})}_drainInertiaBuffer(){const i=this._inertiaBuffer,h=k.now();for(;i.length>0&&h-i[0].time>160;)i.shift()}_onMoveEnd(i){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:b}of this._inertiaBuffer)h.zoom+=b.zoomDelta||0,h.bearing+=b.bearingDelta||0,h.pitch+=b.pitchDelta||0,b.panDelta&&h.pan._add(b.panDelta),b.around&&(h.around=b.around),b.pinchAround&&(h.pinchAround=b.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(h.pan.mag()){const b=Nl(h.pan.mag(),p,c.e({},su,i||{}));g.offset=h.pan.mult(b.amount/h.pan.mag()),g.center=this._map.transform.center,Us(g,b)}if(h.zoom){const b=Nl(h.zoom,p,au);g.zoom=this._map.transform.zoom+b.amount,Us(g,b)}if(h.bearing){const b=Nl(h.bearing,p,lf);g.bearing=this._map.transform.bearing+c.ad(b.amount,-179,179),Us(g,b)}if(h.pitch){const b=Nl(h.pitch,p,Ol);g.pitch=this._map.transform.pitch+b.amount,Us(g,b)}if(g.zoom||g.bearing){const b=h.pinchAround===void 0?h.around:h.pinchAround;g.around=b?this._map.unproject(b):this._map.getCenter()}return this.clear(),c.e(g,{noMoveStart:!0})}}function Us(v,i){(!v.duration||v.durationh.unproject(C)),I=b.reduce((C,L,$,O)=>C.add(L.div(O.length)),new c.P(0,0));super(i,{points:b,point:I,lngLats:E,lngLat:h.unproject(I),originalEvent:p}),this._defaultPrevented=!1}}class lu extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,h,p){super(i,{originalEvent:p}),this._defaultPrevented=!1}}class jl{constructor(i,h){this._map=i,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(i){return this._firePreventable(new lu(i.type,this._map,i))}mousedown(i,h){return this._mousedownPos=h,this._firePreventable(new Qi(i.type,this._map,i))}mouseup(i){this._map.fire(new Qi(i.type,this._map,i))}click(i,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Qi(i.type,this._map,i))}dblclick(i){return this._firePreventable(new Qi(i.type,this._map,i))}mouseover(i){this._map.fire(new Qi(i.type,this._map,i))}mouseout(i){this._map.fire(new Qi(i.type,this._map,i))}touchstart(i){return this._firePreventable(new Va(i.type,this._map,i))}touchmove(i){this._map.fire(new Va(i.type,this._map,i))}touchend(i){this._map.fire(new Va(i.type,this._map,i))}touchcancel(i){this._map.fire(new Va(i.type,this._map,i))}_firePreventable(i){if(this._map.fire(i),i.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cu{constructor(i){this._map=i}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(i){this._map.fire(new Qi(i.type,this._map,i))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Qi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(i){this._delayContextMenu?this._contextMenuEvent=i:this._ignoreContextMenu||this._map.fire(new Qi(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class qs{constructor(i){this._map=i}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(i){return this.transform.pointLocation(c.P.convert(i),this._map.terrain)}}class uu{constructor(i,h){this._map=i,this._tr=new qs(i),this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(i,h){this.isEnabled()&&i.shiftKey&&i.button===0&&(T.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(i,h){if(!this._active)return;const p=h;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)b.fitScreenCoordinates(p,g,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",i)}keydown(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(T.remove(this._box),this._box=null),T.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(i,h){return this._map.fire(new c.k(i,{originalEvent:h}))}}function Gs(v,i){if(v.length!==i.length)throw new Error(`The number of touches and points are not equal - touches ${v.length}, points ${i.length}`);const h={};for(let p=0;pthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),p.length===this.numTouches&&(this.centroid=function(g){const b=new c.P(0,0);for(const E of g)b._add(E);return b.div(g.length)}(h),this.touches=Gs(p,h)))}touchmove(i,h,p){if(this.aborted||!this.centroid)return;const g=Gs(p,h);for(const b in this.touches){const E=g[b];(!E||E.dist(this.touches[b])>30)&&(this.aborted=!0)}}touchend(i,h,p){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class fu{constructor(i){this.singleTap=new hu(i),this.numTaps=i.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(i,h,p){this.singleTap.touchstart(i,h,p)}touchmove(i,h,p){this.singleTap.touchmove(i,h,p)}touchend(i,h,p){const g=this.singleTap.touchend(i,h,p);if(g){const b=i.timeStamp-this.lastTime<500,E=!this.lastTap||this.lastTap.dist(g)<30;if(b&&E||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class cf{constructor(i){this._tr=new qs(i),this._zoomIn=new fu({numTouches:1,numTaps:2}),this._zoomOut=new fu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(i,h,p){this._zoomIn.touchstart(i,h,p),this._zoomOut.touchstart(i,h,p)}touchmove(i,h,p){this._zoomIn.touchmove(i,h,p),this._zoomOut.touchmove(i,h,p)}touchend(i,h,p){const g=this._zoomIn.touchend(i,h,p),b=this._zoomOut.touchend(i,h,p),E=this._tr;return g?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom+1,around:E.unproject(g)},{originalEvent:i})}):b?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom-1,around:E.unproject(b)},{originalEvent:i})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Nr{constructor(i){this._enabled=!!i.enable,this._moveStateManager=i.moveStateManager,this._clickTolerance=i.clickTolerance||1,this._moveFunction=i.move,this._activateOnStart=!!i.activateOnStart,i.assignEvents(this),this.reset()}reset(i){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(i)}_move(...i){const h=this._moveFunction(...i);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(i,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(i)&&(this._moveStateManager.startMove(i),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(i,h){if(!this.isEnabled())return;const p=this._lastPoint;if(!p)return;if(i.preventDefault(),!this._moveStateManager.isValidMoveEvent(i))return void this.reset(i);const g=h.length?h[0]:h;return!this._moved&&g.dist(p){v.mousedown=v.dragStart,v.mousemoveWindow=v.dragMove,v.mouseup=v.dragEnd,v.contextmenu=i=>{i.preventDefault()}},du=({enable:v,clickTolerance:i,bearingDegreesPerPixelMoved:h=.8})=>{const p=new hn({checkCorrectEvent:g=>T.mouseButton(g)===0&&g.ctrlKey||T.mouseButton(g)===2});return new Nr({clickTolerance:i,move:(g,b)=>({bearingDelta:(b.x-g.x)*h}),moveStateManager:p,enable:v,assignEvents:Ua})},_s=({enable:v,clickTolerance:i,pitchDegreesPerPixelMoved:h=-.5})=>{const p=new hn({checkCorrectEvent:g=>T.mouseButton(g)===0&&g.ctrlKey||T.mouseButton(g)===2});return new Nr({clickTolerance:i,move:(g,b)=>({pitchDelta:(b.y-g.y)*h}),moveStateManager:p,enable:v,assignEvents:Ua})};class qa{constructor(i,h){this._clickTolerance=i.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(i,h,p){return this._calculateTransform(i,h,p)}touchmove(i,h,p){if(this._active&&!(p.length0&&(this._active=!0);const g=Gs(p,h),b=new c.P(0,0),E=new c.P(0,0);let I=0;for(const L in g){const $=g[L],O=this._touches[L];O&&(b._add($),E._add($.sub(O)),I++,g[L]=$)}if(this._touches=g,IMath.abs(v.x)}class _u extends Ga{constructor(i){super(),this._currentTouchCount=0,this._map=i}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(i,h,p){super.touchstart(i,h,p),this._currentTouchCount=p.length}_start(i){this._lastPoints=i,Po(i[0].sub(i[1]))&&(this._valid=!1)}_move(i,h,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const g=i[0].sub(this._lastPoints[0]),b=i[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(g,b,p.timeStamp),this._valid?(this._lastPoints=i,this._active=!0,{pitchDelta:(g.y+b.y)/2*-.5}):void 0}gestureBeginsVertically(i,h,p){if(this._valid!==void 0)return this._valid;const g=i.mag()>=2,b=h.mag()>=2;if(!g&&!b)return;if(!g||!b)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;const E=i.y>0==h.y>0;return Po(i)&&Po(h)&&E}}const uf={panStep:100,bearingStep:15,pitchStep:10};class vu{constructor(i){this._tr=new qs(i);const h=uf;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(i){if(i.altKey||i.ctrlKey||i.metaKey)return;let h=0,p=0,g=0,b=0,E=0;switch(i.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:i.shiftKey?p=-1:(i.preventDefault(),b=-1);break;case 39:i.shiftKey?p=1:(i.preventDefault(),b=1);break;case 38:i.shiftKey?g=1:(i.preventDefault(),E=-1);break;case 40:i.shiftKey?g=-1:(i.preventDefault(),E=1);break;default:return}return this._rotationDisabled&&(p=0,g=0),{cameraAnimation:I=>{const C=this._tr;I.easeTo({duration:300,easeId:"keyboardHandler",easing:hf,zoom:h?Math.round(C.zoom)+h*(i.shiftKey?2:1):C.zoom,bearing:C.bearing+p*this._bearingStep,pitch:C.pitch+g*this._pitchStep,offset:[-b*this._panStep,-E*this._panStep],center:C.center},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function hf(v){return v*(2-v)}const bu=4.000244140625;class xu{constructor(i,h){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=i,this._tr=new qs(i),this._triggerRenderFrame=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(i){this._defaultZoomRate=i}setWheelZoomRate(i){this._wheelZoomRate=i}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!i&&i.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(i){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!i[this._map.cooperativeGestures._bypassKey])return;let h=i.deltaMode===WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY;const p=k.now(),g=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,h!==0&&h%bu==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(g*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),i.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=i,this._delta-=h,this._active||this._start(i)),i.preventDefault()}_start(i){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const h=T.mousePos(this._map.getCanvas(),i),p=this._tr;this._around=h.y>p.transform.height/2-p.transform.getHorizon()?c.N.convert(this._aroundCenter?p.center:p.unproject(h)):c.N.convert(p.center),this._aroundPoint=p.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const i=this._tr.transform;if(this._delta!==0){const I=this._type==="wheel"&&Math.abs(this._delta)>bu?this._wheelZoomRate:this._defaultZoomRate;let C=2/(1+Math.exp(-Math.abs(this._delta*I)));this._delta<0&&C!==0&&(C=1/C);const L=typeof this._targetZoom=="number"?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(L*C))),this._type==="wheel"&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:i.zoom,p=this._startZoom,g=this._easing;let b,E=!1;if(this._type==="wheel"&&p&&g){const I=Math.min((k.now()-this._lastWheelEventTime)/200,1),C=g(I);b=c.z.number(p,h,C),I<1?this._frameId||(this._frameId=!0):E=!0}else b=h,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:b-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(i){let h=c.b9;if(this._prevEase){const p=this._prevEase,g=(k.now()-p.start)/p.duration,b=p.easing(g+.01)-p.easing(g),E=.27/Math.sqrt(b*b+1e-4)*.01,I=Math.sqrt(.0729-E*E);h=c.b8(E,I,.25,1)}return this._prevEase={start:k.now(),duration:i,easing:h},h}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class wu{constructor(i,h){this._clickZoom=i,this._tapZoom=h}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Ha{constructor(i){this._tr=new qs(i),this.reset()}reset(){this._active=!1}dblclick(i,h){return i.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:this._tr.zoom+(i.shiftKey?-1:1),around:this._tr.unproject(h)},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ff{constructor(){this._tap=new fu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(i,h,p){if(!this._swipePoint)if(this._tapTime){const g=h[0],b=i.timeStamp-this._tapTime<500,E=this._tapPoint.dist(g)<30;b&&E?p.length>0&&(this._swipePoint=g,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(i,h,p)}touchmove(i,h,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const g=h[0],b=g.y-this._swipePoint.y;return this._swipePoint=g,i.preventDefault(),this._active=!0,{zoomDelta:b/128}}}else this._tap.touchmove(i,h,p)}touchend(i,h,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{const g=this._tap.touchend(i,h,p);g&&(this._tapTime=i.timeStamp,this._tapPoint=g)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fn{constructor(i,h,p){this._el=i,this._mousePan=h,this._touchPan=p}enable(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class $n{constructor(i,h,p){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=h,this._mousePitch=p}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Su{constructor(i,h,p,g){this._el=i,this._touchZoom=h,this._touchRotate=p,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Nn{constructor(i,h){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=i,this._options=h,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const i=this._map.getCanvasContainer();i.classList.add("maplibregl-cooperative-gestures"),this._container=T.create("div","maplibregl-cooperative-gesture-screen",i);let h=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(h=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),g=document.createElement("div");g.className="maplibregl-desktop-message",g.textContent=h,this._container.appendChild(g);const b=document.createElement("div");b.className="maplibregl-mobile-message",b.textContent=p,this._container.appendChild(b),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(T.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(i){this._onCooperativeGesture(i.touches.length===1)}wheel(i){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!i[this._bypassKey])}_onCooperativeGesture(i){this._enabled&&i&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Mo=v=>v.zoom||v.drag||v.pitch||v.rotate;class Cp extends c.k{}function ku(v){return v.panDelta&&v.panDelta.mag()||v.zoomDelta||v.bearingDelta||v.pitchDelta}class Ap{constructor(i,h){this.handleWindowEvent=g=>{this.handleEvent(g,`${g.type}Window`)},this.handleEvent=(g,b)=>{if(g.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const E=g.type==="renderFrame"?void 0:g,I={needsRenderFrame:!1},C={},L={},$=g.touches,O=$?this._getMapTouches($):void 0,H=O?T.touchPos(this._map.getCanvas(),O):T.mousePos(this._map.getCanvas(),g);for(const{handlerName:se,handler:re,allowed:ue}of this._handlers){if(!re.isEnabled())continue;let ye;this._blockedByActive(L,ue,se)?re.reset():re[b||g.type]&&(ye=re[b||g.type](g,H,O),this.mergeHandlerResult(I,C,ye,se,E),ye&&ye.needsRenderFrame&&this._triggerRenderFrame()),(ye||re.isActive())&&(L[se]=re)}const K={};for(const se in this._previousActiveHandlers)L[se]||(K[se]=E);this._previousActiveHandlers=L,(Object.keys(K).length||ku(I))&&(this._changes.push([I,C,K]),this._triggerRenderFrame()),(Object.keys(L).length||ku(I))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:te}=I;te&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],te(this._map))},this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new $l(i),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[g,b,E]of this._listeners)T.addEventListener(g,b,g===document?this.handleWindowEvent:this.handleEvent,E)}destroy(){for(const[i,h,p]of this._listeners)T.removeEventListener(i,h,i===document?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(i){const h=this._map,p=h.getCanvasContainer();this._add("mapEvent",new jl(h,i));const g=h.boxZoom=new uu(h,i);this._add("boxZoom",g),i.interactive&&i.boxZoom&&g.enable();const b=h.cooperativeGestures=new Nn(h,i.cooperativeGestures);this._add("cooperativeGestures",b),i.cooperativeGestures&&b.enable();const E=new cf(h),I=new Ha(h);h.doubleClickZoom=new wu(I,E),this._add("tapZoom",E),this._add("clickZoom",I),i.interactive&&i.doubleClickZoom&&h.doubleClickZoom.enable();const C=new ff;this._add("tapDragZoom",C);const L=h.touchPitch=new _u(h);this._add("touchPitch",L),i.interactive&&i.touchPitch&&h.touchPitch.enable(i.touchPitch);const $=du(i),O=_s(i);h.dragRotate=new $n(i,$,O),this._add("mouseRotate",$,["mousePitch"]),this._add("mousePitch",O,["mouseRotate"]),i.interactive&&i.dragRotate&&h.dragRotate.enable();const H=(({enable:ye,clickTolerance:ne})=>{const xe=new hn({checkCorrectEvent:Ie=>T.mouseButton(Ie)===0&&!Ie.ctrlKey});return new Nr({clickTolerance:ne,move:(Ie,Ce)=>({around:Ce,panDelta:Ce.sub(Ie)}),activateOnStart:!0,moveStateManager:xe,enable:ye,assignEvents:Ua})})(i),K=new qa(i,h);h.dragPan=new Fn(p,H,K),this._add("mousePan",H),this._add("touchPan",K,["touchZoom","touchRotate"]),i.interactive&&i.dragPan&&h.dragPan.enable(i.dragPan);const te=new yu,se=new mu;h.touchZoomRotate=new Su(p,se,te,C),this._add("touchRotate",te,["touchPan","touchZoom"]),this._add("touchZoom",se,["touchPan","touchRotate"]),i.interactive&&i.touchZoomRotate&&h.touchZoomRotate.enable(i.touchZoomRotate);const re=h.scrollZoom=new xu(h,()=>this._triggerRenderFrame());this._add("scrollZoom",re,["mousePan"]),i.interactive&&i.scrollZoom&&h.scrollZoom.enable(i.scrollZoom);const ue=h.keyboard=new vu(h);this._add("keyboard",ue),i.interactive&&i.keyboard&&h.keyboard.enable(),this._add("blockableMapEvent",new cu(h))}_add(i,h,p){this._handlers.push({handlerName:i,handler:h,allowed:p}),this._handlersById[i]=h}stop(i){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}}isActive(){for(const{handler:i}of this._handlers)if(i.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Mo(this._eventsInProgress)||this.isZooming()}_blockedByActive(i,h,p){for(const g in i)if(g!==p&&(!h||h.indexOf(g)<0))return!0;return!1}_getMapTouches(i){const h=[];for(const p of i)this._el.contains(p.target)&&h.push(p);return h}mergeHandlerResult(i,h,p,g,b){if(!p)return;c.e(i,p);const E={handlerName:g,originalEvent:p.originalEvent||b};p.zoomDelta!==void 0&&(h.zoom=E),p.panDelta!==void 0&&(h.drag=E),p.pitchDelta!==void 0&&(h.pitch=E),p.bearingDelta!==void 0&&(h.rotate=E)}_applyChanges(){const i={},h={},p={};for(const[g,b,E]of this._changes)g.panDelta&&(i.panDelta=(i.panDelta||new c.P(0,0))._add(g.panDelta)),g.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(i.around=g.around),g.pinchAround!==void 0&&(i.pinchAround=g.pinchAround),g.noInertia&&(i.noInertia=g.noInertia),c.e(h,b),c.e(p,E);this._updateMapTransform(i,h,p),this._changes=[]}_updateMapTransform(i,h,p){const g=this._map,b=g._getTransformForUpdate(),E=g.terrain;if(!(ku(i)||E&&this._terrainMovement))return this._fireEvents(h,p,!0);let{panDelta:I,zoomDelta:C,bearingDelta:L,pitchDelta:$,around:O,pinchAround:H}=i;H!==void 0&&(O=H),g._stop(!0),O=O||g.transform.centerPoint;const K=b.pointLocation(I?O.sub(I):O);L&&(b.bearing+=L),$&&(b.pitch+=$),C&&(b.zoom+=C),E?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?b.center=b.pointLocation(b.centerPoint.sub(I)):b.setLocationAtPoint(K,O):(this._terrainMovement=!0,this._map._elevationFreeze=!0,b.setLocationAtPoint(K,O)):b.setLocationAtPoint(K,O),g._applyUpdatedTransform(b),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(h,p,!0)}_fireEvents(i,h,p){const g=Mo(this._eventsInProgress),b=Mo(i),E={};for(const O in i){const{originalEvent:H}=i[O];this._eventsInProgress[O]||(E[`${O}start`]=H),this._eventsInProgress[O]=i[O]}!g&&b&&this._fireEvent("movestart",b.originalEvent);for(const O in E)this._fireEvent(O,E[O]);b&&this._fireEvent("move",b.originalEvent);for(const O in i){const{originalEvent:H}=i[O];this._fireEvent(O,H)}const I={};let C;for(const O in this._eventsInProgress){const{handlerName:H,originalEvent:K}=this._eventsInProgress[O];this._handlersById[H].isActive()||(delete this._eventsInProgress[O],C=h[H]||K,I[`${O}end`]=C)}for(const O in I)this._fireEvent(O,I[O]);const L=Mo(this._eventsInProgress),$=(g||b)&&!L;if($&&this._terrainMovement&&(this._map._elevationFreeze=!1,this._terrainMovement=!1,this._map.transform.recalculateZoom(this._map.terrain)),p&&$){this._updatingCamera=!0;const O=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),H=K=>K!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Cp("renderFrame",{timeStamp:i})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class zp extends c.E{constructor(i,h){super(),this._renderFrameCallback=()=>{const p=Math.min((k.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=h.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.N(this.transform.center.lng,this.transform.center.lat)}setCenter(i,h){return this.jumpTo({center:i},h)}panBy(i,h,p){return i=c.P.convert(i).mult(-1),this.panTo(this.transform.center,c.e({offset:i},h),p)}panTo(i,h,p){return this.easeTo(c.e({center:i},h),p)}getZoom(){return this.transform.zoom}setZoom(i,h){return this.jumpTo({zoom:i},h),this}zoomTo(i,h,p){return this.easeTo(c.e({zoom:i},h),p)}zoomIn(i,h){return this.zoomTo(this.getZoom()+1,i,h),this}zoomOut(i,h){return this.zoomTo(this.getZoom()-1,i,h),this}getBearing(){return this.transform.bearing}setBearing(i,h){return this.jumpTo({bearing:i},h),this}getPadding(){return this.transform.padding}setPadding(i,h){return this.jumpTo({padding:i},h),this}rotateTo(i,h,p){return this.easeTo(c.e({bearing:i},h),p)}resetNorth(i,h){return this.rotateTo(0,c.e({duration:1e3},i),h),this}resetNorthPitch(i,h){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},i),h),this}snapToNorth(i,h){return Math.abs(this.getBearing()){if(this._zooming&&(g.zoom=c.z.number(b,re,je)),this._rotating&&(g.bearing=c.z.number(E,L,je)),this._pitching&&(g.pitch=c.z.number(I,$,je)),this._padding&&(g.interpolatePadding(C,O,je),K=g.centerPoint.add(H)),this.terrain&&!i.freezeElevation&&this._updateElevation(je),xe)g.setLocationAtPoint(xe,Ie);else{const Je=g.zoomScale(g.zoom-b),gt=re>b?Math.min(2,ne):Math.max(.5,ne),yt=Math.pow(gt,1-je),Qe=g.unproject(ue.add(ye.mult(je*yt)).mult(Je));g.setLocationAtPoint(g.renderWorldCopies?Qe.wrap():Qe,K)}this._applyUpdatedTransform(g),this._fireMoveEvents(h)},je=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(h,je)},i),this}_prepareEase(i,h,p={}){this._moving=!0,h||p.moving||this.fire(new c.k("movestart",i)),this._zooming&&!p.zooming&&this.fire(new c.k("zoomstart",i)),this._rotating&&!p.rotating&&this.fire(new c.k("rotatestart",i)),this._pitching&&!p.pitching&&this.fire(new c.k("pitchstart",i))}_prepareElevation(i){this._elevationCenter=i,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(i){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const h=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(i<1&&h!==this._elevationTarget){const p=this._elevationTarget-this._elevationStart;this._elevationStart+=i*(p-(h-(p*i+this._elevationStart))/(1-i)),this._elevationTarget=h}this.transform.elevation=c.z.number(this._elevationStart,this._elevationTarget,i)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(i){if(!this.transformCameraUpdate)return;const h=i.clone(),{center:p,zoom:g,pitch:b,bearing:E,elevation:I}=this.transformCameraUpdate(h);p&&(h.center=p),g!==void 0&&(h.zoom=g),b!==void 0&&(h.pitch=b),E!==void 0&&(h.bearing=E),I!==void 0&&(h.elevation=I),this.transform.apply(h)}_fireMoveEvents(i){this.fire(new c.k("move",i)),this._zooming&&this.fire(new c.k("zoom",i)),this._rotating&&this.fire(new c.k("rotate",i)),this._pitching&&this.fire(new c.k("pitch",i))}_afterEase(i,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const p=this._zooming,g=this._rotating,b=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new c.k("zoomend",i)),g&&this.fire(new c.k("rotateend",i)),b&&this.fire(new c.k("pitchend",i)),this.fire(new c.k("moveend",i))}flyTo(i,h){var p;if(!i.essential&&k.prefersReducedMotion){const ft=c.M(i,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ft,h)}this.stop(),i=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.b9},i);const g=this._getTransformForUpdate(),b=this.getZoom(),E=this.getBearing(),I=this.getPitch(),C=this.getPadding(),L="bearing"in i?this._normalizeBearing(i.bearing,E):E,$="pitch"in i?+i.pitch:I,O="padding"in i?i.padding:g.padding,H=c.P.convert(i.offset);let K=g.centerPoint.add(H);const te=g.pointLocation(K),{center:se,zoom:re}=g.getConstrained(c.N.convert(i.center||te),(p=i.zoom)!==null&&p!==void 0?p:b);this._normalizeCenter(se);const ue=g.zoomScale(re-b),ye=g.project(te),ne=g.project(se).sub(ye);let xe=i.curve;const Ie=Math.max(g.width,g.height),Ce=Ie/ue,je=ne.mag();if("minZoom"in i){const ft=c.ad(Math.min(i.minZoom,b,re),g.minZoom,g.maxZoom),jt=Ie/g.zoomScale(ft-b);xe=Math.sqrt(jt/je*2)}const Je=xe*xe;function gt(ft){const jt=(Ce*Ce-Ie*Ie+(ft?-1:1)*Je*Je*je*je)/(2*(ft?Ce:Ie)*Je*je);return Math.log(Math.sqrt(jt*jt+1)-jt)}function yt(ft){return(Math.exp(ft)-Math.exp(-ft))/2}function Qe(ft){return(Math.exp(ft)+Math.exp(-ft))/2}const it=gt(!1);let Et=function(ft){return Qe(it)/Qe(it+xe*ft)},Ut=function(ft){return Ie*((Qe(it)*(yt(jt=it+xe*ft)/Qe(jt))-yt(it))/Je)/je;var jt},st=(gt(!0)-it)/xe;if(Math.abs(je)<1e-6||!isFinite(st)){if(Math.abs(Ie-Ce)<1e-6)return this.easeTo(i,h);const ft=Ce0,Et=jt=>Math.exp(ft*xe*jt)}return i.duration="duration"in i?+i.duration:1e3*st/("screenSpeed"in i?+i.screenSpeed/xe:+i.speed),i.maxDuration&&i.duration>i.maxDuration&&(i.duration=0),this._zooming=!0,this._rotating=E!==L,this._pitching=$!==I,this._padding=!g.isPaddingEqual(O),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(se),this._ease(ft=>{const jt=ft*st,jr=1/Et(jt);g.zoom=ft===1?re:b+g.scaleZoom(jr),this._rotating&&(g.bearing=c.z.number(E,L,ft)),this._pitching&&(g.pitch=c.z.number(I,$,ft)),this._padding&&(g.interpolatePadding(C,O,ft),K=g.centerPoint.add(H)),this.terrain&&!i.freezeElevation&&this._updateElevation(ft);const Qt=ft===1?se:g.unproject(ye.add(ne.mult(Ut(jt))).mult(jr));g.setLocationAtPoint(g.renderWorldCopies?Qt.wrap():Qt,K),this._applyUpdatedTransform(g),this._fireMoveEvents(h)},()=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(h)},i),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(i,h){var p;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const g=this._onEaseEnd;delete this._onEaseEnd,g.call(this,h)}return i||(p=this.handlers)===null||p===void 0||p.stop(!1),this}_ease(i,h,p){p.animate===!1||p.duration===0?(i(1),h()):(this._easeStart=k.now(),this._easeOptions=p,this._onEaseFrame=i,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(i,h){i=c.b3(i,-180,180);const p=Math.abs(i-h);return Math.abs(i-360-h)180?-360:p<-180?360:0}queryTerrainElevation(i){return this.terrain?this.terrain.getElevationForLngLatZoom(c.N.convert(i),this.transform.tileZoom)-this.transform.elevation:null}}const Eu={compact:!0,customAttribution:'MapLibre'};class Zs{constructor(i=Eu){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=h=>{!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"&&h.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=i}getDefaultPosition(){return"bottom-right"}onAdd(i){return this._map=i,this._compact=this.options.compact,this._container=T.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=T.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=T.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){T.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(i,h){const p=this._map._getUIString(`AttributionControl.${h}`);i.title=p,i.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){const g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}const h=this._map.style.sourceCaches;for(const g in h){const b=h[g];if(b.used||b.usedForTerrain){const E=b.getSource();E.attribution&&i.indexOf(E.attribution)<0&&i.push(E.attribution)}}i=i.filter(g=>String(g).trim()),i.sort((g,b)=>g.length-b.length),i=i.filter((g,b)=>{for(let E=b+1;E=0)return!1;return!0});const p=i.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,i.length?(this._innerContainer.innerHTML=p,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class lo{constructor(i={}){this._updateCompact=()=>{const h=this._container.children;if(h.length){const p=h[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=i}getDefaultPosition(){return"bottom-left"}onAdd(i){this._map=i,this._compact=this.options&&this.options.compact,this._container=T.create("div","maplibregl-ctrl");const h=T.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){T.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class St{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(i){const h=++this._id;return this._queue.push({callback:i,id:h,cancelled:!1}),h}remove(i){const h=this._currentlyRunning,p=h?this._queue.concat(h):this._queue;for(const g of p)if(g.id===i)return void(g.cancelled=!0)}run(i=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const p of h)if(!p.cancelled&&(p.callback(i),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var df=c.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Pu extends c.E{constructor(i){super(),this.sourceCache=i,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,i.usedForTerrain=!0,i.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(i,h){this.sourceCache.update(i,h),this._renderableTilesKeys=[];const p={};for(const g of i.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))p[g.key]=!0,this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),c.aQ(g.posMatrix,0,c.X,0,c.X,0,1),this._tiles[g.key]=new Oo(g,this.tileSize));for(const g in this._tiles)p[g]||delete this._tiles[g]}freeRtt(i){for(const h in this._tiles){const p=this._tiles[h];(!i||p.tileID.equals(i)||p.tileID.isChildOf(i)||i.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(i=>this.getTileByID(i))}getTileByID(i){return this._tiles[i]}getTerrainCoords(i){const h={};for(const p of this._renderableTilesKeys){const g=this._tiles[p].tileID;if(g.canonical.equals(i.canonical)){const b=i.clone();b.posMatrix=new Float64Array(16),c.aQ(b.posMatrix,0,c.X,0,c.X,0,1),h[p]=b}else if(g.canonical.isChildOf(i.canonical)){const b=i.clone();b.posMatrix=new Float64Array(16);const E=g.canonical.z-i.canonical.z,I=g.canonical.x-(g.canonical.x>>E<>E<>E;c.aQ(b.posMatrix,0,L,0,L,0,1),c.J(b.posMatrix,b.posMatrix,[-I*L,-C*L,0]),h[p]=b}else if(i.canonical.isChildOf(g.canonical)){const b=i.clone();b.posMatrix=new Float64Array(16);const E=i.canonical.z-g.canonical.z,I=i.canonical.x-(i.canonical.x>>E<>E<>E;c.aQ(b.posMatrix,0,c.X,0,c.X,0,1),c.J(b.posMatrix,b.posMatrix,[I*L,C*L,0]),c.K(b.posMatrix,b.posMatrix,[1/2**E,1/2**E,0]),h[p]=b}}return h}getSourceTile(i,h){const p=this.sourceCache._source;let g=i.overscaledZ-this.deltaZoom;if(g>p.maxzoom&&(g=p.maxzoom),g=p.minzoom&&(!b||!b.dem);)b=this.sourceCache.getTileByID(i.scaledTo(g--).key);return b}tilesAfterTime(i=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=i)}}class pf{constructor(i,h,p){this.painter=i,this.sourceCache=new Pu(h),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(i,h,p,g=c.X){var b;if(!(h>=0&&h=0&&pi.canonical.z&&(i.canonical.z>=g?b=i.canonical.z-g:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const E=i.canonical.x-(i.canonical.x>>b<>b<>8<<4|b>>8,h[E+3]=0;const p=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),g=new ve(i,p,i.gl.RGBA,{premultiply:!1});return g.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._coordsTexture=g,g}pointCoordinate(i){this.painter.maybeDrawDepthAndCoords(!0);const h=new Uint8Array(4),p=this.painter.context,g=p.gl,b=Math.round(i.x*this.painter.pixelRatio/devicePixelRatio),E=Math.round(i.y*this.painter.pixelRatio/devicePixelRatio),I=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(b,I-E-1,1,1,g.RGBA,g.UNSIGNED_BYTE,h),p.bindFramebuffer.set(null);const C=h[0]+(h[2]>>4<<8),L=h[1]+((15&h[2])<<8),$=this.coordsIndex[255-h[3]],O=$&&this.sourceCache.getTileByID($);if(!O)return null;const H=this._coordsTextureSize,K=(1<i.id!==h),this._recentlyUsed.push(i.id)}stampObject(i){i.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const i=this._createObject(this._objects.length);return this._objects.push(i),i}freeObject(i){i.inUse=!1}freeAllObjects(){for(const i of this._objects)this.freeObject(i)}isFull(){return!(this._objects.length!i.inUse)===!1}}const co={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class mf{constructor(i,h){this.painter=i,this.terrain=h,this.pool=new Wa(i.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(i){return this.pool.getObjectForId(i.rtt[this._stacks.length-1].id).texture}prepareForRender(i,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=i._order.filter(p=>!i._layers[p].isHidden(h)),this._coordsDescendingInv={};for(const p in i.sourceCaches){this._coordsDescendingInv[p]={};const g=i.sourceCaches[p].getVisibleCoordinates();for(const b of g){const E=this.terrain.sourceCache.getTerrainCoords(b);for(const I in E)this._coordsDescendingInv[p][I]||(this._coordsDescendingInv[p][I]=[]),this._coordsDescendingInv[p][I].push(E[I])}}this._coordsDescendingInvStr={};for(const p of i._order){const g=i._layers[p],b=g.source;if(co[g.type]&&!this._coordsDescendingInvStr[b]){this._coordsDescendingInvStr[b]={};for(const E in this._coordsDescendingInv[b])this._coordsDescendingInvStr[b][E]=this._coordsDescendingInv[b][E].map(I=>I.key).sort().join()}}for(const p of this._renderableTiles)for(const g in this._coordsDescendingInvStr){const b=this._coordsDescendingInvStr[g][p.tileID.key];b&&b!==p.rttCoords[g]&&(p.rtt=[])}}renderLayer(i){if(i.isHidden(this.painter.transform.zoom))return!1;const h=i.type,p=this.painter,g=this._renderableLayerIds[this._renderableLayerIds.length-1]===i.id;if(co[h]&&(this._prevType&&co[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(i.id),!g))return!0;if(co[this._prevType]||co[h]&&g){this._prevType=h;const b=this._stacks.length-1,E=this._stacks[b]||[];for(const I of this._renderableTiles){if(this.pool.isFull()&&(Na(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(I),I.rtt[b]){const L=this.pool.getObjectForId(I.rtt[b].id);if(L.stamp===I.rtt[b].stamp){this.pool.useObject(L);continue}}const C=this.pool.getOrCreateFreeObject();this.pool.useObject(C),this.pool.stampObject(C),I.rtt[b]={id:C.id,stamp:C.stamp},p.context.bindFramebuffer.set(C.fbo.framebuffer),p.context.clear({color:c.aN.transparent,stencil:0}),p.currentStencilSource=void 0;for(let L=0;L{v.touchstart=v.dragStart,v.touchmoveWindow=v.dragMove,v.touchend=v.dragEnd},Iu={showCompass:!0,showZoom:!0,visualizePitch:!1};class yf{constructor(i,h,p=!1){this.mousedown=E=>{this.startMouse(c.e({},E,{ctrlKey:!0,preventDefault:()=>E.preventDefault()}),T.mousePos(this.element,E)),T.addEventListener(window,"mousemove",this.mousemove),T.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=E=>{this.moveMouse(E,T.mousePos(this.element,E))},this.mouseup=E=>{this.mouseRotate.dragEnd(E),this.mousePitch&&this.mousePitch.dragEnd(E),this.offTemp()},this.touchstart=E=>{E.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=T.touchPos(this.element,E.targetTouches)[0],this.startTouch(E,this._startPos),T.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),T.addEventListener(window,"touchend",this.touchend))},this.touchmove=E=>{E.targetTouches.length!==1?this.reset():(this._lastPos=T.touchPos(this.element,E.targetTouches)[0],this.moveTouch(E,this._lastPos))},this.touchend=E=>{E.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const g=i.dragRotate._mouseRotate.getClickTolerance(),b=i.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=du({clickTolerance:g,enable:!0}),this.touchRotate=(({enable:E,clickTolerance:I,bearingDegreesPerPixelMoved:C=.8})=>{const L=new Vl;return new Nr({clickTolerance:I,move:($,O)=>({bearingDelta:(O.x-$.x)*C}),moveStateManager:L,enable:E,assignEvents:gf})})({clickTolerance:g,enable:!0}),this.map=i,p&&(this.mousePitch=_s({clickTolerance:b,enable:!0}),this.touchPitch=(({enable:E,clickTolerance:I,pitchDegreesPerPixelMoved:C=-.5})=>{const L=new Vl;return new Nr({clickTolerance:I,move:($,O)=>({pitchDelta:(O.y-$.y)*C}),moveStateManager:L,enable:E,assignEvents:gf})})({clickTolerance:b,enable:!0})),T.addEventListener(h,"mousedown",this.mousedown),T.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),T.addEventListener(h,"touchcancel",this.reset)}startMouse(i,h){this.mouseRotate.dragStart(i,h),this.mousePitch&&this.mousePitch.dragStart(i,h),T.disableDrag()}startTouch(i,h){this.touchRotate.dragStart(i,h),this.touchPitch&&this.touchPitch.dragStart(i,h),T.disableDrag()}moveMouse(i,h){const p=this.map,{bearingDelta:g}=this.mouseRotate.dragMove(i,h)||{};if(g&&p.setBearing(p.getBearing()+g),this.mousePitch){const{pitchDelta:b}=this.mousePitch.dragMove(i,h)||{};b&&p.setPitch(p.getPitch()+b)}}moveTouch(i,h){const p=this.map,{bearingDelta:g}=this.touchRotate.dragMove(i,h)||{};if(g&&p.setBearing(p.getBearing()+g),this.touchPitch){const{pitchDelta:b}=this.touchPitch.dragMove(i,h)||{};b&&p.setPitch(p.getPitch()+b)}}off(){const i=this.element;T.removeEventListener(i,"mousedown",this.mousedown),T.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),T.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),T.removeEventListener(window,"touchend",this.touchend),T.removeEventListener(i,"touchcancel",this.reset),this.offTemp()}offTemp(){T.enableDrag(),T.removeEventListener(window,"mousemove",this.mousemove),T.removeEventListener(window,"mouseup",this.mouseup),T.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),T.removeEventListener(window,"touchend",this.touchend)}}let qo;function _f(v,i,h){const p=new c.N(v.lng,v.lat);if(v=new c.N(v.lng,v.lat),i){const g=new c.N(v.lng-360,v.lat),b=new c.N(v.lng+360,v.lat),E=h.locationPoint(v).distSqr(i);h.locationPoint(g).distSqr(i)180;){const g=h.locationPoint(v);if(g.x>=0&&g.y>=0&&g.x<=h.width&&g.y<=h.height)break;v.lng>h.center.lng?v.lng-=360:v.lng+=360}return v.lng!==p.lng&&h.locationPoint(v).y>h.height/2-h.getHorizon()?v:p}const Tu={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Go(v,i,h){const p=v.classList;for(const g in Tu)p.remove(`maplibregl-${h}-anchor-${g}`);p.add(`maplibregl-${h}-anchor-${i}`)}class zr extends c.E{constructor(i){if(super(),this._onKeyPress=h=>{const p=h.code,g=h.charCode||h.keyCode;p!=="Space"&&p!=="Enter"&&g!==32&&g!==13||this.togglePopup()},this._onMapClick=h=>{const p=h.originalEvent.target,g=this._element;this._popup&&(p===g||g.contains(p))&&this.togglePopup()},this._update=h=>{var p;if(!this._map)return;const g=this._map.loaded()&&!this._map.isMoving();((h==null?void 0:h.type)==="terrain"||(h==null?void 0:h.type)==="render"&&!g)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?_f(this._lngLat,this._flatPos,this._map.transform):(p=this._lngLat)===null||p===void 0?void 0:p.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let b="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?b=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(b=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let E="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?E="rotateX(0deg)":this._pitchAlignment==="map"&&(E=`rotateX(${this._map.getPitch()}deg)`),h&&h.type!=="moveend"||(this._pos=this._pos.round()),T.setTransform(this._element,`${Tu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${E} ${b}`),k.frameAsync(new AbortController).then(()=>{this._updateOpacity(h&&h.type==="moveend")}).catch(()=>{})},this._onMove=h=>{if(!this._isDragging){const p=this._clickTolerance||this._map._clickTolerance;this._isDragging=h.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=h.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=h=>{this._element.contains(h.originalEvent.target)&&(h.preventDefault(),this._positionDelta=h.point.sub(this._pos).add(this._offset),this._pointerdownPos=h.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&i.pitchAlignment!=="auto"?i.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(i==null?void 0:i.opacity,i==null?void 0:i.opacityWhenCovered),i&&i.element)this._element=i.element,this._offset=c.P.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=T.create("div");const h=T.createNS("http://www.w3.org/2000/svg","svg"),p=41,g=27;h.setAttributeNS(null,"display","block"),h.setAttributeNS(null,"height",`${p}px`),h.setAttributeNS(null,"width",`${g}px`),h.setAttributeNS(null,"viewBox",`0 0 ${g} ${p}`);const b=T.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"stroke","none"),b.setAttributeNS(null,"stroke-width","1"),b.setAttributeNS(null,"fill","none"),b.setAttributeNS(null,"fill-rule","evenodd");const E=T.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");const I=T.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(3.0, 29.0)"),I.setAttributeNS(null,"fill","#000000");const C=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ue of C){const ye=T.createNS("http://www.w3.org/2000/svg","ellipse");ye.setAttributeNS(null,"opacity","0.04"),ye.setAttributeNS(null,"cx","10.5"),ye.setAttributeNS(null,"cy","5.80029008"),ye.setAttributeNS(null,"rx",ue.rx),ye.setAttributeNS(null,"ry",ue.ry),I.appendChild(ye)}const L=T.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"fill",this._color);const $=T.createNS("http://www.w3.org/2000/svg","path");$.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),L.appendChild($);const O=T.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"opacity","0.25"),O.setAttributeNS(null,"fill","#000000");const H=T.createNS("http://www.w3.org/2000/svg","path");H.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),O.appendChild(H);const K=T.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(6.0, 7.0)"),K.setAttributeNS(null,"fill","#FFFFFF");const te=T.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"transform","translate(8.0, 8.0)");const se=T.createNS("http://www.w3.org/2000/svg","circle");se.setAttributeNS(null,"fill","#000000"),se.setAttributeNS(null,"opacity","0.25"),se.setAttributeNS(null,"cx","5.5"),se.setAttributeNS(null,"cy","5.5"),se.setAttributeNS(null,"r","5.4999962");const re=T.createNS("http://www.w3.org/2000/svg","circle");re.setAttributeNS(null,"fill","#FFFFFF"),re.setAttributeNS(null,"cx","5.5"),re.setAttributeNS(null,"cy","5.5"),re.setAttributeNS(null,"r","5.4999962"),te.appendChild(se),te.appendChild(re),E.appendChild(I),E.appendChild(L),E.appendChild(O),E.appendChild(K),E.appendChild(te),h.appendChild(E),h.setAttributeNS(null,"height",p*this._scale+"px"),h.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(h),this._offset=c.P.convert(i&&i.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",h=>{h.preventDefault()}),this._element.addEventListener("mousedown",h=>{h.preventDefault()}),Go(this._element,this._anchor,"marker"),i&&i.className)for(const h of i.className.split(" "))this._element.classList.add(h);this._popup=null}addTo(i){return this.remove(),this._map=i,this._element.setAttribute("aria-label",i._getUIString("Marker.Title")),i.getCanvasContainer().appendChild(this._element),i.on("move",this._update),i.on("moveend",this._update),i.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),T.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=c.N.convert(i),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(i){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),i){if(!("offset"in i.options)){const g=Math.abs(13.5)/Math.SQRT2;i.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=i,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const i=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:i?(i.isOpen()?i.remove():(i.setLngLat(this._lngLat),i.addTo(this._map)),this):this}_updateOpacity(i=!1){var h,p;if(!(!((h=this._map)===null||h===void 0)&&h.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(i)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const g=this._map,b=g.terrain.depthAtPoint(this._pos),E=g.terrain.getElevationForLngLatZoom(this._lngLat,g.transform.tileZoom);if(g.transform.lngLatToCameraDepth(this._lngLat,E)-b<.006)return void(this._element.style.opacity=this._opacity);const I=-this._offset.y/g.transform._pixelPerMeter,C=Math.sin(g.getPitch()*Math.PI/180)*I,L=g.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),$=g.transform.lngLatToCameraDepth(this._lngLat,E+C)-L>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&$&&this._popup.remove(),this._element.style.opacity=$?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(i){return this._offset=c.P.convert(i),this._update(),this}addClassName(i){this._element.classList.add(i)}removeClassName(i){this._element.classList.remove(i)}toggleClassName(i){return this._element.classList.toggle(i)}setDraggable(i){return this._draggable=!!i,this._map&&(i?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(i){return this._rotation=i||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(i){return this._rotationAlignment=i||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(i){return this._pitchAlignment=i&&i!=="auto"?i:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(i,h){return i===void 0&&h===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),i!==void 0&&(this._opacity=i),h!==void 0&&(this._opacityWhenCovered=h),this._map&&this._updateOpacity(!0),this}}const Ul={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Hs=0,Ws=!1;const vf={maxWidth:100,unit:"metric"};function Cu(v,i,h){const p=h&&h.maxWidth||100,g=v._container.clientHeight/2,b=v.unproject([0,g]),E=v.unproject([p,g]),I=b.distanceTo(E);if(h&&h.unit==="imperial"){const C=3.2808*I;C>5280?Xa(i,p,C/5280,v._getUIString("ScaleControl.Miles")):Xa(i,p,C,v._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?Xa(i,p,I/1852,v._getUIString("ScaleControl.NauticalMiles")):I>=1e3?Xa(i,p,I/1e3,v._getUIString("ScaleControl.Kilometers")):Xa(i,p,I,v._getUIString("ScaleControl.Meters"))}function Xa(v,i,h,p){const g=function(b){const E=Math.pow(10,`${Math.floor(b)}`.length-1);let I=b/E;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:function(C){const L=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*L)/L}(I),E*I}(h);v.style.width=i*(g/h)+"px",v.innerHTML=`${g} ${p}`}const uo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ql=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function It(v){if(v){if(typeof v=="number"){const i=Math.round(Math.abs(v)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,v),"top-left":new c.P(i,i),"top-right":new c.P(-i,i),bottom:new c.P(0,-v),"bottom-left":new c.P(i,-i),"bottom-right":new c.P(-i,-i),left:new c.P(v,0),right:new c.P(-v,0)}}if(v instanceof c.P||Array.isArray(v)){const i=c.P.convert(v);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:c.P.convert(v.center||[0,0]),top:c.P.convert(v.top||[0,0]),"top-left":c.P.convert(v["top-left"]||[0,0]),"top-right":c.P.convert(v["top-right"]||[0,0]),bottom:c.P.convert(v.bottom||[0,0]),"bottom-left":c.P.convert(v["bottom-left"]||[0,0]),"bottom-right":c.P.convert(v["bottom-right"]||[0,0]),left:c.P.convert(v.left||[0,0]),right:c.P.convert(v.right||[0,0])}}return It(new c.P(0,0))}const Ot=y;f.AJAXError=c.bg,f.Evented=c.E,f.LngLat=c.N,f.MercatorCoordinate=c.Z,f.Point=c.P,f.addProtocol=c.bh,f.config=c.a,f.removeProtocol=c.bi,f.AttributionControl=Zs,f.BoxZoomHandler=uu,f.CanvasSource=Ln,f.CooperativeGesturesHandler=Nn,f.DoubleClickZoomHandler=wu,f.DragPanHandler=Fn,f.DragRotateHandler=$n,f.EdgeInsets=Rl,f.FullscreenControl=class extends c.E{constructor(v={}){super(),this._onFullscreenChange=()=>{var i;let h=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((i=h==null?void 0:h.shadowRoot)===null||i===void 0)&&i.fullscreenElement;)h=h.shadowRoot.fullscreenElement;h===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,v&&v.container&&(v.container instanceof HTMLElement?this._container=v.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(v){return this._map=v,this._container||(this._container=this._map.getContainer()),this._controlContainer=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){T.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const v=this._fullscreenButton=T.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);T.create("span","maplibregl-ctrl-icon",v).setAttribute("aria-hidden","true"),v.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const v=this._getTitle();this._fullscreenButton.setAttribute("aria-label",v),this._fullscreenButton.title=v}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},f.GeoJSONSource=ka,f.GeolocateControl=class extends c.E{constructor(v){super(),this._onSuccess=i=>{if(this._map){if(this._isOutOfMapMaxBounds(i))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",i)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=i,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(i),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(i),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",i)),this._finish()}},this._updateCamera=i=>{const h=new c.N(i.coords.longitude,i.coords.latitude),p=i.coords.accuracy,g=this._map.getBearing(),b=c.e({bearing:g},this.options.fitBoundsOptions),E=Te.fromLngLat(h,p);this._map.fitBounds(E,b,{geolocateSource:!0})},this._updateMarker=i=>{if(i){const h=new c.N(i.coords.longitude,i.coords.latitude);this._accuracyCircleMarker.setLngLat(h).addTo(this._map),this._userLocationDotMarker.setLngLat(h).addTo(this._map),this._accuracy=i.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=i=>{if(this._map){if(this.options.trackUserLocation)if(i.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(i.code===3&&Ws)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",i)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=i=>{if(this._map){if(this._container.addEventListener("contextmenu",h=>h.preventDefault()),this._geolocateButton=T.create("button","maplibregl-ctrl-geolocate",this._container),T.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",i===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}else{const h=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=T.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new zr({element:this._dotElement}),this._circleElement=T.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new zr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",h=>{h.geolocateSource||this._watchState!=="ACTIVE_LOCK"||h.originalEvent&&h.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")),this.fire(new c.k("userlocationlostfocus")))})}},this.options=c.e({},Ul,v)}onAdd(v){return this._map=v,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return c._(this,arguments,void 0,function*(i=!1){if(qo!==void 0&&!i)return qo;if(window.navigator.permissions===void 0)return qo=!!window.navigator.geolocation,qo;try{qo=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{qo=!!window.navigator.geolocation}return qo})}().then(i=>this._setupUI(i)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),T.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Hs=0,Ws=!1}_isOutOfMapMaxBounds(v){const i=this._map.getMaxBounds(),h=v.coords;return i&&(h.longitudei.getEast()||h.latitudei.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const v=this._map.getBounds(),i=v.getSouthEast(),h=v.getNorthEast(),p=i.distanceTo(h),g=Math.ceil(this._accuracy/(p/this._map._container.clientHeight)*2);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}px`}trigger(){if(!this._setup)return c.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Hs--,Ws=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart")),this.fire(new c.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let v;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Hs++,Hs>1?(v={maximumAge:6e5,timeout:0},Ws=!0):(v=this.options.positionOptions,Ws=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,v)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},f.Hash=ja,f.ImageSource=wo,f.KeyboardHandler=vu,f.LngLatBounds=Te,f.LogoControl=lo,f.Map=class extends zp{constructor(v){c.be.mark(c.bf.create);const i=Object.assign(Object.assign({},Lp),v);if(i.minZoom!=null&&i.maxZoom!=null&&i.minZoom>i.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(i.minPitch!=null&&i.maxPitch!=null&&i.minPitch>i.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(i.minPitch!=null&&i.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(i.maxPitch!=null&&i.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ou(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new St,this._controls=[],this._mapId=c.a4(),this._contextLost=h=>{h.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.k("webglcontextlost",{originalEvent:h}))},this._contextRestored=h=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:h}))},this._onMapScroll=h=>{if(h.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=i.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=i.preserveDrawingBuffer===!0,this._antialias=i.antialias===!0,this._trackResize=i.trackResize===!0,this._bearingSnap=i.bearingSnap,this._refreshExpiredTiles=i.refreshExpiredTiles===!0,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=i.crossSourceCollisions===!0,this._collectResourceTiming=i.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},pt),i.locale),this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=i.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=V.addThrottleControl(()=>this.isMoving()),this._requestManager=new me(i.transformRequest),typeof i.container=="string"){if(this._container=document.getElementById(i.container),!this._container)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let h=!1;const p=Bl(g=>{this._trackResize&&!this._removed&&this.resize(g)._update()},50);this._resizeObserver=new ResizeObserver(g=>{h?p(g):h=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Ap(this,i),this._hash=i.hash&&new ja(typeof i.hash=="string"&&i.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,c.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new Zs(typeof i.attributionControl=="boolean"?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new lo,i.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update(h.dataType==="style"),this.fire(new c.k(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new c.k(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new c.k("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(v,i){if(i===void 0&&(i=v.getDefaultPosition?v.getDefaultPosition():"top-right"),!v||!v.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=v.onAdd(this);this._controls.push(v);const p=this._controlPositions[i];return i.indexOf("bottom")!==-1?p.insertBefore(h,p.firstChild):p.appendChild(h),this}removeControl(v){if(!v||!v.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(v);return i>-1&&this._controls.splice(i,1),v.onRemove(this),this}hasControl(v){return this._controls.indexOf(v)>-1}calculateCameraOptionsFromTo(v,i,h,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLatZoom(h,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(v,i,h,p)}resize(v){var i;const h=this._containerDimensions(),p=h[0],g=h[1],b=this._getClampedPixelRatio(p,g);if(this._resizeCanvas(p,g,b),this.painter.resize(p,g,b),this.painter.overLimit()){const I=this.painter.context.gl;this._maxCanvasSize=[I.drawingBufferWidth,I.drawingBufferHeight];const C=this._getClampedPixelRatio(p,g);this._resizeCanvas(p,g,C),this.painter.resize(p,g,C)}this.transform.resize(p,g),(i=this._requestedCameraState)===null||i===void 0||i.resize(p,g);const E=!this._moving;return E&&(this.stop(),this.fire(new c.k("movestart",v)).fire(new c.k("move",v))),this.fire(new c.k("resize",v)),E&&this.fire(new c.k("moveend",v)),this}_getClampedPixelRatio(v,i){const{0:h,1:p}=this._maxCanvasSize,g=this.getPixelRatio(),b=v*g,E=i*g;return Math.min(b>h?h/b:1,E>p?p/E:1)*g}getPixelRatio(){var v;return(v=this._overridePixelRatio)!==null&&v!==void 0?v:devicePixelRatio}setPixelRatio(v){this._overridePixelRatio=v,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(v){return this.transform.setMaxBounds(Te.convert(v)),this._update()}setMinZoom(v){if((v=v??-2)>=-2&&v<=this.transform.maxZoom)return this.transform.minZoom=v,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=v,this._update(),this.getZoom()>v&&this.setZoom(v),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(v){if((v=v??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(v>=0&&v<=this.transform.maxPitch)return this.transform.minPitch=v,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(v>=this.transform.minPitch)return this.transform.maxPitch=v,this._update(),this.getPitch()>v&&this.setPitch(v),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(v){return this.transform.renderWorldCopies=v,this._update()}project(v){return this.transform.locationPoint(c.N.convert(v),this.style&&this.terrain)}unproject(v){return this.transform.pointLocation(c.P.convert(v),this.terrain)}isMoving(){var v;return this._moving||((v=this.handlers)===null||v===void 0?void 0:v.isMoving())}isZooming(){var v;return this._zooming||((v=this.handlers)===null||v===void 0?void 0:v.isZooming())}isRotating(){var v;return this._rotating||((v=this.handlers)===null||v===void 0?void 0:v.isRotating())}_createDelegatedListener(v,i,h){if(v==="mouseenter"||v==="mouseover"){let p=!1;return{layer:i,listener:h,delegates:{mousemove:b=>{const E=this.getLayer(i)?this.queryRenderedFeatures(b.point,{layers:[i]}):[];E.length?p||(p=!0,h.call(this,new Qi(v,this,b.originalEvent,{features:E}))):p=!1},mouseout:()=>{p=!1}}}}if(v==="mouseleave"||v==="mouseout"){let p=!1;return{layer:i,listener:h,delegates:{mousemove:E=>{(this.getLayer(i)?this.queryRenderedFeatures(E.point,{layers:[i]}):[]).length?p=!0:p&&(p=!1,h.call(this,new Qi(v,this,E.originalEvent)))},mouseout:E=>{p&&(p=!1,h.call(this,new Qi(v,this,E.originalEvent)))}}}}{const p=g=>{const b=this.getLayer(i)?this.queryRenderedFeatures(g.point,{layers:[i]}):[];b.length&&(g.features=b,h.call(this,g),delete g.features)};return{layer:i,listener:h,delegates:{[v]:p}}}}on(v,i,h){if(h===void 0)return super.on(v,i);const p=this._createDelegatedListener(v,i,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[v]=this._delegatedListeners[v]||[],this._delegatedListeners[v].push(p);for(const g in p.delegates)this.on(g,p.delegates[g]);return this}once(v,i,h){if(h===void 0)return super.once(v,i);const p=this._createDelegatedListener(v,i,h);for(const g in p.delegates)this.once(g,p.delegates[g]);return this}off(v,i,h){return h===void 0?super.off(v,i):(this._delegatedListeners&&this._delegatedListeners[v]&&(p=>{const g=this._delegatedListeners[v];for(let b=0;bthis._updateStyle(v,i));const h=this.style&&i.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!v)),v?(this.style=new Nc(this,i||{}),this.style.setEventedParent(this,{style:this.style}),typeof v=="string"?this.style.loadURL(v,i,h):this.style.loadJSON(v,i,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Nc(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(v,i){if(typeof v=="string"){const h=this._requestManager.transformRequest(v,"Style");c.h(h,new AbortController).then(p=>{this._updateDiff(p.data,i)}).catch(p=>{p&&this.fire(new c.j(p))})}else typeof v=="object"&&this._updateDiff(v,i)}_updateDiff(v,i){try{this.style.setState(v,i)&&this._update(!0)}catch(h){c.w(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(v,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(v,i){return this._lazyInitEmptyStyle(),this.style.addSource(v,i),this._update(!0)}isSourceLoaded(v){const i=this.style&&this.style.sourceCaches[v];if(i!==void 0)return i.loaded();this.fire(new c.j(new Error(`There is no source with ID '${v}'`)))}setTerrain(v){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),v){const i=this.style.sourceCaches[v.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${v.source}`);this.terrain===null&&i.reload();for(const h in this.style._layers){const p=this.style._layers[h];p.type==="hillshade"&&p.source===v.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new pf(this.painter,i,v),this.painter.renderToTexture=new mf(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=h=>{h.dataType==="style"?this.terrain.sourceCache.freeRtt():h.dataType==="source"&&h.tile&&(h.sourceId!==v.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:v})),this}getTerrain(){var v,i;return(i=(v=this.terrain)===null||v===void 0?void 0:v.options)!==null&&i!==void 0?i:null}areTilesLoaded(){const v=this.style&&this.style.sourceCaches;for(const i in v){const h=v[i]._tiles;for(const p in h){const g=h[p];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}removeSource(v){return this.style.removeSource(v),this._update(!0)}getSource(v){return this.style.getSource(v)}addImage(v,i,h={}){const{pixelRatio:p=1,sdf:g=!1,stretchX:b,stretchY:E,content:I,textFitWidth:C,textFitHeight:L}=h;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||c.b(i))){if(i.width===void 0||i.height===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:$,height:O,data:H}=i,K=i;return this.style.addImage(v,{data:new c.R({width:$,height:O},new Uint8Array(H)),pixelRatio:p,stretchX:b,stretchY:E,content:I,textFitWidth:C,textFitHeight:L,sdf:g,version:0,userImage:K}),K.onAdd&&K.onAdd(this,v),this}}{const{width:$,height:O,data:H}=k.getImageData(i);this.style.addImage(v,{data:new c.R({width:$,height:O},H),pixelRatio:p,stretchX:b,stretchY:E,content:I,textFitWidth:C,textFitHeight:L,sdf:g,version:0})}}updateImage(v,i){const h=this.style.getImage(v);if(!h)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const p=i instanceof HTMLImageElement||c.b(i)?k.getImageData(i):i,{width:g,height:b,data:E}=p;if(g===void 0||b===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(g!==h.data.width||b!==h.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(i instanceof HTMLImageElement||c.b(i));return h.data.replace(E,I),this.style.updateImage(v,h),this}getImage(v){return this.style.getImage(v)}hasImage(v){return v?!!this.style.getImage(v):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(v){this.style.removeImage(v)}loadImage(v){return V.getImage(this._requestManager.transformRequest(v,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(v,i){return this._lazyInitEmptyStyle(),this.style.addLayer(v,i),this._update(!0)}moveLayer(v,i){return this.style.moveLayer(v,i),this._update(!0)}removeLayer(v){return this.style.removeLayer(v),this._update(!0)}getLayer(v){return this.style.getLayer(v)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(v,i,h){return this.style.setLayerZoomRange(v,i,h),this._update(!0)}setFilter(v,i,h={}){return this.style.setFilter(v,i,h),this._update(!0)}getFilter(v){return this.style.getFilter(v)}setPaintProperty(v,i,h,p={}){return this.style.setPaintProperty(v,i,h,p),this._update(!0)}getPaintProperty(v,i){return this.style.getPaintProperty(v,i)}setLayoutProperty(v,i,h,p={}){return this.style.setLayoutProperty(v,i,h,p),this._update(!0)}getLayoutProperty(v,i){return this.style.getLayoutProperty(v,i)}setGlyphs(v,i={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(v,i),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(v,i,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(v,i,h,p=>{p||this._update(!0)}),this}removeSprite(v){return this._lazyInitEmptyStyle(),this.style.removeSprite(v),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(v,i={}){return this._lazyInitEmptyStyle(),this.style.setSprite(v,i,h=>{h||this._update(!0)}),this}setLight(v,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(v,i),this._update(!0)}getLight(){return this.style.getLight()}setSky(v){return this._lazyInitEmptyStyle(),this.style.setSky(v),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(v,i){return this.style.setFeatureState(v,i),this._update()}removeFeatureState(v,i){return this.style.removeFeatureState(v,i),this._update()}getFeatureState(v){return this.style.getFeatureState(v)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let v=0,i=0;return this._container&&(v=this._container.clientWidth||400,i=this._container.clientHeight||300),[v,i]}_setupContainer(){const v=this._container;v.classList.add("maplibregl-map");const i=this._canvasContainer=T.create("div","maplibregl-canvas-container",v);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=T.create("canvas","maplibregl-canvas",i),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const h=this._containerDimensions(),p=this._getClampedPixelRatio(h[0],h[1]);this._resizeCanvas(h[0],h[1],p);const g=this._controlContainer=T.create("div","maplibregl-control-container",v),b=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(E=>{b[E]=T.create("div",`maplibregl-ctrl-${E} `,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(v,i,h){this._canvas.width=Math.floor(h*v),this._canvas.height=Math.floor(h*i),this._canvas.style.width=`${v}px`,this._canvas.style.height=`${i}px`}_setupPainter(){const v={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let i=null;this._canvas.addEventListener("webglcontextcreationerror",p=>{i={requestedAttributes:v},p&&(i.statusMessage=p.statusMessage,i.type=p.type)},{once:!0});const h=this._canvas.getContext("webgl2",v)||this._canvas.getContext("webgl",v);if(!h){const p="Failed to initialize WebGL";throw i?(i.message=p,new Error(JSON.stringify(i))):new Error(p)}this.painter=new af(h,this.transform),z.testSupport(h)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(v){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||v,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(v){return this._update(),this._renderTaskQueue.add(v)}_cancelRenderFrame(v){this._renderTaskQueue.remove(v)}_render(v){const i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(v),this._removed)return;let h=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const g=this.transform.zoom,b=k.now();this.style.zoomHistory.update(g,b);const E=new c.a9(g,{now:b,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),I=E.crossFadingFactor();I===1&&I===this._crossFadingFactor||(h=!0,this._crossFadingFactor=I),this.style.update(E)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.be.mark(c.bf.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0,c.be.mark(c.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var v;this._hash&&this._hash.remove();for(const h of this._controls)h.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),V.removeThrottleControl(this._imageQueueHandle),(v=this._resizeObserver)===null||v===void 0||v.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");i!=null&&i.loseContext&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),T.remove(this._canvasContainer),T.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),c.be.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,k.frameAsync(this._frameRequest).then(v=>{c.be.frame(v),this._frameRequest=null,this._render(v)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(v){this._showTileBoundaries!==v&&(this._showTileBoundaries=v,this._update())}get showPadding(){return!!this._showPadding}set showPadding(v){this._showPadding!==v&&(this._showPadding=v,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(v){this._showCollisionBoxes!==v&&(this._showCollisionBoxes=v,v?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(v){this._showOverdrawInspector!==v&&(this._showOverdrawInspector=v,this._update())}get repaint(){return!!this._repaint}set repaint(v){this._repaint!==v&&(this._repaint=v,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(v){this._vertices=v,this._update()}get version(){return Mu}getCameraTargetElevation(){return this.transform.elevation}},f.MapMouseEvent=Qi,f.MapTouchEvent=Va,f.MapWheelEvent=lu,f.Marker=zr,f.NavigationControl=class{constructor(v){this._updateZoomButtons=()=>{const i=this._map.getZoom(),h=i===this._map.getMaxZoom(),p=i===this._map.getMinZoom();this._zoomInButton.disabled=h,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",h.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},this._rotateCompassArrow=()=>{const i=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${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=i},this._setButtonTitle=(i,h)=>{const p=this._map._getUIString(`NavigationControl.${h}`);i.title=p,i.setAttribute("aria-label",p)},this.options=c.e({},Iu,v),this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",i=>i.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",i=>this._map.zoomIn({},{originalEvent:i})),T.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",i=>this._map.zoomOut({},{originalEvent:i})),T.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",i=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:i}):this._map.resetNorth({},{originalEvent:i})}),this._compassIcon=T.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(v){return this._map=v,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new yf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){T.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(v,i){const h=T.create("button",v,this._container);return h.type="button",h.addEventListener("click",i),h}},f.Popup=class extends c.E{constructor(v){super(),this.remove=()=>(this._content&&T.remove(this._content),this._container&&(T.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.k("close"))),this),this._onMouseUp=i=>{this._update(i.point)},this._onMouseMove=i=>{this._update(i.point)},this._onDrag=i=>{this._update(i.point)},this._update=i=>{var h;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=T.create("div","maplibregl-popup",this._map.getContainer()),this._tip=T.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const I of this.options.className.split(" "))this._container.classList.add(I);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?_f(this._lngLat,this._flatPos,this._map.transform):(h=this._lngLat)===null||h===void 0?void 0:h.wrap(),this._trackPointer&&!i)return;const p=this._flatPos=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&i?i:this._map.transform.locationPoint(this._lngLat));let g=this.options.anchor;const b=It(this.options.offset);if(!g){const I=this._container.offsetWidth,C=this._container.offsetHeight;let L;L=p.y+b.bottom.ythis._map.transform.height-C?["bottom"]:[],p.xthis._map.transform.width-I/2&&L.push("right"),g=L.length===0?"bottom":L.join("-")}let E=p.add(b[g]);this.options.subpixelPositioning||(E=E.round()),T.setTransform(this._container,`${Tu[g]} translate(${E.x}px,${E.y}px)`),Go(this._container,g,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(uo),v)}addTo(v){return this._map&&this.remove(),this._map=v,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(v){return this._lngLat=c.N.convert(v),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(v){return this.setDOMContent(document.createTextNode(v))}setHTML(v){const i=document.createDocumentFragment(),h=document.createElement("body");let p;for(h.innerHTML=v;p=h.firstChild,p;)i.appendChild(p);return this.setDOMContent(i)}getMaxWidth(){var v;return(v=this._container)===null||v===void 0?void 0:v.style.maxWidth}setMaxWidth(v){return this.options.maxWidth=v,this._update(),this}setDOMContent(v){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=T.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(v),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(v){return this._container&&this._container.classList.add(v),this}removeClassName(v){return this._container&&this._container.classList.remove(v),this}setOffset(v){return this.options.offset=v,this._update(),this}toggleClassName(v){if(this._container)return this._container.classList.toggle(v)}setSubpixelPositioning(v){this.options.subpixelPositioning=v}_createCloseButton(){this.options.closeButton&&(this._closeButton=T.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const v=this._container.querySelector(ql);v&&v.focus()}},f.RasterDEMTileSource=ti,f.RasterTileSource=ur,f.ScaleControl=class{constructor(v){this._onMove=()=>{Cu(this._map,this._container,this.options)},this.setUnit=i=>{this.options.unit=i,Cu(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},vf),v)}getDefaultPosition(){return"bottom-left"}onAdd(v){return this._map=v,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-scale",v.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){T.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},f.ScrollZoomHandler=xu,f.Style=Nc,f.TerrainControl=class{constructor(v){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(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"))},this.options=v}onAdd(v){return this._map=v,this._container=T.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=T.create("button","maplibregl-ctrl-terrain",this._container),T.create("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(){T.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},f.TwoFingersTouchPitchHandler=_u,f.TwoFingersTouchRotateHandler=yu,f.TwoFingersTouchZoomHandler=mu,f.TwoFingersTouchZoomRotateHandler=Su,f.VectorTileSource=cn,f.VideoSource=Bs,f.addSourceType=(v,i)=>c._(void 0,void 0,void 0,function*(){if(Pa(v))throw new Error(`A source type called "${v}" already exists.`);((h,p)=>{Ea[h]=p})(v,i)}),f.clearPrewarmedResources=function(){const v=rt;v&&(v.isPreloaded()&&v.numActive()===1?(v.release(Ve),rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},f.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},f.getRTLTextPluginStatus=function(){return no().getRTLTextPluginStatus()},f.getVersion=function(){return Ot},f.getWorkerCount=function(){return ct.workerCount},f.getWorkerUrl=function(){return c.a.WORKER_URL},f.importScriptInWorkers=function(v){return li().broadcast("IS",v)},f.prewarm=function(){ni().acquire(Ve)},f.setMaxParallelImageRequests=function(v){c.a.MAX_PARALLEL_IMAGE_REQUESTS=v},f.setRTLTextPlugin=function(v,i){return no().setRTLTextPlugin(v,i)},f.setWorkerCount=function(v){ct.workerCount=v},f.setWorkerUrl=function(v){c.a.WORKER_URL=v}});var u=t;return u})})(Jb);var Kk=Jb.exports;const mo=Yg(Kk);function N0(n){let e;return t=>{if(t)for(let o in t){let l=e==null?void 0:e[o],u=t[o];l!==u&&n(o,u,l)}else if(e)for(let o in e)n(o,void 0,e[o]);e=t}}function Yb(n,...e){let t=[n];for(let o of e)if(o)Array.isArray(o)&&o[0]===n?t.push(...o.slice(1)):t.push(o);else continue;if(t.length!==1)return t.length===2?t[1]:t}function Qb(n){return n===!0?["has","point_count"]:n===!1?["!",["has","point_count"]]:void 0}var wh=Yk;function Yk(n){var e,t,o;if(n){if(Array.isArray(n)){for(e=[],t=n.length,o=0;o{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function eE(n,e,t){let o,l,u,f,c,y,w,M,k,T,z,F,{$$slots:B={},$$scope:G}=e,{id:J=pa("layer")}=e,{source:j=void 0}=e,{sourceLayer:V=void 0}=e,{beforeId:me=void 0}=e,{beforeLayerType:X=void 0}=e,{type:pe}=e,{paint:Ee=void 0}=e,{layout:Pe=void 0}=e,{filter:$e=void 0}=e,{applyToClusters:Ye=void 0}=e,{minzoom:ve=void 0}=e,{maxzoom:We=void 0}=e,{manageHoverState:at=!1}=e,{hovered:mt=null}=e,{interactive:Ht=!0}=e,{hoverCursor:qt=void 0}=e,{eventsIfTopMost:Ue=!1}=e;const Xe=zc(),{map:Zt,source:Gt,self:or,minzoom:Jt,maxzoom:wr,eventTopMost:Ve,layerInfo:ct}=Wk();bt(n,Zt,Se=>t(31,k=Se)),bt(n,Gt,Se=>t(32,T=Se)),bt(n,or,Se=>t(0,M=Se)),bt(n,Jt,Se=>t(34,F=Se)),bt(n,wr,Se=>t(33,z=Se)),Ei(()=>{M&&k&&(ct.delete(M),k==null||k.removeLayer(M))});let tr;function rt(Se){var Mi,cn;if(!Ht||!M||!k||Ue&&Ve(Se)!==M)return;let Be=Se.features??[],nr=(cn=(Mi=Be[0])==null?void 0:Mi.properties)==null?void 0:cn.cluster_id,Te={event:Se,map:k,clusterId:nr,layer:M,source:c,features:Be};Xe(Se.type,Te)}function rr(Se){var Mi,cn;if(!Ht||!M||!k||Ue&&Ve(Se)!==M)return;qt&&(k.getCanvas().style.cursor=qt);let Be=Se.features??[];t(6,mt=Be[0]??null);let nr=(cn=(Mi=Be[0])==null?void 0:Mi.properties)==null?void 0:cn.cluster_id;Xe("mouseenter",{event:Se,map:k,clusterId:nr,layer:M,source:c,features:Be})}function ni(Se){var Mi,cn,ur;if(!Ht||!k)return;if(Ue&&Ve(Se)!==M){t(6,mt=null),at&&tr!==void 0&&(k==null||k.setFeatureState({source:c,sourceLayer:V,id:tr},{hover:!1}),tr=void 0);return}k.getCanvas().style.cursor=qt;let Be=Se.features??[],nr=(cn=(Mi=Be[0])==null?void 0:Mi.properties)==null?void 0:cn.cluster_id,Te=(ur=Be[0])==null?void 0:ur.id;Te!==tr&&(at&&(tr!==void 0&&(k==null||k.setFeatureState({source:c,id:tr,sourceLayer:V},{hover:!1})),k==null||k.setFeatureState({source:c,id:Te,sourceLayer:V},{hover:!0})),tr=Te,t(6,mt=Be[0]??null)),Xe("mousemove",{event:Se,map:k,clusterId:nr,layer:M,source:c,features:Be})}function cr(Se){if(!(!Ht||!M||!k)){if(qt&&(k.getCanvas().style.cursor=""),t(6,mt=null),at&&tr!==void 0){const Be={source:c,id:tr,sourceLayer:V};k==null||k.setFeatureState(Be,{hover:!1}),tr=void 0}Xe("mouseleave",{map:k,layer:M,source:c})}}let li=!0;function Bi(Se){k&&(k.off("click",Se,rt),k.off("dblclick",Se,rt),k.off("contextmenu",Se,rt),k.off("mouseenter",Se,rr),k.off("mousemove",Se,ni),k.off("mouseleave",Se,cr))}return Ei(()=>{k&&M&&Bi(M)}),n.$$set=Se=>{"id"in Se&&t(7,J=Se.id),"source"in Se&&t(8,j=Se.source),"sourceLayer"in Se&&t(9,V=Se.sourceLayer),"beforeId"in Se&&t(10,me=Se.beforeId),"beforeLayerType"in Se&&t(11,X=Se.beforeLayerType),"type"in Se&&t(12,pe=Se.type),"paint"in Se&&t(13,Ee=Se.paint),"layout"in Se&&t(14,Pe=Se.layout),"filter"in Se&&t(15,$e=Se.filter),"applyToClusters"in Se&&t(16,Ye=Se.applyToClusters),"minzoom"in Se&&t(17,ve=Se.minzoom),"maxzoom"in Se&&t(18,We=Se.maxzoom),"manageHoverState"in Se&&t(19,at=Se.manageHoverState),"hovered"in Se&&t(6,mt=Se.hovered),"interactive"in Se&&t(20,Ht=Se.interactive),"hoverCursor"in Se&&t(21,qt=Se.hoverCursor),"eventsIfTopMost"in Se&&t(22,Ue=Se.eventsIfTopMost),"$$scope"in Se&&t(35,G=Se.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&65536&&t(30,o=Qb(Ye)),n.$$.dirty[0]&1073774592&&t(24,l=Yb("all",o,$e)),n.$$.dirty[0]&131072|n.$$.dirty[1]&8&&t(26,u=ve??F),n.$$.dirty[0]&262144|n.$$.dirty[1]&4&&t(25,f=We??z),n.$$.dirty[0]&256|n.$$.dirty[1]&2&&t(29,c=j||T),n.$$.dirty[0]&654343809|n.$$.dirty[1]&1&&k&&M!==J&&c){M&&(Bi(M),ct.delete(M));let Se=me;if(!me&&X){let Be=k.getStyle().layers,nr=typeof X=="function"?X:Mi=>Mi.type===X,Te=Be==null?void 0:Be.find(nr);Te&&(Se=Te.id)}zi(or,M=J,M),k.addLayer(wh({id:M,type:pe,source:c,"source-layer":V,filter:l,paint:Ee,layout:Pe,minzoom:u,maxzoom:f}),Se),t(23,li=!0),k.on("click",M,rt),k.on("dblclick",M,rt),k.on("contextmenu",M,rt),k.on("mouseenter",M,rr),k.on("mousemove",M,ni),k.on("mouseleave",M,cr)}n.$$.dirty[0]&1048577&&M&&ct.set(M,{interactive:Ht}),n.$$.dirty[0]&1|n.$$.dirty[1]&1&&t(28,y=M?N0((Se,Be)=>k==null?void 0:k.setPaintProperty(M,Se,Be)):void 0),n.$$.dirty[0]&1|n.$$.dirty[1]&1&&t(27,w=M?N0((Se,Be)=>k==null?void 0:k.setLayoutProperty(M,Se,Be)):void 0),n.$$.dirty[0]&268443648&&(y==null||y(Ee)),n.$$.dirty[0]&134234112&&(w==null||w(Pe)),n.$$.dirty[0]&100663297|n.$$.dirty[1]&1&&M&&(k==null||k.setLayerZoomRange(M,u,f)),n.$$.dirty[0]&25165825|n.$$.dirty[1]&1&&M&&(li?t(23,li=!1):k==null||k.setFilter(M,l))},[M,Zt,Gt,or,Jt,wr,mt,J,j,V,me,X,pe,Ee,Pe,$e,Ye,ve,We,at,Ht,qt,Ue,li,l,f,u,w,y,c,o,k,T,z,F,G,B]}class Yd extends Dt{constructor(e){super(),Ft(this,e,eE,Qk,At,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function tE(n){let e;const t=n[16].default,o=yi(t,n,n[24],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&16777216)&&_i(o,t,l,l[24],e?bi(t,l[24],u,null):vi(l[24]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function rE(n){let e,t,o;function l(f){n[17](f)}let u={id:n[1],type:"circle",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],applyToClusters:n[9],minzoom:n[10],maxzoom:n[11],hoverCursor:n[12],manageHoverState:n[13],eventsIfTopMost:n[14],interactive:n[15],$$slots:{default:[tE]},$$scope:{ctx:n}};return n[0]!==void 0&&(u.hovered=n[0]),e=new Yd({props:u}),Wr.push(()=>fi(e,"hovered",l)),e.$on("click",n[18]),e.$on("dblclick",n[19]),e.$on("contextmenu",n[20]),e.$on("mouseenter",n[21]),e.$on("mousemove",n[22]),e.$on("mouseleave",n[23]),{c(){Ae(e.$$.fragment)},l(f){Fe(e.$$.fragment,f)},m(f,c){ze(e,f,c),o=!0},p(f,[c]){const y={};c&2&&(y.id=f[1]),c&4&&(y.source=f[2]),c&8&&(y.sourceLayer=f[3]),c&16&&(y.beforeId=f[4]),c&32&&(y.beforeLayerType=f[5]),c&64&&(y.paint=f[6]),c&128&&(y.layout=f[7]),c&256&&(y.filter=f[8]),c&512&&(y.applyToClusters=f[9]),c&1024&&(y.minzoom=f[10]),c&2048&&(y.maxzoom=f[11]),c&4096&&(y.hoverCursor=f[12]),c&8192&&(y.manageHoverState=f[13]),c&16384&&(y.eventsIfTopMost=f[14]),c&32768&&(y.interactive=f[15]),c&16777216&&(y.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,y.hovered=f[0],gi(()=>t=!1)),e.$set(y)},i(f){o||(ae(e.$$.fragment,f),o=!0)},o(f){fe(e.$$.fragment,f),o=!1},d(f){Le(e,f)}}}function iE(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("circle")}=e,{source:f=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:y=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:M}=e,{layout:k=void 0}=e,{filter:T=void 0}=e,{applyToClusters:z=void 0}=e,{minzoom:F=void 0}=e,{maxzoom:B=void 0}=e,{hoverCursor:G=void 0}=e,{manageHoverState:J=!1}=e,{hovered:j=null}=e,{eventsIfTopMost:V=!1}=e,{interactive:me=!0}=e;function X(We){j=We,t(0,j)}function pe(We){Er.call(this,n,We)}function Ee(We){Er.call(this,n,We)}function Pe(We){Er.call(this,n,We)}function $e(We){Er.call(this,n,We)}function Ye(We){Er.call(this,n,We)}function ve(We){Er.call(this,n,We)}return n.$$set=We=>{"id"in We&&t(1,u=We.id),"source"in We&&t(2,f=We.source),"sourceLayer"in We&&t(3,c=We.sourceLayer),"beforeId"in We&&t(4,y=We.beforeId),"beforeLayerType"in We&&t(5,w=We.beforeLayerType),"paint"in We&&t(6,M=We.paint),"layout"in We&&t(7,k=We.layout),"filter"in We&&t(8,T=We.filter),"applyToClusters"in We&&t(9,z=We.applyToClusters),"minzoom"in We&&t(10,F=We.minzoom),"maxzoom"in We&&t(11,B=We.maxzoom),"hoverCursor"in We&&t(12,G=We.hoverCursor),"manageHoverState"in We&&t(13,J=We.manageHoverState),"hovered"in We&&t(0,j=We.hovered),"eventsIfTopMost"in We&&t(14,V=We.eventsIfTopMost),"interactive"in We&&t(15,me=We.interactive),"$$scope"in We&&t(24,l=We.$$scope)},[j,u,f,c,y,w,M,k,T,z,F,B,G,J,V,me,o,X,pe,Ee,Pe,$e,Ye,ve,l]}class bc extends Dt{constructor(e){super(),Ft(this,e,iE,rE,At,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function nE(n){let e;const t=n[15].default,o=yi(t,n,n[23],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&8388608)&&_i(o,t,l,l[23],e?bi(t,l[23],u,null):vi(l[23]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function oE(n){let e,t,o;function l(f){n[16](f)}let u={id:n[1],type:"fill",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],minzoom:n[9],maxzoom:n[10],hoverCursor:n[11],manageHoverState:n[12],eventsIfTopMost:n[13],interactive:n[14],$$slots:{default:[nE]},$$scope:{ctx:n}};return n[0]!==void 0&&(u.hovered=n[0]),e=new Yd({props:u}),Wr.push(()=>fi(e,"hovered",l)),e.$on("click",n[17]),e.$on("dblclick",n[18]),e.$on("contextmenu",n[19]),e.$on("mouseenter",n[20]),e.$on("mousemove",n[21]),e.$on("mouseleave",n[22]),{c(){Ae(e.$$.fragment)},l(f){Fe(e.$$.fragment,f)},m(f,c){ze(e,f,c),o=!0},p(f,[c]){const y={};c&2&&(y.id=f[1]),c&4&&(y.source=f[2]),c&8&&(y.sourceLayer=f[3]),c&16&&(y.beforeId=f[4]),c&32&&(y.beforeLayerType=f[5]),c&64&&(y.paint=f[6]),c&128&&(y.layout=f[7]),c&256&&(y.filter=f[8]),c&512&&(y.minzoom=f[9]),c&1024&&(y.maxzoom=f[10]),c&2048&&(y.hoverCursor=f[11]),c&4096&&(y.manageHoverState=f[12]),c&8192&&(y.eventsIfTopMost=f[13]),c&16384&&(y.interactive=f[14]),c&8388608&&(y.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,y.hovered=f[0],gi(()=>t=!1)),e.$set(y)},i(f){o||(ae(e.$$.fragment,f),o=!0)},o(f){fe(e.$$.fragment,f),o=!1},d(f){Le(e,f)}}}function sE(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("fill")}=e,{source:f=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:y=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:M}=e,{layout:k=void 0}=e,{filter:T=void 0}=e,{minzoom:z=void 0}=e,{maxzoom:F=void 0}=e,{hoverCursor:B=void 0}=e,{manageHoverState:G=!1}=e,{hovered:J=null}=e,{eventsIfTopMost:j=!1}=e,{interactive:V=!0}=e;function me(ve){J=ve,t(0,J)}function X(ve){Er.call(this,n,ve)}function pe(ve){Er.call(this,n,ve)}function Ee(ve){Er.call(this,n,ve)}function Pe(ve){Er.call(this,n,ve)}function $e(ve){Er.call(this,n,ve)}function Ye(ve){Er.call(this,n,ve)}return n.$$set=ve=>{"id"in ve&&t(1,u=ve.id),"source"in ve&&t(2,f=ve.source),"sourceLayer"in ve&&t(3,c=ve.sourceLayer),"beforeId"in ve&&t(4,y=ve.beforeId),"beforeLayerType"in ve&&t(5,w=ve.beforeLayerType),"paint"in ve&&t(6,M=ve.paint),"layout"in ve&&t(7,k=ve.layout),"filter"in ve&&t(8,T=ve.filter),"minzoom"in ve&&t(9,z=ve.minzoom),"maxzoom"in ve&&t(10,F=ve.maxzoom),"hoverCursor"in ve&&t(11,B=ve.hoverCursor),"manageHoverState"in ve&&t(12,G=ve.manageHoverState),"hovered"in ve&&t(0,J=ve.hovered),"eventsIfTopMost"in ve&&t(13,j=ve.eventsIfTopMost),"interactive"in ve&&t(14,V=ve.interactive),"$$scope"in ve&&t(23,l=ve.$$scope)},[J,u,f,c,y,w,M,k,T,z,F,B,G,j,V,o,me,X,pe,Ee,Pe,$e,Ye,l]}class Ih extends Dt{constructor(e){super(),Ft(this,e,sE,oE,At,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function aE(n,e,t){let o;const{map:l}=ma();bt(n,l,y=>t(4,o=y));let{position:u="top-left"}=e,{container:f=void 0}=e,c=null;return Ei(()=>{o!=null&&o.loaded()&&c&&o.removeControl(c)}),n.$$set=y=>{"position"in y&&t(1,u=y.position),"container"in y&&t(2,f=y.container)},n.$$.update=()=>{if(n.$$.dirty&30&&o&&!c){let y;typeof f=="string"?y=document.querySelector(f)??void 0:y=f,t(3,c=new mo.FullscreenControl({container:y})),o.addControl(c,u)}},[l,u,f,c,o]}class lE extends Dt{constructor(e){super(),Ft(this,e,aE,null,At,{position:1,container:2})}}function ex(n,e,t,o,l){let u=!1;n.getSource(e)&&(u=!0,n.removeSource(e));const f=()=>{o(e)&&(n.addSource(e,t),l())};if(u){const c=()=>{e&&(n.getSource(e)?setTimeout(c,1):f())};c()}else f()}function tx(n,e,t){$k().then(()=>{let o=Hb(n);if(!o)return;o.getSource(e)===t&&o.removeSource(e)})}function U0(n){let e=n[0],t,o,l=q0(n);return{c(){l.c(),t=$t()},l(u){l.l(u),t=$t()},m(u,f){l.m(u,f),ce(u,t,f),o=!0},p(u,f){f&1&&At(e,e=u[0])?(vr(),fe(l,1,1,Yt),br(),l=q0(u),l.c(),ae(l,1),l.m(t.parentNode,t)):l.p(u,f)},i(u){o||(ae(l),o=!0)},o(u){fe(l),o=!1},d(u){u&&ee(t),l.d(u)}}}function q0(n){let e;const t=n[19].default,o=yi(t,n,n[18],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&262144)&&_i(o,t,l,l[18],e?bi(t,l[18],u,null):vi(l[18]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function cE(n){let e,t,o=n[0]&&U0(n);return{c(){o&&o.c(),e=$t()},l(l){o&&o.l(l),e=$t()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,[u]){l[0]?o?(o.p(l,u),u&1&&ae(o,1)):(o=U0(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function uE(n,e,t){let o,l,u,{$$slots:f={},$$scope:c}=e,{id:y=pa("geojson")}=e,{data:w}=e,{generateId:M=!1}=e,{promoteId:k=void 0}=e,{filter:T=void 0}=e,{lineMetrics:z=void 0}=e,{cluster:F=void 0}=e,{maxzoom:B=void 0}=e,{attribution:G=void 0}=e,{buffer:J=void 0}=e,{tolerance:j=void 0}=e;const{map:V,cluster:me,self:X}=Xb();bt(n,V,Pe=>t(17,l=Pe)),bt(n,me,Pe=>t(20,u=Pe)),bt(n,X,Pe=>t(0,o=Pe));let pe,Ee=!0;return Ei(()=>{o&&pe&&l&&(tx(V,o,pe),zi(X,o=null,o),t(15,pe=void 0))}),n.$$set=Pe=>{"id"in Pe&&t(4,y=Pe.id),"data"in Pe&&t(5,w=Pe.data),"generateId"in Pe&&t(6,M=Pe.generateId),"promoteId"in Pe&&t(7,k=Pe.promoteId),"filter"in Pe&&t(8,T=Pe.filter),"lineMetrics"in Pe&&t(9,z=Pe.lineMetrics),"cluster"in Pe&&t(10,F=Pe.cluster),"maxzoom"in Pe&&t(11,B=Pe.maxzoom),"attribution"in Pe&&t(12,G=Pe.attribution),"buffer"in Pe&&t(13,J=Pe.buffer),"tolerance"in Pe&&t(14,j=Pe.tolerance),"$$scope"in Pe&&t(18,c=Pe.$$scope)},n.$$.update=()=>{n.$$.dirty&1024&&zi(me,u=F,u),n.$$.dirty&196593&&l&&o!==y&&(zi(X,o=y,o),ex(l,o,wh({type:"geojson",data:w,filter:T,lineMetrics:z,generateId:M,promoteId:k,cluster:!!F,clusterMinPoints:F==null?void 0:F.minPoints,clusterMaxZoom:F==null?void 0:F.maxZoom,clusterRadius:F==null?void 0:F.radius,clusterProperties:F==null?void 0:F.properties,maxzoom:B,attribution:G,buffer:J,tolerance:j}),Pe=>l&&Pe===o,()=>{o&&(t(15,pe=l==null?void 0:l.getSource(o)),t(16,Ee=!0))})),n.$$.dirty&131088&&(l==null||l.on("style.load",()=>{t(15,pe=l==null?void 0:l.getSource(y))})),n.$$.dirty&98336&&pe&&(Ee?t(16,Ee=!1):pe.setData(w)),n.$$.dirty&33792&&(pe==null||pe.setClusterOptions(wh({cluster:!!F,clusterMaxZoom:F==null?void 0:F.maxZoom,clusterRadius:F==null?void 0:F.radius})))},[o,V,me,X,y,w,M,k,T,z,F,B,G,J,j,pe,Ee,l,c,f]}class cl extends Dt{constructor(e){super(),Ft(this,e,uE,cE,At,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10,maxzoom:11,attribution:12,buffer:13,tolerance:14})}}function hE(n,e,t){let o;const{map:l}=ma();bt(n,l,T=>t(8,o=T));let{position:u="top-left"}=e,{positionOptions:f=void 0}=e,{fitBoundsOptions:c=void 0}=e,{trackUserLocation:y=!1}=e,{showAccuracyCircle:w=!0}=e,{showUserLocation:M=!0}=e,{control:k=null}=e;return Ei(()=>{o!=null&&o.loaded()&&k&&o.removeControl(k)}),n.$$set=T=>{"position"in T&&t(2,u=T.position),"positionOptions"in T&&t(3,f=T.positionOptions),"fitBoundsOptions"in T&&t(4,c=T.fitBoundsOptions),"trackUserLocation"in T&&t(5,y=T.trackUserLocation),"showAccuracyCircle"in T&&t(6,w=T.showAccuracyCircle),"showUserLocation"in T&&t(7,M=T.showUserLocation),"control"in T&&t(1,k=T.control)},n.$$.update=()=>{n.$$.dirty&510&&o&&!k&&(t(1,k=new mo.GeolocateControl({positionOptions:f,fitBoundsOptions:c,trackUserLocation:y,showAccuracyCircle:w,showUserLocation:M})),o.addControl(k,u))},[l,k,u,f,c,y,w,M,o]}class fE extends Dt{constructor(e){super(),Ft(this,e,hE,null,At,{position:2,positionOptions:3,fitBoundsOptions:4,trackUserLocation:5,showAccuracyCircle:6,showUserLocation:7,control:1})}}function G0(n){let e=n[0],t,o,l=Z0(n);return{c(){l.c(),t=$t()},l(u){l.l(u),t=$t()},m(u,f){l.m(u,f),ce(u,t,f),o=!0},p(u,f){f&1&&At(e,e=u[0])?(vr(),fe(l,1,1,Yt),br(),l=Z0(u),l.c(),ae(l,1),l.m(t.parentNode,t)):l.p(u,f)},i(u){o||(ae(l),o=!0)},o(u){fe(l),o=!1},d(u){u&&ee(t),l.d(u)}}}function Z0(n){let e;const t=n[10].default,o=yi(t,n,n[9],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&512)&&_i(o,t,l,l[9],e?bi(t,l[9],u,null):vi(l[9]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function dE(n){let e,t,o=n[0]&&G0(n);return{c(){o&&o.c(),e=$t()},l(l){o&&o.l(l),e=$t()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,[u]){l[0]?o?(o.p(l,u),u&1&&ae(o,1)):(o=G0(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function pE(n,e,t){let o,l,{$$slots:u={},$$scope:f}=e,{id:c=pa("image")}=e,{url:y}=e,{coordinates:w}=e;const{map:M,self:k}=Xb();bt(n,M,F=>t(8,l=F)),bt(n,k,F=>t(0,o=F));let T,z=!0;return Ei(()=>{o&&l&&(tx(M,o,T),zi(k,o=null,o),t(6,T=void 0))}),n.$$set=F=>{"id"in F&&t(3,c=F.id),"url"in F&&t(4,y=F.url),"coordinates"in F&&t(5,w=F.coordinates),"$$scope"in F&&t(9,f=F.$$scope)},n.$$.update=()=>{n.$$.dirty&313&&l&&o!==c&&(zi(k,o=c,o),ex(l,o,wh({type:"image",url:y,coordinates:w}),F=>l&&F===o,()=>{o&&(t(6,T=l==null?void 0:l.getSource(o)),t(7,z=!0))})),n.$$.dirty&264&&(l==null||l.on("style.load",()=>{t(6,T=l==null?void 0:l.getSource(c))})),n.$$.dirty&224&&T&&(z?t(7,z=!1):T.setCoordinates(w))},[o,M,k,c,y,w,T,z,l,f,u]}class mE extends Dt{constructor(e){super(),Ft(this,e,pE,dE,At,{id:3,url:4,coordinates:5})}}function gE(n){let e;const t=n[15].default,o=yi(t,n,n[23],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&8388608)&&_i(o,t,l,l[23],e?bi(t,l[23],u,null):vi(l[23]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function yE(n){let e,t,o;function l(f){n[16](f)}let u={id:n[1],type:"line",source:n[2],sourceLayer:n[3],beforeId:n[4],beforeLayerType:n[5],paint:n[6],layout:n[7],filter:n[8],minzoom:n[9],maxzoom:n[10],hoverCursor:n[11],manageHoverState:n[12],eventsIfTopMost:n[13],interactive:n[14],$$slots:{default:[gE]},$$scope:{ctx:n}};return n[0]!==void 0&&(u.hovered=n[0]),e=new Yd({props:u}),Wr.push(()=>fi(e,"hovered",l)),e.$on("click",n[17]),e.$on("dblclick",n[18]),e.$on("contextmenu",n[19]),e.$on("mouseenter",n[20]),e.$on("mousemove",n[21]),e.$on("mouseleave",n[22]),{c(){Ae(e.$$.fragment)},l(f){Fe(e.$$.fragment,f)},m(f,c){ze(e,f,c),o=!0},p(f,[c]){const y={};c&2&&(y.id=f[1]),c&4&&(y.source=f[2]),c&8&&(y.sourceLayer=f[3]),c&16&&(y.beforeId=f[4]),c&32&&(y.beforeLayerType=f[5]),c&64&&(y.paint=f[6]),c&128&&(y.layout=f[7]),c&256&&(y.filter=f[8]),c&512&&(y.minzoom=f[9]),c&1024&&(y.maxzoom=f[10]),c&2048&&(y.hoverCursor=f[11]),c&4096&&(y.manageHoverState=f[12]),c&8192&&(y.eventsIfTopMost=f[13]),c&16384&&(y.interactive=f[14]),c&8388608&&(y.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,y.hovered=f[0],gi(()=>t=!1)),e.$set(y)},i(f){o||(ae(e.$$.fragment,f),o=!0)},o(f){fe(e.$$.fragment,f),o=!1},d(f){Le(e,f)}}}function _E(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("line")}=e,{source:f=void 0}=e,{sourceLayer:c=void 0}=e,{beforeId:y=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:M}=e,{layout:k=void 0}=e,{filter:T=void 0}=e,{minzoom:z=void 0}=e,{maxzoom:F=void 0}=e,{hoverCursor:B=void 0}=e,{manageHoverState:G=!1}=e,{hovered:J=null}=e,{eventsIfTopMost:j=!1}=e,{interactive:V=!0}=e;function me(ve){J=ve,t(0,J)}function X(ve){Er.call(this,n,ve)}function pe(ve){Er.call(this,n,ve)}function Ee(ve){Er.call(this,n,ve)}function Pe(ve){Er.call(this,n,ve)}function $e(ve){Er.call(this,n,ve)}function Ye(ve){Er.call(this,n,ve)}return n.$$set=ve=>{"id"in ve&&t(1,u=ve.id),"source"in ve&&t(2,f=ve.source),"sourceLayer"in ve&&t(3,c=ve.sourceLayer),"beforeId"in ve&&t(4,y=ve.beforeId),"beforeLayerType"in ve&&t(5,w=ve.beforeLayerType),"paint"in ve&&t(6,M=ve.paint),"layout"in ve&&t(7,k=ve.layout),"filter"in ve&&t(8,T=ve.filter),"minzoom"in ve&&t(9,z=ve.minzoom),"maxzoom"in ve&&t(10,F=ve.maxzoom),"hoverCursor"in ve&&t(11,B=ve.hoverCursor),"manageHoverState"in ve&&t(12,G=ve.manageHoverState),"hovered"in ve&&t(0,J=ve.hovered),"eventsIfTopMost"in ve&&t(13,j=ve.eventsIfTopMost),"interactive"in ve&&t(14,V=ve.interactive),"$$scope"in ve&&t(23,l=ve.$$scope)},[J,u,f,c,y,w,M,k,T,z,F,B,G,j,V,o,me,X,pe,Ee,Pe,$e,Ye,l]}class xc extends Dt{constructor(e){super(),Ft(this,e,_E,yE,At,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function vE(n,e,t){let o;const l=zc();let{layer:u=void 0}=e;const{map:f}=ma();bt(n,f,M=>t(2,o=M));function c(M){l(M.type,{...M,map:f})}const y=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","contextmenu","mouseover","mouseout"],w=["click","dblclick","contextmenu","mousemove","movestart","moveend","zoomstart","zoom","zoomend"];return Ei(()=>{if(o)if(u)for(const M of y)o.off(M,u,c);else for(const M of w)o.off(M,c)}),n.$$set=M=>{"layer"in M&&t(1,u=M.layer)},n.$$.update=()=>{if(n.$$.dirty&6&&o)if(u)for(const M of y)o.on(M,u,c);else for(const M of w)o.on(M,c)},[f,u,o]}class bE extends Dt{constructor(e){super(),Ft(this,e,vE,null,At,{layer:1})}}function xE(n){let e=n.getCenter(),t=Math.round(n.getZoom()*100)/100,o=Math.ceil((t*Math.LN2+Math.log(512/360/.5))/Math.LN10),l=Math.pow(10,o),u=Math.round(e.lat*l)/l,f=Math.round(e.lng*l)/l,c=`${t}/${u}/${f}`,y=n.getBearing(),w=n.getPitch();return(y||w)&&(c+=`/${Math.round(y*10)/10}`),w&&(c+=`/${Math.round(w)}`),`#${c}`}function wE(n){return n.replace("#","").split("/").map(parseFloat)}var lc=Qg;function Qg(n,e){return n===e||n!==n&&e!==e?!0:typeof n!=typeof e||{}.toString.call(n)!={}.toString.call(e)||n!==Object(n)||!n?!1:Array.isArray(n)?H0(n,e):{}.toString.call(n)=="[object Set]"?H0(Array.from(n),Array.from(e)):{}.toString.call(n)=="[object Object]"?kE(n,e):SE(n,e)}function SE(n,e){return n.toString()===e.toString()}function H0(n,e){var t=n.length;if(t!=e.length)return!1;for(var o=0;ot(6,o=M));let{position:u="top-left"}=e,{showCompass:f=!0}=e,{showZoom:c=!0}=e,{visualizePitch:y=!1}=e,w=null;return Ei(()=>{o!=null&&o.loaded()&&w&&o.removeControl(w)}),n.$$set=M=>{"position"in M&&t(1,u=M.position),"showCompass"in M&&t(2,f=M.showCompass),"showZoom"in M&&t(3,c=M.showZoom),"visualizePitch"in M&&t(4,y=M.visualizePitch)},n.$$.update=()=>{n.$$.dirty&126&&o&&!w&&(t(5,w=new mo.NavigationControl({showCompass:f,showZoom:c,visualizePitch:y})),o.addControl(w,u))},[l,u,f,c,y,w,o]}class PE extends Dt{constructor(e){super(),Ft(this,e,EE,null,At,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function ME(n,e,t){let o;const{map:l}=ma();bt(n,l,w=>t(5,o=w));let{position:u="bottom-left"}=e,{maxWidth:f=void 0}=e,{unit:c="metric"}=e,y=null;return Ei(()=>{o!=null&&o.loaded()&&y&&o.removeControl(y)}),n.$$set=w=>{"position"in w&&t(1,u=w.position),"maxWidth"in w&&t(2,f=w.maxWidth),"unit"in w&&t(3,c=w.unit)},n.$$.update=()=>{n.$$.dirty&62&&o&&!y&&(t(4,y=new mo.ScaleControl({maxWidth:f,unit:c})),o.addControl(y,u))},[l,u,f,c,y,o]}class IE extends Dt{constructor(e){super(),Ft(this,e,ME,null,At,{position:1,maxWidth:2,unit:3})}}const{window:TE}=Hg,CE=n=>({map:n[0]&16,loadedImages:n[0]&32,allImagesLoaded:n[0]&64}),W0=n=>({map:n[4],loadedImages:n[5],allImagesLoaded:n[6]});function X0(n){let e,t,o=n[3]&&J0(n);const l=n[40].default,u=yi(l,n,n[39],W0);return{c(){o&&o.c(),e=qe(),u&&u.c()},l(f){o&&o.l(f),e=Ge(f),u&&u.l(f)},m(f,c){o&&o.m(f,c),ce(f,e,c),u&&u.m(f,c),t=!0},p(f,c){f[3]?o?(o.p(f,c),c[0]&8&&ae(o,1)):(o=J0(f),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br()),u&&u.p&&(!t||c[0]&112|c[1]&256)&&_i(u,l,f,f[39],t?bi(l,f[39],c,CE):vi(f[39]),W0)},i(f){t||(ae(o),ae(u,f),t=!0)},o(f){fe(o),fe(u,f),t=!1},d(f){f&&ee(e),o&&o.d(f),u&&u.d(f)}}}function J0(n){let e,t,o,l,u,f,c,y;return e=new PE({props:{position:n[7]}}),o=new fE({props:{position:n[7],fitBoundsOptions:{maxZoom:12}}}),u=new lE({props:{position:n[7]}}),c=new IE({props:{position:n[7]}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),Ae(u.$$.fragment),f=qe(),Ae(c.$$.fragment)},l(w){Fe(e.$$.fragment,w),t=Ge(w),Fe(o.$$.fragment,w),l=Ge(w),Fe(u.$$.fragment,w),f=Ge(w),Fe(c.$$.fragment,w)},m(w,M){ze(e,w,M),ce(w,t,M),ze(o,w,M),ce(w,l,M),ze(u,w,M),ce(w,f,M),ze(c,w,M),y=!0},p(w,M){const k={};M[0]&128&&(k.position=w[7]),e.$set(k);const T={};M[0]&128&&(T.position=w[7]),o.$set(T);const z={};M[0]&128&&(z.position=w[7]),u.$set(z);const F={};M[0]&128&&(F.position=w[7]),c.$set(F)},i(w){y||(ae(e.$$.fragment,w),ae(o.$$.fragment,w),ae(u.$$.fragment,w),ae(c.$$.fragment,w),y=!0)},o(w){fe(e.$$.fragment,w),fe(o.$$.fragment,w),fe(u.$$.fragment,w),fe(c.$$.fragment,w),y=!1},d(w){w&&(ee(t),ee(l),ee(f)),Le(e,w),Le(o,w),Le(u,w),Le(c,w)}}}function AE(n){let e,t,o,l,u,f=n[4]&&n[0]&&X0(n);return{c(){e=et("div"),f&&f.c(),this.h()},l(c){e=tt(c,"DIV",{class:!0,"data-testid":!0});var y=Lt(e);f&&f.l(y),y.forEach(ee),this.h()},h(){Ke(e,"class",t=B0(n[2])+" svelte-p00lfq"),Ke(e,"data-testid","map-container"),ts(e,"expand-map",!n[2])},m(c,y){ce(c,e,y),f&&f.m(e,null),n[41](e),o=!0,l||(u=[fr(TE,"hashchange",n[11]),Ym(n[10].call(null,e))],l=!0)},p(c,y){c[4]&&c[0]?f?(f.p(c,y),y[0]&17&&ae(f,1)):(f=X0(c),f.c(),ae(f,1),f.m(e,null)):f&&(vr(),fe(f,1,1,()=>{f=null}),br()),(!o||y[0]&4&&t!==(t=B0(c[2])+" svelte-p00lfq"))&&Ke(e,"class",t),(!o||y[0]&4)&&ts(e,"expand-map",!c[2])},i(c){o||(ae(f),o=!0)},o(c){fe(f),o=!1},d(c){c&&ee(e),f&&f.d(),n[41](null),l=!1,ss(u)}}}function zE(n,e,t){let o,l,u,f,{$$slots:c={},$$scope:y}=e,{map:w=null}=e,{mapContainer:M=void 0}=e,{class:k=void 0}=e,{style:T}=e,{diffStyleUpdates:z=!1}=e,{center:F=void 0}=e,{zoom:B=void 0}=e,{pitch:G=0}=e,{bearing:J=0}=e,{bounds:j=void 0}=e,{hash:V=!1}=e,{updateHash:me=Se=>{window.history.replaceState(window.history.state,"",Se)}}=e,{loaded:X=!1}=e,{minZoom:pe=0}=e,{maxZoom:Ee=22}=e,{antialias:Pe=void 0}=e,{zoomOnDoubleClick:$e=!0}=e,{locale:Ye=void 0}=e,{interactive:ve=!0}=e,{attributionControl:We=!0}=e,{cooperativeGestures:at=!1}=e,{preserveDrawingBuffer:mt=!1}=e,{maxBounds:Ht=void 0}=e,{images:qt=[]}=e,{standardControls:Ue=!1}=e,{filterLayers:Xe=void 0}=e,{transformRequest:Zt=void 0}=e;const Gt=zc(),{map:or,loadedImages:Jt}=Hk();bt(n,or,Se=>t(4,u=Se)),bt(n,Jt,Se=>t(5,f=Se));let wr=new Set;async function Ve(Se,Be=!1){if(u&&!(!u.loaded()&&!Be))if("url"in Se){wr.add(Se.id);try{let nr=await u.loadImage(Se.url);u==null||u.addImage(Se.id,nr.data,Se.options),f.add(Se.id),Jt.set(f)}catch(nr){Gt("error",nr)}finally{wr.delete(Se.id)}}else u.addImage(Se.id,Se.data,Se.options),f.add(Se.id),Jt.set(f)}let ct,tr,rt,rr;function ni(Se){return li(),zi(or,u=new mo.Map(wh({container:Se,style:T,locale:Ye,center:F,zoom:B,pitch:G,bearing:J,minZoom:pe,maxZoom:Ee,antialias:Pe,interactive:ve,preserveDrawingBuffer:mt,maxBounds:Ht,bounds:j,attributionControl:We,transformRequest:Zt,cooperativeGestures:at})),u),u.on("load",Be=>{Be.target.getContainer().setAttribute("data-testid","map"),Be.target.getCanvas().setAttribute("data-testid","map-canvas"),t(0,X=!0),Gt("load",u)}),u.on("error",Be=>Gt("error",{...Be,map:u})),u.on("movestart",Be=>Gt("movestart",{...Be,map:u})),u.on("moveend",Be=>{if(t(12,F=Be.target.getCenter()),t(13,B=Be.target.getZoom()),t(14,G=Be.target.getPitch()),t(15,J=Be.target.getBearing()),t(16,j=Be.target.getBounds()),Gt("moveend",{...Be,map:u}),V){let nr=new URL(window.location.href.replace(/(#.+)?$/,xE(u)));me(nr)}}),u.on("click",Be=>Gt("click",{...Be,map:u})),u.on("dblclick",Be=>Gt("dblclick",{...Be,map:u})),u.on("contextmenu",Be=>Gt("contextmenu",{...Be,map:u})),u.on("zoomstart",Be=>Gt("zoomstart",{...Be,map:u})),u.on("zoom",Be=>{Gt("zoom",{...Be,map:u})}),u.on("zoomend",Be=>{Gt("zoomend",{...Be,map:u})}),u.on("style.load",()=>{if(u){const Be=u.getStyle();if(t(36,ct=Be.layers.map(nr=>nr.id)),t(37,tr=Object.keys(Be.sources)),rr)for(const[nr,Te]of Object.entries(rr))u.addSource(nr,Te);if(rt)for(const nr of rt)u.addLayer(nr);for(const nr of qt)Ve(nr,!0)}}),u.on("styledata",Be=>{if(u&&Xe){const nr=u.getStyle().layers;if(nr)for(let Te of nr)Xe(Te)||u.setLayoutProperty(Te.id,"visibility","none")}Gt("styledata",{...Be,map:u})}),{destroy(){t(0,X=!1),u==null||u.remove(),zi(or,u=null,u)}}}let cr=T;function li(){if(V){let Se=wE(window.location.hash);Se.length>=3&&(t(13,B=Se[0]),t(12,F=[Se[2],Se[1]])),Se.length==5&&(t(15,J=Se[3]),t(14,G=Se[4]))}}function Bi(Se){Wr[Se?"unshift":"push"](()=>{M=Se,t(1,M)})}return n.$$set=Se=>{"map"in Se&&t(17,w=Se.map),"mapContainer"in Se&&t(1,M=Se.mapContainer),"class"in Se&&t(2,k=Se.class),"style"in Se&&t(18,T=Se.style),"diffStyleUpdates"in Se&&t(19,z=Se.diffStyleUpdates),"center"in Se&&t(12,F=Se.center),"zoom"in Se&&t(13,B=Se.zoom),"pitch"in Se&&t(14,G=Se.pitch),"bearing"in Se&&t(15,J=Se.bearing),"bounds"in Se&&t(16,j=Se.bounds),"hash"in Se&&t(20,V=Se.hash),"updateHash"in Se&&t(21,me=Se.updateHash),"loaded"in Se&&t(0,X=Se.loaded),"minZoom"in Se&&t(22,pe=Se.minZoom),"maxZoom"in Se&&t(23,Ee=Se.maxZoom),"antialias"in Se&&t(24,Pe=Se.antialias),"zoomOnDoubleClick"in Se&&t(25,$e=Se.zoomOnDoubleClick),"locale"in Se&&t(26,Ye=Se.locale),"interactive"in Se&&t(27,ve=Se.interactive),"attributionControl"in Se&&t(28,We=Se.attributionControl),"cooperativeGestures"in Se&&t(29,at=Se.cooperativeGestures),"preserveDrawingBuffer"in Se&&t(30,mt=Se.preserveDrawingBuffer),"maxBounds"in Se&&t(31,Ht=Se.maxBounds),"images"in Se&&t(32,qt=Se.images),"standardControls"in Se&&t(3,Ue=Se.standardControls),"filterLayers"in Se&&t(33,Xe=Se.filterLayers),"transformRequest"in Se&&t(34,Zt=Se.transformRequest),"$$scope"in Se&&t(39,y=Se.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&8&&t(7,o=typeof Ue=="boolean"?void 0:Ue),n.$$.dirty[0]&16&&t(17,w=u),n.$$.dirty[0]&786448|n.$$.dirty[1]&224&&u&&!lc(T,cr)){const Se=u.getStyle();if(ct&&(rt=Se.layers.filter(Be=>!ct.includes(Be.id))),tr){const Be=Object.keys(Se.sources).filter(nr=>!tr.includes(nr));rr={};for(const nr of Be)rr[nr]=Se.sources[nr]}t(38,cr=T),u.setStyle(T,{diff:z}),zi(Jt,f=new Set,f),t(35,wr=new Set)}if(n.$$.dirty[0]&49|n.$$.dirty[1]&18&&X&&u!=null&&u.loaded())for(let Se of qt)!f.has(Se.id)&&!wr.has(Se.id)&&!u.hasImage(Se.id)&&Ve(Se);if(n.$$.dirty[0]&32|n.$$.dirty[1]&2&&t(6,l=qt.every(Se=>f.has(Se.id))),n.$$.dirty[0]&61456&&u){let Se={};F!=null&&!lc(F,u==null?void 0:u.getCenter())&&(Se.center=F),B!=null&&!lc(B,u==null?void 0:u.getZoom())&&(Se.zoom=B),J!=null&&!lc(J,u==null?void 0:u.getBearing())&&(Se.bearing=J),G!=null&&!lc(G,u==null?void 0:u.getPitch())&&(Se.pitch=G),Object.keys(Se).length&&u.easeTo(Se)}n.$$.dirty[0]&65552&&j&&!lc(j,u==null?void 0:u.getBounds())&&(u==null||u.fitBounds(j)),n.$$.dirty[0]&33554448&&($e?u==null||u.doubleClickZoom.enable():u==null||u.doubleClickZoom.disable())},[X,M,k,Ue,u,f,l,o,or,Jt,ni,li,F,B,G,J,j,w,T,z,V,me,pe,Ee,Pe,$e,Ye,ve,We,at,mt,Ht,qt,Xe,Zt,wr,ct,tr,cr,y,c,Bi]}class LE extends Dt{constructor(e){super(),Ft(this,e,zE,AE,At,{map:17,mapContainer:1,class:2,style:18,diffStyleUpdates:19,center:12,zoom:13,pitch:14,bearing:15,bounds:16,hash:20,updateHash:21,loaded:0,minZoom:22,maxZoom:23,antialias:24,zoomOnDoubleClick:25,locale:26,interactive:27,attributionControl:28,cooperativeGestures:29,preserveDrawingBuffer:30,maxBounds:31,images:32,standardControls:3,filterLayers:33,transformRequest:34},null,[-1,-1])}}const DE=n=>({marker:n&8}),K0=n=>({marker:n[3]});function FE(n){let e,t,o,l,u,f,c;const y=n[19].default,w=yi(y,n,n[18],K0);return{c(){e=et("div"),w&&w.c(),this.h()},l(M){e=tt(M,"DIV",{tabindex:!0,role:!0});var k=Lt(e);w&&w.l(k),k.forEach(ee),this.h()},h(){Ke(e,"tabindex",t=n[1]?0:void 0),Ke(e,"role",o=n[1]?"button":void 0),ki(e,"z-index",n[2])},m(M,k){ce(M,e,k),w&&w.m(e,null),u=!0,f||(c=[Ym(n[7].call(null,e)),Ym(l=RE.call(null,e,n[0])),fr(e,"click",td(n[20])),fr(e,"dblclick",td(n[21])),fr(e,"contextmenu",td(n[22])),fr(e,"mouseenter",n[23]),fr(e,"mouseleave",n[24]),fr(e,"mousemove",n[25]),fr(e,"keydown",n[8])],f=!0)},p(M,[k]){w&&w.p&&(!u||k&262152)&&_i(w,y,M,M[18],u?bi(y,M[18],k,DE):vi(M[18]),K0),(!u||k&2&&t!==(t=M[1]?0:void 0))&&Ke(e,"tabindex",t),(!u||k&2&&o!==(o=M[1]?"button":void 0))&&Ke(e,"role",o),l&&Nk(l.update)&&k&1&&l.update.call(null,M[0]),k&4&&ki(e,"z-index",M[2])},i(M){u||(ae(w,M),u=!0)},o(M){fe(w,M),u=!1},d(M){M&&ee(e),w&&w.d(M),f=!1,ss(c)}}}function RE(n,e){const t=n.className;function o(l){l?n.className=`${t} ${l}`:n.className=t}return o(e),{update:o}}function BE(n,e,t){let o,l,u,{$$slots:f={},$$scope:c}=e,{marker:y=void 0}=e,{lngLat:w}=e,{class:M=void 0}=e,{interactive:k=!0}=e,{asButton:T=!1}=e,{draggable:z=!1}=e,{feature:F=null}=e,{offset:B=void 0}=e,{zIndex:G=void 0}=e,{rotation:J=0}=e,{opacity:j=1}=e;const V=zc(),{map:me,layerEvent:X,self:pe}=Xk();bt(n,me,Ue=>t(27,u=Ue)),bt(n,X,Ue=>t(26,o=Ue)),bt(n,pe,Ue=>t(3,l=Ue));function Ee(Ue){zi(pe,l=new mo.Marker({element:Ue,rotation:J,draggable:z,offset:B,opacity:j.toString()}).setLngLat(w).addTo(u),l),t(11,y=l);const Xe=()=>Ye("dragstart"),Zt=()=>{Pe(),Ye("drag")},Gt=()=>{Pe(),Ye("dragend")};return z&&(l.on("dragstart",Xe),l.on("drag",Zt),l.on("dragend",Gt)),{destroy(){z&&(l==null||l.off("dragstart",Xe),l==null||l.off("drag",Zt),l==null||l.off("dragend",Gt)),t(11,y=void 0),l==null||l.remove()}}}function Pe(){let Ue=l==null?void 0:l.getLngLat();Ue&&(Array.isArray(w)?t(10,w=[Ue.lng,Ue.lat]):w&&"lon"in w?t(10,w={lon:Ue.lng,lat:Ue.lat}):t(10,w=Ue))}function $e(Ue){Ue.key===" "&&(Ue.preventDefault(),Ue.stopPropagation(),Ye("click"))}function Ye(Ue){if(!k)return;let Xe=l==null?void 0:l.getLngLat();if(!Xe)return;const Zt=[Xe.lng,Xe.lat];let Gt={map:u,marker:l,lngLat:Zt,features:[{type:"Feature",properties:(F==null?void 0:F.properties)??{},geometry:{type:"Point",coordinates:Zt}}]};zi(X,o={...Gt,layerType:"marker",type:Ue},o),V(Ue,Gt)}const ve=()=>Ye("click"),We=()=>Ye("dblclick"),at=()=>Ye("contextmenu"),mt=Ue=>{Ye("mouseenter")},Ht=()=>{Ye("mouseleave")},qt=()=>Ye("mousemove");return n.$$set=Ue=>{"marker"in Ue&&t(11,y=Ue.marker),"lngLat"in Ue&&t(10,w=Ue.lngLat),"class"in Ue&&t(0,M=Ue.class),"interactive"in Ue&&t(12,k=Ue.interactive),"asButton"in Ue&&t(1,T=Ue.asButton),"draggable"in Ue&&t(13,z=Ue.draggable),"feature"in Ue&&t(14,F=Ue.feature),"offset"in Ue&&t(15,B=Ue.offset),"zIndex"in Ue&&t(2,G=Ue.zIndex),"rotation"in Ue&&t(16,J=Ue.rotation),"opacity"in Ue&&t(17,j=Ue.opacity),"$$scope"in Ue&&t(18,c=Ue.$$scope)},n.$$.update=()=>{n.$$.dirty&1032&&(l==null||l.setLngLat(w)),n.$$.dirty&32776&&(l==null||l.setOffset(B??[0,0])),n.$$.dirty&65544&&(l==null||l.setRotation(J)),n.$$.dirty&131080&&(l==null||l.setOpacity(j.toString()))},[M,T,G,l,me,X,pe,Ee,$e,Ye,w,y,k,z,F,B,J,j,c,f,ve,We,at,mt,Ht,qt]}class Qm extends Dt{constructor(e){super(),Ft(this,e,BE,FE,At,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}class Em{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let o=0;for(let l=0;l0){for(f=e[--t];t>0&&(o=f,l=e[--t],f=o+l,u=l-(f-o),!u););t>0&&(u<0&&e[t-1]<0||u>0&&e[t-1]>0)&&(l=u*2,o=f+l,l==o-f&&(f=o))}return f}}var OE=1e-6,Y0=1e-12,ey=Math.PI,Q0=ey/2,ev=180/ey,rs=ey/180,rx=Math.atan2,is=Math.cos,eg=Math.hypot,ns=Math.sin,$E=Math.sqrt;function ix(n){return n>1?Q0:n<-1?-Q0:Math.asin(n)}function NE(){}function xd(n,e){n&&rv.hasOwnProperty(n.type)&&rv[n.type](n,e)}var tv={Feature:function(n,e){xd(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,o=-1,l=t.length;++o({feature:n[0]&1024,position:n[0]&1026}),av=n=>({feature:n[40],position:n[41]});function lv(n){let e=[],t=new WE,o,l,u=_o(n[10]);const f=c=>c[40].id;for(let c=0;c=n[13]&&n[11]<=n[12]&&lv(n);return{c(){Ae(e.$$.fragment),t=qe(),u&&u.c(),o=$t()},l(f){Fe(e.$$.fragment,f),t=Ge(f),u&&u.l(f),o=$t()},m(f,c){ze(e,f,c),ce(f,t,c),u&&u.m(f,c),ce(f,o,c),l=!0},p(f,c){const y={};c[0]&32&&(y.minzoom=f[5]),c[0]&64&&(y.maxzoom=f[6]),e.$set(y),f[11]>=f[13]&&f[11]<=f[12]?u?(u.p(f,c),c[0]&14336&&ae(u,1)):(u=lv(f),u.c(),ae(u,1),u.m(o.parentNode,o)):u&&(vr(),fe(u,1,1,()=>{u=null}),br())},i(f){l||(ae(e.$$.fragment,f),ae(u),l=!0)},o(f){fe(e.$$.fragment,f),fe(u),l=!1},d(f){f&&(ee(t),ee(o)),Le(e,f),u&&u.d(f)}}}function YE(n,e,t){let o,l,u,f,c,y,w,{$$slots:M={},$$scope:k}=e;const{map:T,source:z,minzoom:F,maxzoom:B}=ma();bt(n,T,rt=>t(21,f=rt)),bt(n,z,rt=>t(9,c=rt)),bt(n,F,rt=>t(23,w=rt)),bt(n,B,rt=>t(22,y=rt));const G=zc();let{applyToClusters:J=void 0}=e,{filter:j=void 0}=e,{markerLngLat:V=HE}=e,{interactive:me=!0}=e,{asButton:X=!1}=e,{draggable:pe=!1}=e,{minzoom:Ee=void 0}=e,{maxzoom:Pe=void 0}=e,{hovered:$e=null}=e,{zIndex:Ye=void 0}=e,{class:ve=void 0}=e,We=!1;function at(){f&&(We=!0,f.on("zoom",Xe),f.on("move",qt),f.on("moveend",qt),f.loaded()?f.once("load",qt):qt())}function mt(rt){rt.sourceId===c&&rt.isSourceLoaded&&(We?qt():at())}Ei(()=>{f&&(f.off("zoom",Xe),f.off("move",qt),f.off("moveend",qt),f.off("sourcedata",mt))});let Ht=[];function qt(){var ni;if(!f||!c)return;let rt=f.querySourceFeatures(c,{filter:u}),rr=new Map;for(let cr of rt)cr.id||((ni=cr.properties)!=null&&ni.cluster_id?cr.id="autocluster_"+cr.properties.cluster_id:cr.id=pa("autofeat")),rr.set(cr.id,cr);t(10,Ht=[...rr.values()].sort((cr,li)=>cr.id.toString().localeCompare(li.id.toString())))}let Ue=(f==null?void 0:f.getZoom())??0;function Xe(rt){t(11,Ue=f.getZoom()),qt()}const Zt=rt=>{t(0,$e=rt)},Gt=rt=>{($e==null?void 0:$e.id)===rt.id&&t(0,$e=null)},or=(rt,rr)=>G("dragstart",{...rr.detail,source:c,feature:rt}),Jt=(rt,rr)=>G("drag",{...rr.detail,source:c,feature:rt}),wr=(rt,rr)=>G("dragend",{...rr.detail,source:c,feature:rt}),Ve=(rt,rr)=>G("click",{...rr.detail,source:c,feature:rt}),ct=(rt,rr)=>G("dblclick",{...rr.detail,source:c,feature:rt}),tr=(rt,rr)=>G("contextmenu",{...rr.detail,source:c,feature:rt});return n.$$set=rt=>{"applyToClusters"in rt&&t(19,J=rt.applyToClusters),"filter"in rt&&t(20,j=rt.filter),"markerLngLat"in rt&&t(1,V=rt.markerLngLat),"interactive"in rt&&t(2,me=rt.interactive),"asButton"in rt&&t(3,X=rt.asButton),"draggable"in rt&&t(4,pe=rt.draggable),"minzoom"in rt&&t(5,Ee=rt.minzoom),"maxzoom"in rt&&t(6,Pe=rt.maxzoom),"hovered"in rt&&t(0,$e=rt.hovered),"zIndex"in rt&&t(7,Ye=rt.zIndex),"class"in rt&&t(8,ve=rt.class),"$$scope"in rt&&t(33,k=rt.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&8388640&&t(13,o=Ee??w),n.$$.dirty[0]&4194368&&t(12,l=Pe??y),n.$$.dirty[0]&1572864&&(u=Yb("all",Qb(J),j)),n.$$.dirty[0]&2097664&&f&&c){let rt=f.getSource(c);rt!=null&&rt.loaded()?at():f.on("sourcedata",mt)}},[$e,V,me,X,pe,Ee,Pe,Ye,ve,c,Ht,Ue,l,o,T,z,F,B,G,J,j,f,y,w,M,Zt,Gt,or,Jt,wr,Ve,ct,tr,k]}class QE extends Dt{constructor(e){super(),Ft(this,e,YE,KE,At,{applyToClusters:19,filter:20,markerLngLat:1,interactive:2,asButton:3,draggable:4,minzoom:5,maxzoom:6,hovered:0,zIndex:7,class:8},null,[-1,-1])}}const eP=n=>({features:n[0]&16,data:n[0]&16,map:n[0]&4,close:n[0]&1}),uv=n=>{var e;return{features:n[4],data:(e=n[4])==null?void 0:e[0],map:n[2],close:n[31]}};function hv(n){let e,t,o=(n[4]||n[3]instanceof mo.Marker)&&fv(n);return{c(){e=et("div"),o&&o.c()},l(l){e=tt(l,"DIV",{});var u=Lt(e);o&&o.l(u),u.forEach(ee)},m(l,u){ce(l,e,u),o&&o.m(e,null),n[32](e),t=!0},p(l,u){l[4]||l[3]instanceof mo.Marker?o?(o.p(l,u),u[0]&24&&ae(o,1)):(o=fv(l),o.c(),ae(o,1),o.m(e,null)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(),n[32](null)}}}function fv(n){let e;const t=n[30].default,o=yi(t,n,n[29],uv);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u[0]&536870933)&&_i(o,t,l,l[29],e?bi(t,l[29],u,eP):vi(l[29]),uv)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function tP(n){let e,t,o=n[9].default&&hv(n);return{c(){o&&o.c(),e=$t()},l(l){o&&o.l(l),e=$t()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[9].default?o?(o.p(l,u),u[0]&512&&ae(o,1)):(o=hv(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function rP(n,e,t){let o,l,u,f,c,y,{$$slots:w={},$$scope:M}=e;const k=Wb(w);let{closeButton:T=void 0}=e,{closeOnClickOutside:z=!0}=e,{closeOnClickInside:F=!1}=e,{closeOnMove:B=!1}=e,{openOn:G="click"}=e,{openIfTopMost:J=!0}=e,{focusAfterOpen:j=!0}=e,{anchor:V=void 0}=e,{offset:me=void 0}=e,{popupClass:X=void 0}=e,{maxWidth:pe=void 0}=e,{lngLat:Ee=void 0}=e,{html:Pe=void 0}=e,{open:$e=!1}=e;const Ye=zc(),{map:ve,popupTarget:We,layerEvent:at,layer:mt,eventTopMost:Ht}=ma();bt(n,ve,Be=>t(2,u=Be)),bt(n,We,Be=>t(3,c=Be)),bt(n,at,Be=>t(28,f=Be)),bt(n,mt,Be=>t(35,y=Be));const qt=["click","dblclick","contextmenu"];let Ue,Xe=!1,Zt;function Gt(){if(!Ue)return;let Be=Ue.getElement();!Be||Be===Zt||(Zt=Be,G==="hover"&&(Zt.style.pointerEvents="none"),Zt.addEventListener("mouseenter",()=>{t(24,Xe=!0)},{passive:!0}),Zt.addEventListener("mouseleave",()=>{t(24,Xe=!1)},{passive:!0}),Zt.addEventListener("click",()=>{F&&t(0,$e=!1)},{passive:!0}))}As(()=>{if(u)return u.on("click",cr),u.on("contextmenu",cr),typeof c=="string"&&(u.on("click",c,Ve),u.on("dblclick",c,Ve),u.on("contextmenu",c,Ve),u.on("mousemove",c,ni),u.on("mouseleave",c,rr),u.on("touchstart",c,tr),u.on("touchend",c,rt)),()=>{u!=null&&u.loaded()&&(Ue==null||Ue.remove(),u.off("click",cr),u.off("contextmenu",cr),c instanceof mo.Marker?c.getPopup()===Ue&&c.setPopup(void 0):typeof c=="string"&&(u.off("click",c,Ve),u.off("dblclick",c,Ve),u.off("contextmenu",c,Ve),u.off("mousemove",c,ni),u.off("mouseleave",c,rr),u.off("touchstart",c,tr),u.off("touchend",c,rt)))}});function or(Be){return J?!("marker"in Be)&&!Jk(Be)&&Ht(Be)!==y:!1}let Jt=null,wr="normal";function Ve(Be){Be.type===G&&(or(Be)||("layerType"in Be?Be.layerType==="deckgl"?(t(10,Ee=Be.coordinate),t(4,Jt=Be.object?[Be.object]:null)):(t(10,Ee=Be.lngLat),t(4,Jt=Be.features??[])):(t(10,Ee=Be.lngLat),t(4,Jt=Be.features??[])),setTimeout(()=>t(0,$e=!0))))}let ct=null;function tr(Be){ct=Be.point}function rt(Be){if(!ct||G!=="hover")return;let nr=ct.dist(Be.point);ct=null,nr<3&&(t(10,Ee=Be.lngLat),t(4,Jt=Be.features??[]),Ue.isOpen()?t(25,wr="justOpened"):(t(25,wr="opening"),t(0,$e=!0)))}function rr(Be){G!=="hover"||ct||wr!=="normal"||(t(0,$e=!1),t(4,Jt=null))}function ni(Be){if(!(G!=="hover"||ct||wr!=="normal")){if(or(Be)){t(0,$e=!1),t(4,Jt=null);return}t(0,$e=!0),t(4,Jt=Be.features??[]),t(10,Ee=Be.lngLat)}}function cr(Be){if(wr==="justOpened"){t(25,wr="normal");return}if(!z)return;let nr=[Zt,c instanceof mo.Marker?c==null?void 0:c.getElement():null];$e&&Ue.isOpen()&&!nr.some(Te=>Te==null?void 0:Te.contains(Be.originalEvent.target))&&(Be.type==="contextmenu"&&G==="contextmenu"||Be.type!=="contextmenu")&&t(0,$e=!1)}Ei(()=>{u&&(Ue!=null&&Ue.isOpen())&&Ue.remove()});let li;const Bi=()=>t(0,$e=!1);function Se(Be){Wr[Be?"unshift":"push"](()=>{li=Be,t(1,li)})}return n.$$set=Be=>{"closeButton"in Be&&t(11,T=Be.closeButton),"closeOnClickOutside"in Be&&t(12,z=Be.closeOnClickOutside),"closeOnClickInside"in Be&&t(13,F=Be.closeOnClickInside),"closeOnMove"in Be&&t(14,B=Be.closeOnMove),"openOn"in Be&&t(15,G=Be.openOn),"openIfTopMost"in Be&&t(16,J=Be.openIfTopMost),"focusAfterOpen"in Be&&t(17,j=Be.focusAfterOpen),"anchor"in Be&&t(18,V=Be.anchor),"offset"in Be&&t(19,me=Be.offset),"popupClass"in Be&&t(20,X=Be.popupClass),"maxWidth"in Be&&t(21,pe=Be.maxWidth),"lngLat"in Be&&t(10,Ee=Be.lngLat),"html"in Be&&t(22,Pe=Be.html),"open"in Be&&t(0,$e=Be.open),"$$scope"in Be&&t(29,M=Be.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&14336&&t(27,o=T??(!z&&!F)),n.$$.dirty[0]&146685952&&(Ue||(t(23,Ue=new mo.Popup({closeButton:o,closeOnClick:!1,closeOnMove:B,focusAfterOpen:j,maxWidth:pe,className:X,anchor:V,offset:me})),Zt=Ue.getElement(),Ue.on("open",()=>{t(0,$e=!0),Gt(),Ye("open",Ue)}),Ue.on("close",()=>{t(0,$e=!1),Ye("close",Ue)}),Ue.on("hover",()=>{Ye("hover",Ue)}))),n.$$.dirty[0]&8421384&&Ue&&c instanceof mo.Marker&&(G==="click"?c.setPopup(Ue):c.getPopup()===Ue&&c.setPopup(void 0)),n.$$.dirty[0]&268468224&&qt.includes(G)&&(f==null?void 0:f.type)===G&&(Ve(f),zi(at,f=null,f)),n.$$.dirty[0]&268468224&&t(26,l=G==="hover"&&((f==null?void 0:f.type)==="mousemove"||(f==null?void 0:f.type)==="mouseenter")),n.$$.dirty[0]&352354304&&G==="hover"&&at&&(l&&f&&(f.layerType==="deckgl"?(t(10,Ee=f.coordinate),t(4,Jt=f.object?[f.object]:null)):(t(10,Ee=f.lngLat),t(4,Jt=f.features??[]))),t(0,$e=(l||Xe)??!1)),n.$$.dirty[0]&12582914&&(li?Ue.setDOMContent(li):Pe&&Ue.setHTML(Pe)),n.$$.dirty[0]&8389632&&Ee&&Ue.setLngLat(Ee),n.$$.dirty[0]&41943045&&u){let Be=Ue.isOpen();$e&&!Be?(Ue.addTo(u),wr==="opening"&&t(25,wr="justOpened")):!$e&&Be&&Ue.remove()}},[$e,li,u,c,Jt,ve,We,at,mt,k,Ee,T,z,F,B,G,J,j,V,me,X,pe,Pe,Ue,Xe,wr,l,o,f,M,w,Bi,Se]}class ry extends Dt{constructor(e){super(),Ft(this,e,rP,tP,At,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}function iP(n){let e;const t=n[8].default,o=yi(t,n,n[15],null);return{c(){o&&o.c()},l(l){o&&o.l(l)},m(l,u){o&&o.m(l,u),e=!0},p(l,u){o&&o.p&&(!e||u&32768)&&_i(o,t,l,l[15],e?bi(t,l[15],u,null):vi(l[15]),null)},i(l){e||(ae(o,l),e=!0)},o(l){fe(o,l),e=!1},d(l){o&&o.d(l)}}}function nP(n){let e,t;return e=new Yd({props:{id:n[0],type:"raster",source:n[1],beforeId:n[2],beforeLayerType:n[3],paint:n[4],layout:n[5],minzoom:n[6],maxzoom:n[7],$$slots:{default:[iP]},$$scope:{ctx:n}}}),e.$on("click",n[9]),e.$on("dblclick",n[10]),e.$on("contextmenu",n[11]),e.$on("mouseenter",n[12]),e.$on("mousemove",n[13]),e.$on("mouseleave",n[14]),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&1&&(u.id=o[0]),l&2&&(u.source=o[1]),l&4&&(u.beforeId=o[2]),l&8&&(u.beforeLayerType=o[3]),l&16&&(u.paint=o[4]),l&32&&(u.layout=o[5]),l&64&&(u.minzoom=o[6]),l&128&&(u.maxzoom=o[7]),l&32768&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function oP(n,e,t){let{$$slots:o={},$$scope:l}=e,{id:u=pa("raster-layer")}=e,{source:f=void 0}=e,{beforeId:c=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:w}=e,{layout:M=void 0}=e,{minzoom:k=void 0}=e,{maxzoom:T=void 0}=e;function z(V){Er.call(this,n,V)}function F(V){Er.call(this,n,V)}function B(V){Er.call(this,n,V)}function G(V){Er.call(this,n,V)}function J(V){Er.call(this,n,V)}function j(V){Er.call(this,n,V)}return n.$$set=V=>{"id"in V&&t(0,u=V.id),"source"in V&&t(1,f=V.source),"beforeId"in V&&t(2,c=V.beforeId),"beforeLayerType"in V&&t(3,y=V.beforeLayerType),"paint"in V&&t(4,w=V.paint),"layout"in V&&t(5,M=V.layout),"minzoom"in V&&t(6,k=V.minzoom),"maxzoom"in V&&t(7,T=V.maxzoom),"$$scope"in V&&t(15,l=V.$$scope)},[u,f,c,y,w,M,k,T,o,z,F,B,G,J,j,l]}class sP extends Dt{constructor(e){super(),Ft(this,e,oP,nP,At,{id:0,source:1,beforeId:2,beforeLayerType:3,paint:4,layout:5,minzoom:6,maxzoom:7})}}var Ch=Uint8Array,ax=Uint16Array,aP=Int32Array,lP=new Ch([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),cP=new Ch([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),lx=function(n,e){for(var t=new ax(31),o=0;o<31;++o)t[o]=e+=1<>1|(Ir&21845)<<1,Es=(Es&52428)>>2|(Es&13107)<<2,Es=(Es&61680)>>4|(Es&3855)<<4,fP[Ir]=((Es&65280)>>8|(Es&255)<<8)>>1;var Es,Ir,Qd=new Ch(288);for(Ir=0;Ir<144;++Ir)Qd[Ir]=8;var Ir;for(Ir=144;Ir<256;++Ir)Qd[Ir]=9;var Ir;for(Ir=256;Ir<280;++Ir)Qd[Ir]=7;var Ir;for(Ir=280;Ir<288;++Ir)Qd[Ir]=8;var Ir,dP=new Ch(32);for(Ir=0;Ir<32;++Ir)dP[Ir]=5;var Ir,pP=new Ch(0),mP=typeof TextDecoder<"u"&&new TextDecoder,gP=0;try{mP.decode(pP,{stream:!0}),gP=1}catch{}let ro=Yr(null);class yP{constructor(e){Jr(this,"map");Jr(this,"active");Jr(this,"eventListenersSuccess");Jr(this,"eventListenersFailure");Jr(this,"cursor");Jr(this,"onMouseMove",e=>{this.active&&(this.cursor={type:"Feature",properties:{},geometry:{type:"Point",coordinates:Vw(e.lngLat.toArray())}})});Jr(this,"onClick",()=>{if(this.active&&this.cursor){for(let e of this.eventListenersSuccess)e(this.cursor);this.stop()}});Jr(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersFailure=[],this.cursor=null,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),document.removeEventListener("keydown",this.onKeyDown)}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersFailure=[]}start(){this.map.getCanvas().style.cursor="crosshair",this.active=!0}stop(){this.map.getCanvas().style.cursor="inherit",this.cursor=null,this.active=!1}}var vn=63710088e-1,iy={centimeters:vn*100,centimetres:vn*100,degrees:vn/111325,feet:vn*3.28084,inches:vn*39.37,kilometers:vn/1e3,kilometres:vn/1e3,meters:vn,metres:vn,miles:vn/1609.344,millimeters:vn*1e3,millimetres:vn*1e3,nauticalmiles:vn/1852,radians:1,yards:vn*1.0936},_P={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/vn,yards:1.0936133},og={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function vo(n,e,t){t===void 0&&(t={});var o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}function vP(n,e,t){switch(n){case"Point":return hi(e).geometry;case"LineString":return Ri(e).geometry;case"Polygon":return ny(e).geometry;case"MultiPoint":return hx(e).geometry;case"MultiLineString":return ux(e).geometry;case"MultiPolygon":return fx(e).geometry;default:throw new Error(n+" is invalid")}}function hi(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Td(n[0])||!Td(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return vo(o,e,t)}function bP(n,e,t){return t===void 0&&(t={}),go(n.map(function(o){return hi(o,e)}),t)}function ny(n,e,t){t===void 0&&(t={});for(var o=0,l=n;o=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(n*t)/t}function oy(n,e){e===void 0&&(e="kilometers");var t=iy[e];if(!t)throw new Error(e+" units is invalid");return n*t}function Lc(n,e){e===void 0&&(e="kilometers");var t=iy[e];if(!t)throw new Error(e+" units is invalid");return n/t}function EP(n,e){return Ro(Lc(n,e))}function PP(n){var e=n%360;return e<0&&(e+=360),e}function Ro(n){var e=n%(2*Math.PI);return e*180/Math.PI}function ei(n){var e=n%360;return e*Math.PI/180}function MP(n,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("length must be a positive number");return oy(Lc(n,e),t)}function IP(n,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("area must be a positive number");var o=og[e];if(!o)throw new Error("invalid original units");var l=og[t];if(!l)throw new Error("invalid final units");return n/o*l}function Td(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function sy(n){return!!n&&n.constructor===Object}function TP(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(e){if(!Td(e))throw new Error("bbox must only contain numbers")})}function CP(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}const AP=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:og,bearingToAzimuth:PP,convertArea:IP,convertLength:MP,degreesToRadians:ei,earthRadius:vn,factors:iy,feature:vo,featureCollection:go,geometry:vP,geometryCollection:SP,isNumber:Td,isObject:sy,lengthToDegrees:EP,lengthToRadians:Lc,lineString:Ri,lineStrings:wP,multiLineString:ux,multiPoint:hx,multiPolygon:fx,point:hi,points:bP,polygon:ny,polygons:xP,radiansToDegrees:Ro,radiansToLength:oy,round:kP,unitsFactors:_P,validateBBox:TP,validateId:CP},Symbol.toStringTag,{value:"Module"}));function Bn(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function yo(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function sg(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}function dx(n,e,t){if(t===void 0&&(t={}),t.final===!0)return zP(n,e);var o=Bn(n),l=Bn(e),u=ei(o[0]),f=ei(l[0]),c=ei(o[1]),y=ei(l[1]),w=Math.sin(f-u)*Math.cos(y),M=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(f-u);return Ro(Math.atan2(w,M))}function zP(n,e){var t=dx(e,n);return t=(t+180)%360,t}function Ki(n,e,t){t===void 0&&(t={});var o=Bn(n),l=Bn(e),u=ei(l[1]-o[1]),f=ei(l[0]-o[0]),c=ei(o[1]),y=ei(l[1]),w=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(f/2),2)*Math.cos(c)*Math.cos(y);return oy(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),t.units)}function dv(n,e,t,o){o===void 0&&(o={});var l=Bn(n),u=ei(l[0]),f=ei(l[1]),c=ei(t),y=Lc(e,o.units),w=Math.asin(Math.sin(f)*Math.cos(y)+Math.cos(f)*Math.sin(y)*Math.cos(c)),M=u+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(f),Math.cos(y)-Math.sin(f)*Math.sin(w)),k=Ro(M),T=Ro(w);return hi([k,T],o.properties)}function hl(n,e,t){if(n!==null)for(var o,l,u,f,c,y,w,M=0,k=0,T,z=n.type,F=z==="FeatureCollection",B=z==="Feature",G=F?n.features.length:1,J=0;Jy||F>w||B>M){c=k,y=o,w=F,M=B,u=0;return}var G=Ri([c,k],t.properties);if(e(G,o,l,B,u)===!1)return!1;u++,c=k})===!1)return!1}}})}function yx(n,e,t){var o=t,l=!1;return gx(n,function(u,f,c,y,w){l===!1&&t===void 0?o=u:o=e(o,u,f,c,y,w),l=!0}),o}function _x(n,e){if(!n)throw new Error("geojson is required");Ls(n,function(t,o,l){if(t.geometry!==null){var u=t.geometry.type,f=t.geometry.coordinates;switch(u){case"LineString":if(e(t,o,l,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cl?t:l,w=o>u?o:u;return[f,c,y,w]}var ly={exports:{}},vx={exports:{}};(function(n,e){(function(t,o){n.exports=o()})(vc,function(){function t(j,V,me,X,pe){(function Ee(Pe,$e,Ye,ve,We){for(;ve>Ye;){if(ve-Ye>600){var at=ve-Ye+1,mt=$e-Ye+1,Ht=Math.log(at),qt=.5*Math.exp(2*Ht/3),Ue=.5*Math.sqrt(Ht*qt*(at-qt)/at)*(mt-at/2<0?-1:1),Xe=Math.max(Ye,Math.floor($e-mt*qt/at+Ue)),Zt=Math.min(ve,Math.floor($e+(at-mt)*qt/at+Ue));Ee(Pe,$e,Xe,Zt,We)}var Gt=Pe[$e],or=Ye,Jt=ve;for(o(Pe,Ye,$e),We(Pe[ve],Gt)>0&&o(Pe,Ye,ve);or0;)Jt--}We(Pe[Ye],Gt)===0?o(Pe,Ye,Jt):o(Pe,++Jt,ve),Jt<=$e&&(Ye=Jt+1),$e<=Jt&&(ve=Jt-1)}})(j,V,me||0,X||j.length-1,pe||l)}function o(j,V,me){var X=j[V];j[V]=j[me],j[me]=X}function l(j,V){return jV?1:0}var u=function(j){j===void 0&&(j=9),this._maxEntries=Math.max(4,j),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function f(j,V,me){if(!me)return V.indexOf(j);for(var X=0;X=j.minX&&V.maxY>=j.minY}function G(j){return{children:j,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function J(j,V,me,X,pe){for(var Ee=[V,me];Ee.length;)if(!((me=Ee.pop())-(V=Ee.pop())<=X)){var Pe=V+Math.ceil((me-V)/X/2)*X;t(j,Pe,V,me,pe),Ee.push(V,Pe,Pe,me)}}return u.prototype.all=function(){return this._all(this.data,[])},u.prototype.search=function(j){var V=this.data,me=[];if(!B(j,V))return me;for(var X=this.toBBox,pe=[];V;){for(var Ee=0;Ee=0&&pe[V].children.length>this._maxEntries;)this._split(pe,V),V--;this._adjustParentBBoxes(X,pe,V)},u.prototype._split=function(j,V){var me=j[V],X=me.children.length,pe=this._minEntries;this._chooseSplitAxis(me,pe,X);var Ee=this._chooseSplitIndex(me,pe,X),Pe=G(me.children.splice(Ee,me.children.length-Ee));Pe.height=me.height,Pe.leaf=me.leaf,c(me,this.toBBox),c(Pe,this.toBBox),V?j[V-1].children.push(Pe):this._splitRoot(me,Pe)},u.prototype._splitRoot=function(j,V){this.data=G([j,V]),this.data.height=j.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},u.prototype._chooseSplitIndex=function(j,V,me){for(var X,pe,Ee,Pe,$e,Ye,ve,We=1/0,at=1/0,mt=V;mt<=me-V;mt++){var Ht=y(j,0,mt,this.toBBox),qt=y(j,mt,me,this.toBBox),Ue=(pe=Ht,Ee=qt,Pe=void 0,$e=void 0,Ye=void 0,ve=void 0,Pe=Math.max(pe.minX,Ee.minX),$e=Math.max(pe.minY,Ee.minY),Ye=Math.min(pe.maxX,Ee.maxX),ve=Math.min(pe.maxY,Ee.maxY),Math.max(0,Ye-Pe)*Math.max(0,ve-$e)),Xe=T(Ht)+T(qt);Ue=V;We--){var at=j.children[We];w(Pe,j.leaf?pe(at):at),$e+=z(Pe)}return $e},u.prototype._adjustParentBBoxes=function(j,V,me){for(var X=me;X>=0;X--)w(V[X],j)},u.prototype._condense=function(j){for(var V=j.length-1,me=void 0;V>=0;V--)j[V].children.length===0?V>0?(me=j[V-1].children).splice(me.indexOf(j[V]),1):this.clear():c(j[V],this.toBBox)},u})})(vx);var GP=vx.exports;const ZP=Kd(AP),HP=Kd(jP);var pv=Object.prototype.toString,bx=function(e){var t=pv.call(e),o=t==="[object Arguments]";return o||(o=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&pv.call(e.callee)==="[object Function]"),o},Pm,mv;function WP(){if(mv)return Pm;mv=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,o=bx,l=Object.prototype.propertyIsEnumerable,u=!l.call({toString:null},"toString"),f=l.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],y=function(T){var z=T.constructor;return z&&z.prototype===T},w={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},M=function(){if(typeof window>"u")return!1;for(var T in window)try{if(!w["$"+T]&&e.call(window,T)&&window[T]!==null&&typeof window[T]=="object")try{y(window[T])}catch{return!0}}catch{return!0}return!1}(),k=function(T){if(typeof window>"u"||!M)return y(T);try{return y(T)}catch{return!1}};n=function(z){var F=z!==null&&typeof z=="object",B=t.call(z)==="[object Function]",G=o(z),J=F&&t.call(z)==="[object String]",j=[];if(!F&&!B&&!G)throw new TypeError("Object.keys called on a non-object");var V=f&&B;if(J&&z.length>0&&!e.call(z,0))for(var me=0;me0)for(var X=0;X"u"||!Ji?yr:Ji(Uint8Array),ll={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?yr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?yr:ArrayBuffer,"%ArrayIteratorPrototype%":cc&&Ji?Ji([][Symbol.iterator]()):yr,"%AsyncFromSyncIteratorPrototype%":yr,"%AsyncFunction%":dc,"%AsyncGenerator%":dc,"%AsyncGeneratorFunction%":dc,"%AsyncIteratorPrototype%":dc,"%Atomics%":typeof Atomics>"u"?yr:Atomics,"%BigInt%":typeof BigInt>"u"?yr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?yr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?yr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?yr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":gM,"%eval%":eval,"%EvalError%":yM,"%Float32Array%":typeof Float32Array>"u"?yr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?yr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?yr:FinalizationRegistry,"%Function%":Sx,"%GeneratorFunction%":dc,"%Int8Array%":typeof Int8Array>"u"?yr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?yr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?yr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cc&&Ji?Ji(Ji([][Symbol.iterator]())):yr,"%JSON%":typeof JSON=="object"?JSON:yr,"%Map%":typeof Map>"u"?yr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!cc||!Ji?yr:Ji(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?yr:Promise,"%Proxy%":typeof Proxy>"u"?yr:Proxy,"%RangeError%":_M,"%ReferenceError%":vM,"%Reflect%":typeof Reflect>"u"?yr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?yr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!cc||!Ji?yr:Ji(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?yr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cc&&Ji?Ji(""[Symbol.iterator]()):yr,"%Symbol%":cc?Symbol:yr,"%SyntaxError%":Sc,"%ThrowTypeError%":xM,"%TypedArray%":SM,"%TypeError%":gc,"%Uint8Array%":typeof Uint8Array>"u"?yr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?yr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?yr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?yr:Uint32Array,"%URIError%":bM,"%WeakMap%":typeof WeakMap>"u"?yr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?yr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?yr:WeakSet};if(Ji)try{null.error}catch(n){var kM=Ji(Ji(n));ll["%Error.prototype%"]=kM}var EM=function n(e){var t;if(e==="%AsyncFunction%")t=Im("async function () {}");else if(e==="%GeneratorFunction%")t=Im("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Im("async function* () {}");else if(e==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(t=o.prototype)}else if(e==="%AsyncIteratorPrototype%"){var l=n("%AsyncGenerator%");l&&Ji&&(t=Ji(l.prototype))}return ll[e]=t,t},bv={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ah=hy,Cd=wx,PM=Ah.call(Function.call,Array.prototype.concat),MM=Ah.call(Function.apply,Array.prototype.splice),xv=Ah.call(Function.call,String.prototype.replace),Ad=Ah.call(Function.call,String.prototype.slice),IM=Ah.call(Function.call,RegExp.prototype.exec),TM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,CM=/\\(\\)?/g,AM=function(e){var t=Ad(e,0,1),o=Ad(e,-1);if(t==="%"&&o!=="%")throw new Sc("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&t!=="%")throw new Sc("invalid intrinsic syntax, expected opening `%`");var l=[];return xv(e,TM,function(u,f,c,y){l[l.length]=c?xv(y,CM,"$1"):f||u}),l},zM=function(e,t){var o=e,l;if(Cd(bv,o)&&(l=bv[o],o="%"+l[0]+"%"),Cd(ll,o)){var u=ll[o];if(u===dc&&(u=EM(o)),typeof u>"u"&&!t)throw new gc("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:l,name:o,value:u}}throw new Sc("intrinsic "+e+" does not exist!")},as=function(e,t){if(typeof e!="string"||e.length===0)throw new gc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new gc('"allowMissing" argument must be a boolean');if(IM(/^%?[^%]*%?$/,e)===null)throw new Sc("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=AM(e),l=o.length>0?o[0]:"",u=zM("%"+l+"%",t),f=u.name,c=u.value,y=!1,w=u.alias;w&&(l=w[0],MM(o,PM([0,1],w)));for(var M=1,k=!0;M=o.length){var B=al(c,T);k=!!B,k&&"get"in B&&!("originalValue"in B.get)?c=B.get:c=c[T]}else k=Cd(c,T),c=c[T];k&&!y&&(ll[f]=c)}}return c},LM=as,id=LM("%Object.defineProperty%",!0)||!1;if(id)try{id({},"a",{value:1})}catch{id=!1}var fy=id,DM=as,nd=DM("%Object.getOwnPropertyDescriptor%",!0);if(nd)try{nd([],"length")}catch{nd=null}var dy=nd,wv=fy,FM=xx,uc=ga,Sv=dy,py=function(e,t,o){if(!e||typeof e!="object"&&typeof e!="function")throw new uc("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new uc("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new uc("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new uc("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new uc("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new uc("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,y=!!Sv&&Sv(e,t);if(wv)wv(e,t,{configurable:f===null&&y?y.configurable:!f,enumerable:l===null&&y?y.enumerable:!l,value:o,writable:u===null&&y?y.writable:!u});else if(c||!l&&!u&&!f)e[t]=o;else throw new FM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},lg=fy,kx=function(){return!!lg};kx.hasArrayLengthDefineBug=function(){if(!lg)return null;try{return lg([],"length",{value:1}).length!==1}catch{return!0}};var my=kx,RM=cy,BM=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",OM=Object.prototype.toString,$M=Array.prototype.concat,kv=py,NM=function(n){return typeof n=="function"&&OM.call(n)==="[object Function]"},Ex=my(),jM=function(n,e,t,o){if(e in n){if(o===!0){if(n[e]===t)return}else if(!NM(o)||!o())return}Ex?kv(n,e,t,!0):kv(n,e,t)},Px=function(n,e){var t=arguments.length>2?arguments[2]:{},o=RM(e);BM&&(o=$M.call(o,Object.getOwnPropertySymbols(e)));for(var l=0;l4294967295||qM(t)!==t)throw new Mv("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&Pv){var f=Pv(e,"length");f&&!f.configurable&&(l=!1),f&&!f.writable&&(u=!1)}return(l||u||!o)&&(UM?Ev(e,"length",t,!0,!0):Ev(e,"length",t)),e};(function(n){var e=hy,t=as,o=GM,l=ga,u=t("%Function.prototype.apply%"),f=t("%Function.prototype.call%"),c=t("%Reflect.apply%",!0)||e.call(f,u),y=fy,w=t("%Math.max%");n.exports=function(T){if(typeof T!="function")throw new l("a function is required");var z=c(e,f,arguments);return o(z,1+w(0,T.length-(arguments.length-1)),!0)};var M=function(){return c(e,u,arguments)};y?y(n.exports,"apply",{value:M}):n.exports.apply=M})(Mx);var Dc=Mx.exports,Ix=as,Tx=Dc,ZM=Tx(Ix("String.prototype.indexOf")),xo=function(e,t){var o=Ix(e,!!t);return typeof o=="function"&&ZM(e,".prototype.")>-1?Tx(o):o},HM=cy,Cx=ep(),Ax=xo,Iv=Object,WM=Ax("Array.prototype.push"),Tv=Ax("Object.prototype.propertyIsEnumerable"),XM=Cx?Object.getOwnPropertySymbols:null,zx=function(e,t){if(e==null)throw new TypeError("target must be an object");var o=Iv(e);if(arguments.length===1)return o;for(var l=1;l2&&!!arguments[2];return(!o||uI)&&(cI?Cv(e,"name",t,!0,!0):Cv(e,"name",t)),e},dI=fI,pI=ga,mI=Object,Rx=dI(function(){if(this==null||this!==mI(this))throw new pI("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),gI=Rx,yI=fl.supportsDescriptors,_I=Object.getOwnPropertyDescriptor,Bx=function(){if(yI&&/a/mig.flags==="gim"){var e=_I(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var t="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(o,"sticky",{get:function(){t+="y"}}),t==="dy")return e.get}}return gI},vI=fl.supportsDescriptors,bI=Bx,xI=Object.getOwnPropertyDescriptor,wI=Object.defineProperty,SI=TypeError,Av=Object.getPrototypeOf,kI=/a/,EI=function(){if(!vI||!Av)throw new SI("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=bI(),t=Av(kI),o=xI(t,"flags");return(!o||o.get!==e)&&wI(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},PI=fl,MI=Dc,II=Rx,Ox=Bx,TI=EI,$x=MI(Ox());PI($x,{getPolyfill:Ox,implementation:II,shim:TI});var CI=$x,od={exports:{}},AI=ep,dl=function(){return AI()&&!!Symbol.toStringTag},zI=dl(),LI=xo,cg=LI("Object.prototype.toString"),tp=function(e){return zI&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:cg(e)==="[object Arguments]"},Nx=function(e){return tp(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&cg(e)!=="[object Array]"&&cg(e.callee)==="[object Function]"},DI=function(){return tp(arguments)}();tp.isLegacyArguments=Nx;var jx=DI?tp:Nx;const FI={},RI=Object.freeze(Object.defineProperty({__proto__:null,default:FI},Symbol.toStringTag,{value:"Module"})),BI=Kd(RI);var gy=typeof Map=="function"&&Map.prototype,Am=Object.getOwnPropertyDescriptor&&gy?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,zd=gy&&Am&&typeof Am.get=="function"?Am.get:null,zv=gy&&Map.prototype.forEach,yy=typeof Set=="function"&&Set.prototype,zm=Object.getOwnPropertyDescriptor&&yy?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ld=yy&&zm&&typeof zm.get=="function"?zm.get:null,Lv=yy&&Set.prototype.forEach,OI=typeof WeakMap=="function"&&WeakMap.prototype,gh=OI?WeakMap.prototype.has:null,$I=typeof WeakSet=="function"&&WeakSet.prototype,yh=$I?WeakSet.prototype.has:null,NI=typeof WeakRef=="function"&&WeakRef.prototype,Dv=NI?WeakRef.prototype.deref:null,jI=Boolean.prototype.valueOf,VI=Object.prototype.toString,UI=Function.prototype.toString,qI=String.prototype.match,_y=String.prototype.slice,la=String.prototype.replace,GI=String.prototype.toUpperCase,Fv=String.prototype.toLowerCase,Vx=RegExp.prototype.test,Rv=Array.prototype.concat,Qo=Array.prototype.join,ZI=Array.prototype.slice,Bv=Math.floor,ug=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Lm=Object.getOwnPropertySymbols,hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,kc=typeof Symbol=="function"&&typeof Symbol.iterator=="object",bn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===kc||!0)?Symbol.toStringTag:null,Ux=Object.prototype.propertyIsEnumerable,Ov=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function $v(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||Vx.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var o=n<0?-Bv(-n):Bv(n);if(o!==n){var l=String(o),u=_y.call(e,l.length+1);return la.call(l,t,"$&_")+"."+la.call(la.call(u,/([0-9]{3})/g,"$&_"),/_$/,"")}}return la.call(e,t,"$&_")}var fg=BI,Nv=fg.custom,jv=Gx(Nv)?Nv:null,HI=function n(e,t,o,l){var u=t||{};if(sa(u,"quoteStyle")&&u.quoteStyle!=="single"&&u.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(sa(u,"maxStringLength")&&(typeof u.maxStringLength=="number"?u.maxStringLength<0&&u.maxStringLength!==1/0:u.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=sa(u,"customInspect")?u.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(sa(u,"indent")&&u.indent!==null&&u.indent!==" "&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(sa(u,"numericSeparator")&&typeof u.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=u.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Hx(e,u);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var y=String(e);return c?$v(e,y):y}if(typeof e=="bigint"){var w=String(e)+"n";return c?$v(e,w):w}var M=typeof u.depth>"u"?5:u.depth;if(typeof o>"u"&&(o=0),o>=M&&M>0&&typeof e=="object")return dg(e)?"[Array]":"[Object]";var k=hT(u,o);if(typeof l>"u")l=[];else if(Zx(l,e)>=0)return"[Circular]";function T(at,mt,Ht){if(mt&&(l=ZI.call(l),l.push(mt)),Ht){var qt={depth:u.depth};return sa(u,"quoteStyle")&&(qt.quoteStyle=u.quoteStyle),n(at,qt,o+1,l)}return n(at,u,o+1,l)}if(typeof e=="function"&&!Vv(e)){var z=rT(e),F=Gf(e,T);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(F.length>0?" { "+Qo.call(F,", ")+" }":"")}if(Gx(e)){var B=kc?la.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):hg.call(e);return typeof e=="object"&&!kc?Qu(B):B}if(lT(e)){for(var G="<"+Fv.call(String(e.nodeName)),J=e.attributes||[],j=0;j",G}if(dg(e)){if(e.length===0)return"[]";var V=Gf(e,T);return k&&!uT(V)?"["+pg(V,k)+"]":"[ "+Qo.call(V,", ")+" ]"}if(JI(e)){var me=Gf(e,T);return!("cause"in Error.prototype)&&"cause"in e&&!Ux.call(e,"cause")?"{ ["+String(e)+"] "+Qo.call(Rv.call("[cause]: "+T(e.cause),me),", ")+" }":me.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Qo.call(me,", ")+" }"}if(typeof e=="object"&&f){if(jv&&typeof e[jv]=="function"&&fg)return fg(e,{depth:M-o});if(f!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(iT(e)){var X=[];return zv&&zv.call(e,function(at,mt){X.push(T(mt,e,!0)+" => "+T(at,e))}),Uv("Map",zd.call(e),X,k)}if(sT(e)){var pe=[];return Lv&&Lv.call(e,function(at){pe.push(T(at,e))}),Uv("Set",Ld.call(e),pe,k)}if(nT(e))return Dm("WeakMap");if(aT(e))return Dm("WeakSet");if(oT(e))return Dm("WeakRef");if(YI(e))return Qu(T(Number(e)));if(eT(e))return Qu(T(ug.call(e)));if(QI(e))return Qu(jI.call(e));if(KI(e))return Qu(T(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof vc<"u"&&e===vc)return"{ [object globalThis] }";if(!XI(e)&&!Vv(e)){var Ee=Gf(e,T),Pe=Ov?Ov(e)===Object.prototype:e instanceof Object||e.constructor===Object,$e=e instanceof Object?"":"null prototype",Ye=!Pe&&bn&&Object(e)===e&&bn in e?_y.call(ya(e),8,-1):$e?"Object":"",ve=Pe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",We=ve+(Ye||$e?"["+Qo.call(Rv.call([],Ye||[],$e||[]),": ")+"] ":"");return Ee.length===0?We+"{}":k?We+"{"+pg(Ee,k)+"}":We+"{ "+Qo.call(Ee,", ")+" }"}return String(e)};function qx(n,e,t){var o=(t.quoteStyle||e)==="double"?'"':"'";return o+n+o}function WI(n){return la.call(String(n),/"/g,""")}function dg(n){return ya(n)==="[object Array]"&&(!bn||!(typeof n=="object"&&bn in n))}function XI(n){return ya(n)==="[object Date]"&&(!bn||!(typeof n=="object"&&bn in n))}function Vv(n){return ya(n)==="[object RegExp]"&&(!bn||!(typeof n=="object"&&bn in n))}function JI(n){return ya(n)==="[object Error]"&&(!bn||!(typeof n=="object"&&bn in n))}function KI(n){return ya(n)==="[object String]"&&(!bn||!(typeof n=="object"&&bn in n))}function YI(n){return ya(n)==="[object Number]"&&(!bn||!(typeof n=="object"&&bn in n))}function QI(n){return ya(n)==="[object Boolean]"&&(!bn||!(typeof n=="object"&&bn in n))}function Gx(n){if(kc)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!hg)return!1;try{return hg.call(n),!0}catch{}return!1}function eT(n){if(!n||typeof n!="object"||!ug)return!1;try{return ug.call(n),!0}catch{}return!1}var tT=Object.prototype.hasOwnProperty||function(n){return n in this};function sa(n,e){return tT.call(n,e)}function ya(n){return VI.call(n)}function rT(n){if(n.name)return n.name;var e=qI.call(UI.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function Zx(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,o=n.length;te.maxStringLength){var t=n.length-e.maxStringLength,o="... "+t+" more character"+(t>1?"s":"");return Hx(_y.call(n,0,e.maxStringLength),e)+o}var l=la.call(la.call(n,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,cT);return qx(l,"single",e)}function cT(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+GI.call(e.toString(16))}function Qu(n){return"Object("+n+")"}function Dm(n){return n+" { ? }"}function Uv(n,e,t,o){var l=o?pg(t,o):Qo.call(t,", ");return n+" ("+e+") {"+l+"}"}function uT(n){for(var e=0;e=0)return!1;return!0}function hT(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=Qo.call(Array(n.indent+1)," ");else return null;return{base:t,prev:Qo.call(Array(e+1),t)}}function pg(n,e){if(n.length===0)return"";var t=` `+e.prev+e.base;return t+Qo.call(n,","+t)+` -`+e.prev}function Gf(n,e){var t=dg(n),o=[];if(t){o.length=n.length;for(var l=0;l=o)return t+1;var l=Kv(e,t);if(l<55296||l>56319)return t+1;var u=Kv(e,t+1);return u<56320||u>57343?t+1:t+2},Rm=function(e){var t=0;return{next:function(){var l=t>=e.length,u;return l||(u=e[t],t+=1),{done:l,value:u}}}},Yv=function(e,t){if(FT(e)||Hv(e))return Rm(e);if(RT(e)){var o=0;return{next:function(){var u=NT(e,o),f=$T(e,o,u);return o=u,{done:u>e.length,value:f}}}}if(t&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()};if(!BT&&!OT)od.exports=function(e){if(e!=null)return Yv(e,!0)};else{var jT=Qx,VT=tw,Qv=Ao("Map.prototype.forEach",!0),e1=Ao("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var t1=Ao("Map.prototype.iterator",!0),r1=Ao("Set.prototype.iterator",!0);var i1=Ao("Map.prototype.@@iterator",!0)||Ao("Map.prototype._es6-shim iterator_",!0),n1=Ao("Set.prototype.@@iterator",!0)||Ao("Set.prototype._es6-shim iterator_",!0),UT=function(e){if(jT(e)){if(t1)return Wv(t1(e));if(i1)return i1(e);if(Qv){var t=[];return Qv(e,function(l,u){Jv(t,[u,l])}),Rm(t)}}if(VT(e)){if(r1)return Wv(r1(e));if(n1)return n1(e);if(e1){var o=[];return e1(e,function(l){Jv(o,l)}),Rm(o)}}};od.exports=function(e){return UT(e)||Yv(e)}}}var qT=od.exports,o1=function(n){return n!==n},rw=function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||o1(e)&&o1(t))},GT=rw,iw=function(){return typeof Object.is=="function"?Object.is:GT},ZT=iw,HT=fl,WT=function(){var e=ZT();return HT(Object,{is:e},{is:function(){return Object.is!==e}}),e},XT=fl,JT=Dc,KT=rw,nw=iw,YT=WT,ow=JT(nw(),Object);XT(ow,{getPolyfill:nw,implementation:KT,shim:YT});var QT=ow,eC=Dc,sw=xo,tC=ss,mg=tC("%ArrayBuffer%",!0),sd=sw("ArrayBuffer.prototype.byteLength",!0),rC=sw("Object.prototype.toString"),s1=!!mg&&!sd&&new mg(0).slice,a1=!!s1&&eC(s1),aw=sd||a1?function(e){if(!e||typeof e!="object")return!1;try{return sd?sd(e):a1(e,0),!0}catch{return!1}}:mg?function(e){return rC(e)==="[object ArrayBuffer]"}:function(e){return!1},iC=Date.prototype.getDay,nC=function(e){try{return iC.call(e),!0}catch{return!1}},oC=Object.prototype.toString,sC="[object Date]",aC=dl(),lC=function(e){return typeof e!="object"||e===null?!1:aC?nC(e):oC.call(e)===sC},gg=xo,lw=dl(),cw,uw,yg,_g;if(lw){cw=gg("Object.prototype.hasOwnProperty"),uw=gg("RegExp.prototype.exec"),yg={};var Bm=function(){throw yg};_g={toString:Bm,valueOf:Bm},typeof Symbol.toPrimitive=="symbol"&&(_g[Symbol.toPrimitive]=Bm)}var cC=gg("Object.prototype.toString"),uC=Object.getOwnPropertyDescriptor,hC="[object RegExp]",fC=lw?function(e){if(!e||typeof e!="object")return!1;var t=uC(e,"lastIndex"),o=t&&cw(t,"value");if(!o)return!1;try{uw(e,_g)}catch(l){return l===yg}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:cC(e)===hC},dC=xo,l1=dC("SharedArrayBuffer.prototype.byteLength",!0),pC=l1?function(e){if(!e||typeof e!="object")return!1;try{return l1(e),!0}catch{return!1}}:function(e){return!1},mC=Number.prototype.toString,gC=function(e){try{return mC.call(e),!0}catch{return!1}},yC=Object.prototype.toString,_C="[object Number]",vC=dl(),bC=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:vC?gC(e):yC.call(e)===_C},hw=xo,xC=hw("Boolean.prototype.toString"),wC=hw("Object.prototype.toString"),SC=function(e){try{return xC(e),!0}catch{return!1}},kC="[object Boolean]",EC=dl(),PC=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:EC&&Symbol.toStringTag in e?SC(e):wC(e)===kC},vg={exports:{}},MC=Object.prototype.toString,IC=uy();if(IC){var TC=Symbol.prototype.toString,CC=/^Symbol\(.*\)$/,AC=function(e){return typeof e.valueOf()!="symbol"?!1:CC.test(TC.call(e))};vg.exports=function(e){if(typeof e=="symbol")return!0;if(MC.call(e)!=="[object Symbol]")return!1;try{return AC(e)}catch{return!1}}}else vg.exports=function(e){return!1};var zC=vg.exports,bg={exports:{}},c1=typeof BigInt<"u"&&BigInt,LC=function(){return typeof c1=="function"&&typeof BigInt=="function"&&typeof c1(42)=="bigint"&&typeof BigInt(42)=="bigint"},DC=LC();if(DC){var FC=BigInt.prototype.valueOf,RC=function(e){try{return FC.call(e),!0}catch{}return!1};bg.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:RC(e)}}else bg.exports=function(e){return!1};var BC=bg.exports,OC=Kx,$C=bC,NC=PC,jC=zC,VC=BC,UC=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(OC(e))return"String";if($C(e))return"Number";if(NC(e))return"Boolean";if(jC(e))return"Symbol";if(VC(e))return"BigInt"},Rd=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,u1=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Bd;Rd||(Bd=function(e){return!1});var xg=Rd?Rd.prototype.has:null,Om=u1?u1.prototype.has:null;!Bd&&!xg&&(Bd=function(e){return!1});var qC=Bd||function(e){if(!e||typeof e!="object")return!1;try{if(xg.call(e,xg),Om)try{Om.call(e,Om)}catch{return!0}return e instanceof Rd}catch{}return!1},wg={exports:{}},GC=ss,fw=xo,ZC=GC("%WeakSet%",!0),$m=fw("WeakSet.prototype.has",!0);if($m){var Nm=fw("WeakMap.prototype.has",!0);wg.exports=function(e){if(!e||typeof e!="object")return!1;try{if($m(e,$m),Nm)try{Nm(e,Nm)}catch{return!0}return e instanceof ZC}catch{}return!1}}else wg.exports=function(e){return!1};var HC=wg.exports,WC=Qx,XC=tw,JC=qC,KC=HC,YC=function(e){if(e&&typeof e=="object"){if(WC(e))return"Map";if(XC(e))return"Set";if(JC(e))return"WeakMap";if(KC(e))return"WeakSet"}return!1},dw=Function.prototype.toString,mc=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Sg,ad;if(typeof mc=="function"&&typeof Object.defineProperty=="function")try{Sg=Object.defineProperty({},"length",{get:function(){throw ad}}),ad={},mc(function(){throw 42},null,Sg)}catch(n){n!==ad&&(mc=null)}else mc=null;var QC=/^\s*class\b/,kg=function(e){try{var t=dw.call(e);return QC.test(t)}catch{return!1}},jm=function(e){try{return kg(e)?!1:(dw.call(e),!0)}catch{return!1}},ld=Object.prototype.toString,eA="[object Object]",tA="[object Function]",rA="[object GeneratorFunction]",iA="[object HTMLAllCollection]",nA="[object HTML document.all class]",oA="[object HTMLCollection]",sA=typeof Symbol=="function"&&!!Symbol.toStringTag,aA=!(0 in[,]),Eg=function(){return!1};if(typeof document=="object"){var lA=document.all;ld.call(lA)===ld.call(document.all)&&(Eg=function(e){if((aA||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=ld.call(e);return(t===iA||t===nA||t===oA||t===eA)&&e("")==null}catch{}return!1})}var cA=mc?function(e){if(Eg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{mc(e,null,Sg)}catch(t){if(t!==ad)return!1}return!kg(e)&&jm(e)}:function(e){if(Eg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(sA)return jm(e);if(kg(e))return!1;var t=ld.call(e);return t!==tA&&t!==rA&&!/^\[object HTML/.test(t)?!1:jm(e)},uA=cA,hA=Object.prototype.toString,pw=Object.prototype.hasOwnProperty,fA=function(e,t,o){for(var l=0,u=e.length;l=3&&(l=o),hA.call(e)==="[object Array]"?fA(e,t,l):typeof e=="string"?dA(e,t,l):pA(e,t,l)},gA=mA,yA=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Vm=yA,_A=typeof globalThis>"u"?vc:globalThis,vA=function(){for(var e=[],t=0;t"u"?vc:globalThis,Pg=bA(),ky=Sy("String.prototype.slice"),Um=Object.getPrototypeOf,wA=Sy("Array.prototype.indexOf",!0)||function(e,t){for(var o=0;o-1?t:t!=="Object"?!1:kA(e)}return cd?SA(e):null},PA=xo,d1=PA("ArrayBuffer.prototype.byteLength",!0),MA=aw,IA=function(e){return MA(e)?d1?d1(e):e.byteLength:NaN},gw=sI,as=xo,p1=CI,TA=ss,Ec=qT,CA=Xx,m1=QT,g1=jx,y1=Jx,_1=aw,v1=lC,b1=fC,x1=pC,w1=cy,S1=UC,k1=YC,E1=EA,P1=IA,M1=as("SharedArrayBuffer.prototype.byteLength",!0),I1=as("Date.prototype.getTime"),qm=Object.getPrototypeOf,T1=as("Object.prototype.toString"),Nd=TA("%Set%",!0),Mg=as("Map.prototype.has",!0),jd=as("Map.prototype.get",!0),C1=as("Map.prototype.size",!0),Vd=as("Set.prototype.add",!0),yw=as("Set.prototype.delete",!0),Ud=as("Set.prototype.has",!0),ud=as("Set.prototype.size",!0);function A1(n,e,t,o){for(var l=Ec(n),u;(u=l.next())&&!u.done;)if(Fo(e,u.value,t,o))return yw(n,u.value),!0;return!1}function _w(n){if(typeof n>"u")return null;if(typeof n!="object")return typeof n=="symbol"?!1:typeof n=="string"||typeof n=="number"?+n==+n:!0}function AA(n,e,t,o,l,u){var f=_w(t);if(f!=null)return f;var c=jd(e,f),y=gw({},l,{strict:!1});return typeof c>"u"&&!Mg(e,f)||!Fo(o,c,y,u)?!1:!Mg(n,f)&&Fo(o,c,y,u)}function zA(n,e,t){var o=_w(t);return o??(Ud(e,o)&&!Ud(n,o))}function z1(n,e,t,o,l,u){for(var f=Ec(n),c,y;(c=f.next())&&!c.done;)if(y=c.value,Fo(t,y,l,u)&&Fo(o,jd(e,y),l,u))return yw(n,y),!0;return!1}function Fo(n,e,t,o){var l=t||{};if(l.strict?m1(n,e):n===e)return!0;var u=S1(n),f=S1(e);if(u!==f)return!1;if(!n||!e||typeof n!="object"&&typeof e!="object")return l.strict?m1(n,e):n==e;var c=o.has(n),y=o.has(e),w;if(c&&y){if(o.get(n)===o.get(e))return!0}else w={};return c||o.set(n,w),y||o.set(e,w),FA(n,e,l,o)}function L1(n){return!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number"?!1:!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))}function LA(n,e,t,o){if(ud(n)!==ud(e))return!1;for(var l=Ec(n),u=Ec(e),f,c,y;(f=l.next())&&!f.done;)if(f.value&&typeof f.value=="object")y||(y=new Nd),Vd(y,f.value);else if(!Ud(e,f.value)){if(t.strict||!zA(n,e,f.value))return!1;y||(y=new Nd),Vd(y,f.value)}if(y){for(;(c=u.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!A1(y,c.value,t.strict,o))return!1}else if(!t.strict&&!Ud(n,c.value)&&!A1(y,c.value,t.strict,o))return!1;return ud(y)===0}return!0}function DA(n,e,t,o){if(C1(n)!==C1(e))return!1;for(var l=Ec(n),u=Ec(e),f,c,y,w,M,k;(f=l.next())&&!f.done;)if(w=f.value[0],M=f.value[1],w&&typeof w=="object")y||(y=new Nd),Vd(y,w);else if(k=jd(e,w),typeof k>"u"&&!Mg(e,w)||!Fo(M,k,t,o)){if(t.strict||!AA(n,e,w,M,t,o))return!1;y||(y=new Nd),Vd(y,w)}if(y){for(;(c=u.next())&&!c.done;)if(w=c.value[0],k=c.value[1],w&&typeof w=="object"){if(!z1(y,n,w,k,t,o))return!1}else if(!t.strict&&(!n.has(w)||!Fo(jd(n,w),k,t,o))&&!z1(y,n,w,k,gw({},t,{strict:!1}),o))return!1;return ud(y)===0}return!0}function FA(n,e,t,o){var l,u;if(typeof n!=typeof e||n==null||e==null||T1(n)!==T1(e)||g1(n)!==g1(e))return!1;var f=y1(n),c=y1(e);if(f!==c)return!1;var y=n instanceof Error,w=e instanceof Error;if(y!==w||(y||w)&&(n.name!==e.name||n.message!==e.message))return!1;var M=b1(n),k=b1(e);if(M!==k||(M||k)&&(n.source!==e.source||p1(n)!==p1(e)))return!1;var T=v1(n),z=v1(e);if(T!==z||(T||z)&&I1(n)!==I1(e)||t.strict&&qm&&qm(n)!==qm(e))return!1;var F=E1(n),B=E1(e);if(F!==B)return!1;if(F||B){if(n.length!==e.length)return!1;for(l=0;l=0;l--)if(pe[l]!=Ee[l])return!1;for(l=pe.length-1;l>=0;l--)if(u=pe[l],!Fo(n[u],e[u],t,o))return!1;var Pe=k1(n),$e=k1(e);return Pe!==$e?!1:Pe==="Set"||$e==="Set"?LA(n,e,t,o):Pe==="Map"?DA(n,e,t,o):!0}var RA=function(e,t,o){return Fo(e,t,o,CA())};const zh=Yg(RA);var BA=Object.defineProperty,Dr=(n,e)=>BA(n,"name",{value:e,configurable:!0}),OA=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!nh(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Ig(e),l=Ig(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return nh(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return nh(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Dr(OA,"GeojsonEquality");function nh(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Dr(nh,"sameLength");function Ig(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Dr(Ig,"explode");var Xn=63710088e-1,vw={centimeters:Xn*100,centimetres:Xn*100,degrees:360/(2*Math.PI),feet:Xn*3.28084,inches:Xn*39.37,kilometers:Xn/1e3,kilometres:Xn/1e3,meters:Xn,metres:Xn,miles:Xn/1609.344,millimeters:Xn*1e3,millimetres:Xn*1e3,nauticalmiles:Xn/1852,radians:1,yards:Xn*1.0936},D1={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function ns(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Dr(ns,"feature");function $A(n,e,t={}){switch(n){case"Point":return Ps(e).geometry;case"LineString":return Ts(e).geometry;case"Polygon":return Ey(e).geometry;case"MultiPoint":return xw(e).geometry;case"MultiLineString":return bw(e).geometry;case"MultiPolygon":return ww(e).geometry;default:throw new Error(n+" is invalid")}}Dr($A,"geometry");function Ps(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!qd(n[0])||!qd(n[1]))throw new Error("coordinates must contain numbers");return ns({type:"Point",coordinates:n},e,t)}Dr(Ps,"point");function NA(n,e,t={}){return rp(n.map(o=>Ps(o,e)),t)}Dr(NA,"points");function Ey(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uEy(o,e)),t)}Dr(jA,"polygons");function Ts(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return ns({type:"LineString",coordinates:n},e,t)}Dr(Ts,"lineString");function VA(n,e,t={}){return rp(n.map(o=>Ts(o,e)),t)}Dr(VA,"lineStrings");function rp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Dr(rp,"featureCollection");function bw(n,e,t={}){return ns({type:"MultiLineString",coordinates:n},e,t)}Dr(bw,"multiLineString");function xw(n,e,t={}){return ns({type:"MultiPoint",coordinates:n},e,t)}Dr(xw,"multiPoint");function ww(n,e,t={}){return ns({type:"MultiPolygon",coordinates:n},e,t)}Dr(ww,"multiPolygon");function UA(n,e,t={}){return ns({type:"GeometryCollection",geometries:n},e,t)}Dr(UA,"geometryCollection");function qA(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Dr(qA,"round");function Sw(n,e="kilometers"){const t=vw[e];if(!t)throw new Error(e+" units is invalid");return n*t}Dr(Sw,"radiansToLength");function Py(n,e="kilometers"){const t=vw[e];if(!t)throw new Error(e+" units is invalid");return n/t}Dr(Py,"lengthToRadians");function GA(n,e){return kw(Py(n,e))}Dr(GA,"lengthToDegrees");function ZA(n){let e=n%360;return e<0&&(e+=360),e}Dr(ZA,"bearingToAzimuth");function kw(n){return n%(2*Math.PI)*180/Math.PI}Dr(kw,"radiansToDegrees");function HA(n){return n%360*Math.PI/180}Dr(HA,"degreesToRadians");function WA(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return Sw(Py(n,e),t)}Dr(WA,"convertLength");function XA(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=D1[e];if(!o)throw new Error("invalid original units");const l=D1[t];if(!l)throw new Error("invalid final units");return n/o*l}Dr(XA,"convertArea");function qd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Dr(qd,"isNumber");function My(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Dr(My,"isObject");function JA(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!qd(e))throw new Error("bbox must only contain numbers")})}Dr(JA,"validateBBox");function KA(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Dr(KA,"validateId");var YA=Object.defineProperty,an=(n,e)=>YA(n,"name",{value:e,configurable:!0});function Rc(n,e,t){if(n!==null)for(var o,l,u,f,c,y,w,M=0,k=0,T,z=n.type,F=z==="FeatureCollection",B=z==="Feature",G=F?n.features.length:1,J=0;Jy||F>w||B>M){c=k,y=o,w=F,M=B,u=0;return}var G=Ts([c,k],t.properties);if(e(G,o,l,B,u)===!1)return!1;u++,c=k})===!1)return!1}}})}an(Mw,"segmentEach");function o3(n,e,t){var o=t,l=!1;return Mw(n,function(u,f,c,y,w){l===!1&&t===void 0?o=u:o=e(o,u,f,c,y,w),l=!0}),o}an(o3,"segmentReduce");function Iw(n,e){if(!n)throw new Error("geojson is required");ip(n,function(t,o,l){if(t.geometry!==null){var u=t.geometry.type,f=t.geometry.coordinates;switch(u){case"LineString":if(e(t,o,l,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cc3(n,"name",{value:e,configurable:!0});function Ty(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return Rc(n,o=>{t[0]>o[0]&&(t[0]=o[0]),t[1]>o[1]&&(t[1]=o[1]),t[2] line1 must only contain 2 coordinates");if(o.length!==2)throw new Error(" line2 must only contain 2 coordinates");var l=t[0][0],u=t[0][1],f=t[1][0],c=t[1][1],y=o[0][0],w=o[0][1],M=o[1][0],k=o[1][1],T=(k-w)*(f-l)-(M-y)*(c-u),z=(M-y)*(u-w)-(k-w)*(l-y),F=(f-l)*(u-w)-(c-u)*(l-y);if(T===0)return null;var B=z/T,G=F/T;if(B>=0&&B<=1&&G>=0&&G<=1){var J=l+B*(f-l),j=u+B*(c-u);return hi([J,j])}return null}function m3(n,e,t){t===void 0&&(t={});var o=hi([1/0,1/0],{dist:1/0}),l=0;return Ls(n,function(u){for(var f=yo(u),c=0;c0&&(G=B.features[0],G.properties.dist=Ki(e,G,t),G.properties.location=l+Ki(y,G,t)),y.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(e);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let t=this.dragFrom[0]-e.lngLat.lng,o=this.dragFrom[1]-e.lngLat.lat;for(let l of this.points)l[0]-=t,l[1]-=o}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});Xr(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let t=[];if(B1(this.points).forEach((o,l)=>{t.push([l+1,m3(o,this.cursor).properties.dist])}),t.sort((o,l)=>o[1]-l[1]),t.length>0){let o=t[0][0];this.points.splice(o,0,this.cursor.geometry.coordinates),this.hover=o}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(e))});Xr(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=Gm(e.lngLat.toArray()),this.onClick(e),this.finish())});Xr(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});Xr(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});Xr(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});Xr(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let e=this.polygonFeature();if(e)for(let t of this.eventListenersSuccess)t(e);else for(let t of this.eventListenersFailure)t();this.stop()}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(e){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let e=Lw();this.points.forEach((l,u)=>{let f=Gm(l);f.properties.hover=this.hover==u,f.properties.idx=u,e.features.push(f)}),e.features=e.features.concat(B1(this.points));let t=this.polygonFeature();t&&(t.properties.hover=this.hover=="polygon",e.features.push(t)),Fw.set(e);let o="crosshair";this.hover!=null&&(o=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=o,Rw.set(this.previousStates.length)}pointsUpdated(){let e=this.polygonFeature();if(e)for(let t of this.eventListenersUpdated)t(e)}recalculateHovering(e){this.cursor=null,this.hover=null;for(let t of this.map.queryRenderedFeatures(e.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(t.geometry.type=="Polygon"){this.hover="polygon";break}else if(t.geometry.type=="Point"&&Object.hasOwn(t.properties,"idx")){this.hover=t.properties.idx;break}this.hover==null&&(this.cursor=Gm(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(Dw),t=[JSON.parse(JSON.stringify(e))];return t[0].push(JSON.parse(JSON.stringify(t[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>g3&&this.previousStates.shift()}}function B1(n){let e=[];for(let t=0;t=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[n[n.length-1],n[0]]},properties:{}}),e}let $t;const Bw=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Bw.decode();let oh=null;function _h(){return(oh===null||oh.byteLength===0)&&(oh=new Uint8Array($t.memory.buffer)),oh}function Ms(n,e){return n=n>>>0,Bw.decode(_h().subarray(n,n+e))}const Is=new Array(128).fill(void 0);Is.push(void 0,null,!0,!1);let vh=Is.length;function Fi(n){vh===Is.length&&Is.push(Is.length+1);const e=vh;return vh=Is[e],Is[e]=n,e}function lr(n){return Is[n]}function _3(n){n<132||(Is[n]=vh,vh=n)}function hd(n){const e=lr(n);return _3(n),e}function Zm(n){return n==null}let sh=null;function v3(){return(sh===null||sh.byteLength===0)&&(sh=new Float64Array($t.memory.buffer)),sh}let ah=null;function Jr(){return(ah===null||ah.byteLength===0)&&(ah=new Int32Array($t.memory.buffer)),ah}let ca=0;const fd=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},b3=typeof fd.encodeInto=="function"?function(n,e){return fd.encodeInto(n,e)}:function(n,e){const t=fd.encode(n);return e.set(t),{read:n.length,written:t.length}};function Wf(n,e,t){if(t===void 0){const c=fd.encode(n),y=e(c.length,1)>>>0;return _h().subarray(y,y+c.length).set(c),ca=c.length,y}let o=n.length,l=e(o,1)>>>0;const u=_h();let f=0;for(;f127)break;u[l+f]=c}if(f!==o){f!==0&&(n=n.slice(f)),l=t(l,o,o=f+n.length*3,1)>>>0;const c=_h().subarray(l+f,l+o),y=b3(n,c);f+=y.written}return ca=f,l}function Tg(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const l=n.description;return l==null?"Symbol":`Symbol(${l})`}if(e=="function"){const l=n.name;return typeof l=="string"&&l.length>0?`Function(${l})`:"Function"}if(Array.isArray(n)){const l=n.length;let u="[";l>0&&(u+=Tg(n[0]));for(let f=1;f1)o=t[1];else return toString.call(n);if(o=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:o}function x3(n,e){const t=e(n.length*1,1)>>>0;return _h().set(n,t/1),ca=n.length,t}function Hm(n,e){try{return n.apply(this,e)}catch(t){$t.__wbindgen_exn_store(Fi(t))}}class Gd{static __wrap(e){e=e>>>0;const t=Object.create(Gd.prototype);return t.__wbg_ptr=e,t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();$t.__wbg_jsroutesnapper_free(e)}constructor(e){try{const u=$t.__wbindgen_add_to_stack_pointer(-16),f=x3(e,$t.__wbindgen_malloc),c=ca;$t.jsroutesnapper_new(u,f,c);var t=Jr()[u/4+0],o=Jr()[u/4+1],l=Jr()[u/4+2];if(l)throw hd(o);return Gd.__wrap(t)}finally{$t.__wbindgen_add_to_stack_pointer(16)}}setRouteConfig(e){$t.jsroutesnapper_setRouteConfig(this.__wbg_ptr,Fi(e))}setAreaMode(){$t.jsroutesnapper_setAreaMode(this.__wbg_ptr)}getConfig(){let e,t;try{const u=$t.__wbindgen_add_to_stack_pointer(-16);$t.jsroutesnapper_getConfig(u,this.__wbg_ptr);var o=Jr()[u/4+0],l=Jr()[u/4+1];return e=o,t=l,Ms(o,l)}finally{$t.__wbindgen_add_to_stack_pointer(16),$t.__wbindgen_free(e,t,1)}}toFinalFeature(){try{const o=$t.__wbindgen_add_to_stack_pointer(-16);$t.jsroutesnapper_toFinalFeature(o,this.__wbg_ptr);var e=Jr()[o/4+0],t=Jr()[o/4+1];let l;return e!==0&&(l=Ms(e,t).slice(),$t.__wbindgen_free(e,t*1)),l}finally{$t.__wbindgen_add_to_stack_pointer(16)}}renderGeojson(){let e,t;try{const u=$t.__wbindgen_add_to_stack_pointer(-16);$t.jsroutesnapper_renderGeojson(u,this.__wbg_ptr);var o=Jr()[u/4+0],l=Jr()[u/4+1];return e=o,t=l,Ms(o,l)}finally{$t.__wbindgen_add_to_stack_pointer(16),$t.__wbindgen_free(e,t,1)}}toggleSnapMode(){$t.jsroutesnapper_toggleSnapMode(this.__wbg_ptr)}onMouseMove(e,t,o){return $t.jsroutesnapper_onMouseMove(this.__wbg_ptr,e,t,o)!==0}onClick(){$t.jsroutesnapper_onClick(this.__wbg_ptr)}onDragStart(){return $t.jsroutesnapper_onDragStart(this.__wbg_ptr)!==0}onMouseUp(){return $t.jsroutesnapper_onMouseUp(this.__wbg_ptr)!==0}clearState(){$t.jsroutesnapper_clearState(this.__wbg_ptr)}editExisting(e){try{const l=$t.__wbindgen_add_to_stack_pointer(-16);$t.jsroutesnapper_editExisting(l,this.__wbg_ptr,Fi(e));var t=Jr()[l/4+0],o=Jr()[l/4+1];if(o)throw hd(t)}finally{$t.__wbindgen_add_to_stack_pointer(16)}}debugRenderGraph(){let e,t;try{const u=$t.__wbindgen_add_to_stack_pointer(-16);$t.jsroutesnapper_debugRenderGraph(u,this.__wbg_ptr);var o=Jr()[u/4+0],l=Jr()[u/4+1];return e=o,t=l,Ms(o,l)}finally{$t.__wbindgen_add_to_stack_pointer(16),$t.__wbindgen_free(e,t,1)}}routeNameForWaypoints(e){let t,o;try{const M=$t.__wbindgen_add_to_stack_pointer(-16);$t.jsroutesnapper_routeNameForWaypoints(M,this.__wbg_ptr,Fi(e));var l=Jr()[M/4+0],u=Jr()[M/4+1],f=Jr()[M/4+2],c=Jr()[M/4+3],y=l,w=u;if(c)throw y=0,w=0,hd(f);return t=y,o=w,Ms(y,w)}finally{$t.__wbindgen_add_to_stack_pointer(16),$t.__wbindgen_free(t,o,1)}}addSnappedWaypoint(e,t){$t.jsroutesnapper_addSnappedWaypoint(this.__wbg_ptr,e,t)}undo(){$t.jsroutesnapper_undo(this.__wbg_ptr)}}async function w3(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(o){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o);else throw o}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function S3(){const n={};return n.wbg={},n.wbg.__wbindgen_string_new=function(e,t){const o=Ms(e,t);return Fi(o)},n.wbg.__wbindgen_object_drop_ref=function(e){hd(e)},n.wbg.__wbindgen_error_new=function(e,t){const o=new Error(Ms(e,t));return Fi(o)},n.wbg.__wbindgen_is_object=function(e){const t=lr(e);return typeof t=="object"&&t!==null},n.wbg.__wbindgen_is_undefined=function(e){return lr(e)===void 0},n.wbg.__wbindgen_in=function(e,t){return lr(e)in lr(t)},n.wbg.__wbindgen_number_get=function(e,t){const o=lr(t),l=typeof o=="number"?o:void 0;v3()[e/8+1]=Zm(l)?0:l,Jr()[e/4+0]=!Zm(l)},n.wbg.__wbindgen_boolean_get=function(e){const t=lr(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbindgen_object_clone_ref=function(e){const t=lr(e);return Fi(t)},n.wbg.__wbindgen_jsval_loose_eq=function(e,t){return lr(e)==lr(t)},n.wbg.__wbindgen_string_get=function(e,t){const o=lr(t),l=typeof o=="string"?o:void 0;var u=Zm(l)?0:Wf(l,$t.__wbindgen_malloc,$t.__wbindgen_realloc),f=ca;Jr()[e/4+1]=f,Jr()[e/4+0]=u},n.wbg.__wbg_String_4370c5505c674d30=function(e,t){const o=String(lr(t)),l=Wf(o,$t.__wbindgen_malloc,$t.__wbindgen_realloc),u=ca;Jr()[e/4+1]=u,Jr()[e/4+0]=l},n.wbg.__wbg_getwithrefkey_d1f0d12f1f1b63ea=function(e,t){const o=lr(e)[lr(t)];return Fi(o)},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Fi(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const o=lr(t).stack,l=Wf(o,$t.__wbindgen_malloc,$t.__wbindgen_realloc),u=ca;Jr()[e/4+1]=u,Jr()[e/4+0]=l},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let o,l;try{o=e,l=t,console.error(Ms(e,t))}finally{$t.__wbindgen_free(o,l,1)}},n.wbg.__wbg_debug_9a6b3243fbbebb61=function(e){console.debug(lr(e))},n.wbg.__wbg_error_788ae33f81d3b84b=function(e){console.error(lr(e))},n.wbg.__wbg_info_2e30e8204b29d91d=function(e){console.info(lr(e))},n.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(lr(e))},n.wbg.__wbg_warn_d60e832f9882c1b2=function(e){console.warn(lr(e))},n.wbg.__wbg_get_44be0491f933a435=function(e,t){const o=lr(e)[t>>>0];return Fi(o)},n.wbg.__wbg_length_fff51ee6522a1a18=function(e){return lr(e).length},n.wbg.__wbindgen_is_function=function(e){return typeof lr(e)=="function"},n.wbg.__wbg_next_526fc47e980da008=function(e){const t=lr(e).next;return Fi(t)},n.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return Hm(function(e){const t=lr(e).next();return Fi(t)},arguments)},n.wbg.__wbg_done_5c1f01fb660d73b5=function(e){return lr(e).done},n.wbg.__wbg_value_1695675138684bd5=function(e){const t=lr(e).value;return Fi(t)},n.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return Fi(Symbol.iterator)},n.wbg.__wbg_get_97b561fb56f034b5=function(){return Hm(function(e,t){const o=Reflect.get(lr(e),lr(t));return Fi(o)},arguments)},n.wbg.__wbg_call_cb65541d95d71282=function(){return Hm(function(e,t){const o=lr(e).call(lr(t));return Fi(o)},arguments)},n.wbg.__wbg_isArray_4c24b343cb13cfb1=function(e){return Array.isArray(lr(e))},n.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(e){let t;try{t=lr(e)instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_buffer_085ec1f694018c4f=function(e){const t=lr(e).buffer;return Fi(t)},n.wbg.__wbg_new_8125e318e6245eed=function(e){const t=new Uint8Array(lr(e));return Fi(t)},n.wbg.__wbg_set_5cf90238115182c3=function(e,t,o){lr(e).set(lr(t),o>>>0)},n.wbg.__wbg_length_72e2208bbc0efc61=function(e){return lr(e).length},n.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(e){let t;try{t=lr(e)instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbindgen_debug_string=function(e,t){const o=Tg(lr(t)),l=Wf(o,$t.__wbindgen_malloc,$t.__wbindgen_realloc),u=ca;Jr()[e/4+1]=u,Jr()[e/4+0]=l},n.wbg.__wbindgen_throw=function(e,t){throw new Error(Ms(e,t))},n.wbg.__wbindgen_memory=function(){const e=$t.memory;return Fi(e)},n}function k3(n,e){return $t=n.exports,Ow.__wbindgen_wasm_module=e,sh=null,ah=null,oh=null,$t}async function Ow(n){if($t!==void 0)return $t;typeof n>"u"&&(n="/scheme-sketcher-lib/assets/route_snapper_bg.wasm");const e=S3();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:o}=await w3(await n,e);return k3(t,o)}function Cg(n,e){return e===void 0&&(e={}),yx(n,function(t,o){var l=o.geometry.coordinates;return t+Ki(l[0],l[1],e)},0)}function $w(n,e,t){if(t===void 0&&(t={}),t.final===!0)return E3(n,e);var o=Bn(n),l=Bn(e),u=ei(o[0]),f=ei(l[0]),c=ei(o[1]),y=ei(l[1]),w=Math.sin(f-u)*Math.cos(y),M=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(f-u);return Ro(Math.atan2(w,M))}function E3(n,e){var t=$w(e,n);return t=(t+180)%360,t}function O1(n,e,t,o){o===void 0&&(o={});var l=Bn(n),u=ei(l[0]),f=ei(l[1]),c=ei(t),y=Lc(e,o.units),w=Math.asin(Math.sin(f)*Math.cos(y)+Math.cos(f)*Math.sin(y)*Math.cos(c)),M=u+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(f),Math.cos(y)-Math.sin(f)*Math.sin(w)),k=Ro(M),T=Ro(w);return hi([k,T],o.properties)}function $1(n,e,t){t===void 0&&(t={});var o=hi([1/0,1/0],{dist:1/0}),l=0;return Ls(n,function(u){for(var f=yo(u),c=0;c0&&(G=B.features[0],G.properties.dist=Ki(e,G,t),G.properties.location=l+Ki(y,G,t)),y.properties.dist=f){var c=(t+l)/2;return[e,c-(o-e)/2,o,c+(o-e)/2]}else{var y=(e+o)/2;return[y-(l-t)/2,t,y+(l-t)/2,l]}}function Ag(n){var e=[1/0,1/0,-1/0,-1/0];return hl(n,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2] is required");if(typeof t!="number")throw new Error(" must be a number");if(typeof o!="number")throw new Error(" must be a number");(l===!1||l===void 0)&&(n=JSON.parse(JSON.stringify(n)));var u=Math.pow(10,t);return hl(n,function(f){T3(f,u,o)}),n}function T3(n,e,t){n.length>t&&n.splice(t,n.length);for(var o=0;o0&&(G=B.features[0],G.properties.dist=Ki(e,G,t),G.properties.location=l+Ki(y,G,t)),y.properties.dist1&&t.push(Ri(M)),go(t)}function jw(n,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var t,o=1/0;return wc(e,function(l){var u=A3(l,n),f=u.properties.dist;f{if(!this.active)return;const c=[f.point.x-F3,f.point.y],y=this.map.unproject(f.point).distanceTo(this.map.unproject(c));this.inner.onMouseMove(f.lngLat.lng,f.lngLat.lat,y)&&(this.redraw(),this.dataUpdated())},this.onClick=()=>{this.active&&(this.inner.onClick(),this.redraw(),this.dataUpdated())},this.onDoubleClick=f=>{this.active&&(f.preventDefault(),this.inner.onClick(),this.finish())},this.onDragStart=()=>{this.active&&this.inner.onDragStart()&&this.map.dragPan.disable()},this.onMouseUp=()=>{this.active&&this.inner.onMouseUp()&&this.map.dragPan.enable()},this.onKeyDown=f=>{this.active&&f.key=="Escape"&&(f.stopPropagation(),this.cancel())},this.onKeyPress=f=>{this.active&&f.target.tagName!="INPUT"&&(f.key=="Enter"?(f.stopPropagation(),this.finish()):f.key=="s"||f.key=="S"?(f.stopPropagation(),this.inner.toggleSnapMode(),this.redraw()):f.key=="z"&&f.ctrlKey&&this.undo())},this.map=e,console.time("Deserialize and setup JsRouteSnapper"),this.inner=new Gd(t),console.timeEnd("Deserialize and setup JsRouteSnapper"),this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.routeToolGj=o,this.snapMode=l,this.undoLength=u,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("dragstart",this.onDragStart),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keypress",this.onKeyPress)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("dragstart",this.onDragStart),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keypress",this.onKeyPress)}startRoute(){this.active||(this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}startArea(){this.active||(this.inner.setAreaMode(),this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}stop(){this.active=!1,this.inner.clearState(),this.redraw(),this.map.boxZoom.enable(),this.map.doubleClickZoom.enable()}editExistingRoute(e){this.active&&window.alert("Bug: editExistingRoute called when tool is already active"),e.properties.waypoints||(e.properties.waypoints=[{lon:e.geometry.coordinates[0][0],lat:e.geometry.coordinates[0][1],snapped:!0},{lon:e.geometry.coordinates[e.geometry.coordinates.length-1][0],lat:e.geometry.coordinates[e.geometry.coordinates.length-1][1],snapped:!0}]),this.startRoute(),this.inner.editExisting(e.properties.waypoints),this.redraw()}editExistingArea(e){this.active&&window.alert("Bug: editExistingArea called when tool is already active"),e.properties.waypoints||window.alert("Bug: editExistingArea called for a polygon not produced by the route-snapper"),this.startArea(),this.inner.editExisting(e.properties.waypoints),this.redraw()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}isActive(){return this.active}finish(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersSuccess)t(JSON.parse(e));else for(let t of this.eventListenersFailure)t();this.stop()}cancel(){this.inner.clearState(),this.finish()}setRouteConfig(e){this.inner.setRouteConfig(e),this.redraw()}addSnappedWaypoint(e){this.inner.addSnappedWaypoint(e[0],e[1]),this.redraw()}undo(){this.inner.undo(),this.redraw()}toggleSnapMode(){this.inner.toggleSnapMode(),this.redraw()}redraw(){let e=JSON.parse(this.inner.renderGeojson());this.routeToolGj.set(e),this.map.getCanvas().style.cursor=e.cursor,this.snapMode.set(e.snap_mode),this.undoLength.set(e.undo_length)}dataUpdated(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersUpdated)t(JSON.parse(e))}}function B3(n){return n=="google"||n=="bing"}var nn=[];for(var Xm=0;Xm<256;++Xm)nn.push((Xm+256).toString(16).slice(1));function O3(n,e=0){return(nn[n[e+0]]+nn[n[e+1]]+nn[n[e+2]]+nn[n[e+3]]+"-"+nn[n[e+4]]+nn[n[e+5]]+"-"+nn[n[e+6]]+nn[n[e+7]]+"-"+nn[n[e+8]]+nn[n[e+9]]+"-"+nn[n[e+10]]+nn[n[e+11]]+nn[n[e+12]]+nn[n[e+13]]+nn[n[e+14]]+nn[n[e+15]]).toLowerCase()}var Xf,$3=new Uint8Array(16);function N3(){if(!Xf&&(Xf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xf($3)}var j3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const q1={randomUUID:j3};function V3(n,e,t){if(q1.randomUUID&&!e&&!n)return q1.randomUUID();n=n||{};var o=n.random||(n.rng||N3)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){t=t||0;for(var l=0;l<16;++l)e[t+l]=o[l];return e}return O3(o)}const bh={hovering:"black",lineEndpointColor:"black"},Zd=10,ol=10;function U3(){return q3(["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"])}function q3(n){return n[Math.floor(Math.random()*n.length)]}const kh=Yr(null),Pc=Yr(null),Ds=Yr(null),dd=Yr(new Set),xh=Yr(null),dr=Yr({mode:"list"});function Lh(n){let e=new Set;for(let o of n.features)e.add(o.id);let t=e.size+1;for(;e.has(t);)t++;return t}function G1(n,e){console.log(`Deleting intervention ${e}`),n.update(t=>(t.features=t.features.filter(o=>o.id!=e),t)),xh.set(null),dr.set({mode:"list"})}function op(n){return Object.values(n.schemes)[0].scheme_reference}function Vw(n){return[Math.round(n[0]*1e7)/1e7,Math.round(n[1]*1e7)/1e7]}const ul=Yr(G3());ul.subscribe(n=>window.localStorage.setItem("userSettings",JSON.stringify(n)));function G3(){let n={streetViewImagery:"google",avoidDoublingBack:!1};try{let e=JSON.parse(window.localStorage.getItem("userSettings")||"{}");B3(e.streetViewImagery)&&(n.streetViewImagery=e.streetViewImagery),typeof e.avoidDoublingBack=="boolean"&&(n.avoidDoublingBack=e.avoidDoublingBack)}catch(e){console.log(`Couldn't parse userSettings from local storage: ${e}`)}return n}function Uw(n){let e={type:"FeatureCollection",features:[],schemes:{}};return qw(n,e),e}function qw(n,e){let t=V3(),o=n.initializeEmptyScheme({scheme_reference:t,color:U3()});e.schemes[t]=o}function xr(n,e){return{id:e,beforeId:Z3(n,e)}}function Z3(n,e){let t=Hb(ro);if(!t){console.warn(`getBeforeId(${e}) called before map is ready. Z-ordering may be incorrect.`);return}let o,l=!1;for(let u=n.layerZorder.length-1;u>=0;u--){let f=n.layerZorder[u];if(f==e){l=!0;break}t.getLayer(f)&&(o=f)}if(!l)throw new Error(`Layer ID ${e} not defined in layerZorder`);return o}const sl=["==",["geometry-type"],"Polygon"],Eh=["==",["geometry-type"],"LineString"],Ph=["==",["geometry-type"],"Point"];function Mc(){return{type:"FeatureCollection",features:[]}}function lh(n,e,t){let o=["match",n];for(let[l,u]of Object.entries(e))o.push(l),o.push(u);return o.push(t),o}function Gw(n){return Tw(n)}function H3(n){var t,o;let e={type:"FeatureCollection",features:[]};for(let l of n.features)if(e.features.push(l),l.geometry.type=="LineString"&&!((t=l.properties)!=null&&t.hide_while_editing))for(let u of[l.geometry.coordinates[0],l.geometry.coordinates[l.geometry.coordinates.length-1]])e.features.push({type:"Feature",properties:{endpoint:!0,scheme_reference:(o=l.properties)==null?void 0:o.scheme_reference},geometry:{type:"Point",coordinates:u}});return e}const pd=Yr(null),md=Yr(100);function Z1(n){let e,t;return e=new mE({props:{url:n[3],coordinates:[[n[1].lng,n[1].lat],[n[4].lng,n[1].lat],[n[4].lng,n[4].lat],[n[1].lng,n[4].lat]],$$slots:{default:[W3]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&8&&(u.url=o[3]),l&18&&(u.coordinates=[[o[1].lng,o[1].lat],[o[4].lng,o[1].lat],[o[4].lng,o[4].lat],[o[1].lng,o[4].lat]]),l&545&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function W3(n){let e,t;const o=[xr(n[0],"georeferenced-image"),{paint:{"raster-fade-duration":0,"raster-opacity":n[5]/100}}];let l={};for(let u=0;ufi(e,"lngLat",c));function w(k){n[8](k)}let M={draggable:!0,$$slots:{default:[J3]},$$scope:{ctx:n}};return n[4]!==void 0&&(M.lngLat=n[4]),l=new Qm({props:M}),Hr.push(()=>fi(l,"lngLat",w)),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment)},l(k){Fe(e.$$.fragment,k),o=Ge(k),Fe(l.$$.fragment,k)},m(k,T){ze(e,k,T),ce(k,o,T),ze(l,k,T),f=!0},p(k,T){const z={};T&512&&(z.$$scope={dirty:T,ctx:k}),!t&&T&2&&(t=!0,z.lngLat=k[1],gi(()=>t=!1)),e.$set(z);const F={};T&512&&(F.$$scope={dirty:T,ctx:k}),!u&&T&16&&(u=!0,F.lngLat=k[4],gi(()=>u=!1)),l.$set(F)},i(k){f||(ae(e.$$.fragment,k),ae(l.$$.fragment,k),f=!0)},o(k){fe(e.$$.fragment,k),fe(l.$$.fragment,k),f=!1},d(k){k&&ee(o),Le(e,k),Le(l,k)}}}function X3(n){let e;return{c(){e=et("span"),this.h()},l(t){e=tt(t,"SPAN",{class:!0,style:!0}),Lt(e).forEach(ee),this.h()},h(){Ke(e,"class","dot svelte-1tmbx1c"),ki(e,"background-color","red")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function J3(n){let e;return{c(){e=et("span"),this.h()},l(t){e=tt(t,"SPAN",{class:!0,style:!0}),Lt(e).forEach(ee),this.h()},h(){Ke(e,"class","dot svelte-1tmbx1c"),ki(e,"background-color","blue")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function K3(n){let e,t,o,l=n[3]&&Z1(n),u=n[3]&&n[2].mode=="set-image"&&H1(n);return{c(){l&&l.c(),e=qe(),u&&u.c(),t=Ot()},l(f){l&&l.l(f),e=Ge(f),u&&u.l(f),t=Ot()},m(f,c){l&&l.m(f,c),ce(f,e,c),u&&u.m(f,c),ce(f,t,c),o=!0},p(f,[c]){f[3]?l?(l.p(f,c),c&8&&ae(l,1)):(l=Z1(f),l.c(),ae(l,1),l.m(e.parentNode,e)):l&&(vr(),fe(l,1,1,()=>{l=null}),br()),f[3]&&f[2].mode=="set-image"?u?(u.p(f,c),c&12&&ae(u,1)):(u=H1(f),u.c(),ae(u,1),u.m(t.parentNode,t)):u&&(vr(),fe(u,1,1,()=>{u=null}),br())},i(f){o||(ae(l),ae(u),o=!0)},o(f){fe(l),fe(u),o=!1},d(f){f&&(ee(e),ee(t)),l&&l.d(f),u&&u.d(f)}}}function Y3(n,e,t){let o,l,u,f;bt(n,ro,T=>t(6,o=T)),bt(n,dr,T=>t(2,l=T)),bt(n,pd,T=>t(3,u=T)),bt(n,md,T=>t(5,f=T));let{cfg:c}=e,y={lng:0,lat:0},w={lng:0,lat:0};function M(T){y=T,t(1,y),t(6,o),t(3,u),t(2,l)}function k(T){w=T,t(4,w),t(6,o),t(3,u),t(2,l),t(1,y)}return n.$$set=T=>{"cfg"in T&&t(0,c=T.cfg)},n.$$.update=()=>{if(n.$$.dirty&78&&o&&u&&l.mode=="set-image"&&y.lng==0&&y.lat==0){let T=o.getBounds();t(1,y.lng=T.getWest()+.4*(T.getEast()-T.getWest()),y),t(4,w.lng=T.getWest()+.6*(T.getEast()-T.getWest()),w),t(1,y.lat=T.getNorth()+.4*(T.getSouth()-T.getNorth()),y),t(4,w.lat=T.getNorth()+.6*(T.getSouth()-T.getNorth()),w)}},[c,y,l,u,w,f,o,M,k]}class Q3 extends Dt{constructor(e){super(),Ft(this,e,Y3,K3,At,{cfg:0})}}function W1(n){let e,t;return e=new ry({props:{openOn:"hover",openIfTopMost:!0,$$slots:{default:[ez,({features:o})=>({16:o}),({features:o})=>o?65536:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&196608&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function ez(n){let e,t,o=n[9](n[16])+"",l;return{c(){e=et("div"),t=et("p"),l=xt(o),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);t=tt(f,"P",{});var c=Lt(t);l=wt(c,o),c.forEach(ee),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-prose")},m(u,f){ce(u,e,f),_t(e,t),_t(t,l)},p(u,f){f&65536&&o!==(o=u[9](u[16])+"")&&ai(l,o)},d(u){u&&ee(e)}}}function tz(n){let e,t,o=n[4]&&W1(n);return{c(){o&&o.c(),e=Ot()},l(l){o&&o.l(l),e=Ot()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[4]?o?(o.p(l,u),u&16&&ae(o,1)):(o=W1(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function X1(n){let e,t;return e=new ry({props:{openOn:"hover",openIfTopMost:!0,$$slots:{default:[rz,({features:o})=>({16:o}),({features:o})=>o?65536:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&196608&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function rz(n){let e,t,o=n[9](n[16])+"",l;return{c(){e=et("div"),t=et("p"),l=xt(o),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);t=tt(f,"P",{});var c=Lt(t);l=wt(c,o),c.forEach(ee),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-prose")},m(u,f){ce(u,e,f),_t(e,t),_t(t,l)},p(u,f){f&65536&&o!==(o=u[9](u[16])+"")&&ai(l,o)},d(u){u&&ee(e)}}}function iz(n){let e,t,o=n[4]&&X1(n);return{c(){o&&o.c(),e=Ot()},l(l){o&&o.l(l),e=Ot()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[4]?o?(o.p(l,u),u&16&&ae(o,1)):(o=X1(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function J1(n){let e,t;return e=new ry({props:{openOn:"hover",openIfTopMost:!0,$$slots:{default:[nz,({features:o})=>({16:o}),({features:o})=>o?65536:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&196608&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function nz(n){let e,t,o=n[9](n[16])+"",l;return{c(){e=et("div"),t=et("p"),l=xt(o),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);t=tt(f,"P",{});var c=Lt(t);l=wt(c,o),c.forEach(ee),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-prose")},m(u,f){ce(u,e,f),_t(e,t),_t(t,l)},p(u,f){f&65536&&o!==(o=u[9](u[16])+"")&&ai(l,o)},d(u){u&&ee(e)}}}function oz(n){let e,t,o=n[4]&&J1(n);return{c(){o&&o.c(),e=Ot()},l(l){o&&o.l(l),e=Ot()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[4]?o?(o.p(l,u),u&16&&ae(o,1)):(o=J1(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function sz(n){let e,t,o,l,u,f,c,y,w,M;const k=[xr(n[0],"interventions-points"),{filter:["all",Ph,n[6],n[7],n[3]]},{paint:{"circle-color":n[2],"circle-radius":Zd}},{hoverCursor:n[4]?"pointer":void 0},{manageHoverState:n[4]}];let T={$$slots:{default:[tz]},$$scope:{ctx:n}};for(let X=0;X(y(),y=da(F,X=>t(11,c=X)),F),M,k,T;bt(n,ro,X=>t(14,M=X)),bt(n,dr,X=>t(12,k=X)),bt(n,dd,X=>t(13,T=X)),n.$$.on_destroy.push(()=>y());let{cfg:z}=e,{gjSchemes:F}=e;w();const B=["!=",["get","hide_while_editing"],!0],G=["!=",["get","endpoint"],!0];let J;function j(X){return lh(["get","scheme_reference"],Object.fromEntries(Object.values(X.schemes).map(pe=>[pe.scheme_reference,pe.color])),"black")}function V(X){k.mode!="list"||!M||X.detail.features[0]&&(M.getCanvas().style.cursor="inherit",dr.set({mode:"edit-form",id:X.detail.features[0].id}))}function me(X){if(X){let pe=X[0],Ee=z.interventionName(pe),Pe=z.schemeName(c.schemes[pe.properties.scheme_reference]);return`${Ee} (${Pe})`}return"Tooltip bug"}return n.$$set=X=>{"cfg"in X&&t(0,z=X.cfg),"gjSchemes"in X&&w(t(1,F=X.gjSchemes))},n.$$.update=()=>{if(n.$$.dirty&2048&&t(5,o=H3(c)),n.$$.dirty&4096&&t(4,l=k.mode=="list"),n.$$.dirty&8192&&t(3,u=lz(T)),n.$$.dirty&2048&&t(10,f=j(c)),n.$$.dirty&5120){let X="grey";k.mode=="edit-form"?t(2,J=["case",["==",["id"],k.id],f,X]):k.mode=="list"?t(2,J=f):k.mode=="split-route"?t(2,J=["case",["==","intervention_type","route"],f,X]):t(2,J=X)}},[z,F,J,u,l,o,B,G,V,me,f,c,k,T]}class uz extends Dt{constructor(e){super(),Ft(this,e,cz,az,At,{cfg:0,gjSchemes:1})}}function hz(n){let e,t,o,l,u,f;const c=[xr(n[0],"edit-polygon-fill"),{filter:sl},{paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}];let y={};for(let z=0;zt(1,o=u));let{cfg:l}=e;return n.$$set=u=>{"cfg"in u&&t(0,l=u.cfg)},[l,o]}class pz extends Dt{constructor(e){super(),Ft(this,e,dz,fz,At,{cfg:0})}}const Zw=Yr(Mc()),gd=Yr(Mc()),Hw=Yr(!0),Ay=Yr(0);function mz(n){let e,t,o,l,u,f;const c=[xr(n[0],"route-points"),{filter:Ph},{paint:{"circle-color":lh(["get","type"],{"snapped-waypoint":"red","free-waypoint":"blue"},"black"),"circle-opacity":["case",["has","hovered"],.5,1],"circle-radius":lh(["get","type"],{node:Jf/2},Jf)}}];let y={};for(let z=0;z({3:o}),({feature:o})=>o?8:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&24&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function _z(n){let e,t,o,l;return e=new cl({props:{data:n[1],$$slots:{default:[mz]},$$scope:{ctx:n}}}),o=new cl({props:{data:n[2],$$slots:{default:[yz]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&2&&(c.data=u[1]),f&17&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&4&&(y.data=u[2]),f&16&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}const Jf=10;function K1(n){var e;return(e=n.properties)==null?void 0:e.number}function vz(n,e,t){let o,l;bt(n,Zw,f=>t(1,o=f)),bt(n,gd,f=>t(2,l=f));let{cfg:u}=e;return n.$$set=f=>{"cfg"in f&&t(0,u=f.cfg)},[u,o,l]}class bz extends Dt{constructor(e){super(),Ft(this,e,vz,_z,At,{cfg:0})}}var xz=Object.defineProperty,Fr=(n,e)=>xz(n,"name",{value:e,configurable:!0}),wz=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!ch(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Lg(e),l=Lg(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return ch(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return ch(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Fr(wz,"GeojsonEquality");function ch(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Fr(ch,"sameLength");function Lg(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Fr(Lg,"explode");var Jn=63710088e-1,Ww={centimeters:Jn*100,centimetres:Jn*100,degrees:360/(2*Math.PI),feet:Jn*3.28084,inches:Jn*39.37,kilometers:Jn/1e3,kilometres:Jn/1e3,meters:Jn,metres:Jn,miles:Jn/1609.344,millimeters:Jn*1e3,millimetres:Jn*1e3,nauticalmiles:Jn/1852,radians:1,yards:Jn*1.0936},Y1={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function _a(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Fr(_a,"feature");function Sz(n,e,t={}){switch(n){case"Point":return zy(e).geometry;case"LineString":return Dy(e).geometry;case"Polygon":return Ly(e).geometry;case"MultiPoint":return Jw(e).geometry;case"MultiLineString":return Xw(e).geometry;case"MultiPolygon":return Kw(e).geometry;default:throw new Error(n+" is invalid")}}Fr(Sz,"geometry");function zy(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ic(n[0])||!Ic(n[1]))throw new Error("coordinates must contain numbers");return _a({type:"Point",coordinates:n},e,t)}Fr(zy,"point");function kz(n,e,t={}){return sp(n.map(o=>zy(o,e)),t)}Fr(kz,"points");function Ly(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uLy(o,e)),t)}Fr(Ez,"polygons");function Dy(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return _a({type:"LineString",coordinates:n},e,t)}Fr(Dy,"lineString");function Pz(n,e,t={}){return sp(n.map(o=>Dy(o,e)),t)}Fr(Pz,"lineStrings");function sp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Fr(sp,"featureCollection");function Xw(n,e,t={}){return _a({type:"MultiLineString",coordinates:n},e,t)}Fr(Xw,"multiLineString");function Jw(n,e,t={}){return _a({type:"MultiPoint",coordinates:n},e,t)}Fr(Jw,"multiPoint");function Kw(n,e,t={}){return _a({type:"MultiPolygon",coordinates:n},e,t)}Fr(Kw,"multiPolygon");function Mz(n,e,t={}){return _a({type:"GeometryCollection",geometries:n},e,t)}Fr(Mz,"geometryCollection");function Iz(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Fr(Iz,"round");function Yw(n,e="kilometers"){const t=Ww[e];if(!t)throw new Error(e+" units is invalid");return n*t}Fr(Yw,"radiansToLength");function Fy(n,e="kilometers"){const t=Ww[e];if(!t)throw new Error(e+" units is invalid");return n/t}Fr(Fy,"lengthToRadians");function Tz(n,e){return Ry(Fy(n,e))}Fr(Tz,"lengthToDegrees");function Cz(n){let e=n%360;return e<0&&(e+=360),e}Fr(Cz,"bearingToAzimuth");function Ry(n){return n%(2*Math.PI)*180/Math.PI}Fr(Ry,"radiansToDegrees");function uh(n){return n%360*Math.PI/180}Fr(uh,"degreesToRadians");function Az(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return Yw(Fy(n,e),t)}Fr(Az,"convertLength");function zz(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=Y1[e];if(!o)throw new Error("invalid original units");const l=Y1[t];if(!l)throw new Error("invalid final units");return n/o*l}Fr(zz,"convertArea");function Ic(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Fr(Ic,"isNumber");function Lz(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Fr(Lz,"isObject");function Dz(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Ic(e))throw new Error("bbox must only contain numbers")})}Fr(Dz,"validateBBox");function Fz(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Fr(Fz,"validateId");var Rz=Object.defineProperty,va=(n,e)=>Rz(n,"name",{value:e,configurable:!0});function Dg(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}va(Dg,"getCoord");function Bz(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}va(Bz,"getCoords");function Qw(n){if(n.length>1&&Ic(n[0])&&Ic(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return Qw(n[0]);throw new Error("coordinates must only contain numbers")}va(Qw,"containsNumber");function Oz(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}va(Oz,"geojsonType");function $z(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}va($z,"featureOf");function Nz(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const o of n.features){if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+o.geometry.type)}}va(Nz,"collectionOf");function jz(n){return n.type==="Feature"?n.geometry:n}va(jz,"getGeom");function Vz(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}va(Vz,"getType");var Uz=Object.defineProperty,e2=(n,e)=>Uz(n,"name",{value:e,configurable:!0});function By(n,e,t={}){if(t.final===!0)return t2(n,e);const o=Dg(n),l=Dg(e),u=uh(o[0]),f=uh(l[0]),c=uh(o[1]),y=uh(l[1]),w=Math.sin(f-u)*Math.cos(y),M=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(f-u);return Ry(Math.atan2(w,M))}e2(By,"bearing");function t2(n,e){let t=By(e,n);return t=(t+180)%360,t}e2(t2,"calculateFinalBearing");var qz=Object.defineProperty,Rr=(n,e)=>qz(n,"name",{value:e,configurable:!0}),Gz=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!hh(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Fg(e),l=Fg(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return hh(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return hh(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Rr(Gz,"GeojsonEquality");function hh(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Rr(hh,"sameLength");function Fg(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Rr(Fg,"explode");var Kn=63710088e-1,r2={centimeters:Kn*100,centimetres:Kn*100,degrees:360/(2*Math.PI),feet:Kn*3.28084,inches:Kn*39.37,kilometers:Kn/1e3,kilometres:Kn/1e3,meters:Kn,metres:Kn,miles:Kn/1609.344,millimeters:Kn*1e3,millimetres:Kn*1e3,nauticalmiles:Kn/1852,radians:1,yards:Kn*1.0936},Q1={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function bo(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Rr(bo,"feature");function Zz(n,e,t={}){switch(n){case"Point":return eo(e).geometry;case"LineString":return Lo(e).geometry;case"Polygon":return Oy(e).geometry;case"MultiPoint":return n2(e).geometry;case"MultiLineString":return i2(e).geometry;case"MultiPolygon":return o2(e).geometry;default:throw new Error(n+" is invalid")}}Rr(Zz,"geometry");function eo(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Cc(n[0])||!Cc(n[1]))throw new Error("coordinates must contain numbers");return bo({type:"Point",coordinates:n},e,t)}Rr(eo,"point");function Hz(n,e,t={}){return Tc(n.map(o=>eo(o,e)),t)}Rr(Hz,"points");function Oy(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uOy(o,e)),t)}Rr(Wz,"polygons");function Lo(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return bo({type:"LineString",coordinates:n},e,t)}Rr(Lo,"lineString");function Xz(n,e,t={}){return Tc(n.map(o=>Lo(o,e)),t)}Rr(Xz,"lineStrings");function Tc(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Rr(Tc,"featureCollection");function i2(n,e,t={}){return bo({type:"MultiLineString",coordinates:n},e,t)}Rr(i2,"multiLineString");function n2(n,e,t={}){return bo({type:"MultiPoint",coordinates:n},e,t)}Rr(n2,"multiPoint");function o2(n,e,t={}){return bo({type:"MultiPolygon",coordinates:n},e,t)}Rr(o2,"multiPolygon");function Jz(n,e,t={}){return bo({type:"GeometryCollection",geometries:n},e,t)}Rr(Jz,"geometryCollection");function Kz(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Rr(Kz,"round");function $y(n,e="kilometers"){const t=r2[e];if(!t)throw new Error(e+" units is invalid");return n*t}Rr($y,"radiansToLength");function Ny(n,e="kilometers"){const t=r2[e];if(!t)throw new Error(e+" units is invalid");return n/t}Rr(Ny,"lengthToRadians");function Yz(n,e){return s2(Ny(n,e))}Rr(Yz,"lengthToDegrees");function Qz(n){let e=n%360;return e<0&&(e+=360),e}Rr(Qz,"bearingToAzimuth");function s2(n){return n%(2*Math.PI)*180/Math.PI}Rr(s2,"radiansToDegrees");function fh(n){return n%360*Math.PI/180}Rr(fh,"degreesToRadians");function e4(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return $y(Ny(n,e),t)}Rr(e4,"convertLength");function t4(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=Q1[e];if(!o)throw new Error("invalid original units");const l=Q1[t];if(!l)throw new Error("invalid final units");return n/o*l}Rr(t4,"convertArea");function Cc(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Rr(Cc,"isNumber");function jy(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Rr(jy,"isObject");function r4(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Cc(e))throw new Error("bbox must only contain numbers")})}Rr(r4,"validateBBox");function i4(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Rr(i4,"validateId");var n4=Object.defineProperty,ba=(n,e)=>n4(n,"name",{value:e,configurable:!0});function Rg(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}ba(Rg,"getCoord");function a2(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}ba(a2,"getCoords");function l2(n){if(n.length>1&&Cc(n[0])&&Cc(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return l2(n[0]);throw new Error("coordinates must only contain numbers")}ba(l2,"containsNumber");function o4(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}ba(o4,"geojsonType");function s4(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}ba(s4,"featureOf");function a4(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const o of n.features){if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+o.geometry.type)}}ba(a4,"collectionOf");function l4(n){return n.type==="Feature"?n.geometry:n}ba(l4,"getGeom");function c4(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}ba(c4,"getType");var u4=Object.defineProperty,h4=(n,e)=>u4(n,"name",{value:e,configurable:!0});function pc(n,e,t={}){var o=Rg(n),l=Rg(e),u=fh(l[1]-o[1]),f=fh(l[0]-o[0]),c=fh(o[1]),y=fh(l[1]),w=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(f/2),2)*Math.cos(c)*Math.cos(y);return $y(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),t.units)}h4(pc,"distance");var f4=Object.defineProperty,Br=(n,e)=>f4(n,"name",{value:e,configurable:!0}),d4=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!dh(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Bg(e),l=Bg(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return dh(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return dh(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Br(d4,"GeojsonEquality");function dh(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Br(dh,"sameLength");function Bg(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Br(Bg,"explode");var Yn=63710088e-1,c2={centimeters:Yn*100,centimetres:Yn*100,degrees:360/(2*Math.PI),feet:Yn*3.28084,inches:Yn*39.37,kilometers:Yn/1e3,kilometres:Yn/1e3,meters:Yn,metres:Yn,miles:Yn/1609.344,millimeters:Yn*1e3,millimetres:Yn*1e3,nauticalmiles:Yn/1852,radians:1,yards:Yn*1.0936},eb={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function xa(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Br(xa,"feature");function p4(n,e,t={}){switch(n){case"Point":return ap(e).geometry;case"LineString":return Uy(e).geometry;case"Polygon":return Vy(e).geometry;case"MultiPoint":return h2(e).geometry;case"MultiLineString":return u2(e).geometry;case"MultiPolygon":return f2(e).geometry;default:throw new Error(n+" is invalid")}}Br(p4,"geometry");function ap(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ac(n[0])||!Ac(n[1]))throw new Error("coordinates must contain numbers");return xa({type:"Point",coordinates:n},e,t)}Br(ap,"point");function m4(n,e,t={}){return lp(n.map(o=>ap(o,e)),t)}Br(m4,"points");function Vy(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uVy(o,e)),t)}Br(g4,"polygons");function Uy(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return xa({type:"LineString",coordinates:n},e,t)}Br(Uy,"lineString");function y4(n,e,t={}){return lp(n.map(o=>Uy(o,e)),t)}Br(y4,"lineStrings");function lp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Br(lp,"featureCollection");function u2(n,e,t={}){return xa({type:"MultiLineString",coordinates:n},e,t)}Br(u2,"multiLineString");function h2(n,e,t={}){return xa({type:"MultiPoint",coordinates:n},e,t)}Br(h2,"multiPoint");function f2(n,e,t={}){return xa({type:"MultiPolygon",coordinates:n},e,t)}Br(f2,"multiPolygon");function _4(n,e,t={}){return xa({type:"GeometryCollection",geometries:n},e,t)}Br(_4,"geometryCollection");function v4(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Br(v4,"round");function d2(n,e="kilometers"){const t=c2[e];if(!t)throw new Error(e+" units is invalid");return n*t}Br(d2,"radiansToLength");function cp(n,e="kilometers"){const t=c2[e];if(!t)throw new Error(e+" units is invalid");return n/t}Br(cp,"lengthToRadians");function b4(n,e){return Hd(cp(n,e))}Br(b4,"lengthToDegrees");function x4(n){let e=n%360;return e<0&&(e+=360),e}Br(x4,"bearingToAzimuth");function Hd(n){return n%(2*Math.PI)*180/Math.PI}Br(Hd,"radiansToDegrees");function yd(n){return n%360*Math.PI/180}Br(yd,"degreesToRadians");function w4(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return d2(cp(n,e),t)}Br(w4,"convertLength");function S4(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=eb[e];if(!o)throw new Error("invalid original units");const l=eb[t];if(!l)throw new Error("invalid final units");return n/o*l}Br(S4,"convertArea");function Ac(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Br(Ac,"isNumber");function k4(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Br(k4,"isObject");function E4(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Ac(e))throw new Error("bbox must only contain numbers")})}Br(E4,"validateBBox");function P4(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Br(P4,"validateId");var M4=Object.defineProperty,wa=(n,e)=>M4(n,"name",{value:e,configurable:!0});function p2(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}wa(p2,"getCoord");function I4(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}wa(I4,"getCoords");function m2(n){if(n.length>1&&Ac(n[0])&&Ac(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return m2(n[0]);throw new Error("coordinates must only contain numbers")}wa(m2,"containsNumber");function T4(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}wa(T4,"geojsonType");function C4(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}wa(C4,"featureOf");function A4(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const o of n.features){if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+o.geometry.type)}}wa(A4,"collectionOf");function z4(n){return n.type==="Feature"?n.geometry:n}wa(z4,"getGeom");function L4(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}wa(L4,"getType");var D4=Object.defineProperty,F4=(n,e)=>D4(n,"name",{value:e,configurable:!0});function Og(n,e,t,o={}){const l=p2(n),u=yd(l[0]),f=yd(l[1]),c=yd(t),y=cp(e,o.units),w=Math.asin(Math.sin(f)*Math.cos(y)+Math.cos(f)*Math.sin(y)*Math.cos(c)),M=u+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(f),Math.cos(y)-Math.sin(f)*Math.sin(w)),k=Hd(M),T=Hd(w);return ap([k,T],o.properties)}F4(Og,"destination");class g2{constructor(e=[],t=R4){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:o}=this,l=t[e];for(;e>0;){const u=e-1>>1,f=t[u];if(o(l,f)>=0)break;t[e]=f,e=u}t[e]=l}_down(e){const{data:t,compare:o}=this,l=this.length>>1,u=t[e];for(;e=0)break;t[e]=c,e=f}t[e]=u}}function R4(n,e){return ne?1:0}function y2(n,e){return n.p.x>e.p.x?1:n.p.xe.p.y?1:-1:1}function B4(n,e){return n.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:n.rightSweepEvent.p.x0?(M.isLeftEndpoint=!0,w.isLeftEndpoint=!1):(w.isLeftEndpoint=!0,M.isLeftEndpoint=!1),e.push(w),e.push(M),f=c,Qf=Qf+1}}Kf=Kf+1}let $4=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function N4(n,e){if(n===null||e===null||n.leftSweepEvent.ringId===e.leftSweepEvent.ringId&&(n.rightSweepEvent.isSamePoint(e.leftSweepEvent)||n.rightSweepEvent.isSamePoint(e.leftSweepEvent)||n.rightSweepEvent.isSamePoint(e.rightSweepEvent)||n.leftSweepEvent.isSamePoint(e.leftSweepEvent)||n.leftSweepEvent.isSamePoint(e.rightSweepEvent)))return!1;const t=n.leftSweepEvent.p.x,o=n.leftSweepEvent.p.y,l=n.rightSweepEvent.p.x,u=n.rightSweepEvent.p.y,f=e.leftSweepEvent.p.x,c=e.leftSweepEvent.p.y,y=e.rightSweepEvent.p.x,w=e.rightSweepEvent.p.y,M=(w-c)*(l-t)-(y-f)*(u-o),k=(y-f)*(o-c)-(w-c)*(t-f),T=(l-t)*(o-c)-(u-o)*(t-f);if(M===0)return!1;const z=k/M,F=T/M;if(z>=0&&z<=1&&F>=0&&F<=1){const B=t+z*(l-t),G=o+z*(u-o);return[B,G]}return!1}function j4(n,e){e=e||!1;const t=[],o=new g2([],B4);for(;n.length;){const l=n.pop();if(l.isLeftEndpoint){const u=new $4(l);for(let f=0;fU4(n,"name",{value:e,configurable:!0}),G4=V4;function _2(n,e,t={}){const{removeDuplicates:o=!0,ignoreSelfIntersections:l=!1}=t;let u=[];n.type==="FeatureCollection"?u=u.concat(n.features):n.type==="Feature"?u.push(n):(n.type==="LineString"||n.type==="Polygon"||n.type==="MultiLineString"||n.type==="MultiPolygon")&&u.push(bo(n)),e.type==="FeatureCollection"?u=u.concat(e.features):e.type==="Feature"?u.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&u.push(bo(e));const f=G4(Tc(u),l);let c=[];if(o){const y={};f.forEach(w=>{const M=w.join(",");y[M]||(y[M]=!0,c.push(w))})}else c=f;return Tc(c.map(y=>eo(y)))}q4(_2,"lineIntersect");var Z4=Object.defineProperty,ln=(n,e)=>Z4(n,"name",{value:e,configurable:!0});function Dh(n,e,t){if(n!==null)for(var o,l,u,f,c,y,w,M=0,k=0,T,z=n.type,F=z==="FeatureCollection",B=z==="Feature",G=F?n.features.length:1,J=0;Jy||F>w||B>M){c=k,y=o,w=F,M=B,u=0;return}var G=Lo([c,k],t.properties);if(e(G,o,l,B,u)===!1)return!1;u++,c=k})===!1)return!1}}})}ln(x2,"segmentEach");function Q4(n,e,t){var o=t,l=!1;return x2(n,function(u,f,c,y,w){l===!1&&t===void 0?o=u:o=e(o,u,f,c,y,w),l=!0}),o}ln(Q4,"segmentReduce");function w2(n,e){if(!n)throw new Error("geojson is required");Fh(n,function(t,o,l){if(t.geometry!==null){var u=t.geometry.type,f=t.geometry.coordinates;switch(u){case"LineString":if(e(t,o,l,0,0)===!1)return!1;break;case"Polygon":for(var c=0;ce in n?S2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,il=(n,e)=>{for(var t in e||(e={}))oL.call(e,t)&&nb(n,t,e[t]);if(ib)for(var t of ib(e))sL.call(e,t)&&nb(n,t,e[t]);return n},nl=(n,e)=>iL(n,nL(e)),aL=(n,e)=>S2(n,"name",{value:e,configurable:!0});function k2(n,e,t={}){if(!n||!e)throw new Error("lines and pt are required arguments");let o=eo([1/0,1/0],{dist:1/0,index:-1,location:-1}),l=0;return Fh(n,function(u){const f=a2(u);for(let c=0;c0&&B.features[0]&&(G=nl(il({},B.features[0]),{properties:{dist:pc(e,B.features[0],t),location:l+pc(y,B.features[0],t)}})),y.properties.dist(l(),l=da(y,G=>t(8,o=G)),y),f;bt(n,ro,G=>t(9,f=G)),n.$$.on_destroy.push(()=>l());let{cfg:c}=e,{gjSchemes:y}=e;u(),As(()=>{f&&(f.getCanvas().style.cursor=`url(${E2}), crosshair`)}),Ei(()=>{f&&(f.getCanvas().style.cursor="inherit")});let w=null,M=null,k=Mc();function T(G){if(!f)return;t(6,w=null),M=null;let J=B(G.detail.lngLat.toArray());const j=[G.detail.point.x-hL,G.detail.point.y],V=f.unproject(G.detail.point).distanceTo(f.unproject(j))/1e3;let me=[];for(let[X,pe]of o.features.entries())if(pe.geometry.type=="LineString"){let Ee=lL(pe.geometry,J,{units:"kilometers"});Ee.properties.dist!=null&&Ee.properties.dist<=V&&me.push([X,Ee.geometry.coordinates,Ee.properties.dist])}me.sort((X,pe)=>X[2]-pe[2]),me.length>0&&(t(6,w=B(me[0][1])),M=me[0][0])}function z(){if(M==null){dr.set({mode:"list"});return}let G=L3(o.features[M],w);if(G!=null){let[J,j]=G;y.update(V=>(J.id=V.features[M].id,j.id=Lh(V),V.features.splice(M,1,J,j),V))}t(6,w=null),M=null}function F(G){G.key=="Escape"&&(G.stopPropagation(),dr.set({mode:"list"}))}function B(G){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:Vw(G)}}}return n.$$set=G=>{"cfg"in G&&t(0,c=G.cfg),"gjSchemes"in G&&u(t(1,y=G.gjSchemes))},n.$$.update=()=>{if(n.$$.dirty&64){let G=Mc();w&&G.features.push(w),t(2,k=G)}},[c,y,k,T,z,F,w]}class dL extends Dt{constructor(e){super(),Ft(this,e,fL,uL,At,{cfg:0,gjSchemes:1})}}var pL=Object.defineProperty,Or=(n,e)=>pL(n,"name",{value:e,configurable:!0}),mL=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!ph(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=$g(e),l=$g(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return ph(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return ph(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Or(mL,"GeojsonEquality");function ph(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Or(ph,"sameLength");function $g(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Or($g,"explode");var Qn=63710088e-1,P2={centimeters:Qn*100,centimetres:Qn*100,degrees:360/(2*Math.PI),feet:Qn*3.28084,inches:Qn*39.37,kilometers:Qn/1e3,kilometres:Qn/1e3,meters:Qn,metres:Qn,miles:Qn/1609.344,millimeters:Qn*1e3,millimetres:Qn*1e3,nauticalmiles:Qn/1852,radians:1,yards:Qn*1.0936},sb={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Sa(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Or(Sa,"feature");function gL(n,e,t={}){switch(n){case"Point":return Gy(e).geometry;case"LineString":return Zy(e).geometry;case"Polygon":return up(e).geometry;case"MultiPoint":return I2(e).geometry;case"MultiLineString":return M2(e).geometry;case"MultiPolygon":return Hy(e).geometry;default:throw new Error(n+" is invalid")}}Or(gL,"geometry");function Gy(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Wd(n[0])||!Wd(n[1]))throw new Error("coordinates must contain numbers");return Sa({type:"Point",coordinates:n},e,t)}Or(Gy,"point");function yL(n,e,t={}){return hp(n.map(o=>Gy(o,e)),t)}Or(yL,"points");function up(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uup(o,e)),t)}Or(_L,"polygons");function Zy(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return Sa({type:"LineString",coordinates:n},e,t)}Or(Zy,"lineString");function vL(n,e,t={}){return hp(n.map(o=>Zy(o,e)),t)}Or(vL,"lineStrings");function hp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Or(hp,"featureCollection");function M2(n,e,t={}){return Sa({type:"MultiLineString",coordinates:n},e,t)}Or(M2,"multiLineString");function I2(n,e,t={}){return Sa({type:"MultiPoint",coordinates:n},e,t)}Or(I2,"multiPoint");function Hy(n,e,t={}){return Sa({type:"MultiPolygon",coordinates:n},e,t)}Or(Hy,"multiPolygon");function bL(n,e,t={}){return Sa({type:"GeometryCollection",geometries:n},e,t)}Or(bL,"geometryCollection");function xL(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Or(xL,"round");function T2(n,e="kilometers"){const t=P2[e];if(!t)throw new Error(e+" units is invalid");return n*t}Or(T2,"radiansToLength");function Wy(n,e="kilometers"){const t=P2[e];if(!t)throw new Error(e+" units is invalid");return n/t}Or(Wy,"lengthToRadians");function wL(n,e){return C2(Wy(n,e))}Or(wL,"lengthToDegrees");function SL(n){let e=n%360;return e<0&&(e+=360),e}Or(SL,"bearingToAzimuth");function C2(n){return n%(2*Math.PI)*180/Math.PI}Or(C2,"radiansToDegrees");function kL(n){return n%360*Math.PI/180}Or(kL,"degreesToRadians");function EL(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return T2(Wy(n,e),t)}Or(EL,"convertLength");function PL(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=sb[e];if(!o)throw new Error("invalid original units");const l=sb[t];if(!l)throw new Error("invalid final units");return n/o*l}Or(PL,"convertArea");function Wd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Or(Wd,"isNumber");function ML(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Or(ML,"isObject");function IL(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Wd(e))throw new Error("bbox must only contain numbers")})}Or(IL,"validateBBox");function TL(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Or(TL,"validateId");/** +`+e.prev}function Gf(n,e){var t=dg(n),o=[];if(t){o.length=n.length;for(var l=0;l=o)return t+1;var l=Kv(e,t);if(l<55296||l>56319)return t+1;var u=Kv(e,t+1);return u<56320||u>57343?t+1:t+2},Rm=function(e){var t=0;return{next:function(){var l=t>=e.length,u;return l||(u=e[t],t+=1),{done:l,value:u}}}},Yv=function(e,t){if(FT(e)||Hv(e))return Rm(e);if(RT(e)){var o=0;return{next:function(){var u=NT(e,o),f=$T(e,o,u);return o=u,{done:u>e.length,value:f}}}}if(t&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()};if(!BT&&!OT)od.exports=function(e){if(e!=null)return Yv(e,!0)};else{var jT=Qx,VT=tw,Qv=Ao("Map.prototype.forEach",!0),e1=Ao("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var t1=Ao("Map.prototype.iterator",!0),r1=Ao("Set.prototype.iterator",!0);var i1=Ao("Map.prototype.@@iterator",!0)||Ao("Map.prototype._es6-shim iterator_",!0),n1=Ao("Set.prototype.@@iterator",!0)||Ao("Set.prototype._es6-shim iterator_",!0),UT=function(e){if(jT(e)){if(t1)return Wv(t1(e));if(i1)return i1(e);if(Qv){var t=[];return Qv(e,function(l,u){Jv(t,[u,l])}),Rm(t)}}if(VT(e)){if(r1)return Wv(r1(e));if(n1)return n1(e);if(e1){var o=[];return e1(e,function(l){Jv(o,l)}),Rm(o)}}};od.exports=function(e){return UT(e)||Yv(e)}}}var qT=od.exports,o1=function(n){return n!==n},rw=function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||o1(e)&&o1(t))},GT=rw,iw=function(){return typeof Object.is=="function"?Object.is:GT},ZT=iw,HT=fl,WT=function(){var e=ZT();return HT(Object,{is:e},{is:function(){return Object.is!==e}}),e},XT=fl,JT=Dc,KT=rw,nw=iw,YT=WT,ow=JT(nw(),Object);XT(ow,{getPolyfill:nw,implementation:KT,shim:YT});var QT=ow,eC=Dc,sw=xo,tC=as,mg=tC("%ArrayBuffer%",!0),sd=sw("ArrayBuffer.prototype.byteLength",!0),rC=sw("Object.prototype.toString"),s1=!!mg&&!sd&&new mg(0).slice,a1=!!s1&&eC(s1),aw=sd||a1?function(e){if(!e||typeof e!="object")return!1;try{return sd?sd(e):a1(e,0),!0}catch{return!1}}:mg?function(e){return rC(e)==="[object ArrayBuffer]"}:function(e){return!1},iC=Date.prototype.getDay,nC=function(e){try{return iC.call(e),!0}catch{return!1}},oC=Object.prototype.toString,sC="[object Date]",aC=dl(),lC=function(e){return typeof e!="object"||e===null?!1:aC?nC(e):oC.call(e)===sC},gg=xo,lw=dl(),cw,uw,yg,_g;if(lw){cw=gg("Object.prototype.hasOwnProperty"),uw=gg("RegExp.prototype.exec"),yg={};var Bm=function(){throw yg};_g={toString:Bm,valueOf:Bm},typeof Symbol.toPrimitive=="symbol"&&(_g[Symbol.toPrimitive]=Bm)}var cC=gg("Object.prototype.toString"),uC=Object.getOwnPropertyDescriptor,hC="[object RegExp]",fC=lw?function(e){if(!e||typeof e!="object")return!1;var t=uC(e,"lastIndex"),o=t&&cw(t,"value");if(!o)return!1;try{uw(e,_g)}catch(l){return l===yg}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:cC(e)===hC},dC=xo,l1=dC("SharedArrayBuffer.prototype.byteLength",!0),pC=l1?function(e){if(!e||typeof e!="object")return!1;try{return l1(e),!0}catch{return!1}}:function(e){return!1},mC=Number.prototype.toString,gC=function(e){try{return mC.call(e),!0}catch{return!1}},yC=Object.prototype.toString,_C="[object Number]",vC=dl(),bC=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:vC?gC(e):yC.call(e)===_C},hw=xo,xC=hw("Boolean.prototype.toString"),wC=hw("Object.prototype.toString"),SC=function(e){try{return xC(e),!0}catch{return!1}},kC="[object Boolean]",EC=dl(),PC=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:EC&&Symbol.toStringTag in e?SC(e):wC(e)===kC},vg={exports:{}},MC=Object.prototype.toString,IC=uy();if(IC){var TC=Symbol.prototype.toString,CC=/^Symbol\(.*\)$/,AC=function(e){return typeof e.valueOf()!="symbol"?!1:CC.test(TC.call(e))};vg.exports=function(e){if(typeof e=="symbol")return!0;if(MC.call(e)!=="[object Symbol]")return!1;try{return AC(e)}catch{return!1}}}else vg.exports=function(e){return!1};var zC=vg.exports,bg={exports:{}},c1=typeof BigInt<"u"&&BigInt,LC=function(){return typeof c1=="function"&&typeof BigInt=="function"&&typeof c1(42)=="bigint"&&typeof BigInt(42)=="bigint"},DC=LC();if(DC){var FC=BigInt.prototype.valueOf,RC=function(e){try{return FC.call(e),!0}catch{}return!1};bg.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:RC(e)}}else bg.exports=function(e){return!1};var BC=bg.exports,OC=Kx,$C=bC,NC=PC,jC=zC,VC=BC,UC=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(OC(e))return"String";if($C(e))return"Number";if(NC(e))return"Boolean";if(jC(e))return"Symbol";if(VC(e))return"BigInt"},Rd=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,u1=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Bd;Rd||(Bd=function(e){return!1});var xg=Rd?Rd.prototype.has:null,Om=u1?u1.prototype.has:null;!Bd&&!xg&&(Bd=function(e){return!1});var qC=Bd||function(e){if(!e||typeof e!="object")return!1;try{if(xg.call(e,xg),Om)try{Om.call(e,Om)}catch{return!0}return e instanceof Rd}catch{}return!1},wg={exports:{}},GC=as,fw=xo,ZC=GC("%WeakSet%",!0),$m=fw("WeakSet.prototype.has",!0);if($m){var Nm=fw("WeakMap.prototype.has",!0);wg.exports=function(e){if(!e||typeof e!="object")return!1;try{if($m(e,$m),Nm)try{Nm(e,Nm)}catch{return!0}return e instanceof ZC}catch{}return!1}}else wg.exports=function(e){return!1};var HC=wg.exports,WC=Qx,XC=tw,JC=qC,KC=HC,YC=function(e){if(e&&typeof e=="object"){if(WC(e))return"Map";if(XC(e))return"Set";if(JC(e))return"WeakMap";if(KC(e))return"WeakSet"}return!1},dw=Function.prototype.toString,mc=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Sg,ad;if(typeof mc=="function"&&typeof Object.defineProperty=="function")try{Sg=Object.defineProperty({},"length",{get:function(){throw ad}}),ad={},mc(function(){throw 42},null,Sg)}catch(n){n!==ad&&(mc=null)}else mc=null;var QC=/^\s*class\b/,kg=function(e){try{var t=dw.call(e);return QC.test(t)}catch{return!1}},jm=function(e){try{return kg(e)?!1:(dw.call(e),!0)}catch{return!1}},ld=Object.prototype.toString,eA="[object Object]",tA="[object Function]",rA="[object GeneratorFunction]",iA="[object HTMLAllCollection]",nA="[object HTML document.all class]",oA="[object HTMLCollection]",sA=typeof Symbol=="function"&&!!Symbol.toStringTag,aA=!(0 in[,]),Eg=function(){return!1};if(typeof document=="object"){var lA=document.all;ld.call(lA)===ld.call(document.all)&&(Eg=function(e){if((aA||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=ld.call(e);return(t===iA||t===nA||t===oA||t===eA)&&e("")==null}catch{}return!1})}var cA=mc?function(e){if(Eg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{mc(e,null,Sg)}catch(t){if(t!==ad)return!1}return!kg(e)&&jm(e)}:function(e){if(Eg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(sA)return jm(e);if(kg(e))return!1;var t=ld.call(e);return t!==tA&&t!==rA&&!/^\[object HTML/.test(t)?!1:jm(e)},uA=cA,hA=Object.prototype.toString,pw=Object.prototype.hasOwnProperty,fA=function(e,t,o){for(var l=0,u=e.length;l=3&&(l=o),hA.call(e)==="[object Array]"?fA(e,t,l):typeof e=="string"?dA(e,t,l):pA(e,t,l)},gA=mA,yA=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Vm=yA,_A=typeof globalThis>"u"?vc:globalThis,vA=function(){for(var e=[],t=0;t"u"?vc:globalThis,Pg=bA(),ky=Sy("String.prototype.slice"),Um=Object.getPrototypeOf,wA=Sy("Array.prototype.indexOf",!0)||function(e,t){for(var o=0;o-1?t:t!=="Object"?!1:kA(e)}return cd?SA(e):null},PA=xo,d1=PA("ArrayBuffer.prototype.byteLength",!0),MA=aw,IA=function(e){return MA(e)?d1?d1(e):e.byteLength:NaN},gw=sI,ls=xo,p1=CI,TA=as,Ec=qT,CA=Xx,m1=QT,g1=jx,y1=Jx,_1=aw,v1=lC,b1=fC,x1=pC,w1=cy,S1=UC,k1=YC,E1=EA,P1=IA,M1=ls("SharedArrayBuffer.prototype.byteLength",!0),I1=ls("Date.prototype.getTime"),qm=Object.getPrototypeOf,T1=ls("Object.prototype.toString"),Nd=TA("%Set%",!0),Mg=ls("Map.prototype.has",!0),jd=ls("Map.prototype.get",!0),C1=ls("Map.prototype.size",!0),Vd=ls("Set.prototype.add",!0),yw=ls("Set.prototype.delete",!0),Ud=ls("Set.prototype.has",!0),ud=ls("Set.prototype.size",!0);function A1(n,e,t,o){for(var l=Ec(n),u;(u=l.next())&&!u.done;)if(Fo(e,u.value,t,o))return yw(n,u.value),!0;return!1}function _w(n){if(typeof n>"u")return null;if(typeof n!="object")return typeof n=="symbol"?!1:typeof n=="string"||typeof n=="number"?+n==+n:!0}function AA(n,e,t,o,l,u){var f=_w(t);if(f!=null)return f;var c=jd(e,f),y=gw({},l,{strict:!1});return typeof c>"u"&&!Mg(e,f)||!Fo(o,c,y,u)?!1:!Mg(n,f)&&Fo(o,c,y,u)}function zA(n,e,t){var o=_w(t);return o??(Ud(e,o)&&!Ud(n,o))}function z1(n,e,t,o,l,u){for(var f=Ec(n),c,y;(c=f.next())&&!c.done;)if(y=c.value,Fo(t,y,l,u)&&Fo(o,jd(e,y),l,u))return yw(n,y),!0;return!1}function Fo(n,e,t,o){var l=t||{};if(l.strict?m1(n,e):n===e)return!0;var u=S1(n),f=S1(e);if(u!==f)return!1;if(!n||!e||typeof n!="object"&&typeof e!="object")return l.strict?m1(n,e):n==e;var c=o.has(n),y=o.has(e),w;if(c&&y){if(o.get(n)===o.get(e))return!0}else w={};return c||o.set(n,w),y||o.set(e,w),FA(n,e,l,o)}function L1(n){return!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number"?!1:!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))}function LA(n,e,t,o){if(ud(n)!==ud(e))return!1;for(var l=Ec(n),u=Ec(e),f,c,y;(f=l.next())&&!f.done;)if(f.value&&typeof f.value=="object")y||(y=new Nd),Vd(y,f.value);else if(!Ud(e,f.value)){if(t.strict||!zA(n,e,f.value))return!1;y||(y=new Nd),Vd(y,f.value)}if(y){for(;(c=u.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!A1(y,c.value,t.strict,o))return!1}else if(!t.strict&&!Ud(n,c.value)&&!A1(y,c.value,t.strict,o))return!1;return ud(y)===0}return!0}function DA(n,e,t,o){if(C1(n)!==C1(e))return!1;for(var l=Ec(n),u=Ec(e),f,c,y,w,M,k;(f=l.next())&&!f.done;)if(w=f.value[0],M=f.value[1],w&&typeof w=="object")y||(y=new Nd),Vd(y,w);else if(k=jd(e,w),typeof k>"u"&&!Mg(e,w)||!Fo(M,k,t,o)){if(t.strict||!AA(n,e,w,M,t,o))return!1;y||(y=new Nd),Vd(y,w)}if(y){for(;(c=u.next())&&!c.done;)if(w=c.value[0],k=c.value[1],w&&typeof w=="object"){if(!z1(y,n,w,k,t,o))return!1}else if(!t.strict&&(!n.has(w)||!Fo(jd(n,w),k,t,o))&&!z1(y,n,w,k,gw({},t,{strict:!1}),o))return!1;return ud(y)===0}return!0}function FA(n,e,t,o){var l,u;if(typeof n!=typeof e||n==null||e==null||T1(n)!==T1(e)||g1(n)!==g1(e))return!1;var f=y1(n),c=y1(e);if(f!==c)return!1;var y=n instanceof Error,w=e instanceof Error;if(y!==w||(y||w)&&(n.name!==e.name||n.message!==e.message))return!1;var M=b1(n),k=b1(e);if(M!==k||(M||k)&&(n.source!==e.source||p1(n)!==p1(e)))return!1;var T=v1(n),z=v1(e);if(T!==z||(T||z)&&I1(n)!==I1(e)||t.strict&&qm&&qm(n)!==qm(e))return!1;var F=E1(n),B=E1(e);if(F!==B)return!1;if(F||B){if(n.length!==e.length)return!1;for(l=0;l=0;l--)if(pe[l]!=Ee[l])return!1;for(l=pe.length-1;l>=0;l--)if(u=pe[l],!Fo(n[u],e[u],t,o))return!1;var Pe=k1(n),$e=k1(e);return Pe!==$e?!1:Pe==="Set"||$e==="Set"?LA(n,e,t,o):Pe==="Map"?DA(n,e,t,o):!0}var RA=function(e,t,o){return Fo(e,t,o,CA())};const zh=Yg(RA);var BA=Object.defineProperty,Dr=(n,e)=>BA(n,"name",{value:e,configurable:!0}),OA=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!nh(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Ig(e),l=Ig(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return nh(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return nh(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Dr(OA,"GeojsonEquality");function nh(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Dr(nh,"sameLength");function Ig(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Dr(Ig,"explode");var Xn=63710088e-1,vw={centimeters:Xn*100,centimetres:Xn*100,degrees:360/(2*Math.PI),feet:Xn*3.28084,inches:Xn*39.37,kilometers:Xn/1e3,kilometres:Xn/1e3,meters:Xn,metres:Xn,miles:Xn/1609.344,millimeters:Xn*1e3,millimetres:Xn*1e3,nauticalmiles:Xn/1852,radians:1,yards:Xn*1.0936},D1={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function os(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Dr(os,"feature");function $A(n,e,t={}){switch(n){case"Point":return Ms(e).geometry;case"LineString":return Ts(e).geometry;case"Polygon":return Ey(e).geometry;case"MultiPoint":return xw(e).geometry;case"MultiLineString":return bw(e).geometry;case"MultiPolygon":return ww(e).geometry;default:throw new Error(n+" is invalid")}}Dr($A,"geometry");function Ms(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!qd(n[0])||!qd(n[1]))throw new Error("coordinates must contain numbers");return os({type:"Point",coordinates:n},e,t)}Dr(Ms,"point");function NA(n,e,t={}){return rp(n.map(o=>Ms(o,e)),t)}Dr(NA,"points");function Ey(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uEy(o,e)),t)}Dr(jA,"polygons");function Ts(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return os({type:"LineString",coordinates:n},e,t)}Dr(Ts,"lineString");function VA(n,e,t={}){return rp(n.map(o=>Ts(o,e)),t)}Dr(VA,"lineStrings");function rp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Dr(rp,"featureCollection");function bw(n,e,t={}){return os({type:"MultiLineString",coordinates:n},e,t)}Dr(bw,"multiLineString");function xw(n,e,t={}){return os({type:"MultiPoint",coordinates:n},e,t)}Dr(xw,"multiPoint");function ww(n,e,t={}){return os({type:"MultiPolygon",coordinates:n},e,t)}Dr(ww,"multiPolygon");function UA(n,e,t={}){return os({type:"GeometryCollection",geometries:n},e,t)}Dr(UA,"geometryCollection");function qA(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Dr(qA,"round");function Sw(n,e="kilometers"){const t=vw[e];if(!t)throw new Error(e+" units is invalid");return n*t}Dr(Sw,"radiansToLength");function Py(n,e="kilometers"){const t=vw[e];if(!t)throw new Error(e+" units is invalid");return n/t}Dr(Py,"lengthToRadians");function GA(n,e){return kw(Py(n,e))}Dr(GA,"lengthToDegrees");function ZA(n){let e=n%360;return e<0&&(e+=360),e}Dr(ZA,"bearingToAzimuth");function kw(n){return n%(2*Math.PI)*180/Math.PI}Dr(kw,"radiansToDegrees");function HA(n){return n%360*Math.PI/180}Dr(HA,"degreesToRadians");function WA(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return Sw(Py(n,e),t)}Dr(WA,"convertLength");function XA(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=D1[e];if(!o)throw new Error("invalid original units");const l=D1[t];if(!l)throw new Error("invalid final units");return n/o*l}Dr(XA,"convertArea");function qd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Dr(qd,"isNumber");function My(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Dr(My,"isObject");function JA(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!qd(e))throw new Error("bbox must only contain numbers")})}Dr(JA,"validateBBox");function KA(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Dr(KA,"validateId");var YA=Object.defineProperty,an=(n,e)=>YA(n,"name",{value:e,configurable:!0});function Rc(n,e,t){if(n!==null)for(var o,l,u,f,c,y,w,M=0,k=0,T,z=n.type,F=z==="FeatureCollection",B=z==="Feature",G=F?n.features.length:1,J=0;Jy||F>w||B>M){c=k,y=o,w=F,M=B,u=0;return}var G=Ts([c,k],t.properties);if(e(G,o,l,B,u)===!1)return!1;u++,c=k})===!1)return!1}}})}an(Mw,"segmentEach");function o3(n,e,t){var o=t,l=!1;return Mw(n,function(u,f,c,y,w){l===!1&&t===void 0?o=u:o=e(o,u,f,c,y,w),l=!0}),o}an(o3,"segmentReduce");function Iw(n,e){if(!n)throw new Error("geojson is required");ip(n,function(t,o,l){if(t.geometry!==null){var u=t.geometry.type,f=t.geometry.coordinates;switch(u){case"LineString":if(e(t,o,l,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cc3(n,"name",{value:e,configurable:!0});function Ty(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return Rc(n,o=>{t[0]>o[0]&&(t[0]=o[0]),t[1]>o[1]&&(t[1]=o[1]),t[2] line1 must only contain 2 coordinates");if(o.length!==2)throw new Error(" line2 must only contain 2 coordinates");var l=t[0][0],u=t[0][1],f=t[1][0],c=t[1][1],y=o[0][0],w=o[0][1],M=o[1][0],k=o[1][1],T=(k-w)*(f-l)-(M-y)*(c-u),z=(M-y)*(u-w)-(k-w)*(l-y),F=(f-l)*(u-w)-(c-u)*(l-y);if(T===0)return null;var B=z/T,G=F/T;if(B>=0&&B<=1&&G>=0&&G<=1){var J=l+B*(f-l),j=u+B*(c-u);return hi([J,j])}return null}function m3(n,e,t){t===void 0&&(t={});var o=hi([1/0,1/0],{dist:1/0}),l=0;return Ls(n,function(u){for(var f=yo(u),c=0;c0&&(G=B.features[0],G.properties.dist=Ki(e,G,t),G.properties.location=l+Ki(y,G,t)),y.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(e);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let t=this.dragFrom[0]-e.lngLat.lng,o=this.dragFrom[1]-e.lngLat.lat;for(let l of this.points)l[0]-=t,l[1]-=o}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});Jr(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let t=[];if(B1(this.points).forEach((o,l)=>{t.push([l+1,m3(o,this.cursor).properties.dist])}),t.sort((o,l)=>o[1]-l[1]),t.length>0){let o=t[0][0];this.points.splice(o,0,this.cursor.geometry.coordinates),this.hover=o}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(e))});Jr(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=Gm(e.lngLat.toArray()),this.onClick(e),this.finish())});Jr(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});Jr(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});Jr(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});Jr(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let e=this.polygonFeature();if(e)for(let t of this.eventListenersSuccess)t(e);else for(let t of this.eventListenersFailure)t();this.stop()}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(e){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let e=Lw();this.points.forEach((l,u)=>{let f=Gm(l);f.properties.hover=this.hover==u,f.properties.idx=u,e.features.push(f)}),e.features=e.features.concat(B1(this.points));let t=this.polygonFeature();t&&(t.properties.hover=this.hover=="polygon",e.features.push(t)),Fw.set(e);let o="crosshair";this.hover!=null&&(o=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=o,Rw.set(this.previousStates.length)}pointsUpdated(){let e=this.polygonFeature();if(e)for(let t of this.eventListenersUpdated)t(e)}recalculateHovering(e){this.cursor=null,this.hover=null;for(let t of this.map.queryRenderedFeatures(e.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(t.geometry.type=="Polygon"){this.hover="polygon";break}else if(t.geometry.type=="Point"&&Object.hasOwn(t.properties,"idx")){this.hover=t.properties.idx;break}this.hover==null&&(this.cursor=Gm(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(Dw),t=[JSON.parse(JSON.stringify(e))];return t[0].push(JSON.parse(JSON.stringify(t[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>g3&&this.previousStates.shift()}}function B1(n){let e=[];for(let t=0;t=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[n[n.length-1],n[0]]},properties:{}}),e}let Bt;const Bw=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Bw.decode();let oh=null;function _h(){return(oh===null||oh.byteLength===0)&&(oh=new Uint8Array(Bt.memory.buffer)),oh}function es(n,e){return n=n>>>0,Bw.decode(_h().subarray(n,n+e))}const Is=new Array(128).fill(void 0);Is.push(void 0,null,!0,!1);let vh=Is.length;function Fi(n){vh===Is.length&&Is.push(Is.length+1);const e=vh;return vh=Is[e],Is[e]=n,e}function lr(n){return Is[n]}function _3(n){n<132||(Is[n]=vh,vh=n)}function hd(n){const e=lr(n);return _3(n),e}function Zm(n){return n==null}let sh=null;function v3(){return(sh===null||sh.byteLength===0)&&(sh=new Float64Array(Bt.memory.buffer)),sh}let ah=null;function Gr(){return(ah===null||ah.byteLength===0)&&(ah=new Int32Array(Bt.memory.buffer)),ah}let ca=0;const fd=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},b3=typeof fd.encodeInto=="function"?function(n,e){return fd.encodeInto(n,e)}:function(n,e){const t=fd.encode(n);return e.set(t),{read:n.length,written:t.length}};function Wf(n,e,t){if(t===void 0){const c=fd.encode(n),y=e(c.length,1)>>>0;return _h().subarray(y,y+c.length).set(c),ca=c.length,y}let o=n.length,l=e(o,1)>>>0;const u=_h();let f=0;for(;f127)break;u[l+f]=c}if(f!==o){f!==0&&(n=n.slice(f)),l=t(l,o,o=f+n.length*3,1)>>>0;const c=_h().subarray(l+f,l+o),y=b3(n,c);f+=y.written}return ca=f,l}function Tg(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const l=n.description;return l==null?"Symbol":`Symbol(${l})`}if(e=="function"){const l=n.name;return typeof l=="string"&&l.length>0?`Function(${l})`:"Function"}if(Array.isArray(n)){const l=n.length;let u="[";l>0&&(u+=Tg(n[0]));for(let f=1;f1)o=t[1];else return toString.call(n);if(o=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} +${n.stack}`:o}function x3(n,e){const t=e(n.length*1,1)>>>0;return _h().set(n,t/1),ca=n.length,t}function Hm(n,e){try{return n.apply(this,e)}catch(t){Bt.__wbindgen_exn_store(Fi(t))}}class Gd{static __wrap(e){e=e>>>0;const t=Object.create(Gd.prototype);return t.__wbg_ptr=e,t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();Bt.__wbg_jsroutesnapper_free(e)}constructor(e){try{const u=Bt.__wbindgen_add_to_stack_pointer(-16),f=x3(e,Bt.__wbindgen_malloc),c=ca;Bt.jsroutesnapper_new(u,f,c);var t=Gr()[u/4+0],o=Gr()[u/4+1],l=Gr()[u/4+2];if(l)throw hd(o);return Gd.__wrap(t)}finally{Bt.__wbindgen_add_to_stack_pointer(16)}}setRouteConfig(e){Bt.jsroutesnapper_setRouteConfig(this.__wbg_ptr,Fi(e))}setAreaMode(){Bt.jsroutesnapper_setAreaMode(this.__wbg_ptr)}getConfig(){let e,t;try{const u=Bt.__wbindgen_add_to_stack_pointer(-16);Bt.jsroutesnapper_getConfig(u,this.__wbg_ptr);var o=Gr()[u/4+0],l=Gr()[u/4+1];return e=o,t=l,es(o,l)}finally{Bt.__wbindgen_add_to_stack_pointer(16),Bt.__wbindgen_free(e,t,1)}}toFinalFeature(){try{const o=Bt.__wbindgen_add_to_stack_pointer(-16);Bt.jsroutesnapper_toFinalFeature(o,this.__wbg_ptr);var e=Gr()[o/4+0],t=Gr()[o/4+1];let l;return e!==0&&(l=es(e,t).slice(),Bt.__wbindgen_free(e,t*1)),l}finally{Bt.__wbindgen_add_to_stack_pointer(16)}}renderGeojson(){let e,t;try{const u=Bt.__wbindgen_add_to_stack_pointer(-16);Bt.jsroutesnapper_renderGeojson(u,this.__wbg_ptr);var o=Gr()[u/4+0],l=Gr()[u/4+1];return e=o,t=l,es(o,l)}finally{Bt.__wbindgen_add_to_stack_pointer(16),Bt.__wbindgen_free(e,t,1)}}toggleSnapMode(){Bt.jsroutesnapper_toggleSnapMode(this.__wbg_ptr)}onMouseMove(e,t,o){return Bt.jsroutesnapper_onMouseMove(this.__wbg_ptr,e,t,o)!==0}onClick(){Bt.jsroutesnapper_onClick(this.__wbg_ptr)}onDragStart(){return Bt.jsroutesnapper_onDragStart(this.__wbg_ptr)!==0}onMouseUp(){return Bt.jsroutesnapper_onMouseUp(this.__wbg_ptr)!==0}clearState(){Bt.jsroutesnapper_clearState(this.__wbg_ptr)}editExisting(e){try{const l=Bt.__wbindgen_add_to_stack_pointer(-16);Bt.jsroutesnapper_editExisting(l,this.__wbg_ptr,Fi(e));var t=Gr()[l/4+0],o=Gr()[l/4+1];if(o)throw hd(t)}finally{Bt.__wbindgen_add_to_stack_pointer(16)}}debugRenderGraph(){let e,t;try{const u=Bt.__wbindgen_add_to_stack_pointer(-16);Bt.jsroutesnapper_debugRenderGraph(u,this.__wbg_ptr);var o=Gr()[u/4+0],l=Gr()[u/4+1];return e=o,t=l,es(o,l)}finally{Bt.__wbindgen_add_to_stack_pointer(16),Bt.__wbindgen_free(e,t,1)}}debugSnappableNodes(){let e,t;try{const u=Bt.__wbindgen_add_to_stack_pointer(-16);Bt.jsroutesnapper_debugSnappableNodes(u,this.__wbg_ptr);var o=Gr()[u/4+0],l=Gr()[u/4+1];return e=o,t=l,es(o,l)}finally{Bt.__wbindgen_add_to_stack_pointer(16),Bt.__wbindgen_free(e,t,1)}}routeNameForWaypoints(e){let t,o;try{const M=Bt.__wbindgen_add_to_stack_pointer(-16);Bt.jsroutesnapper_routeNameForWaypoints(M,this.__wbg_ptr,Fi(e));var l=Gr()[M/4+0],u=Gr()[M/4+1],f=Gr()[M/4+2],c=Gr()[M/4+3],y=l,w=u;if(c)throw y=0,w=0,hd(f);return t=y,o=w,es(y,w)}finally{Bt.__wbindgen_add_to_stack_pointer(16),Bt.__wbindgen_free(t,o,1)}}addSnappedWaypoint(e,t){Bt.jsroutesnapper_addSnappedWaypoint(this.__wbg_ptr,e,t)}undo(){Bt.jsroutesnapper_undo(this.__wbg_ptr)}}async function w3(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(o){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o);else throw o}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function S3(){const n={};return n.wbg={},n.wbg.__wbindgen_string_new=function(e,t){const o=es(e,t);return Fi(o)},n.wbg.__wbindgen_object_drop_ref=function(e){hd(e)},n.wbg.__wbindgen_error_new=function(e,t){const o=new Error(es(e,t));return Fi(o)},n.wbg.__wbindgen_is_object=function(e){const t=lr(e);return typeof t=="object"&&t!==null},n.wbg.__wbindgen_is_undefined=function(e){return lr(e)===void 0},n.wbg.__wbindgen_in=function(e,t){return lr(e)in lr(t)},n.wbg.__wbindgen_number_get=function(e,t){const o=lr(t),l=typeof o=="number"?o:void 0;v3()[e/8+1]=Zm(l)?0:l,Gr()[e/4+0]=!Zm(l)},n.wbg.__wbindgen_boolean_get=function(e){const t=lr(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbindgen_jsval_loose_eq=function(e,t){return lr(e)==lr(t)},n.wbg.__wbindgen_string_get=function(e,t){const o=lr(t),l=typeof o=="string"?o:void 0;var u=Zm(l)?0:Wf(l,Bt.__wbindgen_malloc,Bt.__wbindgen_realloc),f=ca;Gr()[e/4+1]=f,Gr()[e/4+0]=u},n.wbg.__wbg_getwithrefkey_d1f0d12f1f1b63ea=function(e,t){const o=lr(e)[lr(t)];return Fi(o)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=lr(e);return Fi(t)},n.wbg.__wbg_String_4370c5505c674d30=function(e,t){const o=String(lr(t)),l=Wf(o,Bt.__wbindgen_malloc,Bt.__wbindgen_realloc),u=ca;Gr()[e/4+1]=u,Gr()[e/4+0]=l},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Fi(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const o=lr(t).stack,l=Wf(o,Bt.__wbindgen_malloc,Bt.__wbindgen_realloc),u=ca;Gr()[e/4+1]=u,Gr()[e/4+0]=l},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let o,l;try{o=e,l=t,console.error(es(e,t))}finally{Bt.__wbindgen_free(o,l,1)}},n.wbg.__wbg_debug_9a6b3243fbbebb61=function(e){console.debug(lr(e))},n.wbg.__wbg_error_788ae33f81d3b84b=function(e){console.error(lr(e))},n.wbg.__wbg_info_2e30e8204b29d91d=function(e){console.info(lr(e))},n.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(lr(e))},n.wbg.__wbg_warn_d60e832f9882c1b2=function(e){console.warn(lr(e))},n.wbg.__wbg_get_44be0491f933a435=function(e,t){const o=lr(e)[t>>>0];return Fi(o)},n.wbg.__wbg_length_fff51ee6522a1a18=function(e){return lr(e).length},n.wbg.__wbindgen_is_function=function(e){return typeof lr(e)=="function"},n.wbg.__wbg_next_526fc47e980da008=function(e){const t=lr(e).next;return Fi(t)},n.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return Hm(function(e){const t=lr(e).next();return Fi(t)},arguments)},n.wbg.__wbg_done_5c1f01fb660d73b5=function(e){return lr(e).done},n.wbg.__wbg_value_1695675138684bd5=function(e){const t=lr(e).value;return Fi(t)},n.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return Fi(Symbol.iterator)},n.wbg.__wbg_get_97b561fb56f034b5=function(){return Hm(function(e,t){const o=Reflect.get(lr(e),lr(t));return Fi(o)},arguments)},n.wbg.__wbg_call_cb65541d95d71282=function(){return Hm(function(e,t){const o=lr(e).call(lr(t));return Fi(o)},arguments)},n.wbg.__wbg_isArray_4c24b343cb13cfb1=function(e){return Array.isArray(lr(e))},n.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(e){let t;try{t=lr(e)instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_buffer_085ec1f694018c4f=function(e){const t=lr(e).buffer;return Fi(t)},n.wbg.__wbg_new_8125e318e6245eed=function(e){const t=new Uint8Array(lr(e));return Fi(t)},n.wbg.__wbg_set_5cf90238115182c3=function(e,t,o){lr(e).set(lr(t),o>>>0)},n.wbg.__wbg_length_72e2208bbc0efc61=function(e){return lr(e).length},n.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(e){let t;try{t=lr(e)instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbindgen_debug_string=function(e,t){const o=Tg(lr(t)),l=Wf(o,Bt.__wbindgen_malloc,Bt.__wbindgen_realloc),u=ca;Gr()[e/4+1]=u,Gr()[e/4+0]=l},n.wbg.__wbindgen_throw=function(e,t){throw new Error(es(e,t))},n.wbg.__wbindgen_memory=function(){const e=Bt.memory;return Fi(e)},n}function k3(n,e){return Bt=n.exports,Ow.__wbindgen_wasm_module=e,sh=null,ah=null,oh=null,Bt}async function Ow(n){if(Bt!==void 0)return Bt;typeof n>"u"&&(n="/scheme-sketcher-lib/assets/route_snapper_bg.wasm");const e=S3();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:o}=await w3(await n,e);return k3(t,o)}function Cg(n,e){return e===void 0&&(e={}),yx(n,function(t,o){var l=o.geometry.coordinates;return t+Ki(l[0],l[1],e)},0)}function $w(n,e,t){if(t===void 0&&(t={}),t.final===!0)return E3(n,e);var o=Bn(n),l=Bn(e),u=ei(o[0]),f=ei(l[0]),c=ei(o[1]),y=ei(l[1]),w=Math.sin(f-u)*Math.cos(y),M=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(f-u);return Ro(Math.atan2(w,M))}function E3(n,e){var t=$w(e,n);return t=(t+180)%360,t}function O1(n,e,t,o){o===void 0&&(o={});var l=Bn(n),u=ei(l[0]),f=ei(l[1]),c=ei(t),y=Lc(e,o.units),w=Math.asin(Math.sin(f)*Math.cos(y)+Math.cos(f)*Math.sin(y)*Math.cos(c)),M=u+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(f),Math.cos(y)-Math.sin(f)*Math.sin(w)),k=Ro(M),T=Ro(w);return hi([k,T],o.properties)}function $1(n,e,t){t===void 0&&(t={});var o=hi([1/0,1/0],{dist:1/0}),l=0;return Ls(n,function(u){for(var f=yo(u),c=0;c0&&(G=B.features[0],G.properties.dist=Ki(e,G,t),G.properties.location=l+Ki(y,G,t)),y.properties.dist=f){var c=(t+l)/2;return[e,c-(o-e)/2,o,c+(o-e)/2]}else{var y=(e+o)/2;return[y-(l-t)/2,t,y+(l-t)/2,l]}}function Ag(n){var e=[1/0,1/0,-1/0,-1/0];return hl(n,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2] is required");if(typeof t!="number")throw new Error(" must be a number");if(typeof o!="number")throw new Error(" must be a number");(l===!1||l===void 0)&&(n=JSON.parse(JSON.stringify(n)));var u=Math.pow(10,t);return hl(n,function(f){T3(f,u,o)}),n}function T3(n,e,t){n.length>t&&n.splice(t,n.length);for(var o=0;o0&&(G=B.features[0],G.properties.dist=Ki(e,G,t),G.properties.location=l+Ki(y,G,t)),y.properties.dist1&&t.push(Ri(M)),go(t)}function jw(n,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var t,o=1/0;return wc(e,function(l){var u=A3(l,n),f=u.properties.dist;f{if(!this.active)return;const c=[f.point.x-F3,f.point.y],y=this.map.unproject(f.point).distanceTo(this.map.unproject(c));this.inner.onMouseMove(f.lngLat.lng,f.lngLat.lat,y)&&(this.redraw(),this.dataUpdated())},this.onClick=()=>{this.active&&(this.inner.onClick(),this.redraw(),this.dataUpdated())},this.onDoubleClick=f=>{this.active&&(f.preventDefault(),this.inner.onClick(),this.finish())},this.onDragStart=()=>{this.active&&this.inner.onDragStart()&&this.map.dragPan.disable()},this.onMouseUp=()=>{this.active&&this.inner.onMouseUp()&&this.map.dragPan.enable()},this.onKeyDown=f=>{this.active&&f.key=="Escape"&&(f.stopPropagation(),this.cancel())},this.onKeyPress=f=>{this.active&&f.target.tagName!="INPUT"&&(f.key=="Enter"?(f.stopPropagation(),this.finish()):f.key=="s"||f.key=="S"?(f.stopPropagation(),this.inner.toggleSnapMode(),this.redraw()):f.key=="z"&&f.ctrlKey&&this.undo())},this.map=e,console.time("Deserialize and setup JsRouteSnapper"),this.inner=new Gd(t),console.timeEnd("Deserialize and setup JsRouteSnapper"),this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.routeToolGj=o,this.snapMode=l,this.undoLength=u,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("dragstart",this.onDragStart),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keypress",this.onKeyPress)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("dragstart",this.onDragStart),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keypress",this.onKeyPress)}startRoute(){this.active||(this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}startArea(){this.active||(this.inner.setAreaMode(),this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}stop(){this.active=!1,this.inner.clearState(),this.redraw(),this.map.boxZoom.enable(),this.map.doubleClickZoom.enable()}editExistingRoute(e){this.active&&window.alert("Bug: editExistingRoute called when tool is already active"),e.properties.waypoints||(e.properties.waypoints=[{lon:e.geometry.coordinates[0][0],lat:e.geometry.coordinates[0][1],snapped:!0},{lon:e.geometry.coordinates[e.geometry.coordinates.length-1][0],lat:e.geometry.coordinates[e.geometry.coordinates.length-1][1],snapped:!0}]),this.startRoute(),this.inner.editExisting(e.properties.waypoints),this.redraw()}editExistingArea(e){this.active&&window.alert("Bug: editExistingArea called when tool is already active"),e.properties.waypoints||window.alert("Bug: editExistingArea called for a polygon not produced by the route-snapper"),this.startArea(),this.inner.editExisting(e.properties.waypoints),this.redraw()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}isActive(){return this.active}finish(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersSuccess)t(JSON.parse(e));else for(let t of this.eventListenersFailure)t();this.stop()}cancel(){this.inner.clearState(),this.finish()}setRouteConfig(e){this.inner.setRouteConfig(e),this.redraw()}addSnappedWaypoint(e){this.inner.addSnappedWaypoint(e[0],e[1]),this.redraw()}undo(){this.inner.undo(),this.redraw()}toggleSnapMode(){this.inner.toggleSnapMode(),this.redraw()}redraw(){let e=JSON.parse(this.inner.renderGeojson());this.routeToolGj.set(e),this.map.getCanvas().style.cursor=e.cursor,this.snapMode.set(e.snap_mode),this.undoLength.set(e.undo_length)}dataUpdated(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersUpdated)t(JSON.parse(e))}}function B3(n){return n=="google"||n=="bing"}var nn=[];for(var Xm=0;Xm<256;++Xm)nn.push((Xm+256).toString(16).slice(1));function O3(n,e=0){return(nn[n[e+0]]+nn[n[e+1]]+nn[n[e+2]]+nn[n[e+3]]+"-"+nn[n[e+4]]+nn[n[e+5]]+"-"+nn[n[e+6]]+nn[n[e+7]]+"-"+nn[n[e+8]]+nn[n[e+9]]+"-"+nn[n[e+10]]+nn[n[e+11]]+nn[n[e+12]]+nn[n[e+13]]+nn[n[e+14]]+nn[n[e+15]]).toLowerCase()}var Xf,$3=new Uint8Array(16);function N3(){if(!Xf&&(Xf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xf($3)}var j3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const q1={randomUUID:j3};function V3(n,e,t){if(q1.randomUUID&&!e&&!n)return q1.randomUUID();n=n||{};var o=n.random||(n.rng||N3)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){t=t||0;for(var l=0;l<16;++l)e[t+l]=o[l];return e}return O3(o)}const bh={hovering:"black",lineEndpointColor:"black"},Zd=10,ol=10;function U3(){return q3(["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"])}function q3(n){return n[Math.floor(Math.random()*n.length)]}const kh=Yr(null),Pc=Yr(null),Ds=Yr(null),dd=Yr(new Set),xh=Yr(null),dr=Yr({mode:"list"});function Lh(n){let e=new Set;for(let o of n.features)e.add(o.id);let t=e.size+1;for(;e.has(t);)t++;return t}function G1(n,e){console.log(`Deleting intervention ${e}`),n.update(t=>(t.features=t.features.filter(o=>o.id!=e),t)),xh.set(null),dr.set({mode:"list"})}function op(n){return Object.values(n.schemes)[0].scheme_reference}function Vw(n){return[Math.round(n[0]*1e7)/1e7,Math.round(n[1]*1e7)/1e7]}const ul=Yr(G3());ul.subscribe(n=>window.localStorage.setItem("userSettings",JSON.stringify(n)));function G3(){let n={streetViewImagery:"google",avoidDoublingBack:!1};try{let e=JSON.parse(window.localStorage.getItem("userSettings")||"{}");B3(e.streetViewImagery)&&(n.streetViewImagery=e.streetViewImagery),typeof e.avoidDoublingBack=="boolean"&&(n.avoidDoublingBack=e.avoidDoublingBack)}catch(e){console.log(`Couldn't parse userSettings from local storage: ${e}`)}return n}function Uw(n){let e={type:"FeatureCollection",features:[],schemes:{}};return qw(n,e),e}function qw(n,e){let t=V3(),o=n.initializeEmptyScheme({scheme_reference:t,color:U3()});e.schemes[t]=o}function xr(n,e){return{id:e,beforeId:Z3(n,e)}}function Z3(n,e){let t=Hb(ro);if(!t){console.warn(`getBeforeId(${e}) called before map is ready. Z-ordering may be incorrect.`);return}let o,l=!1;for(let u=n.layerZorder.length-1;u>=0;u--){let f=n.layerZorder[u];if(f==e){l=!0;break}t.getLayer(f)&&(o=f)}if(!l)throw new Error(`Layer ID ${e} not defined in layerZorder`);return o}const sl=["==",["geometry-type"],"Polygon"],Eh=["==",["geometry-type"],"LineString"],Ph=["==",["geometry-type"],"Point"];function Mc(){return{type:"FeatureCollection",features:[]}}function lh(n,e,t){let o=["match",n];for(let[l,u]of Object.entries(e))o.push(l),o.push(u);return o.push(t),o}function Gw(n){return Tw(n)}function H3(n){var t,o;let e={type:"FeatureCollection",features:[]};for(let l of n.features)if(e.features.push(l),l.geometry.type=="LineString"&&!((t=l.properties)!=null&&t.hide_while_editing))for(let u of[l.geometry.coordinates[0],l.geometry.coordinates[l.geometry.coordinates.length-1]])e.features.push({type:"Feature",properties:{endpoint:!0,scheme_reference:(o=l.properties)==null?void 0:o.scheme_reference},geometry:{type:"Point",coordinates:u}});return e}const pd=Yr(null),md=Yr(100);function Z1(n){let e,t;return e=new mE({props:{url:n[3],coordinates:[[n[1].lng,n[1].lat],[n[4].lng,n[1].lat],[n[4].lng,n[4].lat],[n[1].lng,n[4].lat]],$$slots:{default:[W3]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&8&&(u.url=o[3]),l&18&&(u.coordinates=[[o[1].lng,o[1].lat],[o[4].lng,o[1].lat],[o[4].lng,o[4].lat],[o[1].lng,o[4].lat]]),l&545&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function W3(n){let e,t;const o=[xr(n[0],"georeferenced-image"),{paint:{"raster-fade-duration":0,"raster-opacity":n[5]/100}}];let l={};for(let u=0;ufi(e,"lngLat",c));function w(k){n[8](k)}let M={draggable:!0,$$slots:{default:[J3]},$$scope:{ctx:n}};return n[4]!==void 0&&(M.lngLat=n[4]),l=new Qm({props:M}),Wr.push(()=>fi(l,"lngLat",w)),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment)},l(k){Fe(e.$$.fragment,k),o=Ge(k),Fe(l.$$.fragment,k)},m(k,T){ze(e,k,T),ce(k,o,T),ze(l,k,T),f=!0},p(k,T){const z={};T&512&&(z.$$scope={dirty:T,ctx:k}),!t&&T&2&&(t=!0,z.lngLat=k[1],gi(()=>t=!1)),e.$set(z);const F={};T&512&&(F.$$scope={dirty:T,ctx:k}),!u&&T&16&&(u=!0,F.lngLat=k[4],gi(()=>u=!1)),l.$set(F)},i(k){f||(ae(e.$$.fragment,k),ae(l.$$.fragment,k),f=!0)},o(k){fe(e.$$.fragment,k),fe(l.$$.fragment,k),f=!1},d(k){k&&ee(o),Le(e,k),Le(l,k)}}}function X3(n){let e;return{c(){e=et("span"),this.h()},l(t){e=tt(t,"SPAN",{class:!0,style:!0}),Lt(e).forEach(ee),this.h()},h(){Ke(e,"class","dot svelte-1tmbx1c"),ki(e,"background-color","red")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function J3(n){let e;return{c(){e=et("span"),this.h()},l(t){e=tt(t,"SPAN",{class:!0,style:!0}),Lt(e).forEach(ee),this.h()},h(){Ke(e,"class","dot svelte-1tmbx1c"),ki(e,"background-color","blue")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function K3(n){let e,t,o,l=n[3]&&Z1(n),u=n[3]&&n[2].mode=="set-image"&&H1(n);return{c(){l&&l.c(),e=qe(),u&&u.c(),t=$t()},l(f){l&&l.l(f),e=Ge(f),u&&u.l(f),t=$t()},m(f,c){l&&l.m(f,c),ce(f,e,c),u&&u.m(f,c),ce(f,t,c),o=!0},p(f,[c]){f[3]?l?(l.p(f,c),c&8&&ae(l,1)):(l=Z1(f),l.c(),ae(l,1),l.m(e.parentNode,e)):l&&(vr(),fe(l,1,1,()=>{l=null}),br()),f[3]&&f[2].mode=="set-image"?u?(u.p(f,c),c&12&&ae(u,1)):(u=H1(f),u.c(),ae(u,1),u.m(t.parentNode,t)):u&&(vr(),fe(u,1,1,()=>{u=null}),br())},i(f){o||(ae(l),ae(u),o=!0)},o(f){fe(l),fe(u),o=!1},d(f){f&&(ee(e),ee(t)),l&&l.d(f),u&&u.d(f)}}}function Y3(n,e,t){let o,l,u,f;bt(n,ro,T=>t(6,o=T)),bt(n,dr,T=>t(2,l=T)),bt(n,pd,T=>t(3,u=T)),bt(n,md,T=>t(5,f=T));let{cfg:c}=e,y={lng:0,lat:0},w={lng:0,lat:0};function M(T){y=T,t(1,y),t(6,o),t(3,u),t(2,l)}function k(T){w=T,t(4,w),t(6,o),t(3,u),t(2,l),t(1,y)}return n.$$set=T=>{"cfg"in T&&t(0,c=T.cfg)},n.$$.update=()=>{if(n.$$.dirty&78&&o&&u&&l.mode=="set-image"&&y.lng==0&&y.lat==0){let T=o.getBounds();t(1,y.lng=T.getWest()+.4*(T.getEast()-T.getWest()),y),t(4,w.lng=T.getWest()+.6*(T.getEast()-T.getWest()),w),t(1,y.lat=T.getNorth()+.4*(T.getSouth()-T.getNorth()),y),t(4,w.lat=T.getNorth()+.6*(T.getSouth()-T.getNorth()),w)}},[c,y,l,u,w,f,o,M,k]}class Q3 extends Dt{constructor(e){super(),Ft(this,e,Y3,K3,At,{cfg:0})}}function W1(n){let e,t;return e=new ry({props:{openOn:"hover",openIfTopMost:!0,$$slots:{default:[ez,({features:o})=>({16:o}),({features:o})=>o?65536:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&196608&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function ez(n){let e,t,o=n[9](n[16])+"",l;return{c(){e=et("div"),t=et("p"),l=xt(o),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);t=tt(f,"P",{});var c=Lt(t);l=wt(c,o),c.forEach(ee),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-prose")},m(u,f){ce(u,e,f),_t(e,t),_t(t,l)},p(u,f){f&65536&&o!==(o=u[9](u[16])+"")&&ai(l,o)},d(u){u&&ee(e)}}}function tz(n){let e,t,o=n[4]&&W1(n);return{c(){o&&o.c(),e=$t()},l(l){o&&o.l(l),e=$t()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[4]?o?(o.p(l,u),u&16&&ae(o,1)):(o=W1(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function X1(n){let e,t;return e=new ry({props:{openOn:"hover",openIfTopMost:!0,$$slots:{default:[rz,({features:o})=>({16:o}),({features:o})=>o?65536:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&196608&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function rz(n){let e,t,o=n[9](n[16])+"",l;return{c(){e=et("div"),t=et("p"),l=xt(o),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);t=tt(f,"P",{});var c=Lt(t);l=wt(c,o),c.forEach(ee),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-prose")},m(u,f){ce(u,e,f),_t(e,t),_t(t,l)},p(u,f){f&65536&&o!==(o=u[9](u[16])+"")&&ai(l,o)},d(u){u&&ee(e)}}}function iz(n){let e,t,o=n[4]&&X1(n);return{c(){o&&o.c(),e=$t()},l(l){o&&o.l(l),e=$t()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[4]?o?(o.p(l,u),u&16&&ae(o,1)):(o=X1(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function J1(n){let e,t;return e=new ry({props:{openOn:"hover",openIfTopMost:!0,$$slots:{default:[nz,({features:o})=>({16:o}),({features:o})=>o?65536:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&196608&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function nz(n){let e,t,o=n[9](n[16])+"",l;return{c(){e=et("div"),t=et("p"),l=xt(o),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);t=tt(f,"P",{});var c=Lt(t);l=wt(c,o),c.forEach(ee),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-prose")},m(u,f){ce(u,e,f),_t(e,t),_t(t,l)},p(u,f){f&65536&&o!==(o=u[9](u[16])+"")&&ai(l,o)},d(u){u&&ee(e)}}}function oz(n){let e,t,o=n[4]&&J1(n);return{c(){o&&o.c(),e=$t()},l(l){o&&o.l(l),e=$t()},m(l,u){o&&o.m(l,u),ce(l,e,u),t=!0},p(l,u){l[4]?o?(o.p(l,u),u&16&&ae(o,1)):(o=J1(l),o.c(),ae(o,1),o.m(e.parentNode,e)):o&&(vr(),fe(o,1,1,()=>{o=null}),br())},i(l){t||(ae(o),t=!0)},o(l){fe(o),t=!1},d(l){l&&ee(e),o&&o.d(l)}}}function sz(n){let e,t,o,l,u,f,c,y,w,M;const k=[xr(n[0],"interventions-points"),{filter:["all",Ph,n[6],n[7],n[3]]},{paint:{"circle-color":n[2],"circle-radius":Zd}},{hoverCursor:n[4]?"pointer":void 0},{manageHoverState:n[4]}];let T={$$slots:{default:[tz]},$$scope:{ctx:n}};for(let X=0;X(y(),y=da(F,X=>t(11,c=X)),F),M,k,T;bt(n,ro,X=>t(14,M=X)),bt(n,dr,X=>t(12,k=X)),bt(n,dd,X=>t(13,T=X)),n.$$.on_destroy.push(()=>y());let{cfg:z}=e,{gjSchemes:F}=e;w();const B=["!=",["get","hide_while_editing"],!0],G=["!=",["get","endpoint"],!0];let J;function j(X){return lh(["get","scheme_reference"],Object.fromEntries(Object.values(X.schemes).map(pe=>[pe.scheme_reference,pe.color])),"black")}function V(X){k.mode!="list"||!M||X.detail.features[0]&&(M.getCanvas().style.cursor="inherit",dr.set({mode:"edit-form",id:X.detail.features[0].id}))}function me(X){if(X){let pe=X[0],Ee=z.interventionName(pe),Pe=z.schemeName(c.schemes[pe.properties.scheme_reference]);return`${Ee} (${Pe})`}return"Tooltip bug"}return n.$$set=X=>{"cfg"in X&&t(0,z=X.cfg),"gjSchemes"in X&&w(t(1,F=X.gjSchemes))},n.$$.update=()=>{if(n.$$.dirty&2048&&t(5,o=H3(c)),n.$$.dirty&4096&&t(4,l=k.mode=="list"),n.$$.dirty&8192&&t(3,u=lz(T)),n.$$.dirty&2048&&t(10,f=j(c)),n.$$.dirty&5120){let X="grey";k.mode=="edit-form"?t(2,J=["case",["==",["id"],k.id],f,X]):k.mode=="list"?t(2,J=f):k.mode=="split-route"?t(2,J=["case",["==","intervention_type","route"],f,X]):t(2,J=X)}},[z,F,J,u,l,o,B,G,V,me,f,c,k,T]}class uz extends Dt{constructor(e){super(),Ft(this,e,cz,az,At,{cfg:0,gjSchemes:1})}}function hz(n){let e,t,o,l,u,f;const c=[xr(n[0],"edit-polygon-fill"),{filter:sl},{paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}];let y={};for(let z=0;zt(1,o=u));let{cfg:l}=e;return n.$$set=u=>{"cfg"in u&&t(0,l=u.cfg)},[l,o]}class pz extends Dt{constructor(e){super(),Ft(this,e,dz,fz,At,{cfg:0})}}const Zw=Yr(Mc()),gd=Yr(Mc()),Hw=Yr(!0),Ay=Yr(0);function mz(n){let e,t,o,l,u,f;const c=[xr(n[0],"route-points"),{filter:Ph},{paint:{"circle-color":lh(["get","type"],{"snapped-waypoint":"red","free-waypoint":"blue"},"black"),"circle-opacity":["case",["has","hovered"],.5,1],"circle-radius":lh(["get","type"],{node:Jf/2},Jf)}}];let y={};for(let z=0;z({3:o}),({feature:o})=>o?8:0]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&24&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function _z(n){let e,t,o,l;return e=new cl({props:{data:n[1],$$slots:{default:[mz]},$$scope:{ctx:n}}}),o=new cl({props:{data:n[2],$$slots:{default:[yz]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&2&&(c.data=u[1]),f&17&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&4&&(y.data=u[2]),f&16&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}const Jf=10;function K1(n){var e;return(e=n.properties)==null?void 0:e.number}function vz(n,e,t){let o,l;bt(n,Zw,f=>t(1,o=f)),bt(n,gd,f=>t(2,l=f));let{cfg:u}=e;return n.$$set=f=>{"cfg"in f&&t(0,u=f.cfg)},[u,o,l]}class bz extends Dt{constructor(e){super(),Ft(this,e,vz,_z,At,{cfg:0})}}var xz=Object.defineProperty,Fr=(n,e)=>xz(n,"name",{value:e,configurable:!0}),wz=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!ch(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Lg(e),l=Lg(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return ch(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return ch(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Fr(wz,"GeojsonEquality");function ch(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Fr(ch,"sameLength");function Lg(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Fr(Lg,"explode");var Jn=63710088e-1,Ww={centimeters:Jn*100,centimetres:Jn*100,degrees:360/(2*Math.PI),feet:Jn*3.28084,inches:Jn*39.37,kilometers:Jn/1e3,kilometres:Jn/1e3,meters:Jn,metres:Jn,miles:Jn/1609.344,millimeters:Jn*1e3,millimetres:Jn*1e3,nauticalmiles:Jn/1852,radians:1,yards:Jn*1.0936},Y1={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function _a(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Fr(_a,"feature");function Sz(n,e,t={}){switch(n){case"Point":return zy(e).geometry;case"LineString":return Dy(e).geometry;case"Polygon":return Ly(e).geometry;case"MultiPoint":return Jw(e).geometry;case"MultiLineString":return Xw(e).geometry;case"MultiPolygon":return Kw(e).geometry;default:throw new Error(n+" is invalid")}}Fr(Sz,"geometry");function zy(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ic(n[0])||!Ic(n[1]))throw new Error("coordinates must contain numbers");return _a({type:"Point",coordinates:n},e,t)}Fr(zy,"point");function kz(n,e,t={}){return sp(n.map(o=>zy(o,e)),t)}Fr(kz,"points");function Ly(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uLy(o,e)),t)}Fr(Ez,"polygons");function Dy(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return _a({type:"LineString",coordinates:n},e,t)}Fr(Dy,"lineString");function Pz(n,e,t={}){return sp(n.map(o=>Dy(o,e)),t)}Fr(Pz,"lineStrings");function sp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Fr(sp,"featureCollection");function Xw(n,e,t={}){return _a({type:"MultiLineString",coordinates:n},e,t)}Fr(Xw,"multiLineString");function Jw(n,e,t={}){return _a({type:"MultiPoint",coordinates:n},e,t)}Fr(Jw,"multiPoint");function Kw(n,e,t={}){return _a({type:"MultiPolygon",coordinates:n},e,t)}Fr(Kw,"multiPolygon");function Mz(n,e,t={}){return _a({type:"GeometryCollection",geometries:n},e,t)}Fr(Mz,"geometryCollection");function Iz(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Fr(Iz,"round");function Yw(n,e="kilometers"){const t=Ww[e];if(!t)throw new Error(e+" units is invalid");return n*t}Fr(Yw,"radiansToLength");function Fy(n,e="kilometers"){const t=Ww[e];if(!t)throw new Error(e+" units is invalid");return n/t}Fr(Fy,"lengthToRadians");function Tz(n,e){return Ry(Fy(n,e))}Fr(Tz,"lengthToDegrees");function Cz(n){let e=n%360;return e<0&&(e+=360),e}Fr(Cz,"bearingToAzimuth");function Ry(n){return n%(2*Math.PI)*180/Math.PI}Fr(Ry,"radiansToDegrees");function uh(n){return n%360*Math.PI/180}Fr(uh,"degreesToRadians");function Az(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return Yw(Fy(n,e),t)}Fr(Az,"convertLength");function zz(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=Y1[e];if(!o)throw new Error("invalid original units");const l=Y1[t];if(!l)throw new Error("invalid final units");return n/o*l}Fr(zz,"convertArea");function Ic(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Fr(Ic,"isNumber");function Lz(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Fr(Lz,"isObject");function Dz(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Ic(e))throw new Error("bbox must only contain numbers")})}Fr(Dz,"validateBBox");function Fz(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Fr(Fz,"validateId");var Rz=Object.defineProperty,va=(n,e)=>Rz(n,"name",{value:e,configurable:!0});function Dg(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}va(Dg,"getCoord");function Bz(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}va(Bz,"getCoords");function Qw(n){if(n.length>1&&Ic(n[0])&&Ic(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return Qw(n[0]);throw new Error("coordinates must only contain numbers")}va(Qw,"containsNumber");function Oz(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}va(Oz,"geojsonType");function $z(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}va($z,"featureOf");function Nz(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const o of n.features){if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+o.geometry.type)}}va(Nz,"collectionOf");function jz(n){return n.type==="Feature"?n.geometry:n}va(jz,"getGeom");function Vz(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}va(Vz,"getType");var Uz=Object.defineProperty,e2=(n,e)=>Uz(n,"name",{value:e,configurable:!0});function By(n,e,t={}){if(t.final===!0)return t2(n,e);const o=Dg(n),l=Dg(e),u=uh(o[0]),f=uh(l[0]),c=uh(o[1]),y=uh(l[1]),w=Math.sin(f-u)*Math.cos(y),M=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(f-u);return Ry(Math.atan2(w,M))}e2(By,"bearing");function t2(n,e){let t=By(e,n);return t=(t+180)%360,t}e2(t2,"calculateFinalBearing");var qz=Object.defineProperty,Rr=(n,e)=>qz(n,"name",{value:e,configurable:!0}),Gz=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!hh(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Fg(e),l=Fg(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return hh(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return hh(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Rr(Gz,"GeojsonEquality");function hh(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Rr(hh,"sameLength");function Fg(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Rr(Fg,"explode");var Kn=63710088e-1,r2={centimeters:Kn*100,centimetres:Kn*100,degrees:360/(2*Math.PI),feet:Kn*3.28084,inches:Kn*39.37,kilometers:Kn/1e3,kilometres:Kn/1e3,meters:Kn,metres:Kn,miles:Kn/1609.344,millimeters:Kn*1e3,millimetres:Kn*1e3,nauticalmiles:Kn/1852,radians:1,yards:Kn*1.0936},Q1={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function bo(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Rr(bo,"feature");function Zz(n,e,t={}){switch(n){case"Point":return eo(e).geometry;case"LineString":return Lo(e).geometry;case"Polygon":return Oy(e).geometry;case"MultiPoint":return n2(e).geometry;case"MultiLineString":return i2(e).geometry;case"MultiPolygon":return o2(e).geometry;default:throw new Error(n+" is invalid")}}Rr(Zz,"geometry");function eo(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Cc(n[0])||!Cc(n[1]))throw new Error("coordinates must contain numbers");return bo({type:"Point",coordinates:n},e,t)}Rr(eo,"point");function Hz(n,e,t={}){return Tc(n.map(o=>eo(o,e)),t)}Rr(Hz,"points");function Oy(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uOy(o,e)),t)}Rr(Wz,"polygons");function Lo(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return bo({type:"LineString",coordinates:n},e,t)}Rr(Lo,"lineString");function Xz(n,e,t={}){return Tc(n.map(o=>Lo(o,e)),t)}Rr(Xz,"lineStrings");function Tc(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Rr(Tc,"featureCollection");function i2(n,e,t={}){return bo({type:"MultiLineString",coordinates:n},e,t)}Rr(i2,"multiLineString");function n2(n,e,t={}){return bo({type:"MultiPoint",coordinates:n},e,t)}Rr(n2,"multiPoint");function o2(n,e,t={}){return bo({type:"MultiPolygon",coordinates:n},e,t)}Rr(o2,"multiPolygon");function Jz(n,e,t={}){return bo({type:"GeometryCollection",geometries:n},e,t)}Rr(Jz,"geometryCollection");function Kz(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Rr(Kz,"round");function $y(n,e="kilometers"){const t=r2[e];if(!t)throw new Error(e+" units is invalid");return n*t}Rr($y,"radiansToLength");function Ny(n,e="kilometers"){const t=r2[e];if(!t)throw new Error(e+" units is invalid");return n/t}Rr(Ny,"lengthToRadians");function Yz(n,e){return s2(Ny(n,e))}Rr(Yz,"lengthToDegrees");function Qz(n){let e=n%360;return e<0&&(e+=360),e}Rr(Qz,"bearingToAzimuth");function s2(n){return n%(2*Math.PI)*180/Math.PI}Rr(s2,"radiansToDegrees");function fh(n){return n%360*Math.PI/180}Rr(fh,"degreesToRadians");function e4(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return $y(Ny(n,e),t)}Rr(e4,"convertLength");function t4(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=Q1[e];if(!o)throw new Error("invalid original units");const l=Q1[t];if(!l)throw new Error("invalid final units");return n/o*l}Rr(t4,"convertArea");function Cc(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Rr(Cc,"isNumber");function jy(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Rr(jy,"isObject");function r4(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Cc(e))throw new Error("bbox must only contain numbers")})}Rr(r4,"validateBBox");function i4(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Rr(i4,"validateId");var n4=Object.defineProperty,ba=(n,e)=>n4(n,"name",{value:e,configurable:!0});function Rg(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}ba(Rg,"getCoord");function a2(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}ba(a2,"getCoords");function l2(n){if(n.length>1&&Cc(n[0])&&Cc(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return l2(n[0]);throw new Error("coordinates must only contain numbers")}ba(l2,"containsNumber");function o4(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}ba(o4,"geojsonType");function s4(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}ba(s4,"featureOf");function a4(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const o of n.features){if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+o.geometry.type)}}ba(a4,"collectionOf");function l4(n){return n.type==="Feature"?n.geometry:n}ba(l4,"getGeom");function c4(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}ba(c4,"getType");var u4=Object.defineProperty,h4=(n,e)=>u4(n,"name",{value:e,configurable:!0});function pc(n,e,t={}){var o=Rg(n),l=Rg(e),u=fh(l[1]-o[1]),f=fh(l[0]-o[0]),c=fh(o[1]),y=fh(l[1]),w=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(f/2),2)*Math.cos(c)*Math.cos(y);return $y(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),t.units)}h4(pc,"distance");var f4=Object.defineProperty,Br=(n,e)=>f4(n,"name",{value:e,configurable:!0}),d4=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!dh(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=Bg(e),l=Bg(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return dh(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return dh(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Br(d4,"GeojsonEquality");function dh(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Br(dh,"sameLength");function Bg(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Br(Bg,"explode");var Yn=63710088e-1,c2={centimeters:Yn*100,centimetres:Yn*100,degrees:360/(2*Math.PI),feet:Yn*3.28084,inches:Yn*39.37,kilometers:Yn/1e3,kilometres:Yn/1e3,meters:Yn,metres:Yn,miles:Yn/1609.344,millimeters:Yn*1e3,millimetres:Yn*1e3,nauticalmiles:Yn/1852,radians:1,yards:Yn*1.0936},eb={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function xa(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Br(xa,"feature");function p4(n,e,t={}){switch(n){case"Point":return ap(e).geometry;case"LineString":return Uy(e).geometry;case"Polygon":return Vy(e).geometry;case"MultiPoint":return h2(e).geometry;case"MultiLineString":return u2(e).geometry;case"MultiPolygon":return f2(e).geometry;default:throw new Error(n+" is invalid")}}Br(p4,"geometry");function ap(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ac(n[0])||!Ac(n[1]))throw new Error("coordinates must contain numbers");return xa({type:"Point",coordinates:n},e,t)}Br(ap,"point");function m4(n,e,t={}){return lp(n.map(o=>ap(o,e)),t)}Br(m4,"points");function Vy(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uVy(o,e)),t)}Br(g4,"polygons");function Uy(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return xa({type:"LineString",coordinates:n},e,t)}Br(Uy,"lineString");function y4(n,e,t={}){return lp(n.map(o=>Uy(o,e)),t)}Br(y4,"lineStrings");function lp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Br(lp,"featureCollection");function u2(n,e,t={}){return xa({type:"MultiLineString",coordinates:n},e,t)}Br(u2,"multiLineString");function h2(n,e,t={}){return xa({type:"MultiPoint",coordinates:n},e,t)}Br(h2,"multiPoint");function f2(n,e,t={}){return xa({type:"MultiPolygon",coordinates:n},e,t)}Br(f2,"multiPolygon");function _4(n,e,t={}){return xa({type:"GeometryCollection",geometries:n},e,t)}Br(_4,"geometryCollection");function v4(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Br(v4,"round");function d2(n,e="kilometers"){const t=c2[e];if(!t)throw new Error(e+" units is invalid");return n*t}Br(d2,"radiansToLength");function cp(n,e="kilometers"){const t=c2[e];if(!t)throw new Error(e+" units is invalid");return n/t}Br(cp,"lengthToRadians");function b4(n,e){return Hd(cp(n,e))}Br(b4,"lengthToDegrees");function x4(n){let e=n%360;return e<0&&(e+=360),e}Br(x4,"bearingToAzimuth");function Hd(n){return n%(2*Math.PI)*180/Math.PI}Br(Hd,"radiansToDegrees");function yd(n){return n%360*Math.PI/180}Br(yd,"degreesToRadians");function w4(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return d2(cp(n,e),t)}Br(w4,"convertLength");function S4(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=eb[e];if(!o)throw new Error("invalid original units");const l=eb[t];if(!l)throw new Error("invalid final units");return n/o*l}Br(S4,"convertArea");function Ac(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Br(Ac,"isNumber");function k4(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Br(k4,"isObject");function E4(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Ac(e))throw new Error("bbox must only contain numbers")})}Br(E4,"validateBBox");function P4(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Br(P4,"validateId");var M4=Object.defineProperty,wa=(n,e)=>M4(n,"name",{value:e,configurable:!0});function p2(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}wa(p2,"getCoord");function I4(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}wa(I4,"getCoords");function m2(n){if(n.length>1&&Ac(n[0])&&Ac(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return m2(n[0]);throw new Error("coordinates must only contain numbers")}wa(m2,"containsNumber");function T4(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}wa(T4,"geojsonType");function C4(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}wa(C4,"featureOf");function A4(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const o of n.features){if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+o.geometry.type)}}wa(A4,"collectionOf");function z4(n){return n.type==="Feature"?n.geometry:n}wa(z4,"getGeom");function L4(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}wa(L4,"getType");var D4=Object.defineProperty,F4=(n,e)=>D4(n,"name",{value:e,configurable:!0});function Og(n,e,t,o={}){const l=p2(n),u=yd(l[0]),f=yd(l[1]),c=yd(t),y=cp(e,o.units),w=Math.asin(Math.sin(f)*Math.cos(y)+Math.cos(f)*Math.sin(y)*Math.cos(c)),M=u+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(f),Math.cos(y)-Math.sin(f)*Math.sin(w)),k=Hd(M),T=Hd(w);return ap([k,T],o.properties)}F4(Og,"destination");class g2{constructor(e=[],t=R4){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:o}=this,l=t[e];for(;e>0;){const u=e-1>>1,f=t[u];if(o(l,f)>=0)break;t[e]=f,e=u}t[e]=l}_down(e){const{data:t,compare:o}=this,l=this.length>>1,u=t[e];for(;e=0)break;t[e]=c,e=f}t[e]=u}}function R4(n,e){return ne?1:0}function y2(n,e){return n.p.x>e.p.x?1:n.p.xe.p.y?1:-1:1}function B4(n,e){return n.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:n.rightSweepEvent.p.x0?(M.isLeftEndpoint=!0,w.isLeftEndpoint=!1):(w.isLeftEndpoint=!0,M.isLeftEndpoint=!1),e.push(w),e.push(M),f=c,Qf=Qf+1}}Kf=Kf+1}let $4=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function N4(n,e){if(n===null||e===null||n.leftSweepEvent.ringId===e.leftSweepEvent.ringId&&(n.rightSweepEvent.isSamePoint(e.leftSweepEvent)||n.rightSweepEvent.isSamePoint(e.leftSweepEvent)||n.rightSweepEvent.isSamePoint(e.rightSweepEvent)||n.leftSweepEvent.isSamePoint(e.leftSweepEvent)||n.leftSweepEvent.isSamePoint(e.rightSweepEvent)))return!1;const t=n.leftSweepEvent.p.x,o=n.leftSweepEvent.p.y,l=n.rightSweepEvent.p.x,u=n.rightSweepEvent.p.y,f=e.leftSweepEvent.p.x,c=e.leftSweepEvent.p.y,y=e.rightSweepEvent.p.x,w=e.rightSweepEvent.p.y,M=(w-c)*(l-t)-(y-f)*(u-o),k=(y-f)*(o-c)-(w-c)*(t-f),T=(l-t)*(o-c)-(u-o)*(t-f);if(M===0)return!1;const z=k/M,F=T/M;if(z>=0&&z<=1&&F>=0&&F<=1){const B=t+z*(l-t),G=o+z*(u-o);return[B,G]}return!1}function j4(n,e){e=e||!1;const t=[],o=new g2([],B4);for(;n.length;){const l=n.pop();if(l.isLeftEndpoint){const u=new $4(l);for(let f=0;fU4(n,"name",{value:e,configurable:!0}),G4=V4;function _2(n,e,t={}){const{removeDuplicates:o=!0,ignoreSelfIntersections:l=!1}=t;let u=[];n.type==="FeatureCollection"?u=u.concat(n.features):n.type==="Feature"?u.push(n):(n.type==="LineString"||n.type==="Polygon"||n.type==="MultiLineString"||n.type==="MultiPolygon")&&u.push(bo(n)),e.type==="FeatureCollection"?u=u.concat(e.features):e.type==="Feature"?u.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&u.push(bo(e));const f=G4(Tc(u),l);let c=[];if(o){const y={};f.forEach(w=>{const M=w.join(",");y[M]||(y[M]=!0,c.push(w))})}else c=f;return Tc(c.map(y=>eo(y)))}q4(_2,"lineIntersect");var Z4=Object.defineProperty,ln=(n,e)=>Z4(n,"name",{value:e,configurable:!0});function Dh(n,e,t){if(n!==null)for(var o,l,u,f,c,y,w,M=0,k=0,T,z=n.type,F=z==="FeatureCollection",B=z==="Feature",G=F?n.features.length:1,J=0;Jy||F>w||B>M){c=k,y=o,w=F,M=B,u=0;return}var G=Lo([c,k],t.properties);if(e(G,o,l,B,u)===!1)return!1;u++,c=k})===!1)return!1}}})}ln(x2,"segmentEach");function Q4(n,e,t){var o=t,l=!1;return x2(n,function(u,f,c,y,w){l===!1&&t===void 0?o=u:o=e(o,u,f,c,y,w),l=!0}),o}ln(Q4,"segmentReduce");function w2(n,e){if(!n)throw new Error("geojson is required");Fh(n,function(t,o,l){if(t.geometry!==null){var u=t.geometry.type,f=t.geometry.coordinates;switch(u){case"LineString":if(e(t,o,l,0,0)===!1)return!1;break;case"Polygon":for(var c=0;ce in n?S2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,il=(n,e)=>{for(var t in e||(e={}))oL.call(e,t)&&nb(n,t,e[t]);if(ib)for(var t of ib(e))sL.call(e,t)&&nb(n,t,e[t]);return n},nl=(n,e)=>iL(n,nL(e)),aL=(n,e)=>S2(n,"name",{value:e,configurable:!0});function k2(n,e,t={}){if(!n||!e)throw new Error("lines and pt are required arguments");let o=eo([1/0,1/0],{dist:1/0,index:-1,location:-1}),l=0;return Fh(n,function(u){const f=a2(u);for(let c=0;c0&&B.features[0]&&(G=nl(il({},B.features[0]),{properties:{dist:pc(e,B.features[0],t),location:l+pc(y,B.features[0],t)}})),y.properties.dist(l(),l=da(y,G=>t(8,o=G)),y),f;bt(n,ro,G=>t(9,f=G)),n.$$.on_destroy.push(()=>l());let{cfg:c}=e,{gjSchemes:y}=e;u(),As(()=>{f&&(f.getCanvas().style.cursor=`url(${E2}), crosshair`)}),Ei(()=>{f&&(f.getCanvas().style.cursor="inherit")});let w=null,M=null,k=Mc();function T(G){if(!f)return;t(6,w=null),M=null;let J=B(G.detail.lngLat.toArray());const j=[G.detail.point.x-hL,G.detail.point.y],V=f.unproject(G.detail.point).distanceTo(f.unproject(j))/1e3;let me=[];for(let[X,pe]of o.features.entries())if(pe.geometry.type=="LineString"){let Ee=lL(pe.geometry,J,{units:"kilometers"});Ee.properties.dist!=null&&Ee.properties.dist<=V&&me.push([X,Ee.geometry.coordinates,Ee.properties.dist])}me.sort((X,pe)=>X[2]-pe[2]),me.length>0&&(t(6,w=B(me[0][1])),M=me[0][0])}function z(){if(M==null){dr.set({mode:"list"});return}let G=L3(o.features[M],w);if(G!=null){let[J,j]=G;y.update(V=>(J.id=V.features[M].id,j.id=Lh(V),V.features.splice(M,1,J,j),V))}t(6,w=null),M=null}function F(G){G.key=="Escape"&&(G.stopPropagation(),dr.set({mode:"list"}))}function B(G){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:Vw(G)}}}return n.$$set=G=>{"cfg"in G&&t(0,c=G.cfg),"gjSchemes"in G&&u(t(1,y=G.gjSchemes))},n.$$.update=()=>{if(n.$$.dirty&64){let G=Mc();w&&G.features.push(w),t(2,k=G)}},[c,y,k,T,z,F,w]}class dL extends Dt{constructor(e){super(),Ft(this,e,fL,uL,At,{cfg:0,gjSchemes:1})}}var pL=Object.defineProperty,Or=(n,e)=>pL(n,"name",{value:e,configurable:!0}),mL=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,o,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(o=e==null?void 0:e.direction)!=null?o:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!ph(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const o=$g(e),l=$g(t);return o.every(u=>l.some(f=>this.compare(u,f)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((o,l)=>Math.abs(o-t[l])=0&&(o=[].concat(e.slice(l,e.length),e.slice(1,l+1))),o}comparePath(e,t){return e.every((o,l)=>this.compareCoord(o,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const o=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return o.every(u=>l.some(f=>this.compareLine(u,f,1,!0)))}return!1}compareGeometryCollection(e,t){return ph(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((o,l)=>this.compare(o,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?zh(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return ph(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((o,l)=>this.compare(o,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Or(mL,"GeojsonEquality");function ph(n,e){return n.coordinates?n.coordinates.length===e.coordinates.length:n.length===e.length}Or(ph,"sameLength");function $g(n){return n.coordinates.map(e=>({type:n.type.replace("Multi",""),coordinates:e}))}Or($g,"explode");var Qn=63710088e-1,P2={centimeters:Qn*100,centimetres:Qn*100,degrees:360/(2*Math.PI),feet:Qn*3.28084,inches:Qn*39.37,kilometers:Qn/1e3,kilometres:Qn/1e3,meters:Qn,metres:Qn,miles:Qn/1609.344,millimeters:Qn*1e3,millimetres:Qn*1e3,nauticalmiles:Qn/1852,radians:1,yards:Qn*1.0936},sb={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Sa(n,e,t={}){const o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=e||{},o.geometry=n,o}Or(Sa,"feature");function gL(n,e,t={}){switch(n){case"Point":return Gy(e).geometry;case"LineString":return Zy(e).geometry;case"Polygon":return up(e).geometry;case"MultiPoint":return I2(e).geometry;case"MultiLineString":return M2(e).geometry;case"MultiPolygon":return Hy(e).geometry;default:throw new Error(n+" is invalid")}}Or(gL,"geometry");function Gy(n,e,t={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Wd(n[0])||!Wd(n[1]))throw new Error("coordinates must contain numbers");return Sa({type:"Point",coordinates:n},e,t)}Or(Gy,"point");function yL(n,e,t={}){return hp(n.map(o=>Gy(o,e)),t)}Or(yL,"points");function up(n,e,t={}){for(const l of n){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;uup(o,e)),t)}Or(_L,"polygons");function Zy(n,e,t={}){if(n.length<2)throw new Error("coordinates must be an array of two or more positions");return Sa({type:"LineString",coordinates:n},e,t)}Or(Zy,"lineString");function vL(n,e,t={}){return hp(n.map(o=>Zy(o,e)),t)}Or(vL,"lineStrings");function hp(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}Or(hp,"featureCollection");function M2(n,e,t={}){return Sa({type:"MultiLineString",coordinates:n},e,t)}Or(M2,"multiLineString");function I2(n,e,t={}){return Sa({type:"MultiPoint",coordinates:n},e,t)}Or(I2,"multiPoint");function Hy(n,e,t={}){return Sa({type:"MultiPolygon",coordinates:n},e,t)}Or(Hy,"multiPolygon");function bL(n,e,t={}){return Sa({type:"GeometryCollection",geometries:n},e,t)}Or(bL,"geometryCollection");function xL(n,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(n*t)/t}Or(xL,"round");function T2(n,e="kilometers"){const t=P2[e];if(!t)throw new Error(e+" units is invalid");return n*t}Or(T2,"radiansToLength");function Wy(n,e="kilometers"){const t=P2[e];if(!t)throw new Error(e+" units is invalid");return n/t}Or(Wy,"lengthToRadians");function wL(n,e){return C2(Wy(n,e))}Or(wL,"lengthToDegrees");function SL(n){let e=n%360;return e<0&&(e+=360),e}Or(SL,"bearingToAzimuth");function C2(n){return n%(2*Math.PI)*180/Math.PI}Or(C2,"radiansToDegrees");function kL(n){return n%360*Math.PI/180}Or(kL,"degreesToRadians");function EL(n,e="kilometers",t="kilometers"){if(!(n>=0))throw new Error("length must be a positive number");return T2(Wy(n,e),t)}Or(EL,"convertLength");function PL(n,e="meters",t="kilometers"){if(!(n>=0))throw new Error("area must be a positive number");const o=sb[e];if(!o)throw new Error("invalid original units");const l=sb[t];if(!l)throw new Error("invalid final units");return n/o*l}Or(PL,"convertArea");function Wd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Or(Wd,"isNumber");function ML(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}Or(ML,"isObject");function IL(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(e=>{if(!Wd(e))throw new Error("bbox must only contain numbers")})}Or(IL,"validateBBox");function TL(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Or(TL,"validateId");/** * splaytree v3.1.2 * Fast Splay tree for Node and browser * @@ -602,7 +602,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function CL(n,e){var t={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,l,u,f;return f={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function c(w){return function(M){return y([w,M])}}function y(w){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,l&&(u=w[0]&2?l.return:w[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,w[1])).done)return u;switch(l=0,u&&(w=[w[0]&2,u.value]),w[0]){case 0:case 1:u=w;break;case 4:return t.label++,{value:w[1],done:!1};case 5:t.label++,l=w[1],w=[0];continue;case 7:w=t.ops.pop(),t.trys.pop();continue;default:if(u=t.trys,!(u=u.length>0&&u[u.length-1])&&(w[0]===6||w[0]===2)){t=0;continue}if(w[0]===3&&(!u||w[1]>u[0]&&w[1]e?1:n0){if(e.right===null)break;if(t(n,e.right.key)>0){var c=e.right;if(e.right=c.left,c.left=e,e=c,e.right===null)break}l.right=e,l=e,e=e.right}else break}return l.right=e.left,u.left=e.right,e.left=o.right,e.right=o.left,e}function Jm(n,e,t,o){var l=new fa(n,e);if(t===null)return l.left=l.right=null,l;t=aa(n,t,o);var u=o(n,t.key);return u<0?(l.left=t.left,l.right=t,t.left=null):u>=0&&(l.right=t.right,l.left=t,t.right=null),l}function ab(n,e,t){var o=null,l=null;if(e){e=aa(n,e,t);var u=t(e.key,n);u===0?(o=e.left,l=e.right):u<0?(l=e.right,e.right=null,o=e):(o=e.left,e.left=null,l=e)}return{left:o,right:l}}function zL(n,e,t){return e===null?n:(n===null||(e=aa(n.key,e,t),e.left=n),e)}function Ng(n,e,t,o,l){if(n){o(""+e+(t?"└── ":"├── ")+l(n)+` -`);var u=e+(t?" ":"│ ");n.left&&Ng(n.left,u,!1,o,l),n.right&&Ng(n.right,u,!0,o,l)}}var Xy=function(){function n(e){e===void 0&&(e=AL),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=Jm(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var o=new fa(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);var l=this._comparator,u=aa(e,this._root,l),f=l(e,u.key);return f===0?this._root=u:(f<0?(o.left=u.left,o.right=u,u.left=null):f>0&&(o.right=u.right,o.left=u,u.right=null),this._size++,this._root=o),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,o){var l;if(t===null)return null;t=aa(e,t,o);var u=o(e,t.key);return u===0?(t.left===null?l=t.right:(l=aa(e,t.left,o),l.right=t.right),this._size--,l):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=aa(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,o=this._comparator;t;){var l=o(e,t.key);if(l===0)return t;l<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=aa(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,o=this._comparator;t;){var l=o(e,t.key);if(l===0)return!0;l<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var o=this._root,l=[],u=!1;!u;)o!==null?(l.push(o),o=o.left):l.length!==0?(o=l.pop(),e.call(t,o),o=o.right):u=!0;return this},n.prototype.range=function(e,t,o,l){for(var u=[],f=this._comparator,c=this._root,y;u.length!==0||c;)if(c)u.push(c),c=c.left;else{if(c=u.pop(),y=f(c.key,t),y>0)break;if(f(c.key,e)>=0&&o.call(l,c))return this;c=c.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var o=t.key;return e.push(o)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var o=t.data;return e.push(o)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,o=!1,l=0,u=[];!o;)if(t)u.push(t),t=t.left;else if(u.length>0){if(t=u.pop(),l===e)return t;l++,t=t.right}else o=!0;return null},n.prototype.next=function(e){var t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}for(var l=this._comparator;t;){var u=l(e.key,t.key);if(u===0)break;u<0?(o=t,t=t.left):t=t.right}return o},n.prototype.prev=function(e){var t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}for(var l=this._comparator;t;){var u=l(e.key,t.key);if(u===0)break;u<0?t=t.left:(o=t,t=t.right)}return o},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return DL(this._root)},n.prototype.load=function(e,t,o){t===void 0&&(t=[]),o===void 0&&(o=!1);var l=e.length,u=this._comparator;if(o&&Ug(e,t,0,l-1,u),this._root===null)this._root=jg(e,t,0,l),this._size=l;else{var f=FL(this.toList(),LL(e,t),u);l=this._size+l,this._root=Vg({head:f},0,l)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(o){return String(o.key)});var t=[];return Ng(this._root,"",!0,function(o){return t.push(o)},e),t.join("")},n.prototype.update=function(e,t,o){var l=this._comparator,u=ab(e,this._root,l),f=u.left,c=u.right;l(e,t)<0?c=Jm(t,o,c,l):f=Jm(t,o,f,l),this._root=zL(f,c,l)},n.prototype.split=function(e){return ab(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,o;return CL(this,function(l){switch(l.label){case 0:e=this._root,t=[],o=!1,l.label=1;case 1:return o?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return l.sent(),e=e.right,[3,5];case 4:o=!0,l.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function jg(n,e,t,o){var l=o-t;if(l>0){var u=t+Math.floor(l/2),f=n[u],c=e[u],y=new fa(f,c);return y.left=jg(n,e,t,u),y.right=jg(n,e,u+1,o),y}return null}function LL(n,e){for(var t=new fa(null,null),o=t,l=0;l0?(e=u=u.next=t.pop(),e=e.right):o=!0;return u.next=null,l.next}function Vg(n,e,t){var o=t-e;if(o>0){var l=e+Math.floor(o/2),u=Vg(n,e,l),f=n.head;return f.left=u,n.head=n.head.next,f.right=Vg(n,l+1,t),f}return null}function FL(n,e,t){for(var o=new fa(null,null),l=o,u=n,f=e;u!==null&&f!==null;)t(u.key,f.key)<0?(l.next=u,u=u.next):(l.next=f,f=f.next),l=l.next;return u!==null?l.next=u:f!==null&&(l.next=f),o.next}function Ug(n,e,t,o,l){if(!(t>=o)){for(var u=n[t+o>>1],f=t-1,c=o+1;;){do f++;while(l(n[f],u)<0);do c--;while(l(n[c],u)>0);if(f>=c)break;var y=n[f];n[f]=n[c],n[c]=y,y=e[f],e[f]=e[c],e[c]=y}Ug(n,e,t,c,l),Ug(n,e,c+1,o,l)}}const Cs=11102230246251565e-32,_n=134217729,RL=(3+8*Cs)*Cs;function Km(n,e,t,o,l){let u,f,c,y,w=e[0],M=o[0],k=0,T=0;M>w==M>-w?(u=w,w=e[++k]):(u=M,M=o[++T]);let z=0;if(kw==M>-w?(f=w+u,c=u-(f-w),w=e[++k]):(f=M+u,c=u-(f-M),M=o[++T]),u=f,c!==0&&(l[z++]=c);kw==M>-w?(f=u+w,y=f-u,c=u-(f-y)+(w-y),w=e[++k]):(f=u+M,y=f-u,c=u-(f-y)+(M-y),M=o[++T]),u=f,c!==0&&(l[z++]=c);for(;k=mt||-at>=mt||(k=n-$e,c=n-($e+k)+(k-l),k=t-Ye,w=t-(Ye+k)+(k-l),k=e-ve,y=e-(ve+k)+(k-u),k=o-We,M=o-(We+k)+(k-u),c===0&&y===0&&w===0&&M===0)||(mt=NL*f+RL*Math.abs(at),at+=$e*M+We*c-(ve*w+Ye*y),at>=mt||-at>=mt))return at;me=c*We,T=_n*c,z=T-(T-c),F=c-z,T=_n*We,B=T-(T-We),G=We-B,X=F*G-(me-z*B-F*B-z*G),pe=y*Ye,T=_n*y,z=T-(T-y),F=y-z,T=_n*Ye,B=T-(T-Ye),G=Ye-B,Ee=F*G-(pe-z*B-F*B-z*G),J=X-Ee,k=X-J,Tn[0]=X-(J+k)+(k-Ee),j=me+J,k=j-me,V=me-(j-k)+(J-k),J=V-pe,k=V-J,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?1:0},Xd=n=>Math.sqrt(z2(n,n)),GL=(n,e,t)=>{const o={x:e.x-n.x,y:e.y-n.y},l={x:t.x-n.x,y:t.y-n.y};return _d(l,o)/Xd(l)/Xd(o)},ZL=(n,e,t)=>{const o={x:e.x-n.x,y:e.y-n.y},l={x:t.x-n.x,y:t.y-n.y};return z2(l,o)/Xd(l)/Xd(o)},pb=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},mb=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},HL=(n,e,t,o)=>{if(e.x===0)return mb(t,o,n.x);if(o.x===0)return mb(n,e,t.x);if(e.y===0)return pb(t,o,n.y);if(o.y===0)return pb(n,e,t.y);const l=_d(e,o);if(l==0)return null;const u={x:t.x-n.x,y:t.y-n.y},f=_d(u,e)/l,c=_d(u,o)/l,y=n.x+c*e.x,w=t.x+f*o.x,M=n.y+c*e.y,k=t.y+f*o.y,T=(y+w)/2,z=(M+k)/2;return{x:T,y:z}};class po{static compare(e,t){const o=po.comparePoints(e.point,t.point);return o!==0?o:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ha.compare(e.segment,t.segment))}static comparePoints(e,t){return e.xt.x?1:e.yt.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let o=0,l=t.length;o{const u=l.otherSE;t.set(l,{sine:GL(this.point,e.point,u.point),cosine:ZL(this.point,e.point,u.point)})};return(l,u)=>{t.has(l)||o(l),t.has(u)||o(u);const{sine:f,cosine:c}=t.get(l),{sine:y,cosine:w}=t.get(u);return f>=0&&y>=0?cw?-1:0:f<0&&y<0?cw?1:0:yf?1:0}}}let WL=0;class ha{static compare(e,t){const o=e.leftSE.point.x,l=t.leftSE.point.x,u=e.rightSE.point.x,f=t.rightSE.point.x;if(fc&&y>w)return-1;const k=e.comparePoint(t.leftSE.point);if(k<0)return 1;if(k>0)return-1;const T=t.comparePoint(e.rightSE.point);return T!==0?T:-1}if(o>l){if(cy&&c>M)return 1;const k=t.comparePoint(e.leftSE.point);if(k!==0)return k;const T=e.comparePoint(t.rightSE.point);return T<0?1:T>0?-1:1}if(cy)return 1;if(uf){const k=e.comparePoint(t.rightSE.point);if(k<0)return 1;if(k>0)return-1}if(u!==f){const k=w-c,T=u-o,z=M-y,F=f-l;if(k>T&&zF)return-1}return u>f?1:uM?1:e.idt.id?1:0}constructor(e,t,o,l){this.id=++WL,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=o,this.windings=l}static fromRing(e,t,o){let l,u,f;const c=po.comparePoints(e,t);if(c<0)l=e,u=t,f=1;else if(c>0)l=t,u=e,f=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const y=new po(l,!0),w=new po(u,!1);return new ha(y,w,[o],[f])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,o=this.rightSE.point,l=this.vector();if(t.x===o.x)return e.x===t.x?0:e.x0&&c.swapEvents(),po.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(l.checkForConsuming(),u.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,o=this.windings.length;t0){const u=t;t=o,o=u}if(t.prev===o){const u=t;t=o,o=u}for(let u=0,f=o.rings.length;ul.length===1&&l[0].isSubject;this._isInResult=o(e)!==o(t);break}default:throw new Error(`Unrecognized operation type found ${Do.type}`)}return this._isInResult}}class gb{constructor(e,t,o){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=o,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=Mh.round(e[0][0],e[0][1]);this.bbox={ll:{x:l.x,y:l.y},ur:{x:l.x,y:l.y}};let u=l;for(let f=1,c=e.length;fthis.bbox.ur.x&&(this.bbox.ur.x=y.x),y.y>this.bbox.ur.y&&(this.bbox.ur.y=y.y),u=y)}(l.x!==u.x||l.y!==u.y)&&this.segments.push(ha.fromRing(u,l,this))}getSweepEvents(){const e=[];for(let t=0,o=this.segments.length;tthis.bbox.ur.x&&(this.bbox.ur.x=u.bbox.ur.x),u.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=u.bbox.ur.y),this.interiorRings.push(u)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,o=this.interiorRings.length;tthis.bbox.ur.x&&(this.bbox.ur.x=u.bbox.ur.x),u.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=u.bbox.ur.y),this.polys.push(u)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,o=this.polys.length;t0&&(e=f)}let t=e.segment.prevInResult(),o=t?t.prevInResult():null;for(;;){if(!t)return null;if(!o)return t.ringOut;if(o.ringOut!==t.ringOut)return o.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=o.prevInResult(),o=t?t.prevInResult():null}}}class _b{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,o=this.interiorRings.length;t1&&arguments[1]!==void 0?arguments[1]:ha.compare;this.queue=e,this.tree=new Xy(t),this.segments=[]}process(e){const t=e.segment,o=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),o;const l=e.isLeft?this.tree.add(t):this.tree.find(t);if(!l)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let u=l,f=l,c,y;for(;c===void 0;)u=this.tree.prev(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);for(;y===void 0;)f=this.tree.next(f),f===null?y=null:f.key.consumedBy===void 0&&(y=f.key);if(e.isLeft){let w=null;if(c){const k=c.getIntersection(t);if(k!==null&&(t.isAnEndpoint(k)||(w=k),!c.isAnEndpoint(k))){const T=this._splitSafely(c,k);for(let z=0,F=T.length;z0?(this.tree.remove(t),o.push(e)):(this.segments.push(t),t.prev=c)}else{if(c&&y){const w=c.getIntersection(y);if(w!==null){if(!c.isAnEndpoint(w)){const M=this._splitSafely(c,w);for(let k=0,T=M.length;kvb)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const f=new KL(u);let c=u.size,y=u.pop();for(;y;){const k=y.key;if(u.size===c){const z=k.segment;throw new Error(`Unable to pop() ${k.isLeft?"left":"right"} SweepEvent [${k.point.x}, ${k.point.y}] from segment #${z.id} [${z.leftSE.point.x}, ${z.leftSE.point.y}] -> [${z.rightSE.point.x}, ${z.rightSE.point.y}] from queue.`)}if(u.size>vb)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(f.segments.length>YL)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const T=f.process(k);for(let z=0,F=T.length;z1?e-1:0),o=1;o1?e-1:0),o=1;o1?e-1:0),o=1;o1?e-1:0),o=1;on5(n,"name",{value:e,configurable:!0});function L2(n,e){var t=F2(e),o=null;return n.type==="FeatureCollection"?o=D2(n):o=Jy(vd.union(n.geometry.coordinates)),o.geometry.coordinates.forEach(function(l){t.geometry.coordinates.push(l[0])}),t}fp(L2,"mask");function D2(n){var e=n.features.length===2?vd.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):vd.union.apply(vd,n.features.map(function(t){return t.geometry.coordinates}));return Jy(e)}fp(D2,"unionFc");function Jy(n){return Hy(n)}fp(Jy,"createGeomFromPolygonClippingOutput");function F2(n){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],t=n&&n.geometry.coordinates||e;return up(t)}fp(F2,"createMask");var bb=L2;function o5(n){let e,t;const o=[xr(n[0],"boundary"),{paint:{"fill-color":"black","fill-opacity":.5}}];let l={};for(let u=0;ut(3,o=c));let{cfg:l}=e,{boundaryGeojson:u}=e,{fitBoundsAtStart:f=!1}=e;return(Zb("setCamera")||f)&&(o==null||o.fitBounds(Gw(u),{padding:20,animate:!1})),n.$$set=c=>{"cfg"in c&&t(0,l=c.cfg),"boundaryGeojson"in c&&t(1,u=c.boundaryGeojson),"fitBoundsAtStart"in c&&t(2,f=c.fitBoundsAtStart)},[l,u,f]}class l5 extends Dt{constructor(e){super(),Ft(this,e,a5,s5,At,{cfg:0,boundaryGeojson:1,fitBoundsAtStart:2})}}function c5(n){let e,t;const o=n[1].default,l=yi(o,n,n[0],null);return{c(){e=et("div"),l&&l.c(),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);l&&l.l(f),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-button-group")},m(u,f){ce(u,e,f),l&&l.m(e,null),t=!0},p(u,[f]){l&&l.p&&(!t||f&1)&&_i(l,o,u,u[0],t?bi(o,u[0],f,null):vi(u[0]),null)},i(u){t||(ae(l,u),t=!0)},o(u){fe(l,u),t=!1},d(u){u&&ee(e),l&&l.d(u)}}}function u5(n,e,t){let{$$slots:o={},$$scope:l}=e;return n.$$set=u=>{"$$scope"in u&&t(0,l=u.$$scope)},[l,o]}class pl extends Dt{constructor(e){super(),Ft(this,e,u5,c5,At,{})}}function h5(n){let e,t,o;const l=n[3].default,u=yi(l,n,n[2],null);return{c(){e=et("fieldset"),t=et("div"),u&&u.c(),this.h()},l(f){e=tt(f,"FIELDSET",{class:!0});var c=Lt(e);t=tt(c,"DIV",{class:!0,"data-module":!0});var y=Lt(t);u&&u.l(y),y.forEach(ee),c.forEach(ee),this.h()},h(){Ke(t,"class",n[0]),Ke(t,"data-module","govuk-checkboxes"),Ke(e,"class","govuk-fieldset")},m(f,c){ce(f,e,c),_t(e,t),u&&u.m(t,null),o=!0},p(f,[c]){u&&u.p&&(!o||c&4)&&_i(u,l,f,f[2],o?bi(l,f[2],c,null):vi(f[2]),null)},i(f){o||(ae(u,f),o=!0)},o(f){fe(u,f),o=!1},d(f){f&&ee(e),u&&u.d(f)}}}function f5(n,e,t){let{$$slots:o={},$$scope:l}=e,{small:u=!1}=e,f=u?"govuk-checkboxes--small":"govuk-checkboxes";return n.$$set=c=>{"small"in c&&t(1,u=c.small),"$$scope"in c&&t(2,l=c.$$scope)},[f,u,l,o]}class d5 extends Dt{constructor(e){super(),Ft(this,e,f5,h5,At,{small:1})}}let ed;const p5=new Uint8Array(16);function m5(){if(!ed&&(ed=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ed))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ed(p5)}const on=[];for(let n=0;n<256;++n)on.push((n+256).toString(16).slice(1));function g5(n,e=0){return on[n[e+0]]+on[n[e+1]]+on[n[e+2]]+on[n[e+3]]+"-"+on[n[e+4]]+on[n[e+5]]+"-"+on[n[e+6]]+on[n[e+7]]+"-"+on[n[e+8]]+on[n[e+9]]+"-"+on[n[e+10]]+on[n[e+11]]+on[n[e+12]]+on[n[e+13]]+on[n[e+14]]+on[n[e+15]]}const y5=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xb={randomUUID:y5};function Bc(n,e,t){if(xb.randomUUID&&!e&&!n)return xb.randomUUID();n=n||{};const o=n.random||(n.rng||m5)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){t=t||0;for(let l=0;l<16;++l)e[t+l]=o[l];return e}return g5(o)}const _5=n=>({}),wb=n=>({});function v5(n){let e,t,o,l,u,f,c,y,w;const M=n[5].default,k=yi(M,n,n[4],null),T=n[5].right,z=yi(T,n,n[4],wb);return{c(){e=et("div"),t=et("input"),o=qe(),l=et("label"),k&&k.c(),u=qe(),f=et("span"),z&&z.c(),this.h()},l(F){e=tt(F,"DIV",{class:!0,style:!0});var B=Lt(e);t=tt(B,"INPUT",{type:!0,class:!0,id:!0}),o=Ge(B),l=tt(B,"LABEL",{class:!0,for:!0,title:!0});var G=Lt(l);k&&k.l(G),G.forEach(ee),u=Ge(B),f=tt(B,"SPAN",{style:!0});var J=Lt(f);z&&z.l(J),J.forEach(ee),B.forEach(ee),this.h()},h(){Ke(t,"type","checkbox"),Ke(t,"class","govuk-checkboxes__input"),Ke(t,"id",n[3]),Ke(l,"class","govuk-label govuk-checkboxes__label"),Ke(l,"for",n[3]),Ke(l,"title",n[1]),ki(f,"float","right"),Ke(e,"class","govuk-checkboxes__item"),Ke(e,"style",n[2])},m(F,B){ce(F,e,B),_t(e,t),t.checked=n[0],_t(e,o),_t(e,l),k&&k.m(l,null),_t(e,u),_t(e,f),z&&z.m(f,null),c=!0,y||(w=[fr(t,"change",n[7]),fr(t,"change",n[6])],y=!0)},p(F,[B]){B&1&&(t.checked=F[0]),k&&k.p&&(!c||B&16)&&_i(k,M,F,F[4],c?bi(M,F[4],B,null):vi(F[4]),null),(!c||B&2)&&Ke(l,"title",F[1]),z&&z.p&&(!c||B&16)&&_i(z,T,F,F[4],c?bi(T,F[4],B,_5):vi(F[4]),wb)},i(F){c||(ae(k,F),ae(z,F),c=!0)},o(F){fe(k,F),fe(z,F),c=!1},d(F){F&&ee(e),k&&k.d(F),z&&z.d(F),y=!1,os(w)}}}function b5(n,e,t){let{$$slots:o={},$$scope:l}=e;const u=Wb(o);let{checked:f}=e,{hint:c=null}=e,w=u.right!==void 0?"float: none":"",M=Bc();function k(z){Er.call(this,n,z)}function T(){f=this.checked,t(0,f)}return n.$$set=z=>{"checked"in z&&t(0,f=z.checked),"hint"in z&&t(1,c=z.hint),"$$scope"in z&&t(4,l=z.$$scope)},[f,c,w,M,l,o,k,T]}class Gg extends Dt{constructor(e){super(),Ft(this,e,b5,v5,At,{checked:0,hint:1})}}function x5(n){let e,t,o,l,u,f,c;const y=n[3].default,w=yi(y,n,n[2],null);return{c(){e=et("details"),t=et("summary"),o=et("span"),l=xt(n[0]),u=qe(),f=et("div"),w&&w.c(),this.h()},l(M){e=tt(M,"DETAILS",{class:!0,"data-module":!0});var k=Lt(e);t=tt(k,"SUMMARY",{class:!0});var T=Lt(t);o=tt(T,"SPAN",{class:!0});var z=Lt(o);l=wt(z,n[0]),z.forEach(ee),T.forEach(ee),u=Ge(k),f=tt(k,"DIV",{class:!0});var F=Lt(f);w&&w.l(F),F.forEach(ee),k.forEach(ee),this.h()},h(){Ke(o,"class","govuk-details__summary-text"),Ke(t,"class","govuk-details__summary"),Ke(f,"class","govuk-details__text"),e.open=n[1],Ke(e,"class","govuk-details"),Ke(e,"data-module","govuk-details")},m(M,k){ce(M,e,k),_t(e,t),_t(t,o),_t(o,l),_t(e,u),_t(e,f),w&&w.m(f,null),c=!0},p(M,[k]){(!c||k&1)&&ai(l,M[0]),w&&w.p&&(!c||k&4)&&_i(w,y,M,M[2],c?bi(y,M[2],k,null):vi(M[2]),null),(!c||k&2)&&(e.open=M[1])},i(M){c||(ae(w,M),c=!0)},o(M){fe(w,M),c=!1},d(M){M&&ee(e),w&&w.d(M)}}}function w5(n,e,t){let{$$slots:o={},$$scope:l}=e,{label:u}=e,{open:f=!1}=e;return n.$$set=c=>{"label"in c&&t(0,u=c.label),"open"in c&&t(1,f=c.open),"$$scope"in c&&t(2,l=c.$$scope)},[u,f,l,o]}class S5 extends Dt{constructor(e){super(),Ft(this,e,w5,x5,At,{label:0,open:1})}}function k5(n){let e,t,o,l;const u=n[2].default,f=yi(u,n,n[1],null);let c=[{type:"button"},{class:"govuk-button"},{"data-module":"govuk-button"},n[0]],y={};for(let w=0;w{t(0,e=Qr(Qr({},e),_c(f))),"$$scope"in f&&t(1,l=f.$$scope)},e=_c(e),[e,l,o,u]}class Fs extends Dt{constructor(e){super(),Ft(this,e,E5,k5,At,{})}}function Sb(n){let e,t,o="Error:",l,u;return{c(){e=et("div"),t=et("span"),t.textContent=o,l=qe(),u=xt(n[0]),this.h()},l(f){e=tt(f,"DIV",{class:!0});var c=Lt(e);t=tt(c,"SPAN",{class:!0,"data-svelte-h":!0}),Pi(t)!=="svelte-1gidx8i"&&(t.textContent=o),l=Ge(c),u=wt(c,n[0]),c.forEach(ee),this.h()},h(){Ke(t,"class","govuk-visually-hidden"),Ke(e,"class","govuk-error-message")},m(f,c){ce(f,e,c),_t(e,t),_t(e,l),_t(e,u)},p(f,c){c&1&&ai(u,f[0])},d(f){f&&ee(e)}}}function P5(n){let e,t=n[0]&&Sb(n);return{c(){t&&t.c(),e=Ot()},l(o){t&&t.l(o),e=Ot()},m(o,l){t&&t.m(o,l),ce(o,e,l)},p(o,[l]){o[0]?t?t.p(o,l):(t=Sb(o),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Yt,o:Yt,d(o){o&&ee(e),t&&t.d(o)}}}function M5(n,e,t){let{errorMessage:o}=e;return n.$$set=l=>{"errorMessage"in l&&t(0,o=l.errorMessage)},[o]}class Rs extends Dt{constructor(e){super(),Ft(this,e,M5,P5,At,{errorMessage:0})}}function I5(n){let e,t,o;return{c(){e=et("input"),this.h()},l(l){e=tt(l,"INPUT",{class:!0,id:!0,type:!0}),this.h()},h(){e.disabled=n[1],Ke(e,"class","govuk-file-upload"),Ke(e,"id",n[4]),Ke(e,"type","file")},m(l,u){ce(l,e,u),n[6](e),t||(o=fr(e,"change",n[3]),t=!0)},p(l,u){u&2&&(e.disabled=l[1])},d(l){l&&ee(e),n[6](null),t=!1,o()}}}function T5(n){let e,t;return e=new Bh({props:{label:n[0],id:n[4],$$slots:{default:[I5]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&1&&(u.label=o[0]),l&134&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function C5(n,e,t){let{label:o}=e,{onLoad:l}=e,{disabled:u=!1}=e,f;async function c(M){let k=f.files[0].name,T=await f.files[0].text();l(k,T)}let y=Bc();function w(M){Hr[M?"unshift":"push"](()=>{f=M,t(2,f)})}return n.$$set=M=>{"label"in M&&t(0,o=M.label),"onLoad"in M&&t(5,l=M.onLoad),"disabled"in M&&t(1,u=M.disabled)},[o,u,f,c,y,l,w]}class A5 extends Dt{constructor(e){super(),Ft(this,e,C5,T5,At,{label:0,onLoad:5,disabled:1})}}function z5(n){let e,t,o,l,u;const f=n[3].default,c=yi(f,n,n[2],null);return{c(){e=et("div"),t=et("label"),o=xt(n[0]),l=qe(),c&&c.c(),this.h()},l(y){e=tt(y,"DIV",{class:!0});var w=Lt(e);t=tt(w,"LABEL",{class:!0,for:!0});var M=Lt(t);o=wt(M,n[0]),M.forEach(ee),l=Ge(w),c&&c.l(w),w.forEach(ee),this.h()},h(){Ke(t,"class","govuk-label govuk-label--s"),Ke(t,"for",n[1]),Ke(e,"class","govuk-form-group")},m(y,w){ce(y,e,w),_t(e,t),_t(t,o),_t(e,l),c&&c.m(e,null),u=!0},p(y,[w]){(!u||w&1)&&ai(o,y[0]),(!u||w&2)&&Ke(t,"for",y[1]),c&&c.p&&(!u||w&4)&&_i(c,f,y,y[2],u?bi(f,y[2],w,null):vi(y[2]),null)},i(y){u||(ae(c,y),u=!0)},o(y){fe(c,y),u=!1},d(y){y&&ee(e),c&&c.d(y)}}}function L5(n,e,t){let{$$slots:o={},$$scope:l}=e,{label:u}=e,{id:f}=e;return n.$$set=c=>{"label"in c&&t(0,u=c.label),"id"in c&&t(1,f=c.id),"$$scope"in c&&t(2,l=c.$$scope)},[u,f,l,o]}class Bh extends Dt{constructor(e){super(),Ft(this,e,L5,z5,At,{label:0,id:1})}}function kb(n,e,t){const o=n.slice();return o[10]=e[t][0],o[11]=e[t][1],o}function Eb(n){let e,t,o,l,u=!1,f,c,y=n[11]+"",w,M,k,T,z,F;return T=jk(n[9][0]),{c(){e=et("div"),t=et("input"),f=qe(),c=et("label"),w=xt(y),k=qe(),this.h()},l(B){e=tt(B,"DIV",{class:!0});var G=Lt(e);t=tt(G,"INPUT",{class:!0,id:!0,type:!0}),f=Ge(G),c=tt(G,"LABEL",{class:!0,for:!0});var J=Lt(c);w=wt(J,y),J.forEach(ee),k=Ge(G),G.forEach(ee),this.h()},h(){Ke(t,"class","govuk-radios__input"),Ke(t,"id",o=n[5]+n[10]),Ke(t,"type","radio"),t.__value=l=n[10],to(t,t.__value),Ke(c,"class","govuk-label govuk-radios__label"),Ke(c,"for",M=n[5]+n[10]),Ke(e,"class","govuk-radios__item"),T.p(t)},m(B,G){ce(B,e,G),_t(e,t),t.checked=t.__value===n[0],_t(e,f),_t(e,c),_t(c,w),_t(e,k),z||(F=[fr(t,"change",n[8]),fr(t,"change",n[7])],z=!0)},p(B,G){G&4&&o!==(o=B[5]+B[10])&&Ke(t,"id",o),G&4&&l!==(l=B[10])&&(t.__value=l,to(t,t.__value),u=!0),(u||G&5)&&(t.checked=t.__value===B[0]),G&4&&y!==(y=B[11]+"")&&ai(w,y),G&4&&M!==(M=B[5]+B[10])&&Ke(c,"for",M)},d(B){B&&ee(e),T.r(),z=!1,os(F)}}}function D5(n){let e,t,o,l,u,f,c,y,w;f=new Rs({props:{errorMessage:n[4]}});let M=_o(n[2]),k=[];for(let T=0;T{"legend"in z&&t(1,l=z.legend),"choices"in z&&t(2,u=z.choices),"inlineSmall"in z&&t(3,f=z.inlineSmall),"required"in z&&t(6,c=z.required),"value"in z&&t(0,y=z.value)},n.$$.update=()=>{n.$$.dirty&65&&t(4,o=c&&y==""?"Required":"")},[y,l,u,f,o,w,c,k,T,M]}class Ky extends Dt{constructor(e){super(),Ft(this,e,F5,D5,At,{legend:1,choices:2,inlineSmall:3,required:6,value:0})}}function R5(n){let e,t,o,l;const u=n[2].default,f=yi(u,n,n[1],null);let c=[{type:"button"},{class:"govuk-button govuk-button--secondary"},{"data-module":"govuk-button"},n[0]],y={};for(let w=0;w{t(0,e=Qr(Qr({},e),_c(y))),"$$scope"in y&&t(1,l=y.$$scope)},e=_c(e),[e,l,o,u,f,c]}class Kr extends Dt{constructor(e){super(),Ft(this,e,B5,R5,At,{})}}function Pb(n,e,t){const o=n.slice();return o[10]=e[t][0],o[11]=e[t][1],o}function Mb(n){let e,t;return{c(){e=et("div"),t=xt(n[2]),this.h()},l(o){e=tt(o,"DIV",{class:!0});var l=Lt(e);t=wt(l,n[2]),l.forEach(ee),this.h()},h(){Ke(e,"class","govuk-hint")},m(o,l){ce(o,e,l),_t(e,t)},p(o,l){l&4&&ai(t,o[2])},d(o){o&&ee(e)}}}function Ib(n){let e;return{c(){e=et("option"),this.h()},l(t){e=tt(t,"OPTION",{}),Lt(e).forEach(ee),this.h()},h(){e.__value="",to(e,e.__value)},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function Tb(n){let e,t=n[11]+"",o,l;return{c(){e=et("option"),o=xt(t),this.h()},l(u){e=tt(u,"OPTION",{});var f=Lt(e);o=wt(f,t),f.forEach(ee),this.h()},h(){e.__value=l=n[10],to(e,e.__value)},m(u,f){ce(u,e,f),_t(e,o)},p(u,f){f&8&&t!==(t=u[11]+"")&&ai(o,t),f&8&&l!==(l=u[10])&&(e.__value=l,to(e,e.__value))},d(u){u&&ee(e)}}}function O5(n){let e,t,o,l,u,f,c,y;e=new Rs({props:{errorMessage:n[6]}});let w=n[2]&&Mb(n),M=n[4]&&Ib(),k=_o(n[3]),T=[];for(let z=0;zn[9].call(l))},m(z,F){ze(e,z,F),ce(z,t,F),w&&w.m(z,F),ce(z,o,F),ce(z,l,F),M&&M.m(l,null),_t(l,u);for(let B=0;B{"label"in z&&t(1,o=z.label),"hint"in z&&t(2,l=z.hint),"choices"in z&&t(3,u=z.choices),"emptyOption"in z&&t(4,f=z.emptyOption),"disabled"in z&&t(5,c=z.disabled),"errorMessage"in z&&t(6,y=z.errorMessage),"value"in z&&t(0,w=z.value)},[w,o,l,u,f,c,y,M,k,T]}class R2 extends Dt{constructor(e){super(),Ft(this,e,N5,$5,At,{label:1,hint:2,choices:3,emptyOption:4,disabled:5,errorMessage:6,value:0})}}function Cb(n){let e,t;return{c(){e=et("div"),t=xt(n[2]),this.h()},l(o){e=tt(o,"DIV",{class:!0});var l=Lt(e);t=wt(l,n[2]),l.forEach(ee),this.h()},h(){Ke(e,"class","govuk-hint")},m(o,l){ce(o,e,l),_t(e,t)},p(o,l){l&4&&ai(t,o[2])},d(o){o&&ee(e)}}}function j5(n){let e,t,o,l,u,f,c;e=new Rs({props:{errorMessage:n[4]}});let y=n[2]&&Cb(n);return{c(){Ae(e.$$.fragment),t=qe(),y&&y.c(),o=qe(),l=et("textarea"),this.h()},l(w){Fe(e.$$.fragment,w),t=Ge(w),y&&y.l(w),o=Ge(w),l=tt(w,"TEXTAREA",{class:!0,id:!0,rows:!0}),Lt(l).forEach(ee),this.h()},h(){Ke(l,"class","govuk-textarea"),Ke(l,"id",n[5]),Ke(l,"rows",n[3])},m(w,M){ze(e,w,M),ce(w,t,M),y&&y.m(w,M),ce(w,o,M),ce(w,l,M),to(l,n[0]),u=!0,f||(c=fr(l,"input",n[6]),f=!0)},p(w,M){const k={};M&16&&(k.errorMessage=w[4]),e.$set(k),w[2]?y?y.p(w,M):(y=Cb(w),y.c(),y.m(o.parentNode,o)):y&&(y.d(1),y=null),(!u||M&8)&&Ke(l,"rows",w[3]),M&1&&to(l,w[0])},i(w){u||(ae(e.$$.fragment,w),u=!0)},o(w){fe(e.$$.fragment,w),u=!1},d(w){w&&(ee(t),ee(o),ee(l)),Le(e,w),y&&y.d(w),f=!1,c()}}}function V5(n){let e,t;return e=new Bh({props:{label:n[1],id:n[5],$$slots:{default:[j5]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&2&&(u.label=o[1]),l&157&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function U5(n,e,t){let{label:o}=e,{hint:l=""}=e,{value:u}=e,{rows:f=5}=e,{errorMessage:c=""}=e,y=Bc();function w(){u=this.value,t(0,u)}return n.$$set=M=>{"label"in M&&t(1,o=M.label),"hint"in M&&t(2,l=M.hint),"value"in M&&t(0,u=M.value),"rows"in M&&t(3,f=M.rows),"errorMessage"in M&&t(4,c=M.errorMessage)},[u,o,l,f,c,y,w]}class q5 extends Dt{constructor(e){super(),Ft(this,e,U5,V5,At,{label:1,hint:2,value:0,rows:3,errorMessage:4})}}function G5(n){let e,t,o,l,u,f;return e=new Rs({props:{errorMessage:n[2]}}),{c(){Ae(e.$$.fragment),t=qe(),o=et("input"),this.h()},l(c){Fe(e.$$.fragment,c),t=Ge(c),o=tt(c,"INPUT",{type:!0,class:!0,id:!0}),this.h()},h(){Ke(o,"type","text"),Ke(o,"class","govuk-input"),Ke(o,"id",n[3])},m(c,y){ze(e,c,y),ce(c,t,y),ce(c,o,y),to(o,n[0]),l=!0,u||(f=fr(o,"input",n[5]),u=!0)},p(c,y){const w={};y&4&&(w.errorMessage=c[2]),e.$set(w),y&1&&o.value!==c[0]&&to(o,c[0])},i(c){l||(ae(e.$$.fragment,c),l=!0)},o(c){fe(e.$$.fragment,c),l=!1},d(c){c&&(ee(t),ee(o)),Le(e,c),u=!1,f()}}}function Z5(n){let e,t;return e=new Bh({props:{label:n[1],id:n[3],$$slots:{default:[G5]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&2&&(u.label=o[1]),l&69&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function H5(n,e,t){let o,{label:l}=e,{value:u}=e,{required:f=!1}=e,c=Bc();function y(){u=this.value,t(0,u)}return n.$$set=w=>{"label"in w&&t(1,l=w.label),"value"in w&&t(0,u=w.value),"required"in w&&t(4,f=w.required)},n.$$.update=()=>{n.$$.dirty&17&&t(2,o=f&&(u==null||u=="")?"Required":"")},[u,l,o,c,f,y]}class Yy extends Dt{constructor(e){super(),Ft(this,e,H5,Z5,At,{label:1,value:0,required:4})}}function W5(n){let e,t,o,l;const u=n[2].default,f=yi(u,n,n[1],null);let c=[{type:"button"},{class:"govuk-button govuk-button--warning"},{"data-module":"govuk-button"},n[0]],y={};for(let w=0;w{t(0,e=Qr(Qr({},e),_c(f))),"$$scope"in f&&t(1,l=f.$$scope)},e=_c(e),[e,l,o,u]}class dp extends Dt{constructor(e){super(),Ft(this,e,X5,W5,At,{})}}const J5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M21%2019V5c0-1.1-.9-2-2-2H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2zM8.5%2013.5l2.5%203.01L14.5%2012l4.5%206H5l3.5-4.5z'/%3e%3c/svg%3e",K5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M12%202C8.13%202%205%205.13%205%209c0%205.25%207%2013%207%2013s7-7.75%207-13c0-3.87-3.13-7-7-7zm0%209.5c-1.38%200-2.5-1.12-2.5-2.5s1.12-2.5%202.5-2.5%202.5%201.12%202.5%202.5-1.12%202.5-2.5%202.5z'/%3e%3c/svg%3e",Y5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M18%204H6c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h12c1.1%200%202-.9%202-2V6c0-1.1-.9-2-2-2zm0%2014H6V6h12v12z'/%3e%3c/svg%3e",Q5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20enable-background='new%200%200%2024%2024'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cg%3e%3crect%20fill='none'%20height='24'%20width='24'/%3e%3c/g%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20d='M19,19h2v2h-2V19z%20M19,17h2v-2h-2V17z%20M3,13h2v-2H3V13z%20M3,17h2v-2H3V17z%20M3,9h2V7H3V9z%20M3,5h2V3H3V5z%20M7,5h2V3H7V5z%20M15,21h2v-2h-2V21z%20M11,21h2v-2h-2V21z%20M15,21h2v-2h-2V21z%20M7,21h2v-2H7V21z%20M3,21h2v-2H3V21z%20M21,8c0-2.76-2.24-5-5-5h-5v2h5%20c1.65,0,3,1.35,3,3v5h2V8z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",eD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20enable-background='new%200%200%2024%2024'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cg%3e%3crect%20fill='none'%20height='24'%20width='24'/%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M19,15.18V7c0-2.21-1.79-4-4-4s-4,1.79-4,4v10c0,1.1-0.9,2-2,2s-2-0.9-2-2V8.82C8.16,8.4,9,7.3,9,6c0-1.66-1.34-3-3-3%20S3,4.34,3,6c0,1.3,0.84,2.4,2,2.82V17c0,2.21,1.79,4,4,4s4-1.79,4-4V7c0-1.1,0.9-2,2-2s2,0.9,2,2v8.18c-1.16,0.41-2,1.51-2,2.82%20c0,1.66,1.34,3,3,3s3-1.34,3-3C21,16.7,20.16,15.6,19,15.18z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",tD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0V0z'%20fill='none'/%3e%3cpath%20d='M12.56%2014.33c-.34.27-.56.7-.56%201.17V21h7c1.1%200%202-.9%202-2v-5.98c-.94-.33-1.95-.52-3-.52-2.03%200-3.93.7-5.44%201.83z'/%3e%3ccircle%20cx='18'%20cy='6'%20r='5'/%3e%3cpath%20d='M11.5%206c0-1.08.27-2.1.74-3H5c-1.1%200-2%20.9-2%202v14c0%20.55.23%201.05.59%201.41l9.82-9.82C12.23%209.42%2011.5%207.8%2011.5%206z'/%3e%3c/svg%3e";function rD(n){let e,t,o,l,u,f;const c=[xr(n[0],"hover-polygons"),{filter:sl},{paint:{"line-color":bh.hovering,"line-width":.5*ol}}];let y={};for(let z=0;z(f(),f=da(w,M=>t(4,u=M)),w);bt(n,xh,M=>t(3,l=M)),n.$$.on_destroy.push(()=>f());let{cfg:y}=e,{gjSchemes:w}=e;return c(),n.$$set=M=>{"cfg"in M&&t(0,y=M.cfg),"gjSchemes"in M&&c(t(1,w=M.gjSchemes))},n.$$.update=()=>{n.$$.dirty&24&&t(2,o=l==null?Mc():u.features.find(M=>M.id==l))},[y,w,o,l,u]}class oD extends Dt{constructor(e){super(),Ft(this,e,nD,iD,At,{cfg:0,gjSchemes:1})}}function sD(n){let e,t,o;return{c(){e=et("img"),o=xt(` +`);var u=e+(t?" ":"│ ");n.left&&Ng(n.left,u,!1,o,l),n.right&&Ng(n.right,u,!0,o,l)}}var Xy=function(){function n(e){e===void 0&&(e=AL),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=Jm(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var o=new fa(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);var l=this._comparator,u=aa(e,this._root,l),f=l(e,u.key);return f===0?this._root=u:(f<0?(o.left=u.left,o.right=u,u.left=null):f>0&&(o.right=u.right,o.left=u,u.right=null),this._size++,this._root=o),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,o){var l;if(t===null)return null;t=aa(e,t,o);var u=o(e,t.key);return u===0?(t.left===null?l=t.right:(l=aa(e,t.left,o),l.right=t.right),this._size--,l):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=aa(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,o=this._comparator;t;){var l=o(e,t.key);if(l===0)return t;l<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=aa(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,o=this._comparator;t;){var l=o(e,t.key);if(l===0)return!0;l<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var o=this._root,l=[],u=!1;!u;)o!==null?(l.push(o),o=o.left):l.length!==0?(o=l.pop(),e.call(t,o),o=o.right):u=!0;return this},n.prototype.range=function(e,t,o,l){for(var u=[],f=this._comparator,c=this._root,y;u.length!==0||c;)if(c)u.push(c),c=c.left;else{if(c=u.pop(),y=f(c.key,t),y>0)break;if(f(c.key,e)>=0&&o.call(l,c))return this;c=c.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var o=t.key;return e.push(o)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var o=t.data;return e.push(o)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,o=!1,l=0,u=[];!o;)if(t)u.push(t),t=t.left;else if(u.length>0){if(t=u.pop(),l===e)return t;l++,t=t.right}else o=!0;return null},n.prototype.next=function(e){var t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}for(var l=this._comparator;t;){var u=l(e.key,t.key);if(u===0)break;u<0?(o=t,t=t.left):t=t.right}return o},n.prototype.prev=function(e){var t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}for(var l=this._comparator;t;){var u=l(e.key,t.key);if(u===0)break;u<0?t=t.left:(o=t,t=t.right)}return o},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return DL(this._root)},n.prototype.load=function(e,t,o){t===void 0&&(t=[]),o===void 0&&(o=!1);var l=e.length,u=this._comparator;if(o&&Ug(e,t,0,l-1,u),this._root===null)this._root=jg(e,t,0,l),this._size=l;else{var f=FL(this.toList(),LL(e,t),u);l=this._size+l,this._root=Vg({head:f},0,l)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(o){return String(o.key)});var t=[];return Ng(this._root,"",!0,function(o){return t.push(o)},e),t.join("")},n.prototype.update=function(e,t,o){var l=this._comparator,u=ab(e,this._root,l),f=u.left,c=u.right;l(e,t)<0?c=Jm(t,o,c,l):f=Jm(t,o,f,l),this._root=zL(f,c,l)},n.prototype.split=function(e){return ab(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,o;return CL(this,function(l){switch(l.label){case 0:e=this._root,t=[],o=!1,l.label=1;case 1:return o?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return l.sent(),e=e.right,[3,5];case 4:o=!0,l.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function jg(n,e,t,o){var l=o-t;if(l>0){var u=t+Math.floor(l/2),f=n[u],c=e[u],y=new fa(f,c);return y.left=jg(n,e,t,u),y.right=jg(n,e,u+1,o),y}return null}function LL(n,e){for(var t=new fa(null,null),o=t,l=0;l0?(e=u=u.next=t.pop(),e=e.right):o=!0;return u.next=null,l.next}function Vg(n,e,t){var o=t-e;if(o>0){var l=e+Math.floor(o/2),u=Vg(n,e,l),f=n.head;return f.left=u,n.head=n.head.next,f.right=Vg(n,l+1,t),f}return null}function FL(n,e,t){for(var o=new fa(null,null),l=o,u=n,f=e;u!==null&&f!==null;)t(u.key,f.key)<0?(l.next=u,u=u.next):(l.next=f,f=f.next),l=l.next;return u!==null?l.next=u:f!==null&&(l.next=f),o.next}function Ug(n,e,t,o,l){if(!(t>=o)){for(var u=n[t+o>>1],f=t-1,c=o+1;;){do f++;while(l(n[f],u)<0);do c--;while(l(n[c],u)>0);if(f>=c)break;var y=n[f];n[f]=n[c],n[c]=y,y=e[f],e[f]=e[c],e[c]=y}Ug(n,e,t,c,l),Ug(n,e,c+1,o,l)}}const Cs=11102230246251565e-32,_n=134217729,RL=(3+8*Cs)*Cs;function Km(n,e,t,o,l){let u,f,c,y,w=e[0],M=o[0],k=0,T=0;M>w==M>-w?(u=w,w=e[++k]):(u=M,M=o[++T]);let z=0;if(kw==M>-w?(f=w+u,c=u-(f-w),w=e[++k]):(f=M+u,c=u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*B-F*B-z*G),pe=y*w,T=_n*y,z=T-(T-y),F=y-z,T=_n*w,B=T-(T-w),G=w-B,Ee=F*G-(pe-z*B-F*B-z*G),J=X-Ee,k=X-J,Tn[0]=X-(J+k)+(k-Ee),j=me+J,k=j-me,V=me-(j-k)+(J-k),J=V-pe,k=V-J,Tn[1]=V-(J+k)+(k-pe),Pe=j+J,k=Pe-j,Tn[2]=j-(Pe-k)+(J-k),Tn[3]=Pe;const Ue=Km(qt,cb,4,Tn,ub);return ub[Ue-1]}function VL(n,e,t,o,l,u){const f=(e-u)*(t-l),c=(n-l)*(o-u),y=f-c,w=Math.abs(f+c);return Math.abs(y)>=OL*w?y:-jL(n,e,t,o,l,u,w)}var A2={};const rh=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,qg=(n,e)=>{if(e.ur.x{if(-uan.x*e.y-n.y*e.x,z2=(n,e)=>n.x*e.x+n.y*e.y,db=(n,e,t)=>{const o=VL(n.x,n.y,e.x,e.y,t.x,t.y);return o>0?-1:o<0?1:0},Xd=n=>Math.sqrt(z2(n,n)),GL=(n,e,t)=>{const o={x:e.x-n.x,y:e.y-n.y},l={x:t.x-n.x,y:t.y-n.y};return _d(l,o)/Xd(l)/Xd(o)},ZL=(n,e,t)=>{const o={x:e.x-n.x,y:e.y-n.y},l={x:t.x-n.x,y:t.y-n.y};return z2(l,o)/Xd(l)/Xd(o)},pb=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},mb=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},HL=(n,e,t,o)=>{if(e.x===0)return mb(t,o,n.x);if(o.x===0)return mb(n,e,t.x);if(e.y===0)return pb(t,o,n.y);if(o.y===0)return pb(n,e,t.y);const l=_d(e,o);if(l==0)return null;const u={x:t.x-n.x,y:t.y-n.y},f=_d(u,e)/l,c=_d(u,o)/l,y=n.x+c*e.x,w=t.x+f*o.x,M=n.y+c*e.y,k=t.y+f*o.y,T=(y+w)/2,z=(M+k)/2;return{x:T,y:z}};class po{static compare(e,t){const o=po.comparePoints(e.point,t.point);return o!==0?o:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ha.compare(e.segment,t.segment))}static comparePoints(e,t){return e.xt.x?1:e.yt.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let o=0,l=t.length;o{const u=l.otherSE;t.set(l,{sine:GL(this.point,e.point,u.point),cosine:ZL(this.point,e.point,u.point)})};return(l,u)=>{t.has(l)||o(l),t.has(u)||o(u);const{sine:f,cosine:c}=t.get(l),{sine:y,cosine:w}=t.get(u);return f>=0&&y>=0?cw?-1:0:f<0&&y<0?cw?1:0:yf?1:0}}}let WL=0;class ha{static compare(e,t){const o=e.leftSE.point.x,l=t.leftSE.point.x,u=e.rightSE.point.x,f=t.rightSE.point.x;if(fc&&y>w)return-1;const k=e.comparePoint(t.leftSE.point);if(k<0)return 1;if(k>0)return-1;const T=t.comparePoint(e.rightSE.point);return T!==0?T:-1}if(o>l){if(cy&&c>M)return 1;const k=t.comparePoint(e.leftSE.point);if(k!==0)return k;const T=e.comparePoint(t.rightSE.point);return T<0?1:T>0?-1:1}if(cy)return 1;if(uf){const k=e.comparePoint(t.rightSE.point);if(k<0)return 1;if(k>0)return-1}if(u!==f){const k=w-c,T=u-o,z=M-y,F=f-l;if(k>T&&zF)return-1}return u>f?1:uM?1:e.idt.id?1:0}constructor(e,t,o,l){this.id=++WL,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=o,this.windings=l}static fromRing(e,t,o){let l,u,f;const c=po.comparePoints(e,t);if(c<0)l=e,u=t,f=1;else if(c>0)l=t,u=e,f=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const y=new po(l,!0),w=new po(u,!1);return new ha(y,w,[o],[f])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,o=this.rightSE.point,l=this.vector();if(t.x===o.x)return e.x===t.x?0:e.x0&&c.swapEvents(),po.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(l.checkForConsuming(),u.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,o=this.windings.length;t0){const u=t;t=o,o=u}if(t.prev===o){const u=t;t=o,o=u}for(let u=0,f=o.rings.length;ul.length===1&&l[0].isSubject;this._isInResult=o(e)!==o(t);break}default:throw new Error(`Unrecognized operation type found ${Do.type}`)}return this._isInResult}}class gb{constructor(e,t,o){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=o,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=Mh.round(e[0][0],e[0][1]);this.bbox={ll:{x:l.x,y:l.y},ur:{x:l.x,y:l.y}};let u=l;for(let f=1,c=e.length;fthis.bbox.ur.x&&(this.bbox.ur.x=y.x),y.y>this.bbox.ur.y&&(this.bbox.ur.y=y.y),u=y)}(l.x!==u.x||l.y!==u.y)&&this.segments.push(ha.fromRing(u,l,this))}getSweepEvents(){const e=[];for(let t=0,o=this.segments.length;tthis.bbox.ur.x&&(this.bbox.ur.x=u.bbox.ur.x),u.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=u.bbox.ur.y),this.interiorRings.push(u)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,o=this.interiorRings.length;tthis.bbox.ur.x&&(this.bbox.ur.x=u.bbox.ur.x),u.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=u.bbox.ur.y),this.polys.push(u)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,o=this.polys.length;t0&&(e=f)}let t=e.segment.prevInResult(),o=t?t.prevInResult():null;for(;;){if(!t)return null;if(!o)return t.ringOut;if(o.ringOut!==t.ringOut)return o.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=o.prevInResult(),o=t?t.prevInResult():null}}}class _b{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,o=this.interiorRings.length;t1&&arguments[1]!==void 0?arguments[1]:ha.compare;this.queue=e,this.tree=new Xy(t),this.segments=[]}process(e){const t=e.segment,o=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),o;const l=e.isLeft?this.tree.add(t):this.tree.find(t);if(!l)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let u=l,f=l,c,y;for(;c===void 0;)u=this.tree.prev(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);for(;y===void 0;)f=this.tree.next(f),f===null?y=null:f.key.consumedBy===void 0&&(y=f.key);if(e.isLeft){let w=null;if(c){const k=c.getIntersection(t);if(k!==null&&(t.isAnEndpoint(k)||(w=k),!c.isAnEndpoint(k))){const T=this._splitSafely(c,k);for(let z=0,F=T.length;z0?(this.tree.remove(t),o.push(e)):(this.segments.push(t),t.prev=c)}else{if(c&&y){const w=c.getIntersection(y);if(w!==null){if(!c.isAnEndpoint(w)){const M=this._splitSafely(c,w);for(let k=0,T=M.length;kvb)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const f=new KL(u);let c=u.size,y=u.pop();for(;y;){const k=y.key;if(u.size===c){const z=k.segment;throw new Error(`Unable to pop() ${k.isLeft?"left":"right"} SweepEvent [${k.point.x}, ${k.point.y}] from segment #${z.id} [${z.leftSE.point.x}, ${z.leftSE.point.y}] -> [${z.rightSE.point.x}, ${z.rightSE.point.y}] from queue.`)}if(u.size>vb)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(f.segments.length>YL)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const T=f.process(k);for(let z=0,F=T.length;z1?e-1:0),o=1;o1?e-1:0),o=1;o1?e-1:0),o=1;o1?e-1:0),o=1;on5(n,"name",{value:e,configurable:!0});function L2(n,e){var t=F2(e),o=null;return n.type==="FeatureCollection"?o=D2(n):o=Jy(vd.union(n.geometry.coordinates)),o.geometry.coordinates.forEach(function(l){t.geometry.coordinates.push(l[0])}),t}fp(L2,"mask");function D2(n){var e=n.features.length===2?vd.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):vd.union.apply(vd,n.features.map(function(t){return t.geometry.coordinates}));return Jy(e)}fp(D2,"unionFc");function Jy(n){return Hy(n)}fp(Jy,"createGeomFromPolygonClippingOutput");function F2(n){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],t=n&&n.geometry.coordinates||e;return up(t)}fp(F2,"createMask");var bb=L2;function o5(n){let e,t;const o=[xr(n[0],"boundary"),{paint:{"fill-color":"black","fill-opacity":.5}}];let l={};for(let u=0;ut(3,o=c));let{cfg:l}=e,{boundaryGeojson:u}=e,{fitBoundsAtStart:f=!1}=e;return(Zb("setCamera")||f)&&(o==null||o.fitBounds(Gw(u),{padding:20,animate:!1})),n.$$set=c=>{"cfg"in c&&t(0,l=c.cfg),"boundaryGeojson"in c&&t(1,u=c.boundaryGeojson),"fitBoundsAtStart"in c&&t(2,f=c.fitBoundsAtStart)},[l,u,f]}class l5 extends Dt{constructor(e){super(),Ft(this,e,a5,s5,At,{cfg:0,boundaryGeojson:1,fitBoundsAtStart:2})}}function c5(n){let e,t;const o=n[1].default,l=yi(o,n,n[0],null);return{c(){e=et("div"),l&&l.c(),this.h()},l(u){e=tt(u,"DIV",{class:!0});var f=Lt(e);l&&l.l(f),f.forEach(ee),this.h()},h(){Ke(e,"class","govuk-button-group")},m(u,f){ce(u,e,f),l&&l.m(e,null),t=!0},p(u,[f]){l&&l.p&&(!t||f&1)&&_i(l,o,u,u[0],t?bi(o,u[0],f,null):vi(u[0]),null)},i(u){t||(ae(l,u),t=!0)},o(u){fe(l,u),t=!1},d(u){u&&ee(e),l&&l.d(u)}}}function u5(n,e,t){let{$$slots:o={},$$scope:l}=e;return n.$$set=u=>{"$$scope"in u&&t(0,l=u.$$scope)},[l,o]}class pl extends Dt{constructor(e){super(),Ft(this,e,u5,c5,At,{})}}function h5(n){let e,t,o;const l=n[3].default,u=yi(l,n,n[2],null);return{c(){e=et("fieldset"),t=et("div"),u&&u.c(),this.h()},l(f){e=tt(f,"FIELDSET",{class:!0});var c=Lt(e);t=tt(c,"DIV",{class:!0,"data-module":!0});var y=Lt(t);u&&u.l(y),y.forEach(ee),c.forEach(ee),this.h()},h(){Ke(t,"class",n[0]),Ke(t,"data-module","govuk-checkboxes"),Ke(e,"class","govuk-fieldset")},m(f,c){ce(f,e,c),_t(e,t),u&&u.m(t,null),o=!0},p(f,[c]){u&&u.p&&(!o||c&4)&&_i(u,l,f,f[2],o?bi(l,f[2],c,null):vi(f[2]),null)},i(f){o||(ae(u,f),o=!0)},o(f){fe(u,f),o=!1},d(f){f&&ee(e),u&&u.d(f)}}}function f5(n,e,t){let{$$slots:o={},$$scope:l}=e,{small:u=!1}=e,f=u?"govuk-checkboxes--small":"govuk-checkboxes";return n.$$set=c=>{"small"in c&&t(1,u=c.small),"$$scope"in c&&t(2,l=c.$$scope)},[f,u,l,o]}class d5 extends Dt{constructor(e){super(),Ft(this,e,f5,h5,At,{small:1})}}let ed;const p5=new Uint8Array(16);function m5(){if(!ed&&(ed=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ed))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ed(p5)}const on=[];for(let n=0;n<256;++n)on.push((n+256).toString(16).slice(1));function g5(n,e=0){return on[n[e+0]]+on[n[e+1]]+on[n[e+2]]+on[n[e+3]]+"-"+on[n[e+4]]+on[n[e+5]]+"-"+on[n[e+6]]+on[n[e+7]]+"-"+on[n[e+8]]+on[n[e+9]]+"-"+on[n[e+10]]+on[n[e+11]]+on[n[e+12]]+on[n[e+13]]+on[n[e+14]]+on[n[e+15]]}const y5=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xb={randomUUID:y5};function Bc(n,e,t){if(xb.randomUUID&&!e&&!n)return xb.randomUUID();n=n||{};const o=n.random||(n.rng||m5)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){t=t||0;for(let l=0;l<16;++l)e[t+l]=o[l];return e}return g5(o)}const _5=n=>({}),wb=n=>({});function v5(n){let e,t,o,l,u,f,c,y,w;const M=n[5].default,k=yi(M,n,n[4],null),T=n[5].right,z=yi(T,n,n[4],wb);return{c(){e=et("div"),t=et("input"),o=qe(),l=et("label"),k&&k.c(),u=qe(),f=et("span"),z&&z.c(),this.h()},l(F){e=tt(F,"DIV",{class:!0,style:!0});var B=Lt(e);t=tt(B,"INPUT",{type:!0,class:!0,id:!0}),o=Ge(B),l=tt(B,"LABEL",{class:!0,for:!0,title:!0});var G=Lt(l);k&&k.l(G),G.forEach(ee),u=Ge(B),f=tt(B,"SPAN",{style:!0});var J=Lt(f);z&&z.l(J),J.forEach(ee),B.forEach(ee),this.h()},h(){Ke(t,"type","checkbox"),Ke(t,"class","govuk-checkboxes__input"),Ke(t,"id",n[3]),Ke(l,"class","govuk-label govuk-checkboxes__label"),Ke(l,"for",n[3]),Ke(l,"title",n[1]),ki(f,"float","right"),Ke(e,"class","govuk-checkboxes__item"),Ke(e,"style",n[2])},m(F,B){ce(F,e,B),_t(e,t),t.checked=n[0],_t(e,o),_t(e,l),k&&k.m(l,null),_t(e,u),_t(e,f),z&&z.m(f,null),c=!0,y||(w=[fr(t,"change",n[7]),fr(t,"change",n[6])],y=!0)},p(F,[B]){B&1&&(t.checked=F[0]),k&&k.p&&(!c||B&16)&&_i(k,M,F,F[4],c?bi(M,F[4],B,null):vi(F[4]),null),(!c||B&2)&&Ke(l,"title",F[1]),z&&z.p&&(!c||B&16)&&_i(z,T,F,F[4],c?bi(T,F[4],B,_5):vi(F[4]),wb)},i(F){c||(ae(k,F),ae(z,F),c=!0)},o(F){fe(k,F),fe(z,F),c=!1},d(F){F&&ee(e),k&&k.d(F),z&&z.d(F),y=!1,ss(w)}}}function b5(n,e,t){let{$$slots:o={},$$scope:l}=e;const u=Wb(o);let{checked:f}=e,{hint:c=null}=e,w=u.right!==void 0?"float: none":"",M=Bc();function k(z){Er.call(this,n,z)}function T(){f=this.checked,t(0,f)}return n.$$set=z=>{"checked"in z&&t(0,f=z.checked),"hint"in z&&t(1,c=z.hint),"$$scope"in z&&t(4,l=z.$$scope)},[f,c,w,M,l,o,k,T]}class Gg extends Dt{constructor(e){super(),Ft(this,e,b5,v5,At,{checked:0,hint:1})}}function x5(n){let e,t,o,l,u,f,c;const y=n[3].default,w=yi(y,n,n[2],null);return{c(){e=et("details"),t=et("summary"),o=et("span"),l=xt(n[0]),u=qe(),f=et("div"),w&&w.c(),this.h()},l(M){e=tt(M,"DETAILS",{class:!0,"data-module":!0});var k=Lt(e);t=tt(k,"SUMMARY",{class:!0});var T=Lt(t);o=tt(T,"SPAN",{class:!0});var z=Lt(o);l=wt(z,n[0]),z.forEach(ee),T.forEach(ee),u=Ge(k),f=tt(k,"DIV",{class:!0});var F=Lt(f);w&&w.l(F),F.forEach(ee),k.forEach(ee),this.h()},h(){Ke(o,"class","govuk-details__summary-text"),Ke(t,"class","govuk-details__summary"),Ke(f,"class","govuk-details__text"),e.open=n[1],Ke(e,"class","govuk-details"),Ke(e,"data-module","govuk-details")},m(M,k){ce(M,e,k),_t(e,t),_t(t,o),_t(o,l),_t(e,u),_t(e,f),w&&w.m(f,null),c=!0},p(M,[k]){(!c||k&1)&&ai(l,M[0]),w&&w.p&&(!c||k&4)&&_i(w,y,M,M[2],c?bi(y,M[2],k,null):vi(M[2]),null),(!c||k&2)&&(e.open=M[1])},i(M){c||(ae(w,M),c=!0)},o(M){fe(w,M),c=!1},d(M){M&&ee(e),w&&w.d(M)}}}function w5(n,e,t){let{$$slots:o={},$$scope:l}=e,{label:u}=e,{open:f=!1}=e;return n.$$set=c=>{"label"in c&&t(0,u=c.label),"open"in c&&t(1,f=c.open),"$$scope"in c&&t(2,l=c.$$scope)},[u,f,l,o]}class S5 extends Dt{constructor(e){super(),Ft(this,e,w5,x5,At,{label:0,open:1})}}function k5(n){let e,t,o,l;const u=n[2].default,f=yi(u,n,n[1],null);let c=[{type:"button"},{class:"govuk-button"},{"data-module":"govuk-button"},n[0]],y={};for(let w=0;w{t(0,e=Qr(Qr({},e),_c(f))),"$$scope"in f&&t(1,l=f.$$scope)},e=_c(e),[e,l,o,u]}class Fs extends Dt{constructor(e){super(),Ft(this,e,E5,k5,At,{})}}function Sb(n){let e,t,o="Error:",l,u;return{c(){e=et("div"),t=et("span"),t.textContent=o,l=qe(),u=xt(n[0]),this.h()},l(f){e=tt(f,"DIV",{class:!0});var c=Lt(e);t=tt(c,"SPAN",{class:!0,"data-svelte-h":!0}),Pi(t)!=="svelte-1gidx8i"&&(t.textContent=o),l=Ge(c),u=wt(c,n[0]),c.forEach(ee),this.h()},h(){Ke(t,"class","govuk-visually-hidden"),Ke(e,"class","govuk-error-message")},m(f,c){ce(f,e,c),_t(e,t),_t(e,l),_t(e,u)},p(f,c){c&1&&ai(u,f[0])},d(f){f&&ee(e)}}}function P5(n){let e,t=n[0]&&Sb(n);return{c(){t&&t.c(),e=$t()},l(o){t&&t.l(o),e=$t()},m(o,l){t&&t.m(o,l),ce(o,e,l)},p(o,[l]){o[0]?t?t.p(o,l):(t=Sb(o),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Yt,o:Yt,d(o){o&&ee(e),t&&t.d(o)}}}function M5(n,e,t){let{errorMessage:o}=e;return n.$$set=l=>{"errorMessage"in l&&t(0,o=l.errorMessage)},[o]}class Rs extends Dt{constructor(e){super(),Ft(this,e,M5,P5,At,{errorMessage:0})}}function I5(n){let e,t,o;return{c(){e=et("input"),this.h()},l(l){e=tt(l,"INPUT",{class:!0,id:!0,type:!0}),this.h()},h(){e.disabled=n[1],Ke(e,"class","govuk-file-upload"),Ke(e,"id",n[4]),Ke(e,"type","file")},m(l,u){ce(l,e,u),n[6](e),t||(o=fr(e,"change",n[3]),t=!0)},p(l,u){u&2&&(e.disabled=l[1])},d(l){l&&ee(e),n[6](null),t=!1,o()}}}function T5(n){let e,t;return e=new Bh({props:{label:n[0],id:n[4],$$slots:{default:[I5]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&1&&(u.label=o[0]),l&134&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function C5(n,e,t){let{label:o}=e,{onLoad:l}=e,{disabled:u=!1}=e,f;async function c(M){let k=f.files[0].name,T=await f.files[0].text();l(k,T)}let y=Bc();function w(M){Wr[M?"unshift":"push"](()=>{f=M,t(2,f)})}return n.$$set=M=>{"label"in M&&t(0,o=M.label),"onLoad"in M&&t(5,l=M.onLoad),"disabled"in M&&t(1,u=M.disabled)},[o,u,f,c,y,l,w]}class A5 extends Dt{constructor(e){super(),Ft(this,e,C5,T5,At,{label:0,onLoad:5,disabled:1})}}function z5(n){let e,t,o,l,u;const f=n[3].default,c=yi(f,n,n[2],null);return{c(){e=et("div"),t=et("label"),o=xt(n[0]),l=qe(),c&&c.c(),this.h()},l(y){e=tt(y,"DIV",{class:!0});var w=Lt(e);t=tt(w,"LABEL",{class:!0,for:!0});var M=Lt(t);o=wt(M,n[0]),M.forEach(ee),l=Ge(w),c&&c.l(w),w.forEach(ee),this.h()},h(){Ke(t,"class","govuk-label govuk-label--s"),Ke(t,"for",n[1]),Ke(e,"class","govuk-form-group")},m(y,w){ce(y,e,w),_t(e,t),_t(t,o),_t(e,l),c&&c.m(e,null),u=!0},p(y,[w]){(!u||w&1)&&ai(o,y[0]),(!u||w&2)&&Ke(t,"for",y[1]),c&&c.p&&(!u||w&4)&&_i(c,f,y,y[2],u?bi(f,y[2],w,null):vi(y[2]),null)},i(y){u||(ae(c,y),u=!0)},o(y){fe(c,y),u=!1},d(y){y&&ee(e),c&&c.d(y)}}}function L5(n,e,t){let{$$slots:o={},$$scope:l}=e,{label:u}=e,{id:f}=e;return n.$$set=c=>{"label"in c&&t(0,u=c.label),"id"in c&&t(1,f=c.id),"$$scope"in c&&t(2,l=c.$$scope)},[u,f,l,o]}class Bh extends Dt{constructor(e){super(),Ft(this,e,L5,z5,At,{label:0,id:1})}}function kb(n,e,t){const o=n.slice();return o[10]=e[t][0],o[11]=e[t][1],o}function Eb(n){let e,t,o,l,u=!1,f,c,y=n[11]+"",w,M,k,T,z,F;return T=jk(n[9][0]),{c(){e=et("div"),t=et("input"),f=qe(),c=et("label"),w=xt(y),k=qe(),this.h()},l(B){e=tt(B,"DIV",{class:!0});var G=Lt(e);t=tt(G,"INPUT",{class:!0,id:!0,type:!0}),f=Ge(G),c=tt(G,"LABEL",{class:!0,for:!0});var J=Lt(c);w=wt(J,y),J.forEach(ee),k=Ge(G),G.forEach(ee),this.h()},h(){Ke(t,"class","govuk-radios__input"),Ke(t,"id",o=n[5]+n[10]),Ke(t,"type","radio"),t.__value=l=n[10],to(t,t.__value),Ke(c,"class","govuk-label govuk-radios__label"),Ke(c,"for",M=n[5]+n[10]),Ke(e,"class","govuk-radios__item"),T.p(t)},m(B,G){ce(B,e,G),_t(e,t),t.checked=t.__value===n[0],_t(e,f),_t(e,c),_t(c,w),_t(e,k),z||(F=[fr(t,"change",n[8]),fr(t,"change",n[7])],z=!0)},p(B,G){G&4&&o!==(o=B[5]+B[10])&&Ke(t,"id",o),G&4&&l!==(l=B[10])&&(t.__value=l,to(t,t.__value),u=!0),(u||G&5)&&(t.checked=t.__value===B[0]),G&4&&y!==(y=B[11]+"")&&ai(w,y),G&4&&M!==(M=B[5]+B[10])&&Ke(c,"for",M)},d(B){B&&ee(e),T.r(),z=!1,ss(F)}}}function D5(n){let e,t,o,l,u,f,c,y,w;f=new Rs({props:{errorMessage:n[4]}});let M=_o(n[2]),k=[];for(let T=0;T{"legend"in z&&t(1,l=z.legend),"choices"in z&&t(2,u=z.choices),"inlineSmall"in z&&t(3,f=z.inlineSmall),"required"in z&&t(6,c=z.required),"value"in z&&t(0,y=z.value)},n.$$.update=()=>{n.$$.dirty&65&&t(4,o=c&&y==""?"Required":"")},[y,l,u,f,o,w,c,k,T,M]}class Ky extends Dt{constructor(e){super(),Ft(this,e,F5,D5,At,{legend:1,choices:2,inlineSmall:3,required:6,value:0})}}function R5(n){let e,t,o,l;const u=n[2].default,f=yi(u,n,n[1],null);let c=[{type:"button"},{class:"govuk-button govuk-button--secondary"},{"data-module":"govuk-button"},n[0]],y={};for(let w=0;w{t(0,e=Qr(Qr({},e),_c(y))),"$$scope"in y&&t(1,l=y.$$scope)},e=_c(e),[e,l,o,u,f,c]}class Kr extends Dt{constructor(e){super(),Ft(this,e,B5,R5,At,{})}}function Pb(n,e,t){const o=n.slice();return o[10]=e[t][0],o[11]=e[t][1],o}function Mb(n){let e,t;return{c(){e=et("div"),t=xt(n[2]),this.h()},l(o){e=tt(o,"DIV",{class:!0});var l=Lt(e);t=wt(l,n[2]),l.forEach(ee),this.h()},h(){Ke(e,"class","govuk-hint")},m(o,l){ce(o,e,l),_t(e,t)},p(o,l){l&4&&ai(t,o[2])},d(o){o&&ee(e)}}}function Ib(n){let e;return{c(){e=et("option"),this.h()},l(t){e=tt(t,"OPTION",{}),Lt(e).forEach(ee),this.h()},h(){e.__value="",to(e,e.__value)},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function Tb(n){let e,t=n[11]+"",o,l;return{c(){e=et("option"),o=xt(t),this.h()},l(u){e=tt(u,"OPTION",{});var f=Lt(e);o=wt(f,t),f.forEach(ee),this.h()},h(){e.__value=l=n[10],to(e,e.__value)},m(u,f){ce(u,e,f),_t(e,o)},p(u,f){f&8&&t!==(t=u[11]+"")&&ai(o,t),f&8&&l!==(l=u[10])&&(e.__value=l,to(e,e.__value))},d(u){u&&ee(e)}}}function O5(n){let e,t,o,l,u,f,c,y;e=new Rs({props:{errorMessage:n[6]}});let w=n[2]&&Mb(n),M=n[4]&&Ib(),k=_o(n[3]),T=[];for(let z=0;zn[9].call(l))},m(z,F){ze(e,z,F),ce(z,t,F),w&&w.m(z,F),ce(z,o,F),ce(z,l,F),M&&M.m(l,null),_t(l,u);for(let B=0;B{"label"in z&&t(1,o=z.label),"hint"in z&&t(2,l=z.hint),"choices"in z&&t(3,u=z.choices),"emptyOption"in z&&t(4,f=z.emptyOption),"disabled"in z&&t(5,c=z.disabled),"errorMessage"in z&&t(6,y=z.errorMessage),"value"in z&&t(0,w=z.value)},[w,o,l,u,f,c,y,M,k,T]}class R2 extends Dt{constructor(e){super(),Ft(this,e,N5,$5,At,{label:1,hint:2,choices:3,emptyOption:4,disabled:5,errorMessage:6,value:0})}}function Cb(n){let e,t;return{c(){e=et("div"),t=xt(n[2]),this.h()},l(o){e=tt(o,"DIV",{class:!0});var l=Lt(e);t=wt(l,n[2]),l.forEach(ee),this.h()},h(){Ke(e,"class","govuk-hint")},m(o,l){ce(o,e,l),_t(e,t)},p(o,l){l&4&&ai(t,o[2])},d(o){o&&ee(e)}}}function j5(n){let e,t,o,l,u,f,c;e=new Rs({props:{errorMessage:n[4]}});let y=n[2]&&Cb(n);return{c(){Ae(e.$$.fragment),t=qe(),y&&y.c(),o=qe(),l=et("textarea"),this.h()},l(w){Fe(e.$$.fragment,w),t=Ge(w),y&&y.l(w),o=Ge(w),l=tt(w,"TEXTAREA",{class:!0,id:!0,rows:!0}),Lt(l).forEach(ee),this.h()},h(){Ke(l,"class","govuk-textarea"),Ke(l,"id",n[5]),Ke(l,"rows",n[3])},m(w,M){ze(e,w,M),ce(w,t,M),y&&y.m(w,M),ce(w,o,M),ce(w,l,M),to(l,n[0]),u=!0,f||(c=fr(l,"input",n[6]),f=!0)},p(w,M){const k={};M&16&&(k.errorMessage=w[4]),e.$set(k),w[2]?y?y.p(w,M):(y=Cb(w),y.c(),y.m(o.parentNode,o)):y&&(y.d(1),y=null),(!u||M&8)&&Ke(l,"rows",w[3]),M&1&&to(l,w[0])},i(w){u||(ae(e.$$.fragment,w),u=!0)},o(w){fe(e.$$.fragment,w),u=!1},d(w){w&&(ee(t),ee(o),ee(l)),Le(e,w),y&&y.d(w),f=!1,c()}}}function V5(n){let e,t;return e=new Bh({props:{label:n[1],id:n[5],$$slots:{default:[j5]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&2&&(u.label=o[1]),l&157&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function U5(n,e,t){let{label:o}=e,{hint:l=""}=e,{value:u}=e,{rows:f=5}=e,{errorMessage:c=""}=e,y=Bc();function w(){u=this.value,t(0,u)}return n.$$set=M=>{"label"in M&&t(1,o=M.label),"hint"in M&&t(2,l=M.hint),"value"in M&&t(0,u=M.value),"rows"in M&&t(3,f=M.rows),"errorMessage"in M&&t(4,c=M.errorMessage)},[u,o,l,f,c,y,w]}class q5 extends Dt{constructor(e){super(),Ft(this,e,U5,V5,At,{label:1,hint:2,value:0,rows:3,errorMessage:4})}}function G5(n){let e,t,o,l,u,f;return e=new Rs({props:{errorMessage:n[2]}}),{c(){Ae(e.$$.fragment),t=qe(),o=et("input"),this.h()},l(c){Fe(e.$$.fragment,c),t=Ge(c),o=tt(c,"INPUT",{type:!0,class:!0,id:!0}),this.h()},h(){Ke(o,"type","text"),Ke(o,"class","govuk-input"),Ke(o,"id",n[3])},m(c,y){ze(e,c,y),ce(c,t,y),ce(c,o,y),to(o,n[0]),l=!0,u||(f=fr(o,"input",n[5]),u=!0)},p(c,y){const w={};y&4&&(w.errorMessage=c[2]),e.$set(w),y&1&&o.value!==c[0]&&to(o,c[0])},i(c){l||(ae(e.$$.fragment,c),l=!0)},o(c){fe(e.$$.fragment,c),l=!1},d(c){c&&(ee(t),ee(o)),Le(e,c),u=!1,f()}}}function Z5(n){let e,t;return e=new Bh({props:{label:n[1],id:n[3],$$slots:{default:[G5]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,[l]){const u={};l&2&&(u.label=o[1]),l&69&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function H5(n,e,t){let o,{label:l}=e,{value:u}=e,{required:f=!1}=e,c=Bc();function y(){u=this.value,t(0,u)}return n.$$set=w=>{"label"in w&&t(1,l=w.label),"value"in w&&t(0,u=w.value),"required"in w&&t(4,f=w.required)},n.$$.update=()=>{n.$$.dirty&17&&t(2,o=f&&(u==null||u=="")?"Required":"")},[u,l,o,c,f,y]}class Yy extends Dt{constructor(e){super(),Ft(this,e,H5,Z5,At,{label:1,value:0,required:4})}}function W5(n){let e,t,o,l;const u=n[2].default,f=yi(u,n,n[1],null);let c=[{type:"button"},{class:"govuk-button govuk-button--warning"},{"data-module":"govuk-button"},n[0]],y={};for(let w=0;w{t(0,e=Qr(Qr({},e),_c(f))),"$$scope"in f&&t(1,l=f.$$scope)},e=_c(e),[e,l,o,u]}class dp extends Dt{constructor(e){super(),Ft(this,e,X5,W5,At,{})}}const J5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M21%2019V5c0-1.1-.9-2-2-2H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2zM8.5%2013.5l2.5%203.01L14.5%2012l4.5%206H5l3.5-4.5z'/%3e%3c/svg%3e",K5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M12%202C8.13%202%205%205.13%205%209c0%205.25%207%2013%207%2013s7-7.75%207-13c0-3.87-3.13-7-7-7zm0%209.5c-1.38%200-2.5-1.12-2.5-2.5s1.12-2.5%202.5-2.5%202.5%201.12%202.5%202.5-1.12%202.5-2.5%202.5z'/%3e%3c/svg%3e",Y5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M18%204H6c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h12c1.1%200%202-.9%202-2V6c0-1.1-.9-2-2-2zm0%2014H6V6h12v12z'/%3e%3c/svg%3e",Q5="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20enable-background='new%200%200%2024%2024'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cg%3e%3crect%20fill='none'%20height='24'%20width='24'/%3e%3c/g%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20d='M19,19h2v2h-2V19z%20M19,17h2v-2h-2V17z%20M3,13h2v-2H3V13z%20M3,17h2v-2H3V17z%20M3,9h2V7H3V9z%20M3,5h2V3H3V5z%20M7,5h2V3H7V5z%20M15,21h2v-2h-2V21z%20M11,21h2v-2h-2V21z%20M15,21h2v-2h-2V21z%20M7,21h2v-2H7V21z%20M3,21h2v-2H3V21z%20M21,8c0-2.76-2.24-5-5-5h-5v2h5%20c1.65,0,3,1.35,3,3v5h2V8z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",eD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20enable-background='new%200%200%2024%2024'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cg%3e%3crect%20fill='none'%20height='24'%20width='24'/%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M19,15.18V7c0-2.21-1.79-4-4-4s-4,1.79-4,4v10c0,1.1-0.9,2-2,2s-2-0.9-2-2V8.82C8.16,8.4,9,7.3,9,6c0-1.66-1.34-3-3-3%20S3,4.34,3,6c0,1.3,0.84,2.4,2,2.82V17c0,2.21,1.79,4,4,4s4-1.79,4-4V7c0-1.1,0.9-2,2-2s2,0.9,2,2v8.18c-1.16,0.41-2,1.51-2,2.82%20c0,1.66,1.34,3,3,3s3-1.34,3-3C21,16.7,20.16,15.6,19,15.18z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",tD="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0V0z'%20fill='none'/%3e%3cpath%20d='M12.56%2014.33c-.34.27-.56.7-.56%201.17V21h7c1.1%200%202-.9%202-2v-5.98c-.94-.33-1.95-.52-3-.52-2.03%200-3.93.7-5.44%201.83z'/%3e%3ccircle%20cx='18'%20cy='6'%20r='5'/%3e%3cpath%20d='M11.5%206c0-1.08.27-2.1.74-3H5c-1.1%200-2%20.9-2%202v14c0%20.55.23%201.05.59%201.41l9.82-9.82C12.23%209.42%2011.5%207.8%2011.5%206z'/%3e%3c/svg%3e";function rD(n){let e,t,o,l,u,f;const c=[xr(n[0],"hover-polygons"),{filter:sl},{paint:{"line-color":bh.hovering,"line-width":.5*ol}}];let y={};for(let z=0;z(f(),f=da(w,M=>t(4,u=M)),w);bt(n,xh,M=>t(3,l=M)),n.$$.on_destroy.push(()=>f());let{cfg:y}=e,{gjSchemes:w}=e;return c(),n.$$set=M=>{"cfg"in M&&t(0,y=M.cfg),"gjSchemes"in M&&c(t(1,w=M.gjSchemes))},n.$$.update=()=>{n.$$.dirty&24&&t(2,o=l==null?Mc():u.features.find(M=>M.id==l))},[y,w,o,l,u]}class oD extends Dt{constructor(e){super(),Ft(this,e,nD,iD,At,{cfg:0,gjSchemes:1})}}function sD(n){let e,t,o;return{c(){e=et("img"),o=xt(` New point`),this.h()},l(l){e=tt(l,"IMG",{src:!0,alt:!0}),o=wt(l,` New point`),this.h()},h(){zs(e.src,t=K5)||Ke(e,"src",t),Ke(e,"alt","New point")},m(l,u){ce(l,e,u),ce(l,o,u)},p:Yt,d(l){l&&(ee(e),ee(o))}}}function aD(n){let e,t,o;return{c(){e=et("img"),o=xt(` New route`),this.h()},l(l){e=tt(l,"IMG",{src:!0,alt:!0}),o=wt(l,` @@ -617,7 +617,7 @@ and limitations under the License. Georeference image`),this.h()},h(){zs(e.src,t=J5)||Ke(e,"src",t),Ke(e,"alt","Georeference image")},m(l,u){ce(l,e,u),ce(l,o,u)},p:Yt,d(l){l&&(ee(e),ee(o))}}}function fD(n){let e,t,o;return{c(){e=et("img"),o=xt(` StreetView`),this.h()},l(l){e=tt(l,"IMG",{src:!0,alt:!0}),o=wt(l,` StreetView`),this.h()},h(){zs(e.src,t=tD)||Ke(e,"src",t),Ke(e,"alt","StreetView")},m(l,u){ce(l,e,u),ce(l,o,u)},p:Yt,d(l){l&&(ee(e),ee(o))}}}function dD(n){let e,t,o,l,u,f,c,y,w,M,k,T,z,F,B,G,J;return e=new oD({props:{cfg:n[0],gjSchemes:n[1]}}),l=new Kr({props:{disabled:!n[2],$$slots:{default:[sD]},$$scope:{ctx:n}}}),l.$on("click",n[5]),f=new Kr({props:{disabled:!n[3],$$slots:{default:[aD]},$$scope:{ctx:n}}}),f.$on("click",n[6]),y=new Kr({props:{disabled:!n[4],$$slots:{default:[lD]},$$scope:{ctx:n}}}),y.$on("click",n[7]),M=new Kr({props:{disabled:!n[3],$$slots:{default:[cD]},$$scope:{ctx:n}}}),M.$on("click",n[8]),T=new Kr({props:{$$slots:{default:[uD]},$$scope:{ctx:n}}}),T.$on("click",n[9]),F=new Kr({props:{$$slots:{default:[hD]},$$scope:{ctx:n}}}),F.$on("click",n[10]),G=new Kr({props:{$$slots:{default:[fD]},$$scope:{ctx:n}}}),G.$on("click",n[11]),{c(){Ae(e.$$.fragment),t=qe(),o=et("div"),Ae(l.$$.fragment),u=qe(),Ae(f.$$.fragment),c=qe(),Ae(y.$$.fragment),w=qe(),Ae(M.$$.fragment),k=qe(),Ae(T.$$.fragment),z=qe(),Ae(F.$$.fragment),B=qe(),Ae(G.$$.fragment),this.h()},l(j){Fe(e.$$.fragment,j),t=Ge(j),o=tt(j,"DIV",{class:!0});var V=Lt(o);Fe(l.$$.fragment,V),u=Ge(V),Fe(f.$$.fragment,V),c=Ge(V),Fe(y.$$.fragment,V),w=Ge(V),Fe(M.$$.fragment,V),k=Ge(V),Fe(T.$$.fragment,V),z=Ge(V),Fe(F.$$.fragment,V),B=Ge(V),Fe(G.$$.fragment,V),V.forEach(ee),this.h()},h(){Ke(o,"class","top govuk-prose svelte-1kai3ke")},m(j,V){ze(e,j,V),ce(j,t,V),ce(j,o,V),ze(l,o,null),_t(o,u),ze(f,o,null),_t(o,c),ze(y,o,null),_t(o,w),ze(M,o,null),_t(o,k),ze(T,o,null),_t(o,z),ze(F,o,null),_t(o,B),ze(G,o,null),J=!0},p(j,[V]){const me={};V&1&&(me.cfg=j[0]),V&2&&(me.gjSchemes=j[1]),e.$set(me);const X={};V&4&&(X.disabled=!j[2]),V&4096&&(X.$$scope={dirty:V,ctx:j}),l.$set(X);const pe={};V&8&&(pe.disabled=!j[3]),V&4096&&(pe.$$scope={dirty:V,ctx:j}),f.$set(pe);const Ee={};V&16&&(Ee.disabled=!j[4]),V&4096&&(Ee.$$scope={dirty:V,ctx:j}),y.$set(Ee);const Pe={};V&8&&(Pe.disabled=!j[3]),V&4096&&(Pe.$$scope={dirty:V,ctx:j}),M.$set(Pe);const $e={};V&4096&&($e.$$scope={dirty:V,ctx:j}),T.$set($e);const Ye={};V&4096&&(Ye.$$scope={dirty:V,ctx:j}),F.$set(Ye);const ve={};V&4096&&(ve.$$scope={dirty:V,ctx:j}),G.$set(ve)},i(j){J||(ae(e.$$.fragment,j),ae(l.$$.fragment,j),ae(f.$$.fragment,j),ae(y.$$.fragment,j),ae(M.$$.fragment,j),ae(T.$$.fragment,j),ae(F.$$.fragment,j),ae(G.$$.fragment,j),J=!0)},o(j){fe(e.$$.fragment,j),fe(l.$$.fragment,j),fe(f.$$.fragment,j),fe(y.$$.fragment,j),fe(M.$$.fragment,j),fe(T.$$.fragment,j),fe(F.$$.fragment,j),fe(G.$$.fragment,j),J=!1},d(j){j&&(ee(t),ee(o)),Le(e,j),Le(l),Le(f),Le(y),Le(M),Le(T),Le(F),Le(G)}}}function pD(n,e,t){let o,l,u;bt(n,kh,B=>t(2,o=B)),bt(n,Ds,B=>t(3,l=B)),bt(n,Pc,B=>t(4,u=B));let{cfg:f}=e,{gjSchemes:c}=e;const y=()=>dr.set({mode:"new-point"}),w=()=>dr.set({mode:"new-route"}),M=()=>dr.set({mode:"new-freehand-polygon"}),k=()=>dr.set({mode:"new-snapped-polygon"}),T=()=>dr.set({mode:"split-route"}),z=()=>dr.set({mode:"set-image"}),F=()=>dr.set({mode:"streetview"});return n.$$set=B=>{"cfg"in B&&t(0,f=B.cfg),"gjSchemes"in B&&t(1,c=B.gjSchemes)},[f,c,o,l,u,y,w,M,k,T,z,F]}class mD extends Dt{constructor(e){super(),Ft(this,e,pD,dD,At,{cfg:0,gjSchemes:1})}}function gD(n){let e,t="Click to add a new point";return{c(){e=et("li"),e.textContent=t},l(o){e=tt(o,"LI",{"data-svelte-h":!0}),Pi(e)!=="svelte-dr9nud"&&(e.textContent=t)},m(o,l){ce(o,e,l)},d(o){o&&ee(e)}}}function yD(n){let e,t="Click to move the point here";return{c(){e=et("li"),e.textContent=t},l(o){e=tt(o,"LI",{"data-svelte-h":!0}),Pi(e)!=="svelte-7d87sz"&&(e.textContent=t)},m(o,l){ce(o,e,l)},d(o){o&&ee(e)}}}function _D(n){let e,t,o,l=`Press Escape - to cancel`;function u(y,w){return y[0]?yD:gD}let f=u(n),c=f(n);return{c(){e=et("ul"),c.c(),t=qe(),o=et("li"),o.innerHTML=l},l(y){e=tt(y,"UL",{});var w=Lt(e);c.l(w),t=Ge(w),o=tt(w,"LI",{"data-svelte-h":!0}),Pi(o)!=="svelte-li0w1g"&&(o.innerHTML=l),w.forEach(ee)},m(y,w){ce(y,e,w),c.m(e,null),_t(e,t),_t(e,o)},p(y,[w]){f!==(f=u(y))&&(c.d(1),c=f(y),c&&(c.c(),c.m(e,t)))},i:Yt,o:Yt,d(y){y&&ee(e),c.d()}}}function vD(n,e,t){let{editingExisting:o}=e;return n.$$set=l=>{"editingExisting"in l&&t(0,o=l.editingExisting)},[o]}class B2 extends Dt{constructor(e){super(),Ft(this,e,vD,_D,At,{editingExisting:0})}}function bD(n){let e,t,o;return{c(){e=xt("Undo ("),t=xt(n[0]),o=xt(")")},l(l){e=wt(l,"Undo ("),t=wt(l,n[0]),o=wt(l,")")},m(l,u){ce(l,e,u),ce(l,t,u),ce(l,o,u)},p(l,u){u&1&&ai(t,l[0])},d(l){l&&(ee(e),ee(t),ee(o))}}}function xD(n){let e;return{c(){e=xt("Undo")},l(t){e=wt(t,"Undo")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function wD(n){let e;function t(u,f){return u[0]==0?xD:bD}let o=t(n),l=o(n);return{c(){l.c(),e=Ot()},l(u){l.l(u),e=Ot()},m(u,f){l.m(u,f),ce(u,e,f)},p(u,f){o===(o=t(u))&&l?l.p(u,f):(l.d(1),l=o(u),l&&(l.c(),l.m(e.parentNode,e)))},d(u){u&&ee(e),l.d(u)}}}function SD(n){let e,t,o,l=`
  • Click + to cancel`;function u(y,w){return y[0]?yD:gD}let f=u(n),c=f(n);return{c(){e=et("ul"),c.c(),t=qe(),o=et("li"),o.innerHTML=l},l(y){e=tt(y,"UL",{});var w=Lt(e);c.l(w),t=Ge(w),o=tt(w,"LI",{"data-svelte-h":!0}),Pi(o)!=="svelte-li0w1g"&&(o.innerHTML=l),w.forEach(ee)},m(y,w){ce(y,e,w),c.m(e,null),_t(e,t),_t(e,o)},p(y,[w]){f!==(f=u(y))&&(c.d(1),c=f(y),c&&(c.c(),c.m(e,t)))},i:Yt,o:Yt,d(y){y&&ee(e),c.d()}}}function vD(n,e,t){let{editingExisting:o}=e;return n.$$set=l=>{"editingExisting"in l&&t(0,o=l.editingExisting)},[o]}class B2 extends Dt{constructor(e){super(),Ft(this,e,vD,_D,At,{editingExisting:0})}}function bD(n){let e,t,o;return{c(){e=xt("Undo ("),t=xt(n[0]),o=xt(")")},l(l){e=wt(l,"Undo ("),t=wt(l,n[0]),o=wt(l,")")},m(l,u){ce(l,e,u),ce(l,t,u),ce(l,o,u)},p(l,u){u&1&&ai(t,l[0])},d(l){l&&(ee(e),ee(t),ee(o))}}}function xD(n){let e;return{c(){e=xt("Undo")},l(t){e=wt(t,"Undo")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function wD(n){let e;function t(u,f){return u[0]==0?xD:bD}let o=t(n),l=o(n);return{c(){l.c(),e=$t()},l(u){l.l(u),e=$t()},m(u,f){l.m(u,f),ce(u,e,f)},p(u,f){o===(o=t(u))&&l?l.p(u,f):(l.d(1),l=o(u),l&&(l.c(),l.m(e.parentNode,e)))},d(u){u&&ee(e),l.d(u)}}}function SD(n){let e,t,o,l=`
  • Click the map to add a vertex
  • Click a vertex to delete it
  • Drag a vertex or the polygon to move it
  • Press Control+Z @@ -625,9 +625,9 @@ and limitations under the License. or double click to finish
  • Press Escape - to cancel
  • `,u;return e=new Kr({props:{disabled:n[0]==0,$$slots:{default:[wD]},$$scope:{ctx:n}}}),e.$on("click",n[1]),{c(){Ae(e.$$.fragment),t=qe(),o=et("ul"),o.innerHTML=l},l(f){Fe(e.$$.fragment,f),t=Ge(f),o=tt(f,"UL",{"data-svelte-h":!0}),Pi(o)!=="svelte-1fcmznu"&&(o.innerHTML=l)},m(f,c){ze(e,f,c),ce(f,t,c),ce(f,o,c),u=!0},p(f,[c]){const y={};c&1&&(y.disabled=f[0]==0),c&9&&(y.$$scope={dirty:c,ctx:f}),e.$set(y)},i(f){u||(ae(e.$$.fragment,f),u=!0)},o(f){fe(e.$$.fragment,f),u=!1},d(f){f&&(ee(t),ee(o)),Le(e,f)}}}function kD(n,e,t){let o,l;bt(n,Pc,f=>t(2,o=f)),bt(n,Rw,f=>t(0,l=f));function u(){o.undo()}return[l,u]}class O2 extends Dt{constructor(e){super(),Ft(this,e,kD,SD,At,{})}}function Ab(n,e,t){const o=n.slice();return o[9]=e[t],o}function zb(n){let e,t,o=n[9].place_name+"",l,u,f;function c(...y){return n[5](n[9],...y)}return{c(){e=et("li"),t=et("a"),l=xt(o),this.h()},l(y){e=tt(y,"LI",{});var w=Lt(e);t=tt(w,"A",{href:!0});var M=Lt(t);l=wt(M,o),M.forEach(ee),w.forEach(ee),this.h()},h(){Ke(t,"href","#")},m(y,w){ce(y,e,w),_t(e,t),_t(t,l),u||(f=fr(t,"click",c),u=!0)},p(y,w){n=y,w&2&&o!==(o=n[9].place_name+"")&&ai(l,o)},d(y){y&&ee(e),u=!1,f()}}}function ED(n){let e,t,o,l,u;function f(M){n[4](M)}let c={label:"Add waypoint by search"};n[0]!==void 0&&(c.value=n[0]),e=new Yy({props:c}),Hr.push(()=>fi(e,"value",f));let y=_o(n[1].features),w=[];for(let M=0;Mt=!1)),e.$set(T),k&6){y=_o(M[1].features);let z;for(z=0;zt(6,o=T)),bt(n,gd,T=>t(1,l=T)),bt(n,ro,T=>t(7,u=T));let{cfg:f}=e,c="";async function y(T){if(!T){zi(gd,l=Mc(),l);return}let z=new URLSearchParams({country:"gb",proximity:u.getCenter().toArray().join(","),fuzzyMatch:"true",key:f.maptilerApiKey}).toString(),F=`https://api.maptiler.com/geocoding/${T}.json?${z}`,G=await(await fetch(F)).json(),J=1;for(let j of G.features)j.properties.number=J++;zi(gd,l=G,l)}function w(T,z){T.preventDefault(),o.addSnappedWaypoint(z),t(0,c="")}function M(T){c=T,t(0,c)}const k=(T,z)=>w(z,T.center);return n.$$set=T=>{"cfg"in T&&t(3,f=T.cfg)},n.$$.update=()=>{n.$$.dirty&1&&y(c)},[c,l,w,f,M,k]}class MD extends Dt{constructor(e){super(),Ft(this,e,PD,ED,At,{cfg:3})}}function ID(n){let e,t,o;return{c(){e=xt("Undo ("),t=xt(n[3]),o=xt(")")},l(l){e=wt(l,"Undo ("),t=wt(l,n[3]),o=wt(l,")")},m(l,u){ce(l,e,u),ce(l,t,u),ce(l,o,u)},p(l,u){u&8&&ai(t,l[3])},d(l){l&&(ee(e),ee(t),ee(o))}}}function TD(n){let e;return{c(){e=xt("Undo")},l(t){e=wt(t,"Undo")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function CD(n){let e;function t(u,f){return u[3]==0?TD:ID}let o=t(n),l=o(n);return{c(){l.c(),e=Ot()},l(u){l.l(u),e=Ot()},m(u,f){l.m(u,f),ce(u,e,f)},p(u,f){o===(o=t(u))&&l?l.p(u,f):(l.d(1),l=o(u),l&&(l.c(),l.m(e.parentNode,e)))},d(u){u&&ee(e),l.d(u)}}}function AD(n){let e,t=`Drawing points anywhere. Press s + to cancel`,u;return e=new Kr({props:{disabled:n[0]==0,$$slots:{default:[wD]},$$scope:{ctx:n}}}),e.$on("click",n[1]),{c(){Ae(e.$$.fragment),t=qe(),o=et("ul"),o.innerHTML=l},l(f){Fe(e.$$.fragment,f),t=Ge(f),o=tt(f,"UL",{"data-svelte-h":!0}),Pi(o)!=="svelte-1fcmznu"&&(o.innerHTML=l)},m(f,c){ze(e,f,c),ce(f,t,c),ce(f,o,c),u=!0},p(f,[c]){const y={};c&1&&(y.disabled=f[0]==0),c&9&&(y.$$scope={dirty:c,ctx:f}),e.$set(y)},i(f){u||(ae(e.$$.fragment,f),u=!0)},o(f){fe(e.$$.fragment,f),u=!1},d(f){f&&(ee(t),ee(o)),Le(e,f)}}}function kD(n,e,t){let o,l;bt(n,Pc,f=>t(2,o=f)),bt(n,Rw,f=>t(0,l=f));function u(){o.undo()}return[l,u]}class O2 extends Dt{constructor(e){super(),Ft(this,e,kD,SD,At,{})}}function Ab(n,e,t){const o=n.slice();return o[9]=e[t],o}function zb(n){let e,t,o=n[9].place_name+"",l,u,f;function c(...y){return n[5](n[9],...y)}return{c(){e=et("li"),t=et("a"),l=xt(o),this.h()},l(y){e=tt(y,"LI",{});var w=Lt(e);t=tt(w,"A",{href:!0});var M=Lt(t);l=wt(M,o),M.forEach(ee),w.forEach(ee),this.h()},h(){Ke(t,"href","#")},m(y,w){ce(y,e,w),_t(e,t),_t(t,l),u||(f=fr(t,"click",c),u=!0)},p(y,w){n=y,w&2&&o!==(o=n[9].place_name+"")&&ai(l,o)},d(y){y&&ee(e),u=!1,f()}}}function ED(n){let e,t,o,l,u;function f(M){n[4](M)}let c={label:"Add waypoint by search"};n[0]!==void 0&&(c.value=n[0]),e=new Yy({props:c}),Wr.push(()=>fi(e,"value",f));let y=_o(n[1].features),w=[];for(let M=0;Mt=!1)),e.$set(T),k&6){y=_o(M[1].features);let z;for(z=0;zt(6,o=T)),bt(n,gd,T=>t(1,l=T)),bt(n,ro,T=>t(7,u=T));let{cfg:f}=e,c="";async function y(T){if(!T){zi(gd,l=Mc(),l);return}let z=new URLSearchParams({country:"gb",proximity:u.getCenter().toArray().join(","),fuzzyMatch:"true",key:f.maptilerApiKey}).toString(),F=`https://api.maptiler.com/geocoding/${T}.json?${z}`,G=await(await fetch(F)).json(),J=1;for(let j of G.features)j.properties.number=J++;zi(gd,l=G,l)}function w(T,z){T.preventDefault(),o.addSnappedWaypoint(z),t(0,c="")}function M(T){c=T,t(0,c)}const k=(T,z)=>w(z,T.center);return n.$$set=T=>{"cfg"in T&&t(3,f=T.cfg)},n.$$.update=()=>{n.$$.dirty&1&&y(c)},[c,l,w,f,M,k]}class MD extends Dt{constructor(e){super(),Ft(this,e,PD,ED,At,{cfg:3})}}function ID(n){let e,t,o;return{c(){e=xt("Undo ("),t=xt(n[3]),o=xt(")")},l(l){e=wt(l,"Undo ("),t=wt(l,n[3]),o=wt(l,")")},m(l,u){ce(l,e,u),ce(l,t,u),ce(l,o,u)},p(l,u){u&8&&ai(t,l[3])},d(l){l&&(ee(e),ee(t),ee(o))}}}function TD(n){let e;return{c(){e=xt("Undo")},l(t){e=wt(t,"Undo")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function CD(n){let e;function t(u,f){return u[3]==0?TD:ID}let o=t(n),l=o(n);return{c(){l.c(),e=$t()},l(u){l.l(u),e=$t()},m(u,f){l.m(u,f),ce(u,e,f)},p(u,f){o===(o=t(u))&&l?l.p(u,f):(l.d(1),l=o(u),l&&(l.c(),l.m(e.parentNode,e)))},d(u){u&&ee(e),l.d(u)}}}function AD(n){let e,t=`Drawing points anywhere. Press s or click below to snap to roads`,o,l,u;return l=new Kr({props:{$$slots:{default:[LD]},$$scope:{ctx:n}}}),l.$on("click",n[6]),{c(){e=et("p"),e.innerHTML=t,o=qe(),Ae(l.$$.fragment),this.h()},l(f){e=tt(f,"P",{style:!0,"data-svelte-h":!0}),Pi(e)!=="svelte-5jas5a"&&(e.innerHTML=t),o=Ge(f),Fe(l.$$.fragment,f),this.h()},h(){ki(e,"background","blue"),ki(e,"color","white"),ki(e,"padding","8px")},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1024&&(y.$$scope={dirty:c,ctx:f}),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function zD(n){let e,t=`Snapping to existing roads. Press s - or click below to draw anywhere`,o,l,u;return l=new Kr({props:{$$slots:{default:[DD]},$$scope:{ctx:n}}}),l.$on("click",n[6]),{c(){e=et("p"),e.innerHTML=t,o=qe(),Ae(l.$$.fragment),this.h()},l(f){e=tt(f,"P",{style:!0,"data-svelte-h":!0}),Pi(e)!=="svelte-wz2am1"&&(e.innerHTML=t),o=Ge(f),Fe(l.$$.fragment,f),this.h()},h(){ki(e,"background","red"),ki(e,"color","white"),ki(e,"padding","8px")},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1024&&(y.$$scope={dirty:c,ctx:f}),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function LD(n){let e;return{c(){e=xt("Snap to roads")},l(t){e=wt(t,"Snap to roads")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function DD(n){let e;return{c(){e=xt("Draw anywhere")},l(t){e=wt(t,"Draw anywhere")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function FD(n){let e;return{c(){e=xt("Add points to end")},l(t){e=wt(t,"Add points to end")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function RD(n){let e;return{c(){e=xt("Avoid doubling back")},l(t){e=wt(t,"Avoid doubling back")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function BD(n){let e,t,o,l,u,f;function c(k){n[8](k)}let y={hint:"Keep clicking to add more points to the end of the route",$$slots:{default:[FD]},$$scope:{ctx:n}};n[0]!==void 0&&(y.checked=n[0]),e=new Gg({props:y}),Hr.push(()=>fi(e,"checked",c));function w(k){n[9](k)}let M={hint:"Try to make the route avoid using the same streets with multiple waypoints",$$slots:{default:[RD]},$$scope:{ctx:n}};return n[2].avoidDoublingBack!==void 0&&(M.checked=n[2].avoidDoublingBack),l=new Gg({props:M}),Hr.push(()=>fi(l,"checked",w)),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment)},l(k){Fe(e.$$.fragment,k),o=Ge(k),Fe(l.$$.fragment,k)},m(k,T){ze(e,k,T),ce(k,o,T),ze(l,k,T),f=!0},p(k,T){const z={};T&1024&&(z.$$scope={dirty:T,ctx:k}),!t&&T&1&&(t=!0,z.checked=k[0],gi(()=>t=!1)),e.$set(z);const F={};T&1024&&(F.$$scope={dirty:T,ctx:k}),!u&&T&4&&(u=!0,F.checked=k[2].avoidDoublingBack,gi(()=>u=!1)),l.$set(F)},i(k){f||(ae(e.$$.fragment,k),ae(l.$$.fragment,k),f=!0)},o(k){fe(e.$$.fragment,k),fe(l.$$.fragment,k),f=!1},d(k){k&&ee(o),Le(e,k),Le(l,k)}}}function Lb(n){let e,t;return e=new MD({props:{cfg:n[1]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&2&&(u.cfg=o[1]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function OD(n){let e,t,o,l,u,f,c=`
  • Click + or click below to draw anywhere`,o,l,u;return l=new Kr({props:{$$slots:{default:[DD]},$$scope:{ctx:n}}}),l.$on("click",n[6]),{c(){e=et("p"),e.innerHTML=t,o=qe(),Ae(l.$$.fragment),this.h()},l(f){e=tt(f,"P",{style:!0,"data-svelte-h":!0}),Pi(e)!=="svelte-wz2am1"&&(e.innerHTML=t),o=Ge(f),Fe(l.$$.fragment,f),this.h()},h(){ki(e,"background","red"),ki(e,"color","white"),ki(e,"padding","8px")},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1024&&(y.$$scope={dirty:c,ctx:f}),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function LD(n){let e;return{c(){e=xt("Snap to roads")},l(t){e=wt(t,"Snap to roads")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function DD(n){let e;return{c(){e=xt("Draw anywhere")},l(t){e=wt(t,"Draw anywhere")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function FD(n){let e;return{c(){e=xt("Add points to end")},l(t){e=wt(t,"Add points to end")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function RD(n){let e;return{c(){e=xt("Avoid doubling back")},l(t){e=wt(t,"Avoid doubling back")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function BD(n){let e,t,o,l,u,f;function c(k){n[8](k)}let y={hint:"Keep clicking to add more points to the end of the route",$$slots:{default:[FD]},$$scope:{ctx:n}};n[0]!==void 0&&(y.checked=n[0]),e=new Gg({props:y}),Wr.push(()=>fi(e,"checked",c));function w(k){n[9](k)}let M={hint:"Try to make the route avoid using the same streets with multiple waypoints",$$slots:{default:[RD]},$$scope:{ctx:n}};return n[2].avoidDoublingBack!==void 0&&(M.checked=n[2].avoidDoublingBack),l=new Gg({props:M}),Wr.push(()=>fi(l,"checked",w)),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment)},l(k){Fe(e.$$.fragment,k),o=Ge(k),Fe(l.$$.fragment,k)},m(k,T){ze(e,k,T),ce(k,o,T),ze(l,k,T),f=!0},p(k,T){const z={};T&1024&&(z.$$scope={dirty:T,ctx:k}),!t&&T&1&&(t=!0,z.checked=k[0],gi(()=>t=!1)),e.$set(z);const F={};T&1024&&(F.$$scope={dirty:T,ctx:k}),!u&&T&4&&(u=!0,F.checked=k[2].avoidDoublingBack,gi(()=>u=!1)),l.$set(F)},i(k){f||(ae(e.$$.fragment,k),ae(l.$$.fragment,k),f=!0)},o(k){fe(e.$$.fragment,k),fe(l.$$.fragment,k),f=!1},d(k){k&&ee(o),Le(e,k),Le(l,k)}}}function Lb(n){let e,t;return e=new MD({props:{cfg:n[1]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&2&&(u.cfg=o[1]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function OD(n){let e,t,o,l,u,f,c=`
  • Click the map to add points
  • Press s to switch between snapping points to existing roads and drawing anywhere
  • Click and drag any point to move it
  • Click @@ -636,7 +636,7 @@ and limitations under the License. or double click to finish
  • Press Escape - to cancel
  • `,y,w,M,k,T;e=new Kr({props:{disabled:n[3]==0,$$slots:{default:[CD]},$$scope:{ctx:n}}}),e.$on("click",n[5]);const z=[zD,AD],F=[];function B(J,j){return J[4]?0:1}o=B(n),l=F[o]=z[o](n),w=new d5({props:{small:!0,$$slots:{default:[BD]},$$scope:{ctx:n}}});let G=n[1].maptilerApiKey&&Lb(n);return{c(){Ae(e.$$.fragment),t=qe(),l.c(),u=qe(),f=et("ul"),f.innerHTML=c,y=qe(),Ae(w.$$.fragment),M=qe(),G&&G.c(),k=Ot()},l(J){Fe(e.$$.fragment,J),t=Ge(J),l.l(J),u=Ge(J),f=tt(J,"UL",{"data-svelte-h":!0}),Pi(f)!=="svelte-9zh06q"&&(f.innerHTML=c),y=Ge(J),Fe(w.$$.fragment,J),M=Ge(J),G&&G.l(J),k=Ot()},m(J,j){ze(e,J,j),ce(J,t,j),F[o].m(J,j),ce(J,u,j),ce(J,f,j),ce(J,y,j),ze(w,J,j),ce(J,M,j),G&&G.m(J,j),ce(J,k,j),T=!0},p(J,[j]){const V={};j&8&&(V.disabled=J[3]==0),j&1032&&(V.$$scope={dirty:j,ctx:J}),e.$set(V);let me=o;o=B(J),o===me?F[o].p(J,j):(vr(),fe(F[me],1,1,()=>{F[me]=null}),br(),l=F[o],l?l.p(J,j):(l=F[o]=z[o](J),l.c()),ae(l,1),l.m(u.parentNode,u));const X={};j&1029&&(X.$$scope={dirty:j,ctx:J}),w.$set(X),J[1].maptilerApiKey?G?(G.p(J,j),j&2&&ae(G,1)):(G=Lb(J),G.c(),ae(G,1),G.m(k.parentNode,k)):G&&(vr(),fe(G,1,1,()=>{G=null}),br())},i(J){T||(ae(e.$$.fragment,J),ae(l),ae(w.$$.fragment,J),ae(G),T=!0)},o(J){fe(e.$$.fragment,J),fe(l),fe(w.$$.fragment,J),fe(G),T=!1},d(J){J&&(ee(t),ee(u),ee(f),ee(y),ee(M),ee(k)),Le(e,J),F[o].d(J),Le(w,J),G&&G.d(J)}}}function $D(n,e,t){let o,l,u,f;bt(n,Ds,z=>t(7,o=z)),bt(n,ul,z=>t(2,l=z)),bt(n,Ay,z=>t(3,u=z)),bt(n,Hw,z=>t(4,f=z));let{cfg:c}=e,{extendRoute:y}=e;function w(){o.undo()}function M(){o.toggleSnapMode()}function k(z){y=z,t(0,y)}function T(z){n.$$.not_equal(l.avoidDoublingBack,z)&&(l.avoidDoublingBack=z,ul.set(l))}return n.$$set=z=>{"cfg"in z&&t(1,c=z.cfg),"extendRoute"in z&&t(0,y=z.extendRoute)},n.$$.update=()=>{n.$$.dirty&133&&o.setRouteConfig({avoid_doubling_back:l.avoidDoublingBack,extend_route:y})},[y,c,l,u,f,w,M,o,k,T]}class $2 extends Dt{constructor(e){super(),Ft(this,e,$D,OD,At,{cfg:1,extendRoute:0})}}function ND(n){let e,t,o;return{c(){e=xt("Undo ("),t=xt(n[0]),o=xt(")")},l(l){e=wt(l,"Undo ("),t=wt(l,n[0]),o=wt(l,")")},m(l,u){ce(l,e,u),ce(l,t,u),ce(l,o,u)},p(l,u){u&1&&ai(t,l[0])},d(l){l&&(ee(e),ee(t),ee(o))}}}function jD(n){let e;return{c(){e=xt("Undo")},l(t){e=wt(t,"Undo")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function VD(n){let e;function t(u,f){return u[0]==0?jD:ND}let o=t(n),l=o(n);return{c(){l.c(),e=Ot()},l(u){l.l(u),e=Ot()},m(u,f){l.m(u,f),ce(u,e,f)},p(u,f){o===(o=t(u))&&l?l.p(u,f):(l.d(1),l=o(u),l&&(l.c(),l.m(e.parentNode,e)))},d(u){u&&ee(e),l.d(u)}}}function UD(n){let e,t,o,l=`
  • Click + to cancel
  • `,y,w,M,k,T;e=new Kr({props:{disabled:n[3]==0,$$slots:{default:[CD]},$$scope:{ctx:n}}}),e.$on("click",n[5]);const z=[zD,AD],F=[];function B(J,j){return J[4]?0:1}o=B(n),l=F[o]=z[o](n),w=new d5({props:{small:!0,$$slots:{default:[BD]},$$scope:{ctx:n}}});let G=n[1].maptilerApiKey&&Lb(n);return{c(){Ae(e.$$.fragment),t=qe(),l.c(),u=qe(),f=et("ul"),f.innerHTML=c,y=qe(),Ae(w.$$.fragment),M=qe(),G&&G.c(),k=$t()},l(J){Fe(e.$$.fragment,J),t=Ge(J),l.l(J),u=Ge(J),f=tt(J,"UL",{"data-svelte-h":!0}),Pi(f)!=="svelte-9zh06q"&&(f.innerHTML=c),y=Ge(J),Fe(w.$$.fragment,J),M=Ge(J),G&&G.l(J),k=$t()},m(J,j){ze(e,J,j),ce(J,t,j),F[o].m(J,j),ce(J,u,j),ce(J,f,j),ce(J,y,j),ze(w,J,j),ce(J,M,j),G&&G.m(J,j),ce(J,k,j),T=!0},p(J,[j]){const V={};j&8&&(V.disabled=J[3]==0),j&1032&&(V.$$scope={dirty:j,ctx:J}),e.$set(V);let me=o;o=B(J),o===me?F[o].p(J,j):(vr(),fe(F[me],1,1,()=>{F[me]=null}),br(),l=F[o],l?l.p(J,j):(l=F[o]=z[o](J),l.c()),ae(l,1),l.m(u.parentNode,u));const X={};j&1029&&(X.$$scope={dirty:j,ctx:J}),w.$set(X),J[1].maptilerApiKey?G?(G.p(J,j),j&2&&ae(G,1)):(G=Lb(J),G.c(),ae(G,1),G.m(k.parentNode,k)):G&&(vr(),fe(G,1,1,()=>{G=null}),br())},i(J){T||(ae(e.$$.fragment,J),ae(l),ae(w.$$.fragment,J),ae(G),T=!0)},o(J){fe(e.$$.fragment,J),fe(l),fe(w.$$.fragment,J),fe(G),T=!1},d(J){J&&(ee(t),ee(u),ee(f),ee(y),ee(M),ee(k)),Le(e,J),F[o].d(J),Le(w,J),G&&G.d(J)}}}function $D(n,e,t){let o,l,u,f;bt(n,Ds,z=>t(7,o=z)),bt(n,ul,z=>t(2,l=z)),bt(n,Ay,z=>t(3,u=z)),bt(n,Hw,z=>t(4,f=z));let{cfg:c}=e,{extendRoute:y}=e;function w(){o.undo()}function M(){o.toggleSnapMode()}function k(z){y=z,t(0,y)}function T(z){n.$$.not_equal(l.avoidDoublingBack,z)&&(l.avoidDoublingBack=z,ul.set(l))}return n.$$set=z=>{"cfg"in z&&t(1,c=z.cfg),"extendRoute"in z&&t(0,y=z.extendRoute)},n.$$.update=()=>{n.$$.dirty&133&&o.setRouteConfig({avoid_doubling_back:l.avoidDoublingBack,extend_route:y})},[y,c,l,u,f,w,M,o,k,T]}class $2 extends Dt{constructor(e){super(),Ft(this,e,$D,OD,At,{cfg:1,extendRoute:0})}}function ND(n){let e,t,o;return{c(){e=xt("Undo ("),t=xt(n[0]),o=xt(")")},l(l){e=wt(l,"Undo ("),t=wt(l,n[0]),o=wt(l,")")},m(l,u){ce(l,e,u),ce(l,t,u),ce(l,o,u)},p(l,u){u&1&&ai(t,l[0])},d(l){l&&(ee(e),ee(t),ee(o))}}}function jD(n){let e;return{c(){e=xt("Undo")},l(t){e=wt(t,"Undo")},m(t,o){ce(t,e,o)},p:Yt,d(t){t&&ee(e)}}}function VD(n){let e;function t(u,f){return u[0]==0?jD:ND}let o=t(n),l=o(n);return{c(){l.c(),e=$t()},l(u){l.l(u),e=$t()},m(u,f){l.m(u,f),ce(u,e,f)},p(u,f){o===(o=t(u))&&l?l.p(u,f):(l.d(1),l=o(u),l&&(l.c(),l.m(e.parentNode,e)))},d(u){u&&ee(e),l.d(u)}}}function UD(n){let e,t,o,l=`
  • Click the map to add points
  • Click and drag any point to move it
  • Click a waypoint to delete it
  • Press Control+Z @@ -644,15 +644,15 @@ and limitations under the License. or double click to finish
  • Press Escape - to cancel
  • `,u;return e=new Kr({props:{disabled:n[0]==0,$$slots:{default:[VD]},$$scope:{ctx:n}}}),e.$on("click",n[1]),{c(){Ae(e.$$.fragment),t=qe(),o=et("ul"),o.innerHTML=l},l(f){Fe(e.$$.fragment,f),t=Ge(f),o=tt(f,"UL",{"data-svelte-h":!0}),Pi(o)!=="svelte-6mzb5r"&&(o.innerHTML=l)},m(f,c){ze(e,f,c),ce(f,t,c),ce(f,o,c),u=!0},p(f,[c]){const y={};c&1&&(y.disabled=f[0]==0),c&9&&(y.$$scope={dirty:c,ctx:f}),e.$set(y)},i(f){u||(ae(e.$$.fragment,f),u=!0)},o(f){fe(e.$$.fragment,f),u=!1},d(f){f&&(ee(t),ee(o)),Le(e,f)}}}function qD(n,e,t){let o,l;bt(n,Ds,f=>t(2,o=f)),bt(n,Ay,f=>t(0,l=f));function u(){o.undo()}return[l,u]}class N2 extends Dt{constructor(e){super(),Ft(this,e,qD,UD,At,{})}}function GD(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function ZD(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function HD(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[GD]},$$scope:{ctx:n}}}),e.$on("click",n[3]),o=new Kr({props:{$$slots:{default:[ZD]},$$scope:{ctx:n}}}),o.$on("click",n[4]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&32768&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&32768&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function WD(n){let e,t;return e=new N2({}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function XD(n){let e,t;return e=new O2({}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function JD(n){let e,t;return e=new $2({props:{cfg:n[0],extendRoute:!1}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function KD(n){let e,t;return e=new B2({props:{editingExisting:!0}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function YD(n){let e,t,o,l,u,f,c,y,w,M;u=new pl({props:{$$slots:{default:[HD]},$$scope:{ctx:n}}});const k=[KD,JD,XD,WD],T=[];function z(F,B){return F[2]=="point"?0:F[2]=="route"?1:F[2]=="freehand-polygon"?2:F[2]=="snapped-polygon"?3:-1}return~(c=z(n))&&(y=T[c]=k[c](n)),{c(){e=et("h2"),t=xt("Editing "),o=xt(n[1]),l=qe(),Ae(u.$$.fragment),f=qe(),y&&y.c(),w=Ot()},l(F){e=tt(F,"H2",{});var B=Lt(e);t=wt(B,"Editing "),o=wt(B,n[1]),B.forEach(ee),l=Ge(F),Fe(u.$$.fragment,F),f=Ge(F),y&&y.l(F),w=Ot()},m(F,B){ce(F,e,B),_t(e,t),_t(e,o),ce(F,l,B),ze(u,F,B),ce(F,f,B),~c&&T[c].m(F,B),ce(F,w,B),M=!0},p(F,[B]){(!M||B&2)&&ai(o,F[1]);const G={};B&32768&&(G.$$scope={dirty:B,ctx:F}),u.$set(G);let J=c;c=z(F),c===J?~c&&T[c].p(F,B):(y&&(vr(),fe(T[J],1,1,()=>{T[J]=null}),br()),~c?(y=T[c],y?y.p(F,B):(y=T[c]=k[c](F),y.c()),ae(y,1),y.m(w.parentNode,w)):y=null)},i(F){M||(ae(u.$$.fragment,F),ae(y),M=!0)},o(F){fe(u.$$.fragment,F),fe(y),M=!1},d(F){F&&(ee(e),ee(l),ee(f),ee(w)),Le(u,F),~c&&T[c].d(F)}}}function QD(n,e,t){let o,l,u;bt(n,Pc,j=>t(8,o=j)),bt(n,Ds,j=>t(9,l=j)),bt(n,kh,j=>t(10,u=j));let{cfg:f}=e,{gjSchemes:c}=e,{id:y}=e,w="",M="",k=null;As(()=>{let j=null;c.update(me=>(j=me.features.find(X=>X.id==y),j.properties.hide_while_editing=!0,me));let V=j;t(1,w=f.interventionName(V)),V.geometry.type=="LineString"?(l==null||l.editExistingRoute(V),l==null||l.addEventListenerSuccess(T),l==null||l.addEventListenerUpdated(z),l==null||l.addEventListenerFailure(F),t(2,M="route")):V.geometry.type=="Polygon"?V.properties.waypoints?(l==null||l.editExistingArea(V),l==null||l.addEventListenerSuccess(T),l==null||l.addEventListenerUpdated(z),l==null||l.addEventListenerFailure(F),t(2,M="snapped-polygon")):(o==null||o.editExisting(V),o==null||o.addEventListenerSuccess(T),o==null||o.addEventListenerUpdated(z),o==null||o.addEventListenerFailure(F),t(2,M="freehand-polygon")):V.geometry.type=="Point"&&(u==null||u.start(),u==null||u.addEventListenerSuccess(T),u==null||u.addEventListenerFailure(F),t(2,M="point"))}),Ei(()=>{u==null||u.stop(),u==null||u.clearEventListeners(),l==null||l.stop(),l==null||l.clearEventListeners(),o==null||o.stop(),o==null||o.clearEventListeners(),c.update(j=>{let V=j.features.find(me=>me.id==y);return delete V.properties.hide_while_editing,k&&B(V,k),j})});function T(j){j.properties??(j.properties={}),k=j,dr.set({mode:"edit-form",id:y})}function z(j){k=j}function F(){k=null,dr.set({mode:"edit-form",id:y})}function B(j,V){j.geometry=V.geometry,V.properties.length_meters&&(j.properties.length_meters=V.properties.length_meters),V.properties.waypoints&&(j.properties.waypoints=V.properties.waypoints),f.updateFeature(j,V)}function G(){dr.set({mode:"edit-form",id:y})}function J(){k=null,dr.set({mode:"edit-form",id:y})}return n.$$set=j=>{"cfg"in j&&t(0,f=j.cfg),"gjSchemes"in j&&t(5,c=j.gjSchemes),"id"in j&&t(6,y=j.id)},[f,w,M,G,J,c,y]}class e6 extends Dt{constructor(e){super(),Ft(this,e,QD,YD,At,{cfg:0,gjSchemes:5,id:6})}}function t6(n){let e;return{c(){e=xt("Save")},l(t){e=wt(t,"Save")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function r6(n){let e;return{c(){e=xt("Delete")},l(t){e=wt(t,"Delete")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function i6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[t6]},$$scope:{ctx:n}}}),e.$on("click",n[6]),o=new dp({props:{disabled:!n[2],$$slots:{default:[r6]},$$scope:{ctx:n}}}),o.$on("click",n[4]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&512&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&4&&(y.disabled=!u[2]),f&512&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function n6(n){let e,t,o;return{c(){e=et("input"),this.h()},l(l){e=tt(l,"INPUT",{class:!0,id:!0,type:!0}),this.h()},h(){Ke(e,"class","govuk-file-upload"),Ke(e,"id","load-image"),Ke(e,"type","file")},m(l,u){ce(l,e,u),n[7](e),t||(o=fr(e,"change",n[3]),t=!0)},p:Yt,d(l){l&&ee(e),n[7](null),t=!1,o()}}}function Db(n){let e,t,o,l,u,f,c,y;return{c(){e=et("div"),t=et("label"),o=et("input"),l=xt(` + to cancel`,u;return e=new Kr({props:{disabled:n[0]==0,$$slots:{default:[VD]},$$scope:{ctx:n}}}),e.$on("click",n[1]),{c(){Ae(e.$$.fragment),t=qe(),o=et("ul"),o.innerHTML=l},l(f){Fe(e.$$.fragment,f),t=Ge(f),o=tt(f,"UL",{"data-svelte-h":!0}),Pi(o)!=="svelte-6mzb5r"&&(o.innerHTML=l)},m(f,c){ze(e,f,c),ce(f,t,c),ce(f,o,c),u=!0},p(f,[c]){const y={};c&1&&(y.disabled=f[0]==0),c&9&&(y.$$scope={dirty:c,ctx:f}),e.$set(y)},i(f){u||(ae(e.$$.fragment,f),u=!0)},o(f){fe(e.$$.fragment,f),u=!1},d(f){f&&(ee(t),ee(o)),Le(e,f)}}}function qD(n,e,t){let o,l;bt(n,Ds,f=>t(2,o=f)),bt(n,Ay,f=>t(0,l=f));function u(){o.undo()}return[l,u]}class N2 extends Dt{constructor(e){super(),Ft(this,e,qD,UD,At,{})}}function GD(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function ZD(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function HD(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[GD]},$$scope:{ctx:n}}}),e.$on("click",n[3]),o=new Kr({props:{$$slots:{default:[ZD]},$$scope:{ctx:n}}}),o.$on("click",n[4]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&32768&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&32768&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function WD(n){let e,t;return e=new N2({}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function XD(n){let e,t;return e=new O2({}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function JD(n){let e,t;return e=new $2({props:{cfg:n[0],extendRoute:!1}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function KD(n){let e,t;return e=new B2({props:{editingExisting:!0}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function YD(n){let e,t,o,l,u,f,c,y,w,M;u=new pl({props:{$$slots:{default:[HD]},$$scope:{ctx:n}}});const k=[KD,JD,XD,WD],T=[];function z(F,B){return F[2]=="point"?0:F[2]=="route"?1:F[2]=="freehand-polygon"?2:F[2]=="snapped-polygon"?3:-1}return~(c=z(n))&&(y=T[c]=k[c](n)),{c(){e=et("h2"),t=xt("Editing "),o=xt(n[1]),l=qe(),Ae(u.$$.fragment),f=qe(),y&&y.c(),w=$t()},l(F){e=tt(F,"H2",{});var B=Lt(e);t=wt(B,"Editing "),o=wt(B,n[1]),B.forEach(ee),l=Ge(F),Fe(u.$$.fragment,F),f=Ge(F),y&&y.l(F),w=$t()},m(F,B){ce(F,e,B),_t(e,t),_t(e,o),ce(F,l,B),ze(u,F,B),ce(F,f,B),~c&&T[c].m(F,B),ce(F,w,B),M=!0},p(F,[B]){(!M||B&2)&&ai(o,F[1]);const G={};B&32768&&(G.$$scope={dirty:B,ctx:F}),u.$set(G);let J=c;c=z(F),c===J?~c&&T[c].p(F,B):(y&&(vr(),fe(T[J],1,1,()=>{T[J]=null}),br()),~c?(y=T[c],y?y.p(F,B):(y=T[c]=k[c](F),y.c()),ae(y,1),y.m(w.parentNode,w)):y=null)},i(F){M||(ae(u.$$.fragment,F),ae(y),M=!0)},o(F){fe(u.$$.fragment,F),fe(y),M=!1},d(F){F&&(ee(e),ee(l),ee(f),ee(w)),Le(u,F),~c&&T[c].d(F)}}}function QD(n,e,t){let o,l,u;bt(n,Pc,j=>t(8,o=j)),bt(n,Ds,j=>t(9,l=j)),bt(n,kh,j=>t(10,u=j));let{cfg:f}=e,{gjSchemes:c}=e,{id:y}=e,w="",M="",k=null;As(()=>{let j=null;c.update(me=>(j=me.features.find(X=>X.id==y),j.properties.hide_while_editing=!0,me));let V=j;t(1,w=f.interventionName(V)),V.geometry.type=="LineString"?(l==null||l.editExistingRoute(V),l==null||l.addEventListenerSuccess(T),l==null||l.addEventListenerUpdated(z),l==null||l.addEventListenerFailure(F),t(2,M="route")):V.geometry.type=="Polygon"?V.properties.waypoints?(l==null||l.editExistingArea(V),l==null||l.addEventListenerSuccess(T),l==null||l.addEventListenerUpdated(z),l==null||l.addEventListenerFailure(F),t(2,M="snapped-polygon")):(o==null||o.editExisting(V),o==null||o.addEventListenerSuccess(T),o==null||o.addEventListenerUpdated(z),o==null||o.addEventListenerFailure(F),t(2,M="freehand-polygon")):V.geometry.type=="Point"&&(u==null||u.start(),u==null||u.addEventListenerSuccess(T),u==null||u.addEventListenerFailure(F),t(2,M="point"))}),Ei(()=>{u==null||u.stop(),u==null||u.clearEventListeners(),l==null||l.stop(),l==null||l.clearEventListeners(),o==null||o.stop(),o==null||o.clearEventListeners(),c.update(j=>{let V=j.features.find(me=>me.id==y);return delete V.properties.hide_while_editing,k&&B(V,k),j})});function T(j){j.properties??(j.properties={}),k=j,dr.set({mode:"edit-form",id:y})}function z(j){k=j}function F(){k=null,dr.set({mode:"edit-form",id:y})}function B(j,V){j.geometry=V.geometry,V.properties.length_meters&&(j.properties.length_meters=V.properties.length_meters),V.properties.waypoints&&(j.properties.waypoints=V.properties.waypoints),f.updateFeature(j,V)}function G(){dr.set({mode:"edit-form",id:y})}function J(){k=null,dr.set({mode:"edit-form",id:y})}return n.$$set=j=>{"cfg"in j&&t(0,f=j.cfg),"gjSchemes"in j&&t(5,c=j.gjSchemes),"id"in j&&t(6,y=j.id)},[f,w,M,G,J,c,y]}class e6 extends Dt{constructor(e){super(),Ft(this,e,QD,YD,At,{cfg:0,gjSchemes:5,id:6})}}function t6(n){let e;return{c(){e=xt("Save")},l(t){e=wt(t,"Save")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function r6(n){let e;return{c(){e=xt("Delete")},l(t){e=wt(t,"Delete")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function i6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[t6]},$$scope:{ctx:n}}}),e.$on("click",n[6]),o=new dp({props:{disabled:!n[2],$$slots:{default:[r6]},$$scope:{ctx:n}}}),o.$on("click",n[4]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&512&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&4&&(y.disabled=!u[2]),f&512&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function n6(n){let e,t,o;return{c(){e=et("input"),this.h()},l(l){e=tt(l,"INPUT",{class:!0,id:!0,type:!0}),this.h()},h(){Ke(e,"class","govuk-file-upload"),Ke(e,"id","load-image"),Ke(e,"type","file")},m(l,u){ce(l,e,u),n[7](e),t||(o=fr(e,"change",n[3]),t=!0)},p:Yt,d(l){l&&ee(e),n[7](null),t=!1,o()}}}function Db(n){let e,t,o,l,u,f,c,y;return{c(){e=et("div"),t=et("label"),o=et("input"),l=xt(` Opacity: `),u=xt(n[1]),f=xt("%"),this.h()},l(w){e=tt(w,"DIV",{});var M=Lt(e);t=tt(M,"LABEL",{});var k=Lt(t);o=tt(k,"INPUT",{type:!0,min:!0,max:!0}),l=wt(k,` - Opacity: `),u=wt(k,n[1]),f=wt(k,"%"),k.forEach(ee),M.forEach(ee),this.h()},h(){Ke(o,"type","range"),Ke(o,"min","0"),Ke(o,"max","100")},m(w,M){ce(w,e,M),_t(e,t),_t(t,o),to(o,n[1]),_t(t,l),_t(t,u),_t(t,f),c||(y=[fr(o,"change",n[8]),fr(o,"input",n[8])],c=!0)},p(w,M){M&2&&to(o,w[1]),M&2&&ai(u,w[1])},d(w){w&&ee(e),c=!1,os(y)}}}function o6(n){let e,t,o,l,u,f,c=`Note this image isn't saved as part of this scheme. When you close this page, - it'll be lost.`,y,w,M;e=new pl({props:{$$slots:{default:[i6]},$$scope:{ctx:n}}}),o=new Bh({props:{label:"Load an image",id:"load-image",$$slots:{default:[n6]},$$scope:{ctx:n}}});let k=n[2]&&Db(n);return{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),k&&k.c(),u=qe(),f=et("p"),f.textContent=c},l(T){Fe(e.$$.fragment,T),t=Ge(T),Fe(o.$$.fragment,T),l=Ge(T),k&&k.l(T),u=Ge(T),f=tt(T,"P",{"data-svelte-h":!0}),Pi(f)!=="svelte-1u70vof"&&(f.textContent=c)},m(T,z){ze(e,T,z),ce(T,t,z),ze(o,T,z),ce(T,l,z),k&&k.m(T,z),ce(T,u,z),ce(T,f,z),y=!0,w||(M=fr(window,"keydown",n[5]),w=!0)},p(T,[z]){const F={};z&516&&(F.$$scope={dirty:z,ctx:T}),e.$set(F);const B={};z&513&&(B.$$scope={dirty:z,ctx:T}),o.$set(B),T[2]?k?k.p(T,z):(k=Db(T),k.c(),k.m(u.parentNode,u)):k&&(k.d(1),k=null)},i(T){y||(ae(e.$$.fragment,T),ae(o.$$.fragment,T),y=!0)},o(T){fe(e.$$.fragment,T),fe(o.$$.fragment,T),y=!1},d(T){T&&(ee(t),ee(l),ee(u),ee(f)),Le(e,T),Le(o,T),k&&k.d(T),w=!1,M()}}}function s6(n,e,t){let o,l;bt(n,md,T=>t(1,o=T)),bt(n,pd,T=>t(2,l=T));let u;async function f(T){let z=await u.files[0].arrayBuffer(),F=new Blob([new Uint8Array(z)]);zi(pd,l=URL.createObjectURL(F),l)}function c(){zi(pd,l=null,l),zi(md,o=100,o)}function y(T){T.key=="Escape"&&(T.stopPropagation(),dr.set({mode:"list"}))}const w=()=>dr.set({mode:"list"});function M(T){Hr[T?"unshift":"push"](()=>{u=T,t(0,u)})}function k(){o=qk(this.value),md.set(o)}return[u,o,l,f,c,y,w,M,k]}class a6 extends Dt{constructor(e){super(),Ft(this,e,s6,o6,At,{})}}function l6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function c6(n){let e,t,o,l;return e=new Kr({props:{$$slots:{default:[l6]},$$scope:{ctx:n}}}),e.$on("click",n[0]),o=new B2({props:{editingExisting:!1}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&32&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function u6(n,e,t){let o;bt(n,kh,y=>t(3,o=y));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.start(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(y){y.properties||(y.properties={});let w=y;u.update(M=>(w.id=Lh(M),w.properties.scheme_reference=op(M),l.newPointFeature(w),M.features.push(w),M)),dr.set({mode:"edit-form",id:w.id})}function c(){dr.set({mode:"list"})}return n.$$set=y=>{"cfg"in y&&t(1,l=y.cfg),"gjSchemes"in y&&t(2,u=y.gjSchemes)},[c,l,u]}class h6 extends Dt{constructor(e){super(),Ft(this,e,u6,c6,At,{cfg:1,gjSchemes:2})}}function f6(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function d6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function p6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[f6]},$$scope:{ctx:n}}}),e.$on("click",n[1]),o=new Kr({props:{$$slots:{default:[d6]},$$scope:{ctx:n}}}),o.$on("click",n[0]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&64&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function m6(n){let e,t,o,l;return e=new pl({props:{$$slots:{default:[p6]},$$scope:{ctx:n}}}),o=new O2({}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function g6(n,e,t){let o;bt(n,Pc,w=>t(4,o=w));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.startNew(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(w){w.properties||(w.properties={});let M=w;u.update(k=>(M.id=Lh(k),M.properties.scheme_reference=op(k),l.newPolygonFeature(M),k.features.push(M),k)),dr.set({mode:"edit-form",id:M.id})}function c(){dr.set({mode:"list"})}function y(){o.finish()}return n.$$set=w=>{"cfg"in w&&t(2,l=w.cfg),"gjSchemes"in w&&t(3,u=w.gjSchemes)},[c,y,l,u]}class y6 extends Dt{constructor(e){super(),Ft(this,e,g6,m6,At,{cfg:2,gjSchemes:3})}}function _6(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function v6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function b6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[_6]},$$scope:{ctx:n}}}),e.$on("click",n[2]),o=new Kr({props:{$$slots:{default:[v6]},$$scope:{ctx:n}}}),o.$on("click",n[1]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&64&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function x6(n){let e,t,o,l;return e=new pl({props:{$$slots:{default:[b6]},$$scope:{ctx:n}}}),o=new $2({props:{cfg:n[0],extendRoute:!0}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&1&&(y.cfg=u[0]),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function w6(n,e,t){let o;bt(n,Ds,w=>t(4,o=w));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.startRoute(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(w){let M=w;u.update(k=>(M.id=Lh(k),M.properties.scheme_reference=op(k),l.newLineStringFeature(M),k.features.push(M),k)),dr.set({mode:"edit-form",id:M.id})}function c(){dr.set({mode:"list"})}function y(){o.finish()}return n.$$set=w=>{"cfg"in w&&t(0,l=w.cfg),"gjSchemes"in w&&t(3,u=w.gjSchemes)},[l,c,y,u]}class S6 extends Dt{constructor(e){super(),Ft(this,e,w6,x6,At,{cfg:0,gjSchemes:3})}}function Fb(n){let e,t;return e=new Kr({props:{$$slots:{default:[k6]},$$scope:{ctx:n}}}),e.$on("click",n[5]),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&128&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function k6(n){let e;return{c(){e=xt("X")},l(t){e=wt(t,"X")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function E6(n){let e,t,o,l,u,f,c,y,w,M,k=n[2]&&Fb(n);const T=n[4].default,z=yi(T,n,n[7],null);return{c(){e=et("div"),t=et("div"),o=et("div"),l=et("h1"),u=xt(n[1]),f=qe(),k&&k.c(),c=qe(),z&&z.c(),this.h()},l(F){e=tt(F,"DIV",{class:!0});var B=Lt(e);t=tt(B,"DIV",{class:!0});var G=Lt(t);o=tt(G,"DIV",{style:!0});var J=Lt(o);l=tt(J,"H1",{class:!0});var j=Lt(l);u=wt(j,n[1]),j.forEach(ee),f=Ge(J),k&&k.l(J),J.forEach(ee),c=Ge(G),z&&z.l(G),G.forEach(ee),B.forEach(ee),this.h()},h(){Ke(l,"class","govuk-heading-l"),ki(o,"display","flex"),ki(o,"justify-content","space-between"),Ke(t,"class","content centered-fullscreen svelte-1st8ub0"),Ke(e,"class","background svelte-1st8ub0"),es(e,"open",n[0]),es(e,"closed",!n[0])},m(F,B){ce(F,e,B),_t(e,t),_t(t,o),_t(o,l),_t(l,u),_t(o,f),k&&k.m(o,null),_t(t,c),z&&z.m(t,null),y=!0,w||(M=[fr(t,"click",td(P6)),fr(e,"click",n[6])],w=!0)},p(F,[B]){(!y||B&2)&&ai(u,F[1]),F[2]?k?(k.p(F,B),B&4&&ae(k,1)):(k=Fb(F),k.c(),ae(k,1),k.m(o,null)):k&&(vr(),fe(k,1,1,()=>{k=null}),br()),z&&z.p&&(!y||B&128)&&_i(z,T,F,F[7],y?bi(T,F[7],B,null):vi(F[7]),null),(!y||B&1)&&es(e,"open",F[0]),(!y||B&1)&&es(e,"closed",!F[0])},i(F){y||(ae(k),ae(z,F),y=!0)},o(F){fe(k),fe(z,F),y=!1},d(F){F&&ee(e),k&&k.d(),z&&z.d(F),w=!1,os(M)}}}const P6=()=>null;function M6(n,e,t){let{$$slots:o={},$$scope:l}=e,{title:u}=e,{open:f=!1}=e,{displayEscapeButton:c=!0}=e,{canCloseByClickingBackground:y=!0}=e;const w=()=>t(0,f=!1),M=()=>{y&&t(0,f=!1)};return n.$$set=k=>{"title"in k&&t(1,u=k.title),"open"in k&&t(0,f=k.open),"displayEscapeButton"in k&&t(2,c=k.displayEscapeButton),"canCloseByClickingBackground"in k&&t(3,y=k.canCloseByClickingBackground),"$$scope"in k&&t(7,l=k.$$scope)},[f,u,c,y,o,w,M,l]}class j2 extends Dt{constructor(e){super(),Ft(this,e,M6,E6,At,{title:1,open:0,displayEscapeButton:2,canCloseByClickingBackground:3})}}function I6(n){let e,t=`
  • Click + Opacity: `),u=wt(k,n[1]),f=wt(k,"%"),k.forEach(ee),M.forEach(ee),this.h()},h(){Ke(o,"type","range"),Ke(o,"min","0"),Ke(o,"max","100")},m(w,M){ce(w,e,M),_t(e,t),_t(t,o),to(o,n[1]),_t(t,l),_t(t,u),_t(t,f),c||(y=[fr(o,"change",n[8]),fr(o,"input",n[8])],c=!0)},p(w,M){M&2&&to(o,w[1]),M&2&&ai(u,w[1])},d(w){w&&ee(e),c=!1,ss(y)}}}function o6(n){let e,t,o,l,u,f,c=`Note this image isn't saved as part of this scheme. When you close this page, + it'll be lost.`,y,w,M;e=new pl({props:{$$slots:{default:[i6]},$$scope:{ctx:n}}}),o=new Bh({props:{label:"Load an image",id:"load-image",$$slots:{default:[n6]},$$scope:{ctx:n}}});let k=n[2]&&Db(n);return{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),k&&k.c(),u=qe(),f=et("p"),f.textContent=c},l(T){Fe(e.$$.fragment,T),t=Ge(T),Fe(o.$$.fragment,T),l=Ge(T),k&&k.l(T),u=Ge(T),f=tt(T,"P",{"data-svelte-h":!0}),Pi(f)!=="svelte-1u70vof"&&(f.textContent=c)},m(T,z){ze(e,T,z),ce(T,t,z),ze(o,T,z),ce(T,l,z),k&&k.m(T,z),ce(T,u,z),ce(T,f,z),y=!0,w||(M=fr(window,"keydown",n[5]),w=!0)},p(T,[z]){const F={};z&516&&(F.$$scope={dirty:z,ctx:T}),e.$set(F);const B={};z&513&&(B.$$scope={dirty:z,ctx:T}),o.$set(B),T[2]?k?k.p(T,z):(k=Db(T),k.c(),k.m(u.parentNode,u)):k&&(k.d(1),k=null)},i(T){y||(ae(e.$$.fragment,T),ae(o.$$.fragment,T),y=!0)},o(T){fe(e.$$.fragment,T),fe(o.$$.fragment,T),y=!1},d(T){T&&(ee(t),ee(l),ee(u),ee(f)),Le(e,T),Le(o,T),k&&k.d(T),w=!1,M()}}}function s6(n,e,t){let o,l;bt(n,md,T=>t(1,o=T)),bt(n,pd,T=>t(2,l=T));let u;async function f(T){let z=await u.files[0].arrayBuffer(),F=new Blob([new Uint8Array(z)]);zi(pd,l=URL.createObjectURL(F),l)}function c(){zi(pd,l=null,l),zi(md,o=100,o)}function y(T){T.key=="Escape"&&(T.stopPropagation(),dr.set({mode:"list"}))}const w=()=>dr.set({mode:"list"});function M(T){Wr[T?"unshift":"push"](()=>{u=T,t(0,u)})}function k(){o=qk(this.value),md.set(o)}return[u,o,l,f,c,y,w,M,k]}class a6 extends Dt{constructor(e){super(),Ft(this,e,s6,o6,At,{})}}function l6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function c6(n){let e,t,o,l;return e=new Kr({props:{$$slots:{default:[l6]},$$scope:{ctx:n}}}),e.$on("click",n[0]),o=new B2({props:{editingExisting:!1}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&32&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function u6(n,e,t){let o;bt(n,kh,y=>t(3,o=y));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.start(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(y){y.properties||(y.properties={});let w=y;u.update(M=>(w.id=Lh(M),w.properties.scheme_reference=op(M),l.newPointFeature(w),M.features.push(w),M)),dr.set({mode:"edit-form",id:w.id})}function c(){dr.set({mode:"list"})}return n.$$set=y=>{"cfg"in y&&t(1,l=y.cfg),"gjSchemes"in y&&t(2,u=y.gjSchemes)},[c,l,u]}class h6 extends Dt{constructor(e){super(),Ft(this,e,u6,c6,At,{cfg:1,gjSchemes:2})}}function f6(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function d6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function p6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[f6]},$$scope:{ctx:n}}}),e.$on("click",n[1]),o=new Kr({props:{$$slots:{default:[d6]},$$scope:{ctx:n}}}),o.$on("click",n[0]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&64&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function m6(n){let e,t,o,l;return e=new pl({props:{$$slots:{default:[p6]},$$scope:{ctx:n}}}),o=new O2({}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function g6(n,e,t){let o;bt(n,Pc,w=>t(4,o=w));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.startNew(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(w){w.properties||(w.properties={});let M=w;u.update(k=>(M.id=Lh(k),M.properties.scheme_reference=op(k),l.newPolygonFeature(M),k.features.push(M),k)),dr.set({mode:"edit-form",id:M.id})}function c(){dr.set({mode:"list"})}function y(){o.finish()}return n.$$set=w=>{"cfg"in w&&t(2,l=w.cfg),"gjSchemes"in w&&t(3,u=w.gjSchemes)},[c,y,l,u]}class y6 extends Dt{constructor(e){super(),Ft(this,e,g6,m6,At,{cfg:2,gjSchemes:3})}}function _6(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function v6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function b6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[_6]},$$scope:{ctx:n}}}),e.$on("click",n[2]),o=new Kr({props:{$$slots:{default:[v6]},$$scope:{ctx:n}}}),o.$on("click",n[1]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&64&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function x6(n){let e,t,o,l;return e=new pl({props:{$$slots:{default:[b6]},$$scope:{ctx:n}}}),o=new $2({props:{cfg:n[0],extendRoute:!0}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&1&&(y.cfg=u[0]),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function w6(n,e,t){let o;bt(n,Ds,w=>t(4,o=w));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.startRoute(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(w){let M=w;u.update(k=>(M.id=Lh(k),M.properties.scheme_reference=op(k),l.newLineStringFeature(M),k.features.push(M),k)),dr.set({mode:"edit-form",id:M.id})}function c(){dr.set({mode:"list"})}function y(){o.finish()}return n.$$set=w=>{"cfg"in w&&t(0,l=w.cfg),"gjSchemes"in w&&t(3,u=w.gjSchemes)},[l,c,y,u]}class S6 extends Dt{constructor(e){super(),Ft(this,e,w6,x6,At,{cfg:0,gjSchemes:3})}}function Fb(n){let e,t;return e=new Kr({props:{$$slots:{default:[k6]},$$scope:{ctx:n}}}),e.$on("click",n[5]),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&128&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function k6(n){let e;return{c(){e=xt("X")},l(t){e=wt(t,"X")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function E6(n){let e,t,o,l,u,f,c,y,w,M,k=n[2]&&Fb(n);const T=n[4].default,z=yi(T,n,n[7],null);return{c(){e=et("div"),t=et("div"),o=et("div"),l=et("h1"),u=xt(n[1]),f=qe(),k&&k.c(),c=qe(),z&&z.c(),this.h()},l(F){e=tt(F,"DIV",{class:!0});var B=Lt(e);t=tt(B,"DIV",{class:!0});var G=Lt(t);o=tt(G,"DIV",{style:!0});var J=Lt(o);l=tt(J,"H1",{class:!0});var j=Lt(l);u=wt(j,n[1]),j.forEach(ee),f=Ge(J),k&&k.l(J),J.forEach(ee),c=Ge(G),z&&z.l(G),G.forEach(ee),B.forEach(ee),this.h()},h(){Ke(l,"class","govuk-heading-l"),ki(o,"display","flex"),ki(o,"justify-content","space-between"),Ke(t,"class","content centered-fullscreen svelte-1st8ub0"),Ke(e,"class","background svelte-1st8ub0"),ts(e,"open",n[0]),ts(e,"closed",!n[0])},m(F,B){ce(F,e,B),_t(e,t),_t(t,o),_t(o,l),_t(l,u),_t(o,f),k&&k.m(o,null),_t(t,c),z&&z.m(t,null),y=!0,w||(M=[fr(t,"click",td(P6)),fr(e,"click",n[6])],w=!0)},p(F,[B]){(!y||B&2)&&ai(u,F[1]),F[2]?k?(k.p(F,B),B&4&&ae(k,1)):(k=Fb(F),k.c(),ae(k,1),k.m(o,null)):k&&(vr(),fe(k,1,1,()=>{k=null}),br()),z&&z.p&&(!y||B&128)&&_i(z,T,F,F[7],y?bi(T,F[7],B,null):vi(F[7]),null),(!y||B&1)&&ts(e,"open",F[0]),(!y||B&1)&&ts(e,"closed",!F[0])},i(F){y||(ae(k),ae(z,F),y=!0)},o(F){fe(k),fe(z,F),y=!1},d(F){F&&ee(e),k&&k.d(),z&&z.d(F),w=!1,ss(M)}}}const P6=()=>null;function M6(n,e,t){let{$$slots:o={},$$scope:l}=e,{title:u}=e,{open:f=!1}=e,{displayEscapeButton:c=!0}=e,{canCloseByClickingBackground:y=!0}=e;const w=()=>t(0,f=!1),M=()=>{y&&t(0,f=!1)};return n.$$set=k=>{"title"in k&&t(1,u=k.title),"open"in k&&t(0,f=k.open),"displayEscapeButton"in k&&t(2,c=k.displayEscapeButton),"canCloseByClickingBackground"in k&&t(3,y=k.canCloseByClickingBackground),"$$scope"in k&&t(7,l=k.$$scope)},[f,u,c,y,o,w,M,l]}class j2 extends Dt{constructor(e){super(),Ft(this,e,M6,E6,At,{title:1,open:0,displayEscapeButton:2,canCloseByClickingBackground:3})}}function I6(n){let e,t=`
  • Click on the map to open a new tab with a 3rd-party imagery provider
  • Press Escape - to exit this mode
  • Cursor by Luc Chaissac
  • `;return{c(){e=et("ul"),e.innerHTML=t},l(o){e=tt(o,"UL",{"data-svelte-h":!0}),Pi(e)!=="svelte-pp00dg"&&(e.innerHTML=t)},m(o,l){ce(o,e,l)},p:Yt,i:Yt,o:Yt,d(o){o&&ee(e)}}}class V2 extends Dt{constructor(e){super(),Ft(this,e,null,I6,At,{})}}const T6="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='22px'%20height='17px'%20viewBox='0%200%2022%2017'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3c!--%20Generator:%20Sketch%203.6.1%20(26313)%20-%20http://www.bohemiancoding.com/sketch%20--%3e%3ctitle%3escreenshotwindow%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='bundle-os-x-cursors'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Made-with-💕by-Azendoo-design-team---@azendoo'%20transform='translate(-246.000000,%20-254.000000)'%3e%3cg%20id='screenshotwindow'%20transform='translate(246.000000,%20254.000000)'%3e%3cpath%20d='M3.5,17%20C1.57,17%200,15.43%200,13.5%20L0,6.5%20C0,4.57%201.57,3%203.5,3%20L4.5,3%20C4.966,3%205.387,2.49%205.605,2.053%20C6.239,0.786%207.028,0%209,0%20L13,0%20C14.972,0%2015.761,0.786%2016.395,2.053%20C16.613,2.49%2017.034,3%2017.5,3%20L18.5,3%20C20.43,3%2022,4.57%2022,6.5%20L22,13.5%20C22,15.43%2020.43,17%2018.5,17%20L3.5,17%20Z'%20id='cursor'%20fill='%23FFFFFF'%3e%3c/path%3e%3cpath%20d='M11,14%20C8.238,14%206,11.762%206,9%20C6,6.238%208.238,4%2011,4%20C13.762,4%2016,6.238%2016,9%20C16,11.762%2013.762,14%2011,14%20M18.5,4%20L17.5,4%20C16.5,4%2015.816,3.132%2015.5,2.5%20C15,1.5%2014.5,1%2013,1%20L11,1%20L9,1%20C7.5,1%207,1.5%206.5,2.5%20C6.184,3.132%205.5,4%204.5,4%20L3.5,4%20C2.119,4%201,5.119%201,6.5%20L1,13.5%20C1,14.881%202.119,16%203.5,16%20L18.5,16%20C19.881,16%2021,14.881%2021,13.5%20L21,6.5%20C21,5.119%2019.881,4%2018.5,4'%20id='cursor'%20fill='%23000000'%3e%3c/path%3e%3cpath%20d='M14,9%20C14,10.656%2012.656,12%2011,12%20C9.344,12%208,10.656%208,9%20C8,7.344%209.344,6%2011,6%20C12.656,6%2014,7.344%2014,9'%20id='cursor'%20fill='%23000000'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",{window:C6}=Hg;function Rb(n){let e,t,o,l;const u=[z6,A6],f=[];function c(y,w){return y[0]?0:1}return e=c(n),t=f[e]=u[e](n),{c(){t.c(),o=Ot()},l(y){t.l(y),o=Ot()},m(y,w){f[e].m(y,w),ce(y,o,w),l=!0},p(y,w){let M=e;e=c(y),e===M?f[e].p(y,w):(vr(),fe(f[M],1,1,()=>{f[M]=null}),br(),t=f[e],t?t.p(y,w):(t=f[e]=u[e](y),t.c()),ae(t,1),t.m(o.parentNode,o))},i(y){l||(ae(t),l=!0)},o(y){fe(t),l=!1},d(y){y&&ee(o),f[e].d(y)}}}function A6(n){let e,t;return e=new Kr({props:{$$slots:{default:[L6]},$$scope:{ctx:n}}}),e.$on("click",n[8]),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&8192&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function z6(n){let e,t,o,l,u,f,c;e=new Kr({props:{$$slots:{default:[D6]},$$scope:{ctx:n}}}),e.$on("click",n[6]);function y(M){n[7](M)}let w={legend:"Source",choices:[["google","Google Street View"],["bing","Bing Streetside"]]};return n[2].streetViewImagery!==void 0&&(w.value=n[2].streetViewImagery),o=new Ky({props:w}),Hr.push(()=>fi(o,"value",y)),f=new S5({props:{label:"Help",$$slots:{default:[F6]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),u=qe(),Ae(f.$$.fragment)},l(M){Fe(e.$$.fragment,M),t=Ge(M),Fe(o.$$.fragment,M),u=Ge(M),Fe(f.$$.fragment,M)},m(M,k){ze(e,M,k),ce(M,t,k),ze(o,M,k),ce(M,u,k),ze(f,M,k),c=!0},p(M,k){const T={};k&8192&&(T.$$scope={dirty:k,ctx:M}),e.$set(T);const z={};!l&&k&4&&(l=!0,z.value=M[2].streetViewImagery,gi(()=>l=!1)),o.$set(z);const F={};k&8192&&(F.$$scope={dirty:k,ctx:M}),f.$set(F)},i(M){c||(ae(e.$$.fragment,M),ae(o.$$.fragment,M),ae(f.$$.fragment,M),c=!0)},o(M){fe(e.$$.fragment,M),fe(o.$$.fragment,M),fe(f.$$.fragment,M),c=!1},d(M){M&&(ee(t),ee(u)),Le(e,M),Le(o,M),Le(f,M)}}}function L6(n){let e;return{c(){e=xt("Enable Street View")},l(t){e=wt(t,"Enable Street View")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function D6(n){let e;return{c(){e=xt("Disable Street View")},l(t){e=wt(t,"Disable Street View")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function F6(n){let e,t;return e=new V2({}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function R6(n){let e,t,o,l,u=n[1]&&Rb(n);return{c(){u&&u.c(),e=Ot()},l(f){u&&u.l(f),e=Ot()},m(f,c){u&&u.m(f,c),ce(f,e,c),t=!0,o||(l=fr(C6,"keydown",n[3]),o=!0)},p(f,[c]){f[1]?u?(u.p(f,c),c&2&&ae(u,1)):(u=Rb(f),u.c(),ae(u,1),u.m(e.parentNode,e)):u&&(vr(),fe(u,1,1,()=>{u=null}),br())},i(f){t||(ae(u),t=!0)},o(f){fe(u),t=!1},d(f){f&&ee(e),u&&u.d(f),o=!1,l()}}}function B6(n,e,t){let o;bt(n,ul,G=>t(2,o=G));let{cfg:l}=e,{map:u}=e,{enabled:f}=e,{showControls:c=!0}=e,y=[];function w(){if(u){u.on("click",k),u.getCanvas().style.cursor=`url(${T6}), auto`;for(let G of l.getStreetViewRoadLayerNames(u))y.push([G,u.getPaintProperty(G,"line-color")]),u.setPaintProperty(G,"line-color","cyan")}}function M(){if(u){u.off("click",k),u.getCanvas().style.cursor="inherit";for(let[G,J]of y)u.setPaintProperty(G,"line-color",J);y=[]}}Ei(M);function k(G){if(!f)return;let J=G.lngLat.lng,j=G.lngLat.lat;o.streetViewImagery=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${j},${J}&cbp=11,0,0,0,0`,"_blank"):o.streetViewImagery=="bing"&&window.open(`https://www.bing.com/maps?cp=${j}~${J}&style=x`,"_blank")}function T(G){f&&G.key=="Escape"&&(G.stopPropagation(),t(0,f=!1))}const z=()=>t(0,f=!1);function F(G){n.$$.not_equal(o.streetViewImagery,G)&&(o.streetViewImagery=G,ul.set(o))}const B=()=>t(0,f=!0);return n.$$set=G=>{"cfg"in G&&t(4,l=G.cfg),"map"in G&&t(5,u=G.map),"enabled"in G&&t(0,f=G.enabled),"showControls"in G&&t(1,c=G.showControls)},n.$$.update=()=>{n.$$.dirty&1&&(f?w():M())},[f,c,o,T,l,u,z,F,B]}class O6 extends Dt{constructor(e){super(),Ft(this,e,B6,R6,At,{cfg:4,map:5,enabled:0,showControls:1})}}const $6="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M1%2021h22L12%202%201%2021zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3e%3c/svg%3e";function N6(n){let e,t;return{c(){e=et("img"),this.h()},l(o){e=tt(o,"IMG",{src:!0,title:!0,alt:!0}),this.h()},h(){zs(e.src,t=$6)||Ke(e,"src",t),Ke(e,"title",n[0]),Ke(e,"alt",n[0])},m(o,l){ce(o,e,l)},p(o,[l]){l&1&&Ke(e,"title",o[0]),l&1&&Ke(e,"alt",o[0])},i:Yt,o:Yt,d(o){o&&ee(e)}}}function j6(n,e,t){let{text:o}=e;return n.$$set=l=>{"text"in l&&t(0,o=l.text)},[o]}class V6 extends Dt{constructor(e){super(),Ft(this,e,j6,N6,At,{text:0})}}async function U6(n,e){let t=await fetch(n),o=t.body.getReader(),l=t.headers.get("Content-Length");if(!l)throw new Error(`No Content-Length header from ${n}`);let u=parseInt(l),f=0,c=[];for(;;){let{done:M,value:k}=await o.read();if(M)break;k&&(c.push(k),f+=k.length,e(100*f/u))}let y=new Uint8Array(f),w=0;for(let M of c)y.set(M,w),w+=M.length;return y}function q6(n){let e,t;return e=new Rs({props:{errorMessage:"Failed to load route snapper"}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function G6(n){let e,t="Route data unpacking",o,l;return{c(){e=et("label"),e.textContent=t,o=qe(),l=et("progress"),this.h()},l(u){e=tt(u,"LABEL",{for:!0,"data-svelte-h":!0}),Pi(e)!=="svelte-y5hdhj"&&(e.textContent=t),o=Ge(u),l=tt(u,"PROGRESS",{id:!0,class:!0}),Lt(l).forEach(ee),this.h()},h(){Ke(e,"for","route-unpacking"),Ke(l,"id","route-unpacking"),Ke(l,"class","svelte-q3473n")},m(u,f){ce(u,e,f),ce(u,o,f),ce(u,l,f)},p:Yt,i:Yt,o:Yt,d(u){u&&(ee(e),ee(o),ee(l))}}}function Z6(n){let e,t="Route tool loading",o,l;return{c(){e=et("label"),e.textContent=t,o=qe(),l=et("progress"),this.h()},l(u){e=tt(u,"LABEL",{for:!0,"data-svelte-h":!0}),Pi(e)!=="svelte-1wgeuhh"&&(e.textContent=t),o=Ge(u),l=tt(u,"PROGRESS",{id:!0,class:!0}),Lt(l).forEach(ee),this.h()},h(){Ke(e,"for","route-loading"),Ke(l,"id","route-loading"),l.value=n[0],Ke(l,"class","svelte-q3473n")},m(u,f){ce(u,e,f),ce(u,o,f),ce(u,l,f)},p(u,f){f&1&&(l.value=u[0])},i:Yt,o:Yt,d(u){u&&(ee(e),ee(o),ee(l))}}}function H6(n){let e,t,o,l;const u=[Z6,G6,q6],f=[];function c(y,w){return!y[1]&&!y[2]&&!y[3]?0:y[3]&&!y[1]&&!y[2]?1:y[2]?2:-1}return~(e=c(n))&&(t=f[e]=u[e](n)),{c(){t&&t.c(),o=Ot()},l(y){t&&t.l(y),o=Ot()},m(y,w){~e&&f[e].m(y,w),ce(y,o,w),l=!0},p(y,[w]){let M=e;e=c(y),e===M?~e&&f[e].p(y,w):(t&&(vr(),fe(f[M],1,1,()=>{f[M]=null}),br()),~e?(t=f[e],t?t.p(y,w):(t=f[e]=u[e](y),t.c()),ae(t,1),t.m(o.parentNode,o)):t=null)},i(y){l||(ae(t),l=!0)},o(y){fe(t),l=!1},d(y){y&&ee(o),~e&&f[e].d(y)}}}function W6(n,e,t){let o,l;bt(n,ro,w=>t(5,l=w));let{url:u}=e,f=0,c=!1,y=!1;return As(async()=>{await Ow(),console.log(`Grabbing ${u}`);try{const w=await U6(u,M=>{t(0,f=M)});Ds.set(new R3(l,w,Zw,Hw,Ay)),t(0,f=100),t(1,c=!0)}catch(w){console.log(`Route tool broke: ${w}`),t(2,y=!0)}}),n.$$set=w=>{"url"in w&&t(4,u=w.url)},n.$$.update=()=>{n.$$.dirty&1&&t(3,o=f>=100)},[f,c,y,o,u]}class X6 extends Dt{constructor(e){super(),Ft(this,e,W6,H6,At,{url:4})}}function J6(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function K6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function Y6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[J6]},$$scope:{ctx:n}}}),e.$on("click",n[1]),o=new Kr({props:{$$slots:{default:[K6]},$$scope:{ctx:n}}}),o.$on("click",n[0]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&64&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function Q6(n){let e,t,o,l;return e=new pl({props:{$$slots:{default:[Y6]},$$scope:{ctx:n}}}),o=new N2({}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function eF(n,e,t){let o;bt(n,Ds,w=>t(4,o=w));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.startArea(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(w){let M=w;u.update(k=>(M.id=Lh(k),M.properties.scheme_reference=op(k),l.newPolygonFeature(M),k.features.push(M),k)),dr.set({mode:"edit-form",id:M.id})}function c(){dr.set({mode:"list"})}function y(){o.finish()}return n.$$set=w=>{"cfg"in w&&t(2,l=w.cfg),"gjSchemes"in w&&t(3,u=w.gjSchemes)},[c,y,l,u]}class tF extends Dt{constructor(e){super(),Ft(this,e,eF,Q6,At,{cfg:2,gjSchemes:3})}}function rF(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function iF(n){let e,t,o,l,u,f,c,y,w,M;function k(B){n[4](B)}let T={cfg:n[0],map:n[2],showControls:!1};n[1]!==void 0&&(T.enabled=n[1]),e=new O6({props:T}),Hr.push(()=>fi(e,"enabled",k)),l=new Fs({props:{$$slots:{default:[rF]},$$scope:{ctx:n}}}),l.$on("click",n[5]);function z(B){n[6](B)}let F={legend:"Source",choices:[["google","Google Street View"],["bing","Bing Streetside"]],inlineSmall:!0};return n[3].streetViewImagery!==void 0&&(F.value=n[3].streetViewImagery),f=new Ky({props:F}),Hr.push(()=>fi(f,"value",z)),w=new V2({}),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment),u=qe(),Ae(f.$$.fragment),y=qe(),Ae(w.$$.fragment)},l(B){Fe(e.$$.fragment,B),o=Ge(B),Fe(l.$$.fragment,B),u=Ge(B),Fe(f.$$.fragment,B),y=Ge(B),Fe(w.$$.fragment,B)},m(B,G){ze(e,B,G),ce(B,o,G),ze(l,B,G),ce(B,u,G),ze(f,B,G),ce(B,y,G),ze(w,B,G),M=!0},p(B,[G]){const J={};G&1&&(J.cfg=B[0]),G&4&&(J.map=B[2]),!t&&G&2&&(t=!0,J.enabled=B[1],gi(()=>t=!1)),e.$set(J);const j={};G&128&&(j.$$scope={dirty:G,ctx:B}),l.$set(j);const V={};!c&&G&8&&(c=!0,V.value=B[3].streetViewImagery,gi(()=>c=!1)),f.$set(V)},i(B){M||(ae(e.$$.fragment,B),ae(l.$$.fragment,B),ae(f.$$.fragment,B),ae(w.$$.fragment,B),M=!0)},o(B){fe(e.$$.fragment,B),fe(l.$$.fragment,B),fe(f.$$.fragment,B),fe(w.$$.fragment,B),M=!1},d(B){B&&(ee(o),ee(u),ee(y)),Le(e,B),Le(l,B),Le(f,B),Le(w,B)}}}function nF(n,e,t){let o,l;bt(n,ro,M=>t(2,o=M)),bt(n,ul,M=>t(3,l=M));let{cfg:u}=e,f=!0;function c(M){f=M,t(1,f)}const y=()=>t(1,f=!1);function w(M){n.$$.not_equal(l.streetViewImagery,M)&&(l.streetViewImagery=M,ul.set(l))}return n.$$set=M=>{"cfg"in M&&t(0,u=M.cfg)},n.$$.update=()=>{n.$$.dirty&2&&(f||dr.set({mode:"list"}))},[u,f,o,l,c,y,w]}class oF extends Dt{constructor(e){super(),Ft(this,e,nF,iF,At,{cfg:0})}}function sF(n){let e;return{c(){e=xt("Save")},l(t){e=wt(t,"Save")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function aF(n){let e;return{c(){e=xt("Edit geometry")},l(t){e=wt(t,"Edit geometry")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function lF(n){let e;return{c(){e=xt("Delete")},l(t){e=wt(t,"Delete")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function cF(n){let e,t,o,l,u,f;return e=new Fs({props:{$$slots:{default:[sF]},$$scope:{ctx:n}}}),e.$on("click",n[5]),o=new Kr({props:{$$slots:{default:[aF]},$$scope:{ctx:n}}}),o.$on("click",n[6]),u=new dp({props:{$$slots:{default:[lF]},$$scope:{ctx:n}}}),u.$on("click",n[7]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),Ae(u.$$.fragment)},l(c){Fe(e.$$.fragment,c),t=Ge(c),Fe(o.$$.fragment,c),l=Ge(c),Fe(u.$$.fragment,c)},m(c,y){ze(e,c,y),ce(c,t,y),ze(o,c,y),ce(c,l,y),ze(u,c,y),f=!0},p(c,y){const w={};y&8192&&(w.$$scope={dirty:y,ctx:c}),e.$set(w);const M={};y&8192&&(M.$$scope={dirty:y,ctx:c}),o.$set(M);const k={};y&8192&&(k.$$scope={dirty:y,ctx:c}),u.$set(k)},i(c){f||(ae(e.$$.fragment,c),ae(o.$$.fragment,c),ae(u.$$.fragment,c),f=!0)},o(c){fe(e.$$.fragment,c),fe(o.$$.fragment,c),fe(u.$$.fragment,c),f=!1},d(c){c&&(ee(t),ee(l)),Le(e,c),Le(o,c),Le(u,c)}}}function uF(n){let e,t,o=n[0].interventionName(n[3])+"",l,u,f,c,y,w,M,k,T,z,F,B;f=new pl({props:{$$slots:{default:[cF]},$$scope:{ctx:n}}}),y=new Rs({props:{errorMessage:n[0].interventionWarning(n[3])}});function G(V){n[8](V)}var J=n[0].editFeatureForm;function j(V,me){let X={cfg:V[0],gjSchemes:V[1],id:V[2]};return V[3].properties!==void 0&&(X.props=V[3].properties),{props:X}}return J&&(M=bd(J,j(n)),Hr.push(()=>fi(M,"props",G))),{c(){e=et("h2"),t=xt("Editing "),l=xt(o),u=qe(),Ae(f.$$.fragment),c=qe(),Ae(y.$$.fragment),w=qe(),M&&Ae(M.$$.fragment),T=Ot()},l(V){e=tt(V,"H2",{});var me=Lt(e);t=wt(me,"Editing "),l=wt(me,o),me.forEach(ee),u=Ge(V),Fe(f.$$.fragment,V),c=Ge(V),Fe(y.$$.fragment,V),w=Ge(V),M&&Fe(M.$$.fragment,V),T=Ot()},m(V,me){ce(V,e,me),_t(e,t),_t(e,l),ce(V,u,me),ze(f,V,me),ce(V,c,me),ze(y,V,me),ce(V,w,me),M&&ze(M,V,me),ce(V,T,me),z=!0,F||(B=fr(window,"keydown",n[4]),F=!0)},p(V,[me]){(!z||me&9)&&o!==(o=V[0].interventionName(V[3])+"")&&ai(l,o);const X={};me&8198&&(X.$$scope={dirty:me,ctx:V}),f.$set(X);const pe={};if(me&9&&(pe.errorMessage=V[0].interventionWarning(V[3])),y.$set(pe),me&1&&J!==(J=V[0].editFeatureForm)){if(M){vr();const Ee=M;fe(Ee.$$.fragment,1,0,()=>{Le(Ee,1)}),br()}J?(M=bd(J,j(V)),Hr.push(()=>fi(M,"props",G)),Ae(M.$$.fragment),ae(M.$$.fragment,1),ze(M,T.parentNode,T)):M=null}else if(J){const Ee={};me&1&&(Ee.cfg=V[0]),me&2&&(Ee.gjSchemes=V[1]),me&4&&(Ee.id=V[2]),!k&&me&8&&(k=!0,Ee.props=V[3].properties,gi(()=>k=!1)),M.$set(Ee)}},i(V){z||(ae(f.$$.fragment,V),ae(y.$$.fragment,V),M&&ae(M.$$.fragment,V),z=!0)},o(V){fe(f.$$.fragment,V),fe(y.$$.fragment,V),M&&fe(M.$$.fragment,V),z=!1},d(V){V&&(ee(e),ee(u),ee(c),ee(w),ee(T)),Le(f,V),Le(y,V),M&&Le(M,V),F=!1,B()}}}function hF(n,e,t){let o,l,u=Yt,f=()=>(u(),u=da(y,j=>t(10,l=j)),y);bt(n,ro,j=>t(9,o=j)),n.$$.on_destroy.push(()=>u());let{cfg:c}=e,{gjSchemes:y}=e;f();let{id:w}=e,M=l.features.find(j=>j.id==w);function k(j){y.set(l)}As(()=>{o==null||o.on("click",T)}),Ei(()=>{o==null||o.off("click",T)});function T(j){for(let V of o.queryRenderedFeatures(j.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]}))if(V.id==w)return;dr.set({mode:"list"})}function z(j){if(j.key=="Escape"){j.stopPropagation(),dr.set({mode:"list"});return}if(j.key=="Delete"){const V=j.target.tagName;if(V=="INPUT"||V=="TEXTAREA")return;j.stopPropagation(),G1(y,w)}if(j.key=="e"){const V=j.target.tagName;if(V=="INPUT"||V=="TEXTAREA")return;j.stopPropagation(),dr.set({mode:"edit-geometry",id:w})}}const F=()=>dr.set({mode:"list"}),B=()=>dr.set({mode:"edit-geometry",id:w}),G=()=>G1(y,w);function J(j){n.$$.not_equal(M.properties,j)&&(M.properties=j,t(3,M))}return n.$$set=j=>{"cfg"in j&&t(0,c=j.cfg),"gjSchemes"in j&&f(t(1,y=j.gjSchemes)),"id"in j&&t(2,w=j.id)},n.$$.update=()=>{n.$$.dirty&8&&k()},[c,y,w,M,z,F,B,G,J]}class fF extends Dt{constructor(e){super(),Ft(this,e,hF,uF,At,{cfg:0,gjSchemes:1,id:2})}}const dF="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M6%2019c0%201.1.9%202%202%202h8c1.1%200%202-.9%202-2V7H6v12zM19%204h-3.5l-1-1h-5l-1%201H5v2h14V4z'/%3e%3c/svg%3e";function Bb(n,e,t){const o=n.slice();o[29]=e[t];const l=o[0].interventionWarning(o[29]);return o[30]=l,o}function pF(n){let e,t,o;return{c(){e=et("img"),o=xt(` + to exit this mode
  • Cursor by Luc Chaissac
  • `;return{c(){e=et("ul"),e.innerHTML=t},l(o){e=tt(o,"UL",{"data-svelte-h":!0}),Pi(e)!=="svelte-pp00dg"&&(e.innerHTML=t)},m(o,l){ce(o,e,l)},p:Yt,i:Yt,o:Yt,d(o){o&&ee(e)}}}class V2 extends Dt{constructor(e){super(),Ft(this,e,null,I6,At,{})}}const T6="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='22px'%20height='17px'%20viewBox='0%200%2022%2017'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3c!--%20Generator:%20Sketch%203.6.1%20(26313)%20-%20http://www.bohemiancoding.com/sketch%20--%3e%3ctitle%3escreenshotwindow%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='bundle-os-x-cursors'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Made-with-💕by-Azendoo-design-team---@azendoo'%20transform='translate(-246.000000,%20-254.000000)'%3e%3cg%20id='screenshotwindow'%20transform='translate(246.000000,%20254.000000)'%3e%3cpath%20d='M3.5,17%20C1.57,17%200,15.43%200,13.5%20L0,6.5%20C0,4.57%201.57,3%203.5,3%20L4.5,3%20C4.966,3%205.387,2.49%205.605,2.053%20C6.239,0.786%207.028,0%209,0%20L13,0%20C14.972,0%2015.761,0.786%2016.395,2.053%20C16.613,2.49%2017.034,3%2017.5,3%20L18.5,3%20C20.43,3%2022,4.57%2022,6.5%20L22,13.5%20C22,15.43%2020.43,17%2018.5,17%20L3.5,17%20Z'%20id='cursor'%20fill='%23FFFFFF'%3e%3c/path%3e%3cpath%20d='M11,14%20C8.238,14%206,11.762%206,9%20C6,6.238%208.238,4%2011,4%20C13.762,4%2016,6.238%2016,9%20C16,11.762%2013.762,14%2011,14%20M18.5,4%20L17.5,4%20C16.5,4%2015.816,3.132%2015.5,2.5%20C15,1.5%2014.5,1%2013,1%20L11,1%20L9,1%20C7.5,1%207,1.5%206.5,2.5%20C6.184,3.132%205.5,4%204.5,4%20L3.5,4%20C2.119,4%201,5.119%201,6.5%20L1,13.5%20C1,14.881%202.119,16%203.5,16%20L18.5,16%20C19.881,16%2021,14.881%2021,13.5%20L21,6.5%20C21,5.119%2019.881,4%2018.5,4'%20id='cursor'%20fill='%23000000'%3e%3c/path%3e%3cpath%20d='M14,9%20C14,10.656%2012.656,12%2011,12%20C9.344,12%208,10.656%208,9%20C8,7.344%209.344,6%2011,6%20C12.656,6%2014,7.344%2014,9'%20id='cursor'%20fill='%23000000'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",{window:C6}=Hg;function Rb(n){let e,t,o,l;const u=[z6,A6],f=[];function c(y,w){return y[0]?0:1}return e=c(n),t=f[e]=u[e](n),{c(){t.c(),o=$t()},l(y){t.l(y),o=$t()},m(y,w){f[e].m(y,w),ce(y,o,w),l=!0},p(y,w){let M=e;e=c(y),e===M?f[e].p(y,w):(vr(),fe(f[M],1,1,()=>{f[M]=null}),br(),t=f[e],t?t.p(y,w):(t=f[e]=u[e](y),t.c()),ae(t,1),t.m(o.parentNode,o))},i(y){l||(ae(t),l=!0)},o(y){fe(t),l=!1},d(y){y&&ee(o),f[e].d(y)}}}function A6(n){let e,t;return e=new Kr({props:{$$slots:{default:[L6]},$$scope:{ctx:n}}}),e.$on("click",n[8]),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&8192&&(u.$$scope={dirty:l,ctx:o}),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function z6(n){let e,t,o,l,u,f,c;e=new Kr({props:{$$slots:{default:[D6]},$$scope:{ctx:n}}}),e.$on("click",n[6]);function y(M){n[7](M)}let w={legend:"Source",choices:[["google","Google Street View"],["bing","Bing Streetside"]]};return n[2].streetViewImagery!==void 0&&(w.value=n[2].streetViewImagery),o=new Ky({props:w}),Wr.push(()=>fi(o,"value",y)),f=new S5({props:{label:"Help",$$slots:{default:[F6]},$$scope:{ctx:n}}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),u=qe(),Ae(f.$$.fragment)},l(M){Fe(e.$$.fragment,M),t=Ge(M),Fe(o.$$.fragment,M),u=Ge(M),Fe(f.$$.fragment,M)},m(M,k){ze(e,M,k),ce(M,t,k),ze(o,M,k),ce(M,u,k),ze(f,M,k),c=!0},p(M,k){const T={};k&8192&&(T.$$scope={dirty:k,ctx:M}),e.$set(T);const z={};!l&&k&4&&(l=!0,z.value=M[2].streetViewImagery,gi(()=>l=!1)),o.$set(z);const F={};k&8192&&(F.$$scope={dirty:k,ctx:M}),f.$set(F)},i(M){c||(ae(e.$$.fragment,M),ae(o.$$.fragment,M),ae(f.$$.fragment,M),c=!0)},o(M){fe(e.$$.fragment,M),fe(o.$$.fragment,M),fe(f.$$.fragment,M),c=!1},d(M){M&&(ee(t),ee(u)),Le(e,M),Le(o,M),Le(f,M)}}}function L6(n){let e;return{c(){e=xt("Enable Street View")},l(t){e=wt(t,"Enable Street View")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function D6(n){let e;return{c(){e=xt("Disable Street View")},l(t){e=wt(t,"Disable Street View")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function F6(n){let e,t;return e=new V2({}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function R6(n){let e,t,o,l,u=n[1]&&Rb(n);return{c(){u&&u.c(),e=$t()},l(f){u&&u.l(f),e=$t()},m(f,c){u&&u.m(f,c),ce(f,e,c),t=!0,o||(l=fr(C6,"keydown",n[3]),o=!0)},p(f,[c]){f[1]?u?(u.p(f,c),c&2&&ae(u,1)):(u=Rb(f),u.c(),ae(u,1),u.m(e.parentNode,e)):u&&(vr(),fe(u,1,1,()=>{u=null}),br())},i(f){t||(ae(u),t=!0)},o(f){fe(u),t=!1},d(f){f&&ee(e),u&&u.d(f),o=!1,l()}}}function B6(n,e,t){let o;bt(n,ul,G=>t(2,o=G));let{cfg:l}=e,{map:u}=e,{enabled:f}=e,{showControls:c=!0}=e,y=[];function w(){if(u){u.on("click",k),u.getCanvas().style.cursor=`url(${T6}), auto`;for(let G of l.getStreetViewRoadLayerNames(u))y.push([G,u.getPaintProperty(G,"line-color")]),u.setPaintProperty(G,"line-color","cyan")}}function M(){if(u){u.off("click",k),u.getCanvas().style.cursor="inherit";for(let[G,J]of y)u.setPaintProperty(G,"line-color",J);y=[]}}Ei(M);function k(G){if(!f)return;let J=G.lngLat.lng,j=G.lngLat.lat;o.streetViewImagery=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${j},${J}&cbp=11,0,0,0,0`,"_blank"):o.streetViewImagery=="bing"&&window.open(`https://www.bing.com/maps?cp=${j}~${J}&style=x`,"_blank")}function T(G){f&&G.key=="Escape"&&(G.stopPropagation(),t(0,f=!1))}const z=()=>t(0,f=!1);function F(G){n.$$.not_equal(o.streetViewImagery,G)&&(o.streetViewImagery=G,ul.set(o))}const B=()=>t(0,f=!0);return n.$$set=G=>{"cfg"in G&&t(4,l=G.cfg),"map"in G&&t(5,u=G.map),"enabled"in G&&t(0,f=G.enabled),"showControls"in G&&t(1,c=G.showControls)},n.$$.update=()=>{n.$$.dirty&1&&(f?w():M())},[f,c,o,T,l,u,z,F,B]}class O6 extends Dt{constructor(e){super(),Ft(this,e,B6,R6,At,{cfg:4,map:5,enabled:0,showControls:1})}}const $6="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M1%2021h22L12%202%201%2021zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3e%3c/svg%3e";function N6(n){let e,t;return{c(){e=et("img"),this.h()},l(o){e=tt(o,"IMG",{src:!0,title:!0,alt:!0}),this.h()},h(){zs(e.src,t=$6)||Ke(e,"src",t),Ke(e,"title",n[0]),Ke(e,"alt",n[0])},m(o,l){ce(o,e,l)},p(o,[l]){l&1&&Ke(e,"title",o[0]),l&1&&Ke(e,"alt",o[0])},i:Yt,o:Yt,d(o){o&&ee(e)}}}function j6(n,e,t){let{text:o}=e;return n.$$set=l=>{"text"in l&&t(0,o=l.text)},[o]}class V6 extends Dt{constructor(e){super(),Ft(this,e,j6,N6,At,{text:0})}}async function U6(n,e){let t=await fetch(n),o=t.body.getReader(),l=t.headers.get("Content-Length");if(!l)throw new Error(`No Content-Length header from ${n}`);let u=parseInt(l),f=0,c=[];for(;;){let{done:M,value:k}=await o.read();if(M)break;k&&(c.push(k),f+=k.length,e(100*f/u))}let y=new Uint8Array(f),w=0;for(let M of c)y.set(M,w),w+=M.length;return y}function q6(n){let e,t;return e=new Rs({props:{errorMessage:"Failed to load route snapper"}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function G6(n){let e,t="Route data unpacking",o,l;return{c(){e=et("label"),e.textContent=t,o=qe(),l=et("progress"),this.h()},l(u){e=tt(u,"LABEL",{for:!0,"data-svelte-h":!0}),Pi(e)!=="svelte-y5hdhj"&&(e.textContent=t),o=Ge(u),l=tt(u,"PROGRESS",{id:!0,class:!0}),Lt(l).forEach(ee),this.h()},h(){Ke(e,"for","route-unpacking"),Ke(l,"id","route-unpacking"),Ke(l,"class","svelte-q3473n")},m(u,f){ce(u,e,f),ce(u,o,f),ce(u,l,f)},p:Yt,i:Yt,o:Yt,d(u){u&&(ee(e),ee(o),ee(l))}}}function Z6(n){let e,t="Route tool loading",o,l;return{c(){e=et("label"),e.textContent=t,o=qe(),l=et("progress"),this.h()},l(u){e=tt(u,"LABEL",{for:!0,"data-svelte-h":!0}),Pi(e)!=="svelte-1wgeuhh"&&(e.textContent=t),o=Ge(u),l=tt(u,"PROGRESS",{id:!0,class:!0}),Lt(l).forEach(ee),this.h()},h(){Ke(e,"for","route-loading"),Ke(l,"id","route-loading"),l.value=n[0],Ke(l,"class","svelte-q3473n")},m(u,f){ce(u,e,f),ce(u,o,f),ce(u,l,f)},p(u,f){f&1&&(l.value=u[0])},i:Yt,o:Yt,d(u){u&&(ee(e),ee(o),ee(l))}}}function H6(n){let e,t,o,l;const u=[Z6,G6,q6],f=[];function c(y,w){return!y[1]&&!y[2]&&!y[3]?0:y[3]&&!y[1]&&!y[2]?1:y[2]?2:-1}return~(e=c(n))&&(t=f[e]=u[e](n)),{c(){t&&t.c(),o=$t()},l(y){t&&t.l(y),o=$t()},m(y,w){~e&&f[e].m(y,w),ce(y,o,w),l=!0},p(y,[w]){let M=e;e=c(y),e===M?~e&&f[e].p(y,w):(t&&(vr(),fe(f[M],1,1,()=>{f[M]=null}),br()),~e?(t=f[e],t?t.p(y,w):(t=f[e]=u[e](y),t.c()),ae(t,1),t.m(o.parentNode,o)):t=null)},i(y){l||(ae(t),l=!0)},o(y){fe(t),l=!1},d(y){y&&ee(o),~e&&f[e].d(y)}}}function W6(n,e,t){let o,l;bt(n,ro,w=>t(5,l=w));let{url:u}=e,f=0,c=!1,y=!1;return As(async()=>{await Ow(),console.log(`Grabbing ${u}`);try{const w=await U6(u,M=>{t(0,f=M)});Ds.set(new R3(l,w,Zw,Hw,Ay)),t(0,f=100),t(1,c=!0)}catch(w){console.log(`Route tool broke: ${w}`),t(2,y=!0)}}),n.$$set=w=>{"url"in w&&t(4,u=w.url)},n.$$.update=()=>{n.$$.dirty&1&&t(3,o=f>=100)},[f,c,y,o,u]}class X6 extends Dt{constructor(e){super(),Ft(this,e,W6,H6,At,{url:4})}}function J6(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function K6(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function Y6(n){let e,t,o,l;return e=new Fs({props:{$$slots:{default:[J6]},$$scope:{ctx:n}}}),e.$on("click",n[1]),o=new Kr({props:{$$slots:{default:[K6]},$$scope:{ctx:n}}}),o.$on("click",n[0]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f&64&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function Q6(n){let e,t,o,l;return e=new pl({props:{$$slots:{default:[Y6]},$$scope:{ctx:n}}}),o=new N2({}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function eF(n,e,t){let o;bt(n,Ds,w=>t(4,o=w));let{cfg:l}=e,{gjSchemes:u}=e;As(()=>{o.startArea(),o.addEventListenerSuccess(f),o.addEventListenerFailure(c)}),Ei(()=>{o.stop(),o.clearEventListeners()});function f(w){let M=w;u.update(k=>(M.id=Lh(k),M.properties.scheme_reference=op(k),l.newPolygonFeature(M),k.features.push(M),k)),dr.set({mode:"edit-form",id:M.id})}function c(){dr.set({mode:"list"})}function y(){o.finish()}return n.$$set=w=>{"cfg"in w&&t(2,l=w.cfg),"gjSchemes"in w&&t(3,u=w.gjSchemes)},[c,y,l,u]}class tF extends Dt{constructor(e){super(),Ft(this,e,eF,Q6,At,{cfg:2,gjSchemes:3})}}function rF(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function iF(n){let e,t,o,l,u,f,c,y,w,M;function k(B){n[4](B)}let T={cfg:n[0],map:n[2],showControls:!1};n[1]!==void 0&&(T.enabled=n[1]),e=new O6({props:T}),Wr.push(()=>fi(e,"enabled",k)),l=new Fs({props:{$$slots:{default:[rF]},$$scope:{ctx:n}}}),l.$on("click",n[5]);function z(B){n[6](B)}let F={legend:"Source",choices:[["google","Google Street View"],["bing","Bing Streetside"]],inlineSmall:!0};return n[3].streetViewImagery!==void 0&&(F.value=n[3].streetViewImagery),f=new Ky({props:F}),Wr.push(()=>fi(f,"value",z)),w=new V2({}),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment),u=qe(),Ae(f.$$.fragment),y=qe(),Ae(w.$$.fragment)},l(B){Fe(e.$$.fragment,B),o=Ge(B),Fe(l.$$.fragment,B),u=Ge(B),Fe(f.$$.fragment,B),y=Ge(B),Fe(w.$$.fragment,B)},m(B,G){ze(e,B,G),ce(B,o,G),ze(l,B,G),ce(B,u,G),ze(f,B,G),ce(B,y,G),ze(w,B,G),M=!0},p(B,[G]){const J={};G&1&&(J.cfg=B[0]),G&4&&(J.map=B[2]),!t&&G&2&&(t=!0,J.enabled=B[1],gi(()=>t=!1)),e.$set(J);const j={};G&128&&(j.$$scope={dirty:G,ctx:B}),l.$set(j);const V={};!c&&G&8&&(c=!0,V.value=B[3].streetViewImagery,gi(()=>c=!1)),f.$set(V)},i(B){M||(ae(e.$$.fragment,B),ae(l.$$.fragment,B),ae(f.$$.fragment,B),ae(w.$$.fragment,B),M=!0)},o(B){fe(e.$$.fragment,B),fe(l.$$.fragment,B),fe(f.$$.fragment,B),fe(w.$$.fragment,B),M=!1},d(B){B&&(ee(o),ee(u),ee(y)),Le(e,B),Le(l,B),Le(f,B),Le(w,B)}}}function nF(n,e,t){let o,l;bt(n,ro,M=>t(2,o=M)),bt(n,ul,M=>t(3,l=M));let{cfg:u}=e,f=!0;function c(M){f=M,t(1,f)}const y=()=>t(1,f=!1);function w(M){n.$$.not_equal(l.streetViewImagery,M)&&(l.streetViewImagery=M,ul.set(l))}return n.$$set=M=>{"cfg"in M&&t(0,u=M.cfg)},n.$$.update=()=>{n.$$.dirty&2&&(f||dr.set({mode:"list"}))},[u,f,o,l,c,y,w]}class oF extends Dt{constructor(e){super(),Ft(this,e,nF,iF,At,{cfg:0})}}function sF(n){let e;return{c(){e=xt("Save")},l(t){e=wt(t,"Save")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function aF(n){let e;return{c(){e=xt("Edit geometry")},l(t){e=wt(t,"Edit geometry")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function lF(n){let e;return{c(){e=xt("Delete")},l(t){e=wt(t,"Delete")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function cF(n){let e,t,o,l,u,f;return e=new Fs({props:{$$slots:{default:[sF]},$$scope:{ctx:n}}}),e.$on("click",n[5]),o=new Kr({props:{$$slots:{default:[aF]},$$scope:{ctx:n}}}),o.$on("click",n[6]),u=new dp({props:{$$slots:{default:[lF]},$$scope:{ctx:n}}}),u.$on("click",n[7]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),Ae(u.$$.fragment)},l(c){Fe(e.$$.fragment,c),t=Ge(c),Fe(o.$$.fragment,c),l=Ge(c),Fe(u.$$.fragment,c)},m(c,y){ze(e,c,y),ce(c,t,y),ze(o,c,y),ce(c,l,y),ze(u,c,y),f=!0},p(c,y){const w={};y&8192&&(w.$$scope={dirty:y,ctx:c}),e.$set(w);const M={};y&8192&&(M.$$scope={dirty:y,ctx:c}),o.$set(M);const k={};y&8192&&(k.$$scope={dirty:y,ctx:c}),u.$set(k)},i(c){f||(ae(e.$$.fragment,c),ae(o.$$.fragment,c),ae(u.$$.fragment,c),f=!0)},o(c){fe(e.$$.fragment,c),fe(o.$$.fragment,c),fe(u.$$.fragment,c),f=!1},d(c){c&&(ee(t),ee(l)),Le(e,c),Le(o,c),Le(u,c)}}}function uF(n){let e,t,o=n[0].interventionName(n[3])+"",l,u,f,c,y,w,M,k,T,z,F,B;f=new pl({props:{$$slots:{default:[cF]},$$scope:{ctx:n}}}),y=new Rs({props:{errorMessage:n[0].interventionWarning(n[3])}});function G(V){n[8](V)}var J=n[0].editFeatureForm;function j(V,me){let X={cfg:V[0],gjSchemes:V[1],id:V[2]};return V[3].properties!==void 0&&(X.props=V[3].properties),{props:X}}return J&&(M=bd(J,j(n)),Wr.push(()=>fi(M,"props",G))),{c(){e=et("h2"),t=xt("Editing "),l=xt(o),u=qe(),Ae(f.$$.fragment),c=qe(),Ae(y.$$.fragment),w=qe(),M&&Ae(M.$$.fragment),T=$t()},l(V){e=tt(V,"H2",{});var me=Lt(e);t=wt(me,"Editing "),l=wt(me,o),me.forEach(ee),u=Ge(V),Fe(f.$$.fragment,V),c=Ge(V),Fe(y.$$.fragment,V),w=Ge(V),M&&Fe(M.$$.fragment,V),T=$t()},m(V,me){ce(V,e,me),_t(e,t),_t(e,l),ce(V,u,me),ze(f,V,me),ce(V,c,me),ze(y,V,me),ce(V,w,me),M&&ze(M,V,me),ce(V,T,me),z=!0,F||(B=fr(window,"keydown",n[4]),F=!0)},p(V,[me]){(!z||me&9)&&o!==(o=V[0].interventionName(V[3])+"")&&ai(l,o);const X={};me&8198&&(X.$$scope={dirty:me,ctx:V}),f.$set(X);const pe={};if(me&9&&(pe.errorMessage=V[0].interventionWarning(V[3])),y.$set(pe),me&1&&J!==(J=V[0].editFeatureForm)){if(M){vr();const Ee=M;fe(Ee.$$.fragment,1,0,()=>{Le(Ee,1)}),br()}J?(M=bd(J,j(V)),Wr.push(()=>fi(M,"props",G)),Ae(M.$$.fragment),ae(M.$$.fragment,1),ze(M,T.parentNode,T)):M=null}else if(J){const Ee={};me&1&&(Ee.cfg=V[0]),me&2&&(Ee.gjSchemes=V[1]),me&4&&(Ee.id=V[2]),!k&&me&8&&(k=!0,Ee.props=V[3].properties,gi(()=>k=!1)),M.$set(Ee)}},i(V){z||(ae(f.$$.fragment,V),ae(y.$$.fragment,V),M&&ae(M.$$.fragment,V),z=!0)},o(V){fe(f.$$.fragment,V),fe(y.$$.fragment,V),M&&fe(M.$$.fragment,V),z=!1},d(V){V&&(ee(e),ee(u),ee(c),ee(w),ee(T)),Le(f,V),Le(y,V),M&&Le(M,V),F=!1,B()}}}function hF(n,e,t){let o,l,u=Yt,f=()=>(u(),u=da(y,j=>t(10,l=j)),y);bt(n,ro,j=>t(9,o=j)),n.$$.on_destroy.push(()=>u());let{cfg:c}=e,{gjSchemes:y}=e;f();let{id:w}=e,M=l.features.find(j=>j.id==w);function k(j){y.set(l)}As(()=>{o==null||o.on("click",T)}),Ei(()=>{o==null||o.off("click",T)});function T(j){for(let V of o.queryRenderedFeatures(j.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]}))if(V.id==w)return;dr.set({mode:"list"})}function z(j){if(j.key=="Escape"){j.stopPropagation(),dr.set({mode:"list"});return}if(j.key=="Delete"){const V=j.target.tagName;if(V=="INPUT"||V=="TEXTAREA")return;j.stopPropagation(),G1(y,w)}if(j.key=="e"){const V=j.target.tagName;if(V=="INPUT"||V=="TEXTAREA")return;j.stopPropagation(),dr.set({mode:"edit-geometry",id:w})}}const F=()=>dr.set({mode:"list"}),B=()=>dr.set({mode:"edit-geometry",id:w}),G=()=>G1(y,w);function J(j){n.$$.not_equal(M.properties,j)&&(M.properties=j,t(3,M))}return n.$$set=j=>{"cfg"in j&&t(0,c=j.cfg),"gjSchemes"in j&&f(t(1,y=j.gjSchemes)),"id"in j&&t(2,w=j.id)},n.$$.update=()=>{n.$$.dirty&8&&k()},[c,y,w,M,z,F,B,G,J]}class fF extends Dt{constructor(e){super(),Ft(this,e,hF,uF,At,{cfg:0,gjSchemes:1,id:2})}}const dF="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23000000'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M6%2019c0%201.1.9%202%202%202h8c1.1%200%202-.9%202-2V7H6v12zM19%204h-3.5l-1-1h-5l-1%201H5v2h14V4z'/%3e%3c/svg%3e";function Bb(n,e,t){const o=n.slice();o[29]=e[t];const l=o[0].interventionWarning(o[29]);return o[30]=l,o}function pF(n){let e,t,o;return{c(){e=et("img"),o=xt(` Delete`),this.h()},l(l){e=tt(l,"IMG",{src:!0,alt:!0}),o=wt(l,` - Delete`),this.h()},h(){zs(e.src,t=dF)||Ke(e,"src",t),Ke(e,"alt","Delete scheme")},m(l,u){ce(l,e,u),ce(l,o,u)},p:Yt,d(l){l&&(ee(e),ee(o))}}}function mF(n){let e;return{c(){e=xt("Show")},l(t){e=wt(t,"Show")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function gF(n){let e,t;return e=new Rs({props:{errorMessage:"There's a problem with "+n[8]+" interventions below"}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l[0]&256&&(u.errorMessage="There's a problem with "+o[8]+" interventions below"),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function yF(n){let e,t;return e=new Rs({props:{errorMessage:"There's a problem with one intervention below"}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function Ob(n){let e,t;return e=new V6({props:{text:n[30]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l[0]&13&&(u.text=o[30]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function $b(n,e){let t,o,l,u=e[0].interventionName(e[29])+"",f,c,y,w,M,k=e[30]&&Ob(e);function T(...B){return e[20](e[29],...B)}function z(){return e[21](e[29])}function F(){return e[22](e[29])}return{key:n,first:null,c(){t=et("li"),o=et("a"),k&&k.c(),l=qe(),f=xt(u),c=qe(),this.h()},l(B){t=tt(B,"LI",{});var G=Lt(t);o=tt(G,"A",{href:!0});var J=Lt(o);k&&k.l(J),l=Ge(J),f=wt(J,u),J.forEach(ee),c=Ge(G),G.forEach(ee),this.h()},h(){Ke(o,"href","#"),this.first=t},m(B,G){ce(B,t,G),_t(t,o),k&&k.m(o,null),_t(o,l),_t(o,f),_t(t,c),y=!0,w||(M=[fr(o,"click",T),fr(o,"mouseenter",z),fr(o,"mouseleave",F)],w=!0)},p(B,G){e=B,e[30]?k?(k.p(e,G),G[0]&13&&ae(k,1)):(k=Ob(e),k.c(),ae(k,1),k.m(o,l)):k&&(vr(),fe(k,1,1,()=>{k=null}),br()),(!y||G[0]&13)&&u!==(u=e[0].interventionName(e[29])+"")&&ai(f,u)},i(B){y||(ae(k),y=!0)},o(B){fe(k),y=!1},d(B){B&&ee(t),k&&k.d(),w=!1,os(M)}}}function Nb(n){let e,t,o,l,u=n[7]==1?"intervention":"interventions",f,c,y,w,M,k;function T(F){n[23](F)}let z={label:"Move interventions to another scheme",choices:n[13]()};return n[5]!==void 0&&(z.value=n[5]),w=new R2({props:z}),Hr.push(()=>fi(w,"value",T)),w.$on("change",n[12]),{c(){e=et("p"),t=xt("Do you want to first move "),o=xt(n[7]),l=qe(),f=xt(u),c=xt(" to another scheme?"),y=qe(),Ae(w.$$.fragment)},l(F){e=tt(F,"P",{});var B=Lt(e);t=wt(B,"Do you want to first move "),o=wt(B,n[7]),l=Ge(B),f=wt(B,u),c=wt(B," to another scheme?"),B.forEach(ee),y=Ge(F),Fe(w.$$.fragment,F)},m(F,B){ce(F,e,B),_t(e,t),_t(e,o),_t(e,l),_t(e,f),_t(e,c),ce(F,y,B),ze(w,F,B),k=!0},p(F,B){(!k||B[0]&128)&&ai(o,F[7]),(!k||B[0]&128)&&u!==(u=F[7]==1?"intervention":"interventions")&&ai(f,u);const G={};!M&&B[0]&32&&(M=!0,G.value=F[5],gi(()=>M=!1)),w.$set(G)},i(F){k||(ae(w.$$.fragment,F),k=!0)},o(F){fe(w.$$.fragment,F),k=!1},d(F){F&&(ee(e),ee(y)),Le(w,F)}}}function _F(n){let e;return{c(){e=xt("Delete scheme")},l(t){e=wt(t,"Delete scheme")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function vF(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function bF(n){let e,t,o,l;return e=new dp({props:{$$slots:{default:[_F]},$$scope:{ctx:n}}}),e.$on("click",n[11]),o=new Kr({props:{$$slots:{default:[vF]},$$scope:{ctx:n}}}),o.$on("click",n[24]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f[0]&67108864&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f[0]&67108864&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function xF(n){let e=n[7]>0&&n[13]().length>0,t,o,l,u=e&&Nb(n);return o=new pl({props:{$$slots:{default:[bF]},$$scope:{ctx:n}}}),{c(){u&&u.c(),t=qe(),Ae(o.$$.fragment)},l(f){u&&u.l(f),t=Ge(f),Fe(o.$$.fragment,f)},m(f,c){u&&u.m(f,c),ce(f,t,c),ze(o,f,c),l=!0},p(f,c){c[0]&128&&(e=f[7]>0&&f[13]().length>0),e?u?(u.p(f,c),c[0]&128&&ae(u,1)):(u=Nb(f),u.c(),ae(u,1),u.m(t.parentNode,t)):u&&(vr(),fe(u,1,1,()=>{u=null}),br());const y={};c[0]&67108880&&(y.$$scope={dirty:c,ctx:f}),o.$set(y)},i(f){l||(ae(u),ae(o.$$.fragment,f),l=!0)},o(f){fe(u),fe(o.$$.fragment,f),l=!1},d(f){f&&ee(t),u&&u.d(f),Le(o,f)}}}function wF(n){let e,t=n[0].schemeName(n[3].schemes[n[2]])+"",o,l,u,f,c,y,w,M,k,T,z,F,B,G,J,j,V=[],me=new Map,X,pe,Ee,Pe,$e,Ye;c=new dp({props:{$$slots:{default:[pF]},$$scope:{ctx:n}}}),c.$on("click",n[17]);function ve(Ve){n[18](Ve)}let We={$$slots:{default:[mF]},$$scope:{ctx:n}};n[6]!==void 0&&(We.checked=n[6]),w=new Gg({props:We}),Hr.push(()=>fi(w,"checked",ve)),w.$on("change",n[14]);const at=n[15].default,mt=yi(at,n,n[26],null);var Ht=n[0].editSchemeForm;function qt(Ve,ct){return{props:{gjSchemes:Ve[1],scheme_reference:Ve[2]}}}Ht&&(z=bd(Ht,qt(n)));const Ue=[yF,gF],Xe=[];function Zt(Ve,ct){return Ve[8]==1?0:Ve[8]>0?1:-1}~(B=Zt(n))&&(G=Xe[B]=Ue[B](n));let Gt=_o(n[3].features.filter(n[19]));const or=Ve=>Ve[29].id;for(let Ve=0;Vefi(pe,"open",Jt)),{c(){e=et("h3"),o=xt(t),l=qe(),u=et("input"),f=qe(),Ae(c.$$.fragment),y=qe(),Ae(w.$$.fragment),k=qe(),mt&&mt.c(),T=qe(),z&&Ae(z.$$.fragment),F=qe(),G&&G.c(),J=qe(),j=et("ol");for(let Ve=0;VeM=!1)),w.$set(rt),mt&&mt.p&&(!Pe||ct[0]&67108864)&&_i(mt,at,Ve,Ve[26],Pe?bi(at,Ve[26],ct,null):vi(Ve[26]),null),ct[0]&1&&Ht!==(Ht=Ve[0].editSchemeForm)){if(z){vr();const cr=z;fe(cr.$$.fragment,1,0,()=>{Le(cr,1)}),br()}Ht?(z=bd(Ht,qt(Ve)),Ae(z.$$.fragment),ae(z.$$.fragment,1),ze(z,F.parentNode,F)):z=null}else if(Ht){const cr={};ct[0]&2&&(cr.gjSchemes=Ve[1]),ct[0]&4&&(cr.scheme_reference=Ve[2]),z.$set(cr)}let rr=B;B=Zt(Ve),B===rr?~B&&Xe[B].p(Ve,ct):(G&&(vr(),fe(Xe[rr],1,1,()=>{Xe[rr]=null}),br()),~B?(G=Xe[B],G?G.p(Ve,ct):(G=Xe[B]=Ue[B](Ve),G.c()),ae(G,1),G.m(J.parentNode,J)):G=null),ct[0]&1549&&(Gt=_o(Ve[3].features.filter(Ve[19])),vr(),V=Xg(V,ct,or,1,Ve,Gt,me,j,Wg,$b,null,Bb),br());const ni={};ct[0]&67109040&&(ni.$$scope={dirty:ct,ctx:Ve}),!Ee&&ct[0]&16&&(Ee=!0,ni.open=Ve[4],gi(()=>Ee=!1)),pe.$set(ni)},i(Ve){if(!Pe){ae(c.$$.fragment,Ve),ae(w.$$.fragment,Ve),ae(mt,Ve),z&&ae(z.$$.fragment,Ve),ae(G);for(let ct=0;ct(c(),c=da(z,Xe=>t(3,f=Xe)),z),w;bt(n,dd,Xe=>t(27,u=Xe)),bt(n,ro,Xe=>t(28,w=Xe)),n.$$.on_destroy.push(()=>c());let{$$slots:M={},$$scope:k}=e,{cfg:T}=e,{gjSchemes:z}=e;y();let{scheme_reference:F}=e,B=!1;Ei(()=>{xh.set(null)});function G(Xe,Zt){Xe.preventDefault();let Gt=f.features.find(or=>or.id==Zt);Gt.geometry.type=="Point"?w==null||w.flyTo({center:Gt.geometry.coordinates,duration:500}):w==null||w.fitBounds(Gw(Gt),{padding:200,duration:500}),dr.set({mode:"edit-form",id:Zt})}function J(Xe){xh.update(Zt=>Zt==Xe?null:Zt)}function j(){z.update(Xe=>(Xe.features=Xe.features.filter(Zt=>Zt.properties.scheme_reference!=F),delete Xe.schemes[F],Object.keys(Xe.schemes).length==0&&(Xe=Uw(T)),Xe)),dd.update(Xe=>(Xe.delete(F),Xe)),t(4,B=!1)}let V="";function me(){V&&z.update(Xe=>{for(let Zt of Xe.features)Zt.properties.scheme_reference==F&&(Zt.properties.scheme_reference=V);return Xe})}function X(){return Object.values(f.schemes).filter(Xe=>Xe.scheme_reference!=F).map(Xe=>[Xe.scheme_reference,T.schemeName(Xe)])}let pe=!u.has(F);function Ee(){dd.update(Xe=>(pe?Xe.delete(F):Xe.add(F),Xe))}function Pe(){f.schemes[F].color=this.value,z.set(f)}const $e=()=>t(4,B=!0);function Ye(Xe){pe=Xe,t(6,pe)}const ve=Xe=>Xe.properties.scheme_reference==F,We=(Xe,Zt)=>G(Zt,Xe.id),at=Xe=>xh.set(Xe.id),mt=Xe=>J(Xe.id);function Ht(Xe){V=Xe,t(5,V)}const qt=()=>t(4,B=!1);function Ue(Xe){B=Xe,t(4,B)}return n.$$set=Xe=>{"cfg"in Xe&&t(0,T=Xe.cfg),"gjSchemes"in Xe&&y(t(1,z=Xe.gjSchemes)),"scheme_reference"in Xe&&t(2,F=Xe.scheme_reference),"$$scope"in Xe&&t(26,k=Xe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&13&&t(8,o=f.features.filter(Xe=>Xe.properties.scheme_reference==F&&T.interventionWarning(Xe)!=null).length),n.$$.dirty[0]&12&&t(7,l=f.features.filter(Xe=>Xe.properties.scheme_reference==F).length)},[T,z,F,f,B,V,pe,l,o,G,J,j,me,X,Ee,M,Pe,$e,Ye,ve,We,at,mt,Ht,qt,Ue,k]}class kF extends Dt{constructor(e){super(),Ft(this,e,SF,wF,At,{cfg:0,gjSchemes:1,scheme_reference:2},null,[-1,-1])}}function jb(n,e,t){const o=n.slice();return o[9]=e[t],o[11]=t,o}function EF(n){let e;return{c(){e=xt("Add new blank scheme")},l(t){e=wt(t,"Add new blank scheme")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function Vb(n){let e,t,o,l;function u(){return n[7](n[9])}e=new Kr({props:{disabled:n[11]==0,$$slots:{default:[PF]},$$scope:{ctx:n}}}),e.$on("click",u);function f(){return n[8](n[9])}return o=new Kr({props:{disabled:n[11]==Object.keys(n[3].schemes).length-1,$$slots:{default:[MF]},$$scope:{ctx:n}}}),o.$on("click",f),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(c){Fe(e.$$.fragment,c),t=Ge(c),Fe(o.$$.fragment,c)},m(c,y){ze(e,c,y),ce(c,t,y),ze(o,c,y),l=!0},p(c,y){n=c;const w={};y&8&&(w.disabled=n[11]==0),y&4096&&(w.$$scope={dirty:y,ctx:n}),e.$set(w);const M={};y&8&&(M.disabled=n[11]==Object.keys(n[3].schemes).length-1),y&4096&&(M.$$scope={dirty:y,ctx:n}),o.$set(M)},i(c){l||(ae(e.$$.fragment,c),ae(o.$$.fragment,c),l=!0)},o(c){fe(e.$$.fragment,c),fe(o.$$.fragment,c),l=!1},d(c){c&&ee(t),Le(e,c),Le(o,c)}}}function PF(n){let e;return{c(){e=xt("Move up")},l(t){e=wt(t,"Move up")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function MF(n){let e;return{c(){e=xt("Move down")},l(t){e=wt(t,"Move down")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function IF(n){let e=Object.keys(n[3].schemes).length>1,t,o,l=e&&Vb(n);return{c(){l&&l.c(),t=Ot()},l(u){l&&l.l(u),t=Ot()},m(u,f){l&&l.m(u,f),ce(u,t,f),o=!0},p(u,f){f&8&&(e=Object.keys(u[3].schemes).length>1),e?l?(l.p(u,f),f&8&&ae(l,1)):(l=Vb(u),l.c(),ae(l,1),l.m(t.parentNode,t)):l&&(vr(),fe(l,1,1,()=>{l=null}),br())},i(u){o||(ae(l),o=!0)},o(u){fe(l),o=!1},d(u){u&&ee(t),l&&l.d(u)}}}function Ub(n,e){let t,o,l,u,f;return o=new kF({props:{cfg:e[0],gjSchemes:e[1],scheme_reference:e[9],$$slots:{default:[IF]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Ot(),Ae(o.$$.fragment),l=qe(),u=et("hr"),this.h()},l(c){t=Ot(),Fe(o.$$.fragment,c),l=Ge(c),u=tt(c,"HR",{}),this.h()},h(){this.first=t},m(c,y){ce(c,t,y),ze(o,c,y),ce(c,l,y),ce(c,u,y),f=!0},p(c,y){e=c;const w={};y&1&&(w.cfg=e[0]),y&2&&(w.gjSchemes=e[1]),y&8&&(w.scheme_reference=e[9]),y&4104&&(w.$$scope={dirty:y,ctx:e}),o.$set(w)},i(c){f||(ae(o.$$.fragment,c),f=!0)},o(c){fe(o.$$.fragment,c),f=!1},d(c){c&&(ee(t),ee(l),ee(u)),Le(o,c)}}}function TF(n){let e,t,o,l,u,f,c,y,w=[],M=new Map,k,T;e=new Kr({props:{$$slots:{default:[EF]},$$scope:{ctx:n}}}),e.$on("click",n[4]),o=new A5({props:{label:"Add scheme from file",onLoad:n[5]}}),u=new Rs({props:{errorMessage:n[2]}});let z=_o(Object.keys(n[3].schemes));const F=B=>B[9];for(let B=0;B{t[o]=e[o]}),t}function zF(n,e,t){let o,l=Yt,u=()=>(l(),l=da(c,F=>t(3,o=F)),c);n.$$.on_destroy.push(()=>l());let{cfg:f}=e,{gjSchemes:c}=e;u();function y(){qw(f,o),c.set(o)}let w="";function M(F,B){try{let G=f.backfill(JSON.parse(B));for(let j of Object.values(G.schemes)){if(j.scheme_reference in o.schemes)throw new Error("The file you're loading seems to contain duplicate data. Are you merging in the same file accidentally?");zi(c,o.schemes[j.scheme_reference]=j,o)}zi(c,o.features=o.features.concat(G.features),o);let J=1;o.features.forEach(j=>{j.id=J++}),c.set(o),t(2,w="")}catch(G){t(2,w=`Couldn't load scheme from a file: ${G}`)}}function k(F,B){const G=JSON.parse(JSON.stringify(Object.keys(o.schemes))),J=G.indexOf(F);if(J+B>=0&&J+Bk(F,-1),z=F=>k(F,1);return n.$$set=F=>{"cfg"in F&&t(0,f=F.cfg),"gjSchemes"in F&&u(t(1,c=F.gjSchemes))},[f,c,w,o,y,M,k,T,z]}class LF extends Dt{constructor(e){super(),Ft(this,e,zF,TF,At,{cfg:0,gjSchemes:1})}}function qb(n){let e,t;return e=new X6({props:{url:n[2]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&4&&(u.url=o[2]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function DF(n){let e,t="StreetView",o,l,u;return l=new oF({props:{cfg:n[0]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-ubqx78"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function FF(n){let e,t="Georeference image",o,l,u;return l=new a6({}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-15fpigd"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p:Yt,i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function RF(n){let e,t="Split route",o,l,u,f,c=`
  • Click + Delete`),this.h()},h(){zs(e.src,t=dF)||Ke(e,"src",t),Ke(e,"alt","Delete scheme")},m(l,u){ce(l,e,u),ce(l,o,u)},p:Yt,d(l){l&&(ee(e),ee(o))}}}function mF(n){let e;return{c(){e=xt("Show")},l(t){e=wt(t,"Show")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function gF(n){let e,t;return e=new Rs({props:{errorMessage:"There's a problem with "+n[8]+" interventions below"}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l[0]&256&&(u.errorMessage="There's a problem with "+o[8]+" interventions below"),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function yF(n){let e,t;return e=new Rs({props:{errorMessage:"There's a problem with one intervention below"}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function Ob(n){let e,t;return e=new V6({props:{text:n[30]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l[0]&13&&(u.text=o[30]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function $b(n,e){let t,o,l,u=e[0].interventionName(e[29])+"",f,c,y,w,M,k=e[30]&&Ob(e);function T(...B){return e[20](e[29],...B)}function z(){return e[21](e[29])}function F(){return e[22](e[29])}return{key:n,first:null,c(){t=et("li"),o=et("a"),k&&k.c(),l=qe(),f=xt(u),c=qe(),this.h()},l(B){t=tt(B,"LI",{});var G=Lt(t);o=tt(G,"A",{href:!0});var J=Lt(o);k&&k.l(J),l=Ge(J),f=wt(J,u),J.forEach(ee),c=Ge(G),G.forEach(ee),this.h()},h(){Ke(o,"href","#"),this.first=t},m(B,G){ce(B,t,G),_t(t,o),k&&k.m(o,null),_t(o,l),_t(o,f),_t(t,c),y=!0,w||(M=[fr(o,"click",T),fr(o,"mouseenter",z),fr(o,"mouseleave",F)],w=!0)},p(B,G){e=B,e[30]?k?(k.p(e,G),G[0]&13&&ae(k,1)):(k=Ob(e),k.c(),ae(k,1),k.m(o,l)):k&&(vr(),fe(k,1,1,()=>{k=null}),br()),(!y||G[0]&13)&&u!==(u=e[0].interventionName(e[29])+"")&&ai(f,u)},i(B){y||(ae(k),y=!0)},o(B){fe(k),y=!1},d(B){B&&ee(t),k&&k.d(),w=!1,ss(M)}}}function Nb(n){let e,t,o,l,u=n[7]==1?"intervention":"interventions",f,c,y,w,M,k;function T(F){n[23](F)}let z={label:"Move interventions to another scheme",choices:n[13]()};return n[5]!==void 0&&(z.value=n[5]),w=new R2({props:z}),Wr.push(()=>fi(w,"value",T)),w.$on("change",n[12]),{c(){e=et("p"),t=xt("Do you want to first move "),o=xt(n[7]),l=qe(),f=xt(u),c=xt(" to another scheme?"),y=qe(),Ae(w.$$.fragment)},l(F){e=tt(F,"P",{});var B=Lt(e);t=wt(B,"Do you want to first move "),o=wt(B,n[7]),l=Ge(B),f=wt(B,u),c=wt(B," to another scheme?"),B.forEach(ee),y=Ge(F),Fe(w.$$.fragment,F)},m(F,B){ce(F,e,B),_t(e,t),_t(e,o),_t(e,l),_t(e,f),_t(e,c),ce(F,y,B),ze(w,F,B),k=!0},p(F,B){(!k||B[0]&128)&&ai(o,F[7]),(!k||B[0]&128)&&u!==(u=F[7]==1?"intervention":"interventions")&&ai(f,u);const G={};!M&&B[0]&32&&(M=!0,G.value=F[5],gi(()=>M=!1)),w.$set(G)},i(F){k||(ae(w.$$.fragment,F),k=!0)},o(F){fe(w.$$.fragment,F),k=!1},d(F){F&&(ee(e),ee(y)),Le(w,F)}}}function _F(n){let e;return{c(){e=xt("Delete scheme")},l(t){e=wt(t,"Delete scheme")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function vF(n){let e;return{c(){e=xt("Cancel")},l(t){e=wt(t,"Cancel")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function bF(n){let e,t,o,l;return e=new dp({props:{$$slots:{default:[_F]},$$scope:{ctx:n}}}),e.$on("click",n[11]),o=new Kr({props:{$$slots:{default:[vF]},$$scope:{ctx:n}}}),o.$on("click",n[24]),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(u){Fe(e.$$.fragment,u),t=Ge(u),Fe(o.$$.fragment,u)},m(u,f){ze(e,u,f),ce(u,t,f),ze(o,u,f),l=!0},p(u,f){const c={};f[0]&67108864&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const y={};f[0]&67108864&&(y.$$scope={dirty:f,ctx:u}),o.$set(y)},i(u){l||(ae(e.$$.fragment,u),ae(o.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),fe(o.$$.fragment,u),l=!1},d(u){u&&ee(t),Le(e,u),Le(o,u)}}}function xF(n){let e=n[7]>0&&n[13]().length>0,t,o,l,u=e&&Nb(n);return o=new pl({props:{$$slots:{default:[bF]},$$scope:{ctx:n}}}),{c(){u&&u.c(),t=qe(),Ae(o.$$.fragment)},l(f){u&&u.l(f),t=Ge(f),Fe(o.$$.fragment,f)},m(f,c){u&&u.m(f,c),ce(f,t,c),ze(o,f,c),l=!0},p(f,c){c[0]&128&&(e=f[7]>0&&f[13]().length>0),e?u?(u.p(f,c),c[0]&128&&ae(u,1)):(u=Nb(f),u.c(),ae(u,1),u.m(t.parentNode,t)):u&&(vr(),fe(u,1,1,()=>{u=null}),br());const y={};c[0]&67108880&&(y.$$scope={dirty:c,ctx:f}),o.$set(y)},i(f){l||(ae(u),ae(o.$$.fragment,f),l=!0)},o(f){fe(u),fe(o.$$.fragment,f),l=!1},d(f){f&&ee(t),u&&u.d(f),Le(o,f)}}}function wF(n){let e,t=n[0].schemeName(n[3].schemes[n[2]])+"",o,l,u,f,c,y,w,M,k,T,z,F,B,G,J,j,V=[],me=new Map,X,pe,Ee,Pe,$e,Ye;c=new dp({props:{$$slots:{default:[pF]},$$scope:{ctx:n}}}),c.$on("click",n[17]);function ve(Ve){n[18](Ve)}let We={$$slots:{default:[mF]},$$scope:{ctx:n}};n[6]!==void 0&&(We.checked=n[6]),w=new Gg({props:We}),Wr.push(()=>fi(w,"checked",ve)),w.$on("change",n[14]);const at=n[15].default,mt=yi(at,n,n[26],null);var Ht=n[0].editSchemeForm;function qt(Ve,ct){return{props:{gjSchemes:Ve[1],scheme_reference:Ve[2]}}}Ht&&(z=bd(Ht,qt(n)));const Ue=[yF,gF],Xe=[];function Zt(Ve,ct){return Ve[8]==1?0:Ve[8]>0?1:-1}~(B=Zt(n))&&(G=Xe[B]=Ue[B](n));let Gt=_o(n[3].features.filter(n[19]));const or=Ve=>Ve[29].id;for(let Ve=0;Vefi(pe,"open",Jt)),{c(){e=et("h3"),o=xt(t),l=qe(),u=et("input"),f=qe(),Ae(c.$$.fragment),y=qe(),Ae(w.$$.fragment),k=qe(),mt&&mt.c(),T=qe(),z&&Ae(z.$$.fragment),F=qe(),G&&G.c(),J=qe(),j=et("ol");for(let Ve=0;VeM=!1)),w.$set(rt),mt&&mt.p&&(!Pe||ct[0]&67108864)&&_i(mt,at,Ve,Ve[26],Pe?bi(at,Ve[26],ct,null):vi(Ve[26]),null),ct[0]&1&&Ht!==(Ht=Ve[0].editSchemeForm)){if(z){vr();const cr=z;fe(cr.$$.fragment,1,0,()=>{Le(cr,1)}),br()}Ht?(z=bd(Ht,qt(Ve)),Ae(z.$$.fragment),ae(z.$$.fragment,1),ze(z,F.parentNode,F)):z=null}else if(Ht){const cr={};ct[0]&2&&(cr.gjSchemes=Ve[1]),ct[0]&4&&(cr.scheme_reference=Ve[2]),z.$set(cr)}let rr=B;B=Zt(Ve),B===rr?~B&&Xe[B].p(Ve,ct):(G&&(vr(),fe(Xe[rr],1,1,()=>{Xe[rr]=null}),br()),~B?(G=Xe[B],G?G.p(Ve,ct):(G=Xe[B]=Ue[B](Ve),G.c()),ae(G,1),G.m(J.parentNode,J)):G=null),ct[0]&1549&&(Gt=_o(Ve[3].features.filter(Ve[19])),vr(),V=Xg(V,ct,or,1,Ve,Gt,me,j,Wg,$b,null,Bb),br());const ni={};ct[0]&67109040&&(ni.$$scope={dirty:ct,ctx:Ve}),!Ee&&ct[0]&16&&(Ee=!0,ni.open=Ve[4],gi(()=>Ee=!1)),pe.$set(ni)},i(Ve){if(!Pe){ae(c.$$.fragment,Ve),ae(w.$$.fragment,Ve),ae(mt,Ve),z&&ae(z.$$.fragment,Ve),ae(G);for(let ct=0;ct(c(),c=da(z,Xe=>t(3,f=Xe)),z),w;bt(n,dd,Xe=>t(27,u=Xe)),bt(n,ro,Xe=>t(28,w=Xe)),n.$$.on_destroy.push(()=>c());let{$$slots:M={},$$scope:k}=e,{cfg:T}=e,{gjSchemes:z}=e;y();let{scheme_reference:F}=e,B=!1;Ei(()=>{xh.set(null)});function G(Xe,Zt){Xe.preventDefault();let Gt=f.features.find(or=>or.id==Zt);Gt.geometry.type=="Point"?w==null||w.flyTo({center:Gt.geometry.coordinates,duration:500}):w==null||w.fitBounds(Gw(Gt),{padding:200,duration:500}),dr.set({mode:"edit-form",id:Zt})}function J(Xe){xh.update(Zt=>Zt==Xe?null:Zt)}function j(){z.update(Xe=>(Xe.features=Xe.features.filter(Zt=>Zt.properties.scheme_reference!=F),delete Xe.schemes[F],Object.keys(Xe.schemes).length==0&&(Xe=Uw(T)),Xe)),dd.update(Xe=>(Xe.delete(F),Xe)),t(4,B=!1)}let V="";function me(){V&&z.update(Xe=>{for(let Zt of Xe.features)Zt.properties.scheme_reference==F&&(Zt.properties.scheme_reference=V);return Xe})}function X(){return Object.values(f.schemes).filter(Xe=>Xe.scheme_reference!=F).map(Xe=>[Xe.scheme_reference,T.schemeName(Xe)])}let pe=!u.has(F);function Ee(){dd.update(Xe=>(pe?Xe.delete(F):Xe.add(F),Xe))}function Pe(){f.schemes[F].color=this.value,z.set(f)}const $e=()=>t(4,B=!0);function Ye(Xe){pe=Xe,t(6,pe)}const ve=Xe=>Xe.properties.scheme_reference==F,We=(Xe,Zt)=>G(Zt,Xe.id),at=Xe=>xh.set(Xe.id),mt=Xe=>J(Xe.id);function Ht(Xe){V=Xe,t(5,V)}const qt=()=>t(4,B=!1);function Ue(Xe){B=Xe,t(4,B)}return n.$$set=Xe=>{"cfg"in Xe&&t(0,T=Xe.cfg),"gjSchemes"in Xe&&y(t(1,z=Xe.gjSchemes)),"scheme_reference"in Xe&&t(2,F=Xe.scheme_reference),"$$scope"in Xe&&t(26,k=Xe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&13&&t(8,o=f.features.filter(Xe=>Xe.properties.scheme_reference==F&&T.interventionWarning(Xe)!=null).length),n.$$.dirty[0]&12&&t(7,l=f.features.filter(Xe=>Xe.properties.scheme_reference==F).length)},[T,z,F,f,B,V,pe,l,o,G,J,j,me,X,Ee,M,Pe,$e,Ye,ve,We,at,mt,Ht,qt,Ue,k]}class kF extends Dt{constructor(e){super(),Ft(this,e,SF,wF,At,{cfg:0,gjSchemes:1,scheme_reference:2},null,[-1,-1])}}function jb(n,e,t){const o=n.slice();return o[9]=e[t],o[11]=t,o}function EF(n){let e;return{c(){e=xt("Add new blank scheme")},l(t){e=wt(t,"Add new blank scheme")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function Vb(n){let e,t,o,l;function u(){return n[7](n[9])}e=new Kr({props:{disabled:n[11]==0,$$slots:{default:[PF]},$$scope:{ctx:n}}}),e.$on("click",u);function f(){return n[8](n[9])}return o=new Kr({props:{disabled:n[11]==Object.keys(n[3].schemes).length-1,$$slots:{default:[MF]},$$scope:{ctx:n}}}),o.$on("click",f),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(c){Fe(e.$$.fragment,c),t=Ge(c),Fe(o.$$.fragment,c)},m(c,y){ze(e,c,y),ce(c,t,y),ze(o,c,y),l=!0},p(c,y){n=c;const w={};y&8&&(w.disabled=n[11]==0),y&4096&&(w.$$scope={dirty:y,ctx:n}),e.$set(w);const M={};y&8&&(M.disabled=n[11]==Object.keys(n[3].schemes).length-1),y&4096&&(M.$$scope={dirty:y,ctx:n}),o.$set(M)},i(c){l||(ae(e.$$.fragment,c),ae(o.$$.fragment,c),l=!0)},o(c){fe(e.$$.fragment,c),fe(o.$$.fragment,c),l=!1},d(c){c&&ee(t),Le(e,c),Le(o,c)}}}function PF(n){let e;return{c(){e=xt("Move up")},l(t){e=wt(t,"Move up")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function MF(n){let e;return{c(){e=xt("Move down")},l(t){e=wt(t,"Move down")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function IF(n){let e=Object.keys(n[3].schemes).length>1,t,o,l=e&&Vb(n);return{c(){l&&l.c(),t=$t()},l(u){l&&l.l(u),t=$t()},m(u,f){l&&l.m(u,f),ce(u,t,f),o=!0},p(u,f){f&8&&(e=Object.keys(u[3].schemes).length>1),e?l?(l.p(u,f),f&8&&ae(l,1)):(l=Vb(u),l.c(),ae(l,1),l.m(t.parentNode,t)):l&&(vr(),fe(l,1,1,()=>{l=null}),br())},i(u){o||(ae(l),o=!0)},o(u){fe(l),o=!1},d(u){u&&ee(t),l&&l.d(u)}}}function Ub(n,e){let t,o,l,u,f;return o=new kF({props:{cfg:e[0],gjSchemes:e[1],scheme_reference:e[9],$$slots:{default:[IF]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=$t(),Ae(o.$$.fragment),l=qe(),u=et("hr"),this.h()},l(c){t=$t(),Fe(o.$$.fragment,c),l=Ge(c),u=tt(c,"HR",{}),this.h()},h(){this.first=t},m(c,y){ce(c,t,y),ze(o,c,y),ce(c,l,y),ce(c,u,y),f=!0},p(c,y){e=c;const w={};y&1&&(w.cfg=e[0]),y&2&&(w.gjSchemes=e[1]),y&8&&(w.scheme_reference=e[9]),y&4104&&(w.$$scope={dirty:y,ctx:e}),o.$set(w)},i(c){f||(ae(o.$$.fragment,c),f=!0)},o(c){fe(o.$$.fragment,c),f=!1},d(c){c&&(ee(t),ee(l),ee(u)),Le(o,c)}}}function TF(n){let e,t,o,l,u,f,c,y,w=[],M=new Map,k,T;e=new Kr({props:{$$slots:{default:[EF]},$$scope:{ctx:n}}}),e.$on("click",n[4]),o=new A5({props:{label:"Add scheme from file",onLoad:n[5]}}),u=new Rs({props:{errorMessage:n[2]}});let z=_o(Object.keys(n[3].schemes));const F=B=>B[9];for(let B=0;B{t[o]=e[o]}),t}function zF(n,e,t){let o,l=Yt,u=()=>(l(),l=da(c,F=>t(3,o=F)),c);n.$$.on_destroy.push(()=>l());let{cfg:f}=e,{gjSchemes:c}=e;u();function y(){qw(f,o),c.set(o)}let w="";function M(F,B){try{let G=f.backfill(JSON.parse(B));for(let j of Object.values(G.schemes)){if(j.scheme_reference in o.schemes)throw new Error("The file you're loading seems to contain duplicate data. Are you merging in the same file accidentally?");zi(c,o.schemes[j.scheme_reference]=j,o)}zi(c,o.features=o.features.concat(G.features),o);let J=1;o.features.forEach(j=>{j.id=J++}),c.set(o),t(2,w="")}catch(G){t(2,w=`Couldn't load scheme from a file: ${G}`)}}function k(F,B){const G=JSON.parse(JSON.stringify(Object.keys(o.schemes))),J=G.indexOf(F);if(J+B>=0&&J+Bk(F,-1),z=F=>k(F,1);return n.$$set=F=>{"cfg"in F&&t(0,f=F.cfg),"gjSchemes"in F&&u(t(1,c=F.gjSchemes))},[f,c,w,o,y,M,k,T,z]}class LF extends Dt{constructor(e){super(),Ft(this,e,zF,TF,At,{cfg:0,gjSchemes:1})}}function qb(n){let e,t;return e=new X6({props:{url:n[2]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&4&&(u.url=o[2]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function DF(n){let e,t="StreetView",o,l,u;return l=new oF({props:{cfg:n[0]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-ubqx78"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function FF(n){let e,t="Georeference image",o,l,u;return l=new a6({}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-15fpigd"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p:Yt,i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function RF(n){let e,t="Split route",o,l,u,f,c=`
  • Click on a route to split it
  • Click on the map or press Escape - to cancel
  • `,y;return l=new Fs({props:{$$slots:{default:[qF]},$$scope:{ctx:n}}}),l.$on("click",n[7]),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment),u=qe(),f=et("ul"),f.innerHTML=c},l(w){e=tt(w,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-2pv7mp"&&(e.textContent=t),o=Ge(w),Fe(l.$$.fragment,w),u=Ge(w),f=tt(w,"UL",{"data-svelte-h":!0}),Pi(f)!=="svelte-1tmhrzy"&&(f.innerHTML=c)},m(w,M){ce(w,e,M),ce(w,o,M),ze(l,w,M),ce(w,u,M),ce(w,f,M),y=!0},p(w,M){const k={};M&512&&(k.$$scope={dirty:M,ctx:w}),l.$set(k)},i(w){y||(ae(l.$$.fragment,w),y=!0)},o(w){fe(l.$$.fragment,w),y=!1},d(w){w&&(ee(e),ee(o),ee(u),ee(f)),Le(l,w)}}}function BF(n){let e,t="New polygon (snapped)",o,l,u;return l=new tF({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-10zhc3y"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function OF(n){let e,t="New polygon (freehand)",o,l,u;return l=new y6({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-o2ink0"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function $F(n){let e,t="New route",o,l,u;return l=new S6({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-b5ww8f"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function NF(n){let e,t="New point",o,l,u;return l=new h6({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-1ojdr6q"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function jF(n){let e,t;return e=new e6({props:{cfg:n[0],gjSchemes:n[1],id:n[4].id}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),l&2&&(u.gjSchemes=o[1]),l&16&&(u.id=o[4].id),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function VF(n){let e,t;return e=new fF({props:{cfg:n[0],gjSchemes:n[1],id:n[4].id}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),l&2&&(u.gjSchemes=o[1]),l&16&&(u.id=o[4].id),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function UF(n){let e,t;return e=new LF({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),l&2&&(u.gjSchemes=o[1]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function qF(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function GF(n){let e,t,o,l,u,f,c=n[3]&&qb(n);const y=[UF,VF,jF,NF,$F,OF,BF,RF,FF,DF],w=[];function M(k,T){return k[4].mode=="list"?0:k[4].mode=="edit-form"?1:k[4].mode=="edit-geometry"?2:k[4].mode=="new-point"?3:k[4].mode=="new-route"?4:k[4].mode=="new-freehand-polygon"?5:k[4].mode=="new-snapped-polygon"?6:k[4].mode=="split-route"?7:k[4].mode=="set-image"?8:k[4].mode=="streetview"?9:-1}return~(o=M(n))&&(l=w[o]=y[o](n)),{c(){e=et("div"),c&&c.c(),t=qe(),l&&l.c(),u=Ot(),this.h()},l(k){e=tt(k,"DIV",{});var T=Lt(e);c&&c.l(T),T.forEach(ee),t=Ge(k),l&&l.l(k),u=Ot(),this.h()},h(){ki(e,"visibility",n[4].mode=="list"?"visible":"hidden")},m(k,T){ce(k,e,T),c&&c.m(e,null),ce(k,t,T),~o&&w[o].m(k,T),ce(k,u,T),f=!0},p(k,[T]){k[3]?c?(c.p(k,T),T&8&&ae(c,1)):(c=qb(k),c.c(),ae(c,1),c.m(e,null)):c&&(vr(),fe(c,1,1,()=>{c=null}),br()),T&16&&ki(e,"visibility",k[4].mode=="list"?"visible":"hidden");let z=o;o=M(k),o===z?~o&&w[o].p(k,T):(l&&(vr(),fe(w[z],1,1,()=>{w[z]=null}),br()),~o?(l=w[o],l?l.p(k,T):(l=w[o]=y[o](k),l.c()),ae(l,1),l.m(u.parentNode,u)):l=null)},i(k){f||(ae(c),ae(l),f=!0)},o(k){fe(c),fe(l),f=!1},d(k){k&&(ee(e),ee(t),ee(u)),c&&c.d(),~o&&w[o].d(k)}}}function ZF(n,e,t){let o,l,u,f,c;bt(n,Ds,T=>t(8,o=T)),bt(n,Pc,T=>t(5,l=T)),bt(n,kh,T=>t(6,u=T)),bt(n,ro,T=>t(3,f=T)),bt(n,dr,T=>t(4,c=T));let{cfg:y}=e,{gjSchemes:w}=e,{routeSnapperUrl:M}=e;Ei(()=>{u==null||u.tearDown(),l==null||l.tearDown(),o==null||o.tearDown()});const k=()=>dr.set({mode:"list"});return n.$$set=T=>{"cfg"in T&&t(0,y=T.cfg),"gjSchemes"in T&&t(1,w=T.gjSchemes),"routeSnapperUrl"in T&&t(2,M=T.routeSnapperUrl)},n.$$.update=()=>{n.$$.dirty&72&&f&&!u&&kh.set(new yP(f)),n.$$.dirty&40&&f&&!l&&Pc.set(new y3(f))},[y,w,M,f,c,l,u,k]}class HF extends Dt{constructor(e){super(),Ft(this,e,ZF,GF,At,{cfg:0,gjSchemes:1,routeSnapperUrl:2})}}function WF(n){let e,t,o,l,u,f,c,y,w,M,k,T;function z(X){n[5](X)}let F={label:"Name"};n[0].name!==void 0&&(F.value=n[0].name),e=new Yy({props:F}),Hr.push(()=>fi(e,"value",z));function B(X){n[7](X)}let G={label:"Scheme",choices:Object.values(n[3].schemes).map(n[6])};n[0].scheme_reference!==void 0&&(G.value=n[0].scheme_reference),l=new R2({props:G}),Hr.push(()=>fi(l,"value",B));function J(X){n[8](X)}let j={legend:"Likelihood of construction",choices:[["moonshot","Moonshot"],["maybe","Maybe?"],["definitely","Definitely!"]],inlineSmall:!0,required:!0};n[0].likelihood!==void 0&&(j.value=n[0].likelihood),c=new Ky({props:j}),Hr.push(()=>fi(c,"value",J));function V(X){n[9](X)}let me={label:"Description"};return n[0].description!==void 0&&(me.value=n[0].description),M=new q5({props:me}),Hr.push(()=>fi(M,"value",V)),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment),f=qe(),Ae(c.$$.fragment),w=qe(),Ae(M.$$.fragment)},l(X){Fe(e.$$.fragment,X),o=Ge(X),Fe(l.$$.fragment,X),f=Ge(X),Fe(c.$$.fragment,X),w=Ge(X),Fe(M.$$.fragment,X)},m(X,pe){ze(e,X,pe),ce(X,o,pe),ze(l,X,pe),ce(X,f,pe),ze(c,X,pe),ce(X,w,pe),ze(M,X,pe),T=!0},p(X,[pe]){const Ee={};!t&&pe&1&&(t=!0,Ee.value=X[0].name,gi(()=>t=!1)),e.$set(Ee);const Pe={};pe&10&&(Pe.choices=Object.values(X[3].schemes).map(X[6])),!u&&pe&1&&(u=!0,Pe.value=X[0].scheme_reference,gi(()=>u=!1)),l.$set(Pe);const $e={};!y&&pe&1&&(y=!0,$e.value=X[0].likelihood,gi(()=>y=!1)),c.$set($e);const Ye={};!k&&pe&1&&(k=!0,Ye.value=X[0].description,gi(()=>k=!1)),M.$set(Ye)},i(X){T||(ae(e.$$.fragment,X),ae(l.$$.fragment,X),ae(c.$$.fragment,X),ae(M.$$.fragment,X),T=!0)},o(X){fe(e.$$.fragment,X),fe(l.$$.fragment,X),fe(c.$$.fragment,X),fe(M.$$.fragment,X),T=!1},d(X){X&&(ee(o),ee(f),ee(w)),Le(e,X),Le(l,X),Le(c,X),Le(M,X)}}}function XF(n,e,t){let o,l=Yt,u=()=>(l(),l=da(c,B=>t(3,o=B)),c);n.$$.on_destroy.push(()=>l());let{cfg:f}=e,{gjSchemes:c}=e;u();let{id:y}=e,{props:w}=e;function M(B){n.$$.not_equal(w.name,B)&&(w.name=B,t(0,w))}const k=B=>[B.scheme_reference,f.schemeName(B)];function T(B){n.$$.not_equal(w.scheme_reference,B)&&(w.scheme_reference=B,t(0,w))}function z(B){n.$$.not_equal(w.likelihood,B)&&(w.likelihood=B,t(0,w))}function F(B){n.$$.not_equal(w.description,B)&&(w.description=B,t(0,w))}return n.$$set=B=>{"cfg"in B&&t(1,f=B.cfg),"gjSchemes"in B&&u(t(2,c=B.gjSchemes)),"id"in B&&t(4,y=B.id),"props"in B&&t(0,w=B.props)},[w,f,c,o,y,M,k,T,z,F]}class JF extends Dt{constructor(e){super(),Ft(this,e,XF,WF,At,{cfg:1,gjSchemes:2,id:4,props:0})}}function KF(n){let e;return{c(){e=xt("Scheme details")},l(t){e=wt(t,"Scheme details")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function YF(n){let e;return{c(){e=xt("Save")},l(t){e=wt(t,"Save")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function QF(n){let e,t,o,l,u;function f(y){n[6](y)}let c={label:"Scheme name",required:!0};return n[3].schemes[n[1]].scheme_name!==void 0&&(c.value=n[3].schemes[n[1]].scheme_name),e=new Yy({props:c}),Hr.push(()=>fi(e,"value",f)),l=new Fs({props:{$$slots:{default:[YF]},$$scope:{ctx:n}}}),l.$on("click",n[7]),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment)},l(y){Fe(e.$$.fragment,y),o=Ge(y),Fe(l.$$.fragment,y)},m(y,w){ze(e,y,w),ce(y,o,w),ze(l,y,w),u=!0},p(y,w){const M={};!t&&w&10&&(t=!0,M.value=y[3].schemes[y[1]].scheme_name,gi(()=>t=!1)),e.$set(M);const k={};w&512&&(k.$$scope={dirty:w,ctx:y}),l.$set(k)},i(y){u||(ae(e.$$.fragment,y),ae(l.$$.fragment,y),u=!0)},o(y){fe(e.$$.fragment,y),fe(l.$$.fragment,y),u=!1},d(y){y&&ee(o),Le(e,y),Le(l,y)}}}function eR(n){let e,t,o,l,u,f,c;e=new Kr({props:{$$slots:{default:[KF]},$$scope:{ctx:n}}}),e.$on("click",n[5]);function y(M){n[8](M)}let w={title:"Scheme details",$$slots:{default:[QF]},$$scope:{ctx:n}};return n[2]!==void 0&&(w.open=n[2]),o=new j2({props:w}),Hr.push(()=>fi(o,"open",y)),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(M){Fe(e.$$.fragment,M),t=Ge(M),Fe(o.$$.fragment,M)},m(M,k){ze(e,M,k),ce(M,t,k),ze(o,M,k),u=!0,f||(c=fr(window,"keydown",n[4]),f=!0)},p(M,[k]){const T={};k&512&&(T.$$scope={dirty:k,ctx:M}),e.$set(T);const z={};k&526&&(z.$$scope={dirty:k,ctx:M}),!l&&k&4&&(l=!0,z.open=M[2],gi(()=>l=!1)),o.$set(z)},i(M){u||(ae(e.$$.fragment,M),ae(o.$$.fragment,M),u=!0)},o(M){fe(e.$$.fragment,M),fe(o.$$.fragment,M),u=!1},d(M){M&&ee(t),Le(e,M),Le(o,M),f=!1,c()}}}function tR(n,e,t){let o,l=Yt,u=()=>(l(),l=da(f,F=>t(3,o=F)),f);n.$$.on_destroy.push(()=>l());let{gjSchemes:f}=e;u();let{scheme_reference:c}=e,y=!1;function w(F){y&&F.key=="Escape"&&(F.stopPropagation(),t(2,y=!1))}const M=()=>t(2,y=!0);function k(F){n.$$.not_equal(o.schemes[c].scheme_name,F)&&(o.schemes[c].scheme_name=F,f.set(o))}const T=()=>t(2,y=!1);function z(F){y=F,t(2,y)}return n.$$set=F=>{"gjSchemes"in F&&u(t(0,f=F.gjSchemes)),"scheme_reference"in F&&t(1,c=F.scheme_reference)},[f,c,y,o,w,M,k,T,z]}class rR extends Dt{constructor(e){super(),Ft(this,e,tR,eR,At,{gjSchemes:0,scheme_reference:1})}}function iR(n){let e,t;return e=new dL({props:{cfg:n[3],gjSchemes:n[4]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function nR(n){let e,t;return e=new mD({props:{cfg:n[3],gjSchemes:n[4]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function oR(n){let e,t,o,l,u,f,c,y,w,M,k,T,z;e=new l5({props:{cfg:n[3],boundaryGeojson:n[2],fitBoundsAtStart:!0}}),o=new uz({props:{cfg:n[3],gjSchemes:n[4]}}),u=new Q3({props:{cfg:n[3]}});const F=[nR,iR],B=[];function G(J,j){return J[1].mode=="list"?0:J[1].mode=="split-route"?1:-1}return~(c=G(n))&&(y=B[c]=F[c](n)),M=new bz({props:{cfg:n[3]}}),T=new pz({props:{cfg:n[3]}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),Ae(u.$$.fragment),f=qe(),y&&y.c(),w=qe(),Ae(M.$$.fragment),k=qe(),Ae(T.$$.fragment)},l(J){Fe(e.$$.fragment,J),t=Ge(J),Fe(o.$$.fragment,J),l=Ge(J),Fe(u.$$.fragment,J),f=Ge(J),y&&y.l(J),w=Ge(J),Fe(M.$$.fragment,J),k=Ge(J),Fe(T.$$.fragment,J)},m(J,j){ze(e,J,j),ce(J,t,j),ze(o,J,j),ce(J,l,j),ze(u,J,j),ce(J,f,j),~c&&B[c].m(J,j),ce(J,w,j),ze(M,J,j),ce(J,k,j),ze(T,J,j),z=!0},p(J,j){let V=c;c=G(J),c===V?~c&&B[c].p(J,j):(y&&(vr(),fe(B[V],1,1,()=>{B[V]=null}),br()),~c?(y=B[c],y?y.p(J,j):(y=B[c]=F[c](J),y.c()),ae(y,1),y.m(w.parentNode,w)):y=null)},i(J){z||(ae(e.$$.fragment,J),ae(o.$$.fragment,J),ae(u.$$.fragment,J),ae(y),ae(M.$$.fragment,J),ae(T.$$.fragment,J),z=!0)},o(J){fe(e.$$.fragment,J),fe(o.$$.fragment,J),fe(u.$$.fragment,J),fe(y),fe(M.$$.fragment,J),fe(T.$$.fragment,J),z=!1},d(J){J&&(ee(t),ee(l),ee(f),ee(w),ee(k)),Le(e,J),Le(o,J),Le(u,J),~c&&B[c].d(J),Le(M,J),Le(T,J)}}}function sR(n){let e,t,o,l,u,f,c,y;o=new HF({props:{cfg:n[3],gjSchemes:n[4],routeSnapperUrl:aR}});function w(k){n[5](k)}let M={style:"https://api.maptiler.com/maps/dataviz/style.json?key="+U2,standardControls:!0,$$slots:{default:[oR]},$$scope:{ctx:n}};return n[0]!==void 0&&(M.map=n[0]),f=new LE({props:M}),Hr.push(()=>fi(f,"map",w)),f.$on("error",n[6]),{c(){e=et("div"),t=et("div"),Ae(o.$$.fragment),l=qe(),u=et("div"),Ae(f.$$.fragment),this.h()},l(k){e=tt(k,"DIV",{style:!0});var T=Lt(e);t=tt(T,"DIV",{class:!0});var z=Lt(t);Fe(o.$$.fragment,z),z.forEach(ee),l=Ge(T),u=tt(T,"DIV",{class:!0});var F=Lt(u);Fe(f.$$.fragment,F),F.forEach(ee),T.forEach(ee),this.h()},h(){Ke(t,"class","sidebar svelte-1j3l30i"),Ke(u,"class","map svelte-1j3l30i"),ki(e,"display","flex"),ki(e,"height","100vh")},m(k,T){ce(k,e,T),_t(e,t),ze(o,t,null),_t(e,l),_t(e,u),ze(f,u,null),y=!0},p(k,[T]){const z={};T&130&&(z.$$scope={dirty:T,ctx:k}),!c&&T&1&&(c=!0,z.map=k[0],gi(()=>c=!1)),f.$set(z)},i(k){y||(ae(o.$$.fragment,k),ae(f.$$.fragment,k),y=!0)},o(k){fe(o.$$.fragment,k),fe(f.$$.fragment,k),y=!1},d(k){k&&ee(e),Le(o),Le(f)}}}let U2="MZEJTanw3WpxRvt7qDfo",aR="https://atip.uk/route-snappers/v2.6/LAD_Adur.bin.gz";function lR(n,e,t){let o,l;bt(n,ro,M=>t(0,o=M)),bt(n,dr,M=>t(1,l=M));let u={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-.364623,50.874533],[-.371208,50.869793],[-.367479,50.860539],[-.369022,50.855288],[-.365441,50.846933],[-.358547,50.843541],[-.358369,50.830646],[-.349344,50.822407],[-.339007,50.822184],[-.330269,50.816102],[-.299725,50.823206],[-.280328,50.825936],[-.25188,50.825546],[-.237095,50.828265],[-.21626,50.826897],[-.215382,50.830533],[-.234361,50.851116],[-.239727,50.861896],[-.244998,50.863815],[-.248948,50.870547],[-.258962,50.871214],[-.256606,50.862342],[-.269032,50.863672],[-.287977,50.864159],[-.298485,50.866274],[-.311454,50.864779],[-.320283,50.865434],[-.339752,50.862547],[-.349058,50.865902],[-.364623,50.874533]]]},properties:{}},f={interventionName:M=>`some ${M.geometry.type} feature`,schemeName:M=>M.scheme_name,backfill:M=>M,initializeEmptyScheme:M=>{let k=M;return k.scheme_name="",k},interventionWarning:M=>null,editFeatureForm:JF,editSchemeForm:rR,newPointFeature:M=>{},newPolygonFeature:M=>{},newLineStringFeature:M=>{},updateFeature:(M,k)=>{},maptilerApiKey:U2,getStreetViewRoadLayerNames:M=>["Road network"],layerZorder:["interventions-polygons","interventions-polygons-outlines","hover-polygons","hover-lines","interventions-lines","interventions-lines-endpoints","hover-points","interventions-points","edit-polygon-fill","edit-polygon-lines","edit-polygon-vertices","draw-split-route","route-points","route-lines","route-polygons","road_label","boundary","georeferenced-image"]},c=Yr(Uw(f));function y(M){o=M,ro.set(o)}return[o,l,u,f,c,y,M=>{console.log(M.detail.error)}]}class vR extends Dt{constructor(e){super(),Ft(this,e,lR,sR,At,{})}}export{vR as component}; + to cancel`,y;return l=new Fs({props:{$$slots:{default:[qF]},$$scope:{ctx:n}}}),l.$on("click",n[7]),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment),u=qe(),f=et("ul"),f.innerHTML=c},l(w){e=tt(w,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-2pv7mp"&&(e.textContent=t),o=Ge(w),Fe(l.$$.fragment,w),u=Ge(w),f=tt(w,"UL",{"data-svelte-h":!0}),Pi(f)!=="svelte-1tmhrzy"&&(f.innerHTML=c)},m(w,M){ce(w,e,M),ce(w,o,M),ze(l,w,M),ce(w,u,M),ce(w,f,M),y=!0},p(w,M){const k={};M&512&&(k.$$scope={dirty:M,ctx:w}),l.$set(k)},i(w){y||(ae(l.$$.fragment,w),y=!0)},o(w){fe(l.$$.fragment,w),y=!1},d(w){w&&(ee(e),ee(o),ee(u),ee(f)),Le(l,w)}}}function BF(n){let e,t="New polygon (snapped)",o,l,u;return l=new tF({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-10zhc3y"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function OF(n){let e,t="New polygon (freehand)",o,l,u;return l=new y6({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-o2ink0"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function $F(n){let e,t="New route",o,l,u;return l=new S6({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-b5ww8f"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function NF(n){let e,t="New point",o,l,u;return l=new h6({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){e=et("h2"),e.textContent=t,o=qe(),Ae(l.$$.fragment)},l(f){e=tt(f,"H2",{"data-svelte-h":!0}),Pi(e)!=="svelte-1ojdr6q"&&(e.textContent=t),o=Ge(f),Fe(l.$$.fragment,f)},m(f,c){ce(f,e,c),ce(f,o,c),ze(l,f,c),u=!0},p(f,c){const y={};c&1&&(y.cfg=f[0]),c&2&&(y.gjSchemes=f[1]),l.$set(y)},i(f){u||(ae(l.$$.fragment,f),u=!0)},o(f){fe(l.$$.fragment,f),u=!1},d(f){f&&(ee(e),ee(o)),Le(l,f)}}}function jF(n){let e,t;return e=new e6({props:{cfg:n[0],gjSchemes:n[1],id:n[4].id}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),l&2&&(u.gjSchemes=o[1]),l&16&&(u.id=o[4].id),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function VF(n){let e,t;return e=new fF({props:{cfg:n[0],gjSchemes:n[1],id:n[4].id}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),l&2&&(u.gjSchemes=o[1]),l&16&&(u.id=o[4].id),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function UF(n){let e,t;return e=new LF({props:{cfg:n[0],gjSchemes:n[1]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p(o,l){const u={};l&1&&(u.cfg=o[0]),l&2&&(u.gjSchemes=o[1]),e.$set(u)},i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function qF(n){let e;return{c(){e=xt("Finish")},l(t){e=wt(t,"Finish")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function GF(n){let e,t,o,l,u,f,c=n[3]&&qb(n);const y=[UF,VF,jF,NF,$F,OF,BF,RF,FF,DF],w=[];function M(k,T){return k[4].mode=="list"?0:k[4].mode=="edit-form"?1:k[4].mode=="edit-geometry"?2:k[4].mode=="new-point"?3:k[4].mode=="new-route"?4:k[4].mode=="new-freehand-polygon"?5:k[4].mode=="new-snapped-polygon"?6:k[4].mode=="split-route"?7:k[4].mode=="set-image"?8:k[4].mode=="streetview"?9:-1}return~(o=M(n))&&(l=w[o]=y[o](n)),{c(){e=et("div"),c&&c.c(),t=qe(),l&&l.c(),u=$t(),this.h()},l(k){e=tt(k,"DIV",{});var T=Lt(e);c&&c.l(T),T.forEach(ee),t=Ge(k),l&&l.l(k),u=$t(),this.h()},h(){ki(e,"visibility",n[4].mode=="list"?"visible":"hidden")},m(k,T){ce(k,e,T),c&&c.m(e,null),ce(k,t,T),~o&&w[o].m(k,T),ce(k,u,T),f=!0},p(k,[T]){k[3]?c?(c.p(k,T),T&8&&ae(c,1)):(c=qb(k),c.c(),ae(c,1),c.m(e,null)):c&&(vr(),fe(c,1,1,()=>{c=null}),br()),T&16&&ki(e,"visibility",k[4].mode=="list"?"visible":"hidden");let z=o;o=M(k),o===z?~o&&w[o].p(k,T):(l&&(vr(),fe(w[z],1,1,()=>{w[z]=null}),br()),~o?(l=w[o],l?l.p(k,T):(l=w[o]=y[o](k),l.c()),ae(l,1),l.m(u.parentNode,u)):l=null)},i(k){f||(ae(c),ae(l),f=!0)},o(k){fe(c),fe(l),f=!1},d(k){k&&(ee(e),ee(t),ee(u)),c&&c.d(),~o&&w[o].d(k)}}}function ZF(n,e,t){let o,l,u,f,c;bt(n,Ds,T=>t(8,o=T)),bt(n,Pc,T=>t(5,l=T)),bt(n,kh,T=>t(6,u=T)),bt(n,ro,T=>t(3,f=T)),bt(n,dr,T=>t(4,c=T));let{cfg:y}=e,{gjSchemes:w}=e,{routeSnapperUrl:M}=e;Ei(()=>{u==null||u.tearDown(),l==null||l.tearDown(),o==null||o.tearDown()});const k=()=>dr.set({mode:"list"});return n.$$set=T=>{"cfg"in T&&t(0,y=T.cfg),"gjSchemes"in T&&t(1,w=T.gjSchemes),"routeSnapperUrl"in T&&t(2,M=T.routeSnapperUrl)},n.$$.update=()=>{n.$$.dirty&72&&f&&!u&&kh.set(new yP(f)),n.$$.dirty&40&&f&&!l&&Pc.set(new y3(f))},[y,w,M,f,c,l,u,k]}class HF extends Dt{constructor(e){super(),Ft(this,e,ZF,GF,At,{cfg:0,gjSchemes:1,routeSnapperUrl:2})}}function WF(n){let e,t,o,l,u,f,c,y,w,M,k,T;function z(X){n[5](X)}let F={label:"Name"};n[0].name!==void 0&&(F.value=n[0].name),e=new Yy({props:F}),Wr.push(()=>fi(e,"value",z));function B(X){n[7](X)}let G={label:"Scheme",choices:Object.values(n[3].schemes).map(n[6])};n[0].scheme_reference!==void 0&&(G.value=n[0].scheme_reference),l=new R2({props:G}),Wr.push(()=>fi(l,"value",B));function J(X){n[8](X)}let j={legend:"Likelihood of construction",choices:[["moonshot","Moonshot"],["maybe","Maybe?"],["definitely","Definitely!"]],inlineSmall:!0,required:!0};n[0].likelihood!==void 0&&(j.value=n[0].likelihood),c=new Ky({props:j}),Wr.push(()=>fi(c,"value",J));function V(X){n[9](X)}let me={label:"Description"};return n[0].description!==void 0&&(me.value=n[0].description),M=new q5({props:me}),Wr.push(()=>fi(M,"value",V)),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment),f=qe(),Ae(c.$$.fragment),w=qe(),Ae(M.$$.fragment)},l(X){Fe(e.$$.fragment,X),o=Ge(X),Fe(l.$$.fragment,X),f=Ge(X),Fe(c.$$.fragment,X),w=Ge(X),Fe(M.$$.fragment,X)},m(X,pe){ze(e,X,pe),ce(X,o,pe),ze(l,X,pe),ce(X,f,pe),ze(c,X,pe),ce(X,w,pe),ze(M,X,pe),T=!0},p(X,[pe]){const Ee={};!t&&pe&1&&(t=!0,Ee.value=X[0].name,gi(()=>t=!1)),e.$set(Ee);const Pe={};pe&10&&(Pe.choices=Object.values(X[3].schemes).map(X[6])),!u&&pe&1&&(u=!0,Pe.value=X[0].scheme_reference,gi(()=>u=!1)),l.$set(Pe);const $e={};!y&&pe&1&&(y=!0,$e.value=X[0].likelihood,gi(()=>y=!1)),c.$set($e);const Ye={};!k&&pe&1&&(k=!0,Ye.value=X[0].description,gi(()=>k=!1)),M.$set(Ye)},i(X){T||(ae(e.$$.fragment,X),ae(l.$$.fragment,X),ae(c.$$.fragment,X),ae(M.$$.fragment,X),T=!0)},o(X){fe(e.$$.fragment,X),fe(l.$$.fragment,X),fe(c.$$.fragment,X),fe(M.$$.fragment,X),T=!1},d(X){X&&(ee(o),ee(f),ee(w)),Le(e,X),Le(l,X),Le(c,X),Le(M,X)}}}function XF(n,e,t){let o,l=Yt,u=()=>(l(),l=da(c,B=>t(3,o=B)),c);n.$$.on_destroy.push(()=>l());let{cfg:f}=e,{gjSchemes:c}=e;u();let{id:y}=e,{props:w}=e;function M(B){n.$$.not_equal(w.name,B)&&(w.name=B,t(0,w))}const k=B=>[B.scheme_reference,f.schemeName(B)];function T(B){n.$$.not_equal(w.scheme_reference,B)&&(w.scheme_reference=B,t(0,w))}function z(B){n.$$.not_equal(w.likelihood,B)&&(w.likelihood=B,t(0,w))}function F(B){n.$$.not_equal(w.description,B)&&(w.description=B,t(0,w))}return n.$$set=B=>{"cfg"in B&&t(1,f=B.cfg),"gjSchemes"in B&&u(t(2,c=B.gjSchemes)),"id"in B&&t(4,y=B.id),"props"in B&&t(0,w=B.props)},[w,f,c,o,y,M,k,T,z,F]}class JF extends Dt{constructor(e){super(),Ft(this,e,XF,WF,At,{cfg:1,gjSchemes:2,id:4,props:0})}}function KF(n){let e;return{c(){e=xt("Scheme details")},l(t){e=wt(t,"Scheme details")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function YF(n){let e;return{c(){e=xt("Save")},l(t){e=wt(t,"Save")},m(t,o){ce(t,e,o)},d(t){t&&ee(e)}}}function QF(n){let e,t,o,l,u;function f(y){n[6](y)}let c={label:"Scheme name",required:!0};return n[3].schemes[n[1]].scheme_name!==void 0&&(c.value=n[3].schemes[n[1]].scheme_name),e=new Yy({props:c}),Wr.push(()=>fi(e,"value",f)),l=new Fs({props:{$$slots:{default:[YF]},$$scope:{ctx:n}}}),l.$on("click",n[7]),{c(){Ae(e.$$.fragment),o=qe(),Ae(l.$$.fragment)},l(y){Fe(e.$$.fragment,y),o=Ge(y),Fe(l.$$.fragment,y)},m(y,w){ze(e,y,w),ce(y,o,w),ze(l,y,w),u=!0},p(y,w){const M={};!t&&w&10&&(t=!0,M.value=y[3].schemes[y[1]].scheme_name,gi(()=>t=!1)),e.$set(M);const k={};w&512&&(k.$$scope={dirty:w,ctx:y}),l.$set(k)},i(y){u||(ae(e.$$.fragment,y),ae(l.$$.fragment,y),u=!0)},o(y){fe(e.$$.fragment,y),fe(l.$$.fragment,y),u=!1},d(y){y&&ee(o),Le(e,y),Le(l,y)}}}function eR(n){let e,t,o,l,u,f,c;e=new Kr({props:{$$slots:{default:[KF]},$$scope:{ctx:n}}}),e.$on("click",n[5]);function y(M){n[8](M)}let w={title:"Scheme details",$$slots:{default:[QF]},$$scope:{ctx:n}};return n[2]!==void 0&&(w.open=n[2]),o=new j2({props:w}),Wr.push(()=>fi(o,"open",y)),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment)},l(M){Fe(e.$$.fragment,M),t=Ge(M),Fe(o.$$.fragment,M)},m(M,k){ze(e,M,k),ce(M,t,k),ze(o,M,k),u=!0,f||(c=fr(window,"keydown",n[4]),f=!0)},p(M,[k]){const T={};k&512&&(T.$$scope={dirty:k,ctx:M}),e.$set(T);const z={};k&526&&(z.$$scope={dirty:k,ctx:M}),!l&&k&4&&(l=!0,z.open=M[2],gi(()=>l=!1)),o.$set(z)},i(M){u||(ae(e.$$.fragment,M),ae(o.$$.fragment,M),u=!0)},o(M){fe(e.$$.fragment,M),fe(o.$$.fragment,M),u=!1},d(M){M&&ee(t),Le(e,M),Le(o,M),f=!1,c()}}}function tR(n,e,t){let o,l=Yt,u=()=>(l(),l=da(f,F=>t(3,o=F)),f);n.$$.on_destroy.push(()=>l());let{gjSchemes:f}=e;u();let{scheme_reference:c}=e,y=!1;function w(F){y&&F.key=="Escape"&&(F.stopPropagation(),t(2,y=!1))}const M=()=>t(2,y=!0);function k(F){n.$$.not_equal(o.schemes[c].scheme_name,F)&&(o.schemes[c].scheme_name=F,f.set(o))}const T=()=>t(2,y=!1);function z(F){y=F,t(2,y)}return n.$$set=F=>{"gjSchemes"in F&&u(t(0,f=F.gjSchemes)),"scheme_reference"in F&&t(1,c=F.scheme_reference)},[f,c,y,o,w,M,k,T,z]}class rR extends Dt{constructor(e){super(),Ft(this,e,tR,eR,At,{gjSchemes:0,scheme_reference:1})}}function iR(n){let e,t;return e=new dL({props:{cfg:n[3],gjSchemes:n[4]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function nR(n){let e,t;return e=new mD({props:{cfg:n[3],gjSchemes:n[4]}}),{c(){Ae(e.$$.fragment)},l(o){Fe(e.$$.fragment,o)},m(o,l){ze(e,o,l),t=!0},p:Yt,i(o){t||(ae(e.$$.fragment,o),t=!0)},o(o){fe(e.$$.fragment,o),t=!1},d(o){Le(e,o)}}}function oR(n){let e,t,o,l,u,f,c,y,w,M,k,T,z;e=new l5({props:{cfg:n[3],boundaryGeojson:n[2],fitBoundsAtStart:!0}}),o=new uz({props:{cfg:n[3],gjSchemes:n[4]}}),u=new Q3({props:{cfg:n[3]}});const F=[nR,iR],B=[];function G(J,j){return J[1].mode=="list"?0:J[1].mode=="split-route"?1:-1}return~(c=G(n))&&(y=B[c]=F[c](n)),M=new bz({props:{cfg:n[3]}}),T=new pz({props:{cfg:n[3]}}),{c(){Ae(e.$$.fragment),t=qe(),Ae(o.$$.fragment),l=qe(),Ae(u.$$.fragment),f=qe(),y&&y.c(),w=qe(),Ae(M.$$.fragment),k=qe(),Ae(T.$$.fragment)},l(J){Fe(e.$$.fragment,J),t=Ge(J),Fe(o.$$.fragment,J),l=Ge(J),Fe(u.$$.fragment,J),f=Ge(J),y&&y.l(J),w=Ge(J),Fe(M.$$.fragment,J),k=Ge(J),Fe(T.$$.fragment,J)},m(J,j){ze(e,J,j),ce(J,t,j),ze(o,J,j),ce(J,l,j),ze(u,J,j),ce(J,f,j),~c&&B[c].m(J,j),ce(J,w,j),ze(M,J,j),ce(J,k,j),ze(T,J,j),z=!0},p(J,j){let V=c;c=G(J),c===V?~c&&B[c].p(J,j):(y&&(vr(),fe(B[V],1,1,()=>{B[V]=null}),br()),~c?(y=B[c],y?y.p(J,j):(y=B[c]=F[c](J),y.c()),ae(y,1),y.m(w.parentNode,w)):y=null)},i(J){z||(ae(e.$$.fragment,J),ae(o.$$.fragment,J),ae(u.$$.fragment,J),ae(y),ae(M.$$.fragment,J),ae(T.$$.fragment,J),z=!0)},o(J){fe(e.$$.fragment,J),fe(o.$$.fragment,J),fe(u.$$.fragment,J),fe(y),fe(M.$$.fragment,J),fe(T.$$.fragment,J),z=!1},d(J){J&&(ee(t),ee(l),ee(f),ee(w),ee(k)),Le(e,J),Le(o,J),Le(u,J),~c&&B[c].d(J),Le(M,J),Le(T,J)}}}function sR(n){let e,t,o,l,u,f,c,y;o=new HF({props:{cfg:n[3],gjSchemes:n[4],routeSnapperUrl:aR}});function w(k){n[5](k)}let M={style:"https://api.maptiler.com/maps/dataviz/style.json?key="+U2,standardControls:!0,$$slots:{default:[oR]},$$scope:{ctx:n}};return n[0]!==void 0&&(M.map=n[0]),f=new LE({props:M}),Wr.push(()=>fi(f,"map",w)),f.$on("error",n[6]),{c(){e=et("div"),t=et("div"),Ae(o.$$.fragment),l=qe(),u=et("div"),Ae(f.$$.fragment),this.h()},l(k){e=tt(k,"DIV",{style:!0});var T=Lt(e);t=tt(T,"DIV",{class:!0});var z=Lt(t);Fe(o.$$.fragment,z),z.forEach(ee),l=Ge(T),u=tt(T,"DIV",{class:!0});var F=Lt(u);Fe(f.$$.fragment,F),F.forEach(ee),T.forEach(ee),this.h()},h(){Ke(t,"class","sidebar svelte-1j3l30i"),Ke(u,"class","map svelte-1j3l30i"),ki(e,"display","flex"),ki(e,"height","100vh")},m(k,T){ce(k,e,T),_t(e,t),ze(o,t,null),_t(e,l),_t(e,u),ze(f,u,null),y=!0},p(k,[T]){const z={};T&130&&(z.$$scope={dirty:T,ctx:k}),!c&&T&1&&(c=!0,z.map=k[0],gi(()=>c=!1)),f.$set(z)},i(k){y||(ae(o.$$.fragment,k),ae(f.$$.fragment,k),y=!0)},o(k){fe(o.$$.fragment,k),fe(f.$$.fragment,k),y=!1},d(k){k&&ee(e),Le(o),Le(f)}}}let U2="MZEJTanw3WpxRvt7qDfo",aR="https://atip.uk/route-snappers/v3/LAD_Adur.bin.gz";function lR(n,e,t){let o,l;bt(n,ro,M=>t(0,o=M)),bt(n,dr,M=>t(1,l=M));let u={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-.364623,50.874533],[-.371208,50.869793],[-.367479,50.860539],[-.369022,50.855288],[-.365441,50.846933],[-.358547,50.843541],[-.358369,50.830646],[-.349344,50.822407],[-.339007,50.822184],[-.330269,50.816102],[-.299725,50.823206],[-.280328,50.825936],[-.25188,50.825546],[-.237095,50.828265],[-.21626,50.826897],[-.215382,50.830533],[-.234361,50.851116],[-.239727,50.861896],[-.244998,50.863815],[-.248948,50.870547],[-.258962,50.871214],[-.256606,50.862342],[-.269032,50.863672],[-.287977,50.864159],[-.298485,50.866274],[-.311454,50.864779],[-.320283,50.865434],[-.339752,50.862547],[-.349058,50.865902],[-.364623,50.874533]]]},properties:{}},f={interventionName:M=>`some ${M.geometry.type} feature`,schemeName:M=>M.scheme_name,backfill:M=>M,initializeEmptyScheme:M=>{let k=M;return k.scheme_name="",k},interventionWarning:M=>null,editFeatureForm:JF,editSchemeForm:rR,newPointFeature:M=>{},newPolygonFeature:M=>{},newLineStringFeature:M=>{},updateFeature:(M,k)=>{},maptilerApiKey:U2,getStreetViewRoadLayerNames:M=>["Road network"],layerZorder:["interventions-polygons","interventions-polygons-outlines","hover-polygons","hover-lines","interventions-lines","interventions-lines-endpoints","hover-points","interventions-points","edit-polygon-fill","edit-polygon-lines","edit-polygon-vertices","draw-split-route","route-points","route-lines","route-polygons","road_label","boundary","georeferenced-image"]},c=Yr(Uw(f));function y(M){o=M,ro.set(o)}return[o,l,u,f,c,y,M=>{console.log(M.detail.error)}]}class vR extends Dt{constructor(e){super(),Ft(this,e,lR,sR,At,{})}}export{vR as component}; diff --git a/_app/version.json b/_app/version.json index fc09c07..5ce9b40 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1720962772715"} \ No newline at end of file +{"version":"1721133981029"} \ No newline at end of file diff --git a/assets/route_snapper_bg.wasm b/assets/route_snapper_bg.wasm index 69e4d243f2cae68be701f41d49df48153beecac7..8a754b7bffd497911bb3f9d42ad2599b5bea7122 100644 GIT binary patch literal 260285 zcmeFa51d`cRp)vCyno&Ab@!9hwq>>c)Vo%QOl;EnFByn+Mf^t?Ck9N$fZNWt0mh>VAx&M_Ph7itv{zuopb7(Q>W@i6SuxKj-n{OKl%0>lOspsBl?YQ zOpn-o9B!i$}!-ZI(+zWbYtD$hYF4yreNwz#E0TTR6-urG)r%kzv3II zs0~%i)i>$;1X%WX$UoXefcZyVlHVJ=IDOlWo6g(5{cSsL-n;9j$-UceJuq|g-kY}X zoqSsq>D`i^cl&lsP3}Cfeb>ysTei%oaV+xP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