diff --git a/assets/nested2-08b564c4.js b/assets/nested2-08b564c4.js new file mode 100644 index 000000000..2f4a02b41 --- /dev/null +++ b/assets/nested2-08b564c4.js @@ -0,0 +1,2 @@ +import{S as Ce,i as Oe,s as Fe,F as je,H as F,I as j,t as $,j as h,L as M,o as ne,e as T,a2 as Me,r as D,au as Ie,d as b,v as g,av as ie,l as Ne,k as w,y as Ae,at as ze,A as ee,p as C,w as Z,U as ue,M as Ee,a3 as Je,C as le,G as Te,q as L,am as ce,O as re,J as se,Q as me,N as Ge,D as _e,E as pe,K as ge,x as Pe}from"./maplibre_helpers-09c65b90.js";import{i as qe}from"./all-cc94300b.js";import{L as De,Z as He,C as Be,p as Ue,g as te,I as Ze,B as Ke,q as Qe,M as Re,m as Ve}from"./ZoomOutMap-bbe13584.js";function $e(r,e,t){const n=r.slice();return n[6]=e[t][0],n[7]=e[t][1],n}function de(r){let e;return{c(){e=T("option"),e.__value="",ee(e,e.__value)},m(t,n){b(t,e,n)},d(t){t&&w(e)}}}function he(r){let e,t=r[7]+"",n,l;return{c(){e=T("option"),n=C(t),e.__value=l=r[6],ee(e,e.__value)},m(s,u){b(s,e,u),g(e,n)},p(s,u){u&8&&t!==(t=s[7]+"")&&Z(n,t),u&8&&l!==(l=s[6])&&(e.__value=l,ee(e,e.__value))},d(s){s&&w(e)}}}function We(r){let e,t,n,l,s=r[4]&&de(),u=ne(r[3]),o=[];for(let f=0;fr[5].call(e))},m(f,a){b(f,e,a),s&&s.m(e,null),g(e,t);for(let i=0;i{"label"in a&&t(1,n=a.label),"id"in a&&t(2,l=a.id),"choices"in a&&t(3,s=a.choices),"emptyOption"in a&&t(4,u=a.emptyOption),"value"in a&&t(0,o=a.value)},[o,n,l,s,u,f]}class be extends Ce{constructor(e){super(),Oe(this,e,Ye,Xe,Fe,{label:1,id:2,choices:3,emptyOption:4,value:0})}}function we(r,e,t){const n=r.slice();return n[24]=e[t],n}function xe(r){let e;return{c(){e=C("Home")},m(t,n){b(t,e,n)},d(t){t&&w(e)}}}function ve(r){let e,t;return e=new Ge({props:{errorMessage:r[7]}}),{c(){F(e.$$.fragment)},m(n,l){j(e,n,l),t=!0},p(n,l){const s={};l&128&&(s.errorMessage=n[7]),e.$set(s)},i(n){t||($(e.$$.fragment,n),t=!0)},o(n){h(e.$$.fragment,n),t=!1},d(n){M(e,n)}}}function et(r){let e;return{c(){e=C("Clear")},m(t,n){b(t,e,n)},d(t){t&&w(e)}}}function tt(r){let e,t,n,l,s,u;return n=new le({props:{$$slots:{default:[et]},$$scope:{ctx:r}}}),n.$on("click",r[18]),{c(){e=T("input"),t=L(),F(n.$$.fragment),D(e,"type","text"),D(e,"class","govuk-input govuk-input--width-10"),D(e,"id","filterText")},m(o,f){b(o,e,f),ee(e,r[1]),b(o,t,f),j(n,o,f),l=!0,s||(u=Ne(e,"input",r[17]),s=!0)},p(o,f){f&2&&e.value!==o[1]&&ee(e,o[1]);const a={};f&134217728&&(a.$$scope={dirty:f,ctx:o}),n.$set(a)},i(o){l||($(n.$$.fragment,o),l=!0)},o(o){h(n.$$.fragment,o),l=!1},d(o){o&&(w(e),w(t)),M(n,o),s=!1,u()}}}function nt(r){let e,t,n,l,s,u,o,f;function a(c){r[15](c)}let i={label:"Authority or region",id:"filterAuthority",choices:r[8]};r[4]!==void 0&&(i.value=r[4]),e=new be({props:i}),_e.push(()=>pe(e,"value",a));function O(c){r[16](c)}let I={label:"Funding programme",id:"filterFundingProgramme",choices:r[9]};return r[5]!==void 0&&(I.value=r[5]),l=new be({props:I}),_e.push(()=>pe(l,"value",O)),o=new je({props:{label:"Any field",id:"filterText",$$slots:{default:[tt]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),n=L(),F(l.$$.fragment),u=L(),F(o.$$.fragment)},m(c,p){j(e,c,p),b(c,n,p),j(l,c,p),b(c,u,p),j(o,c,p),f=!0},p(c,p){const N={};p&256&&(N.choices=c[8]),!t&&p&16&&(t=!0,N.value=c[4],ge(()=>t=!1)),e.$set(N);const A={};p&512&&(A.choices=c[9]),!s&&p&32&&(s=!0,A.value=c[5],ge(()=>s=!1)),l.$set(A);const z={};p&134217730&&(z.$$scope={dirty:p,ctx:c}),o.$set(z)},i(c){f||($(e.$$.fragment,c),$(l.$$.fragment,c),$(o.$$.fragment,c),f=!0)},o(c){h(e.$$.fragment,c),h(l.$$.fragment,c),h(o.$$.fragment,c),f=!1},d(c){c&&(w(n),w(u)),M(e,c),M(l,c),M(o,c)}}}function ke(r){let e,t;return e=new Be({props:{label:`${r[24].scheme_reference}: ${r[24].num_features} features`,$$slots:{default:[st]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment)},m(n,l){j(e,n,l),t=!0},p(n,l){const s={};l&1&&(s.label=`${n[24].scheme_reference}: ${n[24].num_features} features`),l&134217729&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||($(e.$$.fragment,n),t=!0)},o(n){h(e.$$.fragment,n),t=!1},d(n){M(e,n)}}}function lt(r){let e;return{c(){e=C("Show on map")},m(t,n){b(t,e,n)},d(t){t&&w(e)}}}function rt(r){let e;return{c(){e=C("Edit scheme")},m(t,n){b(t,e,n)},d(t){t&&w(e)}}}function st(r){let e,t,n=r[24].authority_or_region+"",l,s,u,o,f=r[24].capital_scheme_id+"",a,i,O,I,c=r[24].funding_programme+"",p,N,A,z,K,E,H,G;function Q(){return r[19](r[24])}z=new le({props:{$$slots:{default:[lt]},$$scope:{ctx:r}}}),z.$on("click",Q);function V(){return r[20](r[24])}return E=new le({props:{$$slots:{default:[rt]},$$scope:{ctx:r}}}),E.$on("click",V),{c(){e=T("p"),t=C("Authority or region: "),l=C(n),s=L(),u=T("p"),o=C("Capital scheme ID: "),a=C(f),i=L(),O=T("p"),I=C("Funding programme: "),p=C(c),N=L(),A=T("div"),F(z.$$.fragment),K=L(),F(E.$$.fragment),H=L(),D(A,"class","govuk-button-group")},m(k,y){b(k,e,y),g(e,t),g(e,l),b(k,s,y),b(k,u,y),g(u,o),g(u,a),b(k,i,y),b(k,O,y),g(O,I),g(O,p),b(k,N,y),b(k,A,y),j(z,A,null),g(A,K),j(E,A,null),b(k,H,y),G=!0},p(k,y){r=k,(!G||y&1)&&n!==(n=r[24].authority_or_region+"")&&Z(l,n),(!G||y&1)&&f!==(f=r[24].capital_scheme_id+"")&&Z(a,f),(!G||y&1)&&c!==(c=r[24].funding_programme+"")&&Z(p,c);const R={};y&134217728&&(R.$$scope={dirty:y,ctx:r}),z.$set(R);const _={};y&134217728&&(_.$$scope={dirty:y,ctx:r}),E.$set(_)},i(k){G||($(z.$$.fragment,k),$(E.$$.fragment,k),G=!0)},o(k){h(z.$$.fragment,k),h(E.$$.fragment,k),G=!1},d(k){k&&(w(e),w(s),w(u),w(i),w(O),w(N),w(A),w(H)),M(z),M(E)}}}function ye(r){let e=r[2].has(r[24].scheme_reference),t,n,l=e&&ke(r);return{c(){l&&l.c(),t=Me()},m(s,u){l&&l.m(s,u),b(s,t,u),n=!0},p(s,u){u&5&&(e=s[2].has(s[24].scheme_reference)),e?l?(l.p(s,u),u&5&&$(l,1)):(l=ke(s),l.c(),$(l,1),l.m(t.parentNode,t)):l&&(re(),h(l,1,1,()=>{l=null}),se())},i(s){n||($(l),n=!0)},o(s){h(l),n=!1},d(s){s&&w(t),l&&l.d(s)}}}function ot(r){let e,t,n,l,s,u,o,f,a,i,O,I,c,p,N,A=r[2].size+"",z,K,E=r[3].route+"",H,G,Q=r[3].area+"",V,k,y=r[3].crossing+"",R,_,d=r[3].other+"",q,W,P,x,U;t=new le({props:{$$slots:{default:[xe]},$$scope:{ctx:r}}}),t.$on("click",r[14]),o=new He({props:{boundaryGeojson:r[6]}});let B=r[7]&&ve(r);i=new Te({props:{label:"Load from GeoJSON",id:"load-geojson",loadFile:r[11]}}),I=new Be({props:{label:"Filters",$$slots:{default:[nt]},$$scope:{ctx:r}}});let X=ne(r[0]),S=[];for(let m=0;mh(S[m],1,1,()=>{S[m]=null});return{c(){e=T("div"),F(t.$$.fragment),n=L(),l=T("div"),s=T("h1"),s.textContent="Browse schemes",u=L(),F(o.$$.fragment),f=L(),B&&B.c(),a=L(),F(i.$$.fragment),O=L(),F(I.$$.fragment),c=L(),p=T("p"),N=C("Showing "),z=C(A),K=C(" schemes ("),H=C(E),G=C(" routes, "),V=C(Q),k=C(` areas, + `),R=C(y),_=C(" crossings, "),q=C(d),W=C(" other)"),P=L(),x=T("ul");for(let m=0;m{B=null}),se());const ae={};if(v&134218546&&(ae.$$scope={dirty:v,ctx:m}),I.$set(ae),(!U||v&4)&&A!==(A=m[2].size+"")&&Z(z,A),(!U||v&8)&&E!==(E=m[3].route+"")&&Z(H,E),(!U||v&8)&&Q!==(Q=m[3].area+"")&&Z(V,Q),(!U||v&8)&&y!==(y=m[3].crossing+"")&&Z(R,y),(!U||v&8)&&d!==(d=m[3].other+"")&&Z(q,d),v&12293){X=ne(m[0]);let J;for(J=0;J${t}${n}`;return e+="",e}function ct(r,e,t){let n,l;ue(r,te,_=>t(6,n=_)),ue(r,Ve,_=>t(21,l=_)),Ee(()=>{qe()});let u=new URLSearchParams(window.location.search).get("style")||"streets",o="",f=[],a="",i=new Set,O={area:0,route:0,crossing:0,other:0},I=[],c="",p=[],N="";Je(()=>{te.set(null)});function A(_){try{let d=JSON.parse(_);te.set(d),z(d),t(7,o=""),l==null||l.fitBounds(me(d),{padding:20,animate:!1})}catch(d){t(7,o=`Couldn't load schemes from a file: ${d}`)}}function z(_){let d={};for(let[P,x]of Object.entries(_.schemes))d[P]={scheme_reference:P,num_features:0,...x};for(let P of _.features)d[P.properties.scheme_reference].num_features++;t(0,f=Object.values(d));let q=new Set,W=new Set;for(let P of f)P.authority_or_region&&q.add(P.authority_or_region),P.funding_programme&&W.add(P.funding_programme);t(8,I=Array.from(q.entries())),I.sort(),t(9,p=Array.from(W.entries())),p.sort()}function K(_){let d={type:"FeatureCollection",features:n.features.filter(q=>q.properties.scheme_reference==_.scheme_reference)};l==null||l.fitBounds(me(d),{padding:20,animate:!1})}function E(_){let d={type:"FeatureCollection",features:n.features.filter(W=>W.properties.scheme_reference==_.scheme_reference)},q=_.authority_or_region;window.localStorage.setItem(q,JSON.stringify(d)),window.open(`scheme.html?authority=${_.authority_or_region}`,"_blank")}const H=()=>window.open("index.html");function G(_){c=_,t(4,c)}function Q(_){N=_,t(5,N)}function V(){a=this.value,t(1,a)}const k=()=>t(1,a=""),y=_=>K(_),R=_=>E(_);return r.$$.update=()=>{if(r.$$.dirty&127&&n){if(i.clear(),a||c||N){let _=a.toLowerCase();for(let d of n.features)JSON.stringify(d.properties).toLowerCase().includes(_)&&(c&&d.properties.authority_or_region!=c||N&&d.properties.funding_programme!=N||i.add(d.properties.scheme_reference))}else for(let _ of f)i.add(_.scheme_reference);te.update(_=>{if(!_)return null;for(let d of _.features)i.has(d.properties.scheme_reference)?delete d.properties.hide_while_editing:d.properties.hide_while_editing=!0;return _}),t(3,O={area:0,route:0,crossing:0,other:0});for(let _ of n==null?void 0:n.features)i.has(_.properties.scheme_reference)&&t(3,O[_.properties.intervention_type]++,O);t(2,i),t(6,n),t(1,a),t(4,c),t(5,N),t(0,f),t(3,O)}},[f,a,i,O,c,N,n,o,I,p,u,A,K,E,H,G,Q,V,k,y,R]}class mt extends Ce{constructor(e){super(),Oe(this,e,ct,it,Fe,{})}}document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";new mt({target:document.getElementById("app")}); diff --git a/browse.html b/browse.html index 0caf1bfc5..720838233 100644 --- a/browse.html +++ b/browse.html @@ -7,7 +7,7 @@ content="initial-scale=1,maximum-scale=1,user-scalable=no" /> ATIP v2 scheme browser - + diff --git a/browse_dropdown_filters/assets/About-563eb94d.js b/browse_dropdown_filters/assets/About-563eb94d.js deleted file mode 100644 index af182f10c..000000000 --- a/browse_dropdown_filters/assets/About-563eb94d.js +++ /dev/null @@ -1,15 +0,0 @@ -import{S as F,i as N,s as Q,c as Ce,e as g,r as j,d as k,u as Ae,g as Ie,f as Me,t as m,j as d,k as b,p as c,q as E,aj as we,aB as X,v as a,l as ve,aE as Te,w as Ee,ak as je,al as Pe,B as Se,C as We,H as C,I as A,K as I,D as Le,E as Re,J as Ue}from"./maplibre_helpers-5d84afaa.js";const st="/atip/browse_dropdown_filters/assets/authorities-80e824dc.geojson";function qe(l){let e,t;const n=l[2].default,s=Ce(n,l,l[1],null);return{c(){e=g("a"),s&&s.c(),j(e,"href",l[0]),j(e,"target","_blank"),j(e,"rel","noreferrer")},m(o,i){k(o,e,i),s&&s.m(e,null),t=!0},p(o,[i]){s&&s.p&&(!t||i&2)&&Ae(s,n,o,o[1],t?Me(n,o[1],i,null):Ie(o[1]),null),(!t||i&1)&&j(e,"href",o[0])},i(o){t||(m(s,o),t=!0)},o(o){d(s,o),t=!1},d(o){o&&b(e),s&&s.d(o)}}}function De(l,e,t){let{$$slots:n={},$$scope:s}=e,{href:o}=e;return l.$$set=i=>{"href"in i&&t(0,o=i.href),"$$scope"in i&&t(1,s=i.$$scope)},[o,s,n]}class T extends F{constructor(e){super(),N(this,e,De,qe,Q,{href:0})}}function Be(l){let e,t;return e=new We({props:{$$slots:{default:[Ge]},$$scope:{ctx:l}}}),e.$on("click",l[5]),{c(){C(e.$$.fragment)},m(n,s){A(e,n,s),t=!0},p(n,s){const o={};s&128&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){t||(m(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){I(e,n)}}}function Ge(l){let e;return{c(){e=c("X")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function He(l){let e,t,n,s,o,i,_,$,w,P,f=l[2]&&Be(l);const M=l[4].default,h=Ce(M,l,l[7],null);return{c(){e=g("div"),t=g("div"),n=g("div"),s=g("h1"),o=c(l[1]),i=E(),f&&f.c(),_=E(),h&&h.c(),j(s,"class","govuk-heading-l"),we(n,"display","flex"),we(n,"justify-content","space-between"),j(t,"class","content centered-fullscreen svelte-stcgp5"),j(e,"class","background svelte-stcgp5"),X(e,"open",l[0]),X(e,"closed",!l[0])},m(u,B){k(u,e,B),a(e,t),a(t,n),a(n,s),a(s,o),a(n,i),f&&f.m(n,null),a(t,_),h&&h.m(t,null),$=!0,w||(P=[ve(t,"click",Te(Je)),ve(e,"click",l[6])],w=!0)},p(u,[B]){(!$||B&2)&&Ee(o,u[1]),u[2]?f?(f.p(u,B),B&4&&m(f,1)):(f=Be(u),f.c(),m(f,1),f.m(n,null)):f&&(je(),d(f,1,1,()=>{f=null}),Pe()),h&&h.p&&(!$||B&128)&&Ae(h,M,u,u[7],$?Me(M,u[7],B,null):Ie(u[7]),null),(!$||B&1)&&X(e,"open",u[0]),(!$||B&1)&&X(e,"closed",!u[0])},i(u){$||(m(f),m(h,u),$=!0)},o(u){d(f),d(h,u),$=!1},d(u){u&&b(e),f&&f.d(),h&&h.d(u),w=!1,Se(P)}}}const Je=()=>null;function Xe(l,e,t){let{$$slots:n={},$$scope:s}=e,{title:o}=e,{open:i=!1}=e,{displayEscapeButton:_=!0}=e,{canCloseByClickingBackground:$=!0}=e;const w=()=>t(0,i=!1),P=()=>{$&&t(0,i=!1)};return l.$$set=f=>{"title"in f&&t(1,o=f.title),"open"in f&&t(0,i=f.open),"displayEscapeButton"in f&&t(2,_=f.displayEscapeButton),"canCloseByClickingBackground"in f&&t(3,$=f.canCloseByClickingBackground),"$$scope"in f&&t(7,s=f.$$scope)},[i,o,_,$,n,w,P,s]}class ze extends F{constructor(e){super(),N(this,e,Xe,He,Q,{title:1,open:0,displayEscapeButton:2,canCloseByClickingBackground:3})}}function Ke(l){let e;return{c(){e=c("open source project")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Oe(l){let e;return{c(){e=c("Dustin Carlino")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Fe(l){let e;return{c(){e=c("Madison Wang")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ne(l){let e;return{c(){e=c("Ben Ritter")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Qe(l){let e;return{c(){e=c("OpenStreetMap")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ve(l){let e;return{c(){e=c("MapLibre")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ye(l){let e;return{c(){e=c("GeoRust")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ze(l){let e;return{c(){e=c("osm2streets")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function xe(l){let e;return{c(){e=c("Material icons")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function ye(l){let e;return{c(){e=c("start an issue on Github")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function et(l){let e,t,n,s,o,i,_,$,w,P,f,M,h,u,B,S,V,z,Y,v,Z,W,x,L,y,R,ee,U,te,q,ne,le,D,se,G,ae,H,oe,re,ie,fe,K,ue,O,J;return s=new T({props:{href:"https://github.com/acteng/atip",$$slots:{default:[Ke]},$$scope:{ctx:l}}}),w=new T({props:{href:"https://www.turing.ac.uk/people/researchers/dustin-carlino",$$slots:{default:[Oe]},$$scope:{ctx:l}}}),u=new T({props:{href:"https://www.linkedin.com/in/madison-wang-841977bb/",$$slots:{default:[Fe]},$$scope:{ctx:l}}}),S=new T({props:{href:"https://github.com/BudgieInWA",$$slots:{default:[Ne]},$$scope:{ctx:l}}}),W=new T({props:{href:"https://www.openstreetmap.org/about",$$slots:{default:[Qe]},$$scope:{ctx:l}}}),L=new T({props:{href:"https://maplibre.org/",$$slots:{default:[Ve]},$$scope:{ctx:l}}}),R=new T({props:{href:"https://georust.org/",$$slots:{default:[Ye]},$$scope:{ctx:l}}}),U=new T({props:{href:"https://github.com/a-b-street/osm2streets",$$slots:{default:[Ze]},$$scope:{ctx:l}}}),q=new T({props:{href:"https://material.io/resources/icons/",$$slots:{default:[xe]},$$scope:{ctx:l}}}),G=new T({props:{href:"https://github.com/acteng/atip/issues/new",$$slots:{default:[ye]},$$scope:{ctx:l}}}),{c(){e=g("div"),t=g("p"),n=c(`ATIP v2 is an - `),C(s.$$.fragment),o=c(" supported by Active Travel England and developed by:"),i=E(),_=g("ul"),$=g("li"),C(w.$$.fragment),P=c(": lead developer, from The Alan Turing Institute"),f=E(),M=g("li"),h=c(`With UX help from - `),C(u.$$.fragment),B=c(` and CSS help from - `),C(S.$$.fragment),V=E(),z=g("li"),z.textContent=`With great thanks to ATIP's various users for feedback, testing, and - ideas`,Y=E(),v=g("p"),Z=c(`ATIP builds on - `),C(W.$$.fragment),x=c(` - contributors, - `),C(L.$$.fragment),y=c(`, - `),C(R.$$.fragment),ee=c(`, - `),C(U.$$.fragment),te=c(`, - `),C(q.$$.fragment),ne=c(", and other open source projects."),le=E(),D=g("p"),se=c("We want your feedback about ATIP! Please "),C(G.$$.fragment),ae=c(` - or email - `),H=g("a"),H.textContent="dcarlino@turing.ac.uk",oe=c("."),re=E(),ie=g("hr"),fe=E(),K=g("h2"),K.textContent="Recent changes",ue=E(),O=g("ul"),O.innerHTML=`
  • v2 launched on 2 June 2023. Changes: a complete UI rewrite, new draw - tools, drawing areas snapped to roads, splitting routes, multiple data schemas, - speed limit layer, lane visualization layer
  • v1 launched in March 2023
  • `,j(H,"href","mailto: dcarlino@turing.ac.uk"),j(e,"class","govuk-prose")},m(r,p){k(r,e,p),a(e,t),a(t,n),A(s,t,null),a(t,o),a(e,i),a(e,_),a(_,$),A(w,$,null),a($,P),a(_,f),a(_,M),a(M,h),A(u,M,null),a(M,B),A(S,M,null),a(_,V),a(_,z),a(e,Y),a(e,v),a(v,Z),A(W,v,null),a(v,x),A(L,v,null),a(v,y),A(R,v,null),a(v,ee),A(U,v,null),a(v,te),A(q,v,null),a(v,ne),a(e,le),a(e,D),a(D,se),A(G,D,null),a(D,ae),a(D,H),a(D,oe),a(e,re),a(e,ie),a(e,fe),a(e,K),a(e,ue),a(e,O),J=!0},p(r,p){const ce={};p&4&&(ce.$$scope={dirty:p,ctx:r}),s.$set(ce);const $e={};p&4&&($e.$$scope={dirty:p,ctx:r}),w.$set($e);const pe={};p&4&&(pe.$$scope={dirty:p,ctx:r}),u.$set(pe);const _e={};p&4&&(_e.$$scope={dirty:p,ctx:r}),S.$set(_e);const ge={};p&4&&(ge.$$scope={dirty:p,ctx:r}),W.$set(ge);const me={};p&4&&(me.$$scope={dirty:p,ctx:r}),L.$set(me);const de={};p&4&&(de.$$scope={dirty:p,ctx:r}),R.$set(de);const he={};p&4&&(he.$$scope={dirty:p,ctx:r}),U.$set(he);const ke={};p&4&&(ke.$$scope={dirty:p,ctx:r}),q.$set(ke);const be={};p&4&&(be.$$scope={dirty:p,ctx:r}),G.$set(be)},i(r){J||(m(s.$$.fragment,r),m(w.$$.fragment,r),m(u.$$.fragment,r),m(S.$$.fragment,r),m(W.$$.fragment,r),m(L.$$.fragment,r),m(R.$$.fragment,r),m(U.$$.fragment,r),m(q.$$.fragment,r),m(G.$$.fragment,r),J=!0)},o(r){d(s.$$.fragment,r),d(w.$$.fragment,r),d(u.$$.fragment,r),d(S.$$.fragment,r),d(W.$$.fragment,r),d(L.$$.fragment,r),d(R.$$.fragment,r),d(U.$$.fragment,r),d(q.$$.fragment,r),d(G.$$.fragment,r),J=!1},d(r){r&&b(e),I(s),I(w),I(u),I(S),I(W),I(L),I(R),I(U),I(q),I(G)}}}function tt(l){let e,t,n;function s(i){l[1](i)}let o={title:"About the Active Travel Infrastructure Platform",$$slots:{default:[et]},$$scope:{ctx:l}};return l[0]!==void 0&&(o.open=l[0]),e=new ze({props:o}),Le.push(()=>Re(e,"open",s)),{c(){C(e.$$.fragment)},m(i,_){A(e,i,_),n=!0},p(i,[_]){const $={};_&4&&($.$$scope={dirty:_,ctx:i}),!t&&_&1&&(t=!0,$.open=i[0],Ue(()=>t=!1)),e.$set($)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){d(e.$$.fragment,i),n=!1},d(i){I(e,i)}}}function nt(l,e,t){let{open:n}=e;function s(o){n=o,t(0,n)}return l.$$set=o=>{"open"in o&&t(0,n=o.open)},[n,s]}class at extends F{constructor(e){super(),N(this,e,nt,tt,Q,{open:0})}}export{at as A,ze as M,st as a}; diff --git a/browse_dropdown_filters/assets/ZoomOutMap-96dffba9.js b/browse_dropdown_filters/assets/ZoomOutMap-96dffba9.js deleted file mode 100644 index 931f99189..000000000 --- a/browse_dropdown_filters/assets/ZoomOutMap-96dffba9.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as j,i as T,s as B,e as d,p as C,A as J,at as oe,r as _,d as b,v as p,au as A,l as Z,x as O,k as v,B as ae,as as ie,X as re,c as R,q as $,aF as H,u as q,g as F,f as G,t as I,j as D,Q as N,T as ce,W as U,V as K,U as ue,_ as fe,Z as de,Y as Q,w as pe,M as P,a0 as ee,H as te,I as se,K as ne,aj as M,ak as me,al as _e,aG as ge,L as be,D as ve,C as ye,ar as he,N as we}from"./maplibre_helpers-5d84afaa.js";function ke(n){let e,l,t,s,o,a,c;return{c(){e=d("div"),l=C(`Basemap: - `),t=d("select"),s=d("option"),s.textContent="Streets",o=d("option"),o.textContent="Satellite",s.__value="streets",J(s,s.__value),o.__value="hybrid",J(o,o.__value),n[0]===void 0&&oe(()=>n[2].call(t)),_(e,"class","svelte-1tbnm6i")},m(f,i){b(f,e,i),p(e,l),p(e,t),p(t,s),p(t,o),A(t,n[0],!0),a||(c=[Z(t,"change",n[2]),Z(t,"change",n[1])],a=!0)},p(f,[i]){i&1&&A(t,f[0])},i:O,o:O,d(f){f&&v(e),a=!1,ae(c)}}}function Se(n,e,l){let{style:t}=e;function s(){let a=new URLSearchParams(window.location.search);a.set("style",t);let c=`${window.location.pathname}?${a.toString()}${window.location.hash}`;window.location.href=c}function o(){t=ie(this),l(0,t)}return n.$$set=a=>{"style"in a&&l(0,t=a.style)},[t,s,o]}class xe extends j{constructor(e){super(),T(this,e,Se,ke,B,{style:0})}}const E=[];function L(n,e=O){let l;const t=new Set;function s(c){if(B(n,c)&&(n=c,l)){const f=!E.length;for(const i of t)i[1](),E.push(i,n);if(f){for(let i=0;i{t.delete(i),t.size===0&&l&&(l(),l=null)}}return{set:s,update:o,subscribe:a}}function Ce(n){return n=="google"||n=="bing"}function et(n){return{v1:"Scheme Design",v2:"Experimental Scheme Design",planning:"Development Planning",criticals:"Critical Issues",atf4:"ATF4 Scheme"}[n]}const V=L(null),tt=L(null),le=L(re()),Le=L(null),$e=L(null),Ie=L(null),Be=L(null),Me=L(Oe());Me.subscribe(n=>window.localStorage.setItem("userSettings",JSON.stringify(n)));const st=L("edit-attribute"),nt=L(!1);function lt(n){let e=new Set;for(let t of n.features)e.add(t.id);let l=e.size+1;for(;e.has(l);)l++;return l}function ot(n){console.log(`Deleting intervention ${n}`),le.update(e=>(e.features=e.features.filter(l=>l.id!=n),e)),Le.set(null),$e.set(null),Ie.set(null),Be.set(null)}function Oe(){let n={streetViewImagery:"google",avoidDoublingBack:!1};try{let e=JSON.parse(window.localStorage.getItem("userSettings")||"{}");Ce(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}const De=n=>({}),X=n=>({}),je=n=>({}),Y=n=>({});function Te(n){let e,l,t,s,o,a,c,f,i,r,y;const h=n[3].sidebar,m=R(h,n,n[2],Y),S=n[3].main,w=R(S,n,n[2],X);return{c(){e=d("div"),l=d("aside"),t=d("div"),m&&m.c(),s=$(),o=d("button"),o.textContent="→",c=$(),f=d("main"),w&&w.c(),_(t,"class","sidebar-content content-container svelte-ect12w"),_(o,"type","button"),_(o,"class","sidebar-toggle rounded-rect svelte-ect12w"),_(l,"class",a=H(n[0]?"":"collapsed")+" svelte-ect12w"),_(f,"class","svelte-ect12w"),_(e,"class","overall-layout svelte-ect12w")},m(u,g){b(u,e,g),p(e,l),p(l,t),m&&m.m(t,null),p(l,s),p(l,o),p(e,c),p(e,f),w&&w.m(f,null),i=!0,r||(y=Z(o,"click",n[1]),r=!0)},p(u,[g]){m&&m.p&&(!i||g&4)&&q(m,h,u,u[2],i?G(h,u[2],g,je):F(u[2]),Y),(!i||g&1&&a!==(a=H(u[0]?"":"collapsed")+" svelte-ect12w"))&&_(l,"class",a),w&&w.p&&(!i||g&4)&&q(w,S,u,u[2],i?G(S,u[2],g,De):F(u[2]),X)},i(u){i||(I(m,u),I(w,u),i=!0)},o(u){D(m,u),D(w,u),i=!1},d(u){u&&v(e),m&&m.d(u),w&&w.d(u),r=!1,y()}}}function ze(n,e,l){let{$$slots:t={},$$scope:s}=e,o=!0;function a(){l(0,o=!o)}return n.$$set=c=>{"$$scope"in c&&l(2,s=c.$$scope)},[o,a,s,t]}class at extends j{constructor(e){super(),T(this,e,ze,Te,B,{})}}const k={area:"#D94324",route:"#555F5E",crossing:"#4daf4a",other:"#984ea3",preapp:"#e41a1c",outline:"#377eb8","reserved matters":"#4daf4a","local plan":"#984ea3",hovering:"black",lineEndpointColor:"black"},Ee=10,W=10;let z="interventions";function Pe(n,e,l){let t,s;N(n,V,r=>l(1,t=r)),N(n,le,r=>l(2,s=r));let{schema:o}=e;ce(t,z,s);const a=["match",["get","intervention_type"],"area",k.area,"route",k.route,"crossing",k.crossing,"other",k.other,"white"],c=["match",["get","reference_type",["get","planning"]],"preapp",k.preapp,"outline",k.outline,"reserved matters",k["reserved matters"],"local plan",k["local plan"],"white"],f=["!=","hide_while_editing",!0];return U(t,{id:"interventions-points",source:z,filter:["all",fe,f,["!=","endpoint",!0]],color:a,radius:Ee}),K(t,{id:"interventions-lines",source:z,filter:["all",de,f],color:a,width:W}),U(t,{id:"interventions-lines-endpoints",source:z,filter:["==","endpoint",!0],radius:.5*W,opacity:0,strokeColor:k.lineEndpointColor,strokeWidth:2}),ue(t,{id:"interventions-polygons",source:z,filter:["all",Q,f],color:o=="planning"?c:a,opacity:.2}),K(t,{id:"interventions-polygon-outlines",source:z,filter:["all",Q,f],color:o=="planning"?c:a,opacity:.5,width:.7*W}),n.$$set=r=>{"schema"in r&&l(0,o=r.schema)},n.$$.update=()=>{if(n.$$.dirty&6){let r=JSON.parse(JSON.stringify(s)),y=[];for(let h of r.features)if(h.geometry.type=="LineString"&&!h.properties.hide_while_editing)for(let m of[h.geometry.coordinates[0],h.geometry.coordinates[h.geometry.coordinates.length-1]])y.push({type:"Feature",properties:{endpoint:!0},geometry:{type:"Point",coordinates:m}});r.features=r.features.concat(y),t.getSource(z).setData(r)}},[o,t,s]}class it extends j{constructor(e){super(),T(this,e,Pe,null,B,{schema:0})}}function Re(n){let e,l,t,s,o,a,c;const f=n[3].default,i=R(f,n,n[2],null);return{c(){e=d("details"),l=d("summary"),t=d("span"),s=C(n[0]),o=$(),a=d("div"),i&&i.c(),_(t,"class","govuk-details__summary-text"),_(l,"class","govuk-details__summary"),_(a,"class","govuk-details__text"),e.open=n[1],_(e,"class","govuk-details"),_(e,"data-module","govuk-details")},m(r,y){b(r,e,y),p(e,l),p(l,t),p(t,s),p(e,o),p(e,a),i&&i.m(a,null),c=!0},p(r,[y]){(!c||y&1)&&pe(s,r[0]),i&&i.p&&(!c||y&4)&&q(i,f,r,r[2],c?G(f,r[2],y,null):F(r[2]),null),(!c||y&2)&&(e.open=r[1])},i(r){c||(I(i,r),c=!0)},o(r){D(i,r),c=!1},d(r){r&&v(e),i&&i.d(r)}}}function qe(n,e,l){let{$$slots:t={},$$scope:s}=e,{label:o}=e,{open:a=!1}=e;return n.$$set=c=>{"label"in c&&l(0,o=c.label),"open"in c&&l(1,a=c.open),"$$scope"in c&&l(2,s=c.$$scope)},[o,a,s,t]}class Fe extends j{constructor(e){super(),T(this,e,qe,Re,B,{label:0,open:1})}}function Ge(n,e,l){let t;N(n,V,i=>l(2,t=i));let{layers:s}=e,{contents:o}=e,a=new P.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none"});t.on("mousemove",c),t.on("mouseout",f),ee(()=>{t.off("mousemove",c),t.off("mouseout",f),a.remove()});function c(i){if(!s.every(y=>t.getLayer(y))){a.remove();return}let r=t.queryRenderedFeatures(i.point,{layers:s});r.length>0?a.setLngLat(i.lngLat).setHTML(o(r[0].properties)).addTo(t):a.remove()}function f(){a.remove()}return n.$$set=i=>{"layers"in i&&l(0,s=i.layers),"contents"in i&&l(1,o=i.contents)},[s,o]}class rt extends j{constructor(e){super(),T(this,e,Ge,null,B,{layers:0,contents:1})}}function Ne(n){let e,l,t,s,o,a,c,f,i,r,y,h,m,S,w;return{c(){e=d("li"),l=d("span"),t=C("Areas"),s=$(),o=d("li"),a=d("span"),c=C("Routes"),f=$(),i=d("li"),r=d("span"),y=C("Crossings"),h=$(),m=d("li"),S=d("span"),w=C("Other"),_(l,"class","svelte-l42ea0"),M(l,"background",k.area),_(a,"class","svelte-l42ea0"),M(a,"background",k.route),_(r,"class","svelte-l42ea0"),M(r,"background",k.crossing),_(S,"class","svelte-l42ea0"),M(S,"background",k.other)},m(u,g){b(u,e,g),p(e,l),p(e,t),b(u,s,g),b(u,o,g),p(o,a),p(o,c),b(u,f,g),b(u,i,g),p(i,r),p(i,y),b(u,h,g),b(u,m,g),p(m,S),p(m,w)},p:O,d(u){u&&(v(e),v(s),v(o),v(f),v(i),v(h),v(m))}}}function Ve(n){let e,l,t,s,o,a,c,f,i,r,y,h,m,S,w;return{c(){e=d("li"),l=d("span"),t=C("Preapp"),s=$(),o=d("li"),a=d("span"),c=C("Outline"),f=$(),i=d("li"),r=d("span"),y=C("Reserved matters"),h=$(),m=d("li"),S=d("span"),w=C("Local plan"),_(l,"class","svelte-l42ea0"),M(l,"background",k.preapp),_(a,"class","svelte-l42ea0"),M(a,"background",k.outline),_(r,"class","svelte-l42ea0"),M(r,"background",k["reserved matters"]),_(S,"class","svelte-l42ea0"),M(S,"background",k["local plan"])},m(u,g){b(u,e,g),p(e,l),p(e,t),b(u,s,g),b(u,o,g),p(o,a),p(o,c),b(u,f,g),b(u,i,g),p(i,r),p(i,y),b(u,h,g),b(u,m,g),p(m,S),p(m,w)},p:O,d(u){u&&(v(e),v(s),v(o),v(f),v(i),v(h),v(m))}}}function We(n){let e;function l(o,a){return o[0]=="planning"?Ve:Ne}let t=l(n),s=t(n);return{c(){e=d("ul"),s.c()},m(o,a){b(o,e,a),s.m(e,null)},p(o,a){t===(t=l(o))&&s?s.p(o,a):(s.d(1),s=t(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function Ze(n){let e,l,t;return l=new Fe({props:{label:"Objects",open:!0,$$slots:{default:[We]},$$scope:{ctx:n}}}),{c(){e=d("div"),te(l.$$.fragment),_(e,"class","svelte-l42ea0")},m(s,o){b(s,e,o),se(l,e,null),t=!0},p(s,[o]){const a={};o&3&&(a.$$scope={dirty:o,ctx:s}),l.$set(a)},i(s){t||(I(l.$$.fragment,s),t=!0)},o(s){D(l.$$.fragment,s),t=!1},d(s){s&&v(e),ne(l)}}}function Je(n,e,l){let{schema:t}=e;return n.$$set=s=>{"schema"in s&&l(0,t=s.schema)},[t]}class ct extends j{constructor(e){super(),T(this,e,Je,Ze,B,{schema:0})}}function x(n){let e;const l=n[4].default,t=R(l,n,n[3],null);return{c(){t&&t.c()},m(s,o){t&&t.m(s,o),e=!0},p(s,o){t&&t.p&&(!e||o&8)&&q(t,l,s,s[3],e?G(l,s[3],o,null):F(s[3]),null)},i(s){e||(I(t,s),e=!0)},o(s){D(t,s),e=!1},d(s){t&&t.d(s)}}}function Ae(n){let e,l,t=n[1]&&x(n);return{c(){e=d("div"),t&&t.c(),_(e,"class","map svelte-12dpf1u")},m(s,o){b(s,e,o),t&&t.m(e,null),n[5](e),l=!0},p(s,[o]){s[1]?t?(t.p(s,o),o&2&&I(t,1)):(t=x(s),t.c(),I(t,1),t.m(e,null)):t&&(me(),D(t,1,1,()=>{t=null}),_e())},i(s){l||(I(t),l=!0)},o(s){D(t),l=!1},d(s){s&&v(e),t&&t.d(),n[5](null)}}}function He(n,e,l){let{$$slots:t={},$$scope:s}=e,{style:o}=e,a,c,f=!1;ge("setCamera",!window.location.hash),be(()=>{a=new P.Map({container:c,style:`https://api.maptiler.com/maps/${o}/style.json?key=MZEJTanw3WpxRvt7qDfo`,hash:!0}),a.addControl(new P.ScaleControl({})),a.addControl(new P.NavigationControl({visualizePitch:!0}),"bottom-right"),a.on("load",()=>{l(1,f=!0),V.set(a)}),new ResizeObserver(()=>{a.resize()}).observe(c)}),ee(()=>{a.remove()});function i(r){ve[r?"unshift":"push"](()=>{c=r,l(0,c)})}return n.$$set=r=>{"style"in r&&l(2,o=r.style),"$$scope"in r&&l(3,s=r.$$scope)},[c,f,o,s,t,i]}class ut extends j{constructor(e){super(),T(this,e,He,Ae,B,{style:2})}}const Ue="/atip/browse_dropdown_filters/assets/zoom_out_map-b2e1091a.svg";function Ke(n){let e,l;return{c(){e=d("img"),he(e.src,l=Ue)||_(e,"src",l),_(e,"alt","Zoom to show entire boundary")},m(t,s){b(t,e,s)},p:O,d(t){t&&v(e)}}}function Qe(n){let e,l;return e=new ye({props:{title:"Zoom to show entire boundary",$$slots:{default:[Ke]},$$scope:{ctx:n}}}),e.$on("click",n[0]),{c(){te(e.$$.fragment)},m(t,s){se(e,t,s),l=!0},p(t,[s]){const o={};s&8&&(o.$$scope={dirty:s,ctx:t}),e.$set(o)},i(t){l||(I(e.$$.fragment,t),l=!0)},o(t){D(e.$$.fragment,t),l=!1},d(t){ne(e,t)}}}function Xe(n,e,l){let t;N(n,V,a=>l(2,t=a));let{boundaryGeojson:s}=e;function o(){t.fitBounds(we(s),{padding:20,animate:!0,duration:500})}return n.$$set=a=>{"boundaryGeojson"in a&&l(1,s=a.boundaryGeojson)},[o,s]}class ft extends j{constructor(e){super(),T(this,e,Xe,Qe,B,{boundaryGeojson:1})}}export{xe as B,Fe as C,it as I,at as L,rt as M,ft as Z,$e as a,Ee as b,k as c,st as d,ot as e,Le as f,le as g,et as h,nt as i,ut as j,ct as k,W as l,V as m,lt as n,Be as o,tt as r,Ie as s,Me as u}; diff --git a/browse_dropdown_filters/assets/all-ecff5010.css b/browse_dropdown_filters/assets/all-ecff5010.css deleted file mode 100644 index edb5ad69a..000000000 --- a/browse_dropdown_filters/assets/all-ecff5010.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";:root{--govuk-frontend-version: "4.7.0"}.govuk-link,.govuk-prose a{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */@font-face{font-family:GDS Transport;font-style:normal;font-weight:400;src:url(/atip/browse_dropdown_filters/assets/fonts/light-94a07e06a1-v2.woff2) format("woff2"),url(/atip/browse_dropdown_filters/assets/fonts/light-f591b13f7d-v2.woff) format("woff");font-display:fallback}@font-face{font-family:GDS Transport;font-style:normal;font-weight:700;src:url(/atip/browse_dropdown_filters/assets/fonts/bold-b542beb274-v2.woff2) format("woff2"),url(/atip/browse_dropdown_filters/assets/fonts/bold-affa96571d-v2.woff) format("woff");font-display:fallback}@media print{.govuk-link,.govuk-prose a{font-family:sans-serif}}.govuk-link:focus,.govuk-prose a:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-link:link,.govuk-prose a:link{color:#1d70b8}.govuk-link:visited,.govuk-prose a:visited{color:#4c2c92}.govuk-link:hover,.govuk-prose a:hover{color:#003078}.govuk-link:active,.govuk-prose a:active{color:#0b0c0c}.govuk-link:focus,.govuk-prose a:focus{color:#0b0c0c}@media print{[href^="/"].govuk-link:after,.govuk-prose a[href^="/"]:after,[href^="http://"].govuk-link:after,.govuk-prose a[href^="http://"]:after,[href^="https://"].govuk-link:after,.govuk-prose a[href^="https://"]:after{content:" (" attr(href) ")";font-size:90%;word-wrap:break-word}}.govuk-link--muted:link,.govuk-link--muted:visited{color:#505a5f}.govuk-link--muted:hover,.govuk-link--muted:active{color:#0b0c0c}.govuk-link--muted:focus{color:#0b0c0c}.govuk-link--text-colour:link,.govuk-link--text-colour:visited{color:#0b0c0c}@media print{.govuk-link--text-colour:link,.govuk-link--text-colour:visited{color:#000}}.govuk-link--text-colour:hover{color:#0b0c0cfc}.govuk-link--text-colour:active,.govuk-link--text-colour:focus{color:#0b0c0c}@media print{.govuk-link--text-colour:active,.govuk-link--text-colour:focus{color:#000}}.govuk-link--inverse:link,.govuk-link--inverse:visited{color:#fff}.govuk-link--inverse:hover,.govuk-link--inverse:active{color:#fffffffc}.govuk-link--inverse:focus{color:#0b0c0c}.govuk-link--no-underline:not(:hover):not(:active){text-decoration:none}.govuk-link--no-visited-state:link,.govuk-link--no-visited-state:visited{color:#1d70b8}.govuk-link--no-visited-state:hover{color:#003078}.govuk-link--no-visited-state:active{color:#0b0c0c}.govuk-link--no-visited-state:focus{color:#0b0c0c}.govuk-list{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin-top:0;margin-bottom:15px;padding-left:0;list-style-type:none}@media print{.govuk-list{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-list{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-list{font-size:14pt;line-height:1.15}}@media print{.govuk-list{color:#000}}@media (min-width: 40.0625em){.govuk-list{margin-bottom:20px}}.govuk-list .govuk-list{margin-top:10px}.govuk-list>li{margin-bottom:5px}.govuk-list--bullet,.govuk-prose ul{padding-left:20px;list-style-type:disc}.govuk-list--number{padding-left:20px;list-style-type:decimal}.govuk-list--bullet>li,.govuk-prose ul>li,.govuk-list--number>li{margin-bottom:0}@media (min-width: 40.0625em){.govuk-list--bullet>li,.govuk-prose ul>li,.govuk-list--number>li{margin-bottom:5px}}.govuk-list--spaced>li{margin-bottom:10px}@media (min-width: 40.0625em){.govuk-list--spaced>li{margin-bottom:15px}}.govuk-heading-xl{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;display:block;margin-top:0;margin-bottom:30px}@media print{.govuk-heading-xl{color:#000}}@media print{.govuk-heading-xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-heading-xl{font-size:32pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-heading-xl{margin-bottom:50px}}.govuk-heading-l,.govuk-prose h1{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;display:block;margin-top:0;margin-bottom:20px}@media print{.govuk-heading-l,.govuk-prose h1{color:#000}}@media print{.govuk-heading-l,.govuk-prose h1{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-l,.govuk-prose h1{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-heading-l,.govuk-prose h1{font-size:24pt;line-height:1.05}}@media (min-width: 40.0625em){.govuk-heading-l,.govuk-prose h1{margin-bottom:30px}}.govuk-heading-m,.govuk-prose h2{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;display:block;margin-top:0;margin-bottom:15px}@media print{.govuk-heading-m,.govuk-prose h2{color:#000}}@media print{.govuk-heading-m,.govuk-prose h2{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-m,.govuk-prose h2{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-heading-m,.govuk-prose h2{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-heading-m,.govuk-prose h2{margin-bottom:20px}}.govuk-heading-s{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;display:block;margin-top:0;margin-bottom:15px}@media print{.govuk-heading-s{color:#000}}@media print{.govuk-heading-s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-heading-s{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-heading-s{margin-bottom:20px}}.govuk-caption-xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1.1111111111;display:block;margin-bottom:5px;color:#505a5f}@media print{.govuk-caption-xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-caption-xl{font-size:27px;font-size:1.6875rem;line-height:1.1111111111}}@media print{.govuk-caption-xl{font-size:18pt;line-height:1.15}}.govuk-caption-l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1.1111111111;display:block;margin-bottom:5px;color:#505a5f}@media print{.govuk-caption-l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-caption-l{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-caption-l{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-caption-l{margin-bottom:0}}.govuk-caption-m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;display:block;color:#505a5f}@media print{.govuk-caption-m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-caption-m{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-caption-m{font-size:14pt;line-height:1.15}}.govuk-body-lead,.govuk-body-l{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-top:0;margin-bottom:20px}@media print{.govuk-body-lead,.govuk-body-l{color:#000}}@media print{.govuk-body-lead,.govuk-body-l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body-lead,.govuk-body-l{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-body-lead,.govuk-body-l{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-body-lead,.govuk-body-l{margin-bottom:30px}}.govuk-body,.govuk-prose p,.govuk-body-m{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-top:0;margin-bottom:15px}@media print{.govuk-body,.govuk-prose p,.govuk-body-m{color:#000}}@media print{.govuk-body,.govuk-prose p,.govuk-body-m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body,.govuk-prose p,.govuk-body-m{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-body,.govuk-prose p,.govuk-body-m{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-body,.govuk-prose p,.govuk-body-m{margin-bottom:20px}}.govuk-body-s{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;margin-top:0;margin-bottom:15px}@media print{.govuk-body-s{color:#000}}@media print{.govuk-body-s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body-s{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-body-s{font-size:14pt;line-height:1.2}}@media (min-width: 40.0625em){.govuk-body-s{margin-bottom:20px}}.govuk-body-xs{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:12px;font-size:.75rem;line-height:1.25;margin-top:0;margin-bottom:15px}@media print{.govuk-body-xs{color:#000}}@media print{.govuk-body-xs{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body-xs{font-size:14px;font-size:.875rem;line-height:1.4285714286}}@media print{.govuk-body-xs{font-size:12pt;line-height:1.2}}@media (min-width: 40.0625em){.govuk-body-xs{margin-bottom:20px}}.govuk-body-l+.govuk-heading-l,.govuk-prose .govuk-body-l+h1,.govuk-body-lead+.govuk-heading-l,.govuk-prose .govuk-body-lead+h1{padding-top:5px}@media (min-width: 40.0625em){.govuk-body-l+.govuk-heading-l,.govuk-prose .govuk-body-l+h1,.govuk-body-lead+.govuk-heading-l,.govuk-prose .govuk-body-lead+h1{padding-top:10px}}.govuk-body-m+.govuk-heading-l,.govuk-prose .govuk-body-m+h1,.govuk-body+.govuk-heading-l,.govuk-prose p+.govuk-heading-l,.govuk-prose .govuk-body+h1,.govuk-prose p+h1,.govuk-body-s+.govuk-heading-l,.govuk-prose .govuk-body-s+h1,.govuk-list+.govuk-heading-l,.govuk-prose .govuk-list+h1{padding-top:15px}@media (min-width: 40.0625em){.govuk-body-m+.govuk-heading-l,.govuk-prose .govuk-body-m+h1,.govuk-body+.govuk-heading-l,.govuk-prose p+.govuk-heading-l,.govuk-prose .govuk-body+h1,.govuk-prose p+h1,.govuk-body-s+.govuk-heading-l,.govuk-prose .govuk-body-s+h1,.govuk-list+.govuk-heading-l,.govuk-prose .govuk-list+h1{padding-top:20px}}.govuk-body-m+.govuk-heading-m,.govuk-prose .govuk-body-m+h2,.govuk-body+.govuk-heading-m,.govuk-prose p+.govuk-heading-m,.govuk-prose .govuk-body+h2,.govuk-prose p+h2,.govuk-body-s+.govuk-heading-m,.govuk-prose .govuk-body-s+h2,.govuk-list+.govuk-heading-m,.govuk-prose .govuk-list+h2,.govuk-body-m+.govuk-heading-s,.govuk-body+.govuk-heading-s,.govuk-prose p+.govuk-heading-s,.govuk-body-s+.govuk-heading-s,.govuk-list+.govuk-heading-s{padding-top:5px}@media (min-width: 40.0625em){.govuk-body-m+.govuk-heading-m,.govuk-prose .govuk-body-m+h2,.govuk-body+.govuk-heading-m,.govuk-prose p+.govuk-heading-m,.govuk-prose .govuk-body+h2,.govuk-prose p+h2,.govuk-body-s+.govuk-heading-m,.govuk-prose .govuk-body-s+h2,.govuk-list+.govuk-heading-m,.govuk-prose .govuk-list+h2,.govuk-body-m+.govuk-heading-s,.govuk-body+.govuk-heading-s,.govuk-prose p+.govuk-heading-s,.govuk-body-s+.govuk-heading-s,.govuk-list+.govuk-heading-s{padding-top:10px}}.govuk-section-break{margin:0;border:0}.govuk-section-break--xl{margin-top:30px;margin-bottom:30px}@media (min-width: 40.0625em){.govuk-section-break--xl{margin-top:50px}}@media (min-width: 40.0625em){.govuk-section-break--xl{margin-bottom:50px}}.govuk-section-break--l{margin-top:20px;margin-bottom:20px}@media (min-width: 40.0625em){.govuk-section-break--l{margin-top:30px}}@media (min-width: 40.0625em){.govuk-section-break--l{margin-bottom:30px}}.govuk-section-break--m{margin-top:15px;margin-bottom:15px}@media (min-width: 40.0625em){.govuk-section-break--m{margin-top:20px}}@media (min-width: 40.0625em){.govuk-section-break--m{margin-bottom:20px}}.govuk-section-break--visible{border-bottom:1px solid #b1b4b6}.govuk-button-group{margin-bottom:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}@media (min-width: 40.0625em){.govuk-button-group{margin-bottom:15px}}.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.1875;display:inline-block;max-width:100%;margin-top:5px;margin-bottom:20px;text-align:center}@media print{.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-size:19px;font-size:1.1875rem;line-height:1}}@media print{.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-size:14pt;line-height:19px}}.govuk-button-group .govuk-button{margin-bottom:17px}@media (min-width: 40.0625em){.govuk-button-group{margin-right:-15px;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline}.govuk-button-group .govuk-button,.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{margin-right:15px}.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{text-align:left}}.govuk-form-group{margin-bottom:20px}.govuk-form-group:after{content:"";display:block;clear:both}@media (min-width: 40.0625em){.govuk-form-group{margin-bottom:30px}}.govuk-form-group .govuk-form-group:last-of-type{margin-bottom:0}.govuk-form-group--error{padding-left:15px;border-left:5px solid #d4351c}.govuk-form-group--error .govuk-form-group{padding:0;border:0}.govuk-grid-row{margin-right:-15px;margin-left:-15px}.govuk-grid-row:after{content:"";display:block;clear:both}.govuk-grid-column-one-quarter{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-one-quarter{width:25%;float:left}}.govuk-grid-column-one-third{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-one-third{width:33.3333333333%;float:left}}.govuk-grid-column-one-half{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-one-half{width:50%;float:left}}.govuk-grid-column-two-thirds{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-two-thirds{width:66.6666666667%;float:left}}.govuk-grid-column-three-quarters{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-three-quarters{width:75%;float:left}}.govuk-grid-column-full{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-full{width:100%;float:left}}.govuk-grid-column-one-quarter-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-one-quarter-from-desktop{width:25%;float:left}}.govuk-grid-column-one-third-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-one-third-from-desktop{width:33.3333333333%;float:left}}.govuk-grid-column-one-half-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-one-half-from-desktop{width:50%;float:left}}.govuk-grid-column-two-thirds-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-two-thirds-from-desktop{width:66.6666666667%;float:left}}.govuk-grid-column-three-quarters-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-three-quarters-from-desktop{width:75%;float:left}}.govuk-grid-column-full-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-full-from-desktop{width:100%;float:left}}.govuk-main-wrapper{display:block;padding-top:20px;padding-bottom:20px}@media (min-width: 40.0625em){.govuk-main-wrapper{padding-top:40px;padding-bottom:40px}}.govuk-main-wrapper--auto-spacing:first-child,.govuk-main-wrapper--l{padding-top:30px}@media (min-width: 40.0625em){.govuk-main-wrapper--auto-spacing:first-child,.govuk-main-wrapper--l{padding-top:50px}}.govuk-template{background-color:#f3f2f1;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}@supports (position: -webkit-sticky) or (position: sticky){.govuk-template{scroll-padding-top:60px}.govuk-template:not(:has(.govuk-exit-this-page)){scroll-padding-top:0}}@media screen{.govuk-template{overflow-y:scroll}}.govuk-template__body{margin:0;background-color:#fff}.govuk-width-container{max-width:960px;margin-right:15px;margin-left:15px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(15px,calc(15px + env(safe-area-inset-right)));margin-left:max(15px,calc(15px + env(safe-area-inset-left)))}}@media (min-width: 40.0625em){.govuk-width-container{margin-right:30px;margin-left:30px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(30px,calc(15px + env(safe-area-inset-right)));margin-left:max(30px,calc(15px + env(safe-area-inset-left)))}}}@media (min-width: 1020px){.govuk-width-container{margin-right:auto;margin-left:auto}@supports (margin: max(0px)){.govuk-width-container{margin-right:auto;margin-left:auto}}}.govuk-accordion{margin-bottom:20px}@media (min-width: 40.0625em){.govuk-accordion{margin-bottom:30px}}.govuk-accordion__section{padding-top:15px}.govuk-accordion__section-heading{margin-top:0;margin-bottom:0;padding-top:15px;padding-bottom:15px}.govuk-accordion__section-button{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;color:#0b0c0c;display:block;margin-bottom:0;padding-top:15px}@media print{.govuk-accordion__section-button{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-accordion__section-button{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-accordion__section-button{font-size:18pt;line-height:1.15}}@media print{.govuk-accordion__section-button{color:#000}}.govuk-accordion__section-content>:last-child{margin-bottom:0}.js-enabled .govuk-accordion{border-bottom:1px solid #b1b4b6}.js-enabled .govuk-accordion__section{padding-top:0}.js-enabled .govuk-accordion__section-content{display:none;padding-top:15px;padding-bottom:30px}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section-content{padding-bottom:50px}}.js-enabled .govuk-accordion__section-content[hidden]{padding-top:0;padding-bottom:0}@supports (content-visibility: hidden){.js-enabled .govuk-accordion__section-content[hidden]{content-visibility:hidden;display:inherit}}.js-enabled .govuk-accordion__section--expanded .govuk-accordion__section-content{display:block}.js-enabled .govuk-accordion__show-all{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;position:relative;z-index:1;margin-bottom:9px;padding:5px 2px 5px 0;border-width:0;color:#1d70b8;background:none;cursor:pointer;-webkit-appearance:none}@media print{.js-enabled .govuk-accordion__show-all{font-family:sans-serif}}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__show-all{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.js-enabled .govuk-accordion__show-all{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__show-all{margin-bottom:14px}}.js-enabled .govuk-accordion__show-all::-moz-focus-inner{padding:0;border:0}.js-enabled .govuk-accordion__show-all:hover{color:#0b0c0c;background:#f3f2f1;box-shadow:0 -2px #f3f2f1,0 4px #f3f2f1}.js-enabled .govuk-accordion__show-all:hover .govuk-accordion__section-toggle-text{color:#0b0c0c}.js-enabled .govuk-accordion__show-all:hover .govuk-accordion-nav__chevron{color:#0b0c0c;background:#0b0c0c}.js-enabled .govuk-accordion__show-all:hover .govuk-accordion-nav__chevron:after{color:#f3f2f1}.js-enabled .govuk-accordion__show-all:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.js-enabled .govuk-accordion__show-all:focus .govuk-accordion-nav__chevron{background:#0b0c0c}.js-enabled .govuk-accordion__show-all:focus .govuk-accordion-nav__chevron:after{color:#fd0}.js-enabled .govuk-accordion__section-heading{padding:0}.js-enabled .govuk-accordion-nav__chevron{box-sizing:border-box;display:inline-block;position:relative;width:1.25rem;height:1.25rem;border:.0625rem solid;border-radius:50%;vertical-align:middle}.js-enabled .govuk-accordion-nav__chevron:after{content:"";box-sizing:border-box;display:block;position:absolute;bottom:.3125rem;left:.375rem;width:.375rem;height:.375rem;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);border-top:.125rem solid;border-right:.125rem solid}.js-enabled .govuk-accordion-nav__chevron--down{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.js-enabled .govuk-accordion__section-button{width:100%;padding:10px 0 0;border:0;border-top:1px solid #b1b4b6;border-bottom:10px solid transparent;color:#0b0c0c;background:none;text-align:left;cursor:pointer;-webkit-appearance:none}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section-button{padding-bottom:10px}}.js-enabled .govuk-accordion__section-button:active{color:#0b0c0c;background:none}.js-enabled .govuk-accordion__section-button:hover{color:#0b0c0c;background:#f3f2f1}.js-enabled .govuk-accordion__section-button:hover .govuk-accordion__section-toggle-text{color:#0b0c0c}.js-enabled .govuk-accordion__section-button:hover .govuk-accordion-nav__chevron{color:#0b0c0c;background:#0b0c0c}.js-enabled .govuk-accordion__section-button:hover .govuk-accordion-nav__chevron:after{color:#f3f2f1}.js-enabled .govuk-accordion__section-button:focus{outline:0}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion-nav__chevron{color:#0b0c0c;background:#0b0c0c}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion-nav__chevron:after{color:#fd0}.js-enabled .govuk-accordion__section-button::-moz-focus-inner{padding:0;border:0}.js-enabled .govuk-accordion__section--expanded .govuk-accordion__section-button{padding-bottom:15px;border-bottom:0}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section--expanded .govuk-accordion__section-button{padding-bottom:20px}}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus{padding-bottom:3px}@media (min-width: 48.0625em){.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus{padding-bottom:2px}}.js-enabled .govuk-accordion__section-toggle,.js-enabled .govuk-accordion__section-heading-text,.js-enabled .govuk-accordion__section-summary{display:block;margin-bottom:13px}.js-enabled .govuk-accordion__section-toggle .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-toggle .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-toggle .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__section-heading-text .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-heading-text .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-heading-text .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__section-summary .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-summary .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-summary .govuk-accordion__section-toggle-focus{display:inline}.js-enabled .govuk-accordion__section-toggle{font-size:16px;font-size:1rem;line-height:1.25;font-weight:400;color:#1d70b8}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section-toggle{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.js-enabled .govuk-accordion__section-toggle{font-size:14pt;line-height:1.15}}.js-enabled .govuk-accordion__show-all-text,.js-enabled .govuk-accordion__section-toggle-text{margin-left:5px;vertical-align:middle}@media screen and (forced-colors: active){.js-enabled .govuk-accordion__show-all:hover .govuk-accordion-nav__chevron,.js-enabled .govuk-accordion__section-button:hover .govuk-accordion-nav__chevron{background-color:transparent}.js-enabled .govuk-accordion__show-all:focus .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__show-all:focus .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__show-all:focus .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__show-all:focus .govuk-accordion-nav__chevron,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion-nav__chevron{background:transparent;background-color:transparent}}@media (hover: none){.js-enabled .govuk-accordion__section-header:hover{border-top-color:#b1b4b6;box-shadow:inset 0 3px #1d70b8}.js-enabled .govuk-accordion__section-header:hover .govuk-accordion__section-button{border-top-color:#b1b4b6}}.govuk-back-link{font-size:14px;font-size:.875rem;line-height:1.1428571429;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;display:inline-block;position:relative;margin-top:15px;margin-bottom:15px;padding-left:.875em}@media (min-width: 40.0625em){.govuk-back-link{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-back-link{font-size:14pt;line-height:1.2}}@media print{.govuk-back-link{font-family:sans-serif}}.govuk-back-link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-back-link:link,.govuk-back-link:visited{color:#0b0c0c}@media print{.govuk-back-link:link,.govuk-back-link:visited{color:#000}}.govuk-back-link:hover{color:#0b0c0cfc}.govuk-back-link:active,.govuk-back-link:focus{color:#0b0c0c}@media print{.govuk-back-link:active,.govuk-back-link:focus{color:#000}}.govuk-back-link:before{content:"";display:block;position:absolute;top:0;bottom:0;left:.1875em;width:.4375em;height:.4375em;margin:auto 0;-webkit-transform:rotate(225deg);-ms-transform:rotate(225deg);transform:rotate(225deg);border:solid;border-width:1px 1px 0 0;border-color:#505a5f}@supports (border-width: max(0px)){.govuk-back-link:before{border-width:max(1px,.0625em) max(1px,.0625em) 0 0;font-size:max(16px,1em)}}.govuk-back-link:focus:before{border-color:#0b0c0c}.govuk-back-link:after{content:"";position:absolute;top:-14px;right:0;bottom:-14px;left:0}.govuk-back-link--inverse:link,.govuk-back-link--inverse:visited{color:#fff}.govuk-back-link--inverse:hover,.govuk-back-link--inverse:active{color:#fffffffc}.govuk-back-link--inverse:focus{color:#0b0c0c}.govuk-back-link--inverse:before{border-color:currentcolor}.govuk-breadcrumbs{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;color:#0b0c0c;margin-top:15px;margin-bottom:10px}@media print{.govuk-breadcrumbs{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-breadcrumbs{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-breadcrumbs{font-size:14pt;line-height:1.2}}@media print{.govuk-breadcrumbs{color:#000}}.govuk-breadcrumbs__list{margin:0;padding:0;list-style-type:none}.govuk-breadcrumbs__list:after{content:"";display:block;clear:both}.govuk-breadcrumbs__list-item{display:inline-block;position:relative;margin-bottom:5px;margin-left:.625em;padding-left:.9784375em;float:left}.govuk-breadcrumbs__list-item:before{content:"";display:block;position:absolute;top:0;bottom:0;left:-.206875em;width:.4375em;height:.4375em;margin:auto 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);border:solid;border-width:1px 1px 0 0;border-color:#505a5f}@supports (border-width: max(0px)){.govuk-breadcrumbs__list-item:before{border-width:max(1px,.0625em) max(1px,.0625em) 0 0;font-size:max(16px,1em)}}.govuk-breadcrumbs__list-item:first-child{margin-left:0;padding-left:0}.govuk-breadcrumbs__list-item:first-child:before{content:none;display:none}.govuk-breadcrumbs__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-breadcrumbs__link{font-family:sans-serif}}.govuk-breadcrumbs__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-breadcrumbs__link:link,.govuk-breadcrumbs__link:visited{color:#0b0c0c}@media print{.govuk-breadcrumbs__link:link,.govuk-breadcrumbs__link:visited{color:#000}}.govuk-breadcrumbs__link:hover{color:#0b0c0cfc}.govuk-breadcrumbs__link:active,.govuk-breadcrumbs__link:focus{color:#0b0c0c}@media print{.govuk-breadcrumbs__link:active,.govuk-breadcrumbs__link:focus{color:#000}}@media (max-width: 40.0525em){.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item{display:none}.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item:first-child,.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item:last-child{display:inline-block}.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item:before{top:.375em;margin:0}.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list{display:-ms-flexbox;display:flex}}.govuk-breadcrumbs--inverse,.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:link,.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:visited{color:#fff}.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:hover,.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:active{color:#fffffffc}.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:focus{color:#0b0c0c}.govuk-breadcrumbs--inverse .govuk-breadcrumbs__list-item:before{border-color:currentcolor}.govuk-button{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.1875;box-sizing:border-box;display:inline-block;position:relative;width:100%;margin:0 0 22px;padding:8px 10px 7px;border:2px solid transparent;border-radius:0;color:#fff;background-color:#00703c;box-shadow:0 2px #002d18;text-align:center;vertical-align:top;cursor:pointer;-webkit-appearance:none}@media print{.govuk-button{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-button{font-size:19px;font-size:1.1875rem;line-height:1}}@media print{.govuk-button{font-size:14pt;line-height:19px}}@media (min-width: 40.0625em){.govuk-button{margin-bottom:32px}}@media (min-width: 40.0625em){.govuk-button{width:auto}}.govuk-button:link,.govuk-button:visited,.govuk-button:active,.govuk-button:hover{color:#fff;text-decoration:none}.govuk-button::-moz-focus-inner{padding:0;border:0}.govuk-button:hover{background-color:#005a30}.govuk-button:active{top:2px}.govuk-button:focus{border-color:#fd0;outline:3px solid transparent;box-shadow:inset 0 0 0 1px #fd0}.govuk-button:focus:not(:active):not(:hover){border-color:#fd0;color:#0b0c0c;background-color:#fd0;box-shadow:0 2px #0b0c0c}.govuk-button:before{content:"";display:block;position:absolute;top:-2px;right:-2px;bottom:-4px;left:-2px;background:transparent}.govuk-button:active:before{top:-4px}.govuk-button--disabled,.govuk-button[disabled=disabled],.govuk-button[disabled]{opacity:.5}.govuk-button--disabled:hover,.govuk-button[disabled=disabled]:hover,.govuk-button[disabled]:hover{background-color:#00703c;cursor:not-allowed}.govuk-button--disabled:active,.govuk-button[disabled=disabled]:active,.govuk-button[disabled]:active{top:0;box-shadow:0 2px #002d18}.govuk-button--secondary{background-color:#f3f2f1;box-shadow:0 2px #929191}.govuk-button--secondary,.govuk-button--secondary:link,.govuk-button--secondary:visited,.govuk-button--secondary:active,.govuk-button--secondary:hover{color:#0b0c0c}.govuk-button--secondary:hover{background-color:#dbdad9}.govuk-button--secondary:hover[disabled]{background-color:#f3f2f1}.govuk-button--warning{background-color:#d4351c;box-shadow:0 2px #55150b}.govuk-button--warning,.govuk-button--warning:link,.govuk-button--warning:visited,.govuk-button--warning:active,.govuk-button--warning:hover{color:#fff}.govuk-button--warning:hover{background-color:#aa2a16}.govuk-button--warning:hover[disabled]{background-color:#d4351c}.govuk-button--inverse{background-color:#fff;box-shadow:0 2px #144e81}.govuk-button--inverse,.govuk-button--inverse:link,.govuk-button--inverse:visited,.govuk-button--inverse:active,.govuk-button--inverse:hover{color:#1d70b8}.govuk-button--inverse:hover{background-color:#e8f1f8}.govuk-button--inverse:hover[disabled]{background-color:#fff}.govuk-button--start{font-weight:700;font-size:18px;font-size:1.125rem;line-height:1;display:-ms-inline-flexbox;display:inline-flex;min-height:auto;-ms-flex-pack:center;justify-content:center}@media (min-width: 40.0625em){.govuk-button--start{font-size:24px;font-size:1.5rem;line-height:1}}@media print{.govuk-button--start{font-size:18pt;line-height:1}}.govuk-button__start-icon{margin-left:5px;vertical-align:middle;-ms-flex-negative:0;flex-shrink:0;-ms-flex-item-align:center;align-self:center;forced-color-adjust:auto}@media (min-width: 48.0625em){.govuk-button__start-icon{margin-left:10px}}.govuk-error-message{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;display:block;margin-top:0;margin-bottom:15px;clear:both;color:#d4351c}@media print{.govuk-error-message{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-error-message{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-error-message{font-size:14pt;line-height:1.15}}.govuk-fieldset{min-width:0;margin:0;padding:0;border:0}.govuk-fieldset:after{content:"";display:block;clear:both}@supports not (caret-color: auto){.govuk-fieldset,x:-moz-any-link{display:table-cell}}.govuk-fieldset__legend{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;box-sizing:border-box;display:table;max-width:100%;margin-bottom:10px;padding:0;white-space:normal}@media print{.govuk-fieldset__legend{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-fieldset__legend{font-size:14pt;line-height:1.15}}@media print{.govuk-fieldset__legend{color:#000}}.govuk-fieldset__legend--xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;margin-bottom:15px}@media print{.govuk-fieldset__legend--xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-fieldset__legend--xl{font-size:32pt;line-height:1.15}}.govuk-fieldset__legend--l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;margin-bottom:15px}@media print{.govuk-fieldset__legend--l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--l{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-fieldset__legend--l{font-size:24pt;line-height:1.05}}.govuk-fieldset__legend--m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-bottom:15px}@media print{.govuk-fieldset__legend--m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--m{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-fieldset__legend--m{font-size:18pt;line-height:1.15}}.govuk-fieldset__legend--s{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-fieldset__legend--s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-fieldset__legend--s{font-size:14pt;line-height:1.15}}.govuk-fieldset__heading{margin:0;font-size:inherit;font-weight:inherit}.govuk-hint{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-bottom:15px;color:#505a5f}@media print{.govuk-hint{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-hint{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-hint{font-size:14pt;line-height:1.15}}.govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl)+.govuk-hint{margin-bottom:10px}.govuk-fieldset__legend:not(.govuk-fieldset__legend--m):not(.govuk-fieldset__legend--l):not(.govuk-fieldset__legend--xl)+.govuk-hint{margin-bottom:10px}.govuk-fieldset__legend+.govuk-hint{margin-top:-5px}.govuk-label{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;display:block;margin-bottom:5px}@media print{.govuk-label{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-label{font-size:14pt;line-height:1.15}}@media print{.govuk-label{color:#000}}.govuk-label--xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;margin-bottom:15px}@media print{.govuk-label--xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-label--xl{font-size:32pt;line-height:1.15}}.govuk-label--l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;margin-bottom:15px}@media print{.govuk-label--l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--l{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-label--l{font-size:24pt;line-height:1.05}}.govuk-label--m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-bottom:10px}@media print{.govuk-label--m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--m{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-label--m{font-size:18pt;line-height:1.15}}.govuk-label--s{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-label--s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-label--s{font-size:14pt;line-height:1.15}}.govuk-label-wrapper{margin:0}.govuk-checkboxes__item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;display:block;position:relative;min-height:40px;margin-bottom:10px;padding-left:40px;clear:left}@media print{.govuk-checkboxes__item{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-checkboxes__item{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-checkboxes__item{font-size:14pt;line-height:1.15}}.govuk-checkboxes__item:last-child,.govuk-checkboxes__item:last-of-type{margin-bottom:0}.govuk-checkboxes__input{cursor:pointer;position:absolute;z-index:1;top:-2px;left:-2px;width:44px;height:44px;margin:0;opacity:0}.govuk-checkboxes__label{display:inline-block;margin-bottom:0;padding:8px 15px 5px;cursor:pointer;-ms-touch-action:manipulation;touch-action:manipulation}.govuk-checkboxes__label:before{content:"";box-sizing:border-box;position:absolute;top:0;left:0;width:40px;height:40px;border:2px solid currentcolor;background:transparent}.govuk-checkboxes__label:after{content:"";box-sizing:border-box;position:absolute;top:11px;left:9px;width:23px;height:12px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);border:solid;border-width:0 0 5px 5px;border-top-color:transparent;opacity:0;background:transparent}.govuk-checkboxes__hint{display:block;padding-right:15px;padding-left:15px}.govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{border-width:4px;outline:3px solid transparent;outline-offset:1px;box-shadow:0 0 0 3px #fd0}@media screen and (forced-colors: active),(-ms-high-contrast: active){.govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{outline-color:Highlight}}.govuk-checkboxes__input:checked+.govuk-checkboxes__label:after{opacity:1}.govuk-checkboxes__input:disabled,.govuk-checkboxes__input:disabled+.govuk-checkboxes__label{cursor:not-allowed}.govuk-checkboxes__input:disabled+.govuk-checkboxes__label,.govuk-checkboxes__input:disabled~.govuk-hint{opacity:.5}.govuk-checkboxes__divider{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;width:40px;margin-bottom:10px;text-align:center}@media print{.govuk-checkboxes__divider{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-checkboxes__divider{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-checkboxes__divider{font-size:14pt;line-height:1.15}}@media print{.govuk-checkboxes__divider{color:#000}}.govuk-checkboxes__conditional{margin-bottom:15px;margin-left:18px;padding-left:33px;border-left:4px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-checkboxes__conditional{margin-bottom:20px}}.js-enabled .govuk-checkboxes__conditional--hidden{display:none}.govuk-checkboxes__conditional>:last-child{margin-bottom:0}.govuk-checkboxes--small .govuk-checkboxes__item{min-height:0;margin-bottom:0;padding-left:34px;float:left}.govuk-checkboxes--small .govuk-checkboxes__item:after{content:"";display:block;clear:both}.govuk-checkboxes--small .govuk-checkboxes__input{left:-10px}.govuk-checkboxes--small .govuk-checkboxes__label{margin-top:-2px;padding:13px 15px 13px 1px;float:left}@media (min-width: 40.0625em){.govuk-checkboxes--small .govuk-checkboxes__label{padding:11px 15px 10px 1px}}.govuk-checkboxes--small .govuk-checkboxes__label:before{top:8px;width:24px;height:24px}.govuk-checkboxes--small .govuk-checkboxes__label:after{top:15px;left:6px;width:12px;height:6.5px;border-width:0 0 3px 3px}.govuk-checkboxes--small .govuk-checkboxes__hint{padding:0;clear:both}.govuk-checkboxes--small .govuk-checkboxes__conditional{margin-left:10px;padding-left:20px;clear:both}.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled)+.govuk-checkboxes__label:before{box-shadow:0 0 0 10px #b1b4b6}.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{box-shadow:0 0 0 3px #fd0,0 0 0 10px #b1b4b6}@media (hover: none),(pointer: coarse){.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled)+.govuk-checkboxes__label:before{box-shadow:initial}.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{box-shadow:0 0 0 3px #fd0}}.govuk-textarea{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;display:block;width:100%;min-height:40px;margin-bottom:20px;padding:5px;resize:vertical;border:2px solid #0b0c0c;border-radius:0;-webkit-appearance:none}@media print{.govuk-textarea{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-textarea{font-size:19px;font-size:1.1875rem;line-height:1.25}}@media print{.govuk-textarea{font-size:14pt;line-height:1.25}}@media (min-width: 40.0625em){.govuk-textarea{margin-bottom:30px}}.govuk-textarea:focus{outline:3px solid #ffdd00;outline-offset:0;box-shadow:inset 0 0 0 2px}.govuk-textarea:disabled{opacity:.5;color:inherit;background-color:transparent;cursor:not-allowed}.govuk-textarea--error{border-color:#d4351c}.govuk-textarea--error:focus{border-color:#0b0c0c}.govuk-character-count{margin-bottom:20px}@media (min-width: 40.0625em){.govuk-character-count{margin-bottom:30px}}.govuk-character-count .govuk-form-group,.govuk-character-count .govuk-textarea{margin-bottom:5px}.govuk-character-count__message{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:"tnum" 1;font-feature-settings:"tnum" 1;font-weight:400;margin-top:0;margin-bottom:0}@media print{.govuk-character-count__message{font-family:sans-serif}}@supports (font-variant-numeric: tabular-nums){.govuk-character-count__message{-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant-numeric:tabular-nums}}.govuk-character-count__message:after{content:"​"}.govuk-character-count__message--disabled{visibility:hidden}.govuk-cookie-banner{padding-top:20px;border-bottom:10px solid transparent;background-color:#f3f2f1}.govuk-cookie-banner[hidden]{display:none}.govuk-cookie-banner__message{margin-bottom:-10px}.govuk-cookie-banner__message[hidden]{display:none}.govuk-cookie-banner__message:focus{outline:none}.govuk-input{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;width:100%;height:40px;height:2.5rem;margin-top:0;padding:5px;border:2px solid #0b0c0c;border-radius:0;-webkit-appearance:none;appearance:none}@media print{.govuk-input{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-input{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-input{font-size:14pt;line-height:1.15}}.govuk-input:focus{outline:3px solid #ffdd00;outline-offset:0;box-shadow:inset 0 0 0 2px}.govuk-input:disabled{opacity:.5;color:inherit;background-color:transparent;cursor:not-allowed}.govuk-input::-webkit-outer-spin-button,.govuk-input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.govuk-input[type=number]{-moz-appearance:textfield}.govuk-input--error{border-color:#d4351c}.govuk-input--error:focus{border-color:#0b0c0c}.govuk-input--extra-letter-spacing{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:"tnum" 1;font-feature-settings:"tnum" 1;font-weight:400;letter-spacing:.05em}@media print{.govuk-input--extra-letter-spacing{font-family:sans-serif}}@supports (font-variant-numeric: tabular-nums){.govuk-input--extra-letter-spacing{-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant-numeric:tabular-nums}}.govuk-input--width-30{max-width:29.5em}.govuk-input--width-20{max-width:20.5em}.govuk-input--width-10{max-width:11.5em}.govuk-input--width-5{max-width:5.5em}.govuk-input--width-4{max-width:4.5em}.govuk-input--width-3{max-width:3.75em}.govuk-input--width-2{max-width:2.75em}.govuk-input__wrapper{display:-ms-flexbox;display:flex}.govuk-input__wrapper .govuk-input{-ms-flex:0 1 auto;flex:0 1 auto}.govuk-input__wrapper .govuk-input:focus{z-index:1}@media (max-width: 19.99em){.govuk-input__wrapper{display:block}.govuk-input__wrapper .govuk-input{max-width:100%}}.govuk-input__prefix,.govuk-input__suffix{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;display:inline-block;min-width:40px;min-width:2.5rem;height:40px;height:2.5rem;padding:5px;border:2px solid #0b0c0c;background-color:#f3f2f1;text-align:center;white-space:nowrap;cursor:default;-ms-flex:0 0 auto;flex:0 0 auto}@media print{.govuk-input__prefix,.govuk-input__suffix{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-input__prefix,.govuk-input__suffix{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-input__prefix,.govuk-input__suffix{font-size:14pt;line-height:1.15}}@media (max-width: 40.0525em){.govuk-input__prefix,.govuk-input__suffix{line-height:1.6}}@media (max-width: 19.99em){.govuk-input__prefix,.govuk-input__suffix{display:block;height:100%;white-space:normal}}@media (max-width: 19.99em){.govuk-input__prefix{border-bottom:0}}@media (min-width: 20em){.govuk-input__prefix{border-right:0}}@media (max-width: 19.99em){.govuk-input__suffix{border-top:0}}@media (min-width: 20em){.govuk-input__suffix{border-left:0}}.govuk-date-input{font-size:0}.govuk-date-input:after{content:"";display:block;clear:both}.govuk-date-input__item{display:inline-block;margin-right:20px;margin-bottom:0}.govuk-date-input__label{display:block}.govuk-date-input__input{margin-bottom:0}.govuk-details{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin-bottom:20px;display:block}@media print{.govuk-details{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-details{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-details{font-size:14pt;line-height:1.15}}@media print{.govuk-details{color:#000}}@media (min-width: 40.0625em){.govuk-details{margin-bottom:30px}}.govuk-details__summary{display:inline-block;position:relative;margin-bottom:5px;padding-left:25px;color:#1d70b8;cursor:pointer}.govuk-details__summary:hover{color:#003078}.govuk-details__summary:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-details__summary-text{text-decoration:underline}.govuk-details__summary:focus .govuk-details__summary-text{text-decoration:none}.govuk-details__summary::-webkit-details-marker{display:none}.govuk-details__summary:before{content:"";position:absolute;top:-1px;bottom:0;left:0;margin:auto;display:block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(0% 0%,100% 50%,0% 100%);clip-path:polygon(0% 0%,100% 50%,0% 100%);border-width:7px 0 7px 12.124px;border-left-color:inherit}.govuk-details[open]>.govuk-details__summary:before{display:block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(0% 0%,50% 100%,100% 0%);clip-path:polygon(0% 0%,50% 100%,100% 0%);border-width:12.124px 7px 0 7px;border-top-color:inherit}.govuk-details__text{padding-top:15px;padding-bottom:15px;padding-left:20px;border-left:5px solid #b1b4b6}.govuk-details__text p{margin-top:0;margin-bottom:20px}.govuk-details__text>:last-child{margin-bottom:0}.govuk-error-summary{color:#0b0c0c;padding:15px;margin-bottom:30px;border:5px solid #d4351c}@media print{.govuk-error-summary{color:#000}}@media (min-width: 40.0625em){.govuk-error-summary{padding:20px}}@media (min-width: 40.0625em){.govuk-error-summary{margin-bottom:50px}}.govuk-error-summary:focus{outline:3px solid #ffdd00}.govuk-error-summary__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-top:0;margin-bottom:15px}@media print{.govuk-error-summary__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-error-summary__title{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-error-summary__title{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-error-summary__title{margin-bottom:20px}}.govuk-error-summary__body{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-error-summary__body{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-error-summary__body{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-error-summary__body{font-size:14pt;line-height:1.15}}.govuk-error-summary__body p{margin-top:0;margin-bottom:15px}@media (min-width: 40.0625em){.govuk-error-summary__body p{margin-bottom:20px}}.govuk-error-summary__list{margin-top:0;margin-bottom:0}.govuk-error-summary__list a{font-weight:700;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-error-summary__list a{font-family:sans-serif}}.govuk-error-summary__list a:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-error-summary__list a:link,.govuk-error-summary__list a:visited{color:#d4351c}.govuk-error-summary__list a:hover{color:#942514}.govuk-error-summary__list a:active{color:#d4351c}.govuk-error-summary__list a:focus{color:#0b0c0c}.govuk-exit-this-page{margin-bottom:30px;position:-webkit-sticky;position:sticky;z-index:1000;top:0;left:0;width:100%}@media (min-width: 40.0625em){.govuk-exit-this-page{margin-bottom:50px}}@media (min-width: 40.0625em){.govuk-exit-this-page{display:inline-block;right:0;left:auto;width:auto;float:right}}.govuk-exit-this-page__button{margin-bottom:0}.govuk-exit-this-page__indicator{padding:10px 10px 0;display:none;color:inherit;line-height:0;text-align:center;pointer-events:none}.govuk-exit-this-page__indicator--visible{display:block}.govuk-exit-this-page__indicator-light{box-sizing:border-box;display:inline-block;width:.75em;height:.75em;margin:0 .125em;border-width:2px;border-style:solid;border-radius:50%;border-color:currentcolor}.govuk-exit-this-page__indicator-light--on{border-width:.375em}@media only print{.govuk-exit-this-page{display:none}}.govuk-exit-this-page-overlay{position:fixed;z-index:9999;top:0;right:0;bottom:0;left:0;background-color:#fff}.govuk-exit-this-page-hide-content *{display:none!important}.govuk-exit-this-page-hide-content .govuk-exit-this-page-overlay{display:block!important}.govuk-file-upload{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;max-width:100%;margin-left:-5px;padding:5px}@media print{.govuk-file-upload{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-file-upload{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-file-upload{font-size:14pt;line-height:1.15}}@media print{.govuk-file-upload{color:#000}}.govuk-file-upload::-webkit-file-upload-button{-webkit-appearance:button;color:inherit;font:inherit}.govuk-file-upload:focus{outline:3px solid #ffdd00;box-shadow:inset 0 0 0 4px #0b0c0c}.govuk-file-upload:focus-within{outline:3px solid #ffdd00;box-shadow:inset 0 0 0 4px #0b0c0c}.govuk-file-upload:disabled{opacity:.5;cursor:not-allowed}.govuk-footer{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;padding-top:25px;padding-bottom:15px;border-top:1px solid #b1b4b6;color:#0b0c0c;background:#f3f2f1}@media print{.govuk-footer{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-footer{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-footer{font-size:14pt;line-height:1.2}}@media (min-width: 40.0625em){.govuk-footer{padding-top:40px}}@media (min-width: 40.0625em){.govuk-footer{padding-bottom:25px}}.govuk-footer__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-footer__link{font-family:sans-serif}}.govuk-footer__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-footer__link:link,.govuk-footer__link:visited{color:#0b0c0c}@media print{.govuk-footer__link:link,.govuk-footer__link:visited{color:#000}}.govuk-footer__link:hover{color:#0b0c0cfc}.govuk-footer__link:active,.govuk-footer__link:focus{color:#0b0c0c}@media print{.govuk-footer__link:active,.govuk-footer__link:focus{color:#000}}.govuk-footer__section-break{margin:0 0 30px;border:0;border-bottom:1px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-footer__section-break{margin-bottom:50px}}.govuk-footer__meta{display:-ms-flexbox;display:flex;margin-right:-15px;margin-left:-15px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}.govuk-footer__meta-item{margin-right:15px;margin-bottom:25px;margin-left:15px}.govuk-footer__meta-item--grow{-ms-flex:1;flex:1}@media (max-width: 40.0525em){.govuk-footer__meta-item--grow{-ms-flex-preferred-size:320px;flex-basis:320px}}.govuk-footer__licence-logo{display:inline-block;margin-right:10px;vertical-align:top;forced-color-adjust:auto}@media (max-width: 48.0525em){.govuk-footer__licence-logo{margin-bottom:15px}}.govuk-footer__licence-description{display:inline-block}.govuk-footer__copyright-logo{display:inline-block;min-width:125px;padding-top:112px;background-image:url(/atip/browse_dropdown_filters/assets/images/govuk-crest.png);background-repeat:no-repeat;background-position:50% 0%;background-size:125px 102px;text-align:center;white-space:nowrap}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){.govuk-footer__copyright-logo{background-image:url(/atip/browse_dropdown_filters/assets/images/govuk-crest-2x.png)}}.govuk-footer__inline-list{margin-top:0;margin-bottom:15px;padding:0}.govuk-footer__meta-custom{margin-bottom:20px}.govuk-footer__inline-list-item{display:inline-block;margin-right:15px;margin-bottom:5px}.govuk-footer__heading{margin-bottom:30px;padding-bottom:20px;border-bottom:1px solid #b1b4b6}@media (max-width: 40.0525em){.govuk-footer__heading{padding-bottom:10px}}.govuk-footer__navigation{margin-right:-15px;margin-left:-15px}.govuk-footer__navigation:after{content:"";display:block;clear:both}.govuk-footer__section{display:inline-block;margin-bottom:30px;vertical-align:top}.govuk-footer__list{margin:0;padding:0;list-style:none;-webkit-column-gap:30px;column-gap:30px}@media (min-width: 48.0625em){.govuk-footer__list--columns-2{-webkit-column-count:2;column-count:2}.govuk-footer__list--columns-3{-webkit-column-count:3;column-count:3}}.govuk-footer__list-item{margin-bottom:15px}@media (min-width: 40.0625em){.govuk-footer__list-item{margin-bottom:20px}}.govuk-footer__list-item:last-child{margin-bottom:0}.govuk-header{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;border-bottom:10px solid #ffffff;color:#fff;background:#0b0c0c}@media print{.govuk-header{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-header{font-size:14pt;line-height:1.2}}.govuk-header__container--full-width{padding:0 15px;border-color:#1d70b8}.govuk-header__container--full-width .govuk-header__menu-button{right:15px}.govuk-header__container{position:relative;margin-bottom:-10px;padding-top:10px;border-bottom:10px solid #1d70b8}.govuk-header__container:after{content:"";display:block;clear:both}.govuk-header__logotype{display:inline-block;margin-right:5px}@media (forced-colors: active){.govuk-header__logotype{forced-color-adjust:none;color:linktext}}.govuk-header__logotype:last-child{margin-right:0}.govuk-header__logotype-crown{position:relative;top:-1px;margin-right:1px;fill:currentcolor;vertical-align:top}.govuk-header__logotype-crown-fallback-image{width:36px;height:32px;border:0;vertical-align:bottom}.govuk-header__product-name{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1;display:inline-table}@media print{.govuk-header__product-name{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__product-name{font-size:24px;font-size:1.5rem;line-height:1}}@media print{.govuk-header__product-name{font-size:18pt;line-height:1}}.govuk-header__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none}@media print{.govuk-header__link{font-family:sans-serif}}.govuk-header__link:link,.govuk-header__link:visited{color:#fff}.govuk-header__link:hover,.govuk-header__link:active{color:#fffffffc}.govuk-header__link:focus{color:#0b0c0c}.govuk-header__link:hover{text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:.1578em}.govuk-header__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-header__link--homepage{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;display:inline-block;margin-right:10px;font-size:30px;line-height:1}@media print{.govuk-header__link--homepage{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__link--homepage{display:inline}.govuk-header__link--homepage:focus{box-shadow:0 0 #fd0}}.govuk-header__link--homepage:link,.govuk-header__link--homepage:visited{text-decoration:none}.govuk-header__link--homepage:hover,.govuk-header__link--homepage:active{margin-bottom:-3px;border-bottom:3px solid}.govuk-header__link--homepage:focus{margin-bottom:0;border-bottom:0}.govuk-header__service-name,.govuk-header__link--service-name{display:inline-block;margin-bottom:10px;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111}@media print{.govuk-header__service-name,.govuk-header__link--service-name{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__service-name,.govuk-header__link--service-name{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-header__service-name,.govuk-header__link--service-name{font-size:18pt;line-height:1.15}}.govuk-header__logo,.govuk-header__content{box-sizing:border-box}.govuk-header__logo{margin-bottom:10px;padding-right:50px}@media (min-width: 48.0625em){.govuk-header__logo{width:33.33%;padding-right:15px;float:left;vertical-align:top}}@media (min-width: 48.0625em){.govuk-header__content{width:66.66%;padding-left:15px;float:left}}.govuk-header__menu-button{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;display:none;position:absolute;top:20px;right:0;margin:0;padding:0;border:0;color:#fff;background:none;cursor:pointer}@media print{.govuk-header__menu-button{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__menu-button{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-header__menu-button{font-size:14pt;line-height:1.2}}.govuk-header__menu-button:hover{-webkit-text-decoration:solid underline 3px;text-decoration:solid underline 3px;text-underline-offset:.1578em}.govuk-header__menu-button:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-header__menu-button:after{display:inline-block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(0% 0%,50% 100%,100% 0%);clip-path:polygon(0% 0%,50% 100%,100% 0%);border-width:8.66px 5px 0 5px;border-top-color:inherit;content:"";margin-left:5px}.govuk-header__menu-button[aria-expanded=true]:after{display:inline-block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(50% 0%,0% 100%,100% 100%);clip-path:polygon(50% 0%,0% 100%,100% 100%);border-width:0 5px 8.66px 5px;border-bottom-color:inherit}@media (min-width: 40.0625em){.govuk-header__menu-button{top:15px}}.js-enabled .govuk-header__menu-button{display:block}.govuk-header__menu-button[hidden],.js-enabled .govuk-header__menu-button[hidden]{display:none}@media (min-width: 48.0625em){.govuk-header__navigation{margin-bottom:10px}}.govuk-header__navigation-list{margin:0;padding:0;list-style:none}.govuk-header__navigation-list[hidden]{display:none}@media (min-width: 48.0625em){.govuk-header__navigation--end{margin:0;padding:5px 0;text-align:right}}.govuk-header__navigation--no-service-name{padding-top:40px}.govuk-header__navigation-item{padding:10px 0;border-bottom:1px solid #2e3133}@media (min-width: 48.0625em){.govuk-header__navigation-item{display:inline-block;margin-right:15px;padding:5px 0;border:0}}.govuk-header__navigation-item a{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:14px;font-size:.875rem;line-height:1.1428571429;white-space:nowrap}@media print{.govuk-header__navigation-item a{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__navigation-item a{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-header__navigation-item a{font-size:14pt;line-height:1.2}}.govuk-header__navigation-item--active a:link,.govuk-header__navigation-item--active a:hover,.govuk-header__navigation-item--active a:visited{color:#1d8feb}@media print{.govuk-header__navigation-item--active a{color:#1d70b8}}.govuk-header__navigation-item--active a:focus{color:#0b0c0c}.govuk-header__navigation-item:last-child{margin-right:0;border-bottom:0}@media print{.govuk-header{border-bottom-width:0;color:#0b0c0c;background:transparent}.govuk-header__logotype-crown-fallback-image{display:none}.govuk-header__link:link,.govuk-header__link:visited{color:#0b0c0c}.govuk-header__link:after{display:none}}.govuk-inset-text{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;padding:15px;margin-top:20px;margin-bottom:20px;clear:both;border-left:10px solid #b1b4b6}@media print{.govuk-inset-text{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-inset-text{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-inset-text{font-size:14pt;line-height:1.15}}@media print{.govuk-inset-text{color:#000}}@media (min-width: 40.0625em){.govuk-inset-text{margin-top:30px}}@media (min-width: 40.0625em){.govuk-inset-text{margin-bottom:30px}}.govuk-inset-text>:first-child{margin-top:0}.govuk-inset-text>:only-child,.govuk-inset-text>:last-child{margin-bottom:0}.govuk-notification-banner{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-bottom:30px;border:5px solid #1d70b8;background-color:#1d70b8}@media print{.govuk-notification-banner{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-notification-banner{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-notification-banner{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-notification-banner{margin-bottom:50px}}.govuk-notification-banner:focus{outline:3px solid #ffdd00}.govuk-notification-banner__header{padding:2px 15px 5px;border-bottom:1px solid transparent}@media (min-width: 40.0625em){.govuk-notification-banner__header{padding:2px 20px 5px}}.govuk-notification-banner__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;margin:0;padding:0;color:#fff}@media print{.govuk-notification-banner__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-notification-banner__title{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-notification-banner__title{font-size:14pt;line-height:1.15}}.govuk-notification-banner__content{color:#0b0c0c;padding:15px;background-color:#fff}@media print{.govuk-notification-banner__content{color:#000}}@media (min-width: 40.0625em){.govuk-notification-banner__content{padding:20px}}.govuk-notification-banner__content>*{box-sizing:border-box;max-width:605px}.govuk-notification-banner__content>:last-child{margin-bottom:0}.govuk-notification-banner__heading{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin:0 0 15px;padding:0}@media print{.govuk-notification-banner__heading{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-notification-banner__heading{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-notification-banner__heading{font-size:18pt;line-height:1.15}}.govuk-notification-banner__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-notification-banner__link{font-family:sans-serif}}.govuk-notification-banner__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-notification-banner__link:link,.govuk-notification-banner__link:visited{color:#1d70b8}.govuk-notification-banner__link:hover{color:#003078}.govuk-notification-banner__link:active{color:#0b0c0c}.govuk-notification-banner__link:focus{color:#0b0c0c}.govuk-notification-banner--success{border-color:#00703c;background-color:#00703c}.govuk-notification-banner--success .govuk-notification-banner__link:link,.govuk-notification-banner--success .govuk-notification-banner__link:visited{color:#00703c}.govuk-notification-banner--success .govuk-notification-banner__link:hover{color:#004e2a}.govuk-notification-banner--success .govuk-notification-banner__link:active{color:#00703c}.govuk-notification-banner--success .govuk-notification-banner__link:focus{color:#0b0c0c}.govuk-pagination{margin-bottom:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}@media (min-width: 40.0625em){.govuk-pagination{margin-bottom:30px}}@media (min-width: 40.0625em){.govuk-pagination{-ms-flex-direction:row;flex-direction:row;-ms-flex-align:start;align-items:flex-start}}.govuk-pagination__list{margin:0;padding:0;list-style:none}.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;position:relative;min-width:45px;min-height:45px;padding:10px 15px;float:left}@media print{.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-size:14pt;line-height:1.15}}.govuk-pagination__item:hover,.govuk-pagination__next:hover,.govuk-pagination__prev:hover{background-color:#f3f2f1}.govuk-pagination__item{display:none;text-align:center}@media (min-width: 40.0625em){.govuk-pagination__item{display:block}}.govuk-pagination__prev,.govuk-pagination__next{font-weight:700}.govuk-pagination__prev .govuk-pagination__link,.govuk-pagination__next .govuk-pagination__link{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.govuk-pagination__prev{padding-left:0}.govuk-pagination__next{padding-right:0}.govuk-pagination__item--current,.govuk-pagination__item--ellipses,.govuk-pagination__item:first-child,.govuk-pagination__item:last-child{display:block}.govuk-pagination__item--current{font-weight:700;outline:1px solid transparent;background-color:#1d70b8}.govuk-pagination__item--current:hover{background-color:#1d70b8}.govuk-pagination__item--current .govuk-pagination__link:link,.govuk-pagination__item--current .govuk-pagination__link:visited{color:#fff}.govuk-pagination__item--current .govuk-pagination__link:hover,.govuk-pagination__item--current .govuk-pagination__link:active{color:#fffffffc}.govuk-pagination__item--current .govuk-pagination__link:focus{color:#0b0c0c}.govuk-pagination__item--ellipses{font-weight:700;color:#505a5f}.govuk-pagination__item--ellipses:hover{background-color:transparent}.govuk-pagination__link{display:block;min-width:15px}@media screen{.govuk-pagination__link:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}}.govuk-pagination__link:hover .govuk-pagination__link-title--decorated,.govuk-pagination__link:active .govuk-pagination__link-title--decorated{text-decoration:underline}.govuk-pagination__link:focus .govuk-pagination__icon{color:#0b0c0c}.govuk-pagination__link:focus .govuk-pagination__link-label{text-decoration:none}.govuk-pagination__link:focus .govuk-pagination__link-title--decorated{text-decoration:none}.govuk-pagination__link-label{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;text-decoration:underline;display:inline-block;padding-left:30px}@media print{.govuk-pagination__link-label{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-pagination__link-label{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-pagination__link-label{font-size:14pt;line-height:1.15}}.govuk-pagination__icon{width:.9375rem;height:.8125rem;color:#505a5f;fill:currentcolor;forced-color-adjust:auto}.govuk-pagination__icon--prev{margin-right:15px}.govuk-pagination__icon--next{margin-left:15px}.govuk-pagination--block{display:block}.govuk-pagination--block .govuk-pagination__item{padding:15px;float:none}.govuk-pagination--block .govuk-pagination__next,.govuk-pagination--block .govuk-pagination__prev{padding-left:0;float:none}.govuk-pagination--block .govuk-pagination__next{padding-right:15px}.govuk-pagination--block .govuk-pagination__next .govuk-pagination__icon{margin-left:0}.govuk-pagination--block .govuk-pagination__prev+.govuk-pagination__next{border-top:1px solid #b1b4b6}.govuk-pagination--block .govuk-pagination__link,.govuk-pagination--block .govuk-pagination__link-title{display:inline}.govuk-pagination--block .govuk-pagination__link-title:after{content:"";display:block}.govuk-pagination--block .govuk-pagination__link{text-align:left}.govuk-pagination--block .govuk-pagination__link:focus .govuk-pagination__link-label{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-pagination--block .govuk-pagination__link:not(:focus){text-decoration:none}.govuk-pagination--block .govuk-pagination__icon{margin-right:10px}.govuk-panel{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;margin-bottom:15px;padding:35px;border:5px solid transparent;text-align:center}@media print{.govuk-panel{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-panel{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-panel{font-size:14pt;line-height:1.15}}@media (max-width: 40.0525em){.govuk-panel{padding:10px;overflow-wrap:break-word;word-wrap:break-word}}.govuk-panel--confirmation{color:#fff;background:#00703c}@media print{.govuk-panel--confirmation{border-color:currentcolor;color:#000;background:none}}.govuk-panel__title{margin-top:0;margin-bottom:30px;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375}@media print{.govuk-panel__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-panel__title{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-panel__title{font-size:32pt;line-height:1.15}}.govuk-panel__title:last-child{margin-bottom:0}.govuk-panel__body{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:24px;font-size:1.5rem;line-height:1.0416666667}@media print{.govuk-panel__body{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-panel__body{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-panel__body{font-size:24pt;line-height:1.05}}.govuk-tag{display:inline-block;outline:2px solid transparent;outline-offset:-2px;color:#fff;background-color:#1d70b8;letter-spacing:1px;text-decoration:none;text-transform:uppercase;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:14px;font-size:.875rem;line-height:1;padding:5px 8px 4px}@media print{.govuk-tag{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-tag{font-size:16px;font-size:1rem;line-height:1}}@media print{.govuk-tag{font-size:14pt;line-height:1}}.govuk-tag--grey{color:#383f43;background:#eeefef}.govuk-tag--purple{color:#3d2375;background:#dbd5e9}.govuk-tag--turquoise{color:#10403c;background:#bfe3e0}.govuk-tag--blue{color:#144e81;background:#d2e2f1}.govuk-tag--yellow{color:#594d00;background:#fff7bf}.govuk-tag--orange{color:#6e3619;background:#fcd6c3}.govuk-tag--red{color:#942514;background:#f6d7d2}.govuk-tag--pink{color:#80224d;background:#f7d7e6}.govuk-tag--green{color:#005a30;background:#cce2d8}.govuk-phase-banner{padding-top:10px;padding-bottom:10px;border-bottom:1px solid #b1b4b6}.govuk-phase-banner__content{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;color:#0b0c0c;display:table;margin:0}@media print{.govuk-phase-banner__content{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-phase-banner__content{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-phase-banner__content{font-size:14pt;line-height:1.2}}@media print{.govuk-phase-banner__content{color:#000}}.govuk-phase-banner__content__tag{margin-right:10px}.govuk-phase-banner__text{display:table-cell;vertical-align:middle}.govuk-tabs{margin-top:5px;margin-bottom:20px}@media (min-width: 40.0625em){.govuk-tabs{margin-bottom:30px}}.govuk-tabs__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin-bottom:10px}@media print{.govuk-tabs__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-tabs__title{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-tabs__title{font-size:14pt;line-height:1.15}}@media print{.govuk-tabs__title{color:#000}}.govuk-tabs__list{margin:0 0 20px;padding:0;list-style:none}@media (min-width: 40.0625em){.govuk-tabs__list{margin-bottom:30px}}.govuk-tabs__list-item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-left:25px}@media print{.govuk-tabs__list-item{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-tabs__list-item{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-tabs__list-item{font-size:14pt;line-height:1.15}}.govuk-tabs__list-item:before{color:#0b0c0c;content:"—";margin-left:-25px;padding-right:5px}@media print{.govuk-tabs__list-item:before{color:#000}}.govuk-tabs__tab{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;display:inline-block;margin-bottom:10px}@media print{.govuk-tabs__tab{font-family:sans-serif}}.govuk-tabs__tab:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-tabs__tab:link{color:#1d70b8}.govuk-tabs__tab:visited{color:#4c2c92}.govuk-tabs__tab:hover{color:#003078}.govuk-tabs__tab:active{color:#0b0c0c}.govuk-tabs__tab:focus{color:#0b0c0c}.govuk-tabs__panel{margin-bottom:30px}@media (min-width: 40.0625em){.govuk-tabs__panel{margin-bottom:50px}}@media (min-width: 40.0625em){.js-enabled .govuk-tabs__list{margin-bottom:0;border-bottom:1px solid #b1b4b6}.js-enabled .govuk-tabs__list:after{content:"";display:block;clear:both}.js-enabled .govuk-tabs__title{display:none}.js-enabled .govuk-tabs__list-item{position:relative;margin-right:5px;margin-bottom:0;margin-left:0;padding:10px 20px;float:left;background-color:#f3f2f1;text-align:center}.js-enabled .govuk-tabs__list-item:before{content:none}.js-enabled .govuk-tabs__list-item--selected{position:relative;margin-top:-5px;margin-bottom:-1px;padding:14px 19px 16px;border:1px solid #b1b4b6;border-bottom:0;background-color:#fff}.js-enabled .govuk-tabs__list-item--selected .govuk-tabs__tab{text-decoration:none}.js-enabled .govuk-tabs__tab{margin-bottom:0}.js-enabled .govuk-tabs__tab:link,.js-enabled .govuk-tabs__tab:visited{color:#0b0c0c}}@media print and (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:link,.js-enabled .govuk-tabs__tab:visited{color:#000}}@media (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:hover{color:#0b0c0cfc}.js-enabled .govuk-tabs__tab:active,.js-enabled .govuk-tabs__tab:focus{color:#0b0c0c}}@media print and (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:active,.js-enabled .govuk-tabs__tab:focus{color:#000}}@media (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.js-enabled .govuk-tabs__panel{margin-bottom:0;padding:30px 20px;border:1px solid #b1b4b6;border-top:0}.js-enabled .govuk-tabs__panel>:last-child{margin-bottom:0}.js-enabled .govuk-tabs__panel--hidden{display:none}}.govuk-radios__item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;display:block;position:relative;min-height:40px;margin-bottom:10px;padding-left:40px;clear:left}@media print{.govuk-radios__item{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-radios__item{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-radios__item{font-size:14pt;line-height:1.15}}.govuk-radios__item:last-child,.govuk-radios__item:last-of-type{margin-bottom:0}.govuk-radios__input{cursor:pointer;position:absolute;z-index:1;top:-2px;left:-2px;width:44px;height:44px;margin:0;opacity:0}.govuk-radios__label{display:inline-block;margin-bottom:0;padding:8px 15px 5px;cursor:pointer;-ms-touch-action:manipulation;touch-action:manipulation}.govuk-radios__label:before{content:"";box-sizing:border-box;position:absolute;top:0;left:0;width:40px;height:40px;border:2px solid currentcolor;border-radius:50%;background:transparent}.govuk-radios__label:after{content:"";position:absolute;top:10px;left:10px;width:0;height:0;border:10px solid currentcolor;border-radius:50%;opacity:0;background:currentcolor}.govuk-radios__hint{display:block;padding-right:15px;padding-left:15px}.govuk-radios__input:focus+.govuk-radios__label:before{border-width:4px;outline:3px solid transparent;outline-offset:1px;box-shadow:0 0 0 4px #fd0}@media screen and (forced-colors: active),(-ms-high-contrast: active){.govuk-radios__input:focus+.govuk-radios__label:before{outline-color:Highlight}}.govuk-radios__input:checked+.govuk-radios__label:after{opacity:1}.govuk-radios__input:disabled,.govuk-radios__input:disabled+.govuk-radios__label{cursor:not-allowed}.govuk-radios__input:disabled+.govuk-radios__label,.govuk-radios__input:disabled~.govuk-hint{opacity:.5}@media (min-width: 40.0625em){.govuk-radios--inline:after{content:"";display:block;clear:both}.govuk-radios--inline .govuk-radios__item{margin-right:20px;float:left;clear:none}}.govuk-radios__divider{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;width:40px;margin-bottom:10px;text-align:center}@media print{.govuk-radios__divider{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-radios__divider{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-radios__divider{font-size:14pt;line-height:1.15}}@media print{.govuk-radios__divider{color:#000}}.govuk-radios__conditional{margin-bottom:15px;margin-left:18px;padding-left:33px;border-left:4px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-radios__conditional{margin-bottom:20px}}.js-enabled .govuk-radios__conditional--hidden{display:none}.govuk-radios__conditional>:last-child{margin-bottom:0}.govuk-radios--small .govuk-radios__item{min-height:0;margin-bottom:0;padding-left:34px;float:left}.govuk-radios--small .govuk-radios__item:after{content:"";display:block;clear:both}.govuk-radios--small .govuk-radios__input{left:-10px}.govuk-radios--small .govuk-radios__label{margin-top:-2px;padding:13px 15px 13px 1px;float:left}@media (min-width: 40.0625em){.govuk-radios--small .govuk-radios__label{padding:11px 15px 10px 1px}}.govuk-radios--small .govuk-radios__label:before{top:8px;width:24px;height:24px}.govuk-radios--small .govuk-radios__label:after{top:15px;left:7px;border-width:5px}.govuk-radios--small .govuk-radios__hint{padding:0;clear:both;pointer-events:none}.govuk-radios--small .govuk-radios__conditional{margin-left:10px;padding-left:20px;clear:both}.govuk-radios--small .govuk-radios__divider{width:24px;margin-bottom:5px}.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:not(:disabled)+.govuk-radios__label:before{box-shadow:0 0 0 10px #b1b4b6}.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:focus+.govuk-radios__label:before{box-shadow:0 0 0 4px #fd0,0 0 0 10px #b1b4b6}@media (hover: none),(pointer: coarse){.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:not(:disabled)+.govuk-radios__label:before{box-shadow:initial}.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:focus+.govuk-radios__label:before{box-shadow:0 0 0 4px #fd0}}.govuk-select{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;min-width:11.5em;max-width:100%;height:40px;height:2.5rem;padding:5px;border:2px solid #0b0c0c;color:#0b0c0c;background-color:#fff}@media print{.govuk-select{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-select{font-size:19px;font-size:1.1875rem;line-height:1.25}}@media print{.govuk-select{font-size:14pt;line-height:1.25}}.govuk-select:focus{outline:3px solid #ffdd00;outline-offset:0;box-shadow:inset 0 0 0 2px}.govuk-select:disabled{opacity:.5;color:inherit;cursor:not-allowed}.govuk-select option:active,.govuk-select option:checked,.govuk-select:focus::-ms-value{color:#fff;background-color:#1d70b8}.govuk-select--error{border-color:#d4351c}.govuk-select--error:focus{border-color:#0b0c0c}.govuk-skip-link{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;font-size:14px;font-size:.875rem;line-height:1.1428571429;display:block;padding:10px 15px}.govuk-skip-link:active,.govuk-skip-link:focus{position:static!important;width:auto!important;height:auto!important;margin:inherit!important;overflow:visible!important;clip:auto!important;-webkit-clip-path:none!important;clip-path:none!important;white-space:inherit!important}@media print{.govuk-skip-link{font-family:sans-serif}}.govuk-skip-link:link,.govuk-skip-link:visited{color:#0b0c0c}@media print{.govuk-skip-link:link,.govuk-skip-link:visited{color:#000}}.govuk-skip-link:hover{color:#0b0c0cfc}.govuk-skip-link:active,.govuk-skip-link:focus{color:#0b0c0c}@media print{.govuk-skip-link:active,.govuk-skip-link:focus{color:#000}}@media (min-width: 40.0625em){.govuk-skip-link{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-skip-link{font-size:14pt;line-height:1.2}}@supports (padding: max(0px)){.govuk-skip-link{padding-right:max(15px,calc(15px + env(safe-area-inset-right)));padding-left:max(15px,calc(15px + env(safe-area-inset-left)))}}.govuk-skip-link:focus{outline:3px solid #ffdd00;outline-offset:0;background-color:#fd0}.govuk-skip-link-focused-element:focus{outline:none}.govuk-summary-list{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin:0 0 20px}@media print{.govuk-summary-list{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-summary-list{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-summary-list{font-size:14pt;line-height:1.15}}@media print{.govuk-summary-list{color:#000}}@media (min-width: 40.0625em){.govuk-summary-list{display:table;width:100%;table-layout:fixed;border-collapse:collapse}}@media (min-width: 40.0625em){.govuk-summary-list{margin-bottom:30px}}.govuk-summary-list__row{border-bottom:1px solid #b1b4b6}@media (max-width: 40.0525em){.govuk-summary-list__row{margin-bottom:15px}}@media (min-width: 40.0625em){.govuk-summary-list__row{display:table-row}}.govuk-summary-list__row:not(.govuk-summary-list__row--no-actions)>:last-child{padding-right:0}@media (min-width: 40.0625em){.govuk-summary-list__row--no-actions:after{content:"";display:table-cell;width:20%}}.govuk-summary-list__key,.govuk-summary-list__value,.govuk-summary-list__actions{margin:0}@media (min-width: 40.0625em){.govuk-summary-list__key,.govuk-summary-list__value,.govuk-summary-list__actions{display:table-cell;padding-top:10px;padding-right:20px;padding-bottom:10px}}.govuk-summary-list__actions{margin-bottom:15px}@media (min-width: 40.0625em){.govuk-summary-list__actions{width:20%;padding-right:0;text-align:right}}.govuk-summary-list__key,.govuk-summary-list__value{word-wrap:break-word;overflow-wrap:break-word}.govuk-summary-list__key{margin-bottom:5px;font-weight:700}@media (min-width: 40.0625em){.govuk-summary-list__key{width:30%}}@media (max-width: 40.0525em){.govuk-summary-list__value{margin-bottom:15px}}.govuk-summary-list__value>p{margin-bottom:10px}.govuk-summary-list__value>:last-child{margin-bottom:0}.govuk-summary-list__actions-list{width:100%;margin:0;padding:0}.govuk-summary-list__actions-list-item{display:inline-block}@media (max-width: 40.0525em){.govuk-summary-list__actions-list-item{margin-right:10px;padding-right:10px}.govuk-summary-list__actions-list-item:not(:last-child){border-right:1px solid #b1b4b6}.govuk-summary-list__actions-list-item:last-child{margin-right:0;padding-right:0;border:0}}@media (min-width: 40.0625em){.govuk-summary-list__actions-list-item{margin-left:10px;padding-left:10px}.govuk-summary-list__actions-list-item:not(:first-child){border-left:1px solid #b1b4b6}.govuk-summary-list__actions-list-item:first-child{margin-left:0;padding-left:0;border:0}}.govuk-summary-list--no-border .govuk-summary-list__row{border:0}@media (min-width: 40.0625em){.govuk-summary-list--no-border .govuk-summary-list__key,.govuk-summary-list--no-border .govuk-summary-list__value,.govuk-summary-list--no-border .govuk-summary-list__actions{padding-bottom:11px}}.govuk-summary-list__row--no-border{border:0}@media (min-width: 40.0625em){.govuk-summary-list__row--no-border .govuk-summary-list__key,.govuk-summary-list__row--no-border .govuk-summary-list__value,.govuk-summary-list__row--no-border .govuk-summary-list__actions{padding-bottom:11px}}.govuk-summary-card{margin-bottom:20px;border:1px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-summary-card{margin-bottom:30px}}.govuk-summary-card__title-wrapper{padding:15px;border-bottom:1px solid transparent;background-color:#f3f2f1}@media (min-width: 40.0625em){.govuk-summary-card__title-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:nowrap;flex-wrap:nowrap;padding:15px 20px}}.govuk-summary-card__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;margin:5px 20px 10px 0}@media print{.govuk-summary-card__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-summary-card__title{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-summary-card__title{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-summary-card__title{margin-bottom:5px}}.govuk-summary-card__actions{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;row-gap:10px;margin:5px 0;padding:0;list-style:none}@media print{.govuk-summary-card__actions{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-summary-card__actions{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-summary-card__actions{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-summary-card__actions{-ms-flex-pack:right;justify-content:right;text-align:right}}.govuk-summary-card__action{display:inline;margin:0 10px 0 0;padding-right:10px;border-right:1px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-summary-card__action{margin-right:0}}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.govuk-summary-card__action{margin-bottom:5px}}.govuk-summary-card__action:last-child{margin:0;padding-right:0;border-right:none}@media (min-width: 40.0625em){.govuk-summary-card__action:last-child{padding-left:10px}}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.govuk-summary-card__action:last-child{margin-bottom:0}}.govuk-summary-card__content{padding:15px 15px 0}@media (min-width: 40.0625em){.govuk-summary-card__content{padding:15px 20px}}.govuk-summary-card__content .govuk-summary-list{margin-bottom:0}.govuk-summary-card__content .govuk-summary-list__row:last-of-type{margin-bottom:0;border-bottom:none}.govuk-table{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;width:100%;margin-bottom:20px;border-spacing:0;border-collapse:collapse}@media print{.govuk-table{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-table{font-size:14pt;line-height:1.15}}@media print{.govuk-table{color:#000}}@media (min-width: 40.0625em){.govuk-table{margin-bottom:30px}}.govuk-table__header{font-weight:700}.govuk-table__header,.govuk-table__cell{padding:10px 20px 10px 0;border-bottom:1px solid #b1b4b6;text-align:left;vertical-align:top}.govuk-table__cell--numeric{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:"tnum" 1;font-feature-settings:"tnum" 1;font-weight:400}@media print{.govuk-table__cell--numeric{font-family:sans-serif}}@supports (font-variant-numeric: tabular-nums){.govuk-table__cell--numeric{-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant-numeric:tabular-nums}}.govuk-table__header--numeric,.govuk-table__cell--numeric{text-align:right}.govuk-table__header:last-child,.govuk-table__cell:last-child{padding-right:0}.govuk-table__caption{font-weight:700;display:table-caption;text-align:left}.govuk-table__caption--xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;margin-bottom:15px}@media print{.govuk-table__caption--xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-table__caption--xl{font-size:32pt;line-height:1.15}}.govuk-table__caption--l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;margin-bottom:15px}@media print{.govuk-table__caption--l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--l{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-table__caption--l{font-size:24pt;line-height:1.05}}.govuk-table__caption--m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-bottom:15px}@media print{.govuk-table__caption--m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--m{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-table__caption--m{font-size:18pt;line-height:1.15}}.govuk-table__caption--s{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-table__caption--s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-table__caption--s{font-size:14pt;line-height:1.15}}.govuk-warning-text{position:relative;margin-bottom:20px;padding:10px 0}@media (min-width: 40.0625em){.govuk-warning-text{margin-bottom:30px}}.govuk-warning-text__assistive{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;padding:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;border:0!important;white-space:nowrap!important}.govuk-warning-text__assistive:before{content:" "}.govuk-warning-text__assistive:after{content:" "}.govuk-warning-text__icon{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;box-sizing:border-box;display:inline-block;position:absolute;left:0;min-width:35px;min-height:35px;margin-top:-7px;border:3px solid #0b0c0c;border-radius:50%;color:#fff;background:#0b0c0c;font-size:30px;line-height:29px;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;forced-color-adjust:none}@media print{.govuk-warning-text__icon{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-warning-text__icon{margin-top:-5px}}@media screen and (forced-colors: active){.govuk-warning-text__icon{border-color:windowText;color:windowText;background:transparent}}.govuk-warning-text__text{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;display:block;padding-left:45px}@media print{.govuk-warning-text__text{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-warning-text__text{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-warning-text__text{font-size:14pt;line-height:1.15}}@media print{.govuk-warning-text__text{color:#000}}.govuk-clearfix:after{content:"";display:block;clear:both}.govuk-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;padding:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;border:0!important;white-space:nowrap!important}.govuk-visually-hidden:before{content:" "}.govuk-visually-hidden:after{content:" "}.govuk-visually-hidden-focusable{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important}.govuk-visually-hidden-focusable:active,.govuk-visually-hidden-focusable:focus{position:static!important;width:auto!important;height:auto!important;margin:inherit!important;overflow:visible!important;clip:auto!important;-webkit-clip-path:none!important;clip-path:none!important;white-space:inherit!important}.govuk-\!-display-inline{display:inline!important}.govuk-\!-display-inline-block{display:inline-block!important}.govuk-\!-display-block{display:block!important}.govuk-\!-display-none{display:none!important}@media print{.govuk-\!-display-none-print{display:none!important}}.govuk-\!-margin-0{margin:0!important}.govuk-\!-margin-top-0{margin-top:0!important}.govuk-\!-margin-right-0{margin-right:0!important}.govuk-\!-margin-bottom-0{margin-bottom:0!important}.govuk-\!-margin-left-0{margin-left:0!important}.govuk-\!-margin-1{margin:5px!important}.govuk-\!-margin-top-1{margin-top:5px!important}.govuk-\!-margin-right-1{margin-right:5px!important}.govuk-\!-margin-bottom-1{margin-bottom:5px!important}.govuk-\!-margin-left-1{margin-left:5px!important}.govuk-\!-margin-2{margin:10px!important}.govuk-\!-margin-top-2{margin-top:10px!important}.govuk-\!-margin-right-2{margin-right:10px!important}.govuk-\!-margin-bottom-2{margin-bottom:10px!important}.govuk-\!-margin-left-2{margin-left:10px!important}.govuk-\!-margin-3{margin:15px!important}.govuk-\!-margin-top-3{margin-top:15px!important}.govuk-\!-margin-right-3{margin-right:15px!important}.govuk-\!-margin-bottom-3{margin-bottom:15px!important}.govuk-\!-margin-left-3{margin-left:15px!important}.govuk-\!-margin-4{margin:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-4{margin:20px!important}}.govuk-\!-margin-top-4{margin-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-4{margin-top:20px!important}}.govuk-\!-margin-right-4{margin-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-4{margin-right:20px!important}}.govuk-\!-margin-bottom-4{margin-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-4{margin-bottom:20px!important}}.govuk-\!-margin-left-4{margin-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-4{margin-left:20px!important}}.govuk-\!-margin-5{margin:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-5{margin:25px!important}}.govuk-\!-margin-top-5{margin-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-5{margin-top:25px!important}}.govuk-\!-margin-right-5{margin-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-5{margin-right:25px!important}}.govuk-\!-margin-bottom-5{margin-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-5{margin-bottom:25px!important}}.govuk-\!-margin-left-5{margin-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-5{margin-left:25px!important}}.govuk-\!-margin-6{margin:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-6{margin:30px!important}}.govuk-\!-margin-top-6{margin-top:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-6{margin-top:30px!important}}.govuk-\!-margin-right-6{margin-right:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-6{margin-right:30px!important}}.govuk-\!-margin-bottom-6{margin-bottom:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-6{margin-bottom:30px!important}}.govuk-\!-margin-left-6{margin-left:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-6{margin-left:30px!important}}.govuk-\!-margin-7{margin:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-7{margin:40px!important}}.govuk-\!-margin-top-7{margin-top:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-7{margin-top:40px!important}}.govuk-\!-margin-right-7{margin-right:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-7{margin-right:40px!important}}.govuk-\!-margin-bottom-7{margin-bottom:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-7{margin-bottom:40px!important}}.govuk-\!-margin-left-7{margin-left:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-7{margin-left:40px!important}}.govuk-\!-margin-8{margin:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-8{margin:50px!important}}.govuk-\!-margin-top-8{margin-top:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-8{margin-top:50px!important}}.govuk-\!-margin-right-8{margin-right:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-8{margin-right:50px!important}}.govuk-\!-margin-bottom-8{margin-bottom:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-8{margin-bottom:50px!important}}.govuk-\!-margin-left-8{margin-left:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-8{margin-left:50px!important}}.govuk-\!-margin-9{margin:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-9{margin:60px!important}}.govuk-\!-margin-top-9{margin-top:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-9{margin-top:60px!important}}.govuk-\!-margin-right-9{margin-right:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-9{margin-right:60px!important}}.govuk-\!-margin-bottom-9{margin-bottom:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-9{margin-bottom:60px!important}}.govuk-\!-margin-left-9{margin-left:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-9{margin-left:60px!important}}.govuk-\!-padding-0{padding:0!important}.govuk-\!-padding-top-0{padding-top:0!important}.govuk-\!-padding-right-0{padding-right:0!important}.govuk-\!-padding-bottom-0{padding-bottom:0!important}.govuk-\!-padding-left-0{padding-left:0!important}.govuk-\!-padding-1{padding:5px!important}.govuk-\!-padding-top-1{padding-top:5px!important}.govuk-\!-padding-right-1{padding-right:5px!important}.govuk-\!-padding-bottom-1{padding-bottom:5px!important}.govuk-\!-padding-left-1{padding-left:5px!important}.govuk-\!-padding-2{padding:10px!important}.govuk-\!-padding-top-2{padding-top:10px!important}.govuk-\!-padding-right-2{padding-right:10px!important}.govuk-\!-padding-bottom-2{padding-bottom:10px!important}.govuk-\!-padding-left-2{padding-left:10px!important}.govuk-\!-padding-3{padding:15px!important}.govuk-\!-padding-top-3{padding-top:15px!important}.govuk-\!-padding-right-3{padding-right:15px!important}.govuk-\!-padding-bottom-3{padding-bottom:15px!important}.govuk-\!-padding-left-3{padding-left:15px!important}.govuk-\!-padding-4{padding:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-4{padding:20px!important}}.govuk-\!-padding-top-4{padding-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-4{padding-top:20px!important}}.govuk-\!-padding-right-4{padding-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-4{padding-right:20px!important}}.govuk-\!-padding-bottom-4{padding-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-4{padding-bottom:20px!important}}.govuk-\!-padding-left-4{padding-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-4{padding-left:20px!important}}.govuk-\!-padding-5{padding:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-5{padding:25px!important}}.govuk-\!-padding-top-5{padding-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-5{padding-top:25px!important}}.govuk-\!-padding-right-5{padding-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-5{padding-right:25px!important}}.govuk-\!-padding-bottom-5{padding-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-5{padding-bottom:25px!important}}.govuk-\!-padding-left-5{padding-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-5{padding-left:25px!important}}.govuk-\!-padding-6{padding:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-6{padding:30px!important}}.govuk-\!-padding-top-6{padding-top:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-6{padding-top:30px!important}}.govuk-\!-padding-right-6{padding-right:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-6{padding-right:30px!important}}.govuk-\!-padding-bottom-6{padding-bottom:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-6{padding-bottom:30px!important}}.govuk-\!-padding-left-6{padding-left:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-6{padding-left:30px!important}}.govuk-\!-padding-7{padding:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-7{padding:40px!important}}.govuk-\!-padding-top-7{padding-top:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-7{padding-top:40px!important}}.govuk-\!-padding-right-7{padding-right:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-7{padding-right:40px!important}}.govuk-\!-padding-bottom-7{padding-bottom:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-7{padding-bottom:40px!important}}.govuk-\!-padding-left-7{padding-left:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-7{padding-left:40px!important}}.govuk-\!-padding-8{padding:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-8{padding:50px!important}}.govuk-\!-padding-top-8{padding-top:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-8{padding-top:50px!important}}.govuk-\!-padding-right-8{padding-right:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-8{padding-right:50px!important}}.govuk-\!-padding-bottom-8{padding-bottom:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-8{padding-bottom:50px!important}}.govuk-\!-padding-left-8{padding-left:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-8{padding-left:50px!important}}.govuk-\!-padding-9{padding:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-9{padding:60px!important}}.govuk-\!-padding-top-9{padding-top:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-9{padding-top:60px!important}}.govuk-\!-padding-right-9{padding-right:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-9{padding-right:60px!important}}.govuk-\!-padding-bottom-9{padding-bottom:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-9{padding-bottom:60px!important}}.govuk-\!-padding-left-9{padding-left:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-9{padding-left:60px!important}}.govuk-\!-margin-static-0,.govuk-\!-static-margin-0{margin:0!important}.govuk-\!-margin-top-static-0,.govuk-\!-static-margin-top-0{margin-top:0!important}.govuk-\!-margin-right-static-0,.govuk-\!-static-margin-right-0{margin-right:0!important}.govuk-\!-margin-bottom-static-0,.govuk-\!-static-margin-bottom-0{margin-bottom:0!important}.govuk-\!-margin-left-static-0,.govuk-\!-static-margin-left-0{margin-left:0!important}.govuk-\!-margin-static-1,.govuk-\!-static-margin-1{margin:5px!important}.govuk-\!-margin-top-static-1,.govuk-\!-static-margin-top-1{margin-top:5px!important}.govuk-\!-margin-right-static-1,.govuk-\!-static-margin-right-1{margin-right:5px!important}.govuk-\!-margin-bottom-static-1,.govuk-\!-static-margin-bottom-1{margin-bottom:5px!important}.govuk-\!-margin-left-static-1,.govuk-\!-static-margin-left-1{margin-left:5px!important}.govuk-\!-margin-static-2,.govuk-\!-static-margin-2{margin:10px!important}.govuk-\!-margin-top-static-2,.govuk-\!-static-margin-top-2{margin-top:10px!important}.govuk-\!-margin-right-static-2,.govuk-\!-static-margin-right-2{margin-right:10px!important}.govuk-\!-margin-bottom-static-2,.govuk-\!-static-margin-bottom-2{margin-bottom:10px!important}.govuk-\!-margin-left-static-2,.govuk-\!-static-margin-left-2{margin-left:10px!important}.govuk-\!-margin-static-3,.govuk-\!-static-margin-3{margin:15px!important}.govuk-\!-margin-top-static-3,.govuk-\!-static-margin-top-3{margin-top:15px!important}.govuk-\!-margin-right-static-3,.govuk-\!-static-margin-right-3{margin-right:15px!important}.govuk-\!-margin-bottom-static-3,.govuk-\!-static-margin-bottom-3{margin-bottom:15px!important}.govuk-\!-margin-left-static-3,.govuk-\!-static-margin-left-3{margin-left:15px!important}.govuk-\!-margin-static-4,.govuk-\!-static-margin-4{margin:20px!important}.govuk-\!-margin-top-static-4,.govuk-\!-static-margin-top-4{margin-top:20px!important}.govuk-\!-margin-right-static-4,.govuk-\!-static-margin-right-4{margin-right:20px!important}.govuk-\!-margin-bottom-static-4,.govuk-\!-static-margin-bottom-4{margin-bottom:20px!important}.govuk-\!-margin-left-static-4,.govuk-\!-static-margin-left-4{margin-left:20px!important}.govuk-\!-margin-static-5,.govuk-\!-static-margin-5{margin:25px!important}.govuk-\!-margin-top-static-5,.govuk-\!-static-margin-top-5{margin-top:25px!important}.govuk-\!-margin-right-static-5,.govuk-\!-static-margin-right-5{margin-right:25px!important}.govuk-\!-margin-bottom-static-5,.govuk-\!-static-margin-bottom-5{margin-bottom:25px!important}.govuk-\!-margin-left-static-5,.govuk-\!-static-margin-left-5{margin-left:25px!important}.govuk-\!-margin-static-6,.govuk-\!-static-margin-6{margin:30px!important}.govuk-\!-margin-top-static-6,.govuk-\!-static-margin-top-6{margin-top:30px!important}.govuk-\!-margin-right-static-6,.govuk-\!-static-margin-right-6{margin-right:30px!important}.govuk-\!-margin-bottom-static-6,.govuk-\!-static-margin-bottom-6{margin-bottom:30px!important}.govuk-\!-margin-left-static-6,.govuk-\!-static-margin-left-6{margin-left:30px!important}.govuk-\!-margin-static-7,.govuk-\!-static-margin-7{margin:40px!important}.govuk-\!-margin-top-static-7,.govuk-\!-static-margin-top-7{margin-top:40px!important}.govuk-\!-margin-right-static-7,.govuk-\!-static-margin-right-7{margin-right:40px!important}.govuk-\!-margin-bottom-static-7,.govuk-\!-static-margin-bottom-7{margin-bottom:40px!important}.govuk-\!-margin-left-static-7,.govuk-\!-static-margin-left-7{margin-left:40px!important}.govuk-\!-margin-static-8,.govuk-\!-static-margin-8{margin:50px!important}.govuk-\!-margin-top-static-8,.govuk-\!-static-margin-top-8{margin-top:50px!important}.govuk-\!-margin-right-static-8,.govuk-\!-static-margin-right-8{margin-right:50px!important}.govuk-\!-margin-bottom-static-8,.govuk-\!-static-margin-bottom-8{margin-bottom:50px!important}.govuk-\!-margin-left-static-8,.govuk-\!-static-margin-left-8{margin-left:50px!important}.govuk-\!-margin-static-9,.govuk-\!-static-margin-9{margin:60px!important}.govuk-\!-margin-top-static-9,.govuk-\!-static-margin-top-9{margin-top:60px!important}.govuk-\!-margin-right-static-9,.govuk-\!-static-margin-right-9{margin-right:60px!important}.govuk-\!-margin-bottom-static-9,.govuk-\!-static-margin-bottom-9{margin-bottom:60px!important}.govuk-\!-margin-left-static-9,.govuk-\!-static-margin-left-9{margin-left:60px!important}.govuk-\!-padding-static-0,.govuk-\!-static-padding-0{padding:0!important}.govuk-\!-padding-top-static-0,.govuk-\!-static-padding-top-0{padding-top:0!important}.govuk-\!-padding-right-static-0,.govuk-\!-static-padding-right-0{padding-right:0!important}.govuk-\!-padding-bottom-static-0,.govuk-\!-static-padding-bottom-0{padding-bottom:0!important}.govuk-\!-padding-left-static-0,.govuk-\!-static-padding-left-0{padding-left:0!important}.govuk-\!-padding-static-1,.govuk-\!-static-padding-1{padding:5px!important}.govuk-\!-padding-top-static-1,.govuk-\!-static-padding-top-1{padding-top:5px!important}.govuk-\!-padding-right-static-1,.govuk-\!-static-padding-right-1{padding-right:5px!important}.govuk-\!-padding-bottom-static-1,.govuk-\!-static-padding-bottom-1{padding-bottom:5px!important}.govuk-\!-padding-left-static-1,.govuk-\!-static-padding-left-1{padding-left:5px!important}.govuk-\!-padding-static-2,.govuk-\!-static-padding-2{padding:10px!important}.govuk-\!-padding-top-static-2,.govuk-\!-static-padding-top-2{padding-top:10px!important}.govuk-\!-padding-right-static-2,.govuk-\!-static-padding-right-2{padding-right:10px!important}.govuk-\!-padding-bottom-static-2,.govuk-\!-static-padding-bottom-2{padding-bottom:10px!important}.govuk-\!-padding-left-static-2,.govuk-\!-static-padding-left-2{padding-left:10px!important}.govuk-\!-padding-static-3,.govuk-\!-static-padding-3{padding:15px!important}.govuk-\!-padding-top-static-3,.govuk-\!-static-padding-top-3{padding-top:15px!important}.govuk-\!-padding-right-static-3,.govuk-\!-static-padding-right-3{padding-right:15px!important}.govuk-\!-padding-bottom-static-3,.govuk-\!-static-padding-bottom-3{padding-bottom:15px!important}.govuk-\!-padding-left-static-3,.govuk-\!-static-padding-left-3{padding-left:15px!important}.govuk-\!-padding-static-4,.govuk-\!-static-padding-4{padding:20px!important}.govuk-\!-padding-top-static-4,.govuk-\!-static-padding-top-4{padding-top:20px!important}.govuk-\!-padding-right-static-4,.govuk-\!-static-padding-right-4{padding-right:20px!important}.govuk-\!-padding-bottom-static-4,.govuk-\!-static-padding-bottom-4{padding-bottom:20px!important}.govuk-\!-padding-left-static-4,.govuk-\!-static-padding-left-4{padding-left:20px!important}.govuk-\!-padding-static-5,.govuk-\!-static-padding-5{padding:25px!important}.govuk-\!-padding-top-static-5,.govuk-\!-static-padding-top-5{padding-top:25px!important}.govuk-\!-padding-right-static-5,.govuk-\!-static-padding-right-5{padding-right:25px!important}.govuk-\!-padding-bottom-static-5,.govuk-\!-static-padding-bottom-5{padding-bottom:25px!important}.govuk-\!-padding-left-static-5,.govuk-\!-static-padding-left-5{padding-left:25px!important}.govuk-\!-padding-static-6,.govuk-\!-static-padding-6{padding:30px!important}.govuk-\!-padding-top-static-6,.govuk-\!-static-padding-top-6{padding-top:30px!important}.govuk-\!-padding-right-static-6,.govuk-\!-static-padding-right-6{padding-right:30px!important}.govuk-\!-padding-bottom-static-6,.govuk-\!-static-padding-bottom-6{padding-bottom:30px!important}.govuk-\!-padding-left-static-6,.govuk-\!-static-padding-left-6{padding-left:30px!important}.govuk-\!-padding-static-7,.govuk-\!-static-padding-7{padding:40px!important}.govuk-\!-padding-top-static-7,.govuk-\!-static-padding-top-7{padding-top:40px!important}.govuk-\!-padding-right-static-7,.govuk-\!-static-padding-right-7{padding-right:40px!important}.govuk-\!-padding-bottom-static-7,.govuk-\!-static-padding-bottom-7{padding-bottom:40px!important}.govuk-\!-padding-left-static-7,.govuk-\!-static-padding-left-7{padding-left:40px!important}.govuk-\!-padding-static-8,.govuk-\!-static-padding-8{padding:50px!important}.govuk-\!-padding-top-static-8,.govuk-\!-static-padding-top-8{padding-top:50px!important}.govuk-\!-padding-right-static-8,.govuk-\!-static-padding-right-8{padding-right:50px!important}.govuk-\!-padding-bottom-static-8,.govuk-\!-static-padding-bottom-8{padding-bottom:50px!important}.govuk-\!-padding-left-static-8,.govuk-\!-static-padding-left-8{padding-left:50px!important}.govuk-\!-padding-static-9,.govuk-\!-static-padding-9{padding:60px!important}.govuk-\!-padding-top-static-9,.govuk-\!-static-padding-top-9{padding-top:60px!important}.govuk-\!-padding-right-static-9,.govuk-\!-static-padding-right-9{padding-right:60px!important}.govuk-\!-padding-bottom-static-9,.govuk-\!-static-padding-bottom-9{padding-bottom:60px!important}.govuk-\!-padding-left-static-9,.govuk-\!-static-padding-left-9{padding-left:60px!important}.govuk-\!-text-align-left{text-align:left!important}.govuk-\!-text-align-centre{text-align:center!important}.govuk-\!-text-align-right{text-align:right!important}.govuk-\!-font-size-80{font-size:53px!important;font-size:3.3125rem!important;line-height:1.0377358491!important}@media (min-width: 40.0625em){.govuk-\!-font-size-80{font-size:80px!important;font-size:5rem!important;line-height:1!important}}@media print{.govuk-\!-font-size-80{font-size:53pt!important;line-height:1.1!important}}.govuk-\!-font-size-48{font-size:32px!important;font-size:2rem!important;line-height:1.09375!important}@media (min-width: 40.0625em){.govuk-\!-font-size-48{font-size:48px!important;font-size:3rem!important;line-height:1.0416666667!important}}@media print{.govuk-\!-font-size-48{font-size:32pt!important;line-height:1.15!important}}.govuk-\!-font-size-36{font-size:24px!important;font-size:1.5rem!important;line-height:1.0416666667!important}@media (min-width: 40.0625em){.govuk-\!-font-size-36{font-size:36px!important;font-size:2.25rem!important;line-height:1.1111111111!important}}@media print{.govuk-\!-font-size-36{font-size:24pt!important;line-height:1.05!important}}.govuk-\!-font-size-27{font-size:18px!important;font-size:1.125rem!important;line-height:1.1111111111!important}@media (min-width: 40.0625em){.govuk-\!-font-size-27{font-size:27px!important;font-size:1.6875rem!important;line-height:1.1111111111!important}}@media print{.govuk-\!-font-size-27{font-size:18pt!important;line-height:1.15!important}}.govuk-\!-font-size-24{font-size:18px!important;font-size:1.125rem!important;line-height:1.1111111111!important}@media (min-width: 40.0625em){.govuk-\!-font-size-24{font-size:24px!important;font-size:1.5rem!important;line-height:1.25!important}}@media print{.govuk-\!-font-size-24{font-size:18pt!important;line-height:1.15!important}}.govuk-\!-font-size-19{font-size:16px!important;font-size:1rem!important;line-height:1.25!important}@media (min-width: 40.0625em){.govuk-\!-font-size-19{font-size:19px!important;font-size:1.1875rem!important;line-height:1.3157894737!important}}@media print{.govuk-\!-font-size-19{font-size:14pt!important;line-height:1.15!important}}.govuk-\!-font-size-16{font-size:14px!important;font-size:.875rem!important;line-height:1.1428571429!important}@media (min-width: 40.0625em){.govuk-\!-font-size-16{font-size:16px!important;font-size:1rem!important;line-height:1.25!important}}@media print{.govuk-\!-font-size-16{font-size:14pt!important;line-height:1.2!important}}.govuk-\!-font-size-14{font-size:12px!important;font-size:.75rem!important;line-height:1.25!important}@media (min-width: 40.0625em){.govuk-\!-font-size-14{font-size:14px!important;font-size:.875rem!important;line-height:1.4285714286!important}}@media print{.govuk-\!-font-size-14{font-size:12pt!important;line-height:1.2!important}}.govuk-\!-font-weight-regular{font-weight:400!important}.govuk-\!-font-weight-bold{font-weight:700!important}.govuk-\!-width-full,.govuk-\!-width-three-quarters{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-three-quarters{width:75%!important}}.govuk-\!-width-two-thirds{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-two-thirds{width:66.66%!important}}.govuk-\!-width-one-half{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-one-half{width:50%!important}}.govuk-\!-width-one-third{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-one-third{width:33.33%!important}}.govuk-\!-width-one-quarter{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-one-quarter{width:25%!important}} diff --git a/browse_dropdown_filters/assets/main-88cc3b48.js b/browse_dropdown_filters/assets/main-88cc3b48.js deleted file mode 100644 index 808fdce4b..000000000 --- a/browse_dropdown_filters/assets/main-88cc3b48.js +++ /dev/null @@ -1 +0,0 @@ -import{S as K,i as Z,s as Q,c as me,a as W,e as p,b as ae,d as I,l as H,u as ge,g as ve,f as be,h as ke,t as C,j as L,k as T,m as oe,n as _e,o as se,p as q,q as w,r as h,v as _,w as X,x as ie,y as ye,z as we,A as R,B as $e,C as Ae,F as Se,D as z,E as ue,G as Be,H as D,I as J,J as re,K as O,L as Ee,M as Fe,N as Ie}from"./maplibre_helpers-5d84afaa.js";import{i as Te}from"./all-b6f1cdfd.js";import{A as Ne,a as je}from"./About-563eb94d.js";function Ce(l){let t,e,o,u;const f=l[2].default,a=me(f,l,l[1],null);let i=[{type:"button"},{class:"govuk-button"},{"data-module":"govuk-button"},l[0]],s={};for(let n=0;n{e(0,t=W(W({},t),oe(a))),"$$scope"in a&&e(1,u=a.$$scope)},t=oe(t),[t,u,o,f]}class De extends K{constructor(t){super(),Z(this,t,Le,Ce,Q,{})}}function fe(l,t,e){const o=l.slice();return o[7]=t[e][0],o[8]=t[e][1],o}function de(l){let t,e,o,u,f=!1,a,i,s=l[8]+"",n,d,c,B,v,j;return B=we(l[6][0]),{c(){t=p("div"),e=p("input"),a=w(),i=p("label"),n=q(s),c=w(),h(e,"class","govuk-radios__input"),h(e,"id",o=l[2]+l[7]),h(e,"type","radio"),e.__value=u=l[7],R(e,e.__value),h(i,"class","govuk-label govuk-radios__label"),h(i,"for",d=l[2]+l[7]),h(t,"class","govuk-radios__item"),B.p(e)},m(m,$){I(m,t,$),_(t,e),e.checked=e.__value===l[0],_(t,a),_(t,i),_(i,n),_(t,c),v||(j=[H(e,"change",l[5]),H(e,"change",l[4])],v=!0)},p(m,$){$&12&&o!==(o=m[2]+m[7])&&h(e,"id",o),$&8&&u!==(u=m[7])&&(e.__value=u,R(e,e.__value),f=!0),(f||$&9)&&(e.checked=e.__value===m[0]),$&8&&s!==(s=m[8]+"")&&X(n,s),$&12&&d!==(d=m[2]+m[7])&&h(i,"for",d)},d(m){m&&T(t),B.r(),v=!1,$e(j)}}}function Je(l){let t,e,o,u,f,a,i=se(l[3]),s=[];for(let n=0;n{"legend"in d&&e(1,o=d.legend),"id"in d&&e(2,u=d.id),"choices"in d&&e(3,f=d.choices),"value"in d&&e(0,a=d.value)},[a,o,u,f,s,n,i]}class Me extends K{constructor(t){super(),Z(this,t,Oe,Je,Q,{legend:1,id:2,choices:3,value:0})}}function qe(l){let t;return{c(){t=q("About")},m(e,o){I(e,t,o)},d(e){e&&T(t)}}}function Ge(l){let t,e,o,u,f;return{c(){t=p("input"),e=w(),o=p("datalist"),h(t,"class","govuk-input govuk-input--width-20"),h(t,"id","inputValue"),h(t,"data-testid","transport-authority"),h(t,"list","authorities-list"),h(o,"id","authorities-list")},m(a,i){I(a,t,i),R(t,l[0]),I(a,e,i),I(a,o,i),l[11](o),u||(f=H(t,"input",l[10]),u=!0)},p(a,i){i&1&&t.value!==a[0]&&R(t,a[0])},d(a){a&&(T(t),T(e),T(o)),l[11](null),u=!1,f()}}}function Pe(l){let t;return{c(){t=q("Start")},m(e,o){I(e,t,o)},d(e){e&&T(t)}}}function ce(l){let t,e;return{c(){t=p("i"),e=q(l[4])},m(o,u){I(o,t,u),_(t,e)},p(o,u){u&16&&X(e,o[4])},d(o){o&&T(t)}}}function Ve(l){let t,e,o,u,f,a,i,s,n,d,c,B,v,j,m,$,G,P,g,b,E,A,F,S,N;f=new Ae({props:{$$slots:{default:[qe]},$$scope:{ctx:l}}}),f.$on("click",l[9]),i=new Se({props:{label:"Select Transport Authority or Local Authority District",id:"inputValue",$$slots:{default:[Ge]},$$scope:{ctx:l}}}),n=new De({props:{disabled:!l[5],$$slots:{default:[Pe]},$$scope:{ctx:l}}}),n.$on("click",l[8]);function he(r){l[12](r)}let Y={legend:"Or pick from the map",id:"showBoundaries",choices:[["TA","Transport Authorities"],["LAD","Local Authority Districts"]]};l[3]!==void 0&&(Y.value=l[3]),v=new Me({props:Y}),z.push(()=>ue(v,"value",he)),v.$on("change",l[6]);let k=l[4]&&ce(l);g=new Be({props:{label:"Or upload an ATIP GeoJSON file",loadFile:l[7],id:"load-geojson"}});function pe(r){l[13](r)}let x={};return l[1]!==void 0&&(x.open=l[1]),F=new Ne({props:x}),z.push(()=>ue(F,"open",pe)),{c(){t=p("div"),e=p("div"),o=p("h1"),o.textContent="Welcome to ATIP v2",u=w(),D(f.$$.fragment),a=w(),D(i.$$.fragment),s=w(),D(n.$$.fragment),d=w(),c=p("hr"),B=w(),D(v.$$.fragment),m=w(),k&&k.c(),$=w(),G=p("hr"),P=w(),D(g.$$.fragment),b=w(),E=p("div"),E.innerHTML='
    ',A=w(),D(F.$$.fragment),h(o,"class","govuk-heading-l"),h(e,"class","govuk-grid-column-one-half left svelte-lyn11h"),h(E,"class","govuk-grid-column-one-half"),h(t,"class","govuk-grid-row")},m(r,y){I(r,t,y),_(t,e),_(e,o),_(e,u),J(f,e,null),_(e,a),J(i,e,null),_(e,s),J(n,e,null),_(e,d),_(e,c),_(e,B),J(v,e,null),_(e,m),k&&k.m(e,null),_(e,$),_(e,G),_(e,P),J(g,e,null),_(t,b),_(t,E),I(r,A,y),J(F,r,y),N=!0},p(r,[y]){const ee={};y&65536&&(ee.$$scope={dirty:y,ctx:r}),f.$set(ee);const te={};y&65541&&(te.$$scope={dirty:y,ctx:r}),i.$set(te);const U={};y&32&&(U.disabled=!r[5]),y&65536&&(U.$$scope={dirty:y,ctx:r}),n.$set(U);const le={};!j&&y&8&&(j=!0,le.value=r[3],re(()=>j=!1)),v.$set(le),r[4]?k?k.p(r,y):(k=ce(r),k.c(),k.m(e,$)):k&&(k.d(1),k=null);const ne={};!S&&y&2&&(S=!0,ne.open=r[1],re(()=>S=!1)),F.$set(ne)},i(r){N||(C(f.$$.fragment,r),C(i.$$.fragment,r),C(n.$$.fragment,r),C(v.$$.fragment,r),C(g.$$.fragment,r),C(F.$$.fragment,r),N=!0)},o(r){L(f.$$.fragment,r),L(i.$$.fragment,r),L(n.$$.fragment,r),L(v.$$.fragment,r),L(g.$$.fragment,r),L(F.$$.fragment,r),N=!1},d(r){r&&(T(t),T(A)),O(f),O(i),O(n),O(v),k&&k.d(),O(g),O(F,r)}}}let V="boundary",M="boundary-layer";function He(l){if(l.features.length>0){let t=l.features[0].properties;for(let e of["planning","v2","criticals"])if(t&&e in t)return e}return"v1"}function Re(l,t,e){let o,u=!1,f,a,i=new Set,s=null,n="TA";function d(){s==null||s.setFilter(M,["==",["get","level"],n])}let c=null;Ee(async()=>{Te();const b=await(await fetch(je)).text(),E=JSON.parse(b);for(let S of E.features){let N=document.createElement("option");N.value=S.properties.name,a.appendChild(N),i.add(S.properties.name)}s=new Fe.Map({container:"map",style:"https://api.maptiler.com/maps/streets/style.json?key=MZEJTanw3WpxRvt7qDfo"});let A=null;function F(){A!==null&&s.setFeatureState({source:V,id:A},{hover:!1})}s.on("load",function(){s.fitBounds(Ie(E),{padding:20,animate:!1}),s.addSource(V,{type:"geojson",data:E,generateId:!0}),s.addLayer({id:M,source:V,filter:["==",["get","level"],n],type:"fill",paint:{"fill-color":"rgb(200, 100, 240)","fill-outline-color":"rgb(200, 100, 240)","fill-opacity":["case",["boolean",["feature-state","hover"],!1],.8,.4]}}),s.on("mousemove",M,S=>{S.features.length>0&&(F(),A=S.features[0].id,e(4,c=S.features[0].properties.name),s.setFeatureState({source:V,id:A},{hover:!0}))}),s.on("mouseleave",M,()=>{F(),A=null,e(4,c=null)}),s.on("click",M,function(S){let N=S.features[0].properties.name;window.location.href=`scheme.html?authority=${N}`})})});function B(g){try{let b=JSON.parse(g);if(!b.authority)throw new Error("File doesn't have an authority set; is it an ATIP file?");if(!i.has(b.authority))throw new Error(`Unknown authority ${b.authority}`);let E=b.authority,A=He(b);A!="v1"&&(E+=`_${A}`),window.localStorage.setItem(E,JSON.stringify(b)),window.location.href=`scheme.html?authority=${b.authority}&schema=${A}`}catch(b){window.alert(`Couldn't load scheme from a file: ${b}`)}}function v(){window.location.href=`scheme.html?authority=${f}`}const j=()=>e(1,u=!u);function m(){f=this.value,e(0,f)}function $(g){z[g?"unshift":"push"](()=>{a=g,e(2,a)})}function G(g){n=g,e(3,n)}function P(g){u=g,e(1,u)}return l.$$.update=()=>{l.$$.dirty&1&&e(5,o=i.has(f))},[f,u,a,n,c,o,d,B,v,j,m,$,G,P]}class Ue extends K{constructor(t){super(),Z(this,t,Re,Ve,Q,{})}}document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";new Ue({target:document.getElementById("app")}); diff --git a/browse_dropdown_filters/assets/nested-19010159.js b/browse_dropdown_filters/assets/nested-19010159.js deleted file mode 100644 index fb26b7626..000000000 --- a/browse_dropdown_filters/assets/nested-19010159.js +++ /dev/null @@ -1,50 +0,0 @@ -var ao=Object.defineProperty;var uo=(r,e,t)=>e in r?ao(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Y=(r,e,t)=>(uo(r,typeof e!="symbol"?e+"":e,t),t);import{O as fo,P as co,S as Z,i as Q,s as ee,Q as z,R as po,N as di,T as lt,U as Zn,V as Ft,W as _n,X as tt,Y as Qn,Z as er,_ as tr,$ as _e,d as w,x as U,k,a0 as mn,e as $,a1 as Gt,H as F,q as A,r as R,I as P,l as G,t as E,j as C,K as B,v as M,a2 as Pe,a3 as On,a4 as ho,a5 as go,a6 as ht,a7 as nr,a8 as Qe,a9 as gt,aa as _o,ab as rr,ac as mo,ad as bo,ae as yo,af as vo,ag as fr,ah as tn,ai as Yt,aj as Te,B as Ie,p as ie,ak as de,al as he,am as it,L as Nt,an as wo,ao as ko,ap as So,aq as Eo,ar as Rn,w as Oe,z as jt,A as fe,D as le,E as ve,J as we,o as De,y as nn,as as hi,at as bn,au as rn,av as Mo,G as $o,aw as gi,ax as on,ay as Co,az as yn,aA as cr,aB as pr,c as Lo,u as To,g as Ao,f as xo,aC as Oo,aD as Ro}from"./maplibre_helpers-5d84afaa.js";import{M as _i,A as Io,a as Fo}from"./About-563eb94d.js";import{m as Ue,g as ce,s as sn,a as Ye,f as Re,i as Dt,c as Jt,l as In,b as mi,d as Ce,o as ln,C as _t,u as Lt,n as vn,M as Po,r as mt,e as dr,L as Bo,Z as No,h as jo,j as Do,I as Ho,B as Uo,k as qo}from"./ZoomOutMap-96dffba9.js";/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const bi=Symbol("Comlink.proxy"),Go=Symbol("Comlink.endpoint"),Yo=Symbol("Comlink.releaseProxy"),Sn=Symbol("Comlink.finalizer"),zt=Symbol("Comlink.thrown"),yi=r=>typeof r=="object"&&r!==null||typeof r=="function",Jo={canHandle:r=>yi(r)&&r[bi],serialize(r){const{port1:e,port2:t}=new MessageChannel;return ir(r,e),[t,[t]]},deserialize(r){return r.start(),ki(r)}},zo={canHandle:r=>yi(r)&&zt in r,serialize({value:r}){let e;return r instanceof Error?e={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:e={isError:!1,value:r},[e,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},vi=new Map([["proxy",Jo],["throw",zo]]);function Xo(r,e){for(const t of r)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function ir(r,e=globalThis,t=["*"]){e.addEventListener("message",function n(i){if(!i||!i.data)return;if(!Xo(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:o,type:s,path:a}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(rt);let u;try{const f=a.slice(0,-1).reduce((d,h)=>d[h],r),c=a.reduce((d,h)=>d[h],r);switch(s){case"GET":u=c;break;case"SET":f[a.slice(-1)[0]]=rt(i.data.value),u=!0;break;case"APPLY":u=c.apply(f,l);break;case"CONSTRUCT":{const d=new c(...l);u=es(d)}break;case"ENDPOINT":{const{port1:d,port2:h}=new MessageChannel;ir(r,h),u=Qo(d,[d])}break;case"RELEASE":u=void 0;break;default:return}}catch(f){u={value:f,[zt]:0}}Promise.resolve(u).catch(f=>({value:f,[zt]:0})).then(f=>{const[c,d]=fn(f);e.postMessage(Object.assign(Object.assign({},c),{id:o}),d),s==="RELEASE"&&(e.removeEventListener("message",n),wi(e),Sn in r&&typeof r[Sn]=="function"&&r[Sn]())}).catch(f=>{const[c,d]=fn({value:new TypeError("Unserializable return value"),[zt]:0});e.postMessage(Object.assign(Object.assign({},c),{id:o}),d)})}),e.start&&e.start()}function Wo(r){return r.constructor.name==="MessagePort"}function wi(r){Wo(r)&&r.close()}function ki(r,e){return Fn(r,[],e)}function Ut(r){if(r)throw new Error("Proxy has been released and is not useable")}function Si(r){return pt(r,{type:"RELEASE"}).then(()=>{wi(r)})}const an=new WeakMap,un="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{const e=(an.get(r)||0)-1;an.set(r,e),e===0&&Si(r)});function Vo(r,e){const t=(an.get(e)||0)+1;an.set(e,t),un&&un.register(r,e,r)}function Ko(r){un&&un.unregister(r)}function Fn(r,e=[],t=function(){}){let n=!1;const i=new Proxy(t,{get(o,s){if(Ut(n),s===Yo)return()=>{Ko(i),Si(r),n=!0};if(s==="then"){if(e.length===0)return{then:()=>i};const a=pt(r,{type:"GET",path:e.map(l=>l.toString())}).then(rt);return a.then.bind(a)}return Fn(r,[...e,s])},set(o,s,a){Ut(n);const[l,u]=fn(a);return pt(r,{type:"SET",path:[...e,s].map(f=>f.toString()),value:l},u).then(rt)},apply(o,s,a){Ut(n);const l=e[e.length-1];if(l===Go)return pt(r,{type:"ENDPOINT"}).then(rt);if(l==="bind")return Fn(r,e.slice(0,-1));const[u,f]=hr(a);return pt(r,{type:"APPLY",path:e.map(c=>c.toString()),argumentList:u},f).then(rt)},construct(o,s){Ut(n);const[a,l]=hr(s);return pt(r,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:a},l).then(rt)}});return Vo(i,r),i}function Zo(r){return Array.prototype.concat.apply([],r)}function hr(r){const e=r.map(fn);return[e.map(t=>t[0]),Zo(e.map(t=>t[1]))]}const Ei=new WeakMap;function Qo(r,e){return Ei.set(r,e),r}function es(r){return Object.assign(r,{[bi]:!0})}function fn(r){for(const[e,t]of vi)if(t.canHandle(r)){const[n,i]=t.serialize(r);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:r},Ei.get(r)||[]]}function rt(r){switch(r.type){case"HANDLER":return vi.get(r.name).deserialize(r.value);case"RAW":return r.value}}function pt(r,e,t){return new Promise(n=>{const i=ts();r.addEventListener("message",function o(s){!s.data||!s.data.id||s.data.id!==i||(r.removeEventListener("message",o),n(s.data))}),r.start&&r.start(),r.postMessage(Object.assign({id:i},e),t)})}function ts(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}/** - * splaytree v3.1.1 - * Fast Splay tree for Node and browser - * - * @author Alexander Milevski - * @license MIT - * @preserve - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */function ns(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]e?1:r0){if(e.right===null)break;if(t(r,e.right.key)>0){var a=e.right;if(e.right=a.left,a.left=e,e=a,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function En(r,e,t,n){var i=new nt(r,e);if(t===null)return i.left=i.right=null,i;t=ze(r,t,n);var o=n(r,t.key);return o<0?(i.left=t.left,i.right=t,t.left=null):o>=0&&(i.right=t.right,i.left=t,t.right=null),i}function gr(r,e,t){var n=null,i=null;if(e){e=ze(r,e,t);var o=t(e.key,r);o===0?(n=e.left,i=e.right):o<0?(i=e.right,e.right=null,n=e):(n=e.left,e.left=null,i=e)}return{left:n,right:i}}function is(r,e,t){return e===null?r:(r===null||(e=ze(r.key,e,t),e.left=r),e)}function Pn(r,e,t,n,i){if(r){n(""+e+(t?"└── ":"├── ")+i(r)+` -`);var o=e+(t?" ":"│ ");r.left&&Pn(r.left,o,!1,n,i),r.right&&Pn(r.right,o,!0,n,i)}}var or=function(){function r(e){e===void 0&&(e=rs),this._root=null,this._size=0,this._comparator=e}return r.prototype.insert=function(e,t){return this._size++,this._root=En(e,t,this._root,this._comparator)},r.prototype.add=function(e,t){var n=new nt(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=ze(e,this._root,i),s=i(e,o.key);return s===0?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},r.prototype._remove=function(e,t,n){var i;if(t===null)return null;t=ze(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?i=t.right:(i=ze(e,t.left,n),i.right=t.right),this._size--,i):t},r.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=ze(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},r.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return t;i<0?t=t.left:t=t.right}return null},r.prototype.find=function(e){return this._root&&(this._root=ze(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},r.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return!0;i<0?t=t.left:t=t.right}return!1},r.prototype.forEach=function(e,t){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),e.call(t,n),n=n.right):o=!0;return this},r.prototype.range=function(e,t,n,i){for(var o=[],s=this._comparator,a=this._root,l;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),l=s(a.key,t),l>0)break;if(s(a.key,e)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},r.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},r.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},r.prototype.at=function(e){for(var t=this._root,n=!1,i=0,o=[];!n;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),i===e)return t;i++,t=t.right}else n=!0;return null},r.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var i=this._comparator;t;){var o=i(e.key,t.key);if(o===0)break;o<0?(n=t,t=t.left):t=t.right}return n},r.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var i=this._comparator;t;){var o=i(e.key,t.key);if(o===0)break;o<0?t=t.left:(n=t,t=t.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return ss(this._root)},r.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var i=e.length,o=this._comparator;if(n&&jn(e,t,0,i-1,o),this._root===null)this._root=Bn(e,t,0,i),this._size=i;else{var s=ls(this.toList(),os(e,t),o);i=this._size+i,this._root=Nn({head:s},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Pn(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},r.prototype.update=function(e,t,n){var i=this._comparator,o=gr(e,this._root,i),s=o.left,a=o.right;i(e,t)<0?a=En(t,n,a,i):s=En(t,n,s,i),this._root=is(s,a,i)},r.prototype.split=function(e){return gr(e,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var e;return ns(this,function(t){switch(t.label){case 0:e=this.minNode(),t.label=1;case 1:return e?[4,e]:[3,3];case 2:return t.sent(),e=this.next(e),[3,1];case 3:return[2]}})},r}();function Bn(r,e,t,n){var i=n-t;if(i>0){var o=t+Math.floor(i/2),s=r[o],a=e[o],l=new nt(s,a);return l.left=Bn(r,e,t,o),l.right=Bn(r,e,o+1,n),l}return null}function os(r,e){for(var t=new nt(null,null),n=t,i=0;i0?(e=o=o.next=t.pop(),e=e.right):n=!0;return o.next=null,i.next}function Nn(r,e,t){var n=t-e;if(n>0){var i=e+Math.floor(n/2),o=Nn(r,e,i),s=r.head;return s.left=o,r.head=r.head.next,s.right=Nn(r,i+1,t),s}return null}function ls(r,e,t){for(var n=new nt(null,null),i=n,o=r,s=e;o!==null&&s!==null;)t(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),n.next}function jn(r,e,t,n,i){if(!(t>=n)){for(var o=r[t+n>>1],s=t-1,a=n+1;;){do s++;while(i(r[s],o)<0);do a--;while(i(r[a],o)>0);if(s>=a)break;var l=r[s];r[s]=r[a],r[a]=l,l=e[s],e[s]=e[a],e[a]=l}jn(r,e,t,a,i),jn(r,e,a+1,n,i)}}function Fe(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function _r(r,e){for(var t=0;tn.x?1:t.yn.y?1:0}}]);function r(e,t){Fe(this,r),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}return Ae(r,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var n=t.point.events,i=0,o=n.length;i=0&&d>=0?fh?-1:0:u<0&&d<0?fh?1:0:du?1:0}}}]),r}(),ds=0,pn=function(){Ae(r,null,[{key:"compare",value:function(t,n){var i=t.leftSE.point.x,o=n.leftSE.point.x,s=t.rightSE.point.x,a=n.rightSE.point.x;if(al&&u>f)return-1;var d=t.comparePoint(n.leftSE.point);if(d<0)return 1;if(d>0)return-1;var h=n.comparePoint(t.rightSE.point);return h!==0?h:-1}if(i>o){if(lu&&l>c)return 1;var v=n.comparePoint(t.leftSE.point);if(v!==0)return v;var _=t.comparePoint(n.rightSE.point);return _<0?1:_>0?-1:1}if(lu)return 1;if(sa){var g=t.comparePoint(n.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(s!==a){var p=f-l,m=s-i,y=c-u,S=a-o;if(p>m&&yS)return-1}return s>a?1:sc?1:t.idn.id?1:0}}]);function r(e,t,n,i){Fe(this,r),this.id=++ds,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=i}return Ae(r,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:tn?t:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var n=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(n.x===i.x)return t.x===n.x?0:t.x0&&l.swapEvents(),je.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,i=this.windings.length;n0){var s=n;n=i,i=s}if(n.prev===i){var a=n;n=i,i=a}for(var l=0,u=i.rings.length;l0)o=n,s=t,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var u=new je(o,!0),f=new je(s,!1);return new r(u,f,[i],[a])}}]),r}(),wr=function(){function r(e,t,n){if(Fe(this,r),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=Pt.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=e.length;sthis.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(pn.fromRing(o,i,this))}return Ae(r,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,i=this.segments.length;nthis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}return Ae(r,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),n=0,i=this.interiorRings.length;nthis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}return Ae(r,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,i=this.polys.length;n0&&(t=o)}for(var s=t.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),r}(),Sr=function(){function r(e){Fe(this,r),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Ae(r,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var n=0,i=this.interiorRings.length;n1&&arguments[1]!==void 0?arguments[1]:pn.compare;Fe(this,r),this.queue=e,this.tree=new or(t),this.segments=[]}return Ae(r,[{key:"process",value:function(t){var n=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),i;var o=t.isLeft?this.tree.insert(n):this.tree.find(n);if(!o)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,l=void 0,u=void 0;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;u===void 0;)a=this.tree.next(a),a===null?u=null:a.key.consumedBy===void 0&&(u=a.key);if(t.isLeft){var f=null;if(l){var c=l.getIntersection(n);if(c!==null&&(n.isAnEndpoint(c)||(f=c),!l.isAnEndpoint(c)))for(var d=this._splitSafely(l,c),h=0,v=d.length;h0?(this.tree.remove(n),i.push(t)):(this.segments.push(n),n.prev=l)}else{if(l&&u){var I=l.getIntersection(u);if(I!==null){if(!l.isAnEndpoint(I))for(var N=this._splitSafely(l,I),j=0,D=N.length;jEr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var S=new ms(_),L=_.size,O=_.pop();O;){var x=O.key;if(_.size===L){var I=x.segment;throw new Error("Unable to pop() ".concat(x.isLeft?"left":"right"," SweepEvent ")+"[".concat(x.point.x,", ").concat(x.point.y,"] from segment #").concat(I.id," ")+"[".concat(I.leftSE.point.x,", ").concat(I.leftSE.point.y,"] -> ")+"[".concat(I.rightSE.point.x,", ").concat(I.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(_.size>Er)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(S.segments.length>bs)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var N=S.process(x),j=0,D=N.length;j1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;it(1,n=s));let{boundaryGeojson:i}=e;return po("setCamera")&&n.fitBounds(di(i),{padding:20,animate:!1}),lt(n,"boundary",Es(i)),Zn(n,{id:"boundary",source:"boundary",color:"black",opacity:.5}),r.$$set=s=>{"boundaryGeojson"in s&&t(0,i=s.boundaryGeojson)},[i]}class Ls extends Z{constructor(e){super(),Q(this,e,Cs,null,ee,{boundaryGeojson:0})}}let at="hover";function Ts(r,e,t){let n,i,o,s,a,l;return z(r,Ue,u=>t(0,n=u)),z(r,ce,u=>t(1,i=u)),z(r,sn,u=>t(2,o=u)),z(r,Ye,u=>t(3,s=u)),z(r,Re,u=>t(4,a=u)),z(r,Dt,u=>t(5,l=u)),lt(n,at,tt()),Ft(n,{id:"hover-polygons",source:at,filter:Qn,color:Jt.hovering,width:.5*In}),Ft(n,{id:"hover-lines",source:at,filter:er,color:Jt.hovering,width:1.5*In}),_n(n,{id:"hover-points",source:at,filter:tr,color:Jt.hovering,radius:1.5*mi}),r.$$.update=()=>{if(r.$$.dirty&41&&(l||(n.getCanvas().style.cursor=s?"pointer":"inherit")),r.$$.dirty&31){let u=a||s||o;u!=null?n.getSource(at).setData(i.features.find(f=>f.id==u)):n.getSource(at).setData(tt())}},[n,i,o,s,a,l]}class As extends Z{constructor(e){super(),Q(this,e,Ts,null,ee,{})}}const xs="/atip/browse_dropdown_filters/assets/edit_attributes-29b396e1.svg",Os="/atip/browse_dropdown_filters/assets/edit_geometry-02dad294.svg",Rs="/atip/browse_dropdown_filters/assets/point-276f4055.svg",Is="/atip/browse_dropdown_filters/assets/polygon_freehand-cf965967.svg",Fs="/atip/browse_dropdown_filters/assets/polygon_snapped-18efbbea.svg",Ps="/atip/browse_dropdown_filters/assets/route-d3c0ebad.svg",Ci="/atip/browse_dropdown_filters/assets/split_route-9e0ea2da.svg",Bs="/atip/browse_dropdown_filters/assets/street_view-48580b6a.svg";function Mr(r){let e;function t(o,s){return o[1]?js:Ns}let n=t(r),i=n(r);return{c(){i.c(),e=_e()},m(o,s){i.m(o,s),w(o,e,s)},p(o,s){n!==(n=t(o))&&(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){o&&k(e),i.d(o)}}}function Ns(r){let e;return{c(){e=$("p"),e.textContent="Click an object to fill out its attributes"},m(t,n){w(t,e,n)},d(t){t&&k(e)}}}function js(r){let e;return{c(){e=$("p"),e.textContent="Edit attributes to the left, or click another object"},m(t,n){w(t,e,n)},d(t){t&&k(e)}}}function Ds(r){let e,t=r[0]==Un&&Mr(r);return{c(){t&&t.c(),e=_e()},m(n,i){t&&t.m(n,i),w(n,e,i)},p(n,[i]){n[0]==Un?t?t.p(n,i):(t=Mr(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&k(e),t&&t.d(n)}}}const Un="edit-attribute";function Li(){}function Hs(r,e,t){let n,i,o,s;z(r,Ue,c=>t(6,n=c)),z(r,ce,c=>t(7,i=c)),z(r,Ce,c=>t(0,o=c)),z(r,Re,c=>t(1,s=c));let{changeMode:a}=e,{eventHandler:l}=e;function u(){Re.set(null)}const f=ln.subscribe(c=>{if(c){let d=i.features.find(h=>h.id==c);d.geometry.type=="Point"?n.flyTo({center:d.geometry.coordinates,duration:500}):n.fitBounds(di(d),{padding:200,duration:500}),a(Un)}});return mn(f),l.mapHandlers.mousemove=c=>{var h;let d=n.queryRenderedFeatures(c.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});Ye.set(((h=d[0])==null?void 0:h.id)||null)},l.mapHandlers.mouseout=()=>{Ye.set(null)},l.mapHandlers.click=c=>{let d=n.queryRenderedFeatures(c.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});d.length>0?Re.set(d[0].id):Re.set(null)},r.$$set=c=>{"changeMode"in c&&t(3,a=c.changeMode),"eventHandler"in c&&t(2,l=c.eventHandler)},[o,s,l,a,Li,u]}class Us extends Z{constructor(e){super(),Q(this,e,Hs,Ds,ee,{changeMode:3,eventHandler:2,start:4,stop:5})}get start(){return Li}get stop(){return this.$$.ctx[5]}}const $r=["click","dblclick","mousemove","mousedown","mouseup","mouseout","dragstart"],Cr=["keypress","keyup","keydown"];class Je{constructor(){Y(this,"mapHandlers");Y(this,"documentHandlers");this.mapHandlers={click:e=>{},dblclick:e=>{},mousemove:e=>{},mousedown:e=>{},mouseup:e=>{},mouseout:e=>{},dragstart:e=>{}},this.documentHandlers={keypress:e=>{},keyup:e=>{},keydown:e=>{}}}}class qs{constructor(e){Y(this,"map");Y(this,"active");Y(this,"eventListenersSuccess");Y(this,"eventListenersFailure");Y(this,"cursor");Y(this,"onMouseMove",e=>{this.active&&(this.cursor=Gt(e.lngLat.toArray()))});Y(this,"onClick",()=>{if(this.active&&this.cursor){for(let e of this.eventListenersSuccess)e(this.cursor);this.stop()}});Y(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.preventDefault(),this.cancel())});Y(this,"setHandlers",e=>{e.mapHandlers.mousemove=this.onMouseMove,e.mapHandlers.click=this.onClick,e.documentHandlers.keydown=this.onKeyDown});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersFailure=[],this.cursor=null}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}start(){this.map.getCanvas().style.cursor="crosshair",this.setActivity(!0)}stop(){this.map.getCanvas().style.cursor="inherit",this.cursor=null,this.setActivity(!1)}setActivity(e){this.active=e,Dt.set(e)}}function Gs(r){let e;return{c(){e=$("li"),e.textContent="Click to add a new point"},m(t,n){w(t,e,n)},d(t){t&&k(e)}}}function Ys(r){let e;return{c(){e=$("li"),e.textContent="Click to move the point here"},m(t,n){w(t,e,n)},d(t){t&&k(e)}}}function Js(r){let e,t,n;function i(a,l){return a[1]?Ys:Gs}let o=i(r),s=o(r);return{c(){e=$("ul"),s.c(),t=A(),n=$("li"),n.innerHTML="Press Escape to cancel"},m(a,l){w(a,e,l),s.m(e,null),M(e,t),M(e,n)},p(a,l){o!==(o=i(a))&&(s.d(1),s=o(a),s&&(s.c(),s.m(e,t)))},d(a){a&&k(e),s.d()}}}function zs(r){let e,t,n,i,o,s;return e=new _t({props:{label:"Help",$$slots:{default:[Js]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("button"),n.textContent="Cancel",R(n,"type","button")},m(a,l){P(e,a,l),w(a,t,l),w(a,n,l),i=!0,o||(s=G(n,"click",r[2]),o=!0)},p(a,[l]){const u={};l&10&&(u.$$scope={dirty:l,ctx:a}),e.$set(u)},i(a){i||(E(e.$$.fragment,a),i=!0)},o(a){C(e.$$.fragment,a),i=!1},d(a){a&&(k(t),k(n)),B(e,a),o=!1,s()}}}function Xs(r,e,t){let{pointTool:n}=e,{editingExisting:i}=e;const o=()=>n.cancel();return r.$$set=s=>{"pointTool"in s&&t(0,n=s.pointTool),"editingExisting"in s&&t(1,i=s.editingExisting)},[n,i,o]}class Ti extends Z{constructor(e){super(),Q(this,e,Xs,zs,ee,{pointTool:0,editingExisting:1})}}function et(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function He(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function qn(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function Ai(r,e,t){if(t===void 0&&(t={}),t.final===!0)return Ws(r,e);var n=et(r),i=et(e),o=Pe(n[0]),s=Pe(i[0]),a=Pe(n[1]),l=Pe(i[1]),u=Math.sin(s-o)*Math.cos(l),f=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return On(Math.atan2(u,f))}function Ws(r,e){var t=Ai(e,r);return t=(t+180)%360,t}function Xe(r,e,t){t===void 0&&(t={});var n=et(r),i=et(e),o=Pe(i[1]-n[1]),s=Pe(i[0]-n[0]),a=Pe(n[1]),l=Pe(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return ho(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),t.units)}function Lr(r,e,t,n){n===void 0&&(n={});var i=et(r),o=Pe(i[0]),s=Pe(i[1]),a=Pe(t),l=go(e,n.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a)),f=o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u)),c=On(f),d=On(u);return ht([c,d],n.properties)}function Gn(r){if(!r)throw new Error("geojson is required");var e=[];return nr(r,function(t){Vs(t,e)}),Qe(e)}function Vs(r,e){var t=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":t=He(n);break;case"LineString":t=[He(n)]}t.forEach(function(i){var o=Ks(i,r.properties);o.forEach(function(s){s.id=e.length,e.push(s)})})}}function Ks(r,e){var t=[];return r.reduce(function(n,i){var o=gt([n,i],e);return o.bbox=Zs(n,i),t.push(o),i}),t}function Zs(r,e){var t=r[0],n=r[1],i=e[0],o=e[1],s=ti?t:i,u=n>o?n:o;return[s,a,l,u]}var sr={exports:{}},xi={exports:{}};(function(r,e){(function(t,n){r.exports=n()})(_o,function(){function t(p,m,y,S,L){(function O(x,I,N,j,D){for(;j>N;){if(j-N>600){var T=j-N+1,H=I-N+1,ae=Math.log(T),ke=.5*Math.exp(2*ae/3),Ee=.5*Math.sqrt(ae*ke*(T-ke)/T)*(H-T/2<0?-1:1),ue=Math.max(N,Math.floor(I-H*ke/T+Ee)),ne=Math.min(j,Math.floor(I+(T-H)*ke/T+Ee));O(x,I,ue,ne,D)}var K=x[I],Le=N,me=j;for(n(x,N,I),D(x[j],K)>0&&n(x,N,j);Le0;)me--}D(x[N],K)===0?n(x,N,me):n(x,++me,j),me<=I&&(N=me+1),I<=me&&(j=me-1)}})(p,m,y||0,S||p.length-1,L||i)}function n(p,m,y){var S=p[m];p[m]=p[y],p[y]=S}function i(p,m){return pm?1:0}var o=function(p){p===void 0&&(p=9),this._maxEntries=Math.max(4,p),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(p,m,y){if(!y)return m.indexOf(p);for(var S=0;S=p.minX&&m.maxY>=p.minY}function b(p){return{children:p,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(p,m,y,S,L){for(var O=[m,y];O.length;)if(!((y=O.pop())-(m=O.pop())<=S)){var x=m+Math.ceil((y-m)/S/2)*S;t(p,x,m,y,L),O.push(m,x,x,y)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(p){var m=this.data,y=[];if(!_(p,m))return y;for(var S=this.toBBox,L=[];m;){for(var O=0;O=0&&L[m].children.length>this._maxEntries;)this._split(L,m),m--;this._adjustParentBBoxes(S,L,m)},o.prototype._split=function(p,m){var y=p[m],S=y.children.length,L=this._minEntries;this._chooseSplitAxis(y,L,S);var O=this._chooseSplitIndex(y,L,S),x=b(y.children.splice(O,y.children.length-O));x.height=y.height,x.leaf=y.leaf,a(y,this.toBBox),a(x,this.toBBox),m?p[m-1].children.push(x):this._splitRoot(y,x)},o.prototype._splitRoot=function(p,m){this.data=b([p,m]),this.data.height=p.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(p,m,y){for(var S,L,O,x,I,N,j,D=1/0,T=1/0,H=m;H<=y-m;H++){var ae=l(p,0,H,this.toBBox),ke=l(p,H,y,this.toBBox),Ee=(L=ae,O=ke,x=void 0,I=void 0,N=void 0,j=void 0,x=Math.max(L.minX,O.minX),I=Math.max(L.minY,O.minY),N=Math.min(L.maxX,O.maxX),j=Math.min(L.maxY,O.maxY),Math.max(0,N-x)*Math.max(0,j-I)),ue=d(ae)+d(ke);Ee=m;D--){var T=p.children[D];u(x,p.leaf?L(T):T),I+=h(x)}return I},o.prototype._adjustParentBBoxes=function(p,m,y){for(var S=y;S>=0;S--)u(m[S],p)},o.prototype._condense=function(p){for(var m=p.length-1,y=void 0;m>=0;m--)p[m].children.length===0?m>0?(y=p[m-1].children).splice(y.indexOf(p[m]),1):this.clear():a(p[m],this.toBBox)},o})})(xi);var Qs=xi.exports;const el=rr(mo),tl=rr(bo),nl=rr(yo);var Ne=Qs,Oi=el,Ri=tl,ut=nl.default,rl=Ri.featureEach;Ri.coordEach;Oi.polygon;var Tr=Oi.featureCollection;function Ii(r){var e=new Ne(r);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ut(t),Ne.prototype.insert.call(this,t)},e.load=function(t){var n=[];return Array.isArray(t)?t.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:ut(i),n.push(i)}):rl(t,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:ut(i),n.push(i)}),Ne.prototype.load.call(this,n)},e.remove=function(t,n){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ut(t),Ne.prototype.remove.call(this,t,n)},e.clear=function(){return Ne.prototype.clear.call(this)},e.search=function(t){var n=Ne.prototype.search.call(this,this.toBBox(t));return Tr(n)},e.collides=function(t){return Ne.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=Ne.prototype.all.call(this);return Tr(t)},e.toJSON=function(){return Ne.prototype.toJSON.call(this)},e.fromJSON=function(t){return Ne.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var n;if(t.bbox)n=t.bbox;else if(Array.isArray(t)&&t.length===4)n=t;else if(Array.isArray(t)&&t.length===6)n=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")n=ut(t);else if(t.type==="FeatureCollection")n=ut(t);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},e}sr.exports=Ii;sr.exports.default=Ii;var il=sr.exports;const lr=vo(il);function Fi(r,e){var t={},n=[];if(r.type==="LineString"&&(r=fr(r)),e.type==="LineString"&&(e=fr(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=Ar(r,e);return i&&n.push(i),Qe(n)}var o=lr();return o.load(Gn(e)),tn(Gn(r),function(s){tn(o.search(s),function(a){var l=Ar(s,a);if(l){var u=He(l).join(",");t[u]||(t[u]=!0,n.push(l))}})}),Qe(n)}function Ar(r,e){var t=He(r),n=He(e);if(t.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(n.length!==2)throw new Error(" line2 must only contain 2 coordinates");var i=t[0][0],o=t[0][1],s=t[1][0],a=t[1][1],l=n[0][0],u=n[0][1],f=n[1][0],c=n[1][1],d=(c-u)*(s-i)-(f-l)*(a-o),h=(f-l)*(o-u)-(c-u)*(i-l),v=(s-i)*(o-u)-(a-o)*(i-l);if(d===0)return null;var _=h/d,b=v/d;if(_>=0&&_<=1&&b>=0&&b<=1){var g=i+_*(s-i),p=o+_*(a-o);return ht([g,p])}return null}function Bt(r,e,t){t===void 0&&(t={});var n=ht([1/0,1/0],{dist:1/0}),i=0;return nr(r,function(o){for(var s=He(o),a=0;a0&&(b=_.features[0],b.properties.dist=Xe(e,b,t),b.properties.location=i+Xe(l,b,t)),l.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,n=this.dragFrom[1]-e.lngLat.lat;for(let i of this.points)i[0]-=t,i[1]-=n}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});Y(this,"onClick",e=>{if(this.active&&this.cursor){let t=[];if(xr(this.points).forEach((n,i)=>{t.push([i+1,Bt(n,this.cursor).properties.dist])}),t.sort((n,i)=>n[1]-i[1]),t.length>0){let n=t[0][0];this.points.splice(n,0,this.cursor.geometry.coordinates),this.hover=n}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))});Y(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=Gt(e.lngLat.toArray()),this.onClick(e),this.finish())});Y(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.redraw())});Y(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});Y(this,"onKeypress",e=>{this.active&&e.key=="Enter"&&(e.preventDefault(),this.finish())});Y(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.preventDefault(),this.cancel())});Y(this,"setHandlers",e=>{e.mapHandlers.mousemove=this.onMouseMove,e.mapHandlers.click=this.onClick,e.mapHandlers.dblclick=this.onDoubleClick,e.mapHandlers.mousedown=this.onMouseDown,e.mapHandlers.mouseup=this.onMouseUp,e.documentHandlers.keypress=this.onKeypress,e.documentHandlers.keydown=this.onKeyDown});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,lt(e,ft,tt()),Zn(e,{id:"edit-polygon-fill",source:ft,filter:Qn,color:"red",opacity:["case",["boolean",["get","hover"],"false"],1,.5]}),Ft(e,{id:"edit-polygon-lines",source:ft,filter:er,color:"black",width:8,opacity:.5}),_n(e,{id:"edit-polygon-vertices",source:ft,filter:tr,color:Jt.hovering,radius:mi,opacity:["case",["boolean",["get","hover"],"false"],1,.5]})}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)}tearDown(){this.map.removeLayer("edit-polygon-vertices"),this.map.removeLayer("edit-polygon-fill"),this.map.removeLayer("edit-polygon-lines"),this.map.removeSource(ft)}startNew(){this.setActivity(!0),this.map.doubleClickZoom.disable()}editExisting(e){this.setActivity(!0),this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}setActivity(e){this.active=e,Dt.set(e)}stop(){this.map.getCanvas().style.cursor="inherit",this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.setActivity(!1),this.hover=null,this.dragFrom=null,this.redraw()}redraw(){let e=tt();this.points.forEach((i,o)=>{let s=Gt(i);s.properties.hover=this.hover==o,s.properties.idx=o,e.features.push(s)}),e.features=e.features.concat(xr(this.points));let t=this.polygonFeature();t&&(t.properties.hover=this.hover=="polygon",e.features.push(t)),this.map.getSource(ft).setData(e);let n="crosshair";this.hover!=null&&(n=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=n}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=Gt(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(Yt),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:{}}}}function xr(r){let e=[];for(let t=0;t=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[r[r.length-1],r[0]]},properties:{}}),e}function sl(r){let e;return{c(){e=$("ul"),e.innerHTML="
  • Click the map to add a vertex
  • Click a vertex to delete it
  • Drag a vertex or the polygon to move it
  • Press Enter or double click to finish
  • Press Escape to cancel
  • "},m(t,n){w(t,e,n)},p:U,d(t){t&&k(e)}}}function ll(r){let e,t,n,i,o,s,a,l,u;return e=new _t({props:{label:"Help",$$slots:{default:[sl]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("div"),i=$("button"),i.textContent="Finish",o=A(),s=$("button"),s.textContent="Cancel",R(i,"type","button"),R(s,"type","button"),Te(n,"display","flex"),Te(n,"justify-content","space-between")},m(f,c){P(e,f,c),w(f,t,c),w(f,n,c),M(n,i),M(n,o),M(n,s),a=!0,l||(u=[G(i,"click",r[1]),G(s,"click",r[2])],l=!0)},p(f,[c]){const d={};c&8&&(d.$$scope={dirty:c,ctx:f}),e.$set(d)},i(f){a||(E(e.$$.fragment,f),a=!0)},o(f){C(e.$$.fragment,f),a=!1},d(f){f&&(k(t),k(n)),B(e,f),l=!1,Ie(u)}}}function al(r,e,t){let{polygonTool:n}=e;const i=()=>n.finish(),o=()=>n.cancel();return r.$$set=s=>{"polygonTool"in s&&t(0,n=s.polygonTool)},[n,i,o]}class Pi extends Z{constructor(e){super(),Q(this,e,al,ll,ee,{polygonTool:0})}}let W;const qe=new Array(32).fill(void 0);qe.push(void 0,null,!0,!1);function V(r){return qe[r]}let At=qe.length;function ul(r){r<36||(qe[r]=At,At=r)}function Yn(r){const e=V(r);return ul(r),e}const Bi=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Bi.decode();let Wt=new Uint8Array;function xt(){return Wt.byteLength===0&&(Wt=new Uint8Array(W.memory.buffer)),Wt}function ot(r,e){return Bi.decode(xt().subarray(r,r+e))}function $e(r){At===qe.length&&qe.push(qe.length+1);const e=At;return At=qe[e],qe[e]=r,e}function Mn(r){return r==null}let Vt=new Float64Array;function fl(){return Vt.byteLength===0&&(Vt=new Float64Array(W.memory.buffer)),Vt}let Kt=new Int32Array;function Se(){return Kt.byteLength===0&&(Kt=new Int32Array(W.memory.buffer)),Kt}let Ke=0;const Zt=new TextEncoder("utf-8"),cl=typeof Zt.encodeInto=="function"?function(r,e){return Zt.encodeInto(r,e)}:function(r,e){const t=Zt.encode(r);return e.set(t),{read:r.length,written:t.length}};function qt(r,e,t){if(t===void 0){const a=Zt.encode(r),l=e(a.length);return xt().subarray(l,l+a.length).set(a),Ke=a.length,l}let n=r.length,i=e(n);const o=xt();let s=0;for(;s127)break;o[i+s]=a}if(s!==n){s!==0&&(r=r.slice(s)),i=t(i,n,n=s+r.length*3);const a=xt().subarray(i+s,i+n),l=cl(r,a);s+=l.written}return Ke=s,i}function Jn(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){const i=r.length;let o="[";i>0&&(o+=Jn(r[0]));for(let s=1;s1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} -${r.stack}`:n}function pl(r,e){const t=e(r.length*1);return xt().set(r,t/1),Ke=r.length,t}function $n(r,e){try{return r.apply(this,e)}catch(t){W.__wbindgen_exn_store($e(t))}}class dn{static __wrap(e){const t=Object.create(dn.prototype);return t.ptr=e,t}__destroy_into_raw(){const e=this.ptr;return this.ptr=0,e}free(){const e=this.__destroy_into_raw();W.__wbg_jsroutesnapper_free(e)}constructor(e){try{const o=W.__wbindgen_add_to_stack_pointer(-16),s=pl(e,W.__wbindgen_malloc),a=Ke;W.jsroutesnapper_new(o,s,a);var t=Se()[o/4+0],n=Se()[o/4+1],i=Se()[o/4+2];if(i)throw Yn(n);return dn.__wrap(t)}finally{W.__wbindgen_add_to_stack_pointer(16)}}setConfig(e){W.jsroutesnapper_setConfig(this.ptr,$e(e))}getConfig(){try{const n=W.__wbindgen_add_to_stack_pointer(-16);W.jsroutesnapper_getConfig(n,this.ptr);var e=Se()[n/4+0],t=Se()[n/4+1];return ot(e,t)}finally{W.__wbindgen_add_to_stack_pointer(16),W.__wbindgen_free(e,t)}}toFinalFeature(){try{const n=W.__wbindgen_add_to_stack_pointer(-16);W.jsroutesnapper_toFinalFeature(n,this.ptr);var e=Se()[n/4+0],t=Se()[n/4+1];let i;return e!==0&&(i=ot(e,t).slice(),W.__wbindgen_free(e,t*1)),i}finally{W.__wbindgen_add_to_stack_pointer(16)}}renderGeojson(){try{const n=W.__wbindgen_add_to_stack_pointer(-16);W.jsroutesnapper_renderGeojson(n,this.ptr);var e=Se()[n/4+0],t=Se()[n/4+1];return ot(e,t)}finally{W.__wbindgen_add_to_stack_pointer(16),W.__wbindgen_free(e,t)}}setSnapMode(e){W.jsroutesnapper_setSnapMode(this.ptr,e)}onMouseMove(e,t,n){return W.jsroutesnapper_onMouseMove(this.ptr,e,t,n)!==0}onClick(){W.jsroutesnapper_onClick(this.ptr)}onDragStart(){return W.jsroutesnapper_onDragStart(this.ptr)!==0}onMouseUp(){return W.jsroutesnapper_onMouseUp(this.ptr)!==0}clearState(){W.jsroutesnapper_clearState(this.ptr)}editExisting(e){try{const i=W.__wbindgen_add_to_stack_pointer(-16);W.jsroutesnapper_editExisting(i,this.ptr,$e(e));var t=Se()[i/4+0],n=Se()[i/4+1];if(n)throw Yn(t)}finally{W.__wbindgen_add_to_stack_pointer(16)}}}async function dl(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.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",n);else throw n}const t=await r.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}}function hl(){const r={};return r.wbg={},r.wbg.__wbindgen_object_drop_ref=function(e){Yn(e)},r.wbg.__wbindgen_boolean_get=function(e){const t=V(e);return typeof t=="boolean"?t?1:0:2},r.wbg.__wbindgen_error_new=function(e,t){const n=new Error(ot(e,t));return $e(n)},r.wbg.__wbindgen_string_new=function(e,t){const n=ot(e,t);return $e(n)},r.wbg.__wbindgen_is_object=function(e){const t=V(e);return typeof t=="object"&&t!==null},r.wbg.__wbindgen_is_undefined=function(e){return V(e)===void 0},r.wbg.__wbindgen_in=function(e,t){return V(e)in V(t)},r.wbg.__wbindgen_number_get=function(e,t){const n=V(t),i=typeof n=="number"?n:void 0;fl()[e/8+1]=Mn(i)?0:i,Se()[e/4+0]=!Mn(i)},r.wbg.__wbindgen_jsval_loose_eq=function(e,t){return V(e)==V(t)},r.wbg.__wbindgen_string_get=function(e,t){const n=V(t),i=typeof n=="string"?n:void 0;var o=Mn(i)?0:qt(i,W.__wbindgen_malloc,W.__wbindgen_realloc),s=Ke;Se()[e/4+1]=s,Se()[e/4+0]=o},r.wbg.__wbg_String_91fba7ded13ba54c=function(e,t){const n=String(V(t)),i=qt(n,W.__wbindgen_malloc,W.__wbindgen_realloc),o=Ke;Se()[e/4+1]=o,Se()[e/4+0]=i},r.wbg.__wbindgen_object_clone_ref=function(e){const t=V(e);return $e(t)},r.wbg.__wbg_getwithrefkey_15c62c2b8546208d=function(e,t){const n=V(e)[V(t)];return $e(n)},r.wbg.__wbg_debug_f15cb542ea509609=function(e){console.debug(V(e))},r.wbg.__wbg_error_ef9a0be47931175f=function(e){console.error(V(e))},r.wbg.__wbg_info_2874fdd5393f35ce=function(e){console.info(V(e))},r.wbg.__wbg_log_4b5638ad60bdc54a=function(e){console.log(V(e))},r.wbg.__wbg_warn_58110c4a199df084=function(e){console.warn(V(e))},r.wbg.__wbg_get_57245cc7d7c7619d=function(e,t){const n=V(e)[t>>>0];return $e(n)},r.wbg.__wbg_length_6e3bbe7c8bd4dbd8=function(e){return V(e).length},r.wbg.__wbindgen_is_function=function(e){return typeof V(e)=="function"},r.wbg.__wbg_next_579e583d33566a86=function(e){const t=V(e).next;return $e(t)},r.wbg.__wbg_next_aaef7c8aa5e212ac=function(){return $n(function(e){const t=V(e).next();return $e(t)},arguments)},r.wbg.__wbg_done_1b73b0672e15f234=function(e){return V(e).done},r.wbg.__wbg_value_1ccc36bc03462d71=function(e){const t=V(e).value;return $e(t)},r.wbg.__wbg_iterator_6f9d4f28845f426c=function(){return $e(Symbol.iterator)},r.wbg.__wbg_get_765201544a2b6869=function(){return $n(function(e,t){const n=Reflect.get(V(e),V(t));return $e(n)},arguments)},r.wbg.__wbg_call_97ae9d8645dc388b=function(){return $n(function(e,t){const n=V(e).call(V(t));return $e(n)},arguments)},r.wbg.__wbg_isArray_27c46c67f498e15d=function(e){return Array.isArray(V(e))},r.wbg.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b=function(e){let t;try{t=V(e)instanceof ArrayBuffer}catch{t=!1}return t},r.wbg.__wbg_buffer_3f3d764d4747d564=function(e){const t=V(e).buffer;return $e(t)},r.wbg.__wbg_new_8c3f0052272a457a=function(e){const t=new Uint8Array(V(e));return $e(t)},r.wbg.__wbg_set_83db9690f9353e79=function(e,t,n){V(e).set(V(t),n>>>0)},r.wbg.__wbg_length_9e1ae1900cb0fbd5=function(e){return V(e).length},r.wbg.__wbg_instanceof_Uint8Array_971eeda69eb75003=function(e){let t;try{t=V(e)instanceof Uint8Array}catch{t=!1}return t},r.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return $e(e)},r.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const n=V(t).stack,i=qt(n,W.__wbindgen_malloc,W.__wbindgen_realloc),o=Ke;Se()[e/4+1]=o,Se()[e/4+0]=i},r.wbg.__wbg_error_f851667af71bcfc6=function(e,t){try{console.error(ot(e,t))}finally{W.__wbindgen_free(e,t)}},r.wbg.__wbindgen_debug_string=function(e,t){const n=Jn(V(t)),i=qt(n,W.__wbindgen_malloc,W.__wbindgen_realloc),o=Ke;Se()[e/4+1]=o,Se()[e/4+0]=i},r.wbg.__wbindgen_throw=function(e,t){throw new Error(ot(e,t))},r.wbg.__wbindgen_memory=function(){const e=W.memory;return $e(e)},r}function gl(r,e){return W=r.exports,Ni.__wbindgen_wasm_module=e,Vt=new Float64Array,Kt=new Int32Array,Wt=new Uint8Array,W}async function Ni(r){typeof r>"u"&&(r="/atip/browse_dropdown_filters/assets/route_snapper_bg.wasm");const e=hl();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:t,module:n}=await dl(await r,e);return gl(t,n)}const wt="route-snapper",Or=10,_l=30;class ml{constructor(e,t,n){Y(this,"map");Y(this,"inner");Y(this,"active");Y(this,"eventListenersSuccess");Y(this,"eventListenersUpdated");Y(this,"eventListenersFailure");Y(this,"onMouseMove",e=>{if(!this.active)return;const t=[e.point.x-_l,e.point.y],n=this.map.unproject(e.point).distanceTo(this.map.unproject(t));this.inner.onMouseMove(e.lngLat.lng,e.lngLat.lat,n)&&(this.redraw(),this.dataUpdated())});Y(this,"onClick",()=>{this.active&&(this.inner.onClick(),this.redraw(),this.dataUpdated())});Y(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.inner.onClick(),this.finish())});Y(this,"onDragStart",()=>{this.active&&this.inner.onDragStart()&&this.map.dragPan.disable()});Y(this,"onMouseUp",()=>{this.active&&this.inner.onMouseUp()&&this.map.dragPan.enable()});Y(this,"onKeyPress",e=>{this.active&&e.key=="Enter"&&(e.preventDefault(),this.finish())});Y(this,"onKeyDown",e=>{this.active&&(e.key=="Shift"?(e.preventDefault(),this.inner.setSnapMode(!1),this.redraw()):e.key=="Escape"&&(e.preventDefault(),this.cancel()))});Y(this,"onKeyUp",e=>{this.active&&e.key=="Shift"&&(e.preventDefault(),this.inner.setSnapMode(!0),this.redraw())});Y(this,"setHandlers",e=>{e.mapHandlers.mousemove=this.onMouseMove,e.mapHandlers.click=this.onClick,e.mapHandlers.dblclick=this.onDoubleClick,e.mapHandlers.dragstart=this.onDragStart,e.mapHandlers.mouseup=this.onMouseUp,e.documentHandlers.keypress=this.onKeyPress,e.documentHandlers.keydown=this.onKeyDown,e.documentHandlers.keyup=this.onKeyUp});this.map=e,console.time("Deserialize and setup JsRouteSnapper"),this.inner=new dn(t),console.timeEnd("Deserialize and setup JsRouteSnapper"),this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],lt(e,wt,tt()),_n(e,{id:"route-points",source:wt,filter:tr,color:["match",["get","type"],"hovered","green","important","red","black"],radius:["match",["get","type"],"unimportant",Or/2,Or]}),Ft(e,{id:"route-lines",source:wt,filter:er,color:"black",width:2.5}),Zn(e,{id:"route-polygons",source:wt,filter:Qn,color:"black",opacity:.5}),n()}startRoute(){this.active||(this.setActivity(!0),this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}startArea(){this.active||(this.inner.setConfig({avoid_doubling_back:!0,area_mode:!0,extend_route:!0}),this.setActivity(!0),this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}setActivity(e){this.active=e,Dt.set(e)}stop(){this.setActivity(!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()}tearDown(){this.map.removeLayer("route-points"),this.map.removeLayer("route-lines"),this.map.removeLayer("route-polygons"),this.map.removeSource("route-snapper")}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}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.setConfig({...e,area_mode:!1}),this.redraw()}redraw(){this.map.getSource(wt).setData(JSON.parse(this.inner.renderGeojson()))}dataUpdated(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersUpdated)t(JSON.parse(e))}}function bl(r){let e;return{c(){e=$("ul"),e.innerHTML="
  • Click green points on the transport network to create snapped routes
  • Hold Shift to draw a point anywhere
  • Click and drag any point to move it
  • Click a red waypoint to delete it
  • Press Enter or double click to finish
  • Press Escape to cancel
  • "},m(t,n){w(t,e,n)},p:U,d(t){t&&k(e)}}}function yl(r){let e,t,n,i,o,s,a,l,u,f,c,d,h,v,_,b,g,p,m;return e=new _t({props:{label:"Help",$$slots:{default:[bl]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("label"),i=$("input"),o=ie(` - Add points to end`),s=A(),a=$("br"),l=A(),u=$("label"),f=$("input"),c=ie(` - Avoid doubling back`),d=A(),h=$("div"),v=$("button"),v.textContent="Finish",_=A(),b=$("button"),b.textContent="Cancel",R(i,"type","checkbox"),R(n,"title","Keep clicking to add more points to the end of the route"),R(f,"type","checkbox"),R(u,"title","Try to make the route avoid using the same streets with multiple waypoints"),R(v,"type","button"),R(b,"type","button"),Te(h,"display","flex"),Te(h,"justify-content","space-between")},m(y,S){P(e,y,S),w(y,t,S),w(y,n,S),M(n,i),i.checked=r[0],M(n,o),w(y,s,S),w(y,a,S),w(y,l,S),w(y,u,S),M(u,f),f.checked=r[2].avoidDoublingBack,M(u,c),w(y,d,S),w(y,h,S),M(h,v),M(h,_),M(h,b),g=!0,p||(m=[G(i,"change",r[3]),G(f,"change",r[4]),G(v,"click",r[5]),G(b,"click",r[6])],p=!0)},p(y,[S]){const L={};S&128&&(L.$$scope={dirty:S,ctx:y}),e.$set(L),S&1&&(i.checked=y[0]),S&4&&(f.checked=y[2].avoidDoublingBack)},i(y){g||(E(e.$$.fragment,y),g=!0)},o(y){C(e.$$.fragment,y),g=!1},d(y){y&&(k(t),k(n),k(s),k(a),k(l),k(u),k(d),k(h)),B(e,y),p=!1,Ie(m)}}}function vl(r,e,t){let n;z(r,Lt,f=>t(2,n=f));let{routeTool:i}=e,{extendRoute:o}=e;function s(){o=this.checked,t(0,o)}function a(){n.avoidDoublingBack=this.checked,Lt.set(n)}const l=()=>i.finish(),u=()=>i.cancel();return r.$$set=f=>{"routeTool"in f&&t(1,i=f.routeTool),"extendRoute"in f&&t(0,o=f.extendRoute)},r.$$.update=()=>{r.$$.dirty&7&&i.setRouteConfig({avoid_doubling_back:n.avoidDoublingBack,extend_route:o})},[o,i,n,s,a,l,u]}class ji extends Z{constructor(e){super(),Q(this,e,vl,yl,ee,{routeTool:1,extendRoute:0})}}function wl(r){let e;return{c(){e=$("ul"),e.innerHTML="
  • Click green points on the transport network to create snapped routes
  • Click and drag any point to move it
  • Click a red waypoint to delete it
  • Press Enter or double click to finish
  • Press Escape to cancel
  • "},m(t,n){w(t,e,n)},p:U,d(t){t&&k(e)}}}function kl(r){let e,t,n,i,o,s,a,l,u;return e=new _t({props:{label:"Help",$$slots:{default:[wl]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("div"),i=$("button"),i.textContent="Finish",o=A(),s=$("button"),s.textContent="Cancel",R(i,"type","button"),R(s,"type","button"),Te(n,"display","flex"),Te(n,"justify-content","space-between")},m(f,c){P(e,f,c),w(f,t,c),w(f,n,c),M(n,i),M(n,o),M(n,s),a=!0,l||(u=[G(i,"click",r[1]),G(s,"click",r[2])],l=!0)},p(f,[c]){const d={};c&8&&(d.$$scope={dirty:c,ctx:f}),e.$set(d)},i(f){a||(E(e.$$.fragment,f),a=!0)},o(f){C(e.$$.fragment,f),a=!1},d(f){f&&(k(t),k(n)),B(e,f),l=!1,Ie(u)}}}function Sl(r,e,t){let{routeTool:n}=e;const i=()=>n.finish(),o=()=>n.cancel();return r.$$set=s=>{"routeTool"in s&&t(0,n=s.routeTool)},[n,i,o]}class Di extends Z{constructor(e){super(),Q(this,e,Sl,kl,ee,{routeTool:0})}}function Rr(r){let e,t,n,i;const o=[Ll,Cl,$l,Ml,El],s=[];function a(l,u){return l[3]=="point"?0:l[3]=="free-polygon"?1:l[3]=="snap-polygon"?2:l[3]=="route"?3:4}return e=a(r),t=s[e]=o[e](r),{c(){t.c(),n=_e()},m(l,u){s[e].m(l,u),w(l,n,u),i=!0},p(l,u){let f=e;e=a(l),e===f?s[e].p(l,u):(de(),C(s[f],1,1,()=>{s[f]=null}),he(),t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),E(t,1),t.m(n.parentNode,n))},i(l){i||(E(t),i=!0)},o(l){C(t),i=!1},d(l){l&&k(n),s[e].d(l)}}}function El(r){let e;return{c(){e=$("p"),e.textContent="Click an object to edit its geometry"},m(t,n){w(t,e,n)},p:U,i:U,o:U,d(t){t&&k(e)}}}function Ml(r){let e,t;return e=new ji({props:{routeTool:r[2],extendRoute:!1}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&4&&(o.routeTool=n[2]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function $l(r){let e,t;return e=new Di({props:{routeTool:r[2]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&4&&(o.routeTool=n[2]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Cl(r){let e,t;return e=new Pi({props:{polygonTool:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&2&&(o.polygonTool=n[1]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Ll(r){let e,t;return e=new Ti({props:{pointTool:r[0],editingExisting:!0}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.pointTool=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Tl(r){let e,t,n=r[4]==Ot&&Rr(r);return{c(){n&&n.c(),e=_e()},m(i,o){n&&n.m(i,o),w(i,e,o),t=!0},p(i,[o]){i[4]==Ot?n?(n.p(i,o),o&16&&E(n,1)):(n=Rr(i),n.c(),E(n,1),n.m(e.parentNode,e)):n&&(de(),C(n,1,1,()=>{n=null}),he())},i(i){t||(E(n),t=!0)},o(i){C(n),t=!1},d(i){i&&k(e),n&&n.d(i)}}}const Ot="edit-geometry";function Hi(){}function Ir(r,e){r.geometry=e.geometry,e.properties.length_meters&&(r.properties.length_meters=e.properties.length_meters),e.properties.waypoints&&(r.properties.waypoints=e.properties.waypoints)}function Al(r,e,t){let n,i;z(r,Ue,_=>t(10,n=_)),z(r,Ce,_=>t(4,i=_));let{pointTool:o}=e,{polygonTool:s}=e,{routeTool:a}=e,{eventHandler:l}=e,u=null,f=null,c=null;function d(){u&&(o.stop(),s.stop(),a.stop(),ce.update(_=>{let b=_.features.find(g=>g.id==u);return b?(delete b.properties.hide_while_editing,c&&Ir(b,c),_):(window.alert("You loaded another file or cleared everything while editing. Your changes were lost."),_)})),v(),Ye.set(null)}for(let _ of[o,s,a])_.addEventListenerSuccess(b=>{i==Ot&&(ce.update(g=>{let p=g.features.find(m=>m.id==u);return p?(Ir(p,b),delete p.properties.hide_while_editing,g):(window.alert("You loaded another file or cleared everything while editing. Your changes were lost."),g)}),v())});for(let _ of[s,a])_.addEventListenerUpdated(b=>{i==Ot&&(c=b)});for(let _ of[o,s,a])_.addEventListenerFailure(()=>{i==Ot&&(ce.update(b=>{let g=b.features.find(p=>p.id==u);return g?(delete g.properties.hide_while_editing,b):(window.alert("You loaded another file or cleared everything while editing. Your changes were lost."),b)}),v())});l.mapHandlers.mousemove=_=>{var b;if(a.onMouseMove(_),o.onMouseMove(_),s.onMouseMove(_),u==null){let g=n.queryRenderedFeatures(_.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});Ye.set(((b=g[0])==null?void 0:b.id)||null)}},l.mapHandlers.mouseout=()=>{u==null&&Ye.set(null)},l.mapHandlers.click=_=>{if(a.onClick(),o.onClick(),s.onClick(_),u==null){let b=n.queryRenderedFeatures(_.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});b.length>0&&h(b[0].id)}},l.mapHandlers.mousedown=_=>{s.onMouseDown(_)},l.mapHandlers.dblclick=_=>{a.onDoubleClick(_),s.onDoubleClick(_)},l.mapHandlers.dragstart=()=>{a.onDragStart()},l.mapHandlers.mouseup=()=>{a.onMouseUp(),s.onMouseUp()},l.documentHandlers.keypress=_=>{a.onKeyPress(_),s.onKeypress(_)},l.documentHandlers.keydown=_=>{o.onKeyDown(_),s.onKeyDown(_),a.onKeyDown(_)},l.documentHandlers.keyup=_=>{a.onKeyUp(_)};function h(_){Ye.set(null);let b=null;ce.update(p=>(b=p.features.find(m=>m.id==_),b.properties.hide_while_editing=!0,p));let g=b;u=_,g.geometry.type=="LineString"?(a.editExistingRoute(g),t(3,f="route")):g.geometry.type=="Polygon"?g.properties.waypoints?(a.editExistingArea(g),t(3,f="snap-polygon")):(s.editExisting(g),t(3,f="free-polygon")):g.geometry.type=="Point"&&(o.start(),t(3,f="point"))}function v(){u=null,t(3,f=null),c=null}return r.$$set=_=>{"pointTool"in _&&t(0,o=_.pointTool),"polygonTool"in _&&t(1,s=_.polygonTool),"routeTool"in _&&t(2,a=_.routeTool),"eventHandler"in _&&t(5,l=_.eventHandler)},[o,s,a,f,i,l,Hi,d]}class xl extends Z{constructor(e){super(),Q(this,e,Al,Tl,ee,{pointTool:0,polygonTool:1,routeTool:2,eventHandler:5,start:6,stop:7})}get start(){return Hi}get stop(){return this.$$.ctx[7]}}function Fr(r){let e,t;return e=new Ti({props:{pointTool:r[0],editingExisting:!1}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.pointTool=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Ol(r){let e,t,n=r[1]==hn&&Fr(r);return{c(){n&&n.c(),e=_e()},m(i,o){n&&n.m(i,o),w(i,e,o),t=!0},p(i,[o]){i[1]==hn?n?(n.p(i,o),o&2&&E(n,1)):(n=Fr(i),n.c(),E(n,1),n.m(e.parentNode,e)):n&&(de(),C(n,1,1,()=>{n=null}),he())},i(i){t||(E(n),t=!0)},o(i){C(n),t=!1},d(i){i&&k(e),n&&n.d(i)}}}const hn="point";function Rl(r,e,t){let n;z(r,Ce,u=>t(1,n=u));let{changeMode:i}=e,{pointTool:o}=e,{eventHandler:s}=e;function a(){o.setHandlers(s),o.start()}function l(){o.stop()}return o.addEventListenerSuccess(u=>{n==hn&&(ce.update(f=>(u.id=vn(f),u.properties.intervention_type="other",f.features.push(u),f)),i("edit-attribute"),Re.set(u.id))}),o.addEventListenerFailure(()=>{n==hn&&i("edit-attribute")}),r.$$set=u=>{"changeMode"in u&&t(2,i=u.changeMode),"pointTool"in u&&t(0,o=u.pointTool),"eventHandler"in u&&t(3,s=u.eventHandler)},[o,n,i,s,a,l]}class Il extends Z{constructor(e){super(),Q(this,e,Rl,Ol,ee,{changeMode:2,pointTool:0,eventHandler:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function ar(r,e,t,n,i){r.addEventListenerSuccess(o=>{it(Ce)==n&&(ce.update(s=>(o.id=vn(s),o.properties.intervention_type=t,s.features.push(o),s)),e.value=null,i("edit-attribute"),Re.set(o.id))}),r.addEventListenerUpdated(o=>{it(Ce)==n&&(e.value=o)}),r.addEventListenerFailure(()=>{it(Ce)==n&&(e.value=null,i("edit-attribute"))})}function ur(r,e){r.value&&(ce.update(t=>{let n=r.value;return n.id=vn(t),n.properties.intervention_type=e,t.features.push(n),t}),r.value=null)}function Pr(r){let e,t;return e=new Pi({props:{polygonTool:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.polygonTool=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Fl(r){let e,t,n=r[1]==zn&&Pr(r);return{c(){n&&n.c(),e=_e()},m(i,o){n&&n.m(i,o),w(i,e,o),t=!0},p(i,[o]){i[1]==zn?n?(n.p(i,o),o&2&&E(n,1)):(n=Pr(i),n.c(),E(n,1),n.m(e.parentNode,e)):n&&(de(),C(n,1,1,()=>{n=null}),he())},i(i){t||(E(n),t=!0)},o(i){C(n),t=!1},d(i){i&&k(e),n&&n.d(i)}}}const zn="free-polygon";function Pl(r,e,t){let n;z(r,Ce,f=>t(1,n=f));let{changeMode:i}=e,{polygonTool:o}=e,{eventHandler:s}=e,a={value:null};function l(){o.setHandlers(s),o.startNew()}function u(){o.stop(),ur(a,"area")}return ar(o,a,"area",zn,i),r.$$set=f=>{"changeMode"in f&&t(2,i=f.changeMode),"polygonTool"in f&&t(0,o=f.polygonTool),"eventHandler"in f&&t(3,s=f.eventHandler)},[o,n,i,s,l,u]}class Bl extends Z{constructor(e){super(),Q(this,e,Pl,Fl,ee,{changeMode:2,polygonTool:0,eventHandler:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function Nl(r){let e,t;return e=new ji({props:{routeTool:r[0],extendRoute:!0}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.routeTool=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function jl(r){let e;return{c(){e=$("p"),e.textContent="Failed to load"},m(t,n){w(t,e,n)},p:U,i:U,o:U,d(t){t&&k(e)}}}function Dl(r){let e,t,n;return{c(){e=$("label"),e.textContent="Route data unpacking",t=A(),n=$("progress"),R(e,"for","route-unpacking"),R(n,"id","route-unpacking"),R(n,"class","svelte-q3473n")},m(i,o){w(i,e,o),w(i,t,o),w(i,n,o)},p:U,i:U,o:U,d(i){i&&(k(e),k(t),k(n))}}}function Hl(r){let e,t,n;return{c(){e=$("label"),e.textContent="Route tool loading",t=A(),n=$("progress"),R(e,"for","route-loading"),R(n,"id","route-loading"),n.value=r[1],R(n,"class","svelte-q3473n")},m(i,o){w(i,e,o),w(i,t,o),w(i,n,o)},p(i,o){o&2&&(n.value=i[1])},i:U,o:U,d(i){i&&(k(e),k(t),k(n))}}}function Ul(r){let e,t,n,i;const o=[Hl,Dl,jl,Nl],s=[];function a(l,u){return!l[2]&&!l[3]&&!l[4]?0:l[4]&&!l[2]&&!l[3]?1:l[3]?2:l[5]==Ui?3:-1}return~(e=a(r))&&(t=s[e]=o[e](r)),{c(){t&&t.c(),n=_e()},m(l,u){~e&&s[e].m(l,u),w(l,n,u),i=!0},p(l,[u]){let f=e;e=a(l),e===f?~e&&s[e].p(l,u):(t&&(de(),C(s[f],1,1,()=>{s[f]=null}),he()),~e?(t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),E(t,1),t.m(n.parentNode,n)):t=null)},i(l){i||(E(t),i=!0)},o(l){C(t),i=!1},d(l){l&&k(n),~e&&s[e].d(l)}}}const Ui="route";async function ql(r,e){const t=await fetch(r),n=t.body.getReader(),i=parseInt(t.headers.get("Content-Length"));let o=0,s=[];for(;;){const{done:u,value:f}=await n.read();if(u)break;s.push(f),o+=f.length;const c=100*o/i;e(c)}let a=new Uint8Array(o),l=0;for(let u of s)a.set(u,l),l+=u.length;return a}function Gl(r,e,t){let n,i,o;z(r,Ue,g=>t(11,i=g)),z(r,Ce,g=>t(5,o=g));let{changeMode:s}=e,{url:a}=e,{routeTool:l}=e,{eventHandler:u}=e,f=0,c=!1,d=!1,h={value:null};function v(){l.isActive()||(l.setHandlers(u),l.startRoute())}function _(){l==null||l.stop(),ur(h,"route")}Nt(async()=>{await Ni(),console.log(`Grabbing ${a}`);try{const g=await ql(a,p=>t(1,f=p));t(0,l=new ml(i,g,b))}catch(g){console.log(`Route tool broke: ${g}`),t(3,d=!0);return}ar(l,h,"route",Ui,s)});function b(){t(1,f=100),t(2,c=!0)}return r.$$set=g=>{"changeMode"in g&&t(6,s=g.changeMode),"url"in g&&t(7,a=g.url),"routeTool"in g&&t(0,l=g.routeTool),"eventHandler"in g&&t(8,u=g.eventHandler)},r.$$.update=()=>{r.$$.dirty&2&&t(4,n=f>=100)},[l,f,c,d,n,o,s,a,u,v,_]}class Yl extends Z{constructor(e){super(),Q(this,e,Gl,Ul,ee,{changeMode:6,url:7,routeTool:0,eventHandler:8,start:9,stop:10})}get start(){return this.$$.ctx[9]}get stop(){return this.$$.ctx[10]}}function Qt(r,e){return e===void 0&&(e={}),wo(r,function(t,n){var i=n.geometry.coordinates;return t+Xe(i[0],i[1],e)},0)}function Jl(r,e,t){var n=He(t);if(qn(t)!=="LineString")throw new Error("line must be a LineString");var i=Bt(t,r),o=Bt(t,e),s;i.properties.index<=o.properties.index?s=[i,o]:s=[o,i];for(var a=[s[0].geometry.coordinates],l=s[0].properties.index+1;l=s){var a=(t+i)/2;return[e,a-(n-e)/2,n,a+(n-e)/2]}else{var l=(e+n)/2;return[l-(i-t)/2,t,l+(i-t)/2,i]}}function Xl(r,e){e===void 0&&(e={});var t=e.precision,n=e.coordinates,i=e.mutate;if(t=t==null||isNaN(t)?6:t,n=n==null||isNaN(n)?3:n,!r)throw new Error(" is required");if(typeof t!="number")throw new Error(" must be a number");if(typeof n!="number")throw new Error(" must be a number");(i===!1||i===void 0)&&(r=JSON.parse(JSON.stringify(r)));var o=Math.pow(10,t);return ko(r,function(s){Wl(s,o,n)}),r}function Wl(r,e,t){r.length>t&&r.splice(t,r.length);for(var n=0;n1&&t.push(gt(f)),Qe(t)}function qi(r,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var t,n=1/0;return tn(e,function(i){var o=Bt(i,r),s=o.properties.dist;sClick on a route to split it
  • Click on the map or press Escape to cancel
  • "},m(t,n){w(t,e,n)},p:U,d(t){t&&k(e)}}}function Zl(r){let e,t,n=r[0]==jr&&Nr(r);return{c(){n&&n.c(),e=_e()},m(i,o){n&&n.m(i,o),w(i,e,o),t=!0},p(i,[o]){i[0]==jr?n?o&1&&E(n,1):(n=Nr(i),n.c(),E(n,1),n.m(e.parentNode,e)):n&&(de(),C(n,1,1,()=>{n=null}),he())},i(i){t||(E(n),t=!0)},o(i){C(n),t=!1},d(i){i&&k(e),n&&n.d(i)}}}const jr="split-route",Ql=10,ea=30;let Ln="split-route";function ta(r,e,t){let n,i,o;z(r,ce,_=>t(8,n=_)),z(r,Ue,_=>t(6,i=_)),z(r,Ce,_=>t(0,o=_));let{changeMode:s}=e,{eventHandler:a}=e;function l(){i.getCanvas().style.cursor=`url(${Ci}), crosshair`}function u(){i.getCanvas().style.cursor="inherit",t(5,f=null),c=null}let f=null,c=null;lt(i,Ln,tt()),_n(i,{id:"draw-split-route",source:Ln,color:"black",radius:Ql}),a.mapHandlers.mousemove=_=>{t(5,f=null),c=null;let b=d(_.lngLat.toArray());const g=[_.point.x-ea,_.point.y],p=i.unproject(_.point).distanceTo(i.unproject(g))/1e3;let m=[];for(let[y,S]of n.features.entries())if(S.geometry.type=="LineString"){let L=Bt(S.geometry,b,{units:"kilometers"});L.properties.dist!=null&&L.properties.dist<=p&&m.push([y,L.geometry.coordinates,L.properties.dist])}m.sort((y,S)=>y[2]-S[2]),m.length>0&&(t(5,f=d(m[0][1])),c=m[0][0])},a.mapHandlers.click=()=>{if(c==null)s("edit-attribute");else{let _=Vl(n.features[c],f);if(_.features.length==2){let b=_.features[0],g=_.features[1];b.geometry.coordinates=b.geometry.coordinates.map(Yt),g.geometry.coordinates=g.geometry.coordinates.map(Yt),ce.update(p=>(b.id=p.features[c].id,g.id=vn(p),b.properties=JSON.parse(JSON.stringify(p.features[c].properties)),g.properties=JSON.parse(JSON.stringify(b.properties)),h(p.features[c],b,g,f),p.features.splice(c,1,b,g),p))}t(5,f=null),c=null}},a.documentHandlers.keydown=_=>{_.key=="Escape"&&(s("edit-attribute"),_.preventDefault())};function d(_){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:Yt(_)}}}function h(_,b,g,p){b.properties.length_meters=Qt(b,{units:"kilometers"})*1e3,g.properties.length_meters=Qt(g,{units:"kilometers"})*1e3,b.properties.waypoints=[],g.properties.waypoints=[];let m=v(_,p),y=!0,S=0;for(let L of _.properties.waypoints){let O=v(_,ht([L.lon,L.lat]));if(y)if(O{"changeMode"in _&&t(2,s=_.changeMode),"eventHandler"in _&&t(1,a=_.eventHandler)},r.$$.update=()=>{if(r.$$.dirty&96){let _=tt();f&&_.features.push(f),i.getSource(Ln).setData(_)}},[o,a,s,l,u,f,i]}class na extends Z{constructor(e){super(),Q(this,e,ta,Zl,ee,{changeMode:2,eventHandler:1,start:3,stop:4})}get start(){return this.$$.ctx[3]}get stop(){return this.$$.ctx[4]}}function ra(r){let e,t,n,i,o,s,a,l;return{c(){e=$("button"),t=$("img"),i=A(),o=ie(r[1]),Rn(t.src,n=r[2])||R(t,"src",n),R(t,"alt",r[1]),R(t,"class","svelte-1vvpkg9"),R(e,"type","button"),e.disabled=s=r[4]==r[0],R(e,"class","svelte-1vvpkg9")},m(u,f){w(u,e,f),M(e,t),M(e,i),M(e,o),a||(l=G(e,"click",r[5]),a=!0)},p(u,[f]){f&4&&!Rn(t.src,n=u[2])&&R(t,"src",n),f&2&&R(t,"alt",u[1]),f&2&&Oe(o,u[1]),f&17&&s!==(s=u[4]==u[0])&&(e.disabled=s)},i:U,o:U,d(u){u&&k(e),a=!1,l()}}}function ia(r,e,t){let n;z(r,Ce,u=>t(4,n=u));let{thisMode:i}=e,{label:o}=e,{icon:s}=e,{changeMode:a}=e;const l=()=>a(i);return r.$$set=u=>{"thisMode"in u&&t(0,i=u.thisMode),"label"in u&&t(1,o=u.label),"icon"in u&&t(2,s=u.icon),"changeMode"in u&&t(3,a=u.changeMode)},[i,o,s,a,n,l]}class We extends Z{constructor(e){super(),Q(this,e,ia,ra,ee,{thisMode:0,label:1,icon:2,changeMode:3})}}function Dr(r){let e,t;return e=new Di({props:{routeTool:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.routeTool=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function oa(r){let e,t,n=r[1]==Wn&&Dr(r);return{c(){n&&n.c(),e=_e()},m(i,o){n&&n.m(i,o),w(i,e,o),t=!0},p(i,[o]){i[1]==Wn?n?(n.p(i,o),o&2&&E(n,1)):(n=Dr(i),n.c(),E(n,1),n.m(e.parentNode,e)):n&&(de(),C(n,1,1,()=>{n=null}),he())},i(i){t||(E(n),t=!0)},o(i){C(n),t=!1},d(i){i&&k(e),n&&n.d(i)}}}const Wn="snap-polygon";function sa(r,e,t){let n;z(r,Ce,f=>t(1,n=f));let{changeMode:i}=e,{routeTool:o}=e,{eventHandler:s}=e,a={value:null};function l(){o.setHandlers(s),o.startArea()}function u(){o.stop(),ur(a,"area")}return ar(o,a,"area",Wn,i),r.$$set=f=>{"changeMode"in f&&t(2,i=f.changeMode),"routeTool"in f&&t(0,o=f.routeTool),"eventHandler"in f&&t(3,s=f.eventHandler)},[o,n,i,s,l,u]}class la extends Z{constructor(e){super(),Q(this,e,sa,oa,ee,{changeMode:2,routeTool:0,eventHandler:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function Hr(r){let e,t,n,i,o,s,a,l,u,f,c,d,h,v,_;return c=new _t({props:{label:"Help",$$slots:{default:[aa]},$$scope:{ctx:r}}}),h=jt(r[7][0]),{c(){e=$("label"),t=$("input"),n=ie(` - Google Street View`),i=A(),o=$("br"),s=A(),a=$("label"),l=$("input"),u=ie(` - Bing Streetside`),f=A(),F(c.$$.fragment),R(t,"type","radio"),t.__value="google",fe(t,t.__value),R(l,"type","radio"),l.__value="bing",fe(l,l.__value),h.p(t,l)},m(b,g){w(b,e,g),M(e,t),t.checked=t.__value===r[0].streetViewImagery,M(e,n),w(b,i,g),w(b,o,g),w(b,s,g),w(b,a,g),M(a,l),l.checked=l.__value===r[0].streetViewImagery,M(a,u),w(b,f,g),P(c,b,g),d=!0,v||(_=[G(t,"change",r[6]),G(l,"change",r[8])],v=!0)},p(b,g){g&1&&(t.checked=t.__value===b[0].streetViewImagery),g&1&&(l.checked=l.__value===b[0].streetViewImagery);const p={};g&1024&&(p.$$scope={dirty:g,ctx:b}),c.$set(p)},i(b){d||(E(c.$$.fragment,b),d=!0)},o(b){C(c.$$.fragment,b),d=!1},d(b){b&&(k(e),k(i),k(o),k(s),k(a),k(f)),B(c,b),h.r(),v=!1,Ie(_)}}}function aa(r){let e;return{c(){e=$("ul"),e.innerHTML="
  • Click on the map to open a new tab with a 3rd-party imagery provider
  • Press Escape to exit this mode
  • "},m(t,n){w(t,e,n)},p:U,d(t){t&&k(e)}}}function ua(r){let e,t,n=r[1]==Ur&&Hr(r);return{c(){n&&n.c(),e=_e()},m(i,o){n&&n.m(i,o),w(i,e,o),t=!0},p(i,[o]){i[1]==Ur?n?(n.p(i,o),o&2&&E(n,1)):(n=Hr(i),n.c(),E(n,1),n.m(e.parentNode,e)):n&&(de(),C(n,1,1,()=>{n=null}),he())},i(i){t||(E(n),t=!0)},o(i){C(n),t=!1},d(i){i&&k(e),n&&n.d(i)}}}const Ur="street-view";function fa(r,e,t){let n,i,o;z(r,Lt,h=>t(0,n=h)),z(r,Ue,h=>t(9,i=h)),z(r,Ce,h=>t(1,o=h));let{eventHandler:s}=e,{changeMode:a}=e;function l(){i.getCanvas().style.cursor="zoom-in"}function u(){i.getCanvas().style.cursor="inherit"}s.mapHandlers.click=h=>{let v=h.lngLat.lng,_=h.lngLat.lat;n.streetViewImagery=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${_},${v}&cbp=11,0,0,0,0`,"_blank"):n.streetViewImagery=="bing"&&window.open(`https://www.bing.com/maps?cp=${_}~${v}&style=x`,"_blank")},s.documentHandlers.keydown=h=>{h.key=="Escape"&&(a("edit-attribute"),h.preventDefault())};const f=[[]];function c(){n.streetViewImagery=this.__value,Lt.set(n)}function d(){n.streetViewImagery=this.__value,Lt.set(n)}return r.$$set=h=>{"eventHandler"in h&&t(2,s=h.eventHandler),"changeMode"in h&&t(3,a=h.changeMode)},[n,o,s,a,l,u,c,f,d]}class ca extends Z{constructor(e){super(),Q(this,e,fa,ua,ee,{eventHandler:2,changeMode:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function qr(r){let e,t,n={pointTool:r[11],polygonTool:r[12],routeTool:r[2],eventHandler:r[13]["edit-geometry"]};return e=new xl({props:n}),r[16](e),{c(){F(e.$$.fragment)},m(i,o){P(e,i,o),t=!0},p(i,o){const s={};o&4&&(s.routeTool=i[2]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){C(e.$$.fragment,i),t=!1},d(i){r[16](null),B(e,i)}}}function Gr(r){let e,t;return e=new We({props:{thisMode:"point",label:"New point",icon:Rs,changeMode:r[14]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:U,i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Yr(r){let e,t,n={changeMode:r[14],routeTool:r[2],eventHandler:r[13]["snap-polygon"]};return e=new la({props:n}),r[19](e),{c(){F(e.$$.fragment)},m(i,o){P(e,i,o),t=!0},p(i,o){const s={};o&4&&(s.routeTool=i[2]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){C(e.$$.fragment,i),t=!1},d(i){r[19](null),B(e,i)}}}function Jr(r){let e,t;return e=new We({props:{thisMode:"route",label:"New route",icon:Ps,changeMode:r[14]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:U,i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function zr(r){let e,t;return e=new We({props:{thisMode:"split-route",label:"Split route",icon:Ci,changeMode:r[14]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:U,i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function pa(r){let e,t,n,i,o,s,a,l,u,f,c,d,h,v,_,b,g,p,m,y,S,L,O,x,I,N,j,D,T,H,ae,ke,Ee,ue,ne,K,Le;n=new We({props:{thisMode:"edit-attribute",label:"Edit attributes",icon:xs,changeMode:r[14]}});let me={changeMode:r[14],eventHandler:r[13]["edit-attribute"]};o=new Us({props:me}),r[15](o),l=new We({props:{thisMode:"edit-geometry",label:"Edit geometry",icon:Os,changeMode:r[14]}});let ge=r[2]&&qr(r),be=r[1]!="planning"&&Gr(r),yt={changeMode:r[14],pointTool:r[11],eventHandler:r[13].point};h=new Il({props:yt}),r[17](h),b=new We({props:{thisMode:"free-polygon",label:"New polygon (freehand)",icon:Is,changeMode:r[14]}});let Ht={changeMode:r[14],polygonTool:r[12],eventHandler:r[13]["free-polygon"]};p=new Bl({props:Ht}),r[18](p),S=new We({props:{thisMode:"snap-polygon",label:"New polygon (snapped)",icon:Fs,changeMode:r[14]}});let se=r[2]&&Yr(r),re=r[1]!="planning"&&Jr(r);function X(q){r[21](q)}let oe={changeMode:r[14],url:r[0],eventHandler:r[13].route};r[2]!==void 0&&(oe.routeTool=r[2]),N=new Yl({props:oe}),r[20](N),le.push(()=>ve(N,"routeTool",X));let Me=r[1]!="planning"&&zr(r),to={changeMode:r[14],eventHandler:r[13]["split-route"]};ae=new na({props:to}),r[22](ae),ue=new We({props:{thisMode:"street-view",label:"Street View",icon:Bs,changeMode:r[14]}});let no={changeMode:r[14],eventHandler:r[13]["street-view"]};return K=new ca({props:no}),r[23](K),{c(){e=$("div"),t=$("div"),F(n.$$.fragment),i=A(),F(o.$$.fragment),s=A(),a=$("div"),F(l.$$.fragment),u=A(),ge&&ge.c(),f=A(),c=$("div"),be&&be.c(),d=A(),F(h.$$.fragment),v=A(),_=$("div"),F(b.$$.fragment),g=A(),F(p.$$.fragment),m=A(),y=$("div"),F(S.$$.fragment),L=A(),se&&se.c(),O=A(),x=$("div"),re&&re.c(),I=A(),F(N.$$.fragment),D=A(),T=$("div"),Me&&Me.c(),H=A(),F(ae.$$.fragment),ke=A(),Ee=$("div"),F(ue.$$.fragment),ne=A(),F(K.$$.fragment),R(e,"class","toolbox svelte-4s4d3o")},m(q,xe){w(q,e,xe),M(e,t),P(n,t,null),M(t,i),P(o,t,null),M(e,s),M(e,a),P(l,a,null),M(a,u),ge&&ge.m(a,null),M(e,f),M(e,c),be&&be.m(c,null),M(c,d),P(h,c,null),M(e,v),M(e,_),P(b,_,null),M(_,g),P(p,_,null),M(e,m),M(e,y),P(S,y,null),M(y,L),se&&se.m(y,null),M(e,O),M(e,x),re&&re.m(x,null),M(x,I),P(N,x,null),M(e,D),M(e,T),Me&&Me.m(T,null),M(T,H),P(ae,T,null),M(e,ke),M(e,Ee),P(ue,Ee,null),M(Ee,ne),P(K,Ee,null),Le=!0},p(q,[xe]){const ro={};o.$set(ro),q[2]?ge?(ge.p(q,xe),xe&4&&E(ge,1)):(ge=qr(q),ge.c(),E(ge,1),ge.m(a,null)):ge&&(de(),C(ge,1,1,()=>{ge=null}),he()),q[1]!="planning"?be?(be.p(q,xe),xe&2&&E(be,1)):(be=Gr(q),be.c(),E(be,1),be.m(c,d)):be&&(de(),C(be,1,1,()=>{be=null}),he());const io={};h.$set(io);const oo={};p.$set(oo),q[2]?se?(se.p(q,xe),xe&4&&E(se,1)):(se=Yr(q),se.c(),E(se,1),se.m(y,null)):se&&(de(),C(se,1,1,()=>{se=null}),he()),q[1]!="planning"?re?(re.p(q,xe),xe&2&&E(re,1)):(re=Jr(q),re.c(),E(re,1),re.m(x,I)):re&&(de(),C(re,1,1,()=>{re=null}),he());const kn={};xe&1&&(kn.url=q[0]),!j&&xe&4&&(j=!0,kn.routeTool=q[2],we(()=>j=!1)),N.$set(kn),q[1]!="planning"?Me?(Me.p(q,xe),xe&2&&E(Me,1)):(Me=zr(q),Me.c(),E(Me,1),Me.m(T,H)):Me&&(de(),C(Me,1,1,()=>{Me=null}),he());const so={};ae.$set(so);const lo={};K.$set(lo)},i(q){Le||(E(n.$$.fragment,q),E(o.$$.fragment,q),E(l.$$.fragment,q),E(ge),E(be),E(h.$$.fragment,q),E(b.$$.fragment,q),E(p.$$.fragment,q),E(S.$$.fragment,q),E(se),E(re),E(N.$$.fragment,q),E(Me),E(ae.$$.fragment,q),E(ue.$$.fragment,q),E(K.$$.fragment,q),Le=!0)},o(q){C(n.$$.fragment,q),C(o.$$.fragment,q),C(l.$$.fragment,q),C(ge),C(be),C(h.$$.fragment,q),C(b.$$.fragment,q),C(p.$$.fragment,q),C(S.$$.fragment,q),C(se),C(re),C(N.$$.fragment,q),C(Me),C(ae.$$.fragment,q),C(ue.$$.fragment,q),C(K.$$.fragment,q),Le=!1},d(q){q&&k(e),B(n),r[15](null),B(o),B(l),ge&&ge.d(),be&&be.d(),r[17](null),B(h),B(b),r[18](null),B(p),B(S),se&&se.d(),re&&re.d(),r[20](null),B(N),Me&&Me.d(),r[22](null),B(ae),B(ue),r[23](null),B(K)}}}function da(r,e,t){let n,i;z(r,Ue,T=>t(24,n=T)),z(r,Ce,T=>t(25,i=T));let{routeSnapperUrl:o}=e,{schema:s}=e,a,l=new qs(n),u=new ol(n),f,c,d,h,v,_,b,g;const p={"edit-attribute":new Je,"edit-geometry":new Je,route:new Je,point:new Je,"free-polygon":new Je,"snap-polygon":new Je,"split-route":new Je,"street-view":new Je};$r.forEach(T=>{n.on(T,H=>{p[it(Ce)].mapHandlers[T](H)})}),Cr.forEach(T=>{document.addEventListener(T,H=>{p[it(Ce)].documentHandlers[T](H)})});function m(T){let H={"edit-attribute":f,"edit-geometry":c,route:d,point:h,"free-polygon":v,"snap-polygon":_,"split-route":b,"street-view":g};const ae=i;if(ae==T){console.log(`Mode is already ${ae}, not changing`);return}console.log(`Stopping old mode ${ae}`),H[ae].stop(),Ce.set(T),console.log(`Starting new mode ${T}`),H[T].start()}mn(()=>{u==null||u.tearDown(),a==null||a.tearDown(),$r.forEach(T=>{n.off(T,H=>{p[it(Ce)].mapHandlers[T](H)})}),Cr.forEach(T=>{document.removeEventListener(T,H=>{p[it(Ce)].documentHandlers[T](H)})})});function y(T){le[T?"unshift":"push"](()=>{f=T,t(3,f)})}function S(T){le[T?"unshift":"push"](()=>{c=T,t(4,c)})}function L(T){le[T?"unshift":"push"](()=>{h=T,t(6,h)})}function O(T){le[T?"unshift":"push"](()=>{v=T,t(7,v)})}function x(T){le[T?"unshift":"push"](()=>{_=T,t(8,_)})}function I(T){le[T?"unshift":"push"](()=>{d=T,t(5,d)})}function N(T){a=T,t(2,a)}function j(T){le[T?"unshift":"push"](()=>{b=T,t(9,b)})}function D(T){le[T?"unshift":"push"](()=>{g=T,t(10,g)})}return r.$$set=T=>{"routeSnapperUrl"in T&&t(0,o=T.routeSnapperUrl),"schema"in T&&t(1,s=T.schema)},[o,s,a,f,c,d,h,v,_,b,g,l,u,p,m,y,S,L,O,x,I,N,j,D]}class ha extends Z{constructor(e){super(),Q(this,e,da,pa,ee,{routeSnapperUrl:0,schema:1})}}function Xr(r,e,t){const n=r.slice();return n[3]=e[t],n}function Wr(r,e,t){const n=r.slice();return n[6]=e[t],n}function Vr(r){let e;return{c(){e=$("td"),R(e,"class","svelte-11t6rxo"),Te(e,"background-color",r[6])},m(t,n){w(t,e,n)},p(t,n){n&1&&Te(e,"background-color",t[6])},d(t){t&&k(e)}}}function Kr(r){let e,t=r[3]+"",n;return{c(){e=$("td"),n=ie(t),R(e,"class","svelte-11t6rxo"),Te(e,"width",r[2])},m(i,o){w(i,e,o),M(e,n)},p(i,o){o&2&&t!==(t=i[3]+"")&&Oe(n,t)},d(i){i&&k(e)}}}function ga(r){let e,t,n,i,o=De(r[0]),s=[];for(let u=0;u{"colors"in s&&t(0,n=s.colors),"labels"in s&&t(1,i=s.labels)},[n,i,o]}class ma extends Z{constructor(e){super(),Q(this,e,_a,ga,ee,{colors:0,labels:1})}}const ba="/atip/browse_dropdown_filters/assets/help-d011708a.svg";function ya(r){let e,t;return{c(){e=$("img"),Rn(e.src,t=ba)||R(e,"src",t),R(e,"title",r[0]),R(e,"alt",r[0])},m(n,i){w(n,e,i)},p(n,[i]){i&1&&R(e,"title",n[0]),i&1&&R(e,"alt",n[0])},i:U,o:U,d(n){n&&k(e)}}}function va(r,e,t){let{contents:n}=e;return r.$$set=i=>{"contents"in i&&t(0,n=i.contents)},[n]}class Gi extends Z{constructor(e){super(),Q(this,e,va,ya,ee,{contents:0})}}function wa(r){let e,t,n,i,o,s,a;return t=new Gi({props:{contents:"Data comes from OpenStreetMap, and may not always be correct. Unexpected values are treated as unknown. Freehand route segments and off-road paths generally have no speed data."}}),i=new ma({props:{colors:r[0],labels:["< 20","20","30","40",">= 50"]}}),s=new Po({props:{layers:["speed-limits"],contents:Sa}}),{c(){e=ie(`(mph) -`),F(t.$$.fragment),n=A(),F(i.$$.fragment),o=A(),F(s.$$.fragment)},m(l,u){w(l,e,u),P(t,l,u),w(l,n,u),P(i,l,u),w(l,o,u),P(s,l,u),a=!0},p:U,i(l){a||(E(t.$$.fragment,l),E(i.$$.fragment,l),E(s.$$.fragment,l),a=!0)},o(l){C(t.$$.fragment,l),C(i.$$.fragment,l),C(s.$$.fragment,l),a=!1},d(l){l&&(k(e),k(n),k(o)),B(t,l),B(i,l),B(s,l)}}}let ka="white",ct="speed-limits",Tn="speed-limits",kt=.8;function Sa(r){return r.speed_limit?`${Math.round(r.speed_limit)} mph`:"Unknown"}function Ea(r,e,t){let n,i,o;z(r,Ue,f=>t(2,n=f)),z(r,mt,f=>t(3,i=f)),z(r,ce,f=>t(4,o=f));let{id:s}=e,a=["#00AB4D","#8ECA4D","#F7BB00","#BB0000","#470000"];const l=["case",["<",["get","speed_limit"],20],a[0],["==",["get","speed_limit"],20],a[1],["==",["get","speed_limit"],30],a[2],["==",["get","speed_limit"],40],a[3],[">=",["get","speed_limit"],50],a[4],ka],u=["case",["<",["get","speed_limit"],20],kt,["==",["get","speed_limit"],20],kt,["==",["get","speed_limit"],30],kt,["==",["get","speed_limit"],40],kt,[">=",["get","speed_limit"],50],kt,0];return lt(n,ct,tt()),Ft(n,{id:Tn,source:ct,color:l,width:In,opacity:u}),Nt(async()=>{try{if(s){let f=o.features.find(d=>d.id==s),c=JSON.parse(await i.speedLimitForRoute(f.properties.waypoints));n.getSource(ct).setData(c)}else{let f=JSON.parse(await i.allSpeedLimits());n.getSource(ct).setData(f)}}catch(f){window.alert(`Couldn't calculate speed limits for route: ${f}`)}}),mn(()=>{n.getLayer(Tn)&&n.removeLayer(Tn),n.getSource(ct)&&n.removeSource(ct)}),r.$$set=f=>{"id"in f&&t(1,s=f.id)},[a,s]}class Yi extends Z{constructor(e){super(),Q(this,e,Ea,wa,ee,{id:1})}}function Ma(r){let e;return{c(){e=$("p"),e.textContent="Route info loading..."},m(t,n){w(t,e,n)},p:U,i:U,o:U,d(t){t&&k(e)}}}function $a(r){let e,t,n,i,o,s,a,l,u,f,c,d=r[1]=="speed limits"&&Zr();return{c(){e=$("label"),t=ie(`Show layer: - `),n=$("select"),i=$("option"),i.textContent="None",o=$("option"),o.textContent="Speed limits",a=A(),d&&d.c(),l=_e(),i.__value="none",fe(i,i.__value),o.__value="speed limits",fe(o,o.__value),n.disabled=s=r[0]!=null,r[1]===void 0&&bn(()=>r[3].call(n))},m(h,v){w(h,e,v),M(e,t),M(e,n),M(n,i),M(n,o),rn(n,r[1],!0),w(h,a,v),d&&d.m(h,v),w(h,l,v),u=!0,f||(c=G(n,"change",r[3]),f=!0)},p(h,v){(!u||v&1&&s!==(s=h[0]!=null))&&(n.disabled=s),v&2&&rn(n,h[1]),h[1]=="speed limits"?d?(d.p(h,v),v&2&&E(d,1)):(d=Zr(),d.c(),E(d,1),d.m(l.parentNode,l)):d&&(de(),C(d,1,1,()=>{d=null}),he())},i(h){u||(E(d),u=!0)},o(h){C(d),u=!1},d(h){h&&(k(e),k(a),k(l)),d&&d.d(h),f=!1,c()}}}function Zr(r){let e,t;return e=new Yi({props:{id:void 0}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:U,i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Ca(r){let e,t,n,i;const o=[$a,Ma],s=[];function a(l,u){return l[2]?0:1}return e=a(r),t=s[e]=o[e](r),{c(){t.c(),n=_e()},m(l,u){s[e].m(l,u),w(l,n,u),i=!0},p(l,[u]){let f=e;e=a(l),e===f?s[e].p(l,u):(de(),C(s[f],1,1,()=>{s[f]=null}),he(),t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),E(t,1),t.m(n.parentNode,n))},i(l){i||(E(t),i=!0)},o(l){C(t),i=!1},d(l){l&&k(n),s[e].d(l)}}}function La(r,e,t){let n,i;z(r,Re,a=>t(0,n=a)),z(r,mt,a=>t(2,i=a));let o="none";function s(){o=hi(this),t(1,o),t(0,n)}return r.$$.update=()=>{r.$$.dirty&1&&n&&t(1,o="none")},[n,o,i,s]}class Ta extends Z{constructor(e){super(),Q(this,e,La,Ca,ee,{})}}function Aa(r){let e,t,n,i,o,s,a,l,u,f;return{c(){e=$("p"),t=ie(r[4]),n=A(),i=$("button"),o=ie(r[5]),s=A(),a=$("button"),l=ie(r[6]),R(i,"type","button"),R(a,"type","button")},m(c,d){w(c,e,d),M(e,t),w(c,n,d),w(c,i,d),M(i,o),w(c,s,d),w(c,a,d),M(a,l),u||(f=[G(i,"click",r[7]),G(a,"click",r[8])],u=!0)},p(c,d){d&16&&Oe(t,c[4]),d&32&&Oe(o,c[5]),d&64&&Oe(l,c[6])},d(c){c&&(k(e),k(n),k(i),k(s),k(a)),u=!1,Ie(f)}}}function xa(r){let e,t,n,i,o,s;function a(d){r[9](d)}function l(d){r[10](d)}function u(d){r[11](d)}function f(d){r[12](d)}let c={$$slots:{default:[Aa]},$$scope:{ctx:r}};return r[3]!==void 0&&(c.title=r[3]),r[0]!==void 0&&(c.open=r[0]),r[1]!==void 0&&(c.displayEscapeButton=r[1]),r[2]!==void 0&&(c.canCloseByClickingBackground=r[2]),e=new _i({props:c}),le.push(()=>ve(e,"title",a)),le.push(()=>ve(e,"open",l)),le.push(()=>ve(e,"displayEscapeButton",u)),le.push(()=>ve(e,"canCloseByClickingBackground",f)),{c(){F(e.$$.fragment)},m(d,h){P(e,d,h),s=!0},p(d,[h]){const v={};h&16496&&(v.$$scope={dirty:h,ctx:d}),!t&&h&8&&(t=!0,v.title=d[3],we(()=>t=!1)),!n&&h&1&&(n=!0,v.open=d[0],we(()=>n=!1)),!i&&h&2&&(i=!0,v.displayEscapeButton=d[1],we(()=>i=!1)),!o&&h&4&&(o=!0,v.canCloseByClickingBackground=d[2],we(()=>o=!1)),e.$set(v)},i(d){s||(E(e.$$.fragment,d),s=!0)},o(d){C(e.$$.fragment,d),s=!1},d(d){B(e,d)}}}function Oa(r,e,t){const n=Mo();let{open:i=!1}=e,{displayEscapeButton:o=!1}=e,{canCloseByClickingBackground:s=!1}=e,{title:a}=e,{message:l}=e,{confirmButtonText:u="Confirm"}=e,{cancelButtonText:f="Cancel"}=e;function c(){n("confirmAction")}function d(){n("cancelAction")}function h(g){a=g,t(3,a)}function v(g){i=g,t(0,i)}function _(g){o=g,t(1,o)}function b(g){s=g,t(2,s)}return r.$$set=g=>{"open"in g&&t(0,i=g.open),"displayEscapeButton"in g&&t(1,o=g.displayEscapeButton),"canCloseByClickingBackground"in g&&t(2,s=g.canCloseByClickingBackground),"title"in g&&t(3,a=g.title),"message"in g&&t(4,l=g.message),"confirmButtonText"in g&&t(5,u=g.confirmButtonText),"cancelButtonText"in g&&t(6,f=g.cancelButtonText)},[i,o,s,a,l,u,f,c,d,h,v,_,b]}class Ra extends Z{constructor(e){super(),Q(this,e,Oa,xa,ee,{open:0,displayEscapeButton:1,canCloseByClickingBackground:2,title:3,message:4,confirmButtonText:5,cancelButtonText:6})}}function Qr(r){let e;return{c(){e=$("p"),e.textContent=`Finish drawing on the map and/or select "Edit attributes" to use these - options.`,R(e,"class","reminder")},m(t,n){w(t,e,n)},d(t){t&&k(e)}}}function Ia(r){let e,t,n,i,o,s,a,l,u,f,c,d,h,v,_,b,g,p=r[0].features.length+"",m,y,S,L,O,x,I,N,j,D,T,H,ae;u=new $o({props:{label:"Load from GeoJSON",id:"load-geojson",disabled:r[2],loadFile:r[7]}});function ke(ne){r[13](ne)}let Ee={title:"Would you like to clear your work?",message:"This will delete all your drawn interventions."};r[1]!==void 0&&(Ee.open=r[1]),N=new Ra({props:Ee}),le.push(()=>ve(N,"open",ke)),N.$on("cancelAction",r[4]),N.$on("confirmAction",r[5]);let ue=r[2]&&Qr();return{c(){e=$("div"),t=$("label"),n=ie(`Scheme name: - `),i=$("input"),o=A(),s=$("br"),a=A(),l=$("div"),F(u.$$.fragment),f=A(),c=$("button"),d=ie("Export to GeoJSON"),h=A(),v=$("br"),_=A(),b=$("div"),g=$("span"),m=ie(p),y=ie(" objects"),S=A(),L=$("button"),O=ie("Clear all"),I=A(),F(N.$$.fragment),D=A(),ue&&ue.c(),R(i,"type","text"),R(c,"type","button"),R(c,"class","align-right svelte-wfhzcu"),c.disabled=r[2],R(L,"type","button"),R(L,"class","align-right svelte-wfhzcu"),L.disabled=x=r[0].features.length==0||r[2]},m(ne,K){w(ne,e,K),M(e,t),M(t,n),M(t,i),fe(i,r[0].scheme_name),w(ne,o,K),w(ne,s,K),w(ne,a,K),w(ne,l,K),P(u,l,null),M(l,f),M(l,c),M(c,d),w(ne,h,K),w(ne,v,K),w(ne,_,K),w(ne,b,K),M(b,g),M(g,m),M(g,y),M(b,S),M(b,L),M(L,O),M(b,I),P(N,b,null),M(b,D),ue&&ue.m(b,null),T=!0,H||(ae=[G(i,"input",r[12]),G(c,"click",r[6]),G(L,"click",r[3])],H=!0)},p(ne,[K]){K&1&&i.value!==ne[0].scheme_name&&fe(i,ne[0].scheme_name);const Le={};K&4&&(Le.disabled=ne[2]),u.$set(Le),(!T||K&4)&&(c.disabled=ne[2]),(!T||K&1)&&p!==(p=ne[0].features.length+"")&&Oe(m,p),(!T||K&5&&x!==(x=ne[0].features.length==0||ne[2]))&&(L.disabled=x);const me={};!j&&K&2&&(j=!0,me.open=ne[1],we(()=>j=!1)),N.$set(me),ne[2]?ue||(ue=Qr(),ue.c(),ue.m(b,null)):ue&&(ue.d(1),ue=null)},i(ne){T||(E(u.$$.fragment,ne),E(N.$$.fragment,ne),T=!0)},o(ne){C(u.$$.fragment,ne),C(N.$$.fragment,ne),T=!1},d(ne){ne&&(k(e),k(o),k(s),k(a),k(l),k(h),k(v),k(_),k(b)),B(u),B(N),ue&&ue.d(),H=!1,Ie(ae)}}}function Fa(r,e){var t=document.createElement("a");t.setAttribute("href","data:text/plain;charset=utf-8, "+encodeURIComponent(e)),t.setAttribute("download",r),document.body.appendChild(t),t.click(),document.body.removeChild(t)}function Pa(r,e,t){let n,i;z(r,ce,m=>t(0,n=m)),z(r,Dt,m=>t(2,i=m));let{authorityName:o}=e,{schema:s}=e,a=o;s!="v1"&&(a+=`_${s}`);let l=!1,u=!1;Nt(async()=>{let y=new URLSearchParams(window.location.search).get("geojsonUrl"),S=window.localStorage.getItem(a);if(y){console.log(`Loading GeoJSON from ${y}`);try{let O=await(await fetch(y)).text();ce.set(b(JSON.parse(O)))}catch(L){console.log(`Failed to load from URL: ${L}`)}}else if(S)try{ce.set(b(JSON.parse(S)))}catch(L){console.log(`Failed to load from local storage: ${L}`)}t(11,l=!0)});function f(){t(1,u=!0)}function c(){t(1,u=!1)}function d(){t(1,u=!1),ce.update(m=>(delete m.scheme_name,m.features=[],m)),Re.set(null),Ye.set(null),sn.set(null),ln.set(null)}function h(){const m=JSON.parse(JSON.stringify(n));for(let y of m.features)delete y.properties.hide_while_editing;return m}function v(){let m=h();var y=a;m.authority=o,m.origin="atip-v2",m.scheme_name&&(y+="_"+m.scheme_name),y+=".txt",Fa(y,JSON.stringify(m,null," "))}function _(m){try{ce.set(b(JSON.parse(m)))}catch(y){window.alert(`Couldn't load scheme from a file: ${y}`)}}function b(m){let y=1;for(let S of m.features)S.properties||(S.properties={name:"",description:"",intervention_type:"other"}),S.geometry.type=="LineString"&&!S.properties.length_meters&&(S.properties.length_meters=Qt(S,{units:"kilometers"})*1e3),S.id=y++;return m}function g(){n.scheme_name=this.value,ce.set(n)}function p(m){u=m,t(1,u)}return r.$$set=m=>{"authorityName"in m&&t(8,o=m.authorityName),"schema"in m&&t(9,s=m.schema)},r.$$.update=()=>{r.$$.dirty&3073&&l&&n&&(console.log("GJ changed, saving to local storage"),window.localStorage.setItem(a,JSON.stringify(h())))},[n,u,i,f,c,d,v,_,o,s,a,l,g,p]}class Ba extends Z{constructor(e){super(),Q(this,e,Pa,Ia,ee,{authorityName:8,schema:9})}}function Na(r){let e,t,n,i,o,s,a,l,u,f,c,d,h;return{c(){e=$("h2"),e.textContent="Drawing objects on the map",t=A(),n=$("p"),n.textContent=`Use the tools on right to sketch new objects on the map. Each tool has - instructions that appear when you click on its icon.`,i=A(),o=$("p"),o.innerHTML="Modify existing objects on the map using Edit geometry and clicking something.",s=A(),a=$("h2"),a.textContent="Filling out data",l=A(),u=$("p"),u.innerHTML=`Edit attributes mode allows selecting and adding attributes to objects - that appear on the left.`,f=A(),c=$("h2"),c.textContent="Saving files",d=A(),h=$("p"),h.innerHTML=`ATIP does not send any data over the network or store your data in the - cloud. The current file you're editing will be saved in your browser's local - storage and automatically resume when you return to the page. The Export to GeoJSON - and Load from GeoJSON buttons save and load GeoJSON files (with a - .txt file extension) to your computer. You share these files with others - to collaborate on designs.`},m(v,_){w(v,e,_),w(v,t,_),w(v,n,_),w(v,i,_),w(v,o,_),w(v,s,_),w(v,a,_),w(v,l,_),w(v,u,_),w(v,f,_),w(v,c,_),w(v,d,_),w(v,h,_)},p:U,d(v){v&&(k(e),k(t),k(n),k(i),k(o),k(s),k(a),k(l),k(u),k(f),k(c),k(d),k(h))}}}function ja(r){let e,t,n;function i(s){r[1](s)}let o={title:"Instructions",$$slots:{default:[Na]},$$scope:{ctx:r}};return r[0]!==void 0&&(o.open=r[0]),e=new _i({props:o}),le.push(()=>ve(e,"open",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};a&4&&(l.$$scope={dirty:a,ctx:s}),!t&&a&1&&(t=!0,l.open=s[0],we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function Da(r,e,t){let{open:n}=e;function i(o){n=o,t(0,n)}return r.$$set=o=>{"open"in o&&t(0,n=o.open)},[n,i]}class Ha extends Z{constructor(e){super(),Q(this,e,Da,ja,ee,{open:0})}}const Ua="ATF4Intervention",qa=[{name:"name",type:"one-liner"},{name:"description",type:"textbox"},{name:"type",oneOf:["New segregated cycling facility","New junction treatment","New permanent footway","New shared use (walking and cycling) facilities","Improvements to make an existing walking/cycle route safer","Area-wide traffic management (including by TROs - both permanent and experimental)","Bus priority measures that also enable active travel (for example, bus gates)","Provision of secure cycle parking facilities","New road crossings","Restriction or reduction of car parking availability","School streets"]},{name:"complexity",oneOf:["high","medium","low"]}],Ga={name:Ua,members:qa};function Ya(r){const e=r-1;return e*e*e+1}function gn(r,{delay:e=0,duration:t=400,easing:n=Ya,axis:i="y"}={}){const o=getComputedStyle(r),s=+o.opacity,a=i==="y"?"height":"width",l=parseFloat(o[a]),u=i==="y"?["top","bottom"]:["left","right"],f=u.map(g=>`${g[0].toUpperCase()}${g.slice(1)}`),c=parseFloat(o[`padding${f[0]}`]),d=parseFloat(o[`padding${f[1]}`]),h=parseFloat(o[`margin${f[0]}`]),v=parseFloat(o[`margin${f[1]}`]),_=parseFloat(o[`border${f[0]}Width`]),b=parseFloat(o[`border${f[1]}Width`]);return{delay:e,duration:t,easing:n,css:g=>`overflow: hidden;opacity: ${Math.min(g*20,1)*s};${a}: ${g*l}px;padding-${u[0]}: ${g*c}px;padding-${u[1]}: ${g*d}px;margin-${u[0]}: ${g*h}px;margin-${u[1]}: ${g*v}px;border-${u[0]}-width: ${g*_}px;border-${u[1]}-width: ${g*b}px;`}}function Ji(r){return"members"in r}function zi(r){return"oneOf"in r}function Xi(r){return typeof r=="string"}function Wi(r){return typeof r=="object"&&"value"in r}function Ja(r){return"type"in r&&r.type=="number"}function Vi(r){return"type"in r&&r.type=="one-liner"}function Ki(r){return"type"in r&&r.type=="textbox"}function Zi(r){return"type"in r&&r.type=="checkbox"}function ei(r,e,t){const n=r.slice();return n[15]=e[t],n[18]=e,n[19]=t,n}function ti(r,e,t){const n=r.slice();return n[15]=e[t],n[16]=e,n[17]=t,n}function ni(r){let e,t=r[1].description+"",n;return{c(){e=$("p"),n=ie(t),R(e,"class","svelte-1b72l00")},m(i,o){w(i,e,o),M(e,n)},p(i,o){o&2&&t!==(t=i[1].description+"")&&Oe(n,t)},d(i){i&&k(e)}}}function za(r){let e,t,n;return{c(){e=$("input"),R(e,"type","checkbox")},m(i,o){w(i,e,o),e.checked=r[0],t||(n=G(e,"change",r[14]),t=!0)},p(i,o){o&1&&(e.checked=i[0])},i:U,o:U,d(i){i&&k(e),t=!1,n()}}}function Xa(r){let e,t,n;return{c(){e=$("textarea"),Te(e,"width","100%"),R(e,"rows","5"),R(e,"class","svelte-1b72l00")},m(i,o){w(i,e,o),fe(e,r[0]),t||(n=G(e,"input",r[13]),t=!0)},p(i,o){o&1&&fe(e,i[0])},i:U,o:U,d(i){i&&k(e),t=!1,n()}}}function Wa(r){let e,t,n;return{c(){e=$("input"),R(e,"type","text"),Te(e,"width","100%")},m(i,o){w(i,e,o),fe(e,r[0]),t||(n=G(e,"input",r[12]),t=!0)},p(i,o){o&1&&e.value!==i[0]&&fe(e,i[0])},i:U,o:U,d(i){i&&k(e),t=!1,n()}}}function Va(r){let e,t,n;return{c(){e=$("input"),R(e,"type","number")},m(i,o){w(i,e,o),fe(e,r[0]),t||(n=G(e,"input",r[11]),t=!0)},p(i,o){o&1&&gi(e.value)!==i[0]&&fe(e,i[0])},i:U,o:U,d(i){i&&k(e),t=!1,n()}}}function Ka(r){let e,t,n=De(r[1].oneOf),i=[];for(let s=0;sC(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;sC(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;s{_=null}),he())},i(b){c||(E(_),c=!0)},o(b){C(_),c=!1},d(b){b&&(k(e),k(u),k(f)),_&&_.d(b),d.r(),h=!1,Ie(v)}}}function eu(r){let e,t,n,i=!1,o,s=r[15].value+"",a,l,u,f,c,d;function h(b,g){return b[15].description?ru:nu}let v=h(r),_=v(r);return f=jt(r[7][0]),{c(){e=$("label"),t=$("input"),o=A(),a=ie(s),l=A(),_.c(),u=A(),R(t,"type","radio"),t.__value=n=r[15].value,fe(t,t.__value),f.p(t)},m(b,g){w(b,e,g),M(e,t),t.checked=t.__value===r[2],M(e,o),M(e,a),M(e,l),_.m(e,null),M(e,u),c||(d=[G(t,"change",r[8]),G(t,"change",r[3])],c=!0)},p(b,g){g&2&&n!==(n=b[15].value)&&(t.__value=n,fe(t,t.__value),i=!0),(i||g&6)&&(t.checked=t.__value===b[2]),g&2&&s!==(s=b[15].value+"")&&Oe(a,s),v===(v=h(b))&&_?_.p(b,g):(_.d(1),_=v(b),_&&(_.c(),_.m(e,u)))},i:U,o:U,d(b){b&&k(e),_.d(),f.r(),c=!1,Ie(d)}}}function tu(r){let e,t,n,i=!1,o,s=r[15]+"",a,l,u,f,c,d,h;return c=jt(r[7][0]),{c(){e=$("label"),t=$("input"),o=A(),a=ie(s),l=A(),u=$("br"),f=A(),R(t,"type","radio"),t.__value=n=r[15],fe(t,t.__value),c.p(t)},m(v,_){w(v,e,_),M(e,t),t.checked=t.__value===r[2],M(e,o),M(e,a),M(e,l),M(e,u),M(e,f),d||(h=[G(t,"change",r[6]),G(t,"change",r[3])],d=!0)},p(v,_){_&2&&n!==(n=v[15])&&(t.__value=n,fe(t,t.__value),i=!0),(i||_&6)&&(t.checked=t.__value===v[2]),_&2&&s!==(s=v[15]+"")&&Oe(a,s)},i:U,o:U,d(v){v&&k(e),c.r(),d=!1,Ie(h)}}}function ri(r){let e,t,n,i,o,s;function a(u){r[10](u,r[15])}let l={spec:r[15]};return r[0][r[15].name]!==void 0&&(l.value=r[0][r[15].name]),t=new bt({props:l}),le.push(()=>ve(t,"value",a)),{c(){e=$("div"),F(t.$$.fragment),i=A(),R(e,"class","svelte-1b72l00")},m(u,f){w(u,e,f),P(t,e,null),M(e,i),s=!0},p(u,f){r=u;const c={};f&2&&(c.spec=r[15]),!n&&f&3&&(n=!0,c.value=r[0][r[15].name],we(()=>n=!1)),t.$set(c)},i(u){s||(E(t.$$.fragment,u),u&&bn(()=>{s&&(o||(o=on(e,gn,{duration:500},!0)),o.run(1))}),s=!0)},o(u){C(t.$$.fragment,u),u&&(o||(o=on(e,gn,{duration:500},!1)),o.run(0)),s=!1},d(u){u&&k(e),B(t),u&&o&&o.end()}}}function nu(r){let e;return{c(){e=$("br")},m(t,n){w(t,e,n)},p:U,d(t){t&&k(e)}}}function ru(r){let e,t,n=r[15].description+"",i,o;return{c(){e=$("p"),t=ie("("),i=ie(n),o=ie(")"),R(e,"class","svelte-1b72l00")},m(s,a){w(s,e,a),M(e,t),M(e,i),M(e,o)},p(s,a){a&2&&n!==(n=s[15].description+"")&&Oe(i,n)},d(s){s&&k(e)}}}function ii(r){let e,t,n,i,o,s;const a=[tu,eu,Qa],l=[];function u(f,c){return c&2&&(e=null),c&2&&(t=null),e==null&&(e=!!Xi(f[15])),e?0:(t==null&&(t=!!Wi(f[15])),t?1:2)}return n=u(r,-1),i=l[n]=a[n](r),{c(){i.c(),o=_e()},m(f,c){l[n].m(f,c),w(f,o,c),s=!0},p(f,c){let d=n;n=u(f,c),n===d?l[n].p(f,c):(de(),C(l[d],1,1,()=>{l[d]=null}),he(),i=l[n],i?i.p(f,c):(i=l[n]=a[n](f),i.c()),E(i,1),i.m(o.parentNode,o))},i(f){s||(E(i),s=!0)},o(f){C(i),s=!1},d(f){f&&k(o),l[n].d(f)}}}function oi(r){let e,t,n=r[15].name+"",i,o,s,a,l,u;function f(d){r[5](d,r[15])}let c={spec:r[15]};return r[0][r[15].name]!==void 0&&(c.value=r[0][r[15].name]),s=new bt({props:c}),le.push(()=>ve(s,"value",f)),{c(){e=$("div"),t=$("h3"),i=ie(n),o=A(),F(s.$$.fragment),l=A(),R(e,"class","svelte-1b72l00")},m(d,h){w(d,e,h),M(e,t),M(t,i),M(e,o),P(s,e,null),M(e,l),u=!0},p(d,h){r=d,(!u||h&2)&&n!==(n=r[15].name+"")&&Oe(i,n);const v={};h&2&&(v.spec=r[15]),!a&&h&3&&(a=!0,v.value=r[0][r[15].name],we(()=>a=!1)),s.$set(v)},i(d){u||(E(s.$$.fragment,d),u=!0)},o(d){C(s.$$.fragment,d),u=!1},d(d){d&&k(e),B(s)}}}function iu(r){let e,t,n,i,o,s,a,l,u,f,c,d=r[1].description&&ni(r);const h=[Za,Ka,Va,Wa,Xa,za],v=[];function _(b,g){return g&2&&(t=null),g&2&&(n=null),g&2&&(i=null),g&2&&(o=null),g&2&&(s=null),g&2&&(a=null),t==null&&(t=!!Ji(b[1])),t?0:(n==null&&(n=!!zi(b[1])),n?1:(i==null&&(i=!!Ja(b[1])),i?2:(o==null&&(o=!!Vi(b[1])),o?3:(s==null&&(s=!!Ki(b[1])),s?4:(a==null&&(a=!!Zi(b[1])),a?5:-1)))))}return~(l=_(r,-1))&&(u=v[l]=h[l](r)),{c(){d&&d.c(),e=A(),u&&u.c(),f=_e()},m(b,g){d&&d.m(b,g),w(b,e,g),~l&&v[l].m(b,g),w(b,f,g),c=!0},p(b,[g]){b[1].description?d?d.p(b,g):(d=ni(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);let p=l;l=_(b,g),l===p?~l&&v[l].p(b,g):(u&&(de(),C(v[p],1,1,()=>{v[p]=null}),he()),~l?(u=v[l],u?u.p(b,g):(u=v[l]=h[l](b),u.c()),E(u,1),u.m(f.parentNode,f)):u=null)},i(b){c||(E(u),c=!0)},o(b){C(u),c=!1},d(b){b&&(k(e),k(f)),d&&d.d(b),~l&&v[l].d(b)}}}function ou(r,e,t){var p,m,y;let{spec:n}=e,{value:i}=e,o="";if(Ji(n)){i||(i={});for(let S of n.members)Vi(S)||Ki(S)?i[p=S.name]||(i[p]=""):Zi(S)?i[m=S.name]||(i[m]=!1):i[y=S.name]||(i[y]={})}else zi(n)&&(i||(i={}),Xi(i)?o=i:Wi(i)?o=i.value:o=Object.keys(i)[0]||"");function s(){t(0,i=o)}function a(){t(0,i={}),t(0,i[o]={},i)}const l=[[]];function u(S,L){r.$$.not_equal(i[L.name],S)&&(i[L.name]=S,t(0,i))}function f(){o=this.__value,t(2,o)}function c(){o=this.__value,t(2,o)}function d(){o=this.__value,t(2,o)}function h(S,L){r.$$.not_equal(i[L.name],S)&&(i[L.name]=S,t(0,i))}function v(){i=gi(this.value),t(0,i)}function _(){i=this.value,t(0,i)}function b(){i=this.value,t(0,i)}function g(){i=this.checked,t(0,i)}return r.$$set=S=>{"spec"in S&&t(1,n=S.spec),"value"in S&&t(0,i=S.value)},[i,n,o,s,a,u,f,l,c,d,h,v,_,b,g]}class bt extends Z{constructor(e){super(),Q(this,e,ou,iu,ee,{spec:1,value:0})}}function su(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].atf4!==void 0&&(o.value=r[0].atf4),e=new bt({props:o}),le.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].atf4,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function lu(r,e,t){let{props:n}=e;n.atf4||(n.atf4={});let i=Ga;function o(s){r.$$.not_equal(n.atf4,s)&&(n.atf4=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class au extends Z{constructor(e){super(),Q(this,e,lu,su,ee,{props:0})}}const uu="CriticalIssue",fu=[{name:"name",type:"one-liner"},{name:"Type",oneOf:[{value:"Conflict with motor traffic at side roads / priority junctions",description:">2500vpd cut across main cycling or walking streams"},{value:"Conflict with motor traffic at signal controlled junctions and roundabouts",description:">2500vpd cut across main cycling or walking streams"},{value:"Collision alongside or from behind",description:"Cyclists are not protected in traffic lanes between 3.25 and 3.9m wide."},{value:"Trip hazard",description:"There are level differences of greater than 20mm with no colour contrast to help identify them."},{value:"Conflict with kerbside activity (parking, loading, risk of 'dooring') ",description:"Cycle facility next to parking/loading with no buffer."},{value:"Kerbside activity or risk of crossing conflict",description:"On busy roads (>8000vpd) formal crossings are more than 400m apart. On quieter roads (<8000vpd), desire lines are blocked by parking and loading."},{value:"Standard of crossing facility",description:"On busy roads (>8000vpd), there are uncontrolled crossings of two or more lanes with no gaps in traffic. At signal junctions there are arms with no green man for pedestrians."},{value:"Speed of traffic (where cyclists are not separated or pedestrians crossing uncontrolled)",description:"85th percentile > 37mph (60kph)"},{value:"Total volume of traffic (where cyclists are not separated or pedestrians cross uncontrolled)",description:">10000 vpd. >5% of traffic is HGVs."},{value:"Required crossing speed (risk of pedestrians coming into conflict with traffic)",description:"Pedestrians must cross at a speed of over 1.2m/s to get across the crossing in time."},{value:"Clear walking spaces free of obstructions and furniture, reducing risk of pedestrians walking in the carriageway.",description:"<1.5m clear footway width. Or, 1.5m-2m clear footway width and pedestrian comfort is poor (PCL of D-E)."},{value:"Effective width next to tram line on a straight run",description:"<2.4m from tramline edge to kerb."},{value:"Crossing angle (between cyclist desire line and tram tracks)",description:"Crossing angle less than 60 degrees."},{value:"Defects: non cycle friendly ironworks, raised/ sunken covers/gullies",description:"Major defects"},{value:"Defects: non flush tables, misleading tactile information, cracked paving, slip-risks present from covers, steep slopes",description:"Major defects"}]},{name:"comment",type:"textbox"},{name:"photographed",type:"checkbox"}],cu={name:uu,members:fu};function pu(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].criticals!==void 0&&(o.value=r[0].criticals),e=new bt({props:o}),le.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].criticals,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function du(r,e,t){let{props:n}=e;n.criticals||(n.criticals={});let i=cu;function o(s){r.$$.not_equal(n.criticals,s)&&(n.criticals=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class hu extends Z{constructor(e){super(),Q(this,e,du,pu,ee,{props:0})}}function gu(r,e,t){let n;z(r,Ue,l=>t(3,n=l));let{source:i}=e,{gj:o}=e,{style:s}=e,a=`${i}-layer`;return lt(n,i,o),Co(n,{id:a,source:i,...s}),mn(()=>{n.getLayer(a)&&n.removeLayer(a),n.getSource(i)&&n.removeSource(i)}),r.$$set=l=>{"source"in l&&t(0,i=l.source),"gj"in l&&t(1,o=l.gj),"style"in l&&t(2,s=l.style)},[i,o,s]}class wn extends Z{constructor(e){super(),Q(this,e,gu,null,ee,{source:0,gj:1,style:2})}}function _u(r){let e,t;return e=new wn({props:{source:"intersection-markings",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function mu(r,e,t){let{gj:n}=e,i={type:"fill",paint:{"fill-color":yn("type",{"sidewalk corner":"#CCCCCC"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class bu extends Z{constructor(e){super(),Q(this,e,mu,_u,ee,{gj:0})}}function yu(r){let e,t;return e=new wn({props:{source:"intersection-polygons",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function vu(r,e,t){let{gj:n}=e,i={type:"fill",filter:["==",["get","type"],"intersection"],paint:{"fill-color":yn("intersection_kind",{MapEdge:"#696",Terminus:"black",Connection:"black",Fork:"black",Intersection:"black"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class wu extends Z{constructor(e){super(),Q(this,e,vu,yu,ee,{gj:0})}}function ku(r){let e,t;return e=new wn({props:{source:"lane-markings",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Su(r,e,t){let{gj:n}=e,i={type:"fill",paint:{"fill-color":yn("type",{"center line":"white","lane separator":"white","lane arrow":"white","buffer edge":"white","buffer stripe":"white","vehicle stop line":"white","bike stop line":"green"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class Eu extends Z{constructor(e){super(),Q(this,e,Su,ku,ee,{gj:0})}}function Mu(r){let e,t;return e=new wn({props:{source:"lane-polygons",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function $u(r,e,t){let{gj:n}=e,i={type:"fill",paint:{"fill-color":yn("type",{Driving:"black",Parking:"#333333",Sidewalk:"#CCCCCC",Shoulder:"#CCCCCC",Biking:"#0F7D4B",Bus:"#BE4A4C",SharedLeftTurn:"black",Construction:"#FF6D00",LightRail:"#844204",Footway:"#DDDDE8",SharedUse:"#E5E1BB","Buffer(Planters)":"#555555"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class Cu extends Z{constructor(e){super(),Q(this,e,$u,Mu,ee,{gj:0})}}function si(r){let e,t,n,i,o,s,a,l;return e=new Cu({props:{gj:r[0]}}),n=new Eu({props:{gj:r[1]}}),o=new wu({props:{gj:r[2]}}),a=new bu({props:{gj:r[3]}}),{c(){F(e.$$.fragment),t=A(),F(n.$$.fragment),i=A(),F(o.$$.fragment),s=A(),F(a.$$.fragment)},m(u,f){P(e,u,f),w(u,t,f),P(n,u,f),w(u,i,f),P(o,u,f),w(u,s,f),P(a,u,f),l=!0},p(u,f){const c={};f&1&&(c.gj=u[0]),e.$set(c);const d={};f&2&&(d.gj=u[1]),n.$set(d);const h={};f&4&&(h.gj=u[2]),o.$set(h);const v={};f&8&&(v.gj=u[3]),a.$set(v)},i(u){l||(E(e.$$.fragment,u),E(n.$$.fragment,u),E(o.$$.fragment,u),E(a.$$.fragment,u),l=!0)},o(u){C(e.$$.fragment,u),C(n.$$.fragment,u),C(o.$$.fragment,u),C(a.$$.fragment,u),l=!1},d(u){u&&(k(t),k(i),k(s)),B(e,u),B(n,u),B(o,u),B(a,u)}}}function Lu(r){let e,t,n,i=r[0]&&si(r);return t=new Gi({props:{contents:"This visualizes lane data according to OpenStreetMap. There may be many errors with incorrect or missing lane data, lane width and intersection geometry, and markings. Use with caution."}}),{c(){i&&i.c(),e=A(),F(t.$$.fragment)},m(o,s){i&&i.m(o,s),w(o,e,s),P(t,o,s),n=!0},p(o,[s]){o[0]?i?(i.p(o,s),s&1&&E(i,1)):(i=si(o),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(de(),C(i,1,1,()=>{i=null}),he())},i(o){n||(E(i),E(t.$$.fragment,o),n=!0)},o(o){C(i),C(t.$$.fragment,o),n=!1},d(o){o&&k(e),i&&i.d(o),B(t,o)}}}function Tu(r,e,t){let n,i;z(r,mt,f=>t(5,n=f)),z(r,ce,f=>t(6,i=f));let{id:o}=e,s,a,l,u;return Nt(async()=>{try{let f=i.features.find(d=>d.id==o),c=await n.renderLaneDetailsForRoute(f.properties.waypoints);t(0,s=JSON.parse(c[0])),t(1,a=JSON.parse(c[1])),t(2,l=JSON.parse(c[2])),t(3,u=JSON.parse(c[3]))}catch(f){window.alert(`Couldn't render lane details: ${f}`)}}),r.$$set=f=>{"id"in f&&t(4,o=f.id)},[s,a,l,u,o]}class Au extends Z{constructor(e){super(),Q(this,e,Tu,Lu,ee,{id:4})}}function xu(r){let e;return{c(){e=$("p"),e.textContent="Route info loading..."},m(t,n){w(t,e,n)},p:U,i:U,o:U,d(t){t&&k(e)}}}function Ou(r){let e,t,n,i,o,s,a,l,u,f,c,d,h;const v=[Iu,Ru],_=[];function b(g,p){return g[1]=="speed limits"?0:g[1]=="lane details"?1:-1}return~(l=b(r))&&(u=_[l]=v[l](r)),{c(){e=$("label"),t=ie(`Show details: - `),n=$("select"),i=$("option"),i.textContent="None",o=$("option"),o.textContent="Speed limits",s=$("option"),s.textContent="Lane details",a=A(),u&&u.c(),f=_e(),i.__value="none",fe(i,i.__value),o.__value="speed limits",fe(o,o.__value),s.__value="lane details",fe(s,s.__value),r[1]===void 0&&bn(()=>r[3].call(n))},m(g,p){w(g,e,p),M(e,t),M(e,n),M(n,i),M(n,o),M(n,s),rn(n,r[1],!0),w(g,a,p),~l&&_[l].m(g,p),w(g,f,p),c=!0,d||(h=G(n,"change",r[3]),d=!0)},p(g,p){p&2&&rn(n,g[1]);let m=l;l=b(g),l===m?~l&&_[l].p(g,p):(u&&(de(),C(_[m],1,1,()=>{_[m]=null}),he()),~l?(u=_[l],u?u.p(g,p):(u=_[l]=v[l](g),u.c()),E(u,1),u.m(f.parentNode,f)):u=null)},i(g){c||(E(u),c=!0)},o(g){C(u),c=!1},d(g){g&&(k(e),k(a),k(f)),~l&&_[l].d(g),d=!1,h()}}}function Ru(r){let e,t;return e=new Au({props:{id:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.id=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Iu(r){let e,t;return e=new Yi({props:{id:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.id=n[0]),e.$set(o)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){B(e,n)}}}function Fu(r){let e,t,n,i;const o=[Ou,xu],s=[];function a(l,u){return l[2]?0:1}return e=a(r),t=s[e]=o[e](r),{c(){t.c(),n=_e()},m(l,u){s[e].m(l,u),w(l,n,u),i=!0},p(l,[u]){let f=e;e=a(l),e===f?s[e].p(l,u):(de(),C(s[f],1,1,()=>{s[f]=null}),he(),t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),E(t,1),t.m(n.parentNode,n))},i(l){i||(E(t),i=!0)},o(l){C(t),i=!1},d(l){l&&k(n),s[e].d(l)}}}function Pu(r,e,t){let n;z(r,mt,a=>t(2,n=a));let{id:i}=e,o="none";function s(){o=hi(this),t(1,o)}return r.$$set=a=>{"id"in a&&t(0,i=a.id)},[i,o,n,s]}class Bu extends Z{constructor(e){super(),Q(this,e,Pu,Fu,ee,{id:0})}}function li(r){let e,t,n,i,o;return{c(){e=$("button"),t=ie("Auto-fill"),R(e,"type","button"),e.disabled=n=!r[5]},m(s,a){w(s,e,a),M(e,t),i||(o=G(e,"click",r[7]),i=!0)},p(s,a){a&32&&n!==(n=!s[5])&&(e.disabled=n)},d(s){s&&k(e),i=!1,o()}}}function ai(r){let e,t=ui(r[4])+"",n,i,o,s,a,l;return a=new Bu({props:{id:r[3]}}),{c(){e=ie("Length: "),n=ie(t),i=A(),o=$("br"),s=A(),F(a.$$.fragment)},m(u,f){w(u,e,f),w(u,n,f),w(u,i,f),w(u,o,f),w(u,s,f),P(a,u,f),l=!0},p(u,f){(!l||f&16)&&t!==(t=ui(u[4])+"")&&Oe(n,t);const c={};f&8&&(c.id=u[3]),a.$set(c)},i(u){l||(E(a.$$.fragment,u),l=!0)},o(u){C(a.$$.fragment,u),l=!1},d(u){u&&(k(e),k(n),k(i),k(o),k(s)),B(a,u)}}}function Nu(r){let e,t,n,i,o,s,a,l,u,f,c,d,h,v,_,b,g,p,m,y,S,L,O,x,I,N,j,D,T,H,ae,ke,Ee,ue,ne,K,Le,me,ge,be,yt,Ht,se=r[4]&&li(r),re=r[4]&&ai(r);return be=jt(r[10][0]),{c(){e=$("label"),t=ie(`Name: - - `),se&&se.c(),n=A(),i=$("br"),o=A(),s=$("input"),a=A(),l=$("br"),u=A(),f=$("br"),c=A(),d=$("label"),h=$("input"),v=ie(` - Area`),_=A(),b=$("label"),g=$("input"),p=ie(` - Route`),m=A(),y=$("label"),S=$("input"),L=ie(` - Crossing`),O=A(),x=$("label"),I=$("input"),N=ie(` - Other`),j=A(),D=$("br"),T=A(),H=$("br"),ae=A(),ke=$("label"),Ee=ie("Description:"),ue=$("br"),ne=A(),K=$("textarea"),Le=A(),re&&re.c(),me=_e(),R(s,"type","text"),Te(s,"width","100%"),R(h,"type","radio"),h.__value="area",fe(h,h.__value),R(g,"type","radio"),g.__value="route",fe(g,g.__value),R(S,"type","radio"),S.__value="crossing",fe(S,S.__value),R(I,"type","radio"),I.__value="other",fe(I,I.__value),Te(K,"width","100%"),R(K,"rows","5"),R(K,"class","svelte-15lna0i"),be.p(h,g,S,I)},m(X,oe){w(X,e,oe),M(e,t),se&&se.m(e,null),M(e,n),M(e,i),M(e,o),M(e,s),fe(s,r[0]),w(X,a,oe),w(X,l,oe),w(X,u,oe),w(X,f,oe),w(X,c,oe),w(X,d,oe),M(d,h),h.checked=h.__value===r[1],M(d,v),w(X,_,oe),w(X,b,oe),M(b,g),g.checked=g.__value===r[1],M(b,p),w(X,m,oe),w(X,y,oe),M(y,S),S.checked=S.__value===r[1],M(y,L),w(X,O,oe),w(X,x,oe),M(x,I),I.checked=I.__value===r[1],M(x,N),w(X,j,oe),w(X,D,oe),w(X,T,oe),w(X,H,oe),w(X,ae,oe),w(X,ke,oe),M(ke,Ee),M(ke,ue),M(ke,ne),M(ke,K),fe(K,r[2]),w(X,Le,oe),re&&re.m(X,oe),w(X,me,oe),ge=!0,yt||(Ht=[G(s,"input",r[8]),G(h,"change",r[9]),G(g,"change",r[11]),G(S,"change",r[12]),G(I,"change",r[13]),G(K,"input",r[14])],yt=!0)},p(X,[oe]){X[4]?se?se.p(X,oe):(se=li(X),se.c(),se.m(e,n)):se&&(se.d(1),se=null),oe&1&&s.value!==X[0]&&fe(s,X[0]),oe&2&&(h.checked=h.__value===X[1]),oe&2&&(g.checked=g.__value===X[1]),oe&2&&(S.checked=S.__value===X[1]),oe&2&&(I.checked=I.__value===X[1]),oe&4&&fe(K,X[2]),X[4]?re?(re.p(X,oe),oe&16&&E(re,1)):(re=ai(X),re.c(),E(re,1),re.m(me.parentNode,me)):re&&(de(),C(re,1,1,()=>{re=null}),he())},i(X){ge||(E(re),ge=!0)},o(X){C(re),ge=!1},d(X){X&&(k(e),k(a),k(l),k(u),k(f),k(c),k(d),k(_),k(b),k(m),k(y),k(O),k(x),k(j),k(D),k(T),k(H),k(ae),k(ke),k(Le),k(me)),se&&se.d(),re&&re.d(X),be.r(),yt=!1,Ie(Ht)}}}function ui(r){return r<1e3?Math.round(r)+" m":(r/1e3).toFixed(1)+"km"}function ju(r,e,t){let n,i;z(r,mt,m=>t(5,n=m)),z(r,ce,m=>t(15,i=m));let{id:o}=e,{name:s}=e,{intervention_type:a}=e,{description:l}=e,{length_meters:u}=e;async function f(){let m=i.features.find(y=>y.id==o);try{t(0,s=await n.nameForRoute(m))}catch(y){window.alert(`Couldn't auto-name route: ${y}`)}}const c=[[]],d=()=>f();function h(){s=this.value,t(0,s)}function v(){a=this.__value,t(1,a)}function _(){a=this.__value,t(1,a)}function b(){a=this.__value,t(1,a)}function g(){a=this.__value,t(1,a)}function p(){l=this.value,t(2,l)}return r.$$set=m=>{"id"in m&&t(3,o=m.id),"name"in m&&t(0,s=m.name),"intervention_type"in m&&t(1,a=m.intervention_type),"description"in m&&t(2,l=m.description),"length_meters"in m&&t(4,u=m.length_meters)},[s,a,l,o,u,n,f,d,h,v,c,_,b,g,p]}class Du extends Z{constructor(e){super(),Q(this,e,ju,Nu,ee,{id:3,name:0,intervention_type:1,description:2,length_meters:4})}}const Hu="Intervention",Uu=[{name:"Route",members:[{name:"name",type:"one-liner"},{name:"description",type:"textbox"},{name:"RouteType",oneOf:[{name:"OnRoad",description:"Directly on or parallel to the carriageway",members:[{name:"OnRoadType",oneOf:["FullSeparation",{value:"Stepped",description:"Raised above the road, but below the footway. Only appropriate on roads with speeds under 30 mph."},"PartSeparation","MandatoryLane","AdvisoryLane",{name:"NoSeparation",description:"If there's no physical separation between the road, why not? Justify why separation is unnecessary.",oneOf:["TrafficCalming","ModalFilters","LowSpeed"]}]},{name:"SourceOfSpace",oneOf:["ReallocateEntireLane","RoadDiet","PavementDiet","ReallocateVerge"]}]},{name:"OffRoad",oneOf:["ThroughPark","CanalTowpath"]}]},{name:"Users",oneOf:["Footpath","Cyclepath","SharedUseNoSeparation",{name:"SharedUseWithSeparation",members:[{name:"width_footpath",type:"number"},{name:"width_cyclepath",type:"number"}]}]}]},{name:"Crossing",members:[{name:"name",type:"one-liner"},{name:"description",type:"textbox"},{name:"CrossingType",oneOf:["Zebra",{name:"Signalised",members:[{name:"SignalisedCrossingType",oneOf:["Puffin","Toucan","Pegasus"]},{name:"CrossingActivation",oneOf:["PressButton","InductionLoop","FixedTimer"]},{name:"MaxTimeWaitingForGreen",description:"After activating the signal, what is the maximum time somebody will wait before getting a green light? (seconds)",type:"number"},{name:"GreenDuration",type:"number"}]},"SchoolCrossing","Refuge",{name:"GradeSeparated",members:[{name:"GradeSeparatedType",oneOf:["Bridge","Tunnel"]},{name:"AccessRamp",type:"checkbox"},{name:"Steps",type:"checkbox"}]}]},{name:"MatchesDesireLine",type:"checkbox"},{name:"MotorTrafficFlow",oneOf:["> 8000","3000 - 8000","< 3000"]},{name:"MotorTrafficSpeed",oneOf:["> 30 mph","20 - 30 mph","< 20 mph"]}]}],qu={name:Hu,oneOf:Uu};function Gu(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].v2!==void 0&&(o.value=r[0].v2),e=new bt({props:o}),le.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].v2,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function Yu(r,e,t){let{props:n}=e;n.v2||(n.v2={});let i=qu;function o(s){r.$$.not_equal(n.v2,s)&&(n.v2=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class Ju extends Z{constructor(e){super(),Q(this,e,Yu,Gu,ee,{props:0})}}const zu="Planning",Xu=[{name:"name",type:"one-liner"},{name:"notes",type:"textbox"},{name:"reference_type",oneOf:["preapp","outline","reserved matters","local plan"]},{name:"size",type:"number"},{name:"size_units",oneOf:["number of units","floorspace","area"]},{name:"triage",oneOf:["No Comment","Standing Advice","Toolkit Assessment"]},{name:"recommendation",oneOf:["No Comment","No Objection","Standing Advice","Deferral","Approve subject to conditions and/or obligations","Refusal"]}],Wu={name:zu,members:Xu};function Vu(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].planning!==void 0&&(o.value=r[0].planning),e=new bt({props:o}),le.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].planning,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function Ku(r,e,t){let{props:n}=e;n.planning||(n.planning={});let i=Wu;function o(s){r.$$.not_equal(n.planning,s)&&(n.planning=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class Zu extends Z{constructor(e){super(),Q(this,e,Ku,Vu,ee,{props:0})}}function fi(r){let e,t,n,i,o;const s=r[10].default,a=Lo(s,r,r[9],null);return{c(){e=$("div"),a&&a.c(),Te(e,"border","solid 1px black"),Te(e,"padding","10px")},m(l,u){w(l,e,u),a&&a.m(e,null),r[13](e),n=!0,i||(o=G(e,"introend",r[14]),i=!0)},p(l,u){a&&a.p&&(!n||u&512)&&To(a,s,l,l[9],n?xo(s,l[9],u,null):Ao(l[9]),null)},i(l){n||(E(a,l),l&&bn(()=>{n&&(t||(t=on(e,gn,{duration:100},!0)),t.run(1))}),n=!0)},o(l){C(a,l),l&&(t||(t=on(e,gn,{duration:100},!1)),t.run(0)),n=!1},d(l){l&&k(e),a&&a.d(l),r[13](null),l&&t&&t.end(),i=!1,o()}}}function Qu(r){let e,t,n,i,o,s,a,l,u,f,c=r[4]&&fi(r);return{c(){e=$("button"),t=cr("svg"),n=cr("path"),i=A(),o=ie(r[1]),s=A(),c&&c.c(),a=_e(),R(n,"d","M9 5l7 7-7 7"),R(t,"style","tran"),R(t,"width","20"),R(t,"height","20"),R(t,"fill","none"),R(t,"stroke-linecap","round"),R(t,"stroke-linejoin","round"),R(t,"stroke-width","2"),R(t,"viewBox","0 0 24 24"),R(t,"stroke","currentColor"),R(t,"class","svelte-t7fpgu"),R(e,"aria-expanded",r[4]),R(e,"class","svelte-t7fpgu"),pr(e,"underlined",r[3])},m(d,h){w(d,e,h),M(e,t),M(t,n),M(e,i),M(e,o),w(d,s,h),c&&c.m(d,h),w(d,a,h),l=!0,u||(f=[G(e,"click",r[5]),G(e,"mouseenter",r[11]),G(e,"mouseleave",r[12])],u=!0)},p(d,[h]){(!l||h&2)&&Oe(o,d[1]),(!l||h&16)&&R(e,"aria-expanded",d[4]),(!l||h&8)&&pr(e,"underlined",d[3]),d[4]?c?(c.p(d,h),h&16&&E(c,1)):(c=fi(d),c.c(),E(c,1),c.m(a.parentNode,a)):c&&(de(),C(c,1,1,()=>{c=null}),he())},i(d){l||(E(c),l=!0)},o(d){C(c),l=!1},d(d){d&&(k(e),k(s),k(a)),c&&c.d(d),u=!1,Ie(f)}}}function ef(r,e,t){let n,i,o,s;z(r,Ye,p=>t(7,o=p)),z(r,Re,p=>t(8,s=p));let{$$slots:a={},$$scope:l}=e,{id:u}=e,{label:f}=e;const c=()=>{Re.update(p=>p==u?null:u),s==u&&(ln.set(null),ln.set(u))};let d;function h(){d==null||d.scrollIntoView({behavior:"smooth"})}const v=()=>sn.set(u),_=()=>sn.set(null);function b(p){le[p?"unshift":"push"](()=>{d=p,t(2,d)})}const g=()=>h();return r.$$set=p=>{"id"in p&&t(0,u=p.id),"label"in p&&t(1,f=p.label),"$$scope"in p&&t(9,l=p.$$scope)},r.$$.update=()=>{r.$$.dirty&257&&t(4,n=s==u),r.$$.dirty&129&&t(3,i=o==u)},[u,f,d,i,n,c,h,o,s,l,a,v,_,b,g]}class tf extends Z{constructor(e){super(),Q(this,e,ef,Qu,ee,{id:0,label:1})}}function ci(r,e,t){const n=r.slice();return n[14]=e[t],n[15]=e,n[16]=t,n}function nf(r){let e,t,n;function i(s){r[10](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new au({props:o}),le.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function rf(r){let e,t,n;function i(s){r[9](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new hu({props:o}),le.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function of(r){let e,t,n;function i(s){r[8](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new Zu({props:o}),le.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function sf(r){let e,t,n;function i(s){r[7](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new Ju({props:o}),le.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function lf(r){let e,t,n,i,o;function s(f){r[4](f,r[14])}function a(f){r[5](f,r[14])}function l(f){r[6](f,r[14])}let u={id:r[14].id,length_meters:r[14].properties.length_meters};return r[14].properties.name!==void 0&&(u.name=r[14].properties.name),r[14].properties.intervention_type!==void 0&&(u.intervention_type=r[14].properties.intervention_type),r[14].properties.description!==void 0&&(u.description=r[14].properties.description),e=new Du({props:u}),le.push(()=>ve(e,"name",s)),le.push(()=>ve(e,"intervention_type",a)),le.push(()=>ve(e,"description",l)),{c(){F(e.$$.fragment)},m(f,c){P(e,f,c),o=!0},p(f,c){r=f;const d={};c&2&&(d.id=r[14].id),c&2&&(d.length_meters=r[14].properties.length_meters),!t&&c&2&&(t=!0,d.name=r[14].properties.name,we(()=>t=!1)),!n&&c&2&&(n=!0,d.intervention_type=r[14].properties.intervention_type,we(()=>n=!1)),!i&&c&2&&(i=!0,d.description=r[14].properties.description,we(()=>i=!1)),e.$set(d)},i(f){o||(E(e.$$.fragment,f),o=!0)},o(f){C(e.$$.fragment,f),o=!1},d(f){B(e,f)}}}function af(r){let e,t,n,i,o,s,a,l,u,f,c,d,h,v,_;const b=[lf,sf,of,rf,nf],g=[];function p(y,S){return y[0]=="v1"?0:y[0]=="v2"?1:y[0]=="planning"?2:y[0]=="criticals"?3:y[0]=="atf4"?4:-1}~(e=p(r))&&(t=g[e]=b[e](r));function m(){return r[11](r[14])}return{c(){t&&t.c(),n=A(),i=$("br"),o=A(),s=$("br"),a=A(),l=$("div"),u=$("button"),u.textContent="Delete",f=A(),c=$("button"),c.textContent="Save",d=A(),R(u,"type","button"),R(c,"type","button"),Te(l,"display","flex"),Te(l,"justify-content","space-between")},m(y,S){~e&&g[e].m(y,S),w(y,n,S),w(y,i,S),w(y,o,S),w(y,s,S),w(y,a,S),w(y,l,S),M(l,u),M(l,f),M(l,c),w(y,d,S),h=!0,v||(_=[G(u,"click",m),G(c,"click",r[12])],v=!0)},p(y,S){r=y;let L=e;e=p(r),e===L?~e&&g[e].p(r,S):(t&&(de(),C(g[L],1,1,()=>{g[L]=null}),he()),~e?(t=g[e],t?t.p(r,S):(t=g[e]=b[e](r),t.c()),E(t,1),t.m(n.parentNode,n)):t=null)},i(y){h||(E(t),h=!0)},o(y){C(t),h=!1},d(y){y&&(k(n),k(i),k(o),k(s),k(a),k(l),k(d)),~e&&g[e].d(y),v=!1,Ie(_)}}}function pi(r,e){let t,n,i;return n=new tf({props:{id:e[14].id,label:e[16]+1+") "+e[2](e[14]),$$slots:{default:[af]},$$scope:{ctx:e}}}),{key:r,first:null,c(){t=_e(),F(n.$$.fragment),this.first=t},m(o,s){w(o,t,s),P(n,o,s),i=!0},p(o,s){e=o;const a={};s&2&&(a.id=e[14].id),s&2&&(a.label=e[16]+1+") "+e[2](e[14])),s&131075&&(a.$$scope={dirty:s,ctx:e}),n.$set(a)},i(o){i||(E(n.$$.fragment,o),i=!0)},o(o){C(n.$$.fragment,o),i=!1},d(o){o&&k(t),B(n,o)}}}function uf(r){let e=[],t=new Map,n,i,o,s,a=De(r[1].features);const l=u=>u[14].id;for(let u=0;ut(13,n=g)),z(r,ce,g=>t(1,i=g));let{schema:o}=e;function s(g){var m,y,S,L,O,x,I;if(o=="planning")return((m=g.properties.planning)==null?void 0:m.name)||"Untitled polygon";if(o=="v2")return((S=(y=g.properties.v2)==null?void 0:y.Route)==null?void 0:S.name)||((O=(L=g.properties.v2)==null?void 0:L.Crossing)==null?void 0:O.name)||"Untitled intervention";if(o=="criticals")return((x=g.properties.criticals)==null?void 0:x.name)||"Untitled issue";if(o=="atf4")return((I=g.properties.atf4)==null?void 0:I.name)||"Untitled intervention";if(g.properties.name)return g.properties.name;var p=g.properties.intervention_type;return p=="other"&&(g.geometry.type=="Point"?p="point":g.geometry.type=="LineString"?p="line":p="polygon"),`Untitled ${p}`}function a(g){if(g.key=="Delete"){const p=g.target.tagName;if(p=="INPUT"||p=="TEXTAREA")return;g.preventDefault();const m=n;m&&dr(m)}}function l(g,p){r.$$.not_equal(p.properties.name,g)&&(p.properties.name=g,ce.set(i))}function u(g,p){r.$$.not_equal(p.properties.intervention_type,g)&&(p.properties.intervention_type=g,ce.set(i))}function f(g,p){r.$$.not_equal(p.properties.description,g)&&(p.properties.description=g,ce.set(i))}function c(g,p){r.$$.not_equal(p.properties,g)&&(p.properties=g,ce.set(i))}function d(g,p){r.$$.not_equal(p.properties,g)&&(p.properties=g,ce.set(i))}function h(g,p){r.$$.not_equal(p.properties,g)&&(p.properties=g,ce.set(i))}function v(g,p){r.$$.not_equal(p.properties,g)&&(p.properties=g,ce.set(i))}const _=g=>dr(g.id),b=()=>Re.set(null);return r.$$set=g=>{"schema"in g&&t(0,o=g.schema)},[o,i,s,a,l,u,f,c,d,h,v,_,b]}class cf extends Z{constructor(e){super(),Q(this,e,ff,uf,ee,{schema:0})}}let te;const Ge=new Array(128).fill(void 0);Ge.push(void 0,null,!0,!1);function J(r){return Ge[r]}let Rt=Ge.length;function pf(r){r<132||(Ge[r]=Rt,Rt=r)}function dt(r){const e=J(r);return pf(r),e}let st=0,Et=null;function It(){return(Et===null||Et.byteLength===0)&&(Et=new Uint8Array(te.memory.buffer)),Et}const en=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},df=typeof en.encodeInto=="function"?function(r,e){return en.encodeInto(r,e)}:function(r,e){const t=en.encode(r);return e.set(t),{read:r.length,written:t.length}};function An(r,e,t){if(t===void 0){const a=en.encode(r),l=e(a.length)>>>0;return It().subarray(l,l+a.length).set(a),st=a.length,l}let n=r.length,i=e(n)>>>0;const o=It();let s=0;for(;s127)break;o[i+s]=a}if(s!==n){s!==0&&(r=r.slice(s)),i=t(i,n,n=s+r.length*3)>>>0;const a=It().subarray(i+s,i+n),l=df(r,a);s+=l.written}return st=s,i}function St(r){return r==null}let Mt=null;function pe(){return(Mt===null||Mt.byteLength===0)&&(Mt=new Int32Array(te.memory.buffer)),Mt}const Qi=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Qi.decode();function Ze(r,e){return r=r>>>0,Qi.decode(It().subarray(r,r+e))}function ye(r){Rt===Ge.length&&Ge.push(Ge.length+1);const e=Rt;return Rt=Ge[e],Ge[e]=r,e}let $t=null;function hf(){return($t===null||$t.byteLength===0)&&($t=new Float64Array(te.memory.buffer)),$t}let Ct=null;function gf(){return(Ct===null||Ct.byteLength===0)&&(Ct=new BigInt64Array(te.memory.buffer)),Ct}function Vn(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){const i=r.length;let o="[";i>0&&(o+=Vn(r[0]));for(let s=1;s1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} -${r.stack}`:n}function _f(r,e){const t=e(r.length*1)>>>0;return It().set(r,t/1),st=r.length,t}function xn(r,e){try{return r.apply(this,e)}catch(t){te.__wbindgen_exn_store(ye(t))}}let mf=class Kn{static __wrap(e){e=e>>>0;const t=Object.create(Kn.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();te.__wbg_routeinfo_free(e)}constructor(e){try{const o=te.__wbindgen_add_to_stack_pointer(-16),s=_f(e,te.__wbindgen_malloc),a=st;te.routeinfo_new(o,s,a);var t=pe()[o/4+0],n=pe()[o/4+1],i=pe()[o/4+2];if(i)throw dt(n);return Kn.__wrap(t)}finally{te.__wbindgen_add_to_stack_pointer(16)}}nameForRoute(e){let t,n;try{const f=te.__wbindgen_add_to_stack_pointer(-16);te.routeinfo_nameForRoute(f,this.__wbg_ptr,ye(e));var i=pe()[f/4+0],o=pe()[f/4+1],s=pe()[f/4+2],a=pe()[f/4+3],l=i,u=o;if(a)throw l=0,u=0,dt(s);return t=l,n=u,Ze(l,u)}finally{te.__wbindgen_add_to_stack_pointer(16),te.__wbindgen_free(t,n)}}speedLimitForRoute(e){let t,n;try{const f=te.__wbindgen_add_to_stack_pointer(-16);te.routeinfo_speedLimitForRoute(f,this.__wbg_ptr,ye(e));var i=pe()[f/4+0],o=pe()[f/4+1],s=pe()[f/4+2],a=pe()[f/4+3],l=i,u=o;if(a)throw l=0,u=0,dt(s);return t=l,n=u,Ze(l,u)}finally{te.__wbindgen_add_to_stack_pointer(16),te.__wbindgen_free(t,n)}}allSpeedLimits(){let e,t;try{const u=te.__wbindgen_add_to_stack_pointer(-16);te.routeinfo_allSpeedLimits(u,this.__wbg_ptr);var n=pe()[u/4+0],i=pe()[u/4+1],o=pe()[u/4+2],s=pe()[u/4+3],a=n,l=i;if(s)throw a=0,l=0,dt(o);return e=a,t=l,Ze(a,l)}finally{te.__wbindgen_add_to_stack_pointer(16),te.__wbindgen_free(e,t)}}renderLaneDetailsForRoute(e){let t,n;try{const f=te.__wbindgen_add_to_stack_pointer(-16);te.routeinfo_renderLaneDetailsForRoute(f,this.__wbg_ptr,ye(e));var i=pe()[f/4+0],o=pe()[f/4+1],s=pe()[f/4+2],a=pe()[f/4+3],l=i,u=o;if(a)throw l=0,u=0,dt(s);return t=l,n=u,Ze(l,u)}finally{te.__wbindgen_add_to_stack_pointer(16),te.__wbindgen_free(t,n)}}};async function bf(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.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",n);else throw n}const t=await r.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}}function yf(){const r={};return r.wbg={},r.wbg.__wbindgen_object_drop_ref=function(e){dt(e)},r.wbg.__wbindgen_boolean_get=function(e){const t=J(e);return typeof t=="boolean"?t?1:0:2},r.wbg.__wbindgen_string_get=function(e,t){const n=J(t),i=typeof n=="string"?n:void 0;var o=St(i)?0:An(i,te.__wbindgen_malloc,te.__wbindgen_realloc),s=st;pe()[e/4+1]=s,pe()[e/4+0]=o},r.wbg.__wbindgen_error_new=function(e,t){const n=new Error(Ze(e,t));return ye(n)},r.wbg.__wbindgen_is_bigint=function(e){return typeof J(e)=="bigint"},r.wbg.__wbindgen_bigint_from_i64=function(e){return ye(e)},r.wbg.__wbindgen_jsval_eq=function(e,t){return J(e)===J(t)},r.wbg.__wbindgen_number_get=function(e,t){const n=J(t),i=typeof n=="number"?n:void 0;hf()[e/8+1]=St(i)?0:i,pe()[e/4+0]=!St(i)},r.wbg.__wbindgen_is_object=function(e){const t=J(e);return typeof t=="object"&&t!==null},r.wbg.__wbindgen_in=function(e,t){return J(e)in J(t)},r.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return ye(t)},r.wbg.__wbindgen_is_undefined=function(e){return J(e)===void 0},r.wbg.__wbindgen_string_new=function(e,t){const n=Ze(e,t);return ye(n)},r.wbg.__wbindgen_jsval_loose_eq=function(e,t){return J(e)==J(t)},r.wbg.__wbindgen_object_clone_ref=function(e){const t=J(e);return ye(t)},r.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(e,t){const n=J(e)[J(t)];return ye(n)},r.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return ye(e)},r.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const n=J(t).stack,i=An(n,te.__wbindgen_malloc,te.__wbindgen_realloc),o=st;pe()[e/4+1]=o,pe()[e/4+0]=i},r.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let n,i;try{n=e,i=t,console.error(Ze(e,t))}finally{te.__wbindgen_free(n,i)}},r.wbg.__wbg_debug_917e579618ee56f5=function(e){console.debug(J(e))},r.wbg.__wbg_error_ea7597dedb63d9a4=function(e){console.error(J(e))},r.wbg.__wbg_info_fc2a17f38101c41c=function(e){console.info(J(e))},r.wbg.__wbg_log_003c998d6df63565=function(e){console.log(J(e))},r.wbg.__wbg_warn_ebfcadd0780df93a=function(e){console.warn(J(e))},r.wbg.__wbg_get_e52aaca45f37b337=function(e,t){const n=J(e)[t>>>0];return ye(n)},r.wbg.__wbg_length_070e3265c186df02=function(e){return J(e).length},r.wbg.__wbindgen_is_function=function(e){return typeof J(e)=="function"},r.wbg.__wbg_next_3975dcca26737a22=function(e){const t=J(e).next;return ye(t)},r.wbg.__wbg_next_5a9700550e162aa3=function(){return xn(function(e){const t=J(e).next();return ye(t)},arguments)},r.wbg.__wbg_done_a184612220756243=function(e){return J(e).done},r.wbg.__wbg_value_6cc144c1d9645dd5=function(e){const t=J(e).value;return ye(t)},r.wbg.__wbg_iterator_c1677479667ea090=function(){return ye(Symbol.iterator)},r.wbg.__wbg_get_363c3b466fe4896b=function(){return xn(function(e,t){const n=Reflect.get(J(e),J(t));return ye(n)},arguments)},r.wbg.__wbg_call_f96b398515635514=function(){return xn(function(e,t){const n=J(e).call(J(t));return ye(n)},arguments)},r.wbg.__wbg_isArray_07d89ced8fb14171=function(e){return Array.isArray(J(e))},r.wbg.__wbg_instanceof_ArrayBuffer_de688b806c28ff28=function(e){let t;try{t=J(e)instanceof ArrayBuffer}catch{t=!1}return t},r.wbg.__wbg_isSafeInteger_fcdf4c4f25c86778=function(e){return Number.isSafeInteger(J(e))},r.wbg.__wbg_entries_c3e06bf0354f5d20=function(e){const t=Object.entries(J(e));return ye(t)},r.wbg.__wbg_buffer_fcbfb6d88b2732e9=function(e){const t=J(e).buffer;return ye(t)},r.wbg.__wbg_new_bc5d9aad3f9ac80e=function(e){const t=new Uint8Array(J(e));return ye(t)},r.wbg.__wbg_set_4b3aa8445ac1e91c=function(e,t,n){J(e).set(J(t),n>>>0)},r.wbg.__wbg_length_d9c4ded7e708c6a1=function(e){return J(e).length},r.wbg.__wbg_instanceof_Uint8Array_4733577ba827276b=function(e){let t;try{t=J(e)instanceof Uint8Array}catch{t=!1}return t},r.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const n=J(t),i=typeof n=="bigint"?n:void 0;gf()[e/8+1]=St(i)?BigInt(0):i,pe()[e/4+0]=!St(i)},r.wbg.__wbindgen_debug_string=function(e,t){const n=Vn(J(t)),i=An(n,te.__wbindgen_malloc,te.__wbindgen_realloc),o=st;pe()[e/4+1]=o,pe()[e/4+0]=i},r.wbg.__wbindgen_throw=function(e,t){throw new Error(Ze(e,t))},r.wbg.__wbindgen_memory=function(){const e=te.memory;return ye(e)},r}function vf(r,e){return te=r.exports,eo.__wbindgen_wasm_module=e,Ct=null,$t=null,Mt=null,Et=null,te}async function eo(r){if(te!==void 0)return te;typeof r>"u"&&(r="/atip/browse_dropdown_filters/assets/route_info_bg.wasm");const e=yf();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:t,module:n}=await bf(await r,e);return vf(t,n)}class wf{constructor(){Y(this,"inner");this.inner=null}async loadFile(e){await eo(),console.log(`Grabbing A/B Street map model data from ${e}`);let n=await(await fetch(e)).arrayBuffer();this.inner=new mf(new Uint8Array(n)),console.log("RouteInfo is ready!")}nameForRoute(e){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.nameForRoute(e)}speedLimitForRoute(e){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.speedLimitForRoute(e)}allSpeedLimits(){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.allSpeedLimits()}renderLaneDetailsForRoute(e){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return JSON.parse(this.inner.renderLaneDetailsForRoute(e))}}ir(wf);function kf(){return new Worker("/atip/browse_dropdown_filters/assets/worker-9e257977.js")}function Sf(r){let e,t,n,i,o,s,a,l,u,f,c,d,h,v,_,b,g,p,m,y,S,L,O,x,I,N,j;return v=new No({props:{boundaryGeojson:r[2]}}),b=new Ba({props:{authorityName:r[3],schema:r[5]}}),y=new cf({props:{schema:r[5]}}),x=new Ta({}),{c(){e=$("div"),t=$("div"),n=$("button"),n.textContent="Home",i=A(),o=$("button"),o.textContent="About",s=A(),a=$("button"),a.textContent="Instructions",l=A(),u=$("p"),u.textContent=`${jo(r[5])} mode`,f=A(),c=$("h1"),d=ie(r[3]),h=A(),F(v.$$.fragment),_=A(),F(b.$$.fragment),g=A(),p=$("br"),m=A(),F(y.$$.fragment),S=A(),L=$("hr"),O=A(),F(x.$$.fragment),R(n,"type","button"),R(o,"type","button"),R(a,"type","button"),R(e,"slot","sidebar")},m(D,T){w(D,e,T),M(e,t),M(t,n),M(t,i),M(t,o),M(t,s),M(t,a),M(e,l),M(e,u),M(e,f),M(e,c),M(c,d),M(c,h),P(v,c,null),M(e,_),P(b,e,null),M(e,g),M(e,p),M(e,m),P(y,e,null),M(e,S),M(e,L),M(e,O),P(x,e,null),I=!0,N||(j=[G(n,"click",r[9]),G(o,"click",r[7]),G(a,"click",r[8])],N=!0)},p(D,T){const H={};T&4&&(H.boundaryGeojson=D[2]),v.$set(H)},i(D){I||(E(v.$$.fragment,D),E(b.$$.fragment,D),E(y.$$.fragment,D),E(x.$$.fragment,D),I=!0)},o(D){C(v.$$.fragment,D),C(b.$$.fragment,D),C(y.$$.fragment,D),C(x.$$.fragment,D),I=!1},d(D){D&&k(e),B(v),B(b),B(y),B(x),N=!1,Ie(j)}}}function Ef(r){let e,t,n,i,o,s,a,l,u,f,c,d;return e=new Ls({props:{boundaryGeojson:r[2]}}),n=new Ho({props:{schema:r[5]}}),o=new As({}),a=new ha({props:{routeSnapperUrl:r[6],schema:r[5]}}),u=new Uo({props:{style:r[4]}}),c=new qo({props:{schema:r[5]}}),{c(){F(e.$$.fragment),t=A(),F(n.$$.fragment),i=A(),F(o.$$.fragment),s=A(),F(a.$$.fragment),l=A(),F(u.$$.fragment),f=A(),F(c.$$.fragment)},m(h,v){P(e,h,v),w(h,t,v),P(n,h,v),w(h,i,v),P(o,h,v),w(h,s,v),P(a,h,v),w(h,l,v),P(u,h,v),w(h,f,v),P(c,h,v),d=!0},p(h,v){const _={};v&4&&(_.boundaryGeojson=h[2]),e.$set(_)},i(h){d||(E(e.$$.fragment,h),E(n.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),E(u.$$.fragment,h),E(c.$$.fragment,h),d=!0)},o(h){C(e.$$.fragment,h),C(n.$$.fragment,h),C(o.$$.fragment,h),C(a.$$.fragment,h),C(u.$$.fragment,h),C(c.$$.fragment,h),d=!1},d(h){h&&(k(t),k(i),k(s),k(l),k(f)),B(e,h),B(n,h),B(o,h),B(a,h),B(u,h),B(c,h)}}}function Mf(r){let e,t,n;return t=new Do({props:{style:r[4],$$slots:{default:[Ef]},$$scope:{ctx:r}}}),{c(){e=$("div"),F(t.$$.fragment),R(e,"slot","main")},m(i,o){w(i,e,o),P(t,e,null),n=!0},p(i,o){const s={};o&32772&&(s.$$scope={dirty:o,ctx:i}),t.$set(s)},i(i){n||(E(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){i&&k(e),B(t)}}}function $f(r){let e,t,n,i,o,s,a,l;e=new Bo({props:{$$slots:{main:[Mf],sidebar:[Sf]},$$scope:{ctx:r}}});function u(h){r[10](h)}let f={};r[0]!==void 0&&(f.open=r[0]),n=new Io({props:f}),le.push(()=>ve(n,"open",u));function c(h){r[11](h)}let d={};return r[1]!==void 0&&(d.open=r[1]),s=new Ha({props:d}),le.push(()=>ve(s,"open",c)),{c(){F(e.$$.fragment),t=A(),F(n.$$.fragment),o=A(),F(s.$$.fragment)},m(h,v){P(e,h,v),w(h,t,v),P(n,h,v),w(h,o,v),P(s,h,v),l=!0},p(h,[v]){const _={};v&32772&&(_.$$scope={dirty:v,ctx:h}),e.$set(_);const b={};!i&&v&1&&(i=!0,b.open=h[0],we(()=>i=!1)),n.$set(b);const g={};!a&&v&2&&(a=!0,g.open=h[1],we(()=>a=!1)),s.$set(g)},i(h){l||(E(e.$$.fragment,h),E(n.$$.fragment,h),E(s.$$.fragment,h),l=!0)},o(h){C(e.$$.fragment,h),C(n.$$.fragment,h),C(s.$$.fragment,h),l=!1},d(h){h&&(k(t),k(o)),B(e,h),B(n,h),B(s,h)}}}function Cf(r,e,t){let n=!1,i=!1;const o=new URLSearchParams(window.location.search);let s=o.get("authority"),a=o.get("style")||"streets",l=o.get("schema")||"v1",u=`https://atip.uk/route-snappers/v2.1/${s}.bin.gz`,f=`https://atip.uk/route-info/v2/${s}.bin.gz`;function c(){t(0,n=!n),t(1,i=!1)}function d(){t(1,i=!i),t(0,n=!1)}let h;Nt(async()=>{t(2,h=await v());const p=ki(new kf);let m=await new p;await m.loadFile(f),mt.set(m)});async function v(){const m=await(await fetch(Fo)).text(),y=JSON.parse(m);return y.features=y.features.filter(S=>{var L;return((L=S.properties)==null?void 0:L.name)==s}),y}const _=()=>window.location.href="index.html";function b(p){n=p,t(0,n)}function g(p){i=p,t(1,i)}return[n,i,h,s,a,l,u,c,d,_,b,g]}class Lf extends Z{constructor(e){super(),Q(this,e,Cf,$f,ee,{})}}new Lf({target:document.getElementById("app")}); diff --git a/browse_dropdown_filters/assets/nested2-91da248a.js b/browse_dropdown_filters/assets/nested2-91da248a.js deleted file mode 100644 index 31294116c..000000000 --- a/browse_dropdown_filters/assets/nested2-91da248a.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as we,i as ve,s as ke,F as ye,H as F,I as O,t as w,j,K as N,o as ee,e as E,$ as Se,r as q,at as Be,d as h,v as $,au as re,l as Ce,k as b,y as je,as as Le,A as Y,p as C,w as Z,Q as oe,L as Ie,a0 as ze,C as te,G as Je,q as L,aj as ae,ak as Fe,al as Oe,N as fe,D as ie,E as ue,J as ce,x as Me}from"./maplibre_helpers-5d84afaa.js";import{i as Te}from"./all-b6f1cdfd.js";import{L as Ee,Z as Ge,C as Ne,j as Pe,g as x,I as De,B as qe,k as He,M as Ze,m as Ke}from"./ZoomOutMap-96dffba9.js";function me(s,e,t){const n=s.slice();return n[6]=e[t][0],n[7]=e[t][1],n}function _e(s){let e;return{c(){e=E("option"),e.__value="",Y(e,e.__value)},m(t,n){h(t,e,n)},d(t){t&&b(e)}}}function pe(s){let e,t=s[7]+"",n,l;return{c(){e=E("option"),n=C(t),e.__value=l=s[6],Y(e,e.__value)},m(r,u){h(r,e,u),$(e,n)},p(r,u){u&8&&t!==(t=r[7]+"")&&Z(n,t),u&8&&l!==(l=r[6])&&(e.__value=l,Y(e,e.__value))},d(r){r&&b(e)}}}function Qe(s){let e,t,n,l,r=s[4]&&_e(),u=ee(s[3]),o=[];for(let f=0;fs[5].call(e))},m(f,a){h(f,e,a),r&&r.m(e,null),$(e,t);for(let c=0;c{"label"in a&&t(1,n=a.label),"id"in a&&t(2,l=a.id),"choices"in a&&t(3,r=a.choices),"emptyOption"in a&&t(4,u=a.emptyOption),"value"in a&&t(0,o=a.value)},[o,n,l,r,u,f]}class $e extends we{constructor(e){super(),ve(this,e,Ue,Re,ke,{label:1,id:2,choices:3,emptyOption:4,value:0})}}function de(s,e,t){const n=s.slice();return n[23]=e[t],n}function Ve(s){let e;return{c(){e=C("Home")},m(t,n){h(t,e,n)},d(t){t&&b(e)}}}function We(s){let e;return{c(){e=C("Clear")},m(t,n){h(t,e,n)},d(t){t&&b(e)}}}function Xe(s){let e,t,n,l,r,u;return n=new te({props:{$$slots:{default:[We]},$$scope:{ctx:s}}}),n.$on("click",s[17]),{c(){e=E("input"),t=L(),F(n.$$.fragment),q(e,"type","text"),q(e,"class","govuk-input govuk-input--width-10"),q(e,"id","filterText")},m(o,f){h(o,e,f),Y(e,s[1]),h(o,t,f),O(n,o,f),l=!0,r||(u=Ce(e,"input",s[16]),r=!0)},p(o,f){f&2&&e.value!==o[1]&&Y(e,o[1]);const a={};f&67108864&&(a.$$scope={dirty:f,ctx:o}),n.$set(a)},i(o){l||(w(n.$$.fragment,o),l=!0)},o(o){j(n.$$.fragment,o),l=!1},d(o){o&&(b(e),b(t)),N(n,o),r=!1,u()}}}function Ye(s){let e,t,n,l,r,u,o,f;function a(i){s[14](i)}let c={label:"Authority or region",id:"filterAuthority",choices:s[7]};s[4]!==void 0&&(c.value=s[4]),e=new $e({props:c}),ie.push(()=>ue(e,"value",a));function v(i){s[15](i)}let I={label:"Funding programme",id:"filterFundingProgramme",choices:s[8]};return s[5]!==void 0&&(I.value=s[5]),l=new $e({props:I}),ie.push(()=>ue(l,"value",v)),o=new ye({props:{label:"Any field",id:"filterText",$$slots:{default:[Xe]},$$scope:{ctx:s}}}),{c(){F(e.$$.fragment),n=L(),F(l.$$.fragment),u=L(),F(o.$$.fragment)},m(i,d){O(e,i,d),h(i,n,d),O(l,i,d),h(i,u,d),O(o,i,d),f=!0},p(i,d){const J={};d&128&&(J.choices=i[7]),!t&&d&16&&(t=!0,J.value=i[4],ce(()=>t=!1)),e.$set(J);const A={};d&256&&(A.choices=i[8]),!r&&d&32&&(r=!0,A.value=i[5],ce(()=>r=!1)),l.$set(A);const B={};d&67108866&&(B.$$scope={dirty:d,ctx:i}),o.$set(B)},i(i){f||(w(e.$$.fragment,i),w(l.$$.fragment,i),w(o.$$.fragment,i),f=!0)},o(i){j(e.$$.fragment,i),j(l.$$.fragment,i),j(o.$$.fragment,i),f=!1},d(i){i&&(b(n),b(u)),N(e,i),N(l,i),N(o,i)}}}function ge(s){let e,t;return e=new Ne({props:{label:`${s[23].scheme_reference}: ${s[23].num_features} features`,$$slots:{default:[tt]},$$scope:{ctx:s}}}),{c(){F(e.$$.fragment)},m(n,l){O(e,n,l),t=!0},p(n,l){const r={};l&1&&(r.label=`${n[23].scheme_reference}: ${n[23].num_features} features`),l&67108865&&(r.$$scope={dirty:l,ctx:n}),e.$set(r)},i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){j(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function xe(s){let e;return{c(){e=C("Show on map")},m(t,n){h(t,e,n)},d(t){t&&b(e)}}}function et(s){let e;return{c(){e=C("Edit scheme")},m(t,n){h(t,e,n)},d(t){t&&b(e)}}}function tt(s){let e,t,n=s[23].authority_or_region+"",l,r,u,o,f=s[23].capital_scheme_id+"",a,c,v,I,i=s[23].funding_programme+"",d,J,A,B,P,M,K,T;function Q(){return s[18](s[23])}B=new te({props:{$$slots:{default:[xe]},$$scope:{ctx:s}}}),B.$on("click",Q);function W(){return s[19](s[23])}return M=new te({props:{$$slots:{default:[et]},$$scope:{ctx:s}}}),M.$on("click",W),{c(){e=E("p"),t=C("Authority or region: "),l=C(n),r=L(),u=E("p"),o=C("Capital scheme ID: "),a=C(f),c=L(),v=E("p"),I=C("Funding programme: "),d=C(i),J=L(),A=E("div"),F(B.$$.fragment),P=L(),F(M.$$.fragment),K=L(),q(A,"class","govuk-button-group")},m(g,k){h(g,e,k),$(e,t),$(e,l),h(g,r,k),h(g,u,k),$(u,o),$(u,a),h(g,c,k),h(g,v,k),$(v,I),$(v,d),h(g,J,k),h(g,A,k),O(B,A,null),$(A,P),O(M,A,null),h(g,K,k),T=!0},p(g,k){s=g,(!T||k&1)&&n!==(n=s[23].authority_or_region+"")&&Z(l,n),(!T||k&1)&&f!==(f=s[23].capital_scheme_id+"")&&Z(a,f),(!T||k&1)&&i!==(i=s[23].funding_programme+"")&&Z(d,i);const m={};k&67108864&&(m.$$scope={dirty:k,ctx:s}),B.$set(m);const p={};k&67108864&&(p.$$scope={dirty:k,ctx:s}),M.$set(p)},i(g){T||(w(B.$$.fragment,g),w(M.$$.fragment,g),T=!0)},o(g){j(B.$$.fragment,g),j(M.$$.fragment,g),T=!1},d(g){g&&(b(e),b(r),b(u),b(c),b(v),b(J),b(A),b(K)),N(B),N(M)}}}function he(s){let e=s[2].has(s[23].scheme_reference),t,n,l=e&&ge(s);return{c(){l&&l.c(),t=Se()},m(r,u){l&&l.m(r,u),h(r,t,u),n=!0},p(r,u){u&5&&(e=r[2].has(r[23].scheme_reference)),e?l?(l.p(r,u),u&5&&w(l,1)):(l=ge(r),l.c(),w(l,1),l.m(t.parentNode,t)):l&&(Fe(),j(l,1,1,()=>{l=null}),Oe())},i(r){n||(w(l),n=!0)},o(r){j(l),n=!1},d(r){r&&b(t),l&&l.d(r)}}}function nt(s){let e,t,n,l,r,u,o,f,a,c,v,I,i,d,J=s[2].size+"",A,B,P=s[3].route+"",M,K,T=s[3].area+"",Q,W,g=s[3].crossing+"",k,m,p=s[3].other+"",D,R,G,X,H;t=new te({props:{$$slots:{default:[Ve]},$$scope:{ctx:s}}}),t.$on("click",s[13]),o=new Ge({props:{boundaryGeojson:s[6]}}),a=new Je({props:{label:"Load from GeoJSON",id:"load-geojson",loadFile:s[10]}}),v=new Ne({props:{label:"Filters",$$slots:{default:[Ye]},$$scope:{ctx:s}}});let U=ee(s[0]),y=[];for(let _=0;_j(y[_],1,1,()=>{y[_]=null});return{c(){e=E("div"),F(t.$$.fragment),n=L(),l=E("div"),r=E("h1"),r.textContent="Browse schemes",u=L(),F(o.$$.fragment),f=L(),F(a.$$.fragment),c=L(),F(v.$$.fragment),I=L(),i=E("p"),d=C("Showing "),A=C(J),B=C(" schemes ("),M=C(P),K=C(" routes, "),Q=C(T),W=C(` areas, - `),k=C(g),m=C(" crossings, "),D=C(p),R=C(" other)"),G=L(),X=E("ul");for(let _=0;_${t}${n}`;return e+="",e}function at(s,e,t){let n,l;oe(s,x,m=>t(6,n=m)),oe(s,Ke,m=>t(20,l=m)),Ie(()=>{Te()});let u=new URLSearchParams(window.location.search).get("style")||"streets",o=[],f="",a=new Set,c={area:0,route:0,crossing:0,other:0},v=[],I="",i=[],d="";ze(()=>{x.set(null)});function J(m){try{let p=JSON.parse(m);x.set(p),A(p),l==null||l.fitBounds(fe(p),{padding:20,animate:!1})}catch(p){window.alert(`Couldn't load schemes from a file: ${p}`)}}function A(m){let p={};for(let[G,X]of Object.entries(m.schemes))p[G]={scheme_reference:G,num_features:0,...X};for(let G of m.features)p[G.properties.scheme_reference].num_features++;t(0,o=Object.values(p));let D=new Set,R=new Set;for(let G of o)G.authority_or_region&&D.add(G.authority_or_region),G.funding_programme&&R.add(G.funding_programme);t(7,v=Array.from(D.entries())),v.sort(),t(8,i=Array.from(R.entries())),i.sort()}function B(m){let p={type:"FeatureCollection",features:n.features.filter(D=>D.properties.scheme_reference==m.scheme_reference)};l==null||l.fitBounds(fe(p),{padding:20,animate:!1})}function P(m){let p={type:"FeatureCollection",features:n.features.filter(R=>R.properties.scheme_reference==m.scheme_reference)},D=m.authority_or_region;window.localStorage.setItem(D,JSON.stringify(p)),window.open(`scheme.html?authority=${m.authority_or_region}`,"_blank")}const M=()=>window.open("index.html");function K(m){I=m,t(4,I)}function T(m){d=m,t(5,d)}function Q(){f=this.value,t(1,f)}const W=()=>t(1,f=""),g=m=>B(m),k=m=>P(m);return s.$$.update=()=>{if(s.$$.dirty&127&&n){if(a.clear(),f||I||d){let m=f.toLowerCase();for(let p of n.features)JSON.stringify(p.properties).toLowerCase().includes(m)&&(I&&p.properties.authority_or_region!=I||d&&p.properties.funding_programme!=d||a.add(p.properties.scheme_reference))}else for(let m of o)a.add(m.scheme_reference);x.update(m=>{if(!m)return null;for(let p of m.features)a.has(p.properties.scheme_reference)?delete p.properties.hide_while_editing:p.properties.hide_while_editing=!0;return m}),t(3,c={area:0,route:0,crossing:0,other:0});for(let m of n==null?void 0:n.features)a.has(m.properties.scheme_reference)&&t(3,c[m.properties.intervention_type]++,c);t(2,a),t(6,n),t(1,f),t(4,I),t(5,d),t(0,o),t(3,c)}},[o,f,a,c,I,d,n,v,i,u,J,B,P,M,K,T,Q,W,g,k]}class ft extends we{constructor(e){super(),ve(this,e,at,rt,ke,{})}}document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";new ft({target:document.getElementById("app")}); diff --git a/browse_dropdown_filters/browse.html b/browse_dropdown_filters/browse.html deleted file mode 100644 index 598aec0ef..000000000 --- a/browse_dropdown_filters/browse.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ATIP v2 scheme browser - - - - - - - - - -
    - - - diff --git a/browse_dropdown_filters/index.html b/browse_dropdown_filters/index.html deleted file mode 100644 index 84694924f..000000000 --- a/browse_dropdown_filters/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Active Travel Infrastructure Platform v2 - - - - - - - - - - -
    - - - diff --git a/browse_dropdown_filters/scheme.html b/browse_dropdown_filters/scheme.html deleted file mode 100644 index 21fc4cb55..000000000 --- a/browse_dropdown_filters/scheme.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - ATIP v2 Scheme Entry - - - - - - - - - - -
    - - - diff --git a/capitalize_auto_form/assets/About-1025697f.js b/capitalize_auto_form/assets/About-1025697f.js new file mode 100644 index 000000000..35257254b --- /dev/null +++ b/capitalize_auto_form/assets/About-1025697f.js @@ -0,0 +1,15 @@ +import{S as K,i as N,s as Q,c as Be,e as g,r as P,d as k,u as Ae,g as Ie,f as Me,t as m,j as d,k as b,p as c,q as E,am as we,aC as J,v as a,l as ve,aF as Te,w as Ee,O as Pe,J as Se,B as je,C as We,H as B,I as A,L as I,D as Le,E as Re,K as Ue}from"./maplibre_helpers-09c65b90.js";const st="/atip/capitalize_auto_form/assets/authorities-80e824dc.geojson";function qe(l){let e,t;const n=l[2].default,s=Be(n,l,l[1],null);return{c(){e=g("a"),s&&s.c(),P(e,"href",l[0]),P(e,"target","_blank"),P(e,"rel","noreferrer")},m(o,i){k(o,e,i),s&&s.m(e,null),t=!0},p(o,[i]){s&&s.p&&(!t||i&2)&&Ae(s,n,o,o[1],t?Me(n,o[1],i,null):Ie(o[1]),null),(!t||i&1)&&P(e,"href",o[0])},i(o){t||(m(s,o),t=!0)},o(o){d(s,o),t=!1},d(o){o&&b(e),s&&s.d(o)}}}function ze(l,e,t){let{$$slots:n={},$$scope:s}=e,{href:o}=e;return l.$$set=i=>{"href"in i&&t(0,o=i.href),"$$scope"in i&&t(1,s=i.$$scope)},[o,s,n]}class T extends K{constructor(e){super(),N(this,e,ze,qe,Q,{href:0})}}function Ce(l){let e,t;return e=new We({props:{$$slots:{default:[De]},$$scope:{ctx:l}}}),e.$on("click",l[5]),{c(){B(e.$$.fragment)},m(n,s){A(e,n,s),t=!0},p(n,s){const o={};s&128&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){t||(m(e.$$.fragment,n),t=!0)},o(n){d(e.$$.fragment,n),t=!1},d(n){I(e,n)}}}function De(l){let e;return{c(){e=c("X")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ge(l){let e,t,n,s,o,i,_,$,w,S,f=l[2]&&Ce(l);const M=l[4].default,h=Be(M,l,l[7],null);return{c(){e=g("div"),t=g("div"),n=g("div"),s=g("h1"),o=c(l[1]),i=E(),f&&f.c(),_=E(),h&&h.c(),P(s,"class","govuk-heading-l"),we(n,"display","flex"),we(n,"justify-content","space-between"),P(t,"class","content centered-fullscreen svelte-stcgp5"),P(e,"class","background svelte-stcgp5"),J(e,"open",l[0]),J(e,"closed",!l[0])},m(u,C){k(u,e,C),a(e,t),a(t,n),a(n,s),a(s,o),a(n,i),f&&f.m(n,null),a(t,_),h&&h.m(t,null),$=!0,w||(S=[ve(t,"click",Te(He)),ve(e,"click",l[6])],w=!0)},p(u,[C]){(!$||C&2)&&Ee(o,u[1]),u[2]?f?(f.p(u,C),C&4&&m(f,1)):(f=Ce(u),f.c(),m(f,1),f.m(n,null)):f&&(Pe(),d(f,1,1,()=>{f=null}),Se()),h&&h.p&&(!$||C&128)&&Ae(h,M,u,u[7],$?Me(M,u[7],C,null):Ie(u[7]),null),(!$||C&1)&&J(e,"open",u[0]),(!$||C&1)&&J(e,"closed",!u[0])},i(u){$||(m(f),m(h,u),$=!0)},o(u){d(f),d(h,u),$=!1},d(u){u&&b(e),f&&f.d(),h&&h.d(u),w=!1,je(S)}}}const He=()=>null;function Je(l,e,t){let{$$slots:n={},$$scope:s}=e,{title:o}=e,{open:i=!1}=e,{displayEscapeButton:_=!0}=e,{canCloseByClickingBackground:$=!0}=e;const w=()=>t(0,i=!1),S=()=>{$&&t(0,i=!1)};return l.$$set=f=>{"title"in f&&t(1,o=f.title),"open"in f&&t(0,i=f.open),"displayEscapeButton"in f&&t(2,_=f.displayEscapeButton),"canCloseByClickingBackground"in f&&t(3,$=f.canCloseByClickingBackground),"$$scope"in f&&t(7,s=f.$$scope)},[i,o,_,$,n,w,S,s]}class Oe extends K{constructor(e){super(),N(this,e,Je,Ge,Q,{title:1,open:0,displayEscapeButton:2,canCloseByClickingBackground:3})}}function Xe(l){let e;return{c(){e=c("open source project")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Fe(l){let e;return{c(){e=c("Dustin Carlino")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ke(l){let e;return{c(){e=c("Madison Wang")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ne(l){let e;return{c(){e=c("Ben Ritter")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Qe(l){let e;return{c(){e=c("OpenStreetMap")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ve(l){let e;return{c(){e=c("MapLibre")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ye(l){let e;return{c(){e=c("GeoRust")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function Ze(l){let e;return{c(){e=c("osm2streets")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function xe(l){let e;return{c(){e=c("Material icons")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function ye(l){let e;return{c(){e=c("start an issue on Github")},m(t,n){k(t,e,n)},d(t){t&&b(e)}}}function et(l){let e,t,n,s,o,i,_,$,w,S,f,M,h,u,C,j,V,O,Y,v,Z,W,x,L,y,R,ee,U,te,q,ne,le,z,se,D,ae,G,oe,re,ie,fe,X,ue,F,H;return s=new T({props:{href:"https://github.com/acteng/atip",$$slots:{default:[Xe]},$$scope:{ctx:l}}}),w=new T({props:{href:"https://www.turing.ac.uk/people/researchers/dustin-carlino",$$slots:{default:[Fe]},$$scope:{ctx:l}}}),u=new T({props:{href:"https://www.linkedin.com/in/madison-wang-841977bb/",$$slots:{default:[Ke]},$$scope:{ctx:l}}}),j=new T({props:{href:"https://github.com/BudgieInWA",$$slots:{default:[Ne]},$$scope:{ctx:l}}}),W=new T({props:{href:"https://www.openstreetmap.org/about",$$slots:{default:[Qe]},$$scope:{ctx:l}}}),L=new T({props:{href:"https://maplibre.org/",$$slots:{default:[Ve]},$$scope:{ctx:l}}}),R=new T({props:{href:"https://georust.org/",$$slots:{default:[Ye]},$$scope:{ctx:l}}}),U=new T({props:{href:"https://github.com/a-b-street/osm2streets",$$slots:{default:[Ze]},$$scope:{ctx:l}}}),q=new T({props:{href:"https://material.io/resources/icons/",$$slots:{default:[xe]},$$scope:{ctx:l}}}),D=new T({props:{href:"https://github.com/acteng/atip/issues/new",$$slots:{default:[ye]},$$scope:{ctx:l}}}),{c(){e=g("div"),t=g("p"),n=c(`ATIP v2 is an + `),B(s.$$.fragment),o=c(" supported by Active Travel England and developed by:"),i=E(),_=g("ul"),$=g("li"),B(w.$$.fragment),S=c(": lead developer, from The Alan Turing Institute"),f=E(),M=g("li"),h=c(`With UX help from + `),B(u.$$.fragment),C=c(` and CSS help from + `),B(j.$$.fragment),V=E(),O=g("li"),O.textContent=`With great thanks to ATIP's various users for feedback, testing, and + ideas`,Y=E(),v=g("p"),Z=c(`ATIP builds on + `),B(W.$$.fragment),x=c(` + contributors, + `),B(L.$$.fragment),y=c(`, + `),B(R.$$.fragment),ee=c(`, + `),B(U.$$.fragment),te=c(`, + `),B(q.$$.fragment),ne=c(", and other open source projects."),le=E(),z=g("p"),se=c("We want your feedback about ATIP! Please "),B(D.$$.fragment),ae=c(` + or email + `),G=g("a"),G.textContent="dcarlino@turing.ac.uk",oe=c("."),re=E(),ie=g("hr"),fe=E(),X=g("h2"),X.textContent="Recent changes",ue=E(),F=g("ul"),F.innerHTML=`
  • v2 launched on 2 June 2023. Changes: a complete UI rewrite, new draw + tools, drawing areas snapped to roads, splitting routes, multiple data schemas, + speed limit layer, lane visualization layer
  • v1 launched in March 2023
  • `,P(G,"href","mailto: dcarlino@turing.ac.uk"),P(e,"class","govuk-prose")},m(r,p){k(r,e,p),a(e,t),a(t,n),A(s,t,null),a(t,o),a(e,i),a(e,_),a(_,$),A(w,$,null),a($,S),a(_,f),a(_,M),a(M,h),A(u,M,null),a(M,C),A(j,M,null),a(_,V),a(_,O),a(e,Y),a(e,v),a(v,Z),A(W,v,null),a(v,x),A(L,v,null),a(v,y),A(R,v,null),a(v,ee),A(U,v,null),a(v,te),A(q,v,null),a(v,ne),a(e,le),a(e,z),a(z,se),A(D,z,null),a(z,ae),a(z,G),a(z,oe),a(e,re),a(e,ie),a(e,fe),a(e,X),a(e,ue),a(e,F),H=!0},p(r,p){const ce={};p&4&&(ce.$$scope={dirty:p,ctx:r}),s.$set(ce);const $e={};p&4&&($e.$$scope={dirty:p,ctx:r}),w.$set($e);const pe={};p&4&&(pe.$$scope={dirty:p,ctx:r}),u.$set(pe);const _e={};p&4&&(_e.$$scope={dirty:p,ctx:r}),j.$set(_e);const ge={};p&4&&(ge.$$scope={dirty:p,ctx:r}),W.$set(ge);const me={};p&4&&(me.$$scope={dirty:p,ctx:r}),L.$set(me);const de={};p&4&&(de.$$scope={dirty:p,ctx:r}),R.$set(de);const he={};p&4&&(he.$$scope={dirty:p,ctx:r}),U.$set(he);const ke={};p&4&&(ke.$$scope={dirty:p,ctx:r}),q.$set(ke);const be={};p&4&&(be.$$scope={dirty:p,ctx:r}),D.$set(be)},i(r){H||(m(s.$$.fragment,r),m(w.$$.fragment,r),m(u.$$.fragment,r),m(j.$$.fragment,r),m(W.$$.fragment,r),m(L.$$.fragment,r),m(R.$$.fragment,r),m(U.$$.fragment,r),m(q.$$.fragment,r),m(D.$$.fragment,r),H=!0)},o(r){d(s.$$.fragment,r),d(w.$$.fragment,r),d(u.$$.fragment,r),d(j.$$.fragment,r),d(W.$$.fragment,r),d(L.$$.fragment,r),d(R.$$.fragment,r),d(U.$$.fragment,r),d(q.$$.fragment,r),d(D.$$.fragment,r),H=!1},d(r){r&&b(e),I(s),I(w),I(u),I(j),I(W),I(L),I(R),I(U),I(q),I(D)}}}function tt(l){let e,t,n;function s(i){l[1](i)}let o={title:"About the Active Travel Infrastructure Platform",$$slots:{default:[et]},$$scope:{ctx:l}};return l[0]!==void 0&&(o.open=l[0]),e=new Oe({props:o}),Le.push(()=>Re(e,"open",s)),{c(){B(e.$$.fragment)},m(i,_){A(e,i,_),n=!0},p(i,[_]){const $={};_&4&&($.$$scope={dirty:_,ctx:i}),!t&&_&1&&(t=!0,$.open=i[0],Ue(()=>t=!1)),e.$set($)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){d(e.$$.fragment,i),n=!1},d(i){I(e,i)}}}function nt(l,e,t){let{open:n}=e;function s(o){n=o,t(0,n)}return l.$$set=o=>{"open"in o&&t(0,n=o.open)},[n,s]}class at extends K{constructor(e){super(),N(this,e,nt,tt,Q,{open:0})}}export{at as A,Oe as M,st as a}; diff --git a/browse_dropdown_filters/assets/About-ac64a19d.css b/capitalize_auto_form/assets/About-ac64a19d.css similarity index 100% rename from browse_dropdown_filters/assets/About-ac64a19d.css rename to capitalize_auto_form/assets/About-ac64a19d.css diff --git a/capitalize_auto_form/assets/ZoomOutMap-58aba399.js b/capitalize_auto_form/assets/ZoomOutMap-58aba399.js new file mode 100644 index 000000000..55de2d0db --- /dev/null +++ b/capitalize_auto_form/assets/ZoomOutMap-58aba399.js @@ -0,0 +1,2 @@ +import{S as P,i as z,s as O,e as d,p as C,A as H,au as oe,r as _,d as v,v as p,av as V,l as Z,x as M,k as b,B as ae,at as ie,_ as re,c as q,q as $,aG as A,u as R,g as G,f as N,t as I,j as D,U as F,W as ce,Z as U,Y as Q,X as ue,a1 as fe,a0 as de,$ as X,w as pe,P as T,a3 as ee,H as te,I as se,L as ne,am as B,O as me,J as _e,aH as ge,M as ve,D as be,C as ye,as as he,Q as we}from"./maplibre_helpers-09c65b90.js";function ke(n){let e,l,t,s,o,a,c;return{c(){e=d("div"),l=C(`Basemap: + `),t=d("select"),s=d("option"),s.textContent="Streets",o=d("option"),o.textContent="Satellite",s.__value="streets",H(s,s.__value),o.__value="hybrid",H(o,o.__value),n[0]===void 0&&oe(()=>n[2].call(t)),_(e,"class","svelte-1tbnm6i")},m(f,i){v(f,e,i),p(e,l),p(e,t),p(t,s),p(t,o),V(t,n[0],!0),a||(c=[Z(t,"change",n[2]),Z(t,"change",n[1])],a=!0)},p(f,[i]){i&1&&V(t,f[0])},i:M,o:M,d(f){f&&b(e),a=!1,ae(c)}}}function Se(n,e,l){let{style:t}=e;function s(){let a=new URLSearchParams(window.location.search);a.set("style",t);let c=`${window.location.pathname}?${a.toString()}${window.location.hash}`;window.location.href=c}function o(){t=ie(this),l(0,t)}return n.$$set=a=>{"style"in a&&l(0,t=a.style)},[t,s,o]}class xe extends P{constructor(e){super(),z(this,e,Se,ke,O,{style:0})}}const E=[];function L(n,e=M){let l;const t=new Set;function s(c){if(O(n,c)&&(n=c,l)){const f=!E.length;for(const i of t)i[1](),E.push(i,n);if(f){for(let i=0;i{t.delete(i),t.size===0&&l&&(l(),l=null)}}return{set:s,update:o,subscribe:a}}function Ce(n){return n=="google"||n=="bing"}function et(n){return{v1:"Scheme Design",v2:"Experimental Scheme Design",planning:"Development Planning",criticals:"Critical Issues",atf4:"ATF4 Scheme"}[n]}function tt(n){return{v1:"an intervention",v2:"an intervention",planning:"a development",criticals:"a critical issue",atf4:"an intervention"}[n]}function st(n){return{v1:"interventions",v2:"interventions",planning:"developments",criticals:"critical issues",atf4:"interventions"}[n]}const J=L(null),nt=L(null),le=L(re()),Le=L(null),$e=L(null),Ie=L(null),Oe=L(null),Be=L(Me());Be.subscribe(n=>window.localStorage.setItem("userSettings",JSON.stringify(n)));const lt=L("edit-attribute"),ot=L(!1);function at(n){let e=new Set;for(let t of n.features)e.add(t.id);let l=e.size+1;for(;e.has(l);)l++;return l}function it(n){console.log(`Deleting intervention ${n}`),le.update(e=>(e.features=e.features.filter(l=>l.id!=n),e)),Le.set(null),$e.set(null),Ie.set(null),Oe.set(null)}function Me(){let n={streetViewImagery:"google",avoidDoublingBack:!1};try{let e=JSON.parse(window.localStorage.getItem("userSettings")||"{}");Ce(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}const De=n=>({}),Y=n=>({}),Pe=n=>({}),K=n=>({});function ze(n){let e,l,t,s,o,a,c,f,i,r,y;const h=n[3].sidebar,m=q(h,n,n[2],K),S=n[3].main,w=q(S,n,n[2],Y);return{c(){e=d("div"),l=d("aside"),t=d("div"),m&&m.c(),s=$(),o=d("button"),o.textContent="→",c=$(),f=d("main"),w&&w.c(),_(t,"class","sidebar-content content-container svelte-ect12w"),_(o,"type","button"),_(o,"class","sidebar-toggle rounded-rect svelte-ect12w"),_(l,"class",a=A(n[0]?"":"collapsed")+" svelte-ect12w"),_(f,"class","svelte-ect12w"),_(e,"class","overall-layout svelte-ect12w")},m(u,g){v(u,e,g),p(e,l),p(l,t),m&&m.m(t,null),p(l,s),p(l,o),p(e,c),p(e,f),w&&w.m(f,null),i=!0,r||(y=Z(o,"click",n[1]),r=!0)},p(u,[g]){m&&m.p&&(!i||g&4)&&R(m,h,u,u[2],i?N(h,u[2],g,Pe):G(u[2]),K),(!i||g&1&&a!==(a=A(u[0]?"":"collapsed")+" svelte-ect12w"))&&_(l,"class",a),w&&w.p&&(!i||g&4)&&R(w,S,u,u[2],i?N(S,u[2],g,De):G(u[2]),Y)},i(u){i||(I(m,u),I(w,u),i=!0)},o(u){D(m,u),D(w,u),i=!1},d(u){u&&b(e),m&&m.d(u),w&&w.d(u),r=!1,y()}}}function je(n,e,l){let{$$slots:t={},$$scope:s}=e,o=!0;function a(){l(0,o=!o)}return n.$$set=c=>{"$$scope"in c&&l(2,s=c.$$scope)},[o,a,s,t]}class rt extends P{constructor(e){super(),z(this,e,je,ze,O,{})}}const k={area:"#D94324",route:"#555F5E",crossing:"#4daf4a",other:"#984ea3",preapp:"#e41a1c",outline:"#377eb8","reserved matters":"#4daf4a","local plan":"#984ea3",hovering:"black",lineEndpointColor:"black"},Ee=10,W=10;let j="interventions";function Te(n,e,l){let t,s;F(n,J,r=>l(1,t=r)),F(n,le,r=>l(2,s=r));let{schema:o}=e;ce(t,j,s);const a=["match",["get","intervention_type"],"area",k.area,"route",k.route,"crossing",k.crossing,"other",k.other,"white"],c=["match",["get","reference_type",["get","planning"]],"preapp",k.preapp,"outline",k.outline,"reserved matters",k["reserved matters"],"local plan",k["local plan"],"white"],f=["!=","hide_while_editing",!0];return U(t,{id:"interventions-points",source:j,filter:["all",fe,f,["!=","endpoint",!0]],color:a,radius:Ee}),Q(t,{id:"interventions-lines",source:j,filter:["all",de,f],color:a,width:W}),U(t,{id:"interventions-lines-endpoints",source:j,filter:["==","endpoint",!0],radius:.5*W,opacity:0,strokeColor:k.lineEndpointColor,strokeWidth:2}),ue(t,{id:"interventions-polygons",source:j,filter:["all",X,f],color:o=="planning"?c:a,opacity:.2}),Q(t,{id:"interventions-polygon-outlines",source:j,filter:["all",X,f],color:o=="planning"?c:a,opacity:.5,width:.7*W}),n.$$set=r=>{"schema"in r&&l(0,o=r.schema)},n.$$.update=()=>{if(n.$$.dirty&6){let r=JSON.parse(JSON.stringify(s)),y=[];for(let h of r.features)if(h.geometry.type=="LineString"&&!h.properties.hide_while_editing)for(let m of[h.geometry.coordinates[0],h.geometry.coordinates[h.geometry.coordinates.length-1]])y.push({type:"Feature",properties:{endpoint:!0},geometry:{type:"Point",coordinates:m}});r.features=r.features.concat(y),t.getSource(j).setData(r)}},[o,t,s]}class ct extends P{constructor(e){super(),z(this,e,Te,null,O,{schema:0})}}function qe(n){let e,l,t,s,o,a,c;const f=n[3].default,i=q(f,n,n[2],null);return{c(){e=d("details"),l=d("summary"),t=d("span"),s=C(n[0]),o=$(),a=d("div"),i&&i.c(),_(t,"class","govuk-details__summary-text"),_(l,"class","govuk-details__summary"),_(a,"class","govuk-details__text"),e.open=n[1],_(e,"class","govuk-details"),_(e,"data-module","govuk-details")},m(r,y){v(r,e,y),p(e,l),p(l,t),p(t,s),p(e,o),p(e,a),i&&i.m(a,null),c=!0},p(r,[y]){(!c||y&1)&&pe(s,r[0]),i&&i.p&&(!c||y&4)&&R(i,f,r,r[2],c?N(f,r[2],y,null):G(r[2]),null),(!c||y&2)&&(e.open=r[1])},i(r){c||(I(i,r),c=!0)},o(r){D(i,r),c=!1},d(r){r&&b(e),i&&i.d(r)}}}function Re(n,e,l){let{$$slots:t={},$$scope:s}=e,{label:o}=e,{open:a=!1}=e;return n.$$set=c=>{"label"in c&&l(0,o=c.label),"open"in c&&l(1,a=c.open),"$$scope"in c&&l(2,s=c.$$scope)},[o,a,s,t]}class Ge extends P{constructor(e){super(),z(this,e,Re,qe,O,{label:0,open:1})}}function Ne(n,e,l){let t;F(n,J,i=>l(2,t=i));let{layers:s}=e,{contents:o}=e,a=new T.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none"});t.on("mousemove",c),t.on("mouseout",f),ee(()=>{t.off("mousemove",c),t.off("mouseout",f),a.remove()});function c(i){if(!s.every(y=>t.getLayer(y))){a.remove();return}let r=t.queryRenderedFeatures(i.point,{layers:s});r.length>0?a.setLngLat(i.lngLat).setHTML(o(r[0].properties)).addTo(t):a.remove()}function f(){a.remove()}return n.$$set=i=>{"layers"in i&&l(0,s=i.layers),"contents"in i&&l(1,o=i.contents)},[s,o]}class ut extends P{constructor(e){super(),z(this,e,Ne,null,O,{layers:0,contents:1})}}function Fe(n){let e,l,t,s,o,a,c,f,i,r,y,h,m,S,w;return{c(){e=d("li"),l=d("span"),t=C("Areas"),s=$(),o=d("li"),a=d("span"),c=C("Routes"),f=$(),i=d("li"),r=d("span"),y=C("Crossings"),h=$(),m=d("li"),S=d("span"),w=C("Other"),_(l,"class","svelte-l42ea0"),B(l,"background",k.area),_(a,"class","svelte-l42ea0"),B(a,"background",k.route),_(r,"class","svelte-l42ea0"),B(r,"background",k.crossing),_(S,"class","svelte-l42ea0"),B(S,"background",k.other)},m(u,g){v(u,e,g),p(e,l),p(e,t),v(u,s,g),v(u,o,g),p(o,a),p(o,c),v(u,f,g),v(u,i,g),p(i,r),p(i,y),v(u,h,g),v(u,m,g),p(m,S),p(m,w)},p:M,d(u){u&&(b(e),b(s),b(o),b(f),b(i),b(h),b(m))}}}function Je(n){let e,l,t,s,o,a,c,f,i,r,y,h,m,S,w;return{c(){e=d("li"),l=d("span"),t=C("Preapp"),s=$(),o=d("li"),a=d("span"),c=C("Outline"),f=$(),i=d("li"),r=d("span"),y=C("Reserved matters"),h=$(),m=d("li"),S=d("span"),w=C("Local plan"),_(l,"class","svelte-l42ea0"),B(l,"background",k.preapp),_(a,"class","svelte-l42ea0"),B(a,"background",k.outline),_(r,"class","svelte-l42ea0"),B(r,"background",k["reserved matters"]),_(S,"class","svelte-l42ea0"),B(S,"background",k["local plan"])},m(u,g){v(u,e,g),p(e,l),p(e,t),v(u,s,g),v(u,o,g),p(o,a),p(o,c),v(u,f,g),v(u,i,g),p(i,r),p(i,y),v(u,h,g),v(u,m,g),p(m,S),p(m,w)},p:M,d(u){u&&(b(e),b(s),b(o),b(f),b(i),b(h),b(m))}}}function We(n){let e;function l(o,a){return o[0]=="planning"?Je:Fe}let t=l(n),s=t(n);return{c(){e=d("ul"),s.c()},m(o,a){v(o,e,a),s.m(e,null)},p(o,a){t===(t=l(o))&&s?s.p(o,a):(s.d(1),s=t(o),s&&(s.c(),s.m(e,null)))},d(o){o&&b(e),s.d()}}}function Ze(n){let e,l,t;return l=new Ge({props:{label:"Objects",open:!0,$$slots:{default:[We]},$$scope:{ctx:n}}}),{c(){e=d("div"),te(l.$$.fragment),_(e,"class","svelte-l42ea0")},m(s,o){v(s,e,o),se(l,e,null),t=!0},p(s,[o]){const a={};o&3&&(a.$$scope={dirty:o,ctx:s}),l.$set(a)},i(s){t||(I(l.$$.fragment,s),t=!0)},o(s){D(l.$$.fragment,s),t=!1},d(s){s&&b(e),ne(l)}}}function He(n,e,l){let{schema:t}=e;return n.$$set=s=>{"schema"in s&&l(0,t=s.schema)},[t]}class ft extends P{constructor(e){super(),z(this,e,He,Ze,O,{schema:0})}}function x(n){let e;const l=n[4].default,t=q(l,n,n[3],null);return{c(){t&&t.c()},m(s,o){t&&t.m(s,o),e=!0},p(s,o){t&&t.p&&(!e||o&8)&&R(t,l,s,s[3],e?N(l,s[3],o,null):G(s[3]),null)},i(s){e||(I(t,s),e=!0)},o(s){D(t,s),e=!1},d(s){t&&t.d(s)}}}function Ve(n){let e,l,t=n[1]&&x(n);return{c(){e=d("div"),t&&t.c(),_(e,"class","map svelte-12dpf1u")},m(s,o){v(s,e,o),t&&t.m(e,null),n[5](e),l=!0},p(s,[o]){s[1]?t?(t.p(s,o),o&2&&I(t,1)):(t=x(s),t.c(),I(t,1),t.m(e,null)):t&&(me(),D(t,1,1,()=>{t=null}),_e())},i(s){l||(I(t),l=!0)},o(s){D(t),l=!1},d(s){s&&b(e),t&&t.d(),n[5](null)}}}function Ae(n,e,l){let{$$slots:t={},$$scope:s}=e,{style:o}=e,a,c,f=!1;ge("setCamera",!window.location.hash),ve(()=>{a=new T.Map({container:c,style:`https://api.maptiler.com/maps/${o}/style.json?key=MZEJTanw3WpxRvt7qDfo`,hash:!0}),a.addControl(new T.ScaleControl({})),a.addControl(new T.NavigationControl({visualizePitch:!0}),"bottom-right"),a.on("load",()=>{l(1,f=!0),J.set(a)}),new ResizeObserver(()=>{a.resize()}).observe(c)}),ee(()=>{a.remove()});function i(r){be[r?"unshift":"push"](()=>{c=r,l(0,c)})}return n.$$set=r=>{"style"in r&&l(2,o=r.style),"$$scope"in r&&l(3,s=r.$$scope)},[c,f,o,s,t,i]}class dt extends P{constructor(e){super(),z(this,e,Ae,Ve,O,{style:2})}}const Ue="/atip/capitalize_auto_form/assets/zoom_out_map-b2e1091a.svg";function Qe(n){let e,l;return{c(){e=d("img"),he(e.src,l=Ue)||_(e,"src",l),_(e,"alt","Zoom to show entire boundary")},m(t,s){v(t,e,s)},p:M,d(t){t&&b(e)}}}function Xe(n){let e,l;return e=new ye({props:{title:"Zoom to show entire boundary",$$slots:{default:[Qe]},$$scope:{ctx:n}}}),e.$on("click",n[0]),{c(){te(e.$$.fragment)},m(t,s){se(e,t,s),l=!0},p(t,[s]){const o={};s&8&&(o.$$scope={dirty:s,ctx:t}),e.$set(o)},i(t){l||(I(e.$$.fragment,t),l=!0)},o(t){D(e.$$.fragment,t),l=!1},d(t){ne(e,t)}}}function Ye(n,e,l){let t;F(n,J,a=>l(2,t=a));let{boundaryGeojson:s}=e;function o(){t.fitBounds(we(s),{padding:20,animate:!0,duration:500})}return n.$$set=a=>{"boundaryGeojson"in a&&l(1,s=a.boundaryGeojson)},[o,s]}class pt extends P{constructor(e){super(),z(this,e,Ye,Xe,O,{boundaryGeojson:1})}}export{xe as B,Ge as C,ct as I,rt as L,ut as M,pt as Z,$e as a,Ee as b,k as c,lt as d,tt as e,Le as f,le as g,st as h,ot as i,it as j,et as k,W as l,J as m,at as n,Oe as o,dt as p,ft as q,nt as r,Ie as s,Be as u}; diff --git a/browse_dropdown_filters/assets/ZoomOutMap-b28bd1eb.css b/capitalize_auto_form/assets/ZoomOutMap-b28bd1eb.css similarity index 100% rename from browse_dropdown_filters/assets/ZoomOutMap-b28bd1eb.css rename to capitalize_auto_form/assets/ZoomOutMap-b28bd1eb.css diff --git a/capitalize_auto_form/assets/all-3ccdc89c.css b/capitalize_auto_form/assets/all-3ccdc89c.css new file mode 100644 index 000000000..096300f49 --- /dev/null +++ b/capitalize_auto_form/assets/all-3ccdc89c.css @@ -0,0 +1 @@ +@charset "UTF-8";:root{--govuk-frontend-version: "4.7.0"}.govuk-link,.govuk-prose a{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */@font-face{font-family:GDS Transport;font-style:normal;font-weight:400;src:url(/atip/capitalize_auto_form/assets/fonts/light-94a07e06a1-v2.woff2) format("woff2"),url(/atip/capitalize_auto_form/assets/fonts/light-f591b13f7d-v2.woff) format("woff");font-display:fallback}@font-face{font-family:GDS Transport;font-style:normal;font-weight:700;src:url(/atip/capitalize_auto_form/assets/fonts/bold-b542beb274-v2.woff2) format("woff2"),url(/atip/capitalize_auto_form/assets/fonts/bold-affa96571d-v2.woff) format("woff");font-display:fallback}@media print{.govuk-link,.govuk-prose a{font-family:sans-serif}}.govuk-link:focus,.govuk-prose a:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-link:link,.govuk-prose a:link{color:#1d70b8}.govuk-link:visited,.govuk-prose a:visited{color:#4c2c92}.govuk-link:hover,.govuk-prose a:hover{color:#003078}.govuk-link:active,.govuk-prose a:active{color:#0b0c0c}.govuk-link:focus,.govuk-prose a:focus{color:#0b0c0c}@media print{[href^="/"].govuk-link:after,.govuk-prose a[href^="/"]:after,[href^="http://"].govuk-link:after,.govuk-prose a[href^="http://"]:after,[href^="https://"].govuk-link:after,.govuk-prose a[href^="https://"]:after{content:" (" attr(href) ")";font-size:90%;word-wrap:break-word}}.govuk-link--muted:link,.govuk-link--muted:visited{color:#505a5f}.govuk-link--muted:hover,.govuk-link--muted:active{color:#0b0c0c}.govuk-link--muted:focus{color:#0b0c0c}.govuk-link--text-colour:link,.govuk-link--text-colour:visited{color:#0b0c0c}@media print{.govuk-link--text-colour:link,.govuk-link--text-colour:visited{color:#000}}.govuk-link--text-colour:hover{color:#0b0c0cfc}.govuk-link--text-colour:active,.govuk-link--text-colour:focus{color:#0b0c0c}@media print{.govuk-link--text-colour:active,.govuk-link--text-colour:focus{color:#000}}.govuk-link--inverse:link,.govuk-link--inverse:visited{color:#fff}.govuk-link--inverse:hover,.govuk-link--inverse:active{color:#fffffffc}.govuk-link--inverse:focus{color:#0b0c0c}.govuk-link--no-underline:not(:hover):not(:active){text-decoration:none}.govuk-link--no-visited-state:link,.govuk-link--no-visited-state:visited{color:#1d70b8}.govuk-link--no-visited-state:hover{color:#003078}.govuk-link--no-visited-state:active{color:#0b0c0c}.govuk-link--no-visited-state:focus{color:#0b0c0c}.govuk-list{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin-top:0;margin-bottom:15px;padding-left:0;list-style-type:none}@media print{.govuk-list{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-list{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-list{font-size:14pt;line-height:1.15}}@media print{.govuk-list{color:#000}}@media (min-width: 40.0625em){.govuk-list{margin-bottom:20px}}.govuk-list .govuk-list{margin-top:10px}.govuk-list>li{margin-bottom:5px}.govuk-list--bullet,.govuk-prose ul{padding-left:20px;list-style-type:disc}.govuk-list--number{padding-left:20px;list-style-type:decimal}.govuk-list--bullet>li,.govuk-prose ul>li,.govuk-list--number>li{margin-bottom:0}@media (min-width: 40.0625em){.govuk-list--bullet>li,.govuk-prose ul>li,.govuk-list--number>li{margin-bottom:5px}}.govuk-list--spaced>li{margin-bottom:10px}@media (min-width: 40.0625em){.govuk-list--spaced>li{margin-bottom:15px}}.govuk-heading-xl{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;display:block;margin-top:0;margin-bottom:30px}@media print{.govuk-heading-xl{color:#000}}@media print{.govuk-heading-xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-heading-xl{font-size:32pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-heading-xl{margin-bottom:50px}}.govuk-heading-l,.govuk-prose h1{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;display:block;margin-top:0;margin-bottom:20px}@media print{.govuk-heading-l,.govuk-prose h1{color:#000}}@media print{.govuk-heading-l,.govuk-prose h1{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-l,.govuk-prose h1{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-heading-l,.govuk-prose h1{font-size:24pt;line-height:1.05}}@media (min-width: 40.0625em){.govuk-heading-l,.govuk-prose h1{margin-bottom:30px}}.govuk-heading-m,.govuk-prose h2{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;display:block;margin-top:0;margin-bottom:15px}@media print{.govuk-heading-m,.govuk-prose h2{color:#000}}@media print{.govuk-heading-m,.govuk-prose h2{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-m,.govuk-prose h2{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-heading-m,.govuk-prose h2{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-heading-m,.govuk-prose h2{margin-bottom:20px}}.govuk-heading-s{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;display:block;margin-top:0;margin-bottom:15px}@media print{.govuk-heading-s{color:#000}}@media print{.govuk-heading-s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-heading-s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-heading-s{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-heading-s{margin-bottom:20px}}.govuk-caption-xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1.1111111111;display:block;margin-bottom:5px;color:#505a5f}@media print{.govuk-caption-xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-caption-xl{font-size:27px;font-size:1.6875rem;line-height:1.1111111111}}@media print{.govuk-caption-xl{font-size:18pt;line-height:1.15}}.govuk-caption-l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1.1111111111;display:block;margin-bottom:5px;color:#505a5f}@media print{.govuk-caption-l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-caption-l{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-caption-l{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-caption-l{margin-bottom:0}}.govuk-caption-m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;display:block;color:#505a5f}@media print{.govuk-caption-m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-caption-m{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-caption-m{font-size:14pt;line-height:1.15}}.govuk-body-lead,.govuk-body-l{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-top:0;margin-bottom:20px}@media print{.govuk-body-lead,.govuk-body-l{color:#000}}@media print{.govuk-body-lead,.govuk-body-l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body-lead,.govuk-body-l{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-body-lead,.govuk-body-l{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-body-lead,.govuk-body-l{margin-bottom:30px}}.govuk-body,.govuk-prose p,.govuk-body-m{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-top:0;margin-bottom:15px}@media print{.govuk-body,.govuk-prose p,.govuk-body-m{color:#000}}@media print{.govuk-body,.govuk-prose p,.govuk-body-m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body,.govuk-prose p,.govuk-body-m{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-body,.govuk-prose p,.govuk-body-m{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-body,.govuk-prose p,.govuk-body-m{margin-bottom:20px}}.govuk-body-s{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;margin-top:0;margin-bottom:15px}@media print{.govuk-body-s{color:#000}}@media print{.govuk-body-s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body-s{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-body-s{font-size:14pt;line-height:1.2}}@media (min-width: 40.0625em){.govuk-body-s{margin-bottom:20px}}.govuk-body-xs{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:12px;font-size:.75rem;line-height:1.25;margin-top:0;margin-bottom:15px}@media print{.govuk-body-xs{color:#000}}@media print{.govuk-body-xs{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-body-xs{font-size:14px;font-size:.875rem;line-height:1.4285714286}}@media print{.govuk-body-xs{font-size:12pt;line-height:1.2}}@media (min-width: 40.0625em){.govuk-body-xs{margin-bottom:20px}}.govuk-body-l+.govuk-heading-l,.govuk-prose .govuk-body-l+h1,.govuk-body-lead+.govuk-heading-l,.govuk-prose .govuk-body-lead+h1{padding-top:5px}@media (min-width: 40.0625em){.govuk-body-l+.govuk-heading-l,.govuk-prose .govuk-body-l+h1,.govuk-body-lead+.govuk-heading-l,.govuk-prose .govuk-body-lead+h1{padding-top:10px}}.govuk-body-m+.govuk-heading-l,.govuk-prose .govuk-body-m+h1,.govuk-body+.govuk-heading-l,.govuk-prose p+.govuk-heading-l,.govuk-prose .govuk-body+h1,.govuk-prose p+h1,.govuk-body-s+.govuk-heading-l,.govuk-prose .govuk-body-s+h1,.govuk-list+.govuk-heading-l,.govuk-prose .govuk-list+h1{padding-top:15px}@media (min-width: 40.0625em){.govuk-body-m+.govuk-heading-l,.govuk-prose .govuk-body-m+h1,.govuk-body+.govuk-heading-l,.govuk-prose p+.govuk-heading-l,.govuk-prose .govuk-body+h1,.govuk-prose p+h1,.govuk-body-s+.govuk-heading-l,.govuk-prose .govuk-body-s+h1,.govuk-list+.govuk-heading-l,.govuk-prose .govuk-list+h1{padding-top:20px}}.govuk-body-m+.govuk-heading-m,.govuk-prose .govuk-body-m+h2,.govuk-body+.govuk-heading-m,.govuk-prose p+.govuk-heading-m,.govuk-prose .govuk-body+h2,.govuk-prose p+h2,.govuk-body-s+.govuk-heading-m,.govuk-prose .govuk-body-s+h2,.govuk-list+.govuk-heading-m,.govuk-prose .govuk-list+h2,.govuk-body-m+.govuk-heading-s,.govuk-body+.govuk-heading-s,.govuk-prose p+.govuk-heading-s,.govuk-body-s+.govuk-heading-s,.govuk-list+.govuk-heading-s{padding-top:5px}@media (min-width: 40.0625em){.govuk-body-m+.govuk-heading-m,.govuk-prose .govuk-body-m+h2,.govuk-body+.govuk-heading-m,.govuk-prose p+.govuk-heading-m,.govuk-prose .govuk-body+h2,.govuk-prose p+h2,.govuk-body-s+.govuk-heading-m,.govuk-prose .govuk-body-s+h2,.govuk-list+.govuk-heading-m,.govuk-prose .govuk-list+h2,.govuk-body-m+.govuk-heading-s,.govuk-body+.govuk-heading-s,.govuk-prose p+.govuk-heading-s,.govuk-body-s+.govuk-heading-s,.govuk-list+.govuk-heading-s{padding-top:10px}}.govuk-section-break{margin:0;border:0}.govuk-section-break--xl{margin-top:30px;margin-bottom:30px}@media (min-width: 40.0625em){.govuk-section-break--xl{margin-top:50px}}@media (min-width: 40.0625em){.govuk-section-break--xl{margin-bottom:50px}}.govuk-section-break--l{margin-top:20px;margin-bottom:20px}@media (min-width: 40.0625em){.govuk-section-break--l{margin-top:30px}}@media (min-width: 40.0625em){.govuk-section-break--l{margin-bottom:30px}}.govuk-section-break--m{margin-top:15px;margin-bottom:15px}@media (min-width: 40.0625em){.govuk-section-break--m{margin-top:20px}}@media (min-width: 40.0625em){.govuk-section-break--m{margin-bottom:20px}}.govuk-section-break--visible{border-bottom:1px solid #b1b4b6}.govuk-button-group{margin-bottom:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}@media (min-width: 40.0625em){.govuk-button-group{margin-bottom:15px}}.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.1875;display:inline-block;max-width:100%;margin-top:5px;margin-bottom:20px;text-align:center}@media print{.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-size:19px;font-size:1.1875rem;line-height:1}}@media print{.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{font-size:14pt;line-height:19px}}.govuk-button-group .govuk-button{margin-bottom:17px}@media (min-width: 40.0625em){.govuk-button-group{margin-right:-15px;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline}.govuk-button-group .govuk-button,.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{margin-right:15px}.govuk-button-group .govuk-link,.govuk-button-group .govuk-prose a,.govuk-prose .govuk-button-group a{text-align:left}}.govuk-form-group{margin-bottom:20px}.govuk-form-group:after{content:"";display:block;clear:both}@media (min-width: 40.0625em){.govuk-form-group{margin-bottom:30px}}.govuk-form-group .govuk-form-group:last-of-type{margin-bottom:0}.govuk-form-group--error{padding-left:15px;border-left:5px solid #d4351c}.govuk-form-group--error .govuk-form-group{padding:0;border:0}.govuk-grid-row{margin-right:-15px;margin-left:-15px}.govuk-grid-row:after{content:"";display:block;clear:both}.govuk-grid-column-one-quarter{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-one-quarter{width:25%;float:left}}.govuk-grid-column-one-third{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-one-third{width:33.3333333333%;float:left}}.govuk-grid-column-one-half{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-one-half{width:50%;float:left}}.govuk-grid-column-two-thirds{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-two-thirds{width:66.6666666667%;float:left}}.govuk-grid-column-three-quarters{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-three-quarters{width:75%;float:left}}.govuk-grid-column-full{box-sizing:border-box;width:100%;padding:0 15px}@media (min-width: 40.0625em){.govuk-grid-column-full{width:100%;float:left}}.govuk-grid-column-one-quarter-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-one-quarter-from-desktop{width:25%;float:left}}.govuk-grid-column-one-third-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-one-third-from-desktop{width:33.3333333333%;float:left}}.govuk-grid-column-one-half-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-one-half-from-desktop{width:50%;float:left}}.govuk-grid-column-two-thirds-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-two-thirds-from-desktop{width:66.6666666667%;float:left}}.govuk-grid-column-three-quarters-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-three-quarters-from-desktop{width:75%;float:left}}.govuk-grid-column-full-from-desktop{box-sizing:border-box;padding:0 15px}@media (min-width: 48.0625em){.govuk-grid-column-full-from-desktop{width:100%;float:left}}.govuk-main-wrapper{display:block;padding-top:20px;padding-bottom:20px}@media (min-width: 40.0625em){.govuk-main-wrapper{padding-top:40px;padding-bottom:40px}}.govuk-main-wrapper--auto-spacing:first-child,.govuk-main-wrapper--l{padding-top:30px}@media (min-width: 40.0625em){.govuk-main-wrapper--auto-spacing:first-child,.govuk-main-wrapper--l{padding-top:50px}}.govuk-template{background-color:#f3f2f1;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}@supports (position: -webkit-sticky) or (position: sticky){.govuk-template{scroll-padding-top:60px}.govuk-template:not(:has(.govuk-exit-this-page)){scroll-padding-top:0}}@media screen{.govuk-template{overflow-y:scroll}}.govuk-template__body{margin:0;background-color:#fff}.govuk-width-container{max-width:960px;margin-right:15px;margin-left:15px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(15px,calc(15px + env(safe-area-inset-right)));margin-left:max(15px,calc(15px + env(safe-area-inset-left)))}}@media (min-width: 40.0625em){.govuk-width-container{margin-right:30px;margin-left:30px}@supports (margin: max(0px)){.govuk-width-container{margin-right:max(30px,calc(15px + env(safe-area-inset-right)));margin-left:max(30px,calc(15px + env(safe-area-inset-left)))}}}@media (min-width: 1020px){.govuk-width-container{margin-right:auto;margin-left:auto}@supports (margin: max(0px)){.govuk-width-container{margin-right:auto;margin-left:auto}}}.govuk-accordion{margin-bottom:20px}@media (min-width: 40.0625em){.govuk-accordion{margin-bottom:30px}}.govuk-accordion__section{padding-top:15px}.govuk-accordion__section-heading{margin-top:0;margin-bottom:0;padding-top:15px;padding-bottom:15px}.govuk-accordion__section-button{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;color:#0b0c0c;display:block;margin-bottom:0;padding-top:15px}@media print{.govuk-accordion__section-button{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-accordion__section-button{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-accordion__section-button{font-size:18pt;line-height:1.15}}@media print{.govuk-accordion__section-button{color:#000}}.govuk-accordion__section-content>:last-child{margin-bottom:0}.js-enabled .govuk-accordion{border-bottom:1px solid #b1b4b6}.js-enabled .govuk-accordion__section{padding-top:0}.js-enabled .govuk-accordion__section-content{display:none;padding-top:15px;padding-bottom:30px}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section-content{padding-bottom:50px}}.js-enabled .govuk-accordion__section-content[hidden]{padding-top:0;padding-bottom:0}@supports (content-visibility: hidden){.js-enabled .govuk-accordion__section-content[hidden]{content-visibility:hidden;display:inherit}}.js-enabled .govuk-accordion__section--expanded .govuk-accordion__section-content{display:block}.js-enabled .govuk-accordion__show-all{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;position:relative;z-index:1;margin-bottom:9px;padding:5px 2px 5px 0;border-width:0;color:#1d70b8;background:none;cursor:pointer;-webkit-appearance:none}@media print{.js-enabled .govuk-accordion__show-all{font-family:sans-serif}}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__show-all{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.js-enabled .govuk-accordion__show-all{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__show-all{margin-bottom:14px}}.js-enabled .govuk-accordion__show-all::-moz-focus-inner{padding:0;border:0}.js-enabled .govuk-accordion__show-all:hover{color:#0b0c0c;background:#f3f2f1;box-shadow:0 -2px #f3f2f1,0 4px #f3f2f1}.js-enabled .govuk-accordion__show-all:hover .govuk-accordion__section-toggle-text{color:#0b0c0c}.js-enabled .govuk-accordion__show-all:hover .govuk-accordion-nav__chevron{color:#0b0c0c;background:#0b0c0c}.js-enabled .govuk-accordion__show-all:hover .govuk-accordion-nav__chevron:after{color:#f3f2f1}.js-enabled .govuk-accordion__show-all:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.js-enabled .govuk-accordion__show-all:focus .govuk-accordion-nav__chevron{background:#0b0c0c}.js-enabled .govuk-accordion__show-all:focus .govuk-accordion-nav__chevron:after{color:#fd0}.js-enabled .govuk-accordion__section-heading{padding:0}.js-enabled .govuk-accordion-nav__chevron{box-sizing:border-box;display:inline-block;position:relative;width:1.25rem;height:1.25rem;border:.0625rem solid;border-radius:50%;vertical-align:middle}.js-enabled .govuk-accordion-nav__chevron:after{content:"";box-sizing:border-box;display:block;position:absolute;bottom:.3125rem;left:.375rem;width:.375rem;height:.375rem;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);border-top:.125rem solid;border-right:.125rem solid}.js-enabled .govuk-accordion-nav__chevron--down{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.js-enabled .govuk-accordion__section-button{width:100%;padding:10px 0 0;border:0;border-top:1px solid #b1b4b6;border-bottom:10px solid transparent;color:#0b0c0c;background:none;text-align:left;cursor:pointer;-webkit-appearance:none}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section-button{padding-bottom:10px}}.js-enabled .govuk-accordion__section-button:active{color:#0b0c0c;background:none}.js-enabled .govuk-accordion__section-button:hover{color:#0b0c0c;background:#f3f2f1}.js-enabled .govuk-accordion__section-button:hover .govuk-accordion__section-toggle-text{color:#0b0c0c}.js-enabled .govuk-accordion__section-button:hover .govuk-accordion-nav__chevron{color:#0b0c0c;background:#0b0c0c}.js-enabled .govuk-accordion__section-button:hover .govuk-accordion-nav__chevron:after{color:#f3f2f1}.js-enabled .govuk-accordion__section-button:focus{outline:0}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion-nav__chevron{color:#0b0c0c;background:#0b0c0c}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion-nav__chevron:after{color:#fd0}.js-enabled .govuk-accordion__section-button::-moz-focus-inner{padding:0;border:0}.js-enabled .govuk-accordion__section--expanded .govuk-accordion__section-button{padding-bottom:15px;border-bottom:0}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section--expanded .govuk-accordion__section-button{padding-bottom:20px}}.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus{padding-bottom:3px}@media (min-width: 48.0625em){.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus{padding-bottom:2px}}.js-enabled .govuk-accordion__section-toggle,.js-enabled .govuk-accordion__section-heading-text,.js-enabled .govuk-accordion__section-summary{display:block;margin-bottom:13px}.js-enabled .govuk-accordion__section-toggle .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-toggle .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-toggle .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__section-heading-text .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-heading-text .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-heading-text .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__section-summary .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-summary .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-summary .govuk-accordion__section-toggle-focus{display:inline}.js-enabled .govuk-accordion__section-toggle{font-size:16px;font-size:1rem;line-height:1.25;font-weight:400;color:#1d70b8}@media (min-width: 40.0625em){.js-enabled .govuk-accordion__section-toggle{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.js-enabled .govuk-accordion__section-toggle{font-size:14pt;line-height:1.15}}.js-enabled .govuk-accordion__show-all-text,.js-enabled .govuk-accordion__section-toggle-text{margin-left:5px;vertical-align:middle}@media screen and (forced-colors: active){.js-enabled .govuk-accordion__show-all:hover .govuk-accordion-nav__chevron,.js-enabled .govuk-accordion__section-button:hover .govuk-accordion-nav__chevron{background-color:transparent}.js-enabled .govuk-accordion__show-all:focus .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__show-all:focus .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__show-all:focus .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__show-all:focus .govuk-accordion-nav__chevron,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-heading-text-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-summary-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus,.js-enabled .govuk-accordion__section-button:focus .govuk-accordion-nav__chevron{background:transparent;background-color:transparent}}@media (hover: none){.js-enabled .govuk-accordion__section-header:hover{border-top-color:#b1b4b6;box-shadow:inset 0 3px #1d70b8}.js-enabled .govuk-accordion__section-header:hover .govuk-accordion__section-button{border-top-color:#b1b4b6}}.govuk-back-link{font-size:14px;font-size:.875rem;line-height:1.1428571429;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;display:inline-block;position:relative;margin-top:15px;margin-bottom:15px;padding-left:.875em}@media (min-width: 40.0625em){.govuk-back-link{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-back-link{font-size:14pt;line-height:1.2}}@media print{.govuk-back-link{font-family:sans-serif}}.govuk-back-link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-back-link:link,.govuk-back-link:visited{color:#0b0c0c}@media print{.govuk-back-link:link,.govuk-back-link:visited{color:#000}}.govuk-back-link:hover{color:#0b0c0cfc}.govuk-back-link:active,.govuk-back-link:focus{color:#0b0c0c}@media print{.govuk-back-link:active,.govuk-back-link:focus{color:#000}}.govuk-back-link:before{content:"";display:block;position:absolute;top:0;bottom:0;left:.1875em;width:.4375em;height:.4375em;margin:auto 0;-webkit-transform:rotate(225deg);-ms-transform:rotate(225deg);transform:rotate(225deg);border:solid;border-width:1px 1px 0 0;border-color:#505a5f}@supports (border-width: max(0px)){.govuk-back-link:before{border-width:max(1px,.0625em) max(1px,.0625em) 0 0;font-size:max(16px,1em)}}.govuk-back-link:focus:before{border-color:#0b0c0c}.govuk-back-link:after{content:"";position:absolute;top:-14px;right:0;bottom:-14px;left:0}.govuk-back-link--inverse:link,.govuk-back-link--inverse:visited{color:#fff}.govuk-back-link--inverse:hover,.govuk-back-link--inverse:active{color:#fffffffc}.govuk-back-link--inverse:focus{color:#0b0c0c}.govuk-back-link--inverse:before{border-color:currentcolor}.govuk-breadcrumbs{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;color:#0b0c0c;margin-top:15px;margin-bottom:10px}@media print{.govuk-breadcrumbs{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-breadcrumbs{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-breadcrumbs{font-size:14pt;line-height:1.2}}@media print{.govuk-breadcrumbs{color:#000}}.govuk-breadcrumbs__list{margin:0;padding:0;list-style-type:none}.govuk-breadcrumbs__list:after{content:"";display:block;clear:both}.govuk-breadcrumbs__list-item{display:inline-block;position:relative;margin-bottom:5px;margin-left:.625em;padding-left:.9784375em;float:left}.govuk-breadcrumbs__list-item:before{content:"";display:block;position:absolute;top:0;bottom:0;left:-.206875em;width:.4375em;height:.4375em;margin:auto 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);border:solid;border-width:1px 1px 0 0;border-color:#505a5f}@supports (border-width: max(0px)){.govuk-breadcrumbs__list-item:before{border-width:max(1px,.0625em) max(1px,.0625em) 0 0;font-size:max(16px,1em)}}.govuk-breadcrumbs__list-item:first-child{margin-left:0;padding-left:0}.govuk-breadcrumbs__list-item:first-child:before{content:none;display:none}.govuk-breadcrumbs__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-breadcrumbs__link{font-family:sans-serif}}.govuk-breadcrumbs__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-breadcrumbs__link:link,.govuk-breadcrumbs__link:visited{color:#0b0c0c}@media print{.govuk-breadcrumbs__link:link,.govuk-breadcrumbs__link:visited{color:#000}}.govuk-breadcrumbs__link:hover{color:#0b0c0cfc}.govuk-breadcrumbs__link:active,.govuk-breadcrumbs__link:focus{color:#0b0c0c}@media print{.govuk-breadcrumbs__link:active,.govuk-breadcrumbs__link:focus{color:#000}}@media (max-width: 40.0525em){.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item{display:none}.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item:first-child,.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item:last-child{display:inline-block}.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list-item:before{top:.375em;margin:0}.govuk-breadcrumbs--collapse-on-mobile .govuk-breadcrumbs__list{display:-ms-flexbox;display:flex}}.govuk-breadcrumbs--inverse,.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:link,.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:visited{color:#fff}.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:hover,.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:active{color:#fffffffc}.govuk-breadcrumbs--inverse .govuk-breadcrumbs__link:focus{color:#0b0c0c}.govuk-breadcrumbs--inverse .govuk-breadcrumbs__list-item:before{border-color:currentcolor}.govuk-button{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.1875;box-sizing:border-box;display:inline-block;position:relative;width:100%;margin:0 0 22px;padding:8px 10px 7px;border:2px solid transparent;border-radius:0;color:#fff;background-color:#00703c;box-shadow:0 2px #002d18;text-align:center;vertical-align:top;cursor:pointer;-webkit-appearance:none}@media print{.govuk-button{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-button{font-size:19px;font-size:1.1875rem;line-height:1}}@media print{.govuk-button{font-size:14pt;line-height:19px}}@media (min-width: 40.0625em){.govuk-button{margin-bottom:32px}}@media (min-width: 40.0625em){.govuk-button{width:auto}}.govuk-button:link,.govuk-button:visited,.govuk-button:active,.govuk-button:hover{color:#fff;text-decoration:none}.govuk-button::-moz-focus-inner{padding:0;border:0}.govuk-button:hover{background-color:#005a30}.govuk-button:active{top:2px}.govuk-button:focus{border-color:#fd0;outline:3px solid transparent;box-shadow:inset 0 0 0 1px #fd0}.govuk-button:focus:not(:active):not(:hover){border-color:#fd0;color:#0b0c0c;background-color:#fd0;box-shadow:0 2px #0b0c0c}.govuk-button:before{content:"";display:block;position:absolute;top:-2px;right:-2px;bottom:-4px;left:-2px;background:transparent}.govuk-button:active:before{top:-4px}.govuk-button--disabled,.govuk-button[disabled=disabled],.govuk-button[disabled]{opacity:.5}.govuk-button--disabled:hover,.govuk-button[disabled=disabled]:hover,.govuk-button[disabled]:hover{background-color:#00703c;cursor:not-allowed}.govuk-button--disabled:active,.govuk-button[disabled=disabled]:active,.govuk-button[disabled]:active{top:0;box-shadow:0 2px #002d18}.govuk-button--secondary{background-color:#f3f2f1;box-shadow:0 2px #929191}.govuk-button--secondary,.govuk-button--secondary:link,.govuk-button--secondary:visited,.govuk-button--secondary:active,.govuk-button--secondary:hover{color:#0b0c0c}.govuk-button--secondary:hover{background-color:#dbdad9}.govuk-button--secondary:hover[disabled]{background-color:#f3f2f1}.govuk-button--warning{background-color:#d4351c;box-shadow:0 2px #55150b}.govuk-button--warning,.govuk-button--warning:link,.govuk-button--warning:visited,.govuk-button--warning:active,.govuk-button--warning:hover{color:#fff}.govuk-button--warning:hover{background-color:#aa2a16}.govuk-button--warning:hover[disabled]{background-color:#d4351c}.govuk-button--inverse{background-color:#fff;box-shadow:0 2px #144e81}.govuk-button--inverse,.govuk-button--inverse:link,.govuk-button--inverse:visited,.govuk-button--inverse:active,.govuk-button--inverse:hover{color:#1d70b8}.govuk-button--inverse:hover{background-color:#e8f1f8}.govuk-button--inverse:hover[disabled]{background-color:#fff}.govuk-button--start{font-weight:700;font-size:18px;font-size:1.125rem;line-height:1;display:-ms-inline-flexbox;display:inline-flex;min-height:auto;-ms-flex-pack:center;justify-content:center}@media (min-width: 40.0625em){.govuk-button--start{font-size:24px;font-size:1.5rem;line-height:1}}@media print{.govuk-button--start{font-size:18pt;line-height:1}}.govuk-button__start-icon{margin-left:5px;vertical-align:middle;-ms-flex-negative:0;flex-shrink:0;-ms-flex-item-align:center;align-self:center;forced-color-adjust:auto}@media (min-width: 48.0625em){.govuk-button__start-icon{margin-left:10px}}.govuk-error-message{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;display:block;margin-top:0;margin-bottom:15px;clear:both;color:#d4351c}@media print{.govuk-error-message{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-error-message{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-error-message{font-size:14pt;line-height:1.15}}.govuk-fieldset{min-width:0;margin:0;padding:0;border:0}.govuk-fieldset:after{content:"";display:block;clear:both}@supports not (caret-color: auto){.govuk-fieldset,x:-moz-any-link{display:table-cell}}.govuk-fieldset__legend{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;box-sizing:border-box;display:table;max-width:100%;margin-bottom:10px;padding:0;white-space:normal}@media print{.govuk-fieldset__legend{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-fieldset__legend{font-size:14pt;line-height:1.15}}@media print{.govuk-fieldset__legend{color:#000}}.govuk-fieldset__legend--xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;margin-bottom:15px}@media print{.govuk-fieldset__legend--xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-fieldset__legend--xl{font-size:32pt;line-height:1.15}}.govuk-fieldset__legend--l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;margin-bottom:15px}@media print{.govuk-fieldset__legend--l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--l{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-fieldset__legend--l{font-size:24pt;line-height:1.05}}.govuk-fieldset__legend--m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-bottom:15px}@media print{.govuk-fieldset__legend--m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--m{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-fieldset__legend--m{font-size:18pt;line-height:1.15}}.govuk-fieldset__legend--s{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-fieldset__legend--s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-fieldset__legend--s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-fieldset__legend--s{font-size:14pt;line-height:1.15}}.govuk-fieldset__heading{margin:0;font-size:inherit;font-weight:inherit}.govuk-hint{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-bottom:15px;color:#505a5f}@media print{.govuk-hint{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-hint{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-hint{font-size:14pt;line-height:1.15}}.govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl)+.govuk-hint{margin-bottom:10px}.govuk-fieldset__legend:not(.govuk-fieldset__legend--m):not(.govuk-fieldset__legend--l):not(.govuk-fieldset__legend--xl)+.govuk-hint{margin-bottom:10px}.govuk-fieldset__legend+.govuk-hint{margin-top:-5px}.govuk-label{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;display:block;margin-bottom:5px}@media print{.govuk-label{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-label{font-size:14pt;line-height:1.15}}@media print{.govuk-label{color:#000}}.govuk-label--xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;margin-bottom:15px}@media print{.govuk-label--xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-label--xl{font-size:32pt;line-height:1.15}}.govuk-label--l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;margin-bottom:15px}@media print{.govuk-label--l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--l{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-label--l{font-size:24pt;line-height:1.05}}.govuk-label--m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-bottom:10px}@media print{.govuk-label--m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--m{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-label--m{font-size:18pt;line-height:1.15}}.govuk-label--s{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-label--s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-label--s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-label--s{font-size:14pt;line-height:1.15}}.govuk-label-wrapper{margin:0}.govuk-checkboxes__item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;display:block;position:relative;min-height:40px;margin-bottom:10px;padding-left:40px;clear:left}@media print{.govuk-checkboxes__item{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-checkboxes__item{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-checkboxes__item{font-size:14pt;line-height:1.15}}.govuk-checkboxes__item:last-child,.govuk-checkboxes__item:last-of-type{margin-bottom:0}.govuk-checkboxes__input{cursor:pointer;position:absolute;z-index:1;top:-2px;left:-2px;width:44px;height:44px;margin:0;opacity:0}.govuk-checkboxes__label{display:inline-block;margin-bottom:0;padding:8px 15px 5px;cursor:pointer;-ms-touch-action:manipulation;touch-action:manipulation}.govuk-checkboxes__label:before{content:"";box-sizing:border-box;position:absolute;top:0;left:0;width:40px;height:40px;border:2px solid currentcolor;background:transparent}.govuk-checkboxes__label:after{content:"";box-sizing:border-box;position:absolute;top:11px;left:9px;width:23px;height:12px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);border:solid;border-width:0 0 5px 5px;border-top-color:transparent;opacity:0;background:transparent}.govuk-checkboxes__hint{display:block;padding-right:15px;padding-left:15px}.govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{border-width:4px;outline:3px solid transparent;outline-offset:1px;box-shadow:0 0 0 3px #fd0}@media screen and (forced-colors: active),(-ms-high-contrast: active){.govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{outline-color:Highlight}}.govuk-checkboxes__input:checked+.govuk-checkboxes__label:after{opacity:1}.govuk-checkboxes__input:disabled,.govuk-checkboxes__input:disabled+.govuk-checkboxes__label{cursor:not-allowed}.govuk-checkboxes__input:disabled+.govuk-checkboxes__label,.govuk-checkboxes__input:disabled~.govuk-hint{opacity:.5}.govuk-checkboxes__divider{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;width:40px;margin-bottom:10px;text-align:center}@media print{.govuk-checkboxes__divider{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-checkboxes__divider{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-checkboxes__divider{font-size:14pt;line-height:1.15}}@media print{.govuk-checkboxes__divider{color:#000}}.govuk-checkboxes__conditional{margin-bottom:15px;margin-left:18px;padding-left:33px;border-left:4px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-checkboxes__conditional{margin-bottom:20px}}.js-enabled .govuk-checkboxes__conditional--hidden{display:none}.govuk-checkboxes__conditional>:last-child{margin-bottom:0}.govuk-checkboxes--small .govuk-checkboxes__item{min-height:0;margin-bottom:0;padding-left:34px;float:left}.govuk-checkboxes--small .govuk-checkboxes__item:after{content:"";display:block;clear:both}.govuk-checkboxes--small .govuk-checkboxes__input{left:-10px}.govuk-checkboxes--small .govuk-checkboxes__label{margin-top:-2px;padding:13px 15px 13px 1px;float:left}@media (min-width: 40.0625em){.govuk-checkboxes--small .govuk-checkboxes__label{padding:11px 15px 10px 1px}}.govuk-checkboxes--small .govuk-checkboxes__label:before{top:8px;width:24px;height:24px}.govuk-checkboxes--small .govuk-checkboxes__label:after{top:15px;left:6px;width:12px;height:6.5px;border-width:0 0 3px 3px}.govuk-checkboxes--small .govuk-checkboxes__hint{padding:0;clear:both}.govuk-checkboxes--small .govuk-checkboxes__conditional{margin-left:10px;padding-left:20px;clear:both}.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled)+.govuk-checkboxes__label:before{box-shadow:0 0 0 10px #b1b4b6}.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{box-shadow:0 0 0 3px #fd0,0 0 0 10px #b1b4b6}@media (hover: none),(pointer: coarse){.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled)+.govuk-checkboxes__label:before{box-shadow:initial}.govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus+.govuk-checkboxes__label:before{box-shadow:0 0 0 3px #fd0}}.govuk-textarea{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;display:block;width:100%;min-height:40px;margin-bottom:20px;padding:5px;resize:vertical;border:2px solid #0b0c0c;border-radius:0;-webkit-appearance:none}@media print{.govuk-textarea{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-textarea{font-size:19px;font-size:1.1875rem;line-height:1.25}}@media print{.govuk-textarea{font-size:14pt;line-height:1.25}}@media (min-width: 40.0625em){.govuk-textarea{margin-bottom:30px}}.govuk-textarea:focus{outline:3px solid #ffdd00;outline-offset:0;box-shadow:inset 0 0 0 2px}.govuk-textarea:disabled{opacity:.5;color:inherit;background-color:transparent;cursor:not-allowed}.govuk-textarea--error{border-color:#d4351c}.govuk-textarea--error:focus{border-color:#0b0c0c}.govuk-character-count{margin-bottom:20px}@media (min-width: 40.0625em){.govuk-character-count{margin-bottom:30px}}.govuk-character-count .govuk-form-group,.govuk-character-count .govuk-textarea{margin-bottom:5px}.govuk-character-count__message{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:"tnum" 1;font-feature-settings:"tnum" 1;font-weight:400;margin-top:0;margin-bottom:0}@media print{.govuk-character-count__message{font-family:sans-serif}}@supports (font-variant-numeric: tabular-nums){.govuk-character-count__message{-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant-numeric:tabular-nums}}.govuk-character-count__message:after{content:"​"}.govuk-character-count__message--disabled{visibility:hidden}.govuk-cookie-banner{padding-top:20px;border-bottom:10px solid transparent;background-color:#f3f2f1}.govuk-cookie-banner[hidden]{display:none}.govuk-cookie-banner__message{margin-bottom:-10px}.govuk-cookie-banner__message[hidden]{display:none}.govuk-cookie-banner__message:focus{outline:none}.govuk-input{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;width:100%;height:40px;height:2.5rem;margin-top:0;padding:5px;border:2px solid #0b0c0c;border-radius:0;-webkit-appearance:none;appearance:none}@media print{.govuk-input{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-input{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-input{font-size:14pt;line-height:1.15}}.govuk-input:focus{outline:3px solid #ffdd00;outline-offset:0;box-shadow:inset 0 0 0 2px}.govuk-input:disabled{opacity:.5;color:inherit;background-color:transparent;cursor:not-allowed}.govuk-input::-webkit-outer-spin-button,.govuk-input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.govuk-input[type=number]{-moz-appearance:textfield}.govuk-input--error{border-color:#d4351c}.govuk-input--error:focus{border-color:#0b0c0c}.govuk-input--extra-letter-spacing{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:"tnum" 1;font-feature-settings:"tnum" 1;font-weight:400;letter-spacing:.05em}@media print{.govuk-input--extra-letter-spacing{font-family:sans-serif}}@supports (font-variant-numeric: tabular-nums){.govuk-input--extra-letter-spacing{-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant-numeric:tabular-nums}}.govuk-input--width-30{max-width:29.5em}.govuk-input--width-20{max-width:20.5em}.govuk-input--width-10{max-width:11.5em}.govuk-input--width-5{max-width:5.5em}.govuk-input--width-4{max-width:4.5em}.govuk-input--width-3{max-width:3.75em}.govuk-input--width-2{max-width:2.75em}.govuk-input__wrapper{display:-ms-flexbox;display:flex}.govuk-input__wrapper .govuk-input{-ms-flex:0 1 auto;flex:0 1 auto}.govuk-input__wrapper .govuk-input:focus{z-index:1}@media (max-width: 19.99em){.govuk-input__wrapper{display:block}.govuk-input__wrapper .govuk-input{max-width:100%}}.govuk-input__prefix,.govuk-input__suffix{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;display:inline-block;min-width:40px;min-width:2.5rem;height:40px;height:2.5rem;padding:5px;border:2px solid #0b0c0c;background-color:#f3f2f1;text-align:center;white-space:nowrap;cursor:default;-ms-flex:0 0 auto;flex:0 0 auto}@media print{.govuk-input__prefix,.govuk-input__suffix{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-input__prefix,.govuk-input__suffix{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-input__prefix,.govuk-input__suffix{font-size:14pt;line-height:1.15}}@media (max-width: 40.0525em){.govuk-input__prefix,.govuk-input__suffix{line-height:1.6}}@media (max-width: 19.99em){.govuk-input__prefix,.govuk-input__suffix{display:block;height:100%;white-space:normal}}@media (max-width: 19.99em){.govuk-input__prefix{border-bottom:0}}@media (min-width: 20em){.govuk-input__prefix{border-right:0}}@media (max-width: 19.99em){.govuk-input__suffix{border-top:0}}@media (min-width: 20em){.govuk-input__suffix{border-left:0}}.govuk-date-input{font-size:0}.govuk-date-input:after{content:"";display:block;clear:both}.govuk-date-input__item{display:inline-block;margin-right:20px;margin-bottom:0}.govuk-date-input__label{display:block}.govuk-date-input__input{margin-bottom:0}.govuk-details{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin-bottom:20px;display:block}@media print{.govuk-details{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-details{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-details{font-size:14pt;line-height:1.15}}@media print{.govuk-details{color:#000}}@media (min-width: 40.0625em){.govuk-details{margin-bottom:30px}}.govuk-details__summary{display:inline-block;position:relative;margin-bottom:5px;padding-left:25px;color:#1d70b8;cursor:pointer}.govuk-details__summary:hover{color:#003078}.govuk-details__summary:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-details__summary-text{text-decoration:underline}.govuk-details__summary:focus .govuk-details__summary-text{text-decoration:none}.govuk-details__summary::-webkit-details-marker{display:none}.govuk-details__summary:before{content:"";position:absolute;top:-1px;bottom:0;left:0;margin:auto;display:block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(0% 0%,100% 50%,0% 100%);clip-path:polygon(0% 0%,100% 50%,0% 100%);border-width:7px 0 7px 12.124px;border-left-color:inherit}.govuk-details[open]>.govuk-details__summary:before{display:block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(0% 0%,50% 100%,100% 0%);clip-path:polygon(0% 0%,50% 100%,100% 0%);border-width:12.124px 7px 0 7px;border-top-color:inherit}.govuk-details__text{padding-top:15px;padding-bottom:15px;padding-left:20px;border-left:5px solid #b1b4b6}.govuk-details__text p{margin-top:0;margin-bottom:20px}.govuk-details__text>:last-child{margin-bottom:0}.govuk-error-summary{color:#0b0c0c;padding:15px;margin-bottom:30px;border:5px solid #d4351c}@media print{.govuk-error-summary{color:#000}}@media (min-width: 40.0625em){.govuk-error-summary{padding:20px}}@media (min-width: 40.0625em){.govuk-error-summary{margin-bottom:50px}}.govuk-error-summary:focus{outline:3px solid #ffdd00}.govuk-error-summary__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-top:0;margin-bottom:15px}@media print{.govuk-error-summary__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-error-summary__title{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-error-summary__title{font-size:18pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-error-summary__title{margin-bottom:20px}}.govuk-error-summary__body{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-error-summary__body{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-error-summary__body{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-error-summary__body{font-size:14pt;line-height:1.15}}.govuk-error-summary__body p{margin-top:0;margin-bottom:15px}@media (min-width: 40.0625em){.govuk-error-summary__body p{margin-bottom:20px}}.govuk-error-summary__list{margin-top:0;margin-bottom:0}.govuk-error-summary__list a{font-weight:700;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-error-summary__list a{font-family:sans-serif}}.govuk-error-summary__list a:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-error-summary__list a:link,.govuk-error-summary__list a:visited{color:#d4351c}.govuk-error-summary__list a:hover{color:#942514}.govuk-error-summary__list a:active{color:#d4351c}.govuk-error-summary__list a:focus{color:#0b0c0c}.govuk-exit-this-page{margin-bottom:30px;position:-webkit-sticky;position:sticky;z-index:1000;top:0;left:0;width:100%}@media (min-width: 40.0625em){.govuk-exit-this-page{margin-bottom:50px}}@media (min-width: 40.0625em){.govuk-exit-this-page{display:inline-block;right:0;left:auto;width:auto;float:right}}.govuk-exit-this-page__button{margin-bottom:0}.govuk-exit-this-page__indicator{padding:10px 10px 0;display:none;color:inherit;line-height:0;text-align:center;pointer-events:none}.govuk-exit-this-page__indicator--visible{display:block}.govuk-exit-this-page__indicator-light{box-sizing:border-box;display:inline-block;width:.75em;height:.75em;margin:0 .125em;border-width:2px;border-style:solid;border-radius:50%;border-color:currentcolor}.govuk-exit-this-page__indicator-light--on{border-width:.375em}@media only print{.govuk-exit-this-page{display:none}}.govuk-exit-this-page-overlay{position:fixed;z-index:9999;top:0;right:0;bottom:0;left:0;background-color:#fff}.govuk-exit-this-page-hide-content *{display:none!important}.govuk-exit-this-page-hide-content .govuk-exit-this-page-overlay{display:block!important}.govuk-file-upload{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;max-width:100%;margin-left:-5px;padding:5px}@media print{.govuk-file-upload{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-file-upload{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-file-upload{font-size:14pt;line-height:1.15}}@media print{.govuk-file-upload{color:#000}}.govuk-file-upload::-webkit-file-upload-button{-webkit-appearance:button;color:inherit;font:inherit}.govuk-file-upload:focus{outline:3px solid #ffdd00;box-shadow:inset 0 0 0 4px #0b0c0c}.govuk-file-upload:focus-within{outline:3px solid #ffdd00;box-shadow:inset 0 0 0 4px #0b0c0c}.govuk-file-upload:disabled{opacity:.5;cursor:not-allowed}.govuk-footer{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;padding-top:25px;padding-bottom:15px;border-top:1px solid #b1b4b6;color:#0b0c0c;background:#f3f2f1}@media print{.govuk-footer{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-footer{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-footer{font-size:14pt;line-height:1.2}}@media (min-width: 40.0625em){.govuk-footer{padding-top:40px}}@media (min-width: 40.0625em){.govuk-footer{padding-bottom:25px}}.govuk-footer__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-footer__link{font-family:sans-serif}}.govuk-footer__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-footer__link:link,.govuk-footer__link:visited{color:#0b0c0c}@media print{.govuk-footer__link:link,.govuk-footer__link:visited{color:#000}}.govuk-footer__link:hover{color:#0b0c0cfc}.govuk-footer__link:active,.govuk-footer__link:focus{color:#0b0c0c}@media print{.govuk-footer__link:active,.govuk-footer__link:focus{color:#000}}.govuk-footer__section-break{margin:0 0 30px;border:0;border-bottom:1px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-footer__section-break{margin-bottom:50px}}.govuk-footer__meta{display:-ms-flexbox;display:flex;margin-right:-15px;margin-left:-15px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}.govuk-footer__meta-item{margin-right:15px;margin-bottom:25px;margin-left:15px}.govuk-footer__meta-item--grow{-ms-flex:1;flex:1}@media (max-width: 40.0525em){.govuk-footer__meta-item--grow{-ms-flex-preferred-size:320px;flex-basis:320px}}.govuk-footer__licence-logo{display:inline-block;margin-right:10px;vertical-align:top;forced-color-adjust:auto}@media (max-width: 48.0525em){.govuk-footer__licence-logo{margin-bottom:15px}}.govuk-footer__licence-description{display:inline-block}.govuk-footer__copyright-logo{display:inline-block;min-width:125px;padding-top:112px;background-image:url(/atip/capitalize_auto_form/assets/images/govuk-crest.png);background-repeat:no-repeat;background-position:50% 0%;background-size:125px 102px;text-align:center;white-space:nowrap}@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){.govuk-footer__copyright-logo{background-image:url(/atip/capitalize_auto_form/assets/images/govuk-crest-2x.png)}}.govuk-footer__inline-list{margin-top:0;margin-bottom:15px;padding:0}.govuk-footer__meta-custom{margin-bottom:20px}.govuk-footer__inline-list-item{display:inline-block;margin-right:15px;margin-bottom:5px}.govuk-footer__heading{margin-bottom:30px;padding-bottom:20px;border-bottom:1px solid #b1b4b6}@media (max-width: 40.0525em){.govuk-footer__heading{padding-bottom:10px}}.govuk-footer__navigation{margin-right:-15px;margin-left:-15px}.govuk-footer__navigation:after{content:"";display:block;clear:both}.govuk-footer__section{display:inline-block;margin-bottom:30px;vertical-align:top}.govuk-footer__list{margin:0;padding:0;list-style:none;-webkit-column-gap:30px;column-gap:30px}@media (min-width: 48.0625em){.govuk-footer__list--columns-2{-webkit-column-count:2;column-count:2}.govuk-footer__list--columns-3{-webkit-column-count:3;column-count:3}}.govuk-footer__list-item{margin-bottom:15px}@media (min-width: 40.0625em){.govuk-footer__list-item{margin-bottom:20px}}.govuk-footer__list-item:last-child{margin-bottom:0}.govuk-header{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;border-bottom:10px solid #ffffff;color:#fff;background:#0b0c0c}@media print{.govuk-header{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-header{font-size:14pt;line-height:1.2}}.govuk-header__container--full-width{padding:0 15px;border-color:#1d70b8}.govuk-header__container--full-width .govuk-header__menu-button{right:15px}.govuk-header__container{position:relative;margin-bottom:-10px;padding-top:10px;border-bottom:10px solid #1d70b8}.govuk-header__container:after{content:"";display:block;clear:both}.govuk-header__logotype{display:inline-block;margin-right:5px}@media (forced-colors: active){.govuk-header__logotype{forced-color-adjust:none;color:linktext}}.govuk-header__logotype:last-child{margin-right:0}.govuk-header__logotype-crown{position:relative;top:-1px;margin-right:1px;fill:currentcolor;vertical-align:top}.govuk-header__logotype-crown-fallback-image{width:36px;height:32px;border:0;vertical-align:bottom}.govuk-header__product-name{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:18px;font-size:1.125rem;line-height:1;display:inline-table}@media print{.govuk-header__product-name{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__product-name{font-size:24px;font-size:1.5rem;line-height:1}}@media print{.govuk-header__product-name{font-size:18pt;line-height:1}}.govuk-header__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none}@media print{.govuk-header__link{font-family:sans-serif}}.govuk-header__link:link,.govuk-header__link:visited{color:#fff}.govuk-header__link:hover,.govuk-header__link:active{color:#fffffffc}.govuk-header__link:focus{color:#0b0c0c}.govuk-header__link:hover{text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:.1578em}.govuk-header__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-header__link--homepage{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;display:inline-block;margin-right:10px;font-size:30px;line-height:1}@media print{.govuk-header__link--homepage{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__link--homepage{display:inline}.govuk-header__link--homepage:focus{box-shadow:0 0 #fd0}}.govuk-header__link--homepage:link,.govuk-header__link--homepage:visited{text-decoration:none}.govuk-header__link--homepage:hover,.govuk-header__link--homepage:active{margin-bottom:-3px;border-bottom:3px solid}.govuk-header__link--homepage:focus{margin-bottom:0;border-bottom:0}.govuk-header__service-name,.govuk-header__link--service-name{display:inline-block;margin-bottom:10px;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111}@media print{.govuk-header__service-name,.govuk-header__link--service-name{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__service-name,.govuk-header__link--service-name{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-header__service-name,.govuk-header__link--service-name{font-size:18pt;line-height:1.15}}.govuk-header__logo,.govuk-header__content{box-sizing:border-box}.govuk-header__logo{margin-bottom:10px;padding-right:50px}@media (min-width: 48.0625em){.govuk-header__logo{width:33.33%;padding-right:15px;float:left;vertical-align:top}}@media (min-width: 48.0625em){.govuk-header__content{width:66.66%;padding-left:15px;float:left}}.govuk-header__menu-button{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;display:none;position:absolute;top:20px;right:0;margin:0;padding:0;border:0;color:#fff;background:none;cursor:pointer}@media print{.govuk-header__menu-button{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__menu-button{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-header__menu-button{font-size:14pt;line-height:1.2}}.govuk-header__menu-button:hover{-webkit-text-decoration:solid underline 3px;text-decoration:solid underline 3px;text-underline-offset:.1578em}.govuk-header__menu-button:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-header__menu-button:after{display:inline-block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(0% 0%,50% 100%,100% 0%);clip-path:polygon(0% 0%,50% 100%,100% 0%);border-width:8.66px 5px 0 5px;border-top-color:inherit;content:"";margin-left:5px}.govuk-header__menu-button[aria-expanded=true]:after{display:inline-block;width:0;height:0;border-style:solid;border-color:transparent;-webkit-clip-path:polygon(50% 0%,0% 100%,100% 100%);clip-path:polygon(50% 0%,0% 100%,100% 100%);border-width:0 5px 8.66px 5px;border-bottom-color:inherit}@media (min-width: 40.0625em){.govuk-header__menu-button{top:15px}}.js-enabled .govuk-header__menu-button{display:block}.govuk-header__menu-button[hidden],.js-enabled .govuk-header__menu-button[hidden]{display:none}@media (min-width: 48.0625em){.govuk-header__navigation{margin-bottom:10px}}.govuk-header__navigation-list{margin:0;padding:0;list-style:none}.govuk-header__navigation-list[hidden]{display:none}@media (min-width: 48.0625em){.govuk-header__navigation--end{margin:0;padding:5px 0;text-align:right}}.govuk-header__navigation--no-service-name{padding-top:40px}.govuk-header__navigation-item{padding:10px 0;border-bottom:1px solid #2e3133}@media (min-width: 48.0625em){.govuk-header__navigation-item{display:inline-block;margin-right:15px;padding:5px 0;border:0}}.govuk-header__navigation-item a{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:14px;font-size:.875rem;line-height:1.1428571429;white-space:nowrap}@media print{.govuk-header__navigation-item a{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-header__navigation-item a{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-header__navigation-item a{font-size:14pt;line-height:1.2}}.govuk-header__navigation-item--active a:link,.govuk-header__navigation-item--active a:hover,.govuk-header__navigation-item--active a:visited{color:#1d8feb}@media print{.govuk-header__navigation-item--active a{color:#1d70b8}}.govuk-header__navigation-item--active a:focus{color:#0b0c0c}.govuk-header__navigation-item:last-child{margin-right:0;border-bottom:0}@media print{.govuk-header{border-bottom-width:0;color:#0b0c0c;background:transparent}.govuk-header__logotype-crown-fallback-image{display:none}.govuk-header__link:link,.govuk-header__link:visited{color:#0b0c0c}.govuk-header__link:after{display:none}}.govuk-inset-text{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;padding:15px;margin-top:20px;margin-bottom:20px;clear:both;border-left:10px solid #b1b4b6}@media print{.govuk-inset-text{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-inset-text{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-inset-text{font-size:14pt;line-height:1.15}}@media print{.govuk-inset-text{color:#000}}@media (min-width: 40.0625em){.govuk-inset-text{margin-top:30px}}@media (min-width: 40.0625em){.govuk-inset-text{margin-bottom:30px}}.govuk-inset-text>:first-child{margin-top:0}.govuk-inset-text>:only-child,.govuk-inset-text>:last-child{margin-bottom:0}.govuk-notification-banner{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-bottom:30px;border:5px solid #1d70b8;background-color:#1d70b8}@media print{.govuk-notification-banner{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-notification-banner{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-notification-banner{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-notification-banner{margin-bottom:50px}}.govuk-notification-banner:focus{outline:3px solid #ffdd00}.govuk-notification-banner__header{padding:2px 15px 5px;border-bottom:1px solid transparent}@media (min-width: 40.0625em){.govuk-notification-banner__header{padding:2px 20px 5px}}.govuk-notification-banner__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;margin:0;padding:0;color:#fff}@media print{.govuk-notification-banner__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-notification-banner__title{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-notification-banner__title{font-size:14pt;line-height:1.15}}.govuk-notification-banner__content{color:#0b0c0c;padding:15px;background-color:#fff}@media print{.govuk-notification-banner__content{color:#000}}@media (min-width: 40.0625em){.govuk-notification-banner__content{padding:20px}}.govuk-notification-banner__content>*{box-sizing:border-box;max-width:605px}.govuk-notification-banner__content>:last-child{margin-bottom:0}.govuk-notification-banner__heading{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin:0 0 15px;padding:0}@media print{.govuk-notification-banner__heading{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-notification-banner__heading{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-notification-banner__heading{font-size:18pt;line-height:1.15}}.govuk-notification-banner__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline}@media print{.govuk-notification-banner__link{font-family:sans-serif}}.govuk-notification-banner__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-notification-banner__link:link,.govuk-notification-banner__link:visited{color:#1d70b8}.govuk-notification-banner__link:hover{color:#003078}.govuk-notification-banner__link:active{color:#0b0c0c}.govuk-notification-banner__link:focus{color:#0b0c0c}.govuk-notification-banner--success{border-color:#00703c;background-color:#00703c}.govuk-notification-banner--success .govuk-notification-banner__link:link,.govuk-notification-banner--success .govuk-notification-banner__link:visited{color:#00703c}.govuk-notification-banner--success .govuk-notification-banner__link:hover{color:#004e2a}.govuk-notification-banner--success .govuk-notification-banner__link:active{color:#00703c}.govuk-notification-banner--success .govuk-notification-banner__link:focus{color:#0b0c0c}.govuk-pagination{margin-bottom:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}@media (min-width: 40.0625em){.govuk-pagination{margin-bottom:30px}}@media (min-width: 40.0625em){.govuk-pagination{-ms-flex-direction:row;flex-direction:row;-ms-flex-align:start;align-items:flex-start}}.govuk-pagination__list{margin:0;padding:0;list-style:none}.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;position:relative;min-width:45px;min-height:45px;padding:10px 15px;float:left}@media print{.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-pagination__item,.govuk-pagination__next,.govuk-pagination__prev{font-size:14pt;line-height:1.15}}.govuk-pagination__item:hover,.govuk-pagination__next:hover,.govuk-pagination__prev:hover{background-color:#f3f2f1}.govuk-pagination__item{display:none;text-align:center}@media (min-width: 40.0625em){.govuk-pagination__item{display:block}}.govuk-pagination__prev,.govuk-pagination__next{font-weight:700}.govuk-pagination__prev .govuk-pagination__link,.govuk-pagination__next .govuk-pagination__link{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.govuk-pagination__prev{padding-left:0}.govuk-pagination__next{padding-right:0}.govuk-pagination__item--current,.govuk-pagination__item--ellipses,.govuk-pagination__item:first-child,.govuk-pagination__item:last-child{display:block}.govuk-pagination__item--current{font-weight:700;outline:1px solid transparent;background-color:#1d70b8}.govuk-pagination__item--current:hover{background-color:#1d70b8}.govuk-pagination__item--current .govuk-pagination__link:link,.govuk-pagination__item--current .govuk-pagination__link:visited{color:#fff}.govuk-pagination__item--current .govuk-pagination__link:hover,.govuk-pagination__item--current .govuk-pagination__link:active{color:#fffffffc}.govuk-pagination__item--current .govuk-pagination__link:focus{color:#0b0c0c}.govuk-pagination__item--ellipses{font-weight:700;color:#505a5f}.govuk-pagination__item--ellipses:hover{background-color:transparent}.govuk-pagination__link{display:block;min-width:15px}@media screen{.govuk-pagination__link:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}}.govuk-pagination__link:hover .govuk-pagination__link-title--decorated,.govuk-pagination__link:active .govuk-pagination__link-title--decorated{text-decoration:underline}.govuk-pagination__link:focus .govuk-pagination__icon{color:#0b0c0c}.govuk-pagination__link:focus .govuk-pagination__link-label{text-decoration:none}.govuk-pagination__link:focus .govuk-pagination__link-title--decorated{text-decoration:none}.govuk-pagination__link-label{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;text-decoration:underline;display:inline-block;padding-left:30px}@media print{.govuk-pagination__link-label{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-pagination__link-label{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-pagination__link-label{font-size:14pt;line-height:1.15}}.govuk-pagination__icon{width:.9375rem;height:.8125rem;color:#505a5f;fill:currentcolor;forced-color-adjust:auto}.govuk-pagination__icon--prev{margin-right:15px}.govuk-pagination__icon--next{margin-left:15px}.govuk-pagination--block{display:block}.govuk-pagination--block .govuk-pagination__item{padding:15px;float:none}.govuk-pagination--block .govuk-pagination__next,.govuk-pagination--block .govuk-pagination__prev{padding-left:0;float:none}.govuk-pagination--block .govuk-pagination__next{padding-right:15px}.govuk-pagination--block .govuk-pagination__next .govuk-pagination__icon{margin-left:0}.govuk-pagination--block .govuk-pagination__prev+.govuk-pagination__next{border-top:1px solid #b1b4b6}.govuk-pagination--block .govuk-pagination__link,.govuk-pagination--block .govuk-pagination__link-title{display:inline}.govuk-pagination--block .govuk-pagination__link-title:after{content:"";display:block}.govuk-pagination--block .govuk-pagination__link{text-align:left}.govuk-pagination--block .govuk-pagination__link:focus .govuk-pagination__link-label{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-pagination--block .govuk-pagination__link:not(:focus){text-decoration:none}.govuk-pagination--block .govuk-pagination__icon{margin-right:10px}.govuk-panel{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;margin-bottom:15px;padding:35px;border:5px solid transparent;text-align:center}@media print{.govuk-panel{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-panel{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-panel{font-size:14pt;line-height:1.15}}@media (max-width: 40.0525em){.govuk-panel{padding:10px;overflow-wrap:break-word;word-wrap:break-word}}.govuk-panel--confirmation{color:#fff;background:#00703c}@media print{.govuk-panel--confirmation{border-color:currentcolor;color:#000;background:none}}.govuk-panel__title{margin-top:0;margin-bottom:30px;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375}@media print{.govuk-panel__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-panel__title{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-panel__title{font-size:32pt;line-height:1.15}}.govuk-panel__title:last-child{margin-bottom:0}.govuk-panel__body{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:24px;font-size:1.5rem;line-height:1.0416666667}@media print{.govuk-panel__body{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-panel__body{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-panel__body{font-size:24pt;line-height:1.05}}.govuk-tag{display:inline-block;outline:2px solid transparent;outline-offset:-2px;color:#fff;background-color:#1d70b8;letter-spacing:1px;text-decoration:none;text-transform:uppercase;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:14px;font-size:.875rem;line-height:1;padding:5px 8px 4px}@media print{.govuk-tag{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-tag{font-size:16px;font-size:1rem;line-height:1}}@media print{.govuk-tag{font-size:14pt;line-height:1}}.govuk-tag--grey{color:#383f43;background:#eeefef}.govuk-tag--purple{color:#3d2375;background:#dbd5e9}.govuk-tag--turquoise{color:#10403c;background:#bfe3e0}.govuk-tag--blue{color:#144e81;background:#d2e2f1}.govuk-tag--yellow{color:#594d00;background:#fff7bf}.govuk-tag--orange{color:#6e3619;background:#fcd6c3}.govuk-tag--red{color:#942514;background:#f6d7d2}.govuk-tag--pink{color:#80224d;background:#f7d7e6}.govuk-tag--green{color:#005a30;background:#cce2d8}.govuk-phase-banner{padding-top:10px;padding-bottom:10px;border-bottom:1px solid #b1b4b6}.govuk-phase-banner__content{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;color:#0b0c0c;display:table;margin:0}@media print{.govuk-phase-banner__content{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-phase-banner__content{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-phase-banner__content{font-size:14pt;line-height:1.2}}@media print{.govuk-phase-banner__content{color:#000}}.govuk-phase-banner__content__tag{margin-right:10px}.govuk-phase-banner__text{display:table-cell;vertical-align:middle}.govuk-tabs{margin-top:5px;margin-bottom:20px}@media (min-width: 40.0625em){.govuk-tabs{margin-bottom:30px}}.govuk-tabs__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin-bottom:10px}@media print{.govuk-tabs__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-tabs__title{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-tabs__title{font-size:14pt;line-height:1.15}}@media print{.govuk-tabs__title{color:#000}}.govuk-tabs__list{margin:0 0 20px;padding:0;list-style:none}@media (min-width: 40.0625em){.govuk-tabs__list{margin-bottom:30px}}.govuk-tabs__list-item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-left:25px}@media print{.govuk-tabs__list-item{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-tabs__list-item{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-tabs__list-item{font-size:14pt;line-height:1.15}}.govuk-tabs__list-item:before{color:#0b0c0c;content:"—";margin-left:-25px;padding-right:5px}@media print{.govuk-tabs__list-item:before{color:#000}}.govuk-tabs__tab{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;display:inline-block;margin-bottom:10px}@media print{.govuk-tabs__tab{font-family:sans-serif}}.govuk-tabs__tab:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}.govuk-tabs__tab:link{color:#1d70b8}.govuk-tabs__tab:visited{color:#4c2c92}.govuk-tabs__tab:hover{color:#003078}.govuk-tabs__tab:active{color:#0b0c0c}.govuk-tabs__tab:focus{color:#0b0c0c}.govuk-tabs__panel{margin-bottom:30px}@media (min-width: 40.0625em){.govuk-tabs__panel{margin-bottom:50px}}@media (min-width: 40.0625em){.js-enabled .govuk-tabs__list{margin-bottom:0;border-bottom:1px solid #b1b4b6}.js-enabled .govuk-tabs__list:after{content:"";display:block;clear:both}.js-enabled .govuk-tabs__title{display:none}.js-enabled .govuk-tabs__list-item{position:relative;margin-right:5px;margin-bottom:0;margin-left:0;padding:10px 20px;float:left;background-color:#f3f2f1;text-align:center}.js-enabled .govuk-tabs__list-item:before{content:none}.js-enabled .govuk-tabs__list-item--selected{position:relative;margin-top:-5px;margin-bottom:-1px;padding:14px 19px 16px;border:1px solid #b1b4b6;border-bottom:0;background-color:#fff}.js-enabled .govuk-tabs__list-item--selected .govuk-tabs__tab{text-decoration:none}.js-enabled .govuk-tabs__tab{margin-bottom:0}.js-enabled .govuk-tabs__tab:link,.js-enabled .govuk-tabs__tab:visited{color:#0b0c0c}}@media print and (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:link,.js-enabled .govuk-tabs__tab:visited{color:#000}}@media (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:hover{color:#0b0c0cfc}.js-enabled .govuk-tabs__tab:active,.js-enabled .govuk-tabs__tab:focus{color:#0b0c0c}}@media print and (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:active,.js-enabled .govuk-tabs__tab:focus{color:#000}}@media (min-width: 40.0625em){.js-enabled .govuk-tabs__tab:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.js-enabled .govuk-tabs__panel{margin-bottom:0;padding:30px 20px;border:1px solid #b1b4b6;border-top:0}.js-enabled .govuk-tabs__panel>:last-child{margin-bottom:0}.js-enabled .govuk-tabs__panel--hidden{display:none}}.govuk-radios__item{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;display:block;position:relative;min-height:40px;margin-bottom:10px;padding-left:40px;clear:left}@media print{.govuk-radios__item{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-radios__item{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-radios__item{font-size:14pt;line-height:1.15}}.govuk-radios__item:last-child,.govuk-radios__item:last-of-type{margin-bottom:0}.govuk-radios__input{cursor:pointer;position:absolute;z-index:1;top:-2px;left:-2px;width:44px;height:44px;margin:0;opacity:0}.govuk-radios__label{display:inline-block;margin-bottom:0;padding:8px 15px 5px;cursor:pointer;-ms-touch-action:manipulation;touch-action:manipulation}.govuk-radios__label:before{content:"";box-sizing:border-box;position:absolute;top:0;left:0;width:40px;height:40px;border:2px solid currentcolor;border-radius:50%;background:transparent}.govuk-radios__label:after{content:"";position:absolute;top:10px;left:10px;width:0;height:0;border:10px solid currentcolor;border-radius:50%;opacity:0;background:currentcolor}.govuk-radios__hint{display:block;padding-right:15px;padding-left:15px}.govuk-radios__input:focus+.govuk-radios__label:before{border-width:4px;outline:3px solid transparent;outline-offset:1px;box-shadow:0 0 0 4px #fd0}@media screen and (forced-colors: active),(-ms-high-contrast: active){.govuk-radios__input:focus+.govuk-radios__label:before{outline-color:Highlight}}.govuk-radios__input:checked+.govuk-radios__label:after{opacity:1}.govuk-radios__input:disabled,.govuk-radios__input:disabled+.govuk-radios__label{cursor:not-allowed}.govuk-radios__input:disabled+.govuk-radios__label,.govuk-radios__input:disabled~.govuk-hint{opacity:.5}@media (min-width: 40.0625em){.govuk-radios--inline:after{content:"";display:block;clear:both}.govuk-radios--inline .govuk-radios__item{margin-right:20px;float:left;clear:none}}.govuk-radios__divider{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;width:40px;margin-bottom:10px;text-align:center}@media print{.govuk-radios__divider{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-radios__divider{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-radios__divider{font-size:14pt;line-height:1.15}}@media print{.govuk-radios__divider{color:#000}}.govuk-radios__conditional{margin-bottom:15px;margin-left:18px;padding-left:33px;border-left:4px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-radios__conditional{margin-bottom:20px}}.js-enabled .govuk-radios__conditional--hidden{display:none}.govuk-radios__conditional>:last-child{margin-bottom:0}.govuk-radios--small .govuk-radios__item{min-height:0;margin-bottom:0;padding-left:34px;float:left}.govuk-radios--small .govuk-radios__item:after{content:"";display:block;clear:both}.govuk-radios--small .govuk-radios__input{left:-10px}.govuk-radios--small .govuk-radios__label{margin-top:-2px;padding:13px 15px 13px 1px;float:left}@media (min-width: 40.0625em){.govuk-radios--small .govuk-radios__label{padding:11px 15px 10px 1px}}.govuk-radios--small .govuk-radios__label:before{top:8px;width:24px;height:24px}.govuk-radios--small .govuk-radios__label:after{top:15px;left:7px;border-width:5px}.govuk-radios--small .govuk-radios__hint{padding:0;clear:both;pointer-events:none}.govuk-radios--small .govuk-radios__conditional{margin-left:10px;padding-left:20px;clear:both}.govuk-radios--small .govuk-radios__divider{width:24px;margin-bottom:5px}.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:not(:disabled)+.govuk-radios__label:before{box-shadow:0 0 0 10px #b1b4b6}.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:focus+.govuk-radios__label:before{box-shadow:0 0 0 4px #fd0,0 0 0 10px #b1b4b6}@media (hover: none),(pointer: coarse){.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:not(:disabled)+.govuk-radios__label:before{box-shadow:initial}.govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:focus+.govuk-radios__label:before{box-shadow:0 0 0 4px #fd0}}.govuk-select{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;box-sizing:border-box;min-width:11.5em;max-width:100%;height:40px;height:2.5rem;padding:5px;border:2px solid #0b0c0c;color:#0b0c0c;background-color:#fff}@media print{.govuk-select{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-select{font-size:19px;font-size:1.1875rem;line-height:1.25}}@media print{.govuk-select{font-size:14pt;line-height:1.25}}.govuk-select:focus{outline:3px solid #ffdd00;outline-offset:0;box-shadow:inset 0 0 0 2px}.govuk-select:disabled{opacity:.5;color:inherit;cursor:not-allowed}.govuk-select option:active,.govuk-select option:checked,.govuk-select:focus::-ms-value{color:#fff;background-color:#1d70b8}.govuk-select--error{border-color:#d4351c}.govuk-select--error:focus{border-color:#0b0c0c}.govuk-skip-link{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;font-size:14px;font-size:.875rem;line-height:1.1428571429;display:block;padding:10px 15px}.govuk-skip-link:active,.govuk-skip-link:focus{position:static!important;width:auto!important;height:auto!important;margin:inherit!important;overflow:visible!important;clip:auto!important;-webkit-clip-path:none!important;clip-path:none!important;white-space:inherit!important}@media print{.govuk-skip-link{font-family:sans-serif}}.govuk-skip-link:link,.govuk-skip-link:visited{color:#0b0c0c}@media print{.govuk-skip-link:link,.govuk-skip-link:visited{color:#000}}.govuk-skip-link:hover{color:#0b0c0cfc}.govuk-skip-link:active,.govuk-skip-link:focus{color:#0b0c0c}@media print{.govuk-skip-link:active,.govuk-skip-link:focus{color:#000}}@media (min-width: 40.0625em){.govuk-skip-link{font-size:16px;font-size:1rem;line-height:1.25}}@media print{.govuk-skip-link{font-size:14pt;line-height:1.2}}@supports (padding: max(0px)){.govuk-skip-link{padding-right:max(15px,calc(15px + env(safe-area-inset-right)));padding-left:max(15px,calc(15px + env(safe-area-inset-left)))}}.govuk-skip-link:focus{outline:3px solid #ffdd00;outline-offset:0;background-color:#fd0}.govuk-skip-link-focused-element:focus{outline:none}.govuk-summary-list{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;margin:0 0 20px}@media print{.govuk-summary-list{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-summary-list{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-summary-list{font-size:14pt;line-height:1.15}}@media print{.govuk-summary-list{color:#000}}@media (min-width: 40.0625em){.govuk-summary-list{display:table;width:100%;table-layout:fixed;border-collapse:collapse}}@media (min-width: 40.0625em){.govuk-summary-list{margin-bottom:30px}}.govuk-summary-list__row{border-bottom:1px solid #b1b4b6}@media (max-width: 40.0525em){.govuk-summary-list__row{margin-bottom:15px}}@media (min-width: 40.0625em){.govuk-summary-list__row{display:table-row}}.govuk-summary-list__row:not(.govuk-summary-list__row--no-actions)>:last-child{padding-right:0}@media (min-width: 40.0625em){.govuk-summary-list__row--no-actions:after{content:"";display:table-cell;width:20%}}.govuk-summary-list__key,.govuk-summary-list__value,.govuk-summary-list__actions{margin:0}@media (min-width: 40.0625em){.govuk-summary-list__key,.govuk-summary-list__value,.govuk-summary-list__actions{display:table-cell;padding-top:10px;padding-right:20px;padding-bottom:10px}}.govuk-summary-list__actions{margin-bottom:15px}@media (min-width: 40.0625em){.govuk-summary-list__actions{width:20%;padding-right:0;text-align:right}}.govuk-summary-list__key,.govuk-summary-list__value{word-wrap:break-word;overflow-wrap:break-word}.govuk-summary-list__key{margin-bottom:5px;font-weight:700}@media (min-width: 40.0625em){.govuk-summary-list__key{width:30%}}@media (max-width: 40.0525em){.govuk-summary-list__value{margin-bottom:15px}}.govuk-summary-list__value>p{margin-bottom:10px}.govuk-summary-list__value>:last-child{margin-bottom:0}.govuk-summary-list__actions-list{width:100%;margin:0;padding:0}.govuk-summary-list__actions-list-item{display:inline-block}@media (max-width: 40.0525em){.govuk-summary-list__actions-list-item{margin-right:10px;padding-right:10px}.govuk-summary-list__actions-list-item:not(:last-child){border-right:1px solid #b1b4b6}.govuk-summary-list__actions-list-item:last-child{margin-right:0;padding-right:0;border:0}}@media (min-width: 40.0625em){.govuk-summary-list__actions-list-item{margin-left:10px;padding-left:10px}.govuk-summary-list__actions-list-item:not(:first-child){border-left:1px solid #b1b4b6}.govuk-summary-list__actions-list-item:first-child{margin-left:0;padding-left:0;border:0}}.govuk-summary-list--no-border .govuk-summary-list__row{border:0}@media (min-width: 40.0625em){.govuk-summary-list--no-border .govuk-summary-list__key,.govuk-summary-list--no-border .govuk-summary-list__value,.govuk-summary-list--no-border .govuk-summary-list__actions{padding-bottom:11px}}.govuk-summary-list__row--no-border{border:0}@media (min-width: 40.0625em){.govuk-summary-list__row--no-border .govuk-summary-list__key,.govuk-summary-list__row--no-border .govuk-summary-list__value,.govuk-summary-list__row--no-border .govuk-summary-list__actions{padding-bottom:11px}}.govuk-summary-card{margin-bottom:20px;border:1px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-summary-card{margin-bottom:30px}}.govuk-summary-card__title-wrapper{padding:15px;border-bottom:1px solid transparent;background-color:#f3f2f1}@media (min-width: 40.0625em){.govuk-summary-card__title-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:nowrap;flex-wrap:nowrap;padding:15px 20px}}.govuk-summary-card__title{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;margin:5px 20px 10px 0}@media print{.govuk-summary-card__title{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-summary-card__title{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-summary-card__title{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-summary-card__title{margin-bottom:5px}}.govuk-summary-card__actions{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;row-gap:10px;margin:5px 0;padding:0;list-style:none}@media print{.govuk-summary-card__actions{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-summary-card__actions{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-summary-card__actions{font-size:14pt;line-height:1.15}}@media (min-width: 40.0625em){.govuk-summary-card__actions{-ms-flex-pack:right;justify-content:right;text-align:right}}.govuk-summary-card__action{display:inline;margin:0 10px 0 0;padding-right:10px;border-right:1px solid #b1b4b6}@media (min-width: 40.0625em){.govuk-summary-card__action{margin-right:0}}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.govuk-summary-card__action{margin-bottom:5px}}.govuk-summary-card__action:last-child{margin:0;padding-right:0;border-right:none}@media (min-width: 40.0625em){.govuk-summary-card__action:last-child{padding-left:10px}}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.govuk-summary-card__action:last-child{margin-bottom:0}}.govuk-summary-card__content{padding:15px 15px 0}@media (min-width: 40.0625em){.govuk-summary-card__content{padding:15px 20px}}.govuk-summary-card__content .govuk-summary-list{margin-bottom:0}.govuk-summary-card__content .govuk-summary-list__row:last-of-type{margin-bottom:0;border-bottom:none}.govuk-table{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;width:100%;margin-bottom:20px;border-spacing:0;border-collapse:collapse}@media print{.govuk-table{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-table{font-size:14pt;line-height:1.15}}@media print{.govuk-table{color:#000}}@media (min-width: 40.0625em){.govuk-table{margin-bottom:30px}}.govuk-table__header{font-weight:700}.govuk-table__header,.govuk-table__cell{padding:10px 20px 10px 0;border-bottom:1px solid #b1b4b6;text-align:left;vertical-align:top}.govuk-table__cell--numeric{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:"tnum" 1;font-feature-settings:"tnum" 1;font-weight:400}@media print{.govuk-table__cell--numeric{font-family:sans-serif}}@supports (font-variant-numeric: tabular-nums){.govuk-table__cell--numeric{-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant-numeric:tabular-nums}}.govuk-table__header--numeric,.govuk-table__cell--numeric{text-align:right}.govuk-table__header:last-child,.govuk-table__cell:last-child{padding-right:0}.govuk-table__caption{font-weight:700;display:table-caption;text-align:left}.govuk-table__caption--xl{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:32px;font-size:2rem;line-height:1.09375;margin-bottom:15px}@media print{.govuk-table__caption--xl{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--xl{font-size:48px;font-size:3rem;line-height:1.0416666667}}@media print{.govuk-table__caption--xl{font-size:32pt;line-height:1.15}}.govuk-table__caption--l{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:24px;font-size:1.5rem;line-height:1.0416666667;margin-bottom:15px}@media print{.govuk-table__caption--l{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--l{font-size:36px;font-size:2.25rem;line-height:1.1111111111}}@media print{.govuk-table__caption--l{font-size:24pt;line-height:1.05}}.govuk-table__caption--m{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;margin-bottom:15px}@media print{.govuk-table__caption--m{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--m{font-size:24px;font-size:1.5rem;line-height:1.25}}@media print{.govuk-table__caption--m{font-size:18pt;line-height:1.15}}.govuk-table__caption--s{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25}@media print{.govuk-table__caption--s{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-table__caption--s{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-table__caption--s{font-size:14pt;line-height:1.15}}.govuk-warning-text{position:relative;margin-bottom:20px;padding:10px 0}@media (min-width: 40.0625em){.govuk-warning-text{margin-bottom:30px}}.govuk-warning-text__assistive{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;padding:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;border:0!important;white-space:nowrap!important}.govuk-warning-text__assistive:before{content:" "}.govuk-warning-text__assistive:after{content:" "}.govuk-warning-text__icon{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;box-sizing:border-box;display:inline-block;position:absolute;left:0;min-width:35px;min-height:35px;margin-top:-7px;border:3px solid #0b0c0c;border-radius:50%;color:#fff;background:#0b0c0c;font-size:30px;line-height:29px;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;forced-color-adjust:none}@media print{.govuk-warning-text__icon{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-warning-text__icon{margin-top:-5px}}@media screen and (forced-colors: active){.govuk-warning-text__icon{border-color:windowText;color:windowText;background:transparent}}.govuk-warning-text__text{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:16px;font-size:1rem;line-height:1.25;color:#0b0c0c;display:block;padding-left:45px}@media print{.govuk-warning-text__text{font-family:sans-serif}}@media (min-width: 40.0625em){.govuk-warning-text__text{font-size:19px;font-size:1.1875rem;line-height:1.3157894737}}@media print{.govuk-warning-text__text{font-size:14pt;line-height:1.15}}@media print{.govuk-warning-text__text{color:#000}}.govuk-clearfix:after{content:"";display:block;clear:both}.govuk-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;padding:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;border:0!important;white-space:nowrap!important}.govuk-visually-hidden:before{content:" "}.govuk-visually-hidden:after{content:" "}.govuk-visually-hidden-focusable{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important}.govuk-visually-hidden-focusable:active,.govuk-visually-hidden-focusable:focus{position:static!important;width:auto!important;height:auto!important;margin:inherit!important;overflow:visible!important;clip:auto!important;-webkit-clip-path:none!important;clip-path:none!important;white-space:inherit!important}.govuk-\!-display-inline{display:inline!important}.govuk-\!-display-inline-block{display:inline-block!important}.govuk-\!-display-block{display:block!important}.govuk-\!-display-none{display:none!important}@media print{.govuk-\!-display-none-print{display:none!important}}.govuk-\!-margin-0{margin:0!important}.govuk-\!-margin-top-0{margin-top:0!important}.govuk-\!-margin-right-0{margin-right:0!important}.govuk-\!-margin-bottom-0{margin-bottom:0!important}.govuk-\!-margin-left-0{margin-left:0!important}.govuk-\!-margin-1{margin:5px!important}.govuk-\!-margin-top-1{margin-top:5px!important}.govuk-\!-margin-right-1{margin-right:5px!important}.govuk-\!-margin-bottom-1{margin-bottom:5px!important}.govuk-\!-margin-left-1{margin-left:5px!important}.govuk-\!-margin-2{margin:10px!important}.govuk-\!-margin-top-2{margin-top:10px!important}.govuk-\!-margin-right-2{margin-right:10px!important}.govuk-\!-margin-bottom-2{margin-bottom:10px!important}.govuk-\!-margin-left-2{margin-left:10px!important}.govuk-\!-margin-3{margin:15px!important}.govuk-\!-margin-top-3{margin-top:15px!important}.govuk-\!-margin-right-3{margin-right:15px!important}.govuk-\!-margin-bottom-3{margin-bottom:15px!important}.govuk-\!-margin-left-3{margin-left:15px!important}.govuk-\!-margin-4{margin:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-4{margin:20px!important}}.govuk-\!-margin-top-4{margin-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-4{margin-top:20px!important}}.govuk-\!-margin-right-4{margin-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-4{margin-right:20px!important}}.govuk-\!-margin-bottom-4{margin-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-4{margin-bottom:20px!important}}.govuk-\!-margin-left-4{margin-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-4{margin-left:20px!important}}.govuk-\!-margin-5{margin:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-5{margin:25px!important}}.govuk-\!-margin-top-5{margin-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-5{margin-top:25px!important}}.govuk-\!-margin-right-5{margin-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-5{margin-right:25px!important}}.govuk-\!-margin-bottom-5{margin-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-5{margin-bottom:25px!important}}.govuk-\!-margin-left-5{margin-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-5{margin-left:25px!important}}.govuk-\!-margin-6{margin:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-6{margin:30px!important}}.govuk-\!-margin-top-6{margin-top:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-6{margin-top:30px!important}}.govuk-\!-margin-right-6{margin-right:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-6{margin-right:30px!important}}.govuk-\!-margin-bottom-6{margin-bottom:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-6{margin-bottom:30px!important}}.govuk-\!-margin-left-6{margin-left:20px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-6{margin-left:30px!important}}.govuk-\!-margin-7{margin:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-7{margin:40px!important}}.govuk-\!-margin-top-7{margin-top:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-7{margin-top:40px!important}}.govuk-\!-margin-right-7{margin-right:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-7{margin-right:40px!important}}.govuk-\!-margin-bottom-7{margin-bottom:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-7{margin-bottom:40px!important}}.govuk-\!-margin-left-7{margin-left:25px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-7{margin-left:40px!important}}.govuk-\!-margin-8{margin:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-8{margin:50px!important}}.govuk-\!-margin-top-8{margin-top:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-8{margin-top:50px!important}}.govuk-\!-margin-right-8{margin-right:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-8{margin-right:50px!important}}.govuk-\!-margin-bottom-8{margin-bottom:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-8{margin-bottom:50px!important}}.govuk-\!-margin-left-8{margin-left:30px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-8{margin-left:50px!important}}.govuk-\!-margin-9{margin:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-9{margin:60px!important}}.govuk-\!-margin-top-9{margin-top:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-top-9{margin-top:60px!important}}.govuk-\!-margin-right-9{margin-right:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-right-9{margin-right:60px!important}}.govuk-\!-margin-bottom-9{margin-bottom:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-bottom-9{margin-bottom:60px!important}}.govuk-\!-margin-left-9{margin-left:40px!important}@media (min-width: 40.0625em){.govuk-\!-margin-left-9{margin-left:60px!important}}.govuk-\!-padding-0{padding:0!important}.govuk-\!-padding-top-0{padding-top:0!important}.govuk-\!-padding-right-0{padding-right:0!important}.govuk-\!-padding-bottom-0{padding-bottom:0!important}.govuk-\!-padding-left-0{padding-left:0!important}.govuk-\!-padding-1{padding:5px!important}.govuk-\!-padding-top-1{padding-top:5px!important}.govuk-\!-padding-right-1{padding-right:5px!important}.govuk-\!-padding-bottom-1{padding-bottom:5px!important}.govuk-\!-padding-left-1{padding-left:5px!important}.govuk-\!-padding-2{padding:10px!important}.govuk-\!-padding-top-2{padding-top:10px!important}.govuk-\!-padding-right-2{padding-right:10px!important}.govuk-\!-padding-bottom-2{padding-bottom:10px!important}.govuk-\!-padding-left-2{padding-left:10px!important}.govuk-\!-padding-3{padding:15px!important}.govuk-\!-padding-top-3{padding-top:15px!important}.govuk-\!-padding-right-3{padding-right:15px!important}.govuk-\!-padding-bottom-3{padding-bottom:15px!important}.govuk-\!-padding-left-3{padding-left:15px!important}.govuk-\!-padding-4{padding:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-4{padding:20px!important}}.govuk-\!-padding-top-4{padding-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-4{padding-top:20px!important}}.govuk-\!-padding-right-4{padding-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-4{padding-right:20px!important}}.govuk-\!-padding-bottom-4{padding-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-4{padding-bottom:20px!important}}.govuk-\!-padding-left-4{padding-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-4{padding-left:20px!important}}.govuk-\!-padding-5{padding:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-5{padding:25px!important}}.govuk-\!-padding-top-5{padding-top:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-5{padding-top:25px!important}}.govuk-\!-padding-right-5{padding-right:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-5{padding-right:25px!important}}.govuk-\!-padding-bottom-5{padding-bottom:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-5{padding-bottom:25px!important}}.govuk-\!-padding-left-5{padding-left:15px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-5{padding-left:25px!important}}.govuk-\!-padding-6{padding:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-6{padding:30px!important}}.govuk-\!-padding-top-6{padding-top:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-6{padding-top:30px!important}}.govuk-\!-padding-right-6{padding-right:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-6{padding-right:30px!important}}.govuk-\!-padding-bottom-6{padding-bottom:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-6{padding-bottom:30px!important}}.govuk-\!-padding-left-6{padding-left:20px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-6{padding-left:30px!important}}.govuk-\!-padding-7{padding:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-7{padding:40px!important}}.govuk-\!-padding-top-7{padding-top:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-7{padding-top:40px!important}}.govuk-\!-padding-right-7{padding-right:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-7{padding-right:40px!important}}.govuk-\!-padding-bottom-7{padding-bottom:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-7{padding-bottom:40px!important}}.govuk-\!-padding-left-7{padding-left:25px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-7{padding-left:40px!important}}.govuk-\!-padding-8{padding:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-8{padding:50px!important}}.govuk-\!-padding-top-8{padding-top:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-8{padding-top:50px!important}}.govuk-\!-padding-right-8{padding-right:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-8{padding-right:50px!important}}.govuk-\!-padding-bottom-8{padding-bottom:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-8{padding-bottom:50px!important}}.govuk-\!-padding-left-8{padding-left:30px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-8{padding-left:50px!important}}.govuk-\!-padding-9{padding:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-9{padding:60px!important}}.govuk-\!-padding-top-9{padding-top:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-top-9{padding-top:60px!important}}.govuk-\!-padding-right-9{padding-right:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-right-9{padding-right:60px!important}}.govuk-\!-padding-bottom-9{padding-bottom:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-bottom-9{padding-bottom:60px!important}}.govuk-\!-padding-left-9{padding-left:40px!important}@media (min-width: 40.0625em){.govuk-\!-padding-left-9{padding-left:60px!important}}.govuk-\!-margin-static-0,.govuk-\!-static-margin-0{margin:0!important}.govuk-\!-margin-top-static-0,.govuk-\!-static-margin-top-0{margin-top:0!important}.govuk-\!-margin-right-static-0,.govuk-\!-static-margin-right-0{margin-right:0!important}.govuk-\!-margin-bottom-static-0,.govuk-\!-static-margin-bottom-0{margin-bottom:0!important}.govuk-\!-margin-left-static-0,.govuk-\!-static-margin-left-0{margin-left:0!important}.govuk-\!-margin-static-1,.govuk-\!-static-margin-1{margin:5px!important}.govuk-\!-margin-top-static-1,.govuk-\!-static-margin-top-1{margin-top:5px!important}.govuk-\!-margin-right-static-1,.govuk-\!-static-margin-right-1{margin-right:5px!important}.govuk-\!-margin-bottom-static-1,.govuk-\!-static-margin-bottom-1{margin-bottom:5px!important}.govuk-\!-margin-left-static-1,.govuk-\!-static-margin-left-1{margin-left:5px!important}.govuk-\!-margin-static-2,.govuk-\!-static-margin-2{margin:10px!important}.govuk-\!-margin-top-static-2,.govuk-\!-static-margin-top-2{margin-top:10px!important}.govuk-\!-margin-right-static-2,.govuk-\!-static-margin-right-2{margin-right:10px!important}.govuk-\!-margin-bottom-static-2,.govuk-\!-static-margin-bottom-2{margin-bottom:10px!important}.govuk-\!-margin-left-static-2,.govuk-\!-static-margin-left-2{margin-left:10px!important}.govuk-\!-margin-static-3,.govuk-\!-static-margin-3{margin:15px!important}.govuk-\!-margin-top-static-3,.govuk-\!-static-margin-top-3{margin-top:15px!important}.govuk-\!-margin-right-static-3,.govuk-\!-static-margin-right-3{margin-right:15px!important}.govuk-\!-margin-bottom-static-3,.govuk-\!-static-margin-bottom-3{margin-bottom:15px!important}.govuk-\!-margin-left-static-3,.govuk-\!-static-margin-left-3{margin-left:15px!important}.govuk-\!-margin-static-4,.govuk-\!-static-margin-4{margin:20px!important}.govuk-\!-margin-top-static-4,.govuk-\!-static-margin-top-4{margin-top:20px!important}.govuk-\!-margin-right-static-4,.govuk-\!-static-margin-right-4{margin-right:20px!important}.govuk-\!-margin-bottom-static-4,.govuk-\!-static-margin-bottom-4{margin-bottom:20px!important}.govuk-\!-margin-left-static-4,.govuk-\!-static-margin-left-4{margin-left:20px!important}.govuk-\!-margin-static-5,.govuk-\!-static-margin-5{margin:25px!important}.govuk-\!-margin-top-static-5,.govuk-\!-static-margin-top-5{margin-top:25px!important}.govuk-\!-margin-right-static-5,.govuk-\!-static-margin-right-5{margin-right:25px!important}.govuk-\!-margin-bottom-static-5,.govuk-\!-static-margin-bottom-5{margin-bottom:25px!important}.govuk-\!-margin-left-static-5,.govuk-\!-static-margin-left-5{margin-left:25px!important}.govuk-\!-margin-static-6,.govuk-\!-static-margin-6{margin:30px!important}.govuk-\!-margin-top-static-6,.govuk-\!-static-margin-top-6{margin-top:30px!important}.govuk-\!-margin-right-static-6,.govuk-\!-static-margin-right-6{margin-right:30px!important}.govuk-\!-margin-bottom-static-6,.govuk-\!-static-margin-bottom-6{margin-bottom:30px!important}.govuk-\!-margin-left-static-6,.govuk-\!-static-margin-left-6{margin-left:30px!important}.govuk-\!-margin-static-7,.govuk-\!-static-margin-7{margin:40px!important}.govuk-\!-margin-top-static-7,.govuk-\!-static-margin-top-7{margin-top:40px!important}.govuk-\!-margin-right-static-7,.govuk-\!-static-margin-right-7{margin-right:40px!important}.govuk-\!-margin-bottom-static-7,.govuk-\!-static-margin-bottom-7{margin-bottom:40px!important}.govuk-\!-margin-left-static-7,.govuk-\!-static-margin-left-7{margin-left:40px!important}.govuk-\!-margin-static-8,.govuk-\!-static-margin-8{margin:50px!important}.govuk-\!-margin-top-static-8,.govuk-\!-static-margin-top-8{margin-top:50px!important}.govuk-\!-margin-right-static-8,.govuk-\!-static-margin-right-8{margin-right:50px!important}.govuk-\!-margin-bottom-static-8,.govuk-\!-static-margin-bottom-8{margin-bottom:50px!important}.govuk-\!-margin-left-static-8,.govuk-\!-static-margin-left-8{margin-left:50px!important}.govuk-\!-margin-static-9,.govuk-\!-static-margin-9{margin:60px!important}.govuk-\!-margin-top-static-9,.govuk-\!-static-margin-top-9{margin-top:60px!important}.govuk-\!-margin-right-static-9,.govuk-\!-static-margin-right-9{margin-right:60px!important}.govuk-\!-margin-bottom-static-9,.govuk-\!-static-margin-bottom-9{margin-bottom:60px!important}.govuk-\!-margin-left-static-9,.govuk-\!-static-margin-left-9{margin-left:60px!important}.govuk-\!-padding-static-0,.govuk-\!-static-padding-0{padding:0!important}.govuk-\!-padding-top-static-0,.govuk-\!-static-padding-top-0{padding-top:0!important}.govuk-\!-padding-right-static-0,.govuk-\!-static-padding-right-0{padding-right:0!important}.govuk-\!-padding-bottom-static-0,.govuk-\!-static-padding-bottom-0{padding-bottom:0!important}.govuk-\!-padding-left-static-0,.govuk-\!-static-padding-left-0{padding-left:0!important}.govuk-\!-padding-static-1,.govuk-\!-static-padding-1{padding:5px!important}.govuk-\!-padding-top-static-1,.govuk-\!-static-padding-top-1{padding-top:5px!important}.govuk-\!-padding-right-static-1,.govuk-\!-static-padding-right-1{padding-right:5px!important}.govuk-\!-padding-bottom-static-1,.govuk-\!-static-padding-bottom-1{padding-bottom:5px!important}.govuk-\!-padding-left-static-1,.govuk-\!-static-padding-left-1{padding-left:5px!important}.govuk-\!-padding-static-2,.govuk-\!-static-padding-2{padding:10px!important}.govuk-\!-padding-top-static-2,.govuk-\!-static-padding-top-2{padding-top:10px!important}.govuk-\!-padding-right-static-2,.govuk-\!-static-padding-right-2{padding-right:10px!important}.govuk-\!-padding-bottom-static-2,.govuk-\!-static-padding-bottom-2{padding-bottom:10px!important}.govuk-\!-padding-left-static-2,.govuk-\!-static-padding-left-2{padding-left:10px!important}.govuk-\!-padding-static-3,.govuk-\!-static-padding-3{padding:15px!important}.govuk-\!-padding-top-static-3,.govuk-\!-static-padding-top-3{padding-top:15px!important}.govuk-\!-padding-right-static-3,.govuk-\!-static-padding-right-3{padding-right:15px!important}.govuk-\!-padding-bottom-static-3,.govuk-\!-static-padding-bottom-3{padding-bottom:15px!important}.govuk-\!-padding-left-static-3,.govuk-\!-static-padding-left-3{padding-left:15px!important}.govuk-\!-padding-static-4,.govuk-\!-static-padding-4{padding:20px!important}.govuk-\!-padding-top-static-4,.govuk-\!-static-padding-top-4{padding-top:20px!important}.govuk-\!-padding-right-static-4,.govuk-\!-static-padding-right-4{padding-right:20px!important}.govuk-\!-padding-bottom-static-4,.govuk-\!-static-padding-bottom-4{padding-bottom:20px!important}.govuk-\!-padding-left-static-4,.govuk-\!-static-padding-left-4{padding-left:20px!important}.govuk-\!-padding-static-5,.govuk-\!-static-padding-5{padding:25px!important}.govuk-\!-padding-top-static-5,.govuk-\!-static-padding-top-5{padding-top:25px!important}.govuk-\!-padding-right-static-5,.govuk-\!-static-padding-right-5{padding-right:25px!important}.govuk-\!-padding-bottom-static-5,.govuk-\!-static-padding-bottom-5{padding-bottom:25px!important}.govuk-\!-padding-left-static-5,.govuk-\!-static-padding-left-5{padding-left:25px!important}.govuk-\!-padding-static-6,.govuk-\!-static-padding-6{padding:30px!important}.govuk-\!-padding-top-static-6,.govuk-\!-static-padding-top-6{padding-top:30px!important}.govuk-\!-padding-right-static-6,.govuk-\!-static-padding-right-6{padding-right:30px!important}.govuk-\!-padding-bottom-static-6,.govuk-\!-static-padding-bottom-6{padding-bottom:30px!important}.govuk-\!-padding-left-static-6,.govuk-\!-static-padding-left-6{padding-left:30px!important}.govuk-\!-padding-static-7,.govuk-\!-static-padding-7{padding:40px!important}.govuk-\!-padding-top-static-7,.govuk-\!-static-padding-top-7{padding-top:40px!important}.govuk-\!-padding-right-static-7,.govuk-\!-static-padding-right-7{padding-right:40px!important}.govuk-\!-padding-bottom-static-7,.govuk-\!-static-padding-bottom-7{padding-bottom:40px!important}.govuk-\!-padding-left-static-7,.govuk-\!-static-padding-left-7{padding-left:40px!important}.govuk-\!-padding-static-8,.govuk-\!-static-padding-8{padding:50px!important}.govuk-\!-padding-top-static-8,.govuk-\!-static-padding-top-8{padding-top:50px!important}.govuk-\!-padding-right-static-8,.govuk-\!-static-padding-right-8{padding-right:50px!important}.govuk-\!-padding-bottom-static-8,.govuk-\!-static-padding-bottom-8{padding-bottom:50px!important}.govuk-\!-padding-left-static-8,.govuk-\!-static-padding-left-8{padding-left:50px!important}.govuk-\!-padding-static-9,.govuk-\!-static-padding-9{padding:60px!important}.govuk-\!-padding-top-static-9,.govuk-\!-static-padding-top-9{padding-top:60px!important}.govuk-\!-padding-right-static-9,.govuk-\!-static-padding-right-9{padding-right:60px!important}.govuk-\!-padding-bottom-static-9,.govuk-\!-static-padding-bottom-9{padding-bottom:60px!important}.govuk-\!-padding-left-static-9,.govuk-\!-static-padding-left-9{padding-left:60px!important}.govuk-\!-text-align-left{text-align:left!important}.govuk-\!-text-align-centre{text-align:center!important}.govuk-\!-text-align-right{text-align:right!important}.govuk-\!-font-size-80{font-size:53px!important;font-size:3.3125rem!important;line-height:1.0377358491!important}@media (min-width: 40.0625em){.govuk-\!-font-size-80{font-size:80px!important;font-size:5rem!important;line-height:1!important}}@media print{.govuk-\!-font-size-80{font-size:53pt!important;line-height:1.1!important}}.govuk-\!-font-size-48{font-size:32px!important;font-size:2rem!important;line-height:1.09375!important}@media (min-width: 40.0625em){.govuk-\!-font-size-48{font-size:48px!important;font-size:3rem!important;line-height:1.0416666667!important}}@media print{.govuk-\!-font-size-48{font-size:32pt!important;line-height:1.15!important}}.govuk-\!-font-size-36{font-size:24px!important;font-size:1.5rem!important;line-height:1.0416666667!important}@media (min-width: 40.0625em){.govuk-\!-font-size-36{font-size:36px!important;font-size:2.25rem!important;line-height:1.1111111111!important}}@media print{.govuk-\!-font-size-36{font-size:24pt!important;line-height:1.05!important}}.govuk-\!-font-size-27{font-size:18px!important;font-size:1.125rem!important;line-height:1.1111111111!important}@media (min-width: 40.0625em){.govuk-\!-font-size-27{font-size:27px!important;font-size:1.6875rem!important;line-height:1.1111111111!important}}@media print{.govuk-\!-font-size-27{font-size:18pt!important;line-height:1.15!important}}.govuk-\!-font-size-24{font-size:18px!important;font-size:1.125rem!important;line-height:1.1111111111!important}@media (min-width: 40.0625em){.govuk-\!-font-size-24{font-size:24px!important;font-size:1.5rem!important;line-height:1.25!important}}@media print{.govuk-\!-font-size-24{font-size:18pt!important;line-height:1.15!important}}.govuk-\!-font-size-19{font-size:16px!important;font-size:1rem!important;line-height:1.25!important}@media (min-width: 40.0625em){.govuk-\!-font-size-19{font-size:19px!important;font-size:1.1875rem!important;line-height:1.3157894737!important}}@media print{.govuk-\!-font-size-19{font-size:14pt!important;line-height:1.15!important}}.govuk-\!-font-size-16{font-size:14px!important;font-size:.875rem!important;line-height:1.1428571429!important}@media (min-width: 40.0625em){.govuk-\!-font-size-16{font-size:16px!important;font-size:1rem!important;line-height:1.25!important}}@media print{.govuk-\!-font-size-16{font-size:14pt!important;line-height:1.2!important}}.govuk-\!-font-size-14{font-size:12px!important;font-size:.75rem!important;line-height:1.25!important}@media (min-width: 40.0625em){.govuk-\!-font-size-14{font-size:14px!important;font-size:.875rem!important;line-height:1.4285714286!important}}@media print{.govuk-\!-font-size-14{font-size:12pt!important;line-height:1.2!important}}.govuk-\!-font-weight-regular{font-weight:400!important}.govuk-\!-font-weight-bold{font-weight:700!important}.govuk-\!-width-full,.govuk-\!-width-three-quarters{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-three-quarters{width:75%!important}}.govuk-\!-width-two-thirds{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-two-thirds{width:66.66%!important}}.govuk-\!-width-one-half{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-one-half{width:50%!important}}.govuk-\!-width-one-third{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-one-third{width:33.33%!important}}.govuk-\!-width-one-quarter{width:100%!important}@media (min-width: 40.0625em){.govuk-\!-width-one-quarter{width:25%!important}} diff --git a/browse_dropdown_filters/assets/all-b6f1cdfd.js b/capitalize_auto_form/assets/all-ad91baca.js similarity index 100% rename from browse_dropdown_filters/assets/all-b6f1cdfd.js rename to capitalize_auto_form/assets/all-ad91baca.js diff --git a/browse_dropdown_filters/assets/authorities-80e824dc.geojson b/capitalize_auto_form/assets/authorities-80e824dc.geojson similarity index 100% rename from browse_dropdown_filters/assets/authorities-80e824dc.geojson rename to capitalize_auto_form/assets/authorities-80e824dc.geojson diff --git a/browse_dropdown_filters/assets/edit_attributes-29b396e1.svg b/capitalize_auto_form/assets/edit_attributes-29b396e1.svg similarity index 100% rename from browse_dropdown_filters/assets/edit_attributes-29b396e1.svg rename to capitalize_auto_form/assets/edit_attributes-29b396e1.svg diff --git a/browse_dropdown_filters/assets/edit_geometry-02dad294.svg b/capitalize_auto_form/assets/edit_geometry-02dad294.svg similarity index 100% rename from browse_dropdown_filters/assets/edit_geometry-02dad294.svg rename to capitalize_auto_form/assets/edit_geometry-02dad294.svg diff --git a/browse_dropdown_filters/assets/fonts/bold-affa96571d-v2.woff b/capitalize_auto_form/assets/fonts/bold-affa96571d-v2.woff similarity index 100% rename from browse_dropdown_filters/assets/fonts/bold-affa96571d-v2.woff rename to capitalize_auto_form/assets/fonts/bold-affa96571d-v2.woff diff --git a/browse_dropdown_filters/assets/fonts/bold-b542beb274-v2.woff2 b/capitalize_auto_form/assets/fonts/bold-b542beb274-v2.woff2 similarity index 100% rename from browse_dropdown_filters/assets/fonts/bold-b542beb274-v2.woff2 rename to capitalize_auto_form/assets/fonts/bold-b542beb274-v2.woff2 diff --git a/browse_dropdown_filters/assets/fonts/light-94a07e06a1-v2.woff2 b/capitalize_auto_form/assets/fonts/light-94a07e06a1-v2.woff2 similarity index 100% rename from browse_dropdown_filters/assets/fonts/light-94a07e06a1-v2.woff2 rename to capitalize_auto_form/assets/fonts/light-94a07e06a1-v2.woff2 diff --git a/browse_dropdown_filters/assets/fonts/light-f591b13f7d-v2.woff b/capitalize_auto_form/assets/fonts/light-f591b13f7d-v2.woff similarity index 100% rename from browse_dropdown_filters/assets/fonts/light-f591b13f7d-v2.woff rename to capitalize_auto_form/assets/fonts/light-f591b13f7d-v2.woff diff --git a/browse_dropdown_filters/assets/help-d011708a.svg b/capitalize_auto_form/assets/help-d011708a.svg similarity index 100% rename from browse_dropdown_filters/assets/help-d011708a.svg rename to capitalize_auto_form/assets/help-d011708a.svg diff --git a/browse_dropdown_filters/assets/images/favicon.ico b/capitalize_auto_form/assets/images/favicon.ico similarity index 100% rename from browse_dropdown_filters/assets/images/favicon.ico rename to capitalize_auto_form/assets/images/favicon.ico diff --git a/browse_dropdown_filters/assets/images/govuk-apple-touch-icon-152x152.png b/capitalize_auto_form/assets/images/govuk-apple-touch-icon-152x152.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-apple-touch-icon-152x152.png rename to capitalize_auto_form/assets/images/govuk-apple-touch-icon-152x152.png diff --git a/browse_dropdown_filters/assets/images/govuk-apple-touch-icon-167x167.png b/capitalize_auto_form/assets/images/govuk-apple-touch-icon-167x167.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-apple-touch-icon-167x167.png rename to capitalize_auto_form/assets/images/govuk-apple-touch-icon-167x167.png diff --git a/browse_dropdown_filters/assets/images/govuk-apple-touch-icon-180x180.png b/capitalize_auto_form/assets/images/govuk-apple-touch-icon-180x180.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-apple-touch-icon-180x180.png rename to capitalize_auto_form/assets/images/govuk-apple-touch-icon-180x180.png diff --git a/browse_dropdown_filters/assets/images/govuk-apple-touch-icon.png b/capitalize_auto_form/assets/images/govuk-apple-touch-icon.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-apple-touch-icon.png rename to capitalize_auto_form/assets/images/govuk-apple-touch-icon.png diff --git a/browse_dropdown_filters/assets/images/govuk-crest-2x.png b/capitalize_auto_form/assets/images/govuk-crest-2x.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-crest-2x.png rename to capitalize_auto_form/assets/images/govuk-crest-2x.png diff --git a/browse_dropdown_filters/assets/images/govuk-crest.png b/capitalize_auto_form/assets/images/govuk-crest.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-crest.png rename to capitalize_auto_form/assets/images/govuk-crest.png diff --git a/browse_dropdown_filters/assets/images/govuk-logotype-crown.png b/capitalize_auto_form/assets/images/govuk-logotype-crown.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-logotype-crown.png rename to capitalize_auto_form/assets/images/govuk-logotype-crown.png diff --git a/browse_dropdown_filters/assets/images/govuk-mask-icon.svg b/capitalize_auto_form/assets/images/govuk-mask-icon.svg similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-mask-icon.svg rename to capitalize_auto_form/assets/images/govuk-mask-icon.svg diff --git a/browse_dropdown_filters/assets/images/govuk-opengraph-image.png b/capitalize_auto_form/assets/images/govuk-opengraph-image.png similarity index 100% rename from browse_dropdown_filters/assets/images/govuk-opengraph-image.png rename to capitalize_auto_form/assets/images/govuk-opengraph-image.png diff --git a/browse_dropdown_filters/assets/index-46d9c0d7.css b/capitalize_auto_form/assets/index-46d9c0d7.css similarity index 100% rename from browse_dropdown_filters/assets/index-46d9c0d7.css rename to capitalize_auto_form/assets/index-46d9c0d7.css diff --git a/capitalize_auto_form/assets/main-bb9cdfa7.js b/capitalize_auto_form/assets/main-bb9cdfa7.js new file mode 100644 index 000000000..2e3a822f3 --- /dev/null +++ b/capitalize_auto_form/assets/main-bb9cdfa7.js @@ -0,0 +1 @@ +import{S as X,i as Y,s as x,c as we,a as Q,e as b,b as ue,d as I,l as H,u as ye,g as $e,f as Ae,h as Se,t as M,j as F,k as T,m as re,n as ve,o as fe,p as P,q as y,r as h,v as _,w as ee,x as ce,y as Ee,z as Me,A as W,B as Be,C as Fe,F as Ie,D as Z,E as de,G as Te,H as j,I as C,J as Le,K as _e,L as J,M as Ne,N as je,O as Ce,P as Je,Q as Oe}from"./maplibre_helpers-09c65b90.js";import{i as De}from"./all-ad91baca.js";import{a as Pe,A as Ge}from"./About-1025697f.js";function qe(n){let t,e,l,u;const c=n[2].default,s=we(c,n,n[1],null);let f=[{type:"button"},{class:"govuk-button"},{"data-module":"govuk-button"},n[0]],i={};for(let o=0;o{e(0,t=Q(Q({},t),re(s))),"$$scope"in s&&e(1,u=s.$$scope)},t=re(t),[t,u,l,c]}class Ue extends X{constructor(t){super(),Y(this,t,Re,qe,x,{})}}function he(n,t,e){const l=n.slice();return l[7]=t[e][0],l[8]=t[e][1],l}function pe(n){let t,e,l,u,c=!1,s,f,i=n[8]+"",o,a,d,B,L,$;return B=Me(n[6][0]),{c(){t=b("div"),e=b("input"),s=y(),f=b("label"),o=P(i),d=y(),h(e,"class","govuk-radios__input"),h(e,"id",l=n[2]+n[7]),h(e,"type","radio"),e.__value=u=n[7],W(e,e.__value),h(f,"class","govuk-label govuk-radios__label"),h(f,"for",a=n[2]+n[7]),h(t,"class","govuk-radios__item"),B.p(e)},m(v,E){I(v,t,E),_(t,e),e.checked=e.__value===n[0],_(t,s),_(t,f),_(f,o),_(t,d),L||($=[H(e,"change",n[5]),H(e,"change",n[4])],L=!0)},p(v,E){E&12&&l!==(l=v[2]+v[7])&&h(e,"id",l),E&8&&u!==(u=v[7])&&(e.__value=u,W(e,e.__value),c=!0),(c||E&9)&&(e.checked=e.__value===v[0]),E&8&&i!==(i=v[8]+"")&&ee(o,i),E&12&&a!==(a=v[2]+v[7])&&h(f,"for",a)},d(v){v&&T(t),B.r(),L=!1,Be($)}}}function Ve(n){let t,e,l,u,c,s,f=fe(n[3]),i=[];for(let o=0;o{"legend"in a&&e(1,l=a.legend),"id"in a&&e(2,u=a.id),"choices"in a&&e(3,c=a.choices),"value"in a&&e(0,s=a.value)},[s,l,u,c,i,o,f]}class We extends X{constructor(t){super(),Y(this,t,He,Ve,x,{legend:1,id:2,choices:3,value:0})}}async function ze(){const t=await(await fetch(Pe)).text();return JSON.parse(t)}function Ke(n){let t;return{c(){t=P("About")},m(e,l){I(e,t,l)},d(e){e&&T(t)}}}function ge(n){let t,e;return t=new je({props:{errorMessage:n[2]}}),{c(){j(t.$$.fragment)},m(l,u){C(t,l,u),e=!0},p(l,u){const c={};u&4&&(c.errorMessage=l[2]),t.$set(c)},i(l){e||(M(t.$$.fragment,l),e=!0)},o(l){F(t.$$.fragment,l),e=!1},d(l){J(t,l)}}}function Qe(n){let t,e,l,u,c;return{c(){t=b("input"),e=y(),l=b("datalist"),h(t,"class","govuk-input govuk-input--width-20"),h(t,"id","inputValue"),h(t,"data-testid","transport-authority"),h(t,"list","authorities-list"),h(l,"id","authorities-list")},m(s,f){I(s,t,f),W(t,n[0]),I(s,e,f),I(s,l,f),n[12](l),u||(c=H(t,"input",n[11]),u=!0)},p(s,f){f&1&&t.value!==s[0]&&W(t,s[0])},d(s){s&&(T(t),T(e),T(l)),n[12](null),u=!1,c()}}}function Ze(n){let t;return{c(){t=P("Start")},m(e,l){I(e,t,l)},d(e){e&&T(t)}}}function me(n){let t,e;return{c(){t=b("i"),e=P(n[5])},m(l,u){I(l,t,u),_(t,e)},p(l,u){u&32&&ee(e,l[5])},d(l){l&&T(t)}}}function Xe(n){let t,e,l,u,c,s,f,i,o,a,d,B,L,$,v,E,O,G,q,R,p,g,N,k,S,z,U;c=new Fe({props:{$$slots:{default:[Ke]},$$scope:{ctx:n}}}),c.$on("click",n[10]);let m=n[2]&&ge(n);i=new Ie({props:{label:"Select Transport Authority or Local Authority District",id:"inputValue",$$slots:{default:[Qe]},$$scope:{ctx:n}}}),a=new Ue({props:{disabled:!n[6],$$slots:{default:[Ze]},$$scope:{ctx:n}}}),a.$on("click",n[9]);function be(r){n[13](r)}let te={legend:"Or pick from the map",id:"showBoundaries",choices:[["TA","Transport Authorities"],["LAD","Local Authority Districts"]]};n[4]!==void 0&&(te.value=n[4]),$=new We({props:te}),Z.push(()=>de($,"value",be)),$.$on("change",n[7]);let A=n[5]&&me(n),ne=Ye;p=new Te({props:{label:"Or upload an ATIP GeoJSON file",loadFile:n[8],id:"load-geojson"}});function ke(r){n[14](r)}let le={};return n[1]!==void 0&&(le.open=n[1]),S=new Ge({props:le}),Z.push(()=>de(S,"open",ke)),{c(){t=b("div"),e=b("div"),l=b("h1"),l.textContent="Welcome to ATIP v2",u=y(),j(c.$$.fragment),s=y(),m&&m.c(),f=y(),j(i.$$.fragment),o=y(),j(a.$$.fragment),d=y(),B=b("hr"),L=y(),j($.$$.fragment),E=y(),A&&A.c(),O=y(),G=b("hr"),q=y(),R=y(),j(p.$$.fragment),g=y(),N=b("div"),N.innerHTML='
    ',k=y(),j(S.$$.fragment),h(l,"class","govuk-heading-l"),h(e,"class","govuk-grid-column-one-half left svelte-lyn11h"),h(N,"class","govuk-grid-column-one-half"),h(t,"class","govuk-grid-row")},m(r,w){I(r,t,w),_(t,e),_(e,l),_(e,u),C(c,e,null),_(e,s),m&&m.m(e,null),_(e,f),C(i,e,null),_(e,o),C(a,e,null),_(e,d),_(e,B),_(e,L),C($,e,null),_(e,E),A&&A.m(e,null),_(e,O),_(e,G),_(e,q),_(e,R),C(p,e,null),_(t,g),_(t,N),I(r,k,w),C(S,r,w),U=!0},p(r,[w]){const ae={};w&262144&&(ae.$$scope={dirty:w,ctx:r}),c.$set(ae),r[2]?m?(m.p(r,w),w&4&&M(m,1)):(m=ge(r),m.c(),M(m,1),m.m(e,f)):m&&(Ce(),F(m,1,1,()=>{m=null}),Le());const oe={};w&262153&&(oe.$$scope={dirty:w,ctx:r}),i.$set(oe);const K={};w&64&&(K.disabled=!r[6]),w&262144&&(K.$$scope={dirty:w,ctx:r}),a.$set(K);const se={};!v&&w&16&&(v=!0,se.value=r[4],_e(()=>v=!1)),$.$set(se),r[5]?A?A.p(r,w):(A=me(r),A.c(),A.m(e,O)):A&&(A.d(1),A=null);const ie={};!z&&w&2&&(z=!0,ie.open=r[1],_e(()=>z=!1)),S.$set(ie)},i(r){U||(M(c.$$.fragment,r),M(m),M(i.$$.fragment,r),M(a.$$.fragment,r),M($.$$.fragment,r),M(ne),M(p.$$.fragment,r),M(S.$$.fragment,r),U=!0)},o(r){F(c.$$.fragment,r),F(m),F(i.$$.fragment,r),F(a.$$.fragment,r),F($.$$.fragment,r),F(ne),F(p.$$.fragment,r),F(S.$$.fragment,r),U=!1},d(r){r&&(T(t),T(k)),J(c),m&&m.d(),J(i),J(a),J($),A&&A.d(),J(p),J(S,r)}}}let Ye="",V="boundary",D="boundary-layer";function xe(n){if(n.features.length>0){let t=n.features[0].properties;for(let e of["planning","v2","criticals"])if(t&&e in t)return e}return"v1"}function et(n,t,e){let l,u=!1,s=new URLSearchParams(window.location.search).get("error")||"",f,i,o=new Set,a=null,d="TA";function B(){a==null||a.setFilter(D,["==",["get","level"],d])}let L=null;Ne(async()=>{De();const p=await ze();for(let k of p.features){let S=document.createElement("option");S.value=k.properties.name,i.appendChild(S),o.add(k.properties.name)}a=new Je.Map({container:"map",style:"https://api.maptiler.com/maps/streets/style.json?key=MZEJTanw3WpxRvt7qDfo"});let g=null;function N(){g!==null&&a.setFeatureState({source:V,id:g},{hover:!1})}a.on("load",function(){a.fitBounds(Oe(p),{padding:20,animate:!1}),a.addSource(V,{type:"geojson",data:p,generateId:!0}),a.addLayer({id:D,source:V,filter:["==",["get","level"],d],type:"fill",paint:{"fill-color":"rgb(200, 100, 240)","fill-outline-color":"rgb(200, 100, 240)","fill-opacity":["case",["boolean",["feature-state","hover"],!1],.8,.4]}}),a.on("mousemove",D,k=>{k.features.length>0&&(N(),g=k.features[0].id,e(5,L=k.features[0].properties.name),a.setFeatureState({source:V,id:g},{hover:!0}))}),a.on("mouseleave",D,()=>{N(),g=null,e(5,L=null)}),a.on("click",D,function(k){let S=k.features[0].properties.name;window.location.href=`scheme.html?authority=${S}`})})});function $(p){try{let g=JSON.parse(p);if(!g.authority)throw new Error("File doesn't have an authority set; is it an ATIP file?");if(!o.has(g.authority))throw new Error(`Unknown authority ${g.authority}`);let N=g.authority,k=xe(g);k!="v1"&&(N+=`_${k}`),window.localStorage.setItem(N,JSON.stringify(g)),window.location.href=`scheme.html?authority=${g.authority}&schema=${k}`}catch(g){e(2,s=`Couldn't load scheme from a file: ${g}`)}}function v(){window.location.href=`scheme.html?authority=${f}`}const E=()=>e(1,u=!u);function O(){f=this.value,e(0,f)}function G(p){Z[p?"unshift":"push"](()=>{i=p,e(3,i)})}function q(p){d=p,e(4,d)}function R(p){u=p,e(1,u)}return n.$$.update=()=>{n.$$.dirty&1&&e(6,l=o.has(f))},[f,u,s,i,d,L,l,B,$,v,E,O,G,q,R]}class tt extends X{constructor(t){super(),Y(this,t,et,Xe,x,{})}}document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";new tt({target:document.getElementById("app")}); diff --git a/browse_dropdown_filters/assets/maplibre_helpers-5d84afaa.js b/capitalize_auto_form/assets/maplibre_helpers-09c65b90.js similarity index 82% rename from browse_dropdown_filters/assets/maplibre_helpers-5d84afaa.js rename to capitalize_auto_form/assets/maplibre_helpers-09c65b90.js index 485cb4446..2217e5a02 100644 --- a/browse_dropdown_filters/assets/maplibre_helpers-5d84afaa.js +++ b/capitalize_auto_form/assets/maplibre_helpers-09c65b90.js @@ -1,8 +1,8 @@ -var df=Object.defineProperty;var pf=(E,A,D)=>A in E?df(E,A,{enumerable:!0,configurable:!0,writable:!0,value:D}):E[A]=D;var Yc=(E,A,D)=>(pf(E,typeof A!="symbol"?A+"":A,D),D);(function(){const A=document.createElement("link").relList;if(A&&A.supports&&A.supports("modulepreload"))return;for(const te of document.querySelectorAll('link[rel="modulepreload"]'))N(te);new MutationObserver(te=>{for(const ie of te)if(ie.type==="childList")for(const de of ie.addedNodes)de.tagName==="LINK"&&de.rel==="modulepreload"&&N(de)}).observe(document,{childList:!0,subtree:!0});function D(te){const ie={};return te.integrity&&(ie.integrity=te.integrity),te.referrerPolicy&&(ie.referrerPolicy=te.referrerPolicy),te.crossOrigin==="use-credentials"?ie.credentials="include":te.crossOrigin==="anonymous"?ie.credentials="omit":ie.credentials="same-origin",ie}function N(te){if(te.ep)return;te.ep=!0;const ie=D(te);fetch(te.href,ie)}})();function fa(){}const ff=E=>E;function Ll(E,A){for(const D in A)E[D]=A[D];return E}function td(E){return E()}function Hu(){return Object.create(null)}function ps(E){E.forEach(td)}function nh(E){return typeof E=="function"}function sh(E,A){return E!=E?A==A:E!==A||E&&typeof E=="object"||typeof E=="function"}let kl;function vm(E,A){return kl||(kl=document.createElement("a")),kl.href=A,E===kl.href}function mf(E){return Object.keys(E).length===0}function id(E,...A){if(E==null){for(const N of A)N(void 0);return fa}const D=E.subscribe(...A);return D.unsubscribe?()=>D.unsubscribe():D}function bm(E){let A;return id(E,D=>A=D)(),A}function wm(E,A,D){E.$$.on_destroy.push(id(A,D))}function rd(E,A,D,N){if(E){const te=nd(E,A,D,N);return E[0](te)}}function nd(E,A,D,N){return E[1]&&N?Ll(D.ctx.slice(),E[1](N(A))):D.ctx}function sd(E,A,D,N){if(E[2]&&N){const te=E[2](N(D));if(A.dirty===void 0)return te;if(typeof te=="object"){const ie=[],de=Math.max(A.dirty.length,te.length);for(let h=0;h32){const A=[],D=E.ctx.length/32;for(let N=0;Nwindow.performance.now():()=>Date.now(),ah=ld?E=>requestAnimationFrame(E):fa;const da=new Set;function cd(E){da.forEach(A=>{A.c(E)||(da.delete(A),A.f())}),da.size!==0&&ah(cd)}function _f(E){let A;return da.size===0&&ah(cd),{promise:new Promise(D=>{da.add(A={c:E,f:D})}),abort(){da.delete(A)}}}function zl(E,A){E.appendChild(A)}function hd(E){if(!E)return document;const A=E.getRootNode?E.getRootNode():E.ownerDocument;return A&&A.host?A:E.ownerDocument}function yf(E){const A=wo("style");return A.textContent="/* empty */",xf(hd(E),A),A.sheet}function xf(E,A){return zl(E.head||E,A),A.sheet}function oh(E,A,D){E.insertBefore(A,D||null)}function Eo(E){E.parentNode&&E.parentNode.removeChild(E)}function Em(E,A){for(let D=0;DE.removeEventListener(A,D,N)}function Am(E){return function(A){return A.stopPropagation(),E.call(this,A)}}function pn(E,A,D){D==null?E.removeAttribute(A):E.getAttribute(A)!==D&&E.setAttribute(A,D)}const bf=["width","height"];function Yu(E,A){const D=Object.getOwnPropertyDescriptors(E.__proto__);for(const N in A)A[N]==null?E.removeAttribute(N):N==="style"?E.style.cssText=A[N]:N==="__value"?E.value=E[N]=A[N]:D[N]&&D[N].set&&bf.indexOf(N)===-1?E[N]=A[N]:pn(E,N,A[N])}function Pm(E){let A;return{p(...D){A=D,A.forEach(N=>E.push(N))},r(){A.forEach(D=>E.splice(E.indexOf(D),1))}}}function Mm(E){return E===""?null:+E}function wf(E){return Array.from(E.childNodes)}function Tf(E,A){A=""+A,E.data!==A&&(E.data=A)}function Cm(E,A){E.value=A??""}function km(E,A,D,N){D==null?E.style.removeProperty(A):E.style.setProperty(A,D,N?"important":"")}function zm(E,A,D){for(let N=0;N>>0}function Sf(E,A){const D={stylesheet:yf(A),rules:{}};return Bl.set(E,D),D}function Ju(E,A,D,N,te,ie,de,h=0){const ce=16.666/N;let Y=`{ -`;for(let bt=0;bt<=1;bt+=ce){const et=A+(D-A)*ie(bt);Y+=bt*100+`%{${de(et,1-et)}} -`}const Ne=Y+`100% {${de(D,1-D)}} -}`,xe=`__svelte_${Ef(Ne)}_${h}`,nt=hd(E),{stylesheet:ot,rules:We}=Bl.get(nt)||Sf(nt,E);We[xe]||(We[xe]=!0,ot.insertRule(`@keyframes ${xe} ${Ne}`,ot.cssRules.length));const xt=E.style.animation||"";return E.style.animation=`${xt?`${xt}, `:""}${xe} ${N}ms linear ${te}ms 1 both`,Rl+=1,xe}function If(E,A){const D=(E.style.animation||"").split(", "),N=D.filter(A?ie=>ie.indexOf(A)<0:ie=>ie.indexOf("__svelte")===-1),te=D.length-N.length;te&&(E.style.animation=N.join(", "),Rl-=te,Rl||Af())}function Af(){ah(()=>{Rl||(Bl.forEach(E=>{const{ownerNode:A}=E.stylesheet;A&&Eo(A)}),Bl.clear())})}let To;function bo(E){To=E}function So(){if(!To)throw new Error("Function called outside component initialization");return To}function Bm(E){So().$$.on_mount.push(E)}function Rm(E){So().$$.on_destroy.push(E)}function Fm(){const E=So();return(A,D,{cancelable:N=!1}={})=>{const te=E.$$.callbacks[A];if(te){const ie=dd(A,D,{cancelable:N});return te.slice().forEach(de=>{de.call(E,ie)}),!ie.defaultPrevented}return!0}}function Om(E,A){return So().$$.context.set(E,A),A}function Um(E){return So().$$.context.get(E)}function Pf(E,A){const D=E.$$.callbacks[A.type];D&&D.slice().forEach(N=>N.call(this,A))}const ua=[],eh=[];let pa=[];const th=[],Mf=Promise.resolve();let ih=!1;function Cf(){ih||(ih=!0,Mf.then(pd))}function Fl(E){pa.push(E)}function Vm(E){th.push(E)}const Jc=new Set;let ha=0;function pd(){if(ha!==0)return;const E=To;do{try{for(;haE.indexOf(N)===-1?A.push(N):D.push(N)),D.forEach(N=>N()),pa=A}let vo;function Df(){return vo||(vo=Promise.resolve(),vo.then(()=>{vo=null})),vo}function Qc(E,A,D){E.dispatchEvent(dd(`${A?"intro":"outro"}${D}`))}const Dl=new Set;let fn;function Nm(){fn={r:0,c:[],p:fn}}function $m(){fn.r||ps(fn.c),fn=fn.p}function Io(E,A){E&&E.i&&(Dl.delete(E),E.i(A))}function Vl(E,A,D,N){if(E&&E.o){if(Dl.has(E))return;Dl.add(E),fn.c.push(()=>{Dl.delete(E),N&&(D&&E.d(1),N())}),E.o(A)}else N&&N()}const Lf={duration:0};function qm(E,A,D,N){let ie=A(E,D,{direction:"both"}),de=N?0:1,h=null,ce=null,Y=null,Ne;function xe(){Y&&If(E,Y)}function nt(We,xt){const bt=We.b-de;return xt*=Math.abs(bt),{a:de,b:We.b,d:bt,duration:xt,start:We.start,end:We.start+xt,group:We.group}}function ot(We){const{delay:xt=0,duration:bt=300,easing:et=ff,tick:Bt=fa,css:pt}=ie||Lf,ri={start:gf()+xt,b:We};We||(ri.group=fn,fn.r+=1),"inert"in E&&(We?Ne!==void 0&&(E.inert=Ne):(Ne=E.inert,E.inert=!0)),h||ce?ce=ri:(pt&&(xe(),Y=Ju(E,de,We,bt,xt,et,pt)),We&&Bt(0,1),h=nt(ri,bt),Fl(()=>Qc(E,We,"start")),_f(Rt=>{if(ce&&Rt>ce.start&&(h=nt(ce,bt),ce=null,Qc(E,h.b,"start"),pt&&(xe(),Y=Ju(E,de,h.b,h.duration,0,et,ie.css))),h){if(Rt>=h.end)Bt(de=h.b,1-de),Qc(E,h.b,"end"),ce||(h.b?xe():--h.group.r||ps(h.group.c)),h=null;else if(Rt>=h.start){const Ai=Rt-h.start;de=h.a+h.d*et(Ai/h.duration),Bt(de,1-de)}}return!!(h||ce)}))}return{run(We){nh(ie)?Df().then(()=>{ie=ie({direction:We?"in":"out"}),ot(We)}):ot(We)},end(){xe(),h=ce=null}}}function jm(E){return(E==null?void 0:E.length)!==void 0?E:Array.from(E)}function Zm(E,A){Vl(E,1,1,()=>{A.delete(E.key)})}function Gm(E,A,D,N,te,ie,de,h,ce,Y,Ne,xe){let nt=E.length,ot=ie.length,We=nt;const xt={};for(;We--;)xt[E[We].key]=We;const bt=[],et=new Map,Bt=new Map,pt=[];for(We=ot;We--;){const Mt=xe(te,ie,We),Ct=D(Mt);let ni=de.get(Ct);ni?N&&pt.push(()=>ni.p(Mt,A)):(ni=Y(Ct,Mt),ni.c()),et.set(Ct,bt[We]=ni),Ct in xt&&Bt.set(Ct,Math.abs(We-xt[Ct]))}const ri=new Set,Rt=new Set;function Ai(Mt){Io(Mt,1),Mt.m(h,Ne),de.set(Mt.key,Mt),Ne=Mt.first,ot--}for(;nt&&ot;){const Mt=bt[ot-1],Ct=E[nt-1],ni=Mt.key,Vt=Ct.key;Mt===Ct?(Ne=Mt.first,nt--,ot--):et.has(Vt)?!de.has(ni)||ri.has(ni)?Ai(Mt):Rt.has(Vt)?nt--:Bt.get(ni)>Bt.get(Vt)?(Rt.add(ni),Ai(Mt)):(ri.add(Vt),nt--):(ce(Ct,de),nt--)}for(;nt--;){const Mt=E[nt];et.has(Mt.key)||ce(Mt,de)}for(;ot;)Ai(bt[ot-1]);return ps(pt),bt}function Bf(E,A){const D={},N={},te={$$scope:1};let ie=E.length;for(;ie--;){const de=E[ie],h=A[ie];if(h){for(const ce in de)ce in h||(N[ce]=1);for(const ce in h)te[ce]||(D[ce]=h[ce],te[ce]=1);E[ie]=h}else for(const ce in de)te[ce]=1}for(const de in N)de in D||(D[de]=void 0);return D}function Xm(E,A,D){const N=E.$$.props[A];N!==void 0&&(E.$$.bound[N]=D,D(E.$$.ctx[N]))}function Rf(E){E&&E.c()}function fd(E,A,D){const{fragment:N,after_update:te}=E.$$;N&&N.m(A,D),Fl(()=>{const ie=E.$$.on_mount.map(td).filter(nh);E.$$.on_destroy?E.$$.on_destroy.push(...ie):ps(ie),E.$$.on_mount=[]}),te.forEach(Fl)}function md(E,A){const D=E.$$;D.fragment!==null&&(zf(D.after_update),ps(D.on_destroy),D.fragment&&D.fragment.d(A),D.on_destroy=D.fragment=null,D.ctx=[])}function Ff(E,A){E.$$.dirty[0]===-1&&(ua.push(E),Cf(),E.$$.dirty.fill(0)),E.$$.dirty[A/31|0]|=1<{const We=ot.length?ot[0]:nt;return Y.ctx&&te(Y.ctx[xe],Y.ctx[xe]=We)&&(!Y.skip_bound&&Y.bound[xe]&&Y.bound[xe](We),Ne&&Ff(E,xe)),nt}):[],Y.update(),Ne=!0,ps(Y.before_update),Y.fragment=N?N(Y.ctx):!1,A.target){if(A.hydrate){const xe=wf(A.target);Y.fragment&&Y.fragment.l(xe),xe.forEach(Eo)}else Y.fragment&&Y.fragment.c();A.intro&&Io(E.$$.fragment),fd(E,A.target,A.anchor),pd()}bo(ce)}class hh{constructor(){Yc(this,"$$");Yc(this,"$$set")}$destroy(){md(this,1),this.$destroy=fa}$on(A,D){if(!nh(D))return fa;const N=this.$$.callbacks[A]||(this.$$.callbacks[A]=[]);return N.push(D),()=>{const te=N.indexOf(D);te!==-1&&N.splice(te,1)}}$set(A){this.$$set&&!mf(A)&&(this.$$.skip_bound=!0,this.$$set(A),this.$$.skip_bound=!1)}}const Of="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Of);var Uf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wm(E){return E&&E.__esModule&&Object.prototype.hasOwnProperty.call(E,"default")?E.default:E}function Hm(E){if(E.__esModule)return E;var A=E.default;if(typeof A=="function"){var D=function N(){if(this instanceof N){var te=[null];te.push.apply(te,arguments);var ie=Function.bind.apply(A,te);return new ie}return A.apply(this,arguments)};D.prototype=A.prototype}else D={};return Object.defineProperty(D,"__esModule",{value:!0}),Object.keys(E).forEach(function(N){var te=Object.getOwnPropertyDescriptor(E,N);Object.defineProperty(D,N,te.get?te:{enumerable:!0,get:function(){return E[N]}})}),D}var gd={exports:{}};(function(E,A){(function(D,N){E.exports=N()})(Uf,function(){var D,N,te;function ie(h,ce){if(!D)D=ce;else if(!N)N=ce;else{var Y="var sharedChunk = {}; ("+D+")(sharedChunk); ("+N+")(sharedChunk);",Ne={};D(Ne),te=ce(Ne),typeof window<"u"&&(te.workerUrl=window.URL.createObjectURL(new Blob([Y],{type:"text/javascript"})))}}ie(["exports"],function(h){function ce(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Y=Ne;function Ne(i,e){this.x=i,this.y=e}Ne.prototype={clone:function(){return new Ne(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),s=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,e){var r=Math.cos(i),s=Math.sin(i),l=e.y+s*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-s*(this.y-e.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ne.convert=function(i){return i instanceof Ne?i:Array.isArray(i)?new Ne(i[0],i[1]):i};var xe=ce(Y),nt=ot;function ot(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}ot.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var We=ce(nt);function xt(i,e,r,s){const l=new We(i,e,r,s);return function(u){return l.solve(u)}}const bt=xt(.25,.1,.25,1);function et(i,e,r){return Math.min(r,Math.max(e,i))}function Bt(i,e,r){const s=r-e,l=((i-e)%s+s)%s+e;return l===e?r:l}function pt(i,...e){for(const r of e)for(const s in r)i[s]=r[s];return i}let ri=1;function Rt(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Ai(i,e,r){const s={};for(const l in i)s[l]=e.call(r||this,i[l],l,i);return s}function Mt(i,e,r){const s={};for(const l in i)e.call(r||this,i[l],l,i)&&(s[l]=i[l]);return s}function Ct(i){return Array.isArray(i)?i.map(Ct):typeof i=="object"&&i?Ai(i,Ct):i}const ni={};function Vt(i){ni[i]||(typeof console<"u"&&console.warn(i),ni[i]=!0)}function yt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function ga(i){let e=0;for(let r,s,l=0,u=i.length,d=u-1;lcancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(gn||(gn=document.createElement("a")),gn.href=i,gn.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Hr==null&&(Hr=matchMedia("(prefers-reduced-motion: reduce)")),Hr.matches)}},Nn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Br extends Error{constructor(e,r,s,l){super(`AJAXError: ${r} (${e}): ${s}`),this.status=e,this.statusText=r,this.url=s,this.body=l}}const bi=Zi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Gi=i=>Nn.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function hi(i,e){const r=new AbortController,s=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:bi(),signal:r.signal});let l=!1,u=!1;return i.type==="json"&&s.headers.set("Accept","application/json"),u||fetch(s).then(d=>d.ok?(f=>{(i.type==="arrayBuffer"||i.type==="image"?f.arrayBuffer():i.type==="json"?f.json():f.text()).then(g=>{u||(l=!0,e(null,g,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(g=>{u||e(new Error(g.message))})})(d):d.blob().then(f=>e(new Br(d.status,d.statusText,i.url,f)))).catch(d=>{d.code!==20&&e(new Error(d.message))}),{cancel:()=>{u=!0,l||r.abort()}}}const yn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Zi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Zi())return(Gi(i.url)||hi)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(bi())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return hi(i,e);if(Zi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(s,l){const u=new XMLHttpRequest;u.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(u.responseType="arraybuffer");for(const d in s.headers)u.setRequestHeader(d,s.headers[d]);return s.type==="json"&&(u.responseType="text",u.setRequestHeader("Accept","application/json")),u.withCredentials=s.credentials==="include",u.onerror=()=>{l(new Error(u.statusText))},u.onload=()=>{if((u.status>=200&&u.status<300||u.status===0)&&u.response!==null){let d=u.response;if(s.type==="json")try{d=JSON.parse(u.response)}catch(f){return l(f)}l(null,d,u.getResponseHeader("Cache-Control"),u.getResponseHeader("Expires"))}else{const d=new Blob([u.response],{type:u.getResponseHeader("Content-Type")});l(new Br(u.status,u.statusText,s.url,d))}},u.send(s.body),{cancel:()=>u.abort()}}(i,e)},xn=function(i,e){return yn(pt(i,{type:"arrayBuffer"}),e)};function Kr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Rr(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function br(i,e,r){if(r&&r[i]){const s=r[i].indexOf(e);s!==-1&&r[i].splice(s,1)}}class wr{constructor(e,r={}){pt(this,r),this.type=e}}class Xi extends wr{constructor(e,r={}){super("error",pt({error:e},r))}}class vn{on(e,r){return this._listeners=this._listeners||{},Rr(e,r,this._listeners),this}off(e,r){return br(e,r,this._listeners),br(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Rr(e,r,this._oneTimeListeners),this):new Promise(s=>this.once(e,s))}fire(e,r){typeof e=="string"&&(e=new wr(e,r||{}));const s=e.type;if(this.listens(s)){e.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const f of l)f.call(this,e);const u=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of u)br(s,f,this._oneTimeListeners),f.call(this,e);const d=this._eventedParent;d&&(pt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof Xi&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var le={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"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:{}},default:"mapbox"},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-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 Fr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function $n(i,e){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return Fr.forEach(s=>{s in e&&(r[s]=e[s])}),r}function wt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const jn=[Or,be,Qe,Ye,Pi,Er,Qt,ui(He),er,Sr];function cr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!cr(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of jn)if(!cr(r,e))return null}}return`Expected ${St(i)} but found ${St(e)} instead.`}function V(i,e){return e.some(r=>r.kind===i.kind)}function I(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function M(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const L=.96422,j=.82521,Z=4/29,J=6/29,W=3*J*J,G=J*J*J,ee=Math.PI/180,ue=180/Math.PI;function fe(i){return(i%=360)<0&&(i+=360),i}function pe([i,e,r,s]){let l,u;const d=Xe((.2225045*(i=$e(i))+.7168786*(e=$e(e))+.0606169*(r=$e(r)))/1);i===e&&e===r?l=u=d:(l=Xe((.4360747*i+.3850649*e+.1430804*r)/L),u=Xe((.0139322*i+.0971045*e+.7141733*r)/j));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-u),s]}function $e(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Xe(i){return i>G?Math.pow(i,1/3):i/W+Z}function Le([i,e,r,s]){let l=(i+16)/116,u=isNaN(e)?l:l+e/500,d=isNaN(r)?l:l-r/200;return l=1*Ge(l),u=L*Ge(u),d=j*Ge(d),[Oe(3.1338561*u-1.6168667*l-.4906146*d),Oe(-.9787684*u+1.9161415*l+.033454*d),Oe(.0719453*u-.2289914*l+1.4052427*d),s]}function Oe(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Ge(i){return i>J?i*i*i:W*(i-Z)}function at(i){return parseInt(i.padEnd(2,i),16)/255}function tt(i,e){return ct(e?i/100:i,0,1)}function ct(i,e,r){return Math.min(Math.max(e,i),r)}function Tt(i){return!i.some(Number.isNaN)}const Xt={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 Ze{constructor(e,r,s,l=1,u=!0){this.r=e,this.g=r,this.b=s,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[e,r,s,l]))}static parse(e){if(e instanceof Ze)return e;if(typeof e!="string")return;const r=function(s){if((s=s.toLowerCase())==="transparent")return[0,0,0,0];const l=Xt[s];if(l){const[d,f,g]=l;return[d/255,f/255,g/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const d=s.length<6?1:2;let f=1;return[at(s.slice(f,f+=d)),at(s.slice(f,f+=d)),at(s.slice(f,f+=d)),at(s.slice(f,f+d)||"ff")]}if(s.startsWith("rgb")){const d=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,g,v,b,S,P,C,z,U,F,K,Q]=d,X=[b||" ",C||" ",F].join("");if(X===" "||X===" /"||X===",,"||X===",,,"){const ne=[v,P,U].join(""),ae=ne==="%%%"?100:ne===""?255:0;if(ae){const he=[ct(+g/ae,0,1),ct(+S/ae,0,1),ct(+z/ae,0,1),K?tt(+K,Q):1];if(Tt(he))return he}}return}}const u=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[d,f,g,v,b,S,P,C,z]=u,U=[g||" ",b||" ",P].join("");if(U===" "||U===" /"||U===",,"||U===",,,"){const F=[+f,ct(+v,0,100),ct(+S,0,100),C?tt(+C,z):1];if(Tt(F))return function([K,Q,X,ne]){function ae(he){const ze=(he+K/30)%12,Be=Q*Math.min(X,1-X);return X-Be*Math.max(-1,Math.min(ze-3,9-ze,1))}return K=fe(K),Q/=100,X/=100,[ae(0),ae(8),ae(4),ne]}(F)}}}(e);return r?new Ze(...r,!1):void 0}get rgb(){const{r:e,g:r,b:s,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[e/u,r/u,s/u,l])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,s,l,u]=pe(e),d=Math.sqrt(s*s+l*l);return[Math.round(1e4*d)?fe(Math.atan2(l,s)*ue):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",pe(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,s,l]=this.rgb;return`rgba(${[e,r,s].map(u=>Math.round(255*u)).join(",")},${l})`}}Ze.black=new Ze(0,0,0,1),Ze.white=new Ze(1,1,1,1),Ze.transparent=new Ze(0,0,0,0),Ze.red=new Ze(1,0,0,1);class Lt{constructor(e,r,s){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ur{constructor(e,r,s,l,u){this.text=e,this.image=r,this.scale=s,this.fontStack=l,this.textColor=u}}class di{constructor(e){this.sections=e}static fromString(e){return new di([new Ur(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof di?e:di.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e=="number")return new Li([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Li(e)}}toString(){return JSON.stringify(this.values)}}class Wi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Wi({name:e,available:!1}):null}}function Tn(i,e,r,s){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,e,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,e,r,s]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ms(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Ze||i instanceof Lt||i instanceof di||i instanceof Li||i instanceof Wi)return!0;if(Array.isArray(i)){for(const e of i)if(!ms(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!ms(i[e]))return!1;return!0}return!1}function Wt(i){if(i===null)return Or;if(typeof i=="string")return Qe;if(typeof i=="boolean")return Ye;if(typeof i=="number")return be;if(i instanceof Ze)return Pi;if(i instanceof Lt)return Tr;if(i instanceof di)return Er;if(i instanceof Li)return er;if(i instanceof Wi)return Sr;if(Array.isArray(i)){const e=i.length;let r;for(const s of i){const l=Wt(s);if(r){if(r===l)continue;r=He;break}r=l}return ui(r||He,e)}return Qt}function Zn(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof Ze||i instanceof di||i instanceof Li||i instanceof Wi?i.toString():JSON.stringify(i)}class Vr{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ms(e[1]))return r.error("invalid value");const s=e[1];let l=Wt(s);const u=r.expectedType;return l.kind!=="array"||l.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(l=u),new Vr(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Nt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const gs={string:Qe,number:be,boolean:Ye,object:Qt};class tr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let s,l=1;const u=e[0];if(u==="array"){let f,g;if(e.length>2){const v=e[1];if(typeof v!="string"||!(v in gs)||v==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=gs[v],l++}else f=He;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=e[2],l++}s=ui(f,g)}else{if(!gs[u])throw new Error(`Types doesn't contain name = ${u}`);s=gs[u]}const d=[];for(;le.outputDefined())}}const Ao={"to-boolean":Ye,"to-color":Pi,"to-number":be,"to-string":Qe};class pi{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[0];if(!Ao[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return r.error("Expected one argument.");const l=Ao[s],u=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Tn(r[0],r[1],r[2],r[3]),!s))return new Ze(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Nt(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="padding"){let r;for(const s of this.args){r=s.evaluate(e);const l=Li.parse(r);if(l)return l}throw new Nt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="number"){let r=null;for(const s of this.args){if(r=s.evaluate(e),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new Nt(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?di.fromString(Zn(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Wi.fromString(Zn(this.args[0].evaluate(e))):Zn(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const _a=["Unknown","Point","LineString","Polygon"];class _s{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"?_a[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Ze.parse(e)),r}}class Nr{constructor(e,r,s=[],l,u=new wn,d=[]){this.registry=e,this.path=s,this.key=s.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=l,this._isConstant=r}parse(e,r,s,l,u={}){return r?this.concat(r,s,l)._parse(e,u):this._parse(e,u)}_parse(e,r){function s(l,u,d){return d==="assert"?new tr(u,[l]):d==="coerce"?new pi(u,[l]):l}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=e[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const u=this.registry[l];if(u){let d=u.parse(e,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,g=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||g.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(f.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array"){if(this.checkSubtype(f,g))return null}else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Vr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new _s;try{d=new Vr(d.type,d.evaluate(f))}catch(g){return this.error(g.message),null}}return d}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,s){const l=typeof e=="number"?this.path.concat(e):this.path,u=s?this.scope.concat(s):this.scope;return new Nr(this.registry,this._isConstant,l,r||null,u,this.errors)}error(e,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new fi(s,e))}checkSubtype(e,r){const s=cr(e,r);return s&&this.error(s),s}}class mt{constructor(e,r,s){this.type=Tr,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,Ye);if(!l)return null;const u=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Ye);if(!u)return null;let d=null;return s.locale&&(d=r.parse(s.locale,1,Qe),!d)?null:new mt(l,u,d)}evaluate(e){return new Lt(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const $r=8192;function Gn(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function ys(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Po(i,e){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,e.z);return[Math.round(r*l*$r),Math.round(s*l*$r)]}function Mo(i,e,r){const s=i[0]-e[0],l=i[1]-e[1],u=i[0]-r[0],d=i[1]-r[1];return s*d-u*l==0&&s*u<=0&&l*d<=0}function ya(i,e){let r=!1;for(let d=0,f=e.length;d(s=i)[1]!=(u=g[v+1])[1]>s[1]&&s[0]<(u[0]-l[0])*(s[1]-l[1])/(u[1]-l[1])+l[0]&&(r=!r)}}var s,l,u;return r}function Co(i,e){for(let r=0;r0&&f<0||d<0&&f>0}function ql(i,e,r){for(const v of r)for(let b=0;br[2]){const l=.5*s;let u=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;u===0&&(u=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=u}Gn(e,i)}function zo(i,e,r,s){const l=Math.pow(2,s.z)*$r,u=[s.x*$r,s.y*$r],d=[];for(const f of i)for(const g of f){const v=[g.x+u[0],g.y+u[1]];wa(v,e,r,l),d.push(v)}return d}function Do(i,e,r,s){const l=Math.pow(2,s.z)*$r,u=[s.x*$r,s.y*$r],d=[];for(const g of i){const v=[];for(const b of g){const S=[b.x+u[0],b.y+u[1]];Gn(e,S),v.push(S)}d.push(v)}if(e[2]-e[0]<=l/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const g of d)for(const v of g)wa(v,e,r,l)}var f;return d}class Ir{constructor(e,r){this.type=Ye,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ms(e[1])){const s=e[1];if(s.type==="FeatureCollection")for(let l=0;l!Array.isArray(v)||v.length===e.length-1);let g=null;for(const[v,b]of f){g=new Nr(r.registry,vs,r.path,null,r.scope);const S=[];let P=!1;for(let C=1;C{return P=S,Array.isArray(P)?`(${P.map(St).join(", ")})`:`(${St(P.type)}...)`;var P}).join(" | "),b=[];for(let S=1;S{r=e?r&&vs(s):r&&s instanceof Vr}),!!r&&Xn(i)&&bs(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Xn(i){if(i instanceof Hi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Ir)return!1;let e=!0;return i.eachChild(r=>{e&&!Xn(r)&&(e=!1)}),e}function En(i){if(i instanceof Hi&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!En(r)&&(e=!1)}),e}function bs(i,e){if(i instanceof Hi&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!bs(s,e)&&(r=!1)}),r}function ws(i,e){const r=i.length-1;let s,l,u=0,d=r,f=0;for(;u<=d;)if(f=Math.floor((u+d)/2),s=i[f],l=i[f+1],s<=e){if(f===r||ee))throw new Nt("Input is not a number.");d=f-1}return 0}class Sn{constructor(e,r,s){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[l,u]of s)this.labels.push(l),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(e[1],1,be);if(!s)return null;const l=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let d=1;d=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',v);const S=r.parse(g,b,u);if(!S)return null;u=u||S.type,l.push([f,S])}return new Sn(u,s,l)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const u=r.length;return l>=r[u-1]?s[u-1].evaluate(e):s[ws(r,l)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function In(i,e,r){return i+r*(e-i)}function Ts(i,e,r){return i.map((s,l)=>In(s,e[l],r))}const Bi={number:In,color:function(i,e,r,s="rgb"){switch(s){case"rgb":{const[l,u,d,f]=Ts(i.rgb,e.rgb,r);return new Ze(l,u,d,f,!1)}case"hcl":{const[l,u,d,f]=i.hcl,[g,v,b,S]=e.hcl;let P,C;if(isNaN(l)||isNaN(g))isNaN(l)?isNaN(g)?P=NaN:(P=g,d!==1&&d!==0||(C=v)):(P=l,b!==1&&b!==0||(C=u));else{let Q=g-l;g>l&&Q>180?Q-=360:g180&&(Q+=360),P=l+r*Q}const[z,U,F,K]=function([Q,X,ne,ae]){return Q=isNaN(Q)?0:Q*ee,Le([ne,Math.cos(Q)*X,Math.sin(Q)*X,ae])}([P,C??In(u,v,r),In(d,b,r),In(f,S,r)]);return new Ze(z,U,F,K,!1)}case"lab":{const[l,u,d,f]=Le(Ts(i.lab,e.lab,r));return new Ze(l,u,d,f,!1)}}},array:Ts,padding:function(i,e,r){return new Li(Ts(i.values,e.values,r))}};class Ri{constructor(e,r,s,l,u){this.type=e,this.operator=r,this.interpolation=s,this.input=l,this.labels=[],this.outputs=[];for(const[d,f]of u)this.labels.push(d),this.outputs.push(f)}static interpolationFactor(e,r,s,l){let u=0;if(e.name==="exponential")u=Ta(r,e.base,s,l);else if(e.name==="linear")u=Ta(r,1,s,l);else if(e.name==="cubic-bezier"){const d=e.controlPoints;u=new We(d[0],d[1],d[2],d[3]).solve(Ta(r,1,s,l))}return u}static parse(e,r){let[s,l,u,...d]=e;if(!Array.isArray(l)||l.length===0)return r.error("Expected an interpolation type expression.",1);if(l[0]==="linear")l={name:"linear"};else if(l[0]==="exponential"){const v=l[1];if(typeof v!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);l={name:"exponential",base:v}}else{if(l[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(l[0])}`,1,0);{const v=l.slice(1);if(v.length!==4||v.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:v}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,be),!u)return null;const f=[];let g=null;s==="interpolate-hcl"||s==="interpolate-lab"?g=Pi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let v=0;v=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',P);const z=r.parse(S,C,g);if(!z)return null;g=g||z.type,f.push([b,z])}return M(g,be)||M(g,Pi)||M(g,er)||M(g,ui(be))?new Ri(g,s,l,u,f):r.error(`Type ${St(g)} is not interpolatable.`)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const u=r.length;if(l>=r[u-1])return s[u-1].evaluate(e);const d=ws(r,l),f=Ri.interpolationFactor(this.interpolation,l,r[d],r[d+1]),g=s[d].evaluate(e),v=s[d+1].evaluate(e);switch(this.operator){case"interpolate":return Bi[this.type.kind](g,v,f);case"interpolate-hcl":return Bi.color(g,v,f,"hcl");case"interpolate-lab":return Bi.color(g,v,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ta(i,e,r,s){const l=s-r,u=i-r;return l===0?0:e===1?u/l:(Math.pow(e,u)-1)/(Math.pow(e,l)-1)}class Es{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const u=[];for(const f of e.slice(1)){const g=r.parse(f,1+u.length,s,void 0,{typeAnnotation:"omit"});if(!g)return null;s=s||g.type,u.push(g)}if(!s)throw new Error("No output type");const d=l&&u.some(f=>cr(l,f.type));return new Es(d?He:s,u)}evaluate(e){let r,s=null,l=0;for(const u of this.args)if(l++,s=u.evaluate(e),s&&s instanceof Wi&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ss{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let u=1;u=s.length)throw new Nt(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new Nt(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Wn{constructor(e,r){this.type=Ye,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,He),l=r.parse(e[2],2,He);return s&&l?V(s.type,[Ye,Qe,be,Or,He])?new Wn(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(s.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!I(r,["boolean","string","number","null"]))throw new Nt(`Expected first argument to be of type boolean, string, number or null, but found ${St(Wt(r))} instead.`);if(!I(s,["string","array"]))throw new Nt(`Expected second argument to be of type array or string, but found ${St(Wt(s))} instead.`);return s.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class en{constructor(e,r,s){this.type=be,this.needle=e,this.haystack=r,this.fromIndex=s}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,He),l=r.parse(e[2],2,He);if(!s||!l)return null;if(!V(s.type,[Ye,Qe,be,Or,He]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(s.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,be);return u?new en(s,l,u):null}return new en(s,l)}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!I(r,["boolean","string","number","null"]))throw new Nt(`Expected first argument to be of type boolean, string, number or null, but found ${St(Wt(r))} instead.`);if(!I(s,["string","array"]))throw new Nt(`Expected second argument to be of type array or string, but found ${St(Wt(s))} instead.`);if(this.fromIndex){const l=this.fromIndex.evaluate(e);return s.indexOf(r,l)}return s.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class ht{constructor(e,r,s,l,u,d){this.inputType=e,this.type=r,this.input=s,this.cases=l,this.outputs=u,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const u={},d=[];for(let v=2;vNumber.MAX_SAFE_INTEGER)return P.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof z=="number"&&Math.floor(z)!==z)return P.error("Numeric branch labels must be integer values.");if(s){if(P.checkSubtype(s,Wt(z)))return null}else s=Wt(z);if(u[String(z)]!==void 0)return P.error("Branch labels must be unique.");u[String(z)]=d.length}const C=r.parse(S,v,l);if(!C)return null;l=l||C.type,d.push(C)}const f=r.parse(e[1],1,He);if(!f)return null;const g=r.parse(e[e.length-1],e.length-1,l);return g?f.type.kind!=="value"&&r.concat(1).checkSubtype(s,f.type)?null:new ht(s,l,f,u,d,g):null}evaluate(e){const r=this.input.evaluate(e);return(Wt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Sa{constructor(e,r,s){this.type=e,this.branches=r,this.otherwise=s}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class Is{constructor(e,r,s,l){this.type=e,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,He),l=r.parse(e[2],2,be);if(!s||!l)return null;if(!V(s.type,[ui(He),Qe,He]))return r.error(`Expected first argument to be of type array or string, but found ${St(s.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,be);return u?new Is(s.type,s,l,u):null}return new Is(s.type,s,l)}evaluate(e){const r=this.input.evaluate(e),s=this.beginIndex.evaluate(e);if(!I(r,["string","array"]))throw new Nt(`Expected first argument to be of type array or string, but found ${St(Wt(r))} instead.`);if(this.endIndex){const l=this.endIndex.evaluate(e);return r.slice(s,l)}return r.slice(s)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Lo(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Bo(i,e,r,s){return s.compare(e,r)===0}function An(i,e,r){const s=i!=="=="&&i!=="!=";return class _d{constructor(u,d,f){this.type=Ye,this.lhs=u,this.rhs=d,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");const f=u[0];let g=d.parse(u[1],1,He);if(!g)return null;if(!Lo(f,g.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${St(g.type)}'.`);let v=d.parse(u[2],2,He);if(!v)return null;if(!Lo(f,v.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${St(v.type)}'.`);if(g.type.kind!==v.type.kind&&g.type.kind!=="value"&&v.type.kind!=="value")return d.error(`Cannot compare types '${St(g.type)}' and '${St(v.type)}'.`);s&&(g.type.kind==="value"&&v.type.kind!=="value"?g=new tr(v.type,[g]):g.type.kind!=="value"&&v.type.kind==="value"&&(v=new tr(g.type,[v])));let b=null;if(u.length===4){if(g.type.kind!=="string"&&v.type.kind!=="string"&&g.type.kind!=="value"&&v.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(u[3],3,Tr),!b)return null}return new _d(g,v,b)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(s&&this.hasUntypedArgument){const g=Wt(d),v=Wt(f);if(g.kind!==v.kind||g.kind!=="string"&&g.kind!=="number")throw new Nt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${v.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const g=Wt(d),v=Wt(f);if(g.kind!=="string"||v.kind!=="string")return e(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):e(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const Zl=An("==",function(i,e,r){return e===r},Bo),Gl=An("!=",function(i,e,r){return e!==r},function(i,e,r,s){return!Bo(0,e,r,s)}),Xl=An("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,s){return s.compare(e,r)>0}),Hl=An("<=",function(i,e,r){return e<=r},function(i,e,r,s){return s.compare(e,r)<=0}),Kl=An(">=",function(i,e,r){return e>=r},function(i,e,r,s){return s.compare(e,r)>=0});class Ia{constructor(e,r,s,l,u){this.type=Qe,this.number=e,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const s=r.parse(e[1],1,be);if(!s)return null;const l=e[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let u=null;if(l.locale&&(u=r.parse(l.locale,1,Qe),!u))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,Qe),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,be),!f))return null;let g=null;return l["max-fraction-digits"]&&(g=r.parse(l["max-fraction-digits"],1,be),!g)?null:new Ia(s,u,d,f,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class As{constructor(e){this.type=Er,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let u=!1;for(let d=1;d<=e.length-1;++d){const f=e[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let g=null;if(f["font-scale"]&&(g=r.parse(f["font-scale"],1,be),!g))return null;let v=null;if(f["text-font"]&&(v=r.parse(f["text-font"],1,ui(Qe)),!v))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,Pi),!b))return null;const S=l[l.length-1];S.scale=g,S.font=v,S.textColor=b}else{const g=r.parse(e[d],1,He);if(!g)return null;const v=g.type.kind;if(v!=="string"&&v!=="value"&&v!=="null"&&v!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,l.push({content:g,scale:null,font:null,textColor:null})}}return new As(l)}evaluate(e){return new di(this.sections.map(r=>{const s=r.content.evaluate(e);return Wt(s)===Sr?new Ur("",s,null,null,null):new Ur(Zn(s),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class Aa{constructor(e){this.type=Sr,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const s=r.parse(e[1],1,Qe);return s?new Aa(s):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),s=Wi.fromString(r);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(r)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class Pa{constructor(e){this.type=be,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=r.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${St(s.type)} instead.`):new Pa(s):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Nt(`Expected value to be of type string or array, but found ${St(Wt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Pn={"==":Zl,"!=":Gl,">":Wl,"<":Xl,">=":Kl,"<=":Hl,array:tr,at:Ea,boolean:tr,case:Sa,coalesce:Es,collator:mt,format:As,image:Aa,in:Wn,"index-of":en,interpolate:Ri,"interpolate-hcl":Ri,"interpolate-lab":Ri,length:Pa,let:Ss,literal:Vr,match:ht,number:tr,"number-format":Ia,object:tr,slice:Is,step:Sn,string:tr,"to-boolean":pi,"to-color":pi,"to-number":pi,"to-string":pi,var:xs,within:Ir};function Ro(i,[e,r,s,l]){e=e.evaluate(i),r=r.evaluate(i),s=s.evaluate(i);const u=l?l.evaluate(i):1,d=Tn(e,r,s,u);if(d)throw new Nt(d);return new Ze(e/255,r/255,s/255,u,!1)}function Fo(i,e){return i in e}function Ma(i,e){const r=e[i];return r===void 0?null:r}function tn(i){return{type:i}}function Oo(i){return{result:"success",value:i}}function Mn(i){return{result:"error",value:i}}function Cn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Uo(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Ca(i){return!!i.expression&&i.expression.interpolated}function _t(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Ps(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Yl(i){return i}function Vo(i,e){const r=e.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),u=i.type||(Ca(e)?"exponential":"interval");if(r||e.type==="padding"){const b=r?Ze.parse:Li.parse;(i=lr({},i)).stops&&(i.stops=i.stops.map(S=>[S[0],b(S[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,g,v;if(u==="exponential")f=No;else if(u==="interval")f=ka;else if(u==="categorical"){f=Jl,g=Object.create(null);for(const b of i.stops)g[b[0]]=b[1];v=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=Ql}if(s){const b={},S=[];for(let z=0;zz[0]),evaluate:({zoom:z},U)=>No({stops:P,base:i.base},e,z).evaluate(z,U)}}if(l){const b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Ri.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(S=>S[0]),evaluate:({zoom:S})=>f(i,e,S,g,v)}}return{kind:"source",evaluate(b,S){const P=S&&S.properties?S.properties[i.property]:void 0;return P===void 0?Hn(i.default,e.default):f(i,e,P,g,v)}}}function Hn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Jl(i,e,r,s,l){return Hn(typeof r===l?s[r]:void 0,i.default,e.default)}function ka(i,e,r){if(_t(r)!=="number")return Hn(i.default,e.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const l=ws(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function No(i,e,r){const s=i.base!==void 0?i.base:1;if(_t(r)!=="number")return Hn(i.default,e.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const u=ws(i.stops.map(b=>b[0]),r),d=function(b,S,P,C){const z=C-P,U=b-P;return z===0?0:S===1?U/z:(Math.pow(S,U)-1)/(Math.pow(S,z)-1)}(r,s,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],g=i.stops[u+1][1],v=Bi[e.type]||Yl;return typeof f.evaluate=="function"?{evaluate(...b){const S=f.evaluate.apply(void 0,b),P=g.evaluate.apply(void 0,b);if(S!==void 0&&P!==void 0)return v(S,P,d,i.colorSpace)}}:v(f,g,d,i.colorSpace)}function Ql(i,e,r){switch(e.type){case"color":r=Ze.parse(r);break;case"formatted":r=di.fromString(r.toString());break;case"resolvedImage":r=Wi.fromString(r.toString());break;case"padding":r=Li.parse(r);break;default:_t(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return Hn(r,i.default,e.default)}Hi.register(Pn,{error:[{kind:"error"},[Qe],(i,[e])=>{throw new Nt(e.evaluate(i))}],typeof:[Qe,[He],(i,[e])=>St(Wt(e.evaluate(i)))],"to-rgba":[ui(be,4),[Pi],(i,[e])=>{const[r,s,l,u]=e.evaluate(i).rgb;return[255*r,255*s,255*l,u]}],rgb:[Pi,[be,be,be],Ro],rgba:[Pi,[be,be,be,be],Ro],has:{type:Ye,overloads:[[[Qe],(i,[e])=>Fo(e.evaluate(i),i.properties())],[[Qe,Qt],(i,[e,r])=>Fo(e.evaluate(i),r.evaluate(i))]]},get:{type:He,overloads:[[[Qe],(i,[e])=>Ma(e.evaluate(i),i.properties())],[[Qe,Qt],(i,[e,r])=>Ma(e.evaluate(i),r.evaluate(i))]]},"feature-state":[He,[Qe],(i,[e])=>Ma(e.evaluate(i),i.featureState||{})],properties:[Qt,[],i=>i.properties()],"geometry-type":[Qe,[],i=>i.geometryType()],id:[He,[],i=>i.id()],zoom:[be,[],i=>i.globals.zoom],"heatmap-density":[be,[],i=>i.globals.heatmapDensity||0],"line-progress":[be,[],i=>i.globals.lineProgress||0],accumulated:[He,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[be,tn(be),(i,e)=>{let r=0;for(const s of e)r+=s.evaluate(i);return r}],"*":[be,tn(be),(i,e)=>{let r=1;for(const s of e)r*=s.evaluate(i);return r}],"-":{type:be,overloads:[[[be,be],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[be],(i,[e])=>-e.evaluate(i)]]},"/":[be,[be,be],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[be,[be,be],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[be,[],()=>Math.LN2],pi:[be,[],()=>Math.PI],e:[be,[],()=>Math.E],"^":[be,[be,be],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[be,[be],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[be,[be],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[be,[be],(i,[e])=>Math.log(e.evaluate(i))],log2:[be,[be],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[be,[be],(i,[e])=>Math.sin(e.evaluate(i))],cos:[be,[be],(i,[e])=>Math.cos(e.evaluate(i))],tan:[be,[be],(i,[e])=>Math.tan(e.evaluate(i))],asin:[be,[be],(i,[e])=>Math.asin(e.evaluate(i))],acos:[be,[be],(i,[e])=>Math.acos(e.evaluate(i))],atan:[be,[be],(i,[e])=>Math.atan(e.evaluate(i))],min:[be,tn(be),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[be,tn(be),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[be,[be],(i,[e])=>Math.abs(e.evaluate(i))],round:[be,[be],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[be,[be],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[be,[be],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ye,[Qe,He],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ye,[He],(i,[e])=>i.id()===e.value],"filter-type-==":[Ye,[Qe],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s{const r=i.id(),s=e.value;return typeof r==typeof s&&r":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[Ye,[He],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>s}],"filter-<=":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[Ye,[He],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r<=s}],"filter->=":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[Ye,[He],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>=s}],"filter-has":[Ye,[He],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ye,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ye,[ui(Qe)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ye,[ui(He)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ye,[Qe,ui(He)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ye,[Qe,ui(He)],(i,[e,r])=>function(s,l,u,d){for(;u<=d;){const f=u+d>>1;if(l[f]===s)return!0;l[f]>s?d=f-1:u=f+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[tn(Ye),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[tn(Ye),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ye,[Ye],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ye,[Qe],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Qe,[Qe],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Qe,[Qe],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Qe,tn(He),(i,e)=>e.map(r=>Zn(r.evaluate(i))).join("")],"resolved-locale":[Qe,[Tr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class za{constructor(e,r){var s;this.expression=e,this._warningHistory={},this._evaluator=new _s,this._defaultValue=r?(s=r).type==="color"&&Ps(s.default)?new Ze(0,0,0,0):s.type==="color"?Ze.parse(s.default)||null:s.type==="padding"?Li.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,s,l,u,d){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,r,s,l,u,d){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new Nt(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function Ms(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Pn}function Dt(i,e){const r=new Nr(Pn,vs,[],e?function(l){const u={color:Pi,string:Qe,number:be,enum:Qe,boolean:Ye,formatted:Er,padding:er,resolvedImage:Sr};return l.type==="array"?ui(u[l.value]||He,l.length):u[l.type]}(e):void 0),s=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Oo(new za(s,e)):Mn(r.errors)}class Da{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!En(r.expression)}evaluateWithoutErrorHandling(e,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,u,d)}evaluate(e,r,s,l,u,d){return this._styleExpression.evaluate(e,r,s,l,u,d)}}class st{constructor(e,r,s,l){this.kind=e,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!En(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(e,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,u,d)}evaluate(e,r,s,l,u,d){return this._styleExpression.evaluate(e,r,s,l,u,d)}interpolationFactor(e,r,s){return this.interpolationType?Ri.interpolationFactor(this.interpolationType,e,r,s):0}}function Cs(i,e){const r=Dt(i,e);if(r.result==="error")return r;const s=r.value.expression,l=Xn(s);if(!l&&!Cn(e))return Mn([new fi("","data expressions not supported")]);const u=bs(s,["zoom"]);if(!u&&!Uo(e))return Mn([new fi("","zoom expressions not supported")]);const d=Et(s);return d||u?d instanceof fi?Mn([d]):d instanceof Ri&&!Ca(e)?Mn([new fi("",'"interpolate" expressions cannot be used with this property')]):Oo(d?new st(l?"camera":"composite",r.value,d.labels,d instanceof Ri?d.interpolation:void 0):new Da(l?"constant":"source",r.value)):Mn([new fi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class It{constructor(e,r){this._parameters=e,this._specification=r,lr(this,Vo(this._parameters,this._specification))}static deserialize(e){return new It(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Et(i){let e=null;if(i instanceof Ss)e=Et(i.result);else if(i instanceof Es){for(const r of i.args)if(e=Et(r),e)break}else(i instanceof Sn||i instanceof Ri)&&i.input instanceof Hi&&i.input.name==="zoom"&&(e=i);return e instanceof fi||i.eachChild(r=>{const s=Et(r);s instanceof fi?e=s:!e&&s?e=new fi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new fi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function kn(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!kn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const $o={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function La(i){if(i==null)return{filter:()=>!0,needGeometry:!1};kn(i)||(i=ks(i));const e=Dt(i,$o);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>e.value.evaluate(r,s,{},l),needGeometry:qo(i)}}function ec(i,e){return ie?1:0}function qo(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?zs(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(ks))):e==="all"?["all"].concat(i.slice(1).map(ks)):e==="none"?["all"].concat(i.slice(1).map(ks).map(Kn)):e==="in"?Ba(i[1],i.slice(2)):e==="!in"?Kn(Ba(i[1],i.slice(2))):e==="has"?Ra(i[1]):e==="!has"?Kn(Ra(i[1])):e!=="within"||i;var r}function zs(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Ba(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(ec)]]:["filter-in-small",i,["literal",e]]}}function Ra(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Kn(i){return["!",i]}function Yn(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const u of i)l+=`${Yn(u)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new we(e,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function Go(i){const e=i.valueSpec,r=$t(i.value.type);let s,l,u,d={};const f=r!=="categorical"&&i.value.property===void 0,g=!f,v=_t(i.value.stops)==="array"&&_t(i.value.stops[0])==="array"&&_t(i.value.stops[0][0])==="object",b=Ki({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new we(C.key,C.value,'identity function may not have a "stops" property')];let z=[];const U=C.value;return z=z.concat(Zo({key:C.key,value:U,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:S})),_t(U)==="array"&&U.length===0&&z.push(new we(C.key,U,"array must have at least one stop")),z},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new we(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new we(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Ca(i.valueSpec)&&b.push(new we(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!Cn(i.valueSpec)?b.push(new we(i.key,i.value,"property functions not supported")):f&&!Uo(i.valueSpec)&&b.push(new we(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!v||i.value.property!==void 0||b.push(new we(i.key,i.value,'"property" property is required')),b;function S(C){let z=[];const U=C.value,F=C.key;if(_t(U)!=="array")return[new we(F,U,`array expected, ${_t(U)} found`)];if(U.length!==2)return[new we(F,U,`array length 2 expected, length ${U.length} found`)];if(v){if(_t(U[0])!=="object")return[new we(F,U,`object expected, ${_t(U[0])} found`)];if(U[0].zoom===void 0)return[new we(F,U,"object stop key must have zoom")];if(U[0].value===void 0)return[new we(F,U,"object stop key must have value")];if(u&&u>$t(U[0].zoom))return[new we(F,U[0].zoom,"stop zoom values must appear in ascending order")];$t(U[0].zoom)!==u&&(u=$t(U[0].zoom),l=void 0,d={}),z=z.concat(Ki({key:`${F}[0]`,value:U[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Fa,value:P}}))}else z=z.concat(P({key:`${F}[0]`,value:U[0],valueSpec:{},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},U));return Ms(rn(U[1]))?z.concat([new we(`${F}[1]`,U[1],"expressions are not allowed in function stops.")]):z.concat(C.validateSpec({key:`${F}[1]`,value:U[1],valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function P(C,z){const U=_t(C.value),F=$t(C.value),K=C.value!==null?C.value:z;if(s){if(U!==s)return[new we(C.key,K,`${U} stop domain type must match previous stop domain type ${s}`)]}else s=U;if(U!=="number"&&U!=="string"&&U!=="boolean")return[new we(C.key,K,"stop domain value must be a number, string, or boolean")];if(U!=="number"&&r!=="categorical"){let Q=`number expected, ${U} found`;return Cn(e)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new we(C.key,K,Q)]}return r!=="categorical"||U!=="number"||isFinite(F)&&Math.floor(F)===F?r!=="categorical"&&U==="number"&&l!==void 0&&Fnew we(`${i.key}${s.key}`,i.value,s.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new we(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!En(r))return[new we(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!En(r))return[new we(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!bs(r,["zoom","feature-state"]))return[new we(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Xn(r))return[new we(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jn(i){const e=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf($t(r))===-1&&l.push(new we(e,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf($t(r))===-1&&l.push(new we(e,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function zn(i){return kn(rn(i.value))?nn(lr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Xo(i)}function Xo(i){const e=i.value,r=i.key;if(_t(e)!=="array")return[new we(r,e,`array expected, ${_t(e)} found`)];const s=i.styleSpec;let l,u=[];if(e.length<1)return[new we(r,e,"filter array must have at least 1 element")];switch(u=u.concat(Jn({key:`${r}[0]`,value:e[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),$t(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&$t(e[1])==="$type"&&u.push(new we(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new we(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(l=_t(e[1]),l!=="string"&&u.push(new we(`${r}[1]`,e[1],`string expected, ${l} found`)));for(let d=2;d{v in r&&e.push(new we(s,r[v],`"${v}" is prohibited for ref layers`))}),l.layers.forEach(v=>{$t(v.id)===f&&(g=v)}),g?g.ref?e.push(new we(s,r.ref,"ref cannot reference another ref layer")):d=$t(g.type):e.push(new we(s,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const g=l.sources&&l.sources[r.source],v=g&&$t(g.type);g?v==="vector"&&d==="raster"?e.push(new we(s,r.source,`layer "${r.id}" requires a raster source`)):v==="raster"&&d!=="raster"?e.push(new we(s,r.source,`layer "${r.id}" requires a vector source`)):v!=="vector"||r["source-layer"]?v==="raster-dem"&&d!=="hillshade"?e.push(new we(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||v==="geojson"&&g.lineMetrics||e.push(new we(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new we(s,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new we(s,r.source,`source "${r.source}" not found`))}else e.push(new we(s,r,'missing required property "source"'));return e=e.concat(Ki({key:s,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:zn,layout:g=>Ki({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":v=>Wo(lr({layerType:d},v))}}),paint:g=>Ki({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":v=>Ua(lr({layerType:d},v))}})}})),e}function hr(i){const e=i.value,r=i.key,s=_t(e);return s!=="string"?[new we(r,e,`string expected, ${s} found`)]:[]}const Ls={promoteId:function({key:i,value:e}){if(_t(e)==="string")return hr({key:i,value:e});{const r=[];for(const s in e)r.push(...hr({key:`${i}.${s}`,value:e[s]}));return r}}};function Bs(i){const e=i.value,r=i.key,s=i.styleSpec,l=i.style,u=i.validateSpec;if(!e.type)return[new we(r,e,'"type" is required')];const d=$t(e.type);let f;switch(d){case"vector":case"raster":case"raster-dem":return f=Ki({key:r,value:e,valueSpec:s[`source_${d.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:Ls,validateSpec:u}),f;case"geojson":if(f=Ki({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s,validateSpec:u,objectElementValidators:Ls}),e.cluster)for(const g in e.clusterProperties){const[v,b]=e.clusterProperties[g],S=typeof v=="string"?[v,["accumulated"],["get",g]]:v;f.push(...nn({key:`${r}.${g}.map`,value:b,validateSpec:u,expressionContext:"cluster-map"})),f.push(...nn({key:`${r}.${g}.reduce`,value:S,validateSpec:u,expressionContext:"cluster-reduce"}))}return f;case"video":return Ki({key:r,value:e,valueSpec:s.source_video,style:l,validateSpec:u,styleSpec:s});case"image":return Ki({key:r,value:e,valueSpec:s.source_image,style:l,validateSpec:u,styleSpec:s});case"canvas":return[new we(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:u,styleSpec:s})}}function Ho(i){const e=i.value,r=i.styleSpec,s=r.light,l=i.style;let u=[];const d=_t(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new we("light",e,`object expected, ${d} found`)]),u;for(const f in e){const g=f.match(/^(.*)-transition$/);u=u.concat(g&&s[g[1]]&&s[g[1]].transition?i.validateSpec({key:f,value:e[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):s[f]?i.validateSpec({key:f,value:e[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new we(f,e[f],`unknown property "${f}"`)])}return u}function Qn(i){const e=i.value,r=i.styleSpec,s=r.terrain,l=i.style;let u=[];const d=_t(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new we("terrain",e,`object expected, ${d} found`)]),u;for(const f in e)u=u.concat(s[f]?i.validateSpec({key:f,value:e[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new we(f,e[f],`unknown property "${f}"`)]);return u}function Ko(i){let e=[];const r=i.value,s=i.key;if(Array.isArray(r)){const l=[],u=[];for(const d in r)r[d].id&&l.includes(r[d].id)&&e.push(new we(s,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),l.push(r[d].id),r[d].url&&u.includes(r[d].url)&&e.push(new we(s,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),u.push(r[d].url),e=e.concat(Ki({key:`${s}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return hr({key:s,value:r})}const Yo={"*":()=>[],array:Zo,boolean:function(i){const e=i.value,r=i.key,s=_t(e);return s!=="boolean"?[new we(r,e,`boolean expected, ${s} found`)]:[]},number:Fa,color:function(i){const e=i.key,r=i.value,s=_t(r);return s!=="string"?[new we(e,r,`color expected, ${s} found`)]:Ze.parse(String(r))?[]:[new we(e,r,`color expected, "${r}" found`)]},constants:jo,enum:Jn,filter:zn,function:Go,layer:Ds,object:Ki,source:Bs,light:Ho,terrain:Qn,string:hr,formatted:function(i){return hr(i).length===0?[]:nn(i)},resolvedImage:function(i){return hr(i).length===0?[]:nn(i)},padding:function(i){const e=i.key,r=i.value;if(_t(r)==="array"){if(r.length<1||r.length>4)return[new we(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let l=[];for(let u=0;u[]}})),i.constants&&(r=r.concat(jo({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:es}))),ts(r)}function Yi(i){return function(e){return i({...e,validateSpec:es})}}function ts(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Ht(i){return function(...e){return ts(i.apply(this,e))}}ur.source=Ht(Yi(Bs)),ur.sprite=Ht(Yi(Ko)),ur.glyphs=Ht(Yi(Jo)),ur.light=Ht(Yi(Ho)),ur.terrain=Ht(Yi(Qn)),ur.layer=Ht(Yi(Ds)),ur.filter=Ht(Yi(zn)),ur.paintProperty=Ht(Yi(Ua)),ur.layoutProperty=Ht(Yi(Wo));const qr=ur,ic=qr.light,rc=qr.paintProperty,nc=qr.layoutProperty;function Dn(i,e){let r=!1;if(e&&e.length)for(const s of e)i.fire(new Xi(new Error(s.message))),r=!0;return r}class is{constructor(e,r,s){const l=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const d=new Int32Array(this.arrayBuffer);e=d[0],this.d=(r=d[1])+2*(s=d[2]);for(let g=0;g=S[z+0]&&l>=S[z+1])?(f[C]=!0,d.push(b[C])):f[C]=!1}}}}_forEachCell(e,r,s,l,u,d,f,g){const v=this._convertToCellCoord(e),b=this._convertToCellCoord(r),S=this._convertToCellCoord(s),P=this._convertToCellCoord(l);for(let C=v;C<=S;C++)for(let z=b;z<=P;z++){const U=this.d*z+C;if((!g||g(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&u.call(this,e,r,s,l,U,d,f,g))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let s=0;for(let d=0;d=0)continue;const d=i[u];l[u]=dr[s].shallow.indexOf(u)>=0?d:rs(d,e)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof i)}function Ar(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Rs(i)||Wr(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Ar);if(typeof i=="object"){const e=i.$name||"Object";if(!dr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=dr[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const u=i[l];s[l]=dr[e].shallow.indexOf(l)>=0?u:Ar(u)}return s}throw new Error("can't deserialize object of type "+typeof i)}class Qo{constructor(){this.first=!0}update(e,r){const s=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Fs(i){for(const e of i)if(Os(e.charCodeAt(0)))return!0;return!1}function Va(i){for(const e of i)if(!el(e.charCodeAt(0)))return!1;return!0}function el(i){return!(Ae.Arabic(i)||Ae["Arabic Supplement"](i)||Ae["Arabic Extended-A"](i)||Ae["Arabic Presentation Forms-A"](i)||Ae["Arabic Presentation Forms-B"](i))}function Os(i){return!(i!==746&&i!==747&&(i<4352||!(Ae["Bopomofo Extended"](i)||Ae.Bopomofo(i)||Ae["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Ae["CJK Compatibility Ideographs"](i)||Ae["CJK Compatibility"](i)||Ae["CJK Radicals Supplement"](i)||Ae["CJK Strokes"](i)||!(!Ae["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Ae["CJK Unified Ideographs Extension A"](i)||Ae["CJK Unified Ideographs"](i)||Ae["Enclosed CJK Letters and Months"](i)||Ae["Hangul Compatibility Jamo"](i)||Ae["Hangul Jamo Extended-A"](i)||Ae["Hangul Jamo Extended-B"](i)||Ae["Hangul Jamo"](i)||Ae["Hangul Syllables"](i)||Ae.Hiragana(i)||Ae["Ideographic Description Characters"](i)||Ae.Kanbun(i)||Ae["Kangxi Radicals"](i)||Ae["Katakana Phonetic Extensions"](i)||Ae.Katakana(i)&&i!==12540||!(!Ae["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Ae["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Ae["Unified Canadian Aboriginal Syllabics"](i)||Ae["Unified Canadian Aboriginal Syllabics Extended"](i)||Ae["Vertical Forms"](i)||Ae["Yijing Hexagram Symbols"](i)||Ae["Yi Syllables"](i)||Ae["Yi Radicals"](i))))}function tl(i){return!(Os(i)||function(e){return!!(Ae["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Ae["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Ae["Letterlike Symbols"](e)||Ae["Number Forms"](e)||Ae["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ae["Control Pictures"](e)&&e!==9251||Ae["Optical Character Recognition"](e)||Ae["Enclosed Alphanumerics"](e)||Ae["Geometric Shapes"](e)||Ae["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Ae["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ae["CJK Symbols and Punctuation"](e)||Ae.Katakana(e)||Ae["Private Use Area"](e)||Ae["CJK Compatibility Forms"](e)||Ae["Small Form Variants"](e)||Ae["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function Us(i){return i>=1424&&i<=2303||Ae["Arabic Presentation Forms-A"](i)||Ae["Arabic Presentation Forms-B"](i)}function Vs(i,e){return!(!e&&Us(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Ae.Khmer(i))}function il(i){for(const e of i)if(Us(e.charCodeAt(0)))return!0;return!1}const Na="deferred",Ns="loading",$a="loaded";let ns=null,Mi="unavailable",jr=null;const rl=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(Mi="error"),ns&&ns(i)};function qa(){$s.fire(new wr("pluginStateChange",{pluginStatus:Mi,pluginURL:jr}))}const $s=new vn,ja=function(){return Mi},nl=function(){if(Mi!==Na||!jr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Mi=Ns,qa(),jr&&xn({url:jr},i=>{i?rl(i):(Mi=$a,qa())})},Ji={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Mi===$a||Ji.applyArabicShaping!=null,isLoading:()=>Mi===Ns,setState(i){if(!Zi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Mi=i.pluginStatus,jr=i.pluginURL},isParsed(){if(!Zi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ji.applyArabicShaping!=null&&Ji.processBidirectionalText!=null&&Ji.processStyledBidirectionalText!=null},getPluginURL(){if(!Zi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return jr}};class kt{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Qo,this.transition={})}isSupportedScript(e){return function(r,s){for(const l of r)if(!Vs(l.charCodeAt(0),s))return!1;return!0}(e,Ji.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),s=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class qs{constructor(e,r){this.property=e,this.value=r,this.expression=function(s,l){if(Ps(s))return new It(s,l);if(Ms(s)){const u=Cs(s,l);if(u.result==="error")throw new Error(u.value.map(d=>`${d.key}: ${d.message}`).join(", "));return u.value}{let u=s;return l.type==="color"&&typeof s=="string"?u=Ze.parse(s):l.type!=="padding"||typeof s!="number"&&!Array.isArray(s)||(u=Li.parse(s)),{kind:"constant",evaluate:()=>u}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,s){return this.property.possiblyEvaluate(this,e,r,s)}}class Za{constructor(e){this.property=e,this.value=new qs(e,void 0)}transitioned(e,r){return new ss(this.property,this.value,r,pt({},e.transition,this.transition),e.now)}untransitioned(){return new ss(this.property,this.value,null,{},0)}}class sl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Ct(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Za(this._values[e].property)),this._values[e].value=new qs(this._values[e].property,r===null?void 0:Ct(r))}getTransition(e){return Ct(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Za(this._values[e].property)),this._values[e].transition=Ct(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s);const l=this.getTransition(r);l!==void 0&&(e[`${r}-transition`]=l)}return e}transitioned(e,r){const s=new al(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].transitioned(e,r._values[l]);return s}untransitioned(){const e=new al(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class ss{constructor(e,r,s,l,u){this.property=e,this.value=r,this.begin=u+l.delay||0,this.end=this.begin+l.duration||0,e.specification.transition&&(l.delay||l.duration)&&(this.prior=s)}possiblyEvaluate(e,r,s){const l=e.now||0,u=this.value.possiblyEvaluate(e,r,s),d=this.prior;if(d){if(l>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(l=1)return 1;const v=g*g,b=v*g;return 4*(g<.5?b:3*(g-v)+b-.75)}(f))}}return u}}class al{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,s){const l=new js(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,s);return l}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ga{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return Ct(this._values[e].value)}setValue(e,r){this._values[e]=new qs(this._values[e].property,r===null?void 0:Ct(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s)}return e}possiblyEvaluate(e,r,s){const l=new js(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,s);return l}}class pr{constructor(e,r,s){this.property=e,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,s,l){return this.property.evaluate(this.value,this.parameters,e,r,s,l)}}class js{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Fe{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,s){const l=Bi[this.specification.type];return l?l(e,r,s):e}}class qe{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,s,l){return new pr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},s,l)}:e.expression,r)}interpolate(e,r,s){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new pr(this,{kind:"constant",value:void 0},e.parameters);const l=Bi[this.specification.type];if(l){const u=l(e.value.value,r.value.value,s);return new pr(this,{kind:"constant",value:u},e.parameters)}return e}evaluate(e,r,s,l,u,d){return e.kind==="constant"?e.value:e.evaluate(r,s,l,u,d)}}class as extends qe{possiblyEvaluate(e,r,s,l){if(e.value===void 0)return new pr(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},s,l),d=e.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,f=this._calculate(d,d,d,r);return new pr(this,{kind:"constant",value:f},r)}if(e.expression.kind==="camera"){const u=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new pr(this,{kind:"constant",value:u},r)}return new pr(this,e.expression,r)}evaluate(e,r,s,l,u,d){if(e.kind==="source"){const f=e.evaluate(r,s,l,u,d);return this._calculate(f,f,f,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},s,l),e.evaluate({zoom:Math.floor(r.zoom)},s,l),e.evaluate({zoom:Math.floor(r.zoom)+1},s,l),r):e.value}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Xa{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){if(e.value!==void 0){if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},s,l);return this._calculate(u,u,u,r)}return this._calculate(e.expression.evaluate(new kt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new kt(Math.floor(r.zoom),r)),e.expression.evaluate(new kt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Wa{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){return!!e.expression.evaluate(r,null,{},s,l)}interpolate(){return!1}}class Ci{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const s=e[r];s.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new qs(s,void 0),u=this.defaultTransitionablePropertyValues[r]=new Za(s);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}De("DataDrivenProperty",qe),De("DataConstantProperty",Fe),De("CrossFadedDataDrivenProperty",as),De("CrossFadedProperty",Xa),De("ColorRampProperty",Wa);const ol="-transition";class fr extends vn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Ga(r.layout)),r.paint)){this._transitionablePaint=new sl(r.paint);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new js(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,s={}){r!=null&&this._validate(nc,`layers.${this.id}.layout.${e}`,e,r,s)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(ol)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,s={}){if(r!=null&&this._validate(rc,`layers.${this.id}.paint.${e}`,e,r,s))return!1;if(e.endsWith(ol))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[e],u=l.property.specification["property-type"]==="cross-faded-data-driven",d=l.value.isDataDriven(),f=l.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const g=this._transitionablePaint._values[e].value;return g.isDataDriven()||d||u||this._handleOverridablePaintPropertyUpdate(e,f,g)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,s){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Mt(e,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(e,r,s,l,u={}){return(!u||u.validate!==!1)&&Dn(this,e.call(qr,{key:r,layerType:this.type,objectKey:s,value:l,styleSpec:le,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof pr&&Cn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const sc={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Pr{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ft{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Kt(i,e=1){let r=0,s=0;return{members:i.map(l=>{const u=sc[l.type].BYTES_PER_ELEMENT,d=r=ll(r,Math.max(e,u)),f=l.components||1;return s=Math.max(s,u),r+=u*f,{name:l.name,type:l.type,components:f,offset:d}}),size:ll(r,Math.max(s,e)),alignment:e}}function ll(i,e){return Math.ceil(i/e)*e}class Ln extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.int16[l+0]=r,this.int16[l+1]=s,e}}Ln.prototype.bytesPerElement=4,De("StructArrayLayout2i4",Ln);class Zs extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.int16[u+0]=r,this.int16[u+1]=s,this.int16[u+2]=l,e}}Zs.prototype.bytesPerElement=6,De("StructArrayLayout3i6",Zs);class Ha extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const d=4*e;return this.int16[d+0]=r,this.int16[d+1]=s,this.int16[d+2]=l,this.int16[d+3]=u,e}}Ha.prototype.bytesPerElement=8,De("StructArrayLayout4i8",Ha);class mr extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,d)}emplace(e,r,s,l,u,d,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=d,this.int16[g+5]=f,e}}mr.prototype.bytesPerElement=12,De("StructArrayLayout2i4i12",mr);class Gs extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,d)}emplace(e,r,s,l,u,d,f){const g=4*e,v=8*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.uint8[v+4]=l,this.uint8[v+5]=u,this.uint8[v+6]=d,this.uint8[v+7]=f,e}}Gs.prototype.bytesPerElement=8,De("StructArrayLayout2i4ub8",Gs);class sn extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.float32[l+0]=r,this.float32[l+1]=s,e}}sn.prototype.bytesPerElement=8,De("StructArrayLayout2f8",sn);class Xs extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b){const S=this.length;return this.resize(S+1),this.emplace(S,e,r,s,l,u,d,f,g,v,b)}emplace(e,r,s,l,u,d,f,g,v,b,S){const P=10*e;return this.uint16[P+0]=r,this.uint16[P+1]=s,this.uint16[P+2]=l,this.uint16[P+3]=u,this.uint16[P+4]=d,this.uint16[P+5]=f,this.uint16[P+6]=g,this.uint16[P+7]=v,this.uint16[P+8]=b,this.uint16[P+9]=S,e}}Xs.prototype.bytesPerElement=20,De("StructArrayLayout10ui20",Xs);class os extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b,S,P){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,s,l,u,d,f,g,v,b,S,P)}emplace(e,r,s,l,u,d,f,g,v,b,S,P,C){const z=12*e;return this.int16[z+0]=r,this.int16[z+1]=s,this.int16[z+2]=l,this.int16[z+3]=u,this.uint16[z+4]=d,this.uint16[z+5]=f,this.uint16[z+6]=g,this.uint16[z+7]=v,this.int16[z+8]=b,this.int16[z+9]=S,this.int16[z+10]=P,this.int16[z+11]=C,e}}os.prototype.bytesPerElement=24,De("StructArrayLayout4i4ui4i24",os);class Ka extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.float32[u+0]=r,this.float32[u+1]=s,this.float32[u+2]=l,e}}Ka.prototype.bytesPerElement=12,De("StructArrayLayout3f12",Ka);class Bn extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}Bn.prototype.bytesPerElement=4,De("StructArrayLayout1ul4",Bn);class an extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,s,l,u,d,f,g,v)}emplace(e,r,s,l,u,d,f,g,v,b){const S=10*e,P=5*e;return this.int16[S+0]=r,this.int16[S+1]=s,this.int16[S+2]=l,this.int16[S+3]=u,this.int16[S+4]=d,this.int16[S+5]=f,this.uint32[P+3]=g,this.uint16[S+8]=v,this.uint16[S+9]=b,e}}an.prototype.bytesPerElement=20,De("StructArrayLayout6i1ul2ui20",an);class Ya extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,d)}emplace(e,r,s,l,u,d,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=d,this.int16[g+5]=f,e}}Ya.prototype.bytesPerElement=12,De("StructArrayLayout2i2i2i12",Ya);class Ws extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,s,l,u)}emplace(e,r,s,l,u,d){const f=4*e,g=8*e;return this.float32[f+0]=r,this.float32[f+1]=s,this.float32[f+2]=l,this.int16[g+6]=u,this.int16[g+7]=d,e}}Ws.prototype.bytesPerElement=16,De("StructArrayLayout2f1f2i16",Ws);class on extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const d=12*e,f=3*e;return this.uint8[d+0]=r,this.uint8[d+1]=s,this.float32[f+1]=l,this.float32[f+2]=u,e}}on.prototype.bytesPerElement=12,De("StructArrayLayout2ub2f12",on);class Hs extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.uint16[u+0]=r,this.uint16[u+1]=s,this.uint16[u+2]=l,e}}Hs.prototype.bytesPerElement=6,De("StructArrayLayout3ui6",Hs);class Ja extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K)}emplace(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q){const X=24*e,ne=12*e,ae=48*e;return this.int16[X+0]=r,this.int16[X+1]=s,this.uint16[X+2]=l,this.uint16[X+3]=u,this.uint32[ne+2]=d,this.uint32[ne+3]=f,this.uint32[ne+4]=g,this.uint16[X+10]=v,this.uint16[X+11]=b,this.uint16[X+12]=S,this.float32[ne+7]=P,this.float32[ne+8]=C,this.uint8[ae+36]=z,this.uint8[ae+37]=U,this.uint8[ae+38]=F,this.uint32[ne+10]=K,this.int16[X+22]=Q,e}}Ja.prototype.bytesPerElement=48,De("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ja);class Ks extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q,X,ne,ae,he,ze,Be,Pe,Se,Te,Me){const Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q,X,ne,ae,he,ze,Be,Pe,Se,Te,Me)}emplace(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q,X,ne,ae,he,ze,Be,Pe,Se,Te,Me,Ie){const ye=34*e,Ve=17*e;return this.int16[ye+0]=r,this.int16[ye+1]=s,this.int16[ye+2]=l,this.int16[ye+3]=u,this.int16[ye+4]=d,this.int16[ye+5]=f,this.int16[ye+6]=g,this.int16[ye+7]=v,this.uint16[ye+8]=b,this.uint16[ye+9]=S,this.uint16[ye+10]=P,this.uint16[ye+11]=C,this.uint16[ye+12]=z,this.uint16[ye+13]=U,this.uint16[ye+14]=F,this.uint16[ye+15]=K,this.uint16[ye+16]=Q,this.uint16[ye+17]=X,this.uint16[ye+18]=ne,this.uint16[ye+19]=ae,this.uint16[ye+20]=he,this.uint16[ye+21]=ze,this.uint16[ye+22]=Be,this.uint32[Ve+12]=Pe,this.float32[Ve+13]=Se,this.float32[Ve+14]=Te,this.float32[Ve+15]=Me,this.float32[Ve+16]=Ie,e}}Ks.prototype.bytesPerElement=68,De("StructArrayLayout8i15ui1ul4f68",Ks);class Ys extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}Ys.prototype.bytesPerElement=4,De("StructArrayLayout1f4",Ys);class Js extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=4*e;return this.uint32[2*e+0]=r,this.uint16[u+2]=s,this.uint16[u+3]=l,e}}Js.prototype.bytesPerElement=8,De("StructArrayLayout1ul2ui8",Js);class o extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.uint16[l+0]=r,this.uint16[l+1]=s,e}}o.prototype.bytesPerElement=4,De("StructArrayLayout2ui4",o);class t extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}t.prototype.bytesPerElement=2,De("StructArrayLayout1ui2",t);class n extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const d=4*e;return this.float32[d+0]=r,this.float32[d+1]=s,this.float32[d+2]=l,this.float32[d+3]=u,e}}n.prototype.bytesPerElement=16,De("StructArrayLayout4f16",n);class a extends Pr{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new xe(this.anchorPointX,this.anchorPointY)}}a.prototype.size=20;class c extends an{get(e){return new a(this,e)}}De("CollisionBoxArray",c);class p extends Pr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}p.prototype.size=48;class m extends Ja{get(e){return new p(this,e)}}De("PlacedSymbolArray",m);class y extends Pr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}y.prototype.size=68;class _ extends Ks{get(e){return new y(this,e)}}De("SymbolInstanceArray",_);class x extends Ys{getoffsetX(e){return this.float32[1*e+0]}}De("GlyphOffsetArray",x);class T extends Zs{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}De("SymbolLineVertexArray",T);class w extends Pr{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]}}w.prototype.size=8;class k extends Js{get(e){return new w(this,e)}}De("FeatureIndexArray",k);class O extends Ln{}class B extends Ln{}class R extends Ln{}class q extends mr{}class H extends Gs{}class se extends sn{}class $ extends Xs{}class re extends os{}class oe extends Ka{}class me extends Bn{}class _e extends Ya{}class ve extends on{}class ge extends Hs{}class Ce extends o{}const Ue=Kt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ke}=Ue;class Ee{constructor(e=[]){this.segments=e}prepareSegment(e,r,s,l){let u=this.segments[this.segments.length-1];return e>Ee.MAX_VERTEX_ARRAY_LENGTH&&Vt(`Max vertices per segment is ${Ee.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!u||u.vertexLength+e>Ee.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==l)&&(u={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},l!==void 0&&(u.sortKey=l),this.segments.push(u)),u}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,s,l){return new Ee([{vertexOffset:e,primitiveOffset:r,vertexLength:s,primitiveLength:l,vaos:{},sortKey:0}])}}function je(i,e){return 256*(i=et(Math.floor(i),0,255))+et(Math.floor(e),0,255)}Ee.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,De("SegmentVector",Ee);const ke=Kt([{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 ut={exports:{}},qt={exports:{}};qt.exports=function(i,e){var r,s,l,u,d,f,g,v;for(s=i.length-(r=3&i.length),l=e,d=3432918353,f=461845907,v=0;v>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>16)*f&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(g=0,r){case 3:g^=(255&i.charCodeAt(v+2))<<16;case 2:g^=(255&i.charCodeAt(v+1))<<8;case 1:l^=g=(65535&(g=(g=(65535&(g^=255&i.charCodeAt(v)))*d+(((g>>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>16)*f&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var dt=qt.exports,Je={exports:{}};Je.exports=function(i,e){for(var r,s=i.length,l=e^s,u=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++u;switch(s){case 3:l^=(255&i.charCodeAt(u+2))<<16;case 2:l^=(255&i.charCodeAt(u+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(u)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var Ot=dt,wi=Je.exports;ut.exports=Ot,ut.exports.murmur3=Ot,ut.exports.murmur2=wi;var jt=ce(ut.exports);class si{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,s,l){this.ids.push(Fi(e)),this.positions.push(r,s,l)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Fi(e);let s=0,l=this.ids.length-1;for(;s>1;this.ids[d]>=r?l=d:s=d+1}const u=[];for(;this.ids[s]===r;)u.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return u}static serialize(e,r){const s=new Float64Array(e.ids),l=new Uint32Array(e.positions);return ir(s,l,0,s.length-1),r&&r.push(s.buffer,l.buffer),{ids:s,positions:l}}static deserialize(e){const r=new si;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Fi(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:jt(String(i))}function ir(i,e,r,s){for(;r>1];let u=r-1,d=s+1;for(;;){do u++;while(i[u]l);if(u>=d)break;rr(i,u,d),rr(e,3*u,3*d),rr(e,3*u+1,3*d+1),rr(e,3*u+2,3*d+2)}d-r`u_${l}`),this.type=s}setUniform(e,r,s){e.set(s.constantOr(this.value))}getBinding(e,r,s){return this.type==="color"?new mi(e,r):new gr(e,r)}}class oi{constructor(e,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,s,l){const u=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)}getBinding(e,r,s){return s.substr(0,9)==="u_pattern"?new ls(e,r):new gr(e,r)}}class gt{constructor(e,r,s,l){this.expression=e,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(e,r,s,l,u){const d=this.paintVertexArray.length,f=this.expression.evaluate(new kt(0),r,{},l,[],u);this.paintVertexArray.resize(e),this._setPaintValue(d,e,f)}updatePaintArray(e,r,s,l){const u=this.expression.evaluate({zoom:0},s,l);this._setPaintValue(e,r,u)}_setPaintValue(e,r,s){if(this.type==="color"){const l=ft(s);for(let u=e;u`u_${f}_t`),this.type=s,this.useIntegerZoom=l,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(e,r,s,l,u){const d=this.expression.evaluate(new kt(this.zoom),r,{},l,[],u),f=this.expression.evaluate(new kt(this.zoom+1),r,{},l,[],u),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,d,f)}updatePaintArray(e,r,s,l){const u=this.expression.evaluate({zoom:this.zoom},s,l),d=this.expression.evaluate({zoom:this.zoom+1},s,l);this._setPaintValue(e,r,u,d)}_setPaintValue(e,r,s,l){if(this.type==="color"){const u=ft(s),d=ft(l);for(let f=e;f`#define HAS_UNIFORM_${l}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof gt||s instanceof ti)for(let l=0;l!0){this.programConfigurations={};for(const l of e)this.programConfigurations[l.id]=new Qs(l,r,s);this.needsUpload=!1,this._featureMap=new si,this._bufferOffset=0}populatePaintArrays(e,r,s,l,u,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,l,u,d);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,s,l){for(const u of s)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,l)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function ac(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function cl(i,e,r){const s={color:{source:sn,composite:n},number:{source:Ys,composite:sn}},l=function(u){return{"line-pattern":{source:$,composite:$},"fill-pattern":{source:$,composite:$},"fill-extrusion-pattern":{source:$,composite:$}}[u]}(i);return l&&l[r]||s[e][r]}De("ConstantBinder",ei),De("CrossFadedConstantBinder",oi),De("SourceExpressionBinder",gt),De("CrossFadedCompositeBinder",Oi),De("CompositeExpressionBinder",ti),De("ProgramConfiguration",Qs,{omit:["_buffers"]}),De("ProgramConfigurationSet",Mr);var At=8192;const Qa=Math.pow(2,14)-1,cs=-Qa-1;function Cr(i){const e=At/i.extent,r=i.loadGeometry();for(let s=0;sd.x+1||gd.y+1)&&Vt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function hs(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Cr(i):[]}}function hl(i,e,r,s,l){i.emplaceBack(2*e+(s+1)/2,2*r+(l+1)/2)}class oc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new B,this.indexArray=new ge,this.segments=new Ee,this.programConfigurations=new Mr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){const l=this.layers[0],u=[];let d=null,f=!1;l.type==="circle"&&(d=l.layout.get("circle-sort-key"),f=!d.isConstant());for(const{feature:g,id:v,index:b,sourceLayerIndex:S}of e){const P=this.layers[0]._featureFilter.needGeometry,C=hs(g,P);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),C,s))continue;const z=f?d.evaluate(C,{},s):void 0,U={id:v,properties:g.properties,type:g.type,sourceLayerIndex:S,index:b,geometry:P?C.geometry:Cr(g),patterns:{},sortKey:z};u.push(U)}f&&u.sort((g,v)=>g.sortKey-v.sortKey);for(const g of u){const{geometry:v,index:b,sourceLayerIndex:S}=g,P=e[b].feature;this.addFeature(g,v,b,s),r.featureIndex.insert(P,v,b,S,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ke),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,s,l){for(const u of r)for(const d of u){const f=d.x,g=d.y;if(f<0||f>=At||g<0||g>=At)continue;const v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=v.vertexLength;hl(this.layoutVertexArray,f,g,-1,-1),hl(this.layoutVertexArray,f,g,1,-1),hl(this.layoutVertexArray,f,g,1,1),hl(this.layoutVertexArray,f,g,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),v.vertexLength+=4,v.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,{},l)}}function yh(i,e){for(let r=0;r1){if(lc(i,e))return!0;for(let s=0;s1?r:r.sub(e)._mult(l)._add(e))}function bh(i,e){let r,s,l,u=!1;for(let d=0;de.y!=l.y>e.y&&e.x<(l.x-s.x)*(e.y-s.y)/(l.y-s.y)+s.x&&(u=!u)}return u}function ea(i,e){let r=!1;for(let s=0,l=i.length-1;se.y!=d.y>e.y&&e.x<(d.x-u.x)*(e.y-u.y)/(d.y-u.y)+u.x&&(r=!r)}return r}function kd(i,e,r){const s=r[0],l=r[2];if(i.xl.x&&e.x>l.x||i.yl.y&&e.y>l.y)return!1;const u=yt(i,e,r[0]);return u!==yt(i,e,r[1])||u!==yt(i,e,r[2])||u!==yt(i,e,r[3])}function eo(i,e,r){const s=e.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(e.id).getMaxValue(i)}function ul(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function dl(i,e,r,s,l){if(!e[0]&&!e[1])return i;const u=xe.convert(e)._mult(l);r==="viewport"&&u._rotate(-s);const d=[];for(let f=0;fi.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>e.width||l.height>e.height||s.x>e.width-l.width||s.y>e.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=e.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g{e[i.evaluationKey]=g;const v=i.expression.evaluate(e);l.data[d+f+0]=Math.floor(255*v.r/v.a),l.data[d+f+1]=Math.floor(255*v.g/v.a),l.data[d+f+2]=Math.floor(255*v.b/v.a),l.data[d+f+3]=Math.floor(255*v.a)};if(i.clips)for(let d=0,f=0;d80*r){s=u=i[0],l=d=i[1];for(var z=r;zu&&(u=f),g>d&&(d=g);v=(v=Math.max(u-s,d-l))!==0?32767/v:0}return ro(P,C,r,s,l,v,0),C}function kh(i,e,r,s,l){var u,d;if(l===gc(i,e,r,s)>0)for(u=e;u=e;u-=s)d=Lh(u,i[u],i[u+1],d);return d&&ml(d,d.next)&&(so(d),d=d.next),d}function us(i,e){if(!i)return i;e||(e=i);var r,s=i;do if(r=!1,s.steiner||!ml(s,s.next)&&Zt(s.prev,s,s.next)!==0)s=s.next;else{if(so(s),(s=e=s.prev)===s.next)break;r=!0}while(r||s!==e);return e}function ro(i,e,r,s,l,u,d){if(i){!d&&u&&function(b,S,P,C){var z=b;do z.z===0&&(z.z=fc(z.x,z.y,S,P,C)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==b);z.prevZ.nextZ=null,z.prevZ=null,function(U){var F,K,Q,X,ne,ae,he,ze,Be=1;do{for(K=U,U=null,ne=null,ae=0;K;){for(ae++,Q=K,he=0,F=0;F0||ze>0&&Q;)he!==0&&(ze===0||!Q||K.z<=Q.z)?(X=K,K=K.nextZ,he--):(X=Q,Q=Q.nextZ,ze--),ne?ne.nextZ=X:U=X,X.prevZ=ne,ne=X;K=Q}ne.nextZ=null,Be*=2}while(ae>1)}(z)}(i,s,l,u);for(var f,g,v=i;i.prev!==i.next;)if(f=i.prev,g=i.next,u?Ud(i,s,l,u):Od(i))e.push(f.i/r|0),e.push(i.i/r|0),e.push(g.i/r|0),so(i),i=g.next,v=g.next;else if((i=g)===v){d?d===1?ro(i=Vd(us(i),e,r),e,r,s,l,u,2):d===2&&Nd(i,e,r,s,l,u):ro(us(i),e,r,s,l,u,1);break}}}function Od(i){var e=i.prev,r=i,s=i.next;if(Zt(e,r,s)>=0)return!1;for(var l=e.x,u=r.x,d=s.x,f=e.y,g=r.y,v=s.y,b=lu?l>d?l:d:u>d?u:d,C=f>g?f>v?f:v:g>v?g:v,z=s.next;z!==e;){if(z.x>=b&&z.x<=P&&z.y>=S&&z.y<=C&&ia(l,f,u,g,d,v,z.x,z.y)&&Zt(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function Ud(i,e,r,s){var l=i.prev,u=i,d=i.next;if(Zt(l,u,d)>=0)return!1;for(var f=l.x,g=u.x,v=d.x,b=l.y,S=u.y,P=d.y,C=fg?f>v?f:v:g>v?g:v,F=b>S?b>P?b:P:S>P?S:P,K=fc(C,z,e,r,s),Q=fc(U,F,e,r,s),X=i.prevZ,ne=i.nextZ;X&&X.z>=K&&ne&&ne.z<=Q;){if(X.x>=C&&X.x<=U&&X.y>=z&&X.y<=F&&X!==l&&X!==d&&ia(f,b,g,S,v,P,X.x,X.y)&&Zt(X.prev,X,X.next)>=0||(X=X.prevZ,ne.x>=C&&ne.x<=U&&ne.y>=z&&ne.y<=F&&ne!==l&&ne!==d&&ia(f,b,g,S,v,P,ne.x,ne.y)&&Zt(ne.prev,ne,ne.next)>=0))return!1;ne=ne.nextZ}for(;X&&X.z>=K;){if(X.x>=C&&X.x<=U&&X.y>=z&&X.y<=F&&X!==l&&X!==d&&ia(f,b,g,S,v,P,X.x,X.y)&&Zt(X.prev,X,X.next)>=0)return!1;X=X.prevZ}for(;ne&&ne.z<=Q;){if(ne.x>=C&&ne.x<=U&&ne.y>=z&&ne.y<=F&&ne!==l&&ne!==d&&ia(f,b,g,S,v,P,ne.x,ne.y)&&Zt(ne.prev,ne,ne.next)>=0)return!1;ne=ne.nextZ}return!0}function Vd(i,e,r){var s=i;do{var l=s.prev,u=s.next.next;!ml(l,u)&&zh(l,s,s.next,u)&&no(l,u)&&no(u,l)&&(e.push(l.i/r|0),e.push(s.i/r|0),e.push(u.i/r|0),so(s),so(s.next),s=i=u),s=s.next}while(s!==i);return us(s)}function Nd(i,e,r,s,l,u){var d=i;do{for(var f=d.next.next;f!==d.prev;){if(d.i!==f.i&&Gd(d,f)){var g=Dh(d,f);return d=us(d,d.next),g=us(g,g.next),ro(d,e,r,s,l,u,0),void ro(g,e,r,s,l,u,0)}f=f.next}d=d.next}while(d!==i)}function $d(i,e){return i.x-e.x}function qd(i,e){var r=function(l,u){var d,f=u,g=l.x,v=l.y,b=-1/0;do{if(v<=f.y&&v>=f.next.y&&f.next.y!==f.y){var S=f.x+(v-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(S<=g&&S>b&&(b=S,d=f.x=f.x&&f.x>=z&&g!==f.x&&ia(vd.x||f.x===d.x&&jd(d,f)))&&(d=f,F=P)),f=f.next;while(f!==C);return d}(i,e);if(!r)return e;var s=Dh(r,i);return us(s,s.next),us(r,r.next)}function jd(i,e){return Zt(i.prev,i,e.prev)<0&&Zt(e.next,i,i.next)<0}function fc(i,e,r,s,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*l|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Zd(i){var e=i,r=i;do(e.x=(i-d)*(u-f)&&(i-d)*(s-f)>=(r-d)*(e-f)&&(r-d)*(u-f)>=(l-d)*(s-f)}function Gd(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,s){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==s.i&&l.next.i!==s.i&&zh(l,l.next,r,s))return!0;l=l.next}while(l!==r);return!1}(i,e)&&(no(i,e)&&no(e,i)&&function(r,s){var l=r,u=!1,d=(r.x+s.x)/2,f=(r.y+s.y)/2;do l.y>f!=l.next.y>f&&l.next.y!==l.y&&d<(l.next.x-l.x)*(f-l.y)/(l.next.y-l.y)+l.x&&(u=!u),l=l.next;while(l!==r);return u}(i,e)&&(Zt(i.prev,i,e.prev)||Zt(i,e.prev,e))||ml(i,e)&&Zt(i.prev,i,i.next)>0&&Zt(e.prev,e,e.next)>0)}function Zt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function ml(i,e){return i.x===e.x&&i.y===e.y}function zh(i,e,r,s){var l=_l(Zt(i,e,r)),u=_l(Zt(i,e,s)),d=_l(Zt(r,s,i)),f=_l(Zt(r,s,e));return l!==u&&d!==f||!(l!==0||!gl(i,r,e))||!(u!==0||!gl(i,s,e))||!(d!==0||!gl(r,i,s))||!(f!==0||!gl(r,e,s))}function gl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function _l(i){return i>0?1:i<0?-1:0}function no(i,e){return Zt(i.prev,i,i.next)<0?Zt(i,e,i.next)>=0&&Zt(i,i.prev,e)>=0:Zt(i,e,i.prev)<0||Zt(i,i.next,e)<0}function Dh(i,e){var r=new mc(i.i,i.x,i.y),s=new mc(e.i,e.x,e.y),l=i.next,u=e.prev;return i.next=e,e.prev=i,r.next=l,l.prev=r,s.next=r,r.prev=s,u.next=s,s.prev=u,s}function Lh(i,e,r,s){var l=new mc(i,e,r);return s?(l.next=s.next,l.prev=s,s.next.prev=l,s.next=l):(l.prev=l,l.next=l),l}function so(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function mc(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function gc(i,e,r,s){for(var l=0,u=e,d=r-s;u0&&r.holes.push(s+=i[l-1].length)}return r};var Bh=ce(pc.exports);function Xd(i,e,r,s,l){Rh(i,e,r||0,s||i.length-1,l||Wd)}function Rh(i,e,r,s,l){for(;s>r;){if(s-r>600){var u=s-r+1,d=e-r+1,f=Math.log(u),g=.5*Math.exp(2*f/3),v=.5*Math.sqrt(f*g*(u-g)/u)*(d-u/2<0?-1:1);Rh(i,e,Math.max(r,Math.floor(e-d*g/u+v)),Math.min(s,Math.floor(e+(u-d)*g/u+v)),l)}var b=i[e],S=r,P=s;for(ao(i,r,e),l(i[s],b)>0&&ao(i,r,s);S0;)P--}l(i[r],b)===0?ao(i,r,P):ao(i,++P,s),P<=e&&(r=P+1),e<=P&&(s=P-1)}}function ao(i,e,r){var s=i[e];i[e]=i[r],i[r]=s}function Wd(i,e){return ie?1:0}function _c(i,e){const r=i.length;if(r<=1)return[i];const s=[];let l,u;for(let d=0;d1)for(let d=0;dr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new R,this.indexArray=new ge,this.indexArray2=new Ce,this.programConfigurations=new Mr(e.layers,e.zoom),this.segments=new Ee,this.segments2=new Ee,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=yc("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:g,index:v,sourceLayerIndex:b}of e){const S=this.layers[0]._featureFilter.needGeometry,P=hs(f,S);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),P,s))continue;const C=u?l.evaluate(P,{},s,r.availableImages):void 0,z={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:v,geometry:S?P.geometry:Cr(f),patterns:{},sortKey:C};d.push(z)}u&&d.sort((f,g)=>f.sortKey-g.sortKey);for(const f of d){const{geometry:g,index:v,sourceLayerIndex:b}=f;if(this.hasPattern){const S=xc("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(S)}else this.addFeature(f,g,v,s,{});r.featureIndex.insert(e[v].feature,g,v,b,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,s,l,u){for(const d of _c(r,500)){let f=0;for(const C of d)f+=C.length;const g=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),v=g.vertexLength,b=[],S=[];for(const C of d){if(C.length===0)continue;C!==d[0]&&S.push(b.length/2);const z=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),U=z.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(U+C.length-1,U),b.push(C[0].x),b.push(C[0].y);for(let F=1;F>3}if(l--,s===1||s===2)u+=i.readSVarint(),d+=i.readSVarint(),s===1&&(e&&f.push(e),e=[]),e.push(new ep(u,d));else{if(s!==7)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&f.push(e),f},ra.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,s=0,l=0,u=0,d=1/0,f=-1/0,g=1/0,v=-1/0;i.pos>3}if(s--,r===1||r===2)(l+=i.readSVarint())f&&(f=l),(u+=i.readSVarint())v&&(v=u);else if(r!==7)throw new Error("unknown command "+r)}return[d,g,f,v]},ra.prototype.toGeoJSON=function(i,e,r){var s,l,u=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*e,g=this.loadGeometry(),v=ra.types[this.type];function b(C){for(var z=0;z>3;l=d===1?s.readString():d===2?s.readFloat():d===3?s.readDouble():d===4?s.readVarint64():d===5?s.readVarint():d===6?s.readSVarint():d===7?s.readBoolean():null}return l}(r))}Nh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new rp(this._pbf,e,this.extent,this._keys,this._values)};var sp=Vh;function ap(i,e,r){if(i===3){var s=new sp(r,r.readVarint()+r.pos);s.length&&(e[s.name]=s)}}Rn.VectorTile=function(i,e){this.layers=i.readFields(ap,{},e)},Rn.VectorTileFeature=Uh,Rn.VectorTileLayer=Vh;const op=Rn.VectorTileFeature.types,bc=Math.pow(2,13);function oo(i,e,r,s,l,u,d,f){i.emplaceBack(e,r,2*Math.floor(s*bc)+d,l*bc*2,u*bc*2,Math.round(f))}class wc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new q,this.centroidVertexArray=new O,this.indexArray=new ge,this.programConfigurations=new Mr(e.layers,e.zoom),this.segments=new Ee,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.features=[],this.hasPattern=yc("fill-extrusion",this.layers,r);for(const{feature:l,id:u,index:d,sourceLayerIndex:f}of e){const g=this.layers[0]._featureFilter.needGeometry,v=hs(l,g);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),v,s))continue;const b={id:u,sourceLayerIndex:f,index:d,geometry:g?v.geometry:Cr(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(xc("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,d,s,{}),r.featureIndex.insert(l,b.geometry,d,f,this.index,!0)}}addFeatures(e,r,s){for(const l of this.features){const{geometry:u}=l;this.addFeature(l,u,l.index,r,s)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qd),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Jd.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,s,l,u){const d={x:0,y:0,vertexCount:0};for(const f of _c(r,500)){let g=0;for(const z of f)g+=z.length;let v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const z of f){if(z.length===0||cp(z))continue;let U=0;for(let F=0;F=1){const Q=z[F-1];if(!lp(K,Q)){v.vertexLength+4>Ee.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const X=K.sub(Q)._perp()._unit(),ne=Q.dist(K);U+ne>32768&&(U=0),oo(this.layoutVertexArray,K.x,K.y,X.x,X.y,0,0,U),oo(this.layoutVertexArray,K.x,K.y,X.x,X.y,0,1,U),d.x+=2*K.x,d.y+=2*K.y,d.vertexCount+=2,U+=ne,oo(this.layoutVertexArray,Q.x,Q.y,X.x,X.y,0,0,U),oo(this.layoutVertexArray,Q.x,Q.y,X.x,X.y,0,1,U),d.x+=2*Q.x,d.y+=2*Q.y,d.vertexCount+=2;const ae=v.vertexLength;this.indexArray.emplaceBack(ae,ae+2,ae+1),this.indexArray.emplaceBack(ae+1,ae+2,ae+3),v.vertexLength+=4,v.primitiveLength+=2}}}}if(v.vertexLength+g>Ee.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),op[e.type]!=="Polygon")continue;const b=[],S=[],P=v.vertexLength;for(const z of f)if(z.length!==0){z!==f[0]&&S.push(b.length/2);for(let U=0;UAt)||i.y===e.y&&(i.y<0||i.y>At)}function cp(i){return i.every(e=>e.x<0)||i.every(e=>e.x>At)||i.every(e=>e.y<0)||i.every(e=>e.y>At)}let $h;De("FillExtrusionBucket",wc,{omit:["layers","features"]});var hp={get paint(){return $h=$h||new Ci({"fill-extrusion-opacity":new Fe(le["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qe(le["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Fe(le["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Fe(le["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new as(le["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qe(le["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qe(le["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Fe(le["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};function lo(i,e){return i.x*e.x+i.y*e.y}function qh(i,e){if(i.length===1){let r=0;const s=e[r++];let l;for(;!l||s.equals(l);)if(l=e[r++],!l)return 1/0;for(;rr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new H,this.layoutVertexArray2=new se,this.indexArray=new ge,this.programConfigurations=new Mr(e.layers,e.zoom),this.segments=new Ee,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=yc("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:g,index:v,sourceLayerIndex:b}of e){const S=this.layers[0]._featureFilter.needGeometry,P=hs(f,S);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),P,s))continue;const C=u?l.evaluate(P,{},s):void 0,z={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:v,geometry:S?P.geometry:Cr(f),patterns:{},sortKey:C};d.push(z)}u&&d.sort((f,g)=>f.sortKey-g.sortKey);for(const f of d){const{geometry:g,index:v,sourceLayerIndex:b}=f;if(this.hasPattern){const S=xc("line",this.layers,f,this.zoom,r);this.patternFeatures.push(S)}else this.addFeature(f,g,v,s,{});r.featureIndex.insert(e[v].feature,g,v,b,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,fp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,dp),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,s,l,u){const d=this.layers[0].layout,f=d.get("line-join").evaluate(e,{}),g=d.get("line-cap"),v=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const S of r)this.addLine(S,e,f,g,v,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,u,l)}addLine(e,r,s,l,u,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&e[g-1].equals(e[g-2]);)g--;let v=0;for(;v0;if(ze&&K>v){const Te=P.dist(C);if(Te>2*b){const Me=P.sub(P.sub(C)._mult(b/Te)._round());this.updateDistance(C,Me),this.addCurrentVertex(Me,U,0,0,S),C=Me}}const Pe=C&&z;let Se=Pe?s:f?"butt":l;if(Pe&&Se==="round"&&(aeu&&(Se="bevel"),Se==="bevel"&&(ae>2&&(Se="flipbevel"),ae100)Q=F.mult(-1);else{const Te=ae*U.add(F).mag()/U.sub(F).mag();Q._perp()._mult(Te*(Be?-1:1))}this.addCurrentVertex(P,Q,0,0,S),this.addCurrentVertex(P,Q.mult(-1),0,0,S)}else if(Se==="bevel"||Se==="fakeround"){const Te=-Math.sqrt(ae*ae-1),Me=Be?Te:0,Ie=Be?0:Te;if(C&&this.addCurrentVertex(P,U,Me,Ie,S),Se==="fakeround"){const ye=Math.round(180*he/Math.PI/20);for(let Ve=1;Ve2*b){const Me=P.add(z.sub(P)._mult(b/Te)._round());this.updateDistance(P,Me),this.addCurrentVertex(Me,F,0,0,S),P=Me}}}}addCurrentVertex(e,r,s,l,u,d=!1){const f=r.y*l-r.x,g=-r.y-r.x*l;this.addHalfVertex(e,r.x+r.y*s,r.y-r.x*s,d,!1,s,u),this.addHalfVertex(e,f,g,d,!0,-l,u),this.distance>jh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,s,l,u,d))}addHalfVertex({x:e,y:r},s,l,u,d,f,g){const v=.5*(this.lineClips?this.scaledDistance*(jh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(u?1:0),(r<<1)+(d?1:0),Math.round(63*s)+128,Math.round(63*l)+128,1+(f===0?0:f<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),g.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let Zh,Gh;De("LineBucket",Tc,{omit:["layers","patternFeatures"]});var Xh={get paint(){return Gh=Gh||new Ci({"line-opacity":new qe(le.paint_line["line-opacity"]),"line-color":new qe(le.paint_line["line-color"]),"line-translate":new Fe(le.paint_line["line-translate"]),"line-translate-anchor":new Fe(le.paint_line["line-translate-anchor"]),"line-width":new qe(le.paint_line["line-width"]),"line-gap-width":new qe(le.paint_line["line-gap-width"]),"line-offset":new qe(le.paint_line["line-offset"]),"line-blur":new qe(le.paint_line["line-blur"]),"line-dasharray":new Xa(le.paint_line["line-dasharray"]),"line-pattern":new as(le.paint_line["line-pattern"]),"line-gradient":new Wa(le.paint_line["line-gradient"])})},get layout(){return Zh=Zh||new Ci({"line-cap":new Fe(le.layout_line["line-cap"]),"line-join":new qe(le.layout_line["line-join"]),"line-miter-limit":new Fe(le.layout_line["line-miter-limit"]),"line-round-limit":new Fe(le.layout_line["line-round-limit"]),"line-sort-key":new qe(le.layout_line["line-sort-key"])})}};class _p extends qe{possiblyEvaluate(e,r){return r=new kt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,s,l){return r=pt({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,s,l)}}let yl;function Wh(i,e){return e>0?e+2*i:i}const yp=Kt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),xp=Kt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Kt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const vp=Kt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Kt([{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 Hh=Kt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),bp=Kt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function wp(i,e,r){return i.sections.forEach(s=>{s.text=function(l,u,d){const f=u.layout.get("text-transform").evaluate(d,{});return f==="uppercase"?l=l.toLocaleUpperCase():f==="lowercase"&&(l=l.toLocaleLowerCase()),Ji.applyArabicShaping&&(l=Ji.applyArabicShaping(l)),l}(s.text,e,r)}),i}Kt([{name:"triangle",components:3,type:"Uint16"}]),Kt([{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"}]),Kt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Kt([{type:"Float32",name:"offsetX"}]),Kt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const co={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var li=24,Kh=vt,Yh=function(i,e,r,s,l){var u,d,f=8*l-s-1,g=(1<>1,b=-7,S=r?l-1:0,P=r?-1:1,C=i[e+S];for(S+=P,u=C&(1<<-b)-1,C>>=-b,b+=f;b>0;u=256*u+i[e+S],S+=P,b-=8);for(d=u&(1<<-b)-1,u>>=-b,b+=s;b>0;d=256*d+i[e+S],S+=P,b-=8);if(u===0)u=1-v;else{if(u===g)return d?NaN:1/0*(C?-1:1);d+=Math.pow(2,s),u-=v}return(C?-1:1)*d*Math.pow(2,u-s)},Jh=function(i,e,r,s,l,u){var d,f,g,v=8*u-l-1,b=(1<>1,P=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=s?0:u-1,z=s?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,d=b):(d=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-d))<1&&(d--,g*=2),(e+=d+S>=1?P/g:P*Math.pow(2,1-S))*g>=2&&(d++,g/=2),d+S>=b?(f=0,d=b):d+S>=1?(f=(e*g-1)*Math.pow(2,l),d+=S):(f=e*Math.pow(2,S-1)*Math.pow(2,l),d=0));l>=8;i[r+C]=255&f,C+=z,f/=256,l-=8);for(d=d<0;i[r+C]=255&d,C+=z,d/=256,v-=8);i[r+C-z]|=128*U};function vt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}vt.Varint=0,vt.Fixed64=1,vt.Bytes=2,vt.Fixed32=5;var Ec=4294967296,Qh=1/Ec,eu=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ln(i){return i.type===vt.Bytes?i.readVarint()+i.pos:i.pos+1}function na(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function tu(i,e,r){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(s);for(var l=r.pos-1;l>=i;l--)r.buf[l+s]=r.buf[l]}function Tp(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function iu(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}vt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&s,i(l,e,this),this.pos===u&&this.skip(s)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=xl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=iu(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=xl(this.buf,this.pos)+xl(this.buf,this.pos+4)*Ec;return this.pos+=8,i},readSFixed64:function(){var i=xl(this.buf,this.pos)+iu(this.buf,this.pos+4)*Ec;return this.pos+=8,i},readFloat:function(){var i=Yh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Yh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,s=this.buf;return e=127&(r=s[this.pos++]),r<128?e:(e|=(127&(r=s[this.pos++]))<<7,r<128?e:(e|=(127&(r=s[this.pos++]))<<14,r<128?e:(e|=(127&(r=s[this.pos++]))<<21,r<128?e:function(l,u,d){var f,g,v=d.buf;if(f=(112&(g=v[d.pos++]))>>4,g<128||(f|=(127&(g=v[d.pos++]))<<3,g<128)||(f|=(127&(g=v[d.pos++]))<<10,g<128)||(f|=(127&(g=v[d.pos++]))<<17,g<128)||(f|=(127&(g=v[d.pos++]))<<24,g<128)||(f|=(1&(g=v[d.pos++]))<<31,g<128))return na(l,f,u);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&eu?function(r,s,l){return eu.decode(r.subarray(s,l))}(this.buf,e,i):function(r,s,l){for(var u="",d=s;d239?4:b>223?3:b>191?2:1;if(d+P>l)break;P===1?b<128&&(S=b):P===2?(192&(f=r[d+1]))==128&&(S=(31&b)<<6|63&f)<=127&&(S=null):P===3?(g=r[d+2],(192&(f=r[d+1]))==128&&(192&g)==128&&((S=(15&b)<<12|(63&f)<<6|63&g)<=2047||S>=55296&&S<=57343)&&(S=null)):P===4&&(g=r[d+2],v=r[d+3],(192&(f=r[d+1]))==128&&(192&g)==128&&(192&v)==128&&((S=(15&b)<<18|(63&f)<<12|(63&g)<<6|63&v)<=65535||S>=1114112)&&(S=null)),S===null?(S=65533,P=1):S>65535&&(S-=65536,u+=String.fromCharCode(S>>>10&1023|55296),S=56320|1023&S),u+=String.fromCharCode(S),d+=P}return u}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==vt.Bytes)return i.push(this.readVarint(e));var r=ln(this);for(i=i||[];this.pos127;);else if(e===vt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===vt.Fixed32)this.pos+=4;else{if(e!==vt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var s,l;if(e>=0?(s=e%4294967296|0,l=e/4294967296|0):(l=~(-e/4294967296),4294967295^(s=~(-e%4294967296))?s=s+1|0:(s=0,l=l+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,d,f){f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,f.buf[f.pos]=127&(u>>>=7)}(s,0,r),function(u,d){var f=(7&u)<<4;d.buf[d.pos++]|=f|((u>>>=3)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u)))))}(l,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(s,l,u){for(var d,f,g=0;g55295&&d<57344){if(!f){d>56319||g+1===l.length?(s[u++]=239,s[u++]=191,s[u++]=189):f=d;continue}if(d<56320){s[u++]=239,s[u++]=191,s[u++]=189,f=d;continue}d=f-55296<<10|d-56320|65536,f=null}else f&&(s[u++]=239,s[u++]=191,s[u++]=189,f=null);d<128?s[u++]=d:(d<2048?s[u++]=d>>6|192:(d<65536?s[u++]=d>>12|224:(s[u++]=d>>18|240,s[u++]=d>>12&63|128),s[u++]=d>>6&63|128),s[u++]=63&d|128)}return u}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&tu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Jh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Jh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&tu(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,e,r){this.writeTag(i,vt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Tp,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Ep,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Ap,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Sp,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Ip,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Pp,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Mp,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Cp,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,kp,e)},writeBytesField:function(i,e){this.writeTag(i,vt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,vt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,vt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,vt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,vt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,vt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,vt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,vt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,vt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,vt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Sc=ce(Kh);const Ic=3;function zp(i,e,r){i===1&&r.readMessage(Dp,e)}function Dp(i,e,r){if(i===3){const{id:s,bitmap:l,width:u,height:d,left:f,top:g,advance:v}=r.readMessage(Lp,{});e.push({id:s,bitmap:new io({width:u+2*Ic,height:d+2*Ic},l),metrics:{width:u,height:d,left:f,top:g,advance:v}})}}function Lp(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const ru=Ic;function nu(i){let e=0,r=0;for(const d of i)e+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,f)=>f.h-d.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let l=0,u=0;for(const d of i)for(let f=s.length-1;f>=0;f--){const g=s[f];if(!(d.w>g.w||d.h>g.h)){if(d.x=g.x,d.y=g.y,u=Math.max(u,d.y+d.h),l=Math.max(l,d.x+d.w),d.w===g.w&&d.h===g.h){const v=s.pop();f=0&&s>=e&&bl[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const s=new aa;return s.text=this.text.substring(e,r),s.sectionIndex=this.sectionIndex.slice(e,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(uo.forText(e.scale,e.fontStack||r));const s=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function vl(i,e,r,s,l,u,d,f,g,v,b,S,P,C,z,U){const F=aa.fromFeature(i,l);let K;S===h.WritingMode.vertical&&F.verticalizePunctuation();const{processBidirectionalText:Q,processStyledBidirectionalText:X}=Ji;if(Q&&F.sections.length===1){K=[];const he=Q(F.toString(),Pc(F,v,u,e,s,C,z));for(const ze of he){const Be=new aa;Be.text=ze,Be.sections=F.sections;for(let Pe=0;Pe0&&hn>$i&&($i=hn)}else{const or=Be[rt.fontStack],qi=or&&or[vi];if(qi&&qi.rect)kr=qi.rect,_r=qi.metrics;else{const hn=ze[rt.fontStack],_o=hn&&hn[vi];if(!_o)continue;_r=_o.metrics}Ii=(yi-rt.scale)*li}yr?(he.verticalizable=!0,Ni.push({glyph:vi,imageName:zr,x:Pt,y:zt+Ii,vertical:yr,scale:rt.scale,fontStack:rt.fontStack,sectionIndex:Qi,metrics:_r,rect:kr}),Pt+=cn*rt.scale+Ve):(Ni.push({glyph:vi,imageName:zr,x:Pt,y:zt+Ii,vertical:yr,scale:rt.scale,fontStack:rt.fontStack,sectionIndex:Qi,metrics:_r,rect:kr}),Pt+=_r.advance*rt.scale+Ve)}Ni.length!==0&&(ii=Math.max(Pt-Ve,ii),Fp(Ni,0,Ni.length-1,gi,$i)),Pt=0;const Ut=Te*yi+$i;zi.lineOffset=Math.max($i,Si),zt+=Ut,ar=Math.max(Ut,ar),++Yt}var ci;const _i=zt-ho,{horizontalAlign:Ei,verticalAlign:Vi}=Mc(Me);(function(Jt,yi,Si,zi,Ni,$i,Ut,xi,rt){const Qi=(yi-Si)*Ni;let vi=0;vi=$i!==Ut?-xi*zi-ho:(-zi*rt+.5)*Ut;for(const Ii of Jt)for(const _r of Ii.positionedGlyphs)_r.x+=Qi,_r.y+=vi})(he.positionedLines,gi,Ei,Vi,ii,ar,Te,_i,Se.length),he.top+=-Vi*_i,he.bottom=he.top+_i,he.left+=-Ei*ii,he.right=he.left+ii}(ae,e,r,s,K,d,f,g,S,v,P,U),!function(he){for(const ze of he)if(ze.positionedGlyphs.length!==0)return!1;return!0}(ne)&&ae}const bl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Bp={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function au(i,e,r,s,l,u){if(e.imageName){const d=s[e.imageName];return d?d.displaySize[0]*e.scale*li/u+l:0}{const d=r[e.fontStack],f=d&&d[i];return f?f.metrics.advance*e.scale+l:0}}function ou(i,e,r,s){const l=Math.pow(i-e,2);return s?i=0;let b=0;for(let P=0;Pd.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=hc([]),this.placementViewportMatrix=hc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=uu(this.zoom,r["text-size"]),this.iconSizeData=uu(this.zoom,r["icon-size"]);const s=this.layers[0].layout,l=s.get("symbol-sort-key"),u=s.get("symbol-z-order");this.canOverlap=Cc(s,"text-overlap","text-allow-overlap")!=="never"||Cc(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(d=>h.WritingMode[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=e.sourceID}createArrays(){this.text=new zc(new Mr(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new zc(new Mr(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new x,this.lineVertexArray=new T,this.symbolInstances=new _}calculateGlyphDependencies(e,r,s,l,u){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],!v&&!b)return;const P=r.iconDependencies,C=r.glyphDependencies,z=r.availableImages,U=new kt(this.zoom);for(const{feature:F,id:K,index:Q,sourceLayerIndex:X}of e){const ne=l._featureFilter.needGeometry,ae=hs(F,ne);if(!l._featureFilter.filter(U,ae,s))continue;let he,ze;if(ne||(ae.geometry=Cr(F)),v){const Pe=l.getValueAndResolveTokens("text-field",ae,s,z),Se=di.factory(Pe);Np(Se)&&(this.hasRTLText=!0),(!this.hasRTLText||ja()==="unavailable"||this.hasRTLText&&Ji.isParsed())&&(he=wp(Se,l,ae))}if(b){const Pe=l.getValueAndResolveTokens("icon-image",ae,s,z);ze=Pe instanceof Wi?Pe:Wi.fromString(Pe)}if(!he&&!ze)continue;const Be=this.sortFeaturesByKey?S.evaluate(ae,{},s):void 0;if(this.features.push({id:K,text:he,icon:ze,index:Q,sourceLayerIndex:X,geometry:ae.geometry,properties:F.properties,type:Up[F.type],sortKey:Be}),ze&&(P[ze.name]=!0),he){const Pe=d.evaluate(ae,{},s).join(","),Se=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(h.WritingMode.vertical)>=0;for(const Te of he.sections)if(Te.image)P[Te.image.name]=!0;else{const Me=Fs(he.toString()),Ie=Te.fontStack||Pe,ye=C[Ie]=C[Ie]||{};this.calculateGlyphDependencies(Te.text,ye,Se,this.allowVerticalPlacement,Me)}}}u.get("symbol-placement")==="line"&&(this.features=function(F){const K={},Q={},X=[];let ne=0;function ae(Pe){X.push(F[Pe]),ne++}function he(Pe,Se,Te){const Me=Q[Pe];return delete Q[Pe],Q[Se]=Me,X[Me].geometry[0].pop(),X[Me].geometry[0]=X[Me].geometry[0].concat(Te[0]),Me}function ze(Pe,Se,Te){const Me=K[Se];return delete K[Se],K[Pe]=Me,X[Me].geometry[0].shift(),X[Me].geometry[0]=Te[0].concat(X[Me].geometry[0]),Me}function Be(Pe,Se,Te){const Me=Te?Se[0][Se[0].length-1]:Se[0][0];return`${Pe}:${Me.x}:${Me.y}`}for(let Pe=0;PePe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((F,K)=>F.sortKey-K.sortKey)}update(e,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const s=this.lineVertexArray.length;if(e.segment!==void 0){let l=e.dist(r[e.segment+1]),u=e.dist(r[e.segment]);const d={};for(let f=e.segment+1;f=0;f--)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:u},f>0&&(u+=r[f-1].dist(r[f]));for(let f=0;f0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const s=e.placedSymbolArray.get(r),l=s.vertexStartIndex+4*s.numGlyphs;for(let u=s.vertexStartIndex;ul[f]-l[g]||u[g]-u[f]),d}addToSortKeyRanges(e,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((l,u,d)=>{l>=0&&d.indexOf(l)===u&&this.addIndicesForPlacedSymbol(this.text,l)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let du,pu;De("SymbolBucket",oa,{omit:["layers","collisionBoxArray","features","compareText"]}),oa.MAX_GLYPHS=65535,oa.addDynamicAttributes=kc;var Lc={get paint(){return pu=pu||new Ci({"icon-opacity":new qe(le.paint_symbol["icon-opacity"]),"icon-color":new qe(le.paint_symbol["icon-color"]),"icon-halo-color":new qe(le.paint_symbol["icon-halo-color"]),"icon-halo-width":new qe(le.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qe(le.paint_symbol["icon-halo-blur"]),"icon-translate":new Fe(le.paint_symbol["icon-translate"]),"icon-translate-anchor":new Fe(le.paint_symbol["icon-translate-anchor"]),"text-opacity":new qe(le.paint_symbol["text-opacity"]),"text-color":new qe(le.paint_symbol["text-color"],{runtimeType:Pi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new qe(le.paint_symbol["text-halo-color"]),"text-halo-width":new qe(le.paint_symbol["text-halo-width"]),"text-halo-blur":new qe(le.paint_symbol["text-halo-blur"]),"text-translate":new Fe(le.paint_symbol["text-translate"]),"text-translate-anchor":new Fe(le.paint_symbol["text-translate-anchor"])})},get layout(){return du=du||new Ci({"symbol-placement":new Fe(le.layout_symbol["symbol-placement"]),"symbol-spacing":new Fe(le.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Fe(le.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qe(le.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Fe(le.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Fe(le.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Fe(le.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Fe(le.layout_symbol["icon-ignore-placement"]),"icon-optional":new Fe(le.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Fe(le.layout_symbol["icon-rotation-alignment"]),"icon-size":new qe(le.layout_symbol["icon-size"]),"icon-text-fit":new Fe(le.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Fe(le.layout_symbol["icon-text-fit-padding"]),"icon-image":new qe(le.layout_symbol["icon-image"]),"icon-rotate":new qe(le.layout_symbol["icon-rotate"]),"icon-padding":new qe(le.layout_symbol["icon-padding"]),"icon-keep-upright":new Fe(le.layout_symbol["icon-keep-upright"]),"icon-offset":new qe(le.layout_symbol["icon-offset"]),"icon-anchor":new qe(le.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Fe(le.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Fe(le.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Fe(le.layout_symbol["text-rotation-alignment"]),"text-field":new qe(le.layout_symbol["text-field"]),"text-font":new qe(le.layout_symbol["text-font"]),"text-size":new qe(le.layout_symbol["text-size"]),"text-max-width":new qe(le.layout_symbol["text-max-width"]),"text-line-height":new Fe(le.layout_symbol["text-line-height"]),"text-letter-spacing":new qe(le.layout_symbol["text-letter-spacing"]),"text-justify":new qe(le.layout_symbol["text-justify"]),"text-radial-offset":new qe(le.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Fe(le.layout_symbol["text-variable-anchor"]),"text-anchor":new qe(le.layout_symbol["text-anchor"]),"text-max-angle":new Fe(le.layout_symbol["text-max-angle"]),"text-writing-mode":new Fe(le.layout_symbol["text-writing-mode"]),"text-rotate":new qe(le.layout_symbol["text-rotate"]),"text-padding":new Fe(le.layout_symbol["text-padding"]),"text-keep-upright":new Fe(le.layout_symbol["text-keep-upright"]),"text-transform":new qe(le.layout_symbol["text-transform"]),"text-offset":new qe(le.layout_symbol["text-offset"]),"text-allow-overlap":new Fe(le.layout_symbol["text-allow-overlap"]),"text-overlap":new Fe(le.layout_symbol["text-overlap"]),"text-ignore-placement":new Fe(le.layout_symbol["text-ignore-placement"]),"text-optional":new Fe(le.layout_symbol["text-optional"])})}};class fu{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Or,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}De("FormatSectionOverride",fu,{omit:["defaultValue"]});class Tl extends fr{constructor(e){super(e,Lc)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const l=[];for(const u of s)l.indexOf(u)<0&&l.push(u);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,s,l){const u=this.layout.get(e).evaluate(r,{},s,l),d=this._unevaluatedLayout._values[e];return d.isDataDriven()||Ms(d.value)||!u?u:function(f,g){return g.replace(/{([^{}]+)}/g,(v,b)=>b in f?String(f[b]):"")}(r.properties,u)}createBucket(e){return new oa(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Lc.paint.overridableProperties){if(!Tl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),s=new fu(r),l=new za(s,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new Da("source",l):new st("composite",l,r.value.zoomStops),this.paint._values[e]=new pr(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&Tl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const s=e.get("text-field"),l=Lc.paint.properties[r];let u=!1;const d=f=>{for(const g of f)if(l.overrides&&l.overrides.hasOverride(g))return void(u=!0)};if(s.value.kind==="constant"&&s.value.value instanceof di)d(s.value.value.sections);else if(s.value.kind==="source"){const f=v=>{u||(v instanceof Vr&&Wt(v.value)===Er?d(v.value.sections):v instanceof As?d(v.sections):v.eachChild(f))},g=s.value;g._styleExpression&&f(g._styleExpression.expression)}return u}}let mu;var $p={get paint(){return mu=mu||new Ci({"background-color":new Fe(le.paint_background["background-color"]),"background-pattern":new Xa(le.paint_background["background-pattern"]),"background-opacity":new Fe(le.paint_background["background-opacity"])})}};let gu;var qp={get paint(){return gu=gu||new Ci({"raster-opacity":new Fe(le.paint_raster["raster-opacity"]),"raster-hue-rotate":new Fe(le.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Fe(le.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Fe(le.paint_raster["raster-brightness-max"]),"raster-saturation":new Fe(le.paint_raster["raster-saturation"]),"raster-contrast":new Fe(le.paint_raster["raster-contrast"]),"raster-resampling":new Fe(le.paint_raster["raster-resampling"]),"raster-fade-duration":new Fe(le.paint_raster["raster-fade-duration"])})}};class jp extends fr{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const Zp={circle:class extends fr{constructor(i){super(i,zd)}createBucket(i){return new oc(i)}queryRadius(i){const e=i;return eo("circle-radius",this,e)+eo("circle-stroke-width",this,e)+ul(this.paint.get("circle-translate"))}queryIntersectsFeature(i,e,r,s,l,u,d,f){const g=dl(i,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),u.angle,d),v=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),b=this.paint.get("circle-pitch-alignment")==="map",S=b?g:function(C,z){return C.map(U=>Sh(U,z))}(g,f),P=b?v*d:v;for(const C of s)for(const z of C){const U=b?z:Sh(z,f);let F=P;const K=pl([],[z.x,z.y,0,1],f);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?F*=K[3]/u.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(F*=u.cameraToCenterDistance/K[3]),Pd(S,U,F))return!0}return!1}},heatmap:class extends fr{createBucket(i){return new Ih(i)}constructor(i){super(i,Ld),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(i){i==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Mh({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends fr{constructor(i){super(i,Bd)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends fr{constructor(i){super(i,Kd)}recalculate(i,e){super.recalculate(i,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(i){return new vc(i)}queryRadius(){return ul(this.paint.get("fill-translate"))}queryIntersectsFeature(i,e,r,s,l,u,d){return xh(dl(i,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),u.angle,d),s)}isTileClipped(){return!0}},"fill-extrusion":class extends fr{constructor(i){super(i,hp)}createBucket(i){return new wc(i)}queryRadius(){return ul(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,e,r,s,l,u,d,f){const g=dl(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),u.angle,d),v=this.paint.get("fill-extrusion-height").evaluate(e,r),b=this.paint.get("fill-extrusion-base").evaluate(e,r),S=function(C,z,U,F){const K=[];for(const Q of C){const X=[Q.x,Q.y,0,1];pl(X,X,z),K.push(new xe(X[0]/X[3],X[1]/X[3]))}return K}(g,f),P=function(C,z,U,F){const K=[],Q=[],X=F[8]*z,ne=F[9]*z,ae=F[10]*z,he=F[11]*z,ze=F[8]*U,Be=F[9]*U,Pe=F[10]*U,Se=F[11]*U;for(const Te of C){const Me=[],Ie=[];for(const ye of Te){const Ve=ye.x,Re=ye.y,it=F[0]*Ve+F[4]*Re+F[12],Pt=F[1]*Ve+F[5]*Re+F[13],zt=F[2]*Ve+F[6]*Re+F[14],ii=F[3]*Ve+F[7]*Re+F[15],ar=zt+ae,gi=ii+he,Yt=it+ze,ci=Pt+Be,_i=zt+Pe,Ei=ii+Se,Vi=new xe((it+X)/gi,(Pt+ne)/gi);Vi.z=ar/gi,Me.push(Vi);const Jt=new xe(Yt/Ei,ci/Ei);Jt.z=_i/Ei,Ie.push(Jt)}K.push(Me),Q.push(Ie)}return[K,Q]}(s,b,v,f);return function(C,z,U){let F=1/0;xh(U,z)&&(F=qh(U,z[0]));for(let K=0;K=3){for(let U=0;U{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const Bc=63710088e-1;class Un{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Un(Bt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,s=this.lat*r,l=e.lat*r,u=Math.sin(s)*Math.sin(l)+Math.cos(s)*Math.cos(l)*Math.cos((e.lng-this.lng)*r);return Bc*Math.acos(Math.min(u,1))}static convert(e){if(e instanceof Un)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Un(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Un(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const _u=2*Math.PI*Bc;function yu(i){return _u*Math.cos(i*Math.PI/180)}function xu(i){return(180+i)/360}function vu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function bu(i,e){return i/yu(e)}function Rc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class El{constructor(e,r,s=0){this.x=+e,this.y=+r,this.z=+s}static fromLngLat(e,r=0){const s=Un.convert(e);return new El(xu(s.lng),vu(s.lat),bu(r,s.lat))}toLngLat(){return new Un(360*this.x-180,Rc(this.y))}toAltitude(){return this.z*yu(Rc(this.y))}meterInMercatorCoordinateUnits(){return 1/_u*(e=Rc(this.y),1/Math.cos(e*Math.PI/180));var e}}function wu(i,e,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,e*s-2*Math.PI*6378137/2]}class Fc{constructor(e,r,s){if(e<0||e>25||s<0||s>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${s}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=s,this.key=fo(0,e,e,r,s)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,s){const l=(d=this.y,f=this.z,g=wu(256*(u=this.x),256*(d=Math.pow(2,f)-d-1),f),v=wu(256*(u+1),256*(d+1),f),g[0]+","+g[1]+","+v[0]+","+v[1]);var u,d,f,g,v;const b=function(S,P,C){let z,U="";for(let F=S;F>0;F--)z=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new xe((e.x*r-this.x)*At,(e.y*r-this.y)*At)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Tu{constructor(e,r){this.wrap=e,this.canonical=r,this.key=fo(e,r.z,r.z,r.x,r.y)}}class sr{constructor(e,r,s,l,u){if(e= z; overscaledZ = ${e}; z = ${s}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Fc(s,+l,+u),this.key=fo(r,e,s,l,u)}clone(){return new sr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new sr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new sr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?fo(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):fo(this.wrap*+r,e,e,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new sr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,l=2*this.canonical.y;return[new sr(r,this.wrap,r,s,l),new sr(r,this.wrap,r,s+1,l),new sr(r,this.wrap,r,s,l+1),new sr(r,this.wrap,r,s+1,l+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=f),f=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}_unpackMapbox(e,r,s){return(256*e*256+256*r+s)/10-1e4}_unpackTerrarium(e,r,s){return 256*e+r+s/256-32768}getPixels(){return new nr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,s){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,u=r*this.dim+this.dim,d=s*this.dim,f=s*this.dim+this.dim;switch(r){case-1:l=u-1;break;case 1:u=l+1}switch(s){case-1:d=f-1;break;case 1:f=d+1}const g=-r*this.dim,v=-s*this.dim;for(let b=d;b=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Iu{constructor(e,r,s,l,u){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=s,e._y=l,this.properties=e.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Au{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new is(At,16,0),this.grid3D=new is(At,16,0),this.featureIndexArray=new k,this.promoteId=r}insert(e,r,s,l,u,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,l,u);const g=d?this.grid3D:this.grid;for(let v=0;v=0&&S[3]>=0&&g.insert(f,S[0],S[1],S[2],S[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Rn.VectorTile(new Sc(this.rawTileData)).layers,this.sourceLayerCoder=new Su(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,s,l){this.loadVTLayers();const u=e.params||{},d=At/e.tileSize/e.scale,f=La(u.filter),g=e.queryGeometry,v=e.queryPadding*d,b=Mu(g),S=this.grid.query(b.minX-v,b.minY-v,b.maxX+v,b.maxY+v),P=Mu(e.cameraQueryGeometry),C=this.grid3D.query(P.minX-v,P.minY-v,P.maxX+v,P.maxY+v,(F,K,Q,X)=>function(ne,ae,he,ze,Be){for(const Se of ne)if(ae<=Se.x&&he<=Se.y&&ze>=Se.x&&Be>=Se.y)return!0;const Pe=[new xe(ae,he),new xe(ae,Be),new xe(ze,Be),new xe(ze,he)];if(ne.length>2){for(const Se of Pe)if(ea(ne,Se))return!0}for(let Se=0;Se(X||(X=Cr(ne)),ae.queryIntersectsFeature(g,ne,he,X,this.z,e.transform,d,e.pixelPosMatrix)))}return z}loadMatchingFeature(e,r,s,l,u,d,f,g,v,b,S){const P=this.bucketLayerIDs[r];if(d&&!function(F,K){for(let Q=0;Q=0)return!0;return!1}(d,P))return;const C=this.sourceLayerCoder.decode(s),z=this.vtLayers[C].feature(l);if(u.needGeometry){const F=hs(z,!0);if(!u.filter(new kt(this.tileID.overscaledZ),F,this.tileID.canonical))return}else if(!u.filter(new kt(this.tileID.overscaledZ),z))return;const U=this.getId(z,C);for(let F=0;F{const f=e instanceof js?e.get(d):null;return f&&f.evaluate?f.evaluate(r,s,l):f})}function Mu(i){let e=1/0,r=1/0,s=-1/0,l=-1/0;for(const u of i)e=Math.min(e,u.x),r=Math.min(r,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return{minX:e,minY:r,maxX:s,maxY:l}}function Xp(i,e){return e-i}function Cu(i,e,r,s,l){const u=[];for(let d=0;d=s&&S.x>=s||(b.x>=s?b=new xe(s,b.y+(s-b.x)/(S.x-b.x)*(S.y-b.y))._round():S.x>=s&&(S=new xe(s,b.y+(s-b.x)/(S.x-b.x)*(S.y-b.y))._round()),b.y>=l&&S.y>=l||(b.y>=l?b=new xe(b.x+(l-b.y)/(S.y-b.y)*(S.x-b.x),l)._round():S.y>=l&&(S=new xe(b.x+(l-b.y)/(S.y-b.y)*(S.x-b.x),l)._round()),g&&b.equals(g[g.length-1])||(g=[b],u.push(g)),g.push(S)))))}}return u}De("FeatureIndex",Au,{omit:["rawTileData","sourceLayerCoder"]});class Vn extends xe{constructor(e,r,s,l){super(e,r),this.angle=s,l!==void 0&&(this.segment=l)}clone(){return new Vn(this.x,this.y,this.angle,this.segment)}}function ku(i,e,r,s,l){if(e.segment===void 0)return!0;let u=e,d=e.segment+1,f=0;for(;f>-r/2;){if(d--,d<0)return!1;f-=i[d].dist(u),u=i[d]}f+=i[d].dist(i[d+1]),d++;const g=[];let v=0;for(;fs;)v-=g.shift().angleDelta;if(v>l)return!1;d++,f+=b.dist(S)}return!0}function zu(i){let e=0;for(let r=0;rv){const z=(v-g)/C,U=Bi.number(S.x,P.x,z),F=Bi.number(S.y,P.y,z),K=new Vn(U,F,P.angleTo(S),b);return K._round(),!d||ku(i,K,f,d,e)?K:void 0}g+=C}}function Hp(i,e,r,s,l,u,d,f,g){const v=Du(s,u,d),b=Lu(s,l),S=b*d,P=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return e-S=0&&ne=0&&ae=0&&P+v<=b){const he=new Vn(ne,ae,Q,z);he._round(),s&&!ku(i,he,u,s,l)||C.push(he)}}S+=K}return f||C.length||d||(C=Bu(i,S/2,r,s,l,u,d,!0,g)),C}De("Anchor",Vn);const la=Ui;function Ru(i,e,r,s){const l=[],u=i.image,d=u.pixelRatio,f=u.paddedRect.w-2*la,g=u.paddedRect.h-2*la,v=i.right-i.left,b=i.bottom-i.top,S=u.stretchX||[[0,f]],P=u.stretchY||[[0,g]],C=(Te,Me)=>Te+Me[1]-Me[0],z=S.reduce(C,0),U=P.reduce(C,0),F=f-z,K=g-U;let Q=0,X=z,ne=0,ae=U,he=0,ze=F,Be=0,Pe=K;if(u.content&&s){const Te=u.content;Q=Sl(S,0,Te[0]),ne=Sl(P,0,Te[1]),X=Sl(S,Te[0],Te[2]),ae=Sl(P,Te[1],Te[3]),he=Te[0]-Q,Be=Te[1]-ne,ze=Te[2]-Te[0]-X,Pe=Te[3]-Te[1]-ae}const Se=(Te,Me,Ie,ye)=>{const Ve=Il(Te.stretch-Q,X,v,i.left),Re=Al(Te.fixed-he,ze,Te.stretch,z),it=Il(Me.stretch-ne,ae,b,i.top),Pt=Al(Me.fixed-Be,Pe,Me.stretch,U),zt=Il(Ie.stretch-Q,X,v,i.left),ii=Al(Ie.fixed-he,ze,Ie.stretch,z),ar=Il(ye.stretch-ne,ae,b,i.top),gi=Al(ye.fixed-Be,Pe,ye.stretch,U),Yt=new xe(Ve,it),ci=new xe(zt,it),_i=new xe(zt,ar),Ei=new xe(Ve,ar),Vi=new xe(Re/d,Pt/d),Jt=new xe(ii/d,gi/d),yi=e*Math.PI/180;if(yi){const Ni=Math.sin(yi),$i=Math.cos(yi),Ut=[$i,-Ni,Ni,$i];Yt._matMult(Ut),ci._matMult(Ut),Ei._matMult(Ut),_i._matMult(Ut)}const Si=Te.stretch+Te.fixed,zi=Me.stretch+Me.fixed;return{tl:Yt,tr:ci,bl:Ei,br:_i,tex:{x:u.paddedRect.x+la+Si,y:u.paddedRect.y+la+zi,w:Ie.stretch+Ie.fixed-Si,h:ye.stretch+ye.fixed-zi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Vi,pixelOffsetBR:Jt,minFontScaleX:ze/d/v,minFontScaleY:Pe/d/b,isSDF:r}};if(s&&(u.stretchX||u.stretchY)){const Te=Fu(S,F,z),Me=Fu(P,K,U);for(let Ie=0;Ie0&&(z=Math.max(10,z),this.circleDiameter=z)}else{let S=d.top*f-g[0],P=d.bottom*f+g[2],C=d.left*f-g[3],z=d.right*f+g[1];const U=d.collisionPadding;if(U&&(C-=U[0]*f,S-=U[1]*f,z+=U[2]*f,P+=U[3]*f),b){const F=new xe(C,S),K=new xe(z,S),Q=new xe(C,P),X=new xe(z,P),ne=b*Math.PI/180;F._rotate(ne),K._rotate(ne),Q._rotate(ne),X._rotate(ne),C=Math.min(F.x,K.x,Q.x,X.x),z=Math.max(F.x,K.x,Q.x,X.x),S=Math.min(F.y,K.y,Q.y,X.y),P=Math.max(F.y,K.y,Q.y,X.y)}e.emplaceBack(r.x,r.y,C,S,z,P,s,l,u)}this.boxEndIndex=e.length}}class Kp{constructor(e=[],r=Yp){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:s}=this,l=r[e];for(;e>0;){const u=e-1>>1,d=r[u];if(s(l,d)>=0)break;r[e]=d,e=u}r[e]=l}_down(e){const{data:r,compare:s}=this,l=this.length>>1,u=r[e];for(;e=0)break;r[e]=f,e=d}r[e]=u}}function Yp(i,e){return ie?1:0}function Jp(i,e=1,r=!1){let s=1/0,l=1/0,u=-1/0,d=-1/0;const f=i[0];for(let C=0;Cu)&&(u=z.x),(!C||z.y>d)&&(d=z.y)}const g=Math.min(u-s,d-l);let v=g/2;const b=new Kp([],Qp);if(g===0)return new xe(s,l);for(let C=s;CS.d||!S.d)&&(S=C,r&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,P)),C.max-S.d<=e||(v=C.h/2,b.push(new ca(C.p.x-v,C.p.y-v,v,i)),b.push(new ca(C.p.x+v,C.p.y-v,v,i)),b.push(new ca(C.p.x-v,C.p.y+v,v,i)),b.push(new ca(C.p.x+v,C.p.y+v,v,i)),P+=4)}return r&&(console.log(`num probes: ${P}`),console.log(`best distance: ${S.d}`)),S.p}function Qp(i,e){return e.max-i.max}function ca(i,e,r,s){this.p=new xe(i,e),this.h=r,this.d=function(l,u){let d=!1,f=1/0;for(let g=0;gl.y!=z.y>l.y&&l.x<(z.x-C.x)*(l.y-C.y)/(z.y-C.y)+C.x&&(d=!d),f=Math.min(f,vh(l,C,z))}}return(d?1:-1)*Math.sqrt(f)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}const Oc=Number.POSITIVE_INFINITY;function Ou(i,e){return e[1]!==Oc?function(r,s,l){let u=0,d=0;switch(s=Math.abs(s),l=Math.abs(l),r){case"top-right":case"top-left":case"top":d=l-7;break;case"bottom-right":case"bottom-left":case"bottom":d=7-l}switch(r){case"top-right":case"bottom-right":case"right":u=-s;break;case"top-left":case"bottom-left":case"left":u=s}return[u,d]}(i,e[0],e[1]):function(r,s){let l=0,u=0;s<0&&(s=0);const d=s/Math.sqrt(2);switch(r){case"top-right":case"top-left":u=d-7;break;case"bottom-right":case"bottom-left":u=7-d;break;case"bottom":u=7-s;break;case"top":u=s-7}switch(r){case"top-right":case"bottom-right":l=-d;break;case"top-left":case"bottom-left":l=d;break;case"left":l=s;break;case"right":l=-s}return[l,u]}(i,e[0])}function Uc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ef(i,e,r,s,l,u,d,f,g,v,b){let S=u.textMaxSize.evaluate(e,{});S===void 0&&(S=d);const P=i.layers[0].layout,C=P.get("icon-offset").evaluate(e,{},b),z=Vu(r.horizontal),U=d/24,F=i.tilePixelRatio*U,K=i.tilePixelRatio*S/24,Q=i.tilePixelRatio*f,X=i.tilePixelRatio*P.get("symbol-spacing"),ne=P.get("text-padding")*i.tilePixelRatio,ae=function(ye,Ve,Re,it=1){const Pt=ye.get("icon-padding").evaluate(Ve,{},Re),zt=Pt&&Pt.values;return[zt[0]*it,zt[1]*it,zt[2]*it,zt[3]*it]}(P,e,b,i.tilePixelRatio),he=P.get("text-max-angle")/180*Math.PI,ze=P.get("text-rotation-alignment")!=="viewport"&&P.get("symbol-placement")!=="point",Be=P.get("icon-rotation-alignment")==="map"&&P.get("symbol-placement")!=="point",Pe=P.get("symbol-placement"),Se=X/2,Te=P.get("icon-text-fit");let Me;s&&Te!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Me=hu(s,r.vertical,Te,P.get("icon-text-fit-padding"),C,U)),z&&(s=hu(s,z,Te,P.get("icon-text-fit-padding"),C,U)));const Ie=(ye,Ve)=>{Ve.x<0||Ve.x>=At||Ve.y<0||Ve.y>=At||function(Re,it,Pt,zt,ii,ar,gi,Yt,ci,_i,Ei,Vi,Jt,yi,Si,zi,Ni,$i,Ut,xi,rt,Qi,vi,Ii,_r){const kr=Re.addToLineVertexArray(it,Pt);let zr,cn,yr,or,qi=0,hn=0,_o=0,ju=0,Xc=-1,Wc=-1;const un={};let Zu=jt(""),Hc=0,Kc=0;if(Yt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[Hc,Kc]=Yt.layout.get("text-offset").evaluate(rt,{},Ii).map(ji=>ji*li):(Hc=Yt.layout.get("text-radial-offset").evaluate(rt,{},Ii)*li,Kc=Oc),Re.allowVerticalPlacement&&zt.vertical){const ji=Yt.layout.get("text-rotate").evaluate(rt,{},Ii)+90;yr=new Pl(ci,it,_i,Ei,Vi,zt.vertical,Jt,yi,Si,ji),gi&&(or=new Pl(ci,it,_i,Ei,Vi,gi,Ni,$i,Si,ji))}if(ii){const ji=Yt.layout.get("icon-rotate").evaluate(rt,{}),Gr=Yt.layout.get("icon-text-fit")!=="none",yo=Ru(ii,ji,vi,Gr),xo=gi?Ru(gi,ji,vi,Gr):void 0;cn=new Pl(ci,it,_i,Ei,Vi,ii,Ni,$i,!1,ji),qi=4*yo.length;const Wu=Re.iconSizeData;let ds=null;Wu.kind==="source"?(ds=[Zr*Yt.layout.get("icon-size").evaluate(rt,{})],ds[0]>On&&Vt(`${Re.layerIds[0]}: Value for "icon-size" is >= ${po}. Reduce your "icon-size".`)):Wu.kind==="composite"&&(ds=[Zr*Qi.compositeIconSizes[0].evaluate(rt,{},Ii),Zr*Qi.compositeIconSizes[1].evaluate(rt,{},Ii)],(ds[0]>On||ds[1]>On)&&Vt(`${Re.layerIds[0]}: Value for "icon-size" is >= ${po}. Reduce your "icon-size".`)),Re.addSymbols(Re.icon,yo,ds,xi,Ut,rt,h.WritingMode.none,it,kr.lineStartIndex,kr.lineLength,-1,Ii),Xc=Re.icon.placedSymbolArray.length-1,xo&&(hn=4*xo.length,Re.addSymbols(Re.icon,xo,ds,xi,Ut,rt,h.WritingMode.vertical,it,kr.lineStartIndex,kr.lineLength,-1,Ii),Wc=Re.icon.placedSymbolArray.length-1)}const Gu=Object.keys(zt.horizontal);for(const ji of Gu){const Gr=zt.horizontal[ji];if(!zr){Zu=jt(Gr.text);const xo=Yt.layout.get("text-rotate").evaluate(rt,{},Ii);zr=new Pl(ci,it,_i,Ei,Vi,Gr,Jt,yi,Si,xo)}const yo=Gr.positionedLines.length===1;if(_o+=Uu(Re,it,Gr,ar,Yt,Si,rt,zi,kr,zt.vertical?h.WritingMode.horizontal:h.WritingMode.horizontalOnly,yo?Gu:[ji],un,Xc,Qi,Ii),yo)break}zt.vertical&&(ju+=Uu(Re,it,zt.vertical,ar,Yt,Si,rt,zi,kr,h.WritingMode.vertical,["vertical"],un,Wc,Qi,Ii));const nf=zr?zr.boxStartIndex:Re.collisionBoxArray.length,sf=zr?zr.boxEndIndex:Re.collisionBoxArray.length,af=yr?yr.boxStartIndex:Re.collisionBoxArray.length,of=yr?yr.boxEndIndex:Re.collisionBoxArray.length,lf=cn?cn.boxStartIndex:Re.collisionBoxArray.length,cf=cn?cn.boxEndIndex:Re.collisionBoxArray.length,hf=or?or.boxStartIndex:Re.collisionBoxArray.length,uf=or?or.boxEndIndex:Re.collisionBoxArray.length;let Dr=-1;const Cl=(ji,Gr)=>ji&&ji.circleDiameter?Math.max(ji.circleDiameter,Gr):Gr;Dr=Cl(zr,Dr),Dr=Cl(yr,Dr),Dr=Cl(cn,Dr),Dr=Cl(or,Dr);const Xu=Dr>-1?1:0;Xu&&(Dr*=_r/li),Re.glyphOffsetArray.length>=oa.MAX_GLYPHS&&Vt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),rt.sortKey!==void 0&&Re.addToSortKeyRanges(Re.symbolInstances.length,rt.sortKey),Re.symbolInstances.emplaceBack(it.x,it.y,un.right>=0?un.right:-1,un.center>=0?un.center:-1,un.left>=0?un.left:-1,un.vertical||-1,Xc,Wc,Zu,nf,sf,af,of,lf,cf,hf,uf,_i,_o,ju,qi,hn,Xu,0,Jt,Hc,Kc,Dr)}(i,Ve,ye,r,s,l,Me,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,F,[ne,ne,ne,ne],ze,g,Q,ae,Be,C,e,u,v,b,d)};if(Pe==="line")for(const ye of Cu(e.geometry,0,0,At,At)){const Ve=Hp(ye,X,he,r.vertical||z,s,24,K,i.overscaling,At);for(const Re of Ve)z&&tf(i,z.text,Se,Re)||Ie(ye,Re)}else if(Pe==="line-center"){for(const ye of e.geometry)if(ye.length>1){const Ve=Wp(ye,he,r.vertical||z,s,24,K);Ve&&Ie(ye,Ve)}}else if(e.type==="Polygon")for(const ye of _c(e.geometry,0)){const Ve=Jp(ye,16);Ie(ye[0],new Vn(Ve.x,Ve.y,0))}else if(e.type==="LineString")for(const ye of e.geometry)Ie(ye,new Vn(ye[0].x,ye[0].y,0));else if(e.type==="Point")for(const ye of e.geometry)for(const Ve of ye)Ie([Ve],new Vn(Ve.x,Ve.y,0))}function Uu(i,e,r,s,l,u,d,f,g,v,b,S,P,C,z){const U=function(Q,X,ne,ae,he,ze,Be,Pe){const Se=ae.layout.get("text-rotate").evaluate(ze,{})*Math.PI/180,Te=[];for(const Me of X.positionedLines)for(const Ie of Me.positionedGlyphs){if(!Ie.rect)continue;const ye=Ie.rect||{};let Ve=ru+1,Re=!0,it=1,Pt=0;const zt=(he||Pe)&&Ie.vertical,ii=Ie.metrics.advance*Ie.scale/2;if(Pe&&X.verticalizable&&(Pt=Me.lineOffset/2-(Ie.imageName?-(li-Ie.metrics.width*Ie.scale)/2:(Ie.scale-1)*li)),Ie.imageName){const Ut=Be[Ie.imageName];Re=Ut.sdf,it=Ut.pixelRatio,Ve=Ui/it}const ar=he?[Ie.x+ii,Ie.y]:[0,0];let gi=he?[0,0]:[Ie.x+ii+ne[0],Ie.y+ne[1]-Pt],Yt=[0,0];zt&&(Yt=gi,gi=[0,0]);const ci=(Ie.metrics.left-Ve)*Ie.scale-ii+gi[0],_i=(-Ie.metrics.top-Ve)*Ie.scale+gi[1],Ei=ci+ye.w*Ie.scale/it,Vi=_i+ye.h*Ie.scale/it,Jt=new xe(ci,_i),yi=new xe(Ei,_i),Si=new xe(ci,Vi),zi=new xe(Ei,Vi);if(zt){const Ut=new xe(-ii,ii-ho),xi=-Math.PI/2,rt=li/2-ii,Qi=new xe(5-ho-rt,-(Ie.imageName?rt:0)),vi=new xe(...Yt);Jt._rotateAround(xi,Ut)._add(Qi)._add(vi),yi._rotateAround(xi,Ut)._add(Qi)._add(vi),Si._rotateAround(xi,Ut)._add(Qi)._add(vi),zi._rotateAround(xi,Ut)._add(Qi)._add(vi)}if(Se){const Ut=Math.sin(Se),xi=Math.cos(Se),rt=[xi,-Ut,Ut,xi];Jt._matMult(rt),yi._matMult(rt),Si._matMult(rt),zi._matMult(rt)}const Ni=new xe(0,0),$i=new xe(0,0);Te.push({tl:Jt,tr:yi,bl:Si,br:zi,tex:ye,writingMode:X.writingMode,glyphOffset:ar,sectionIndex:Ie.sectionIndex,isSDF:Re,pixelOffsetTL:Ni,pixelOffsetBR:$i,minFontScaleX:0,minFontScaleY:0})}return Te}(0,r,f,l,u,d,s,i.allowVerticalPlacement),F=i.textSizeData;let K=null;F.kind==="source"?(K=[Zr*l.layout.get("text-size").evaluate(d,{})],K[0]>On&&Vt(`${i.layerIds[0]}: Value for "text-size" is >= ${po}. Reduce your "text-size".`)):F.kind==="composite"&&(K=[Zr*C.compositeTextSizes[0].evaluate(d,{},z),Zr*C.compositeTextSizes[1].evaluate(d,{},z)],(K[0]>On||K[1]>On)&&Vt(`${i.layerIds[0]}: Value for "text-size" is >= ${po}. Reduce your "text-size".`)),i.addSymbols(i.text,U,K,f,u,d,v,e,g.lineStartIndex,g.lineLength,P,z);for(const Q of b)S[Q]=i.text.placedSymbolArray.length-1;return 4*U.length}function Vu(i){for(const e in i)return i[e];return null}function tf(i,e,r,s){const l=i.compareText;if(e in l){const u=l[e];for(let d=u.length-1;d>=0;d--)if(s.dist(u[d])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const u=Nu[15&s];if(!u)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new Vc(f,d,u,e)}constructor(e,r=64,s=Float64Array,l){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const u=Nu.indexOf(this.ArrayType),d=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-f%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${s}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=r,s}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Nc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,s,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:d,nodeSize:f}=this,g=[0,u.length-1,0],v=[];for(;g.length;){const b=g.pop()||0,S=g.pop()||0,P=g.pop()||0;if(S-P<=f){for(let F=P;F<=S;F++){const K=d[2*F],Q=d[2*F+1];K>=e&&K<=s&&Q>=r&&Q<=l&&v.push(u[F])}continue}const C=P+S>>1,z=d[2*C],U=d[2*C+1];z>=e&&z<=s&&U>=r&&U<=l&&v.push(u[C]),(b===0?e<=z:r<=U)&&(g.push(P),g.push(C-1),g.push(1-b)),(b===0?s>=z:l>=U)&&(g.push(C+1),g.push(S),g.push(1-b))}return v}within(e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:u,nodeSize:d}=this,f=[0,l.length-1,0],g=[],v=s*s;for(;f.length;){const b=f.pop()||0,S=f.pop()||0,P=f.pop()||0;if(S-P<=d){for(let F=P;F<=S;F++)qu(u[2*F],u[2*F+1],e,r)<=v&&g.push(l[F]);continue}const C=P+S>>1,z=u[2*C],U=u[2*C+1];qu(z,U,e,r)<=v&&g.push(l[C]),(b===0?e-s<=z:r-s<=U)&&(f.push(P),f.push(C-1),f.push(1-b)),(b===0?e+s>=z:r+s>=U)&&(f.push(C+1),f.push(S),f.push(1-b))}return g}}function Nc(i,e,r,s,l,u){if(l-s<=r)return;const d=s+l>>1;$u(i,e,d,s,l,u),Nc(i,e,r,s,d-1,1-u),Nc(i,e,r,d+1,l,1-u)}function $u(i,e,r,s,l,u){for(;l>s;){if(l-s>600){const v=l-s+1,b=r-s+1,S=Math.log(v),P=.5*Math.exp(2*S/3),C=.5*Math.sqrt(S*P*(v-P)/v)*(b-v/2<0?-1:1);$u(i,e,r,Math.max(s,Math.floor(r-b*P/v+C)),Math.min(l,Math.floor(r+(v-b)*P/v+C)),u)}const d=e[2*r+u];let f=s,g=l;for(mo(i,e,s,r),e[2*l+u]>d&&mo(i,e,s,l);fd;)g--}e[2*s+u]===d?mo(i,e,s,g):(g++,mo(i,e,g,l)),g<=r&&(s=g+1),r<=g&&(l=g-1)}}function mo(i,e,r,s){$c(i,r,s),$c(e,2*r,2*s),$c(e,2*r+1,2*s+1)}function $c(i,e,r){const s=i[e];i[e]=i[r],i[r]=s}function qu(i,e,r,s){const l=i-r,u=e-s;return l*l+u*u}var qc;h.PerformanceMarkers=void 0,(qc=h.PerformanceMarkers||(h.PerformanceMarkers={})).create="create",qc.load="load",qc.fullLoad="fullLoad";let Ml=null,go=[];const jc=1e3/60,Zc="loadTime",Gc="fullLoadTime",rf={mark(i){performance.mark(i)},frame(i){const e=i;Ml!=null&&go.push(e-Ml),Ml=e},clearMetrics(){Ml=null,go=[],performance.clearMeasures(Zc),performance.clearMeasures(Gc);for(const i in h.PerformanceMarkers)performance.clearMarks(h.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure(Zc,h.PerformanceMarkers.create,h.PerformanceMarkers.load),performance.measure(Gc,h.PerformanceMarkers.create,h.PerformanceMarkers.fullLoad);const i=performance.getEntriesByName(Zc)[0].duration,e=performance.getEntriesByName(Gc)[0].duration,r=go.length,s=1/(go.reduce((u,d)=>u+d,0)/r/1e3),l=go.filter(u=>u>jc).reduce((u,d)=>u+(d-jc)/jc,0);return{loadTime:i,fullLoadTime:e,fps:s,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};h.AJAXError=Br,h.ARRAY_TYPE=ta,h.Actor=class{constructor(i,e,r){this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Rt(["receive","process"],this),this.invoker=new Gp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Zi()?i:window}send(i,e,r,s,l=!1){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[u]=r);const d=Lr(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:i,hasCallback:!!r,targetMapId:s,mustQueue:l,sourceMapId:this.mapId,data:rs(e,d)},d),{cancel:()=>{r&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:s,sourceMapId:this.mapId})}}}receive(i){const e=i.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type===""){delete this.tasks[r];const s=this.cancelCallbacks[r];delete this.cancelCallbacks[r],s&&s()}else Zi()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(!this.taskQueue.length)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){if(e.type===""){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Ar(e.error)):r(null,Ar(e.data)))}else{let r=!1;const s=Lr(this.globalScope)?void 0:[],l=e.hasCallback?(f,g)=>{r=!0,delete this.cancelCallbacks[i],this.target.postMessage({id:i,type:"",sourceMapId:this.mapId,error:f?rs(f):null,data:rs(g,s)},s)}:f=>{r=!0};let u=null;const d=Ar(e.data);if(this.parent[e.type])u=this.parent[e.type](e.sourceMapId,d,l);else if(this.parent.getWorkerSource){const f=e.type.split(".");u=this.parent.getWorkerSource(e.sourceMapId,f[0],d.source)[f[1]](d,l)}else l(new Error(`Could not find function ${e.type}`));!r&&u&&u.cancel&&(this.cancelCallbacks[i]=u.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},h.AlphaImage=io,h.CanonicalTileID=Fc,h.CollisionBoxArray=c,h.CollisionCircleLayoutArray=class extends Ws{},h.Color=Ze,h.DEMData=Eu,h.DataConstantProperty=Fe,h.DictionaryCoder=Su,h.EXTENT=At,h.ErrorEvent=Xi,h.EvaluationParameters=kt,h.Event=wr,h.Evented=vn,h.FeatureIndex=Au,h.FillBucket=vc,h.FillExtrusionBucket=wc,h.GeoJSONFeature=Iu,h.ImageAtlas=su,h.ImagePosition=Ac,h.KDBush=Vc,h.LineBucket=Tc,h.LineStripIndexArray=class extends t{},h.LngLat=Un,h.MercatorCoordinate=El,h.ONE_EM=li,h.OverscaledTileID=sr,h.PerformanceUtils=rf,h.Point=xe,h.Pos3dArray=class extends Zs{},h.PosArray=O,h.Properties=Ci,h.Protobuf=Sc,h.QuadTriangleArray=class extends Hs{},h.RGBAImage=nr,h.RasterBoundsArray=class extends Ha{},h.RequestPerformance=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},h.SegmentVector=Ee,h.SymbolBucket=oa,h.Transitionable=sl,h.TriangleIndexArray=ge,h.Uniform1f=gr,h.Uniform1i=class extends Ti{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},h.Uniform2f=class extends Ti{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},h.Uniform3f=class extends Ti{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},h.Uniform4f=ls,h.UniformColor=mi,h.UniformMatrix4f=class extends Ti{constructor(i,e){super(i,e),this.current=ai}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},h.UnwrappedTileID=Tu,h.ValidationError=we,h.ZoomHistory=Qo,h.addDynamicAttributes=kc,h.arrayBufferToImage=function(i,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=vr})},r.onerror=()=>e(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 s=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(s):vr},h.arrayBufferToImageBitmap=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(s=>{e(null,s)}).catch(s=>{e(new Error(`Could not load image because of ${s.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},h.asyncAll=function(i,e,r){if(!i.length)return r(null,[]);let s=i.length;const l=new Array(i.length);let u=null;i.forEach((d,f)=>{e(d,(g,v)=>{g&&(u=g),l[f]=v,--s==0&&r(u,l)})})},h.bezier=xt,h.bindAll=Rt,h.clamp=et,h.clipLine=Cu,h.clone=function(i){var e=new ta(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},h.clone$1=Ct,h.collisionCircleLayout=bp,h.config=Nn,h.copy=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},h.create=function(){var i=new ta(16);return ta!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},h.createExpression=Dt,h.createFilter=La,h.createLayout=Kt,h.createStyleLayer=function(i){return i.type==="custom"?new jp(i):new Zp[i.type](i)},h.deepEqual=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let s=0;s{s[d.source]?r.push({command:lt.removeLayer,args:[d.id]}):u.push(d)}),r=r.concat(l),function(d,f,g){f=f||[];const v=(d=d||[]).map(bn),b=f.map(bn),S=d.reduce(Qr,{}),P=f.reduce(Qr,{}),C=v.slice(),z=Object.create(null);let U,F,K,Q,X,ne,ae;for(U=0,F=0;U{}}},h.groupByLayout=function(i,e){const r={};for(let l=0;l@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,l,u)=>{const d=l||u;return e[s]=!d||d.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},h.parseGlyphPbf=function(i){return new Sc(i).readFields(zp,[])},h.pbf=Kh,h.performSymbolLayout=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=At/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0].layout,r=i.bucket.layers[0]._unevaluatedLayout._values,s={layoutIconSize:r["icon-size"].possiblyEvaluate(new kt(i.bucket.zoom+1),i.canonical),layoutTextSize:r["text-size"].possiblyEvaluate(new kt(i.bucket.zoom+1),i.canonical),textMaxSize:r["text-size"].possiblyEvaluate(new kt(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:g,maxZoom:v}=i.bucket.textSizeData;s.compositeTextSizes=[r["text-size"].possiblyEvaluate(new kt(g),i.canonical),r["text-size"].possiblyEvaluate(new kt(v),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:g,maxZoom:v}=i.bucket.iconSizeData;s.compositeIconSizes=[r["icon-size"].possiblyEvaluate(new kt(g),i.canonical),r["icon-size"].possiblyEvaluate(new kt(v),i.canonical)]}const l=e.get("text-line-height")*li,u=e.get("text-rotation-alignment")!=="viewport"&&e.get("symbol-placement")!=="point",d=e.get("text-keep-upright"),f=e.get("text-size");for(const g of i.bucket.features){const v=e.get("text-font").evaluate(g,{},i.canonical).join(","),b=f.evaluate(g,{},i.canonical),S=s.layoutTextSize.evaluate(g,{},i.canonical),P=s.layoutIconSize.evaluate(g,{},i.canonical),C={horizontal:{},vertical:void 0},z=g.text;let U,F=[0,0];if(z){const X=z.toString(),ne=e.get("text-letter-spacing").evaluate(g,{},i.canonical)*li,ae=Va(X)?ne:0,he=e.get("text-anchor").evaluate(g,{},i.canonical),ze=e.get("text-variable-anchor");if(!ze){const Me=e.get("text-radial-offset").evaluate(g,{},i.canonical);F=Me?Ou(he,[Me*li,Oc]):e.get("text-offset").evaluate(g,{},i.canonical).map(Ie=>Ie*li)}let Be=u?"center":e.get("text-justify").evaluate(g,{},i.canonical);const Pe=e.get("symbol-placement"),Se=Pe==="point"?e.get("text-max-width").evaluate(g,{},i.canonical)*li:0,Te=()=>{i.bucket.allowVerticalPlacement&&Fs(X)&&(C.vertical=vl(z,i.glyphMap,i.glyphPositions,i.imagePositions,v,Se,l,he,"left",ae,F,h.WritingMode.vertical,!0,Pe,S,b))};if(!u&&ze){const Me=Be==="auto"?ze.map(ye=>Uc(ye)):[Be];let Ie=!1;for(let ye=0;yethis._layers[fe.id]),J=Z[0];if(J.visibility==="none")continue;const W=J.source||"";let G=this.familiesBySource[W];G||(G=this.familiesBySource[W]={});const ee=J.sourceLayer||"_geojsonTileLayer";let ue=G[ee];ue||(ue=G[ee]=[]),ue.push(Z)}}}class Y{constructor(I){const M={},L=[];for(const W in I){const G=I[W],ee=M[W]={};for(const ue in G){const fe=G[+ue];if(!fe||fe.bitmap.width===0||fe.bitmap.height===0)continue;const pe={x:0,y:0,w:fe.bitmap.width+2,h:fe.bitmap.height+2};L.push(pe),ee[ue]={rect:pe,metrics:fe.metrics}}}const{w:j,h:Z}=h.potpack(L),J=new h.AlphaImage({width:j||1,height:Z||1});for(const W in I){const G=I[W];for(const ee in G){const ue=G[+ee];if(!ue||ue.bitmap.width===0||ue.bitmap.height===0)continue;const fe=M[W][ee].rect;h.AlphaImage.copy(ue.bitmap,J,{x:0,y:0},{x:fe.x+1,y:fe.y+1},ue.bitmap)}}this.image=J,this.positions=M}}h.register("GlyphAtlas",Y);class Ne{constructor(I){this.tileID=new h.OverscaledTileID(I.tileID.overscaledZ,I.tileID.wrap,I.tileID.canonical.z,I.tileID.canonical.x,I.tileID.canonical.y),this.uid=I.uid,this.zoom=I.zoom,this.pixelRatio=I.pixelRatio,this.tileSize=I.tileSize,this.source=I.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=I.showCollisionBoxes,this.collectResourceTiming=!!I.collectResourceTiming,this.returnDependencies=!!I.returnDependencies,this.promoteId=I.promoteId}parse(I,M,L,j,Z){this.status="parsing",this.data=I,this.collisionBoxArray=new h.CollisionBoxArray;const J=new h.DictionaryCoder(Object.keys(I.layers).sort()),W=new h.FeatureIndex(this.tileID,this.promoteId);W.bucketLayerIDs=[];const G={},ee={featureIndex:W,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:L},ue=M.familiesBySource[this.source];for(const tt in ue){const ct=I.layers[tt];if(!ct)continue;ct.version===1&&h.warnOnce(`Vector tile source "${this.source}" layer "${tt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Tt=J.encode(tt),Xt=[];for(let Ze=0;Ze=Lt.maxzoom||Lt.visibility!=="none"&&(xe(Ze,this.zoom,L),(G[Lt.id]=Lt.createBucket({index:W.bucketLayerIDs.length,layers:Ze,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Tt,sourceID:this.source})).populate(Xt,ee,this.tileID.canonical),W.bucketLayerIDs.push(Ze.map(Ur=>Ur.id)))}}let fe,pe,$e,Xe;const Le=h.mapObject(ee.glyphDependencies,tt=>Object.keys(tt).map(Number));Object.keys(Le).length?j.send("getGlyphs",{uid:this.uid,stacks:Le,source:this.source,tileID:this.tileID,type:"glyphs"},(tt,ct)=>{fe||(fe=tt,pe=ct,at.call(this))}):pe={};const Oe=Object.keys(ee.iconDependencies);Oe.length?j.send("getImages",{icons:Oe,source:this.source,tileID:this.tileID,type:"icons"},(tt,ct)=>{fe||(fe=tt,$e=ct,at.call(this))}):$e={};const Ge=Object.keys(ee.patternDependencies);function at(){if(fe)return Z(fe);if(pe&&$e&&Xe){const tt=new Y(pe),ct=new h.ImageAtlas($e,Xe);for(const Tt in G){const Xt=G[Tt];Xt instanceof h.SymbolBucket?(xe(Xt.layers,this.zoom,L),h.performSymbolLayout({bucket:Xt,glyphMap:pe,glyphPositions:tt.positions,imageMap:$e,imagePositions:ct.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Xt.hasPattern&&(Xt instanceof h.LineBucket||Xt instanceof h.FillBucket||Xt instanceof h.FillExtrusionBucket)&&(xe(Xt.layers,this.zoom,L),Xt.addFeatures(ee,this.tileID.canonical,ct.patternPositions))}this.status="done",Z(null,{buckets:Object.values(G).filter(Tt=>!Tt.isEmpty()),featureIndex:W,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:tt.image,imageAtlas:ct,glyphMap:this.returnDependencies?pe:null,iconMap:this.returnDependencies?$e:null,glyphPositions:this.returnDependencies?tt.positions:null})}}Ge.length?j.send("getImages",{icons:Ge,source:this.source,tileID:this.tileID,type:"patterns"},(tt,ct)=>{fe||(fe=tt,Xe=ct,at.call(this))}):Xe={},at.call(this)}}function xe(V,I,M){const L=new h.EvaluationParameters(I);for(const j of V)j.recalculate(L,M)}function nt(V,I){const M=h.getArrayBuffer(V.request,(L,j,Z,J)=>{L?I(L):j&&I(null,{vectorTile:new h.vectorTile.VectorTile(new h.Protobuf(j)),rawData:j,cacheControl:Z,expires:J})});return()=>{M.cancel(),I()}}class ot{constructor(I,M,L,j){this.actor=I,this.layerIndex=M,this.availableImages=L,this.loadVectorData=j||nt,this.loading={},this.loaded={}}loadTile(I,M){const L=I.uid;this.loading||(this.loading={});const j=!!(I&&I.request&&I.request.collectResourceTiming)&&new h.RequestPerformance(I.request),Z=this.loading[L]=new Ne(I);Z.abort=this.loadVectorData(I,(J,W)=>{if(delete this.loading[L],J||!W)return Z.status="done",this.loaded[L]=Z,M(J);const G=W.rawData,ee={};W.expires&&(ee.expires=W.expires),W.cacheControl&&(ee.cacheControl=W.cacheControl);const ue={};if(j){const fe=j.finish();fe&&(ue.resourceTiming=JSON.parse(JSON.stringify(fe)))}Z.vectorTile=W.vectorTile,Z.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,(fe,pe)=>{if(fe||!pe)return M(fe);M(null,h.extend({rawTileData:G.slice(0)},pe,ee,ue))}),this.loaded=this.loaded||{},this.loaded[L]=Z})}reloadTile(I,M){const L=this.loaded,j=I.uid,Z=this;if(L&&L[j]){const J=L[j];J.showCollisionBoxes=I.showCollisionBoxes;const W=(G,ee)=>{const ue=J.reloadCallback;ue&&(delete J.reloadCallback,J.parse(J.vectorTile,Z.layerIndex,this.availableImages,Z.actor,ue)),M(G,ee)};J.status==="parsing"?J.reloadCallback=W:J.status==="done"&&(J.vectorTile?J.parse(J.vectorTile,this.layerIndex,this.availableImages,this.actor,W):W())}}abortTile(I,M){const L=this.loading,j=I.uid;L&&L[j]&&L[j].abort&&(L[j].abort(),delete L[j]),M()}removeTile(I,M){const L=this.loaded,j=I.uid;L&&L[j]&&delete L[j],M()}}class We{constructor(){this.loaded={}}loadTile(I,M){const{uid:L,encoding:j,rawImageData:Z}=I,J=h.isImageBitmap(Z)?this.getImageData(Z):Z,W=new h.DEMData(L,J,j);this.loaded=this.loaded||{},this.loaded[L]=W,M(null,W)}getImageData(I){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(I.width,I.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=I.width,this.offscreenCanvas.height=I.height,this.offscreenCanvasContext.drawImage(I,0,0,I.width,I.height);const M=this.offscreenCanvasContext.getImageData(-1,-1,I.width+2,I.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new h.RGBAImage({width:M.width,height:M.height},M.data)}removeTile(I){const M=this.loaded,L=I.uid;M&&M[L]&&delete M[L]}}function xt(V,I){if(V.length!==0){bt(V[0],I);for(var M=1;M=Math.abs(W)?M-G+W:W-G+M,M=G}M+L>=0!=!!I&&V.reverse()}var et=h.getDefaultExportFromCjs(function V(I,M){var L,j=I&&I.type;if(j==="FeatureCollection")for(L=0;L>31}function vr(V,I){for(var M=V.loadGeometry(),L=V.type,j=0,Z=0,J=M.length,W=0;WV},Nn=Math.fround||(Br=new Float32Array(1),V=>(Br[0]=+V,Br[0]));var Br;const bi=3,Gi=5,hi=6;class yn{constructor(I){this.options=Object.assign(Object.create(_n),I),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(I){const{log:M,minZoom:L,maxZoom:j}=this.options;M&&console.time("total time");const Z=`prepare ${I.length} points`;M&&console.time(Z),this.points=I;const J=[];for(let G=0;G=L;G--){const ee=+Date.now();W=this.trees[G]=this._createTree(this._cluster(W,G)),M&&console.log("z%d: %d clusters in %dms",G,W.numItems,+Date.now()-ee)}return M&&console.timeEnd("total time"),this}getClusters(I,M){let L=((I[0]+180)%360+360)%360-180;const j=Math.max(-90,Math.min(90,I[1]));let Z=I[2]===180?180:((I[2]+180)%360+360)%360-180;const J=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)L=-180,Z=180;else if(L>Z){const fe=this.getClusters([L,j,180,J],M),pe=this.getClusters([-180,j,Z,J],M);return fe.concat(pe)}const W=this.trees[this._limitZoom(M)],G=W.range(Rr(L),br(J),Rr(Z),br(j)),ee=W.data,ue=[];for(const fe of G){const pe=this.stride*fe;ue.push(ee[pe+Gi]>1?xn(ee,pe,this.clusterProps):this.points[ee[pe+bi]])}return ue}getChildren(I){const M=this._getOriginId(I),L=this._getOriginZoom(I),j="No cluster with the specified id.",Z=this.trees[L];if(!Z)throw new Error(j);const J=Z.data;if(M*this.stride>=J.length)throw new Error(j);const W=this.options.radius/(this.options.extent*Math.pow(2,L-1)),G=Z.within(J[M*this.stride],J[M*this.stride+1],W),ee=[];for(const ue of G){const fe=ue*this.stride;J[fe+4]===I&&ee.push(J[fe+Gi]>1?xn(J,fe,this.clusterProps):this.points[J[fe+bi]])}if(ee.length===0)throw new Error(j);return ee}getLeaves(I,M,L){const j=[];return this._appendLeaves(j,I,M=M||10,L=L||0,0),j}getTile(I,M,L){const j=this.trees[this._limitZoom(I)],Z=Math.pow(2,I),{extent:J,radius:W}=this.options,G=W/J,ee=(L-G)/Z,ue=(L+1+G)/Z,fe={features:[]};return this._addTileFeatures(j.range((M-G)/Z,ee,(M+1+G)/Z,ue),j.data,M,L,Z,fe),M===0&&this._addTileFeatures(j.range(1-G/Z,ee,1,ue),j.data,Z,L,Z,fe),M===Z-1&&this._addTileFeatures(j.range(0,ee,G/Z,ue),j.data,-1,L,Z,fe),fe.features.length?fe:null}getClusterExpansionZoom(I){let M=this._getOriginZoom(I)-1;for(;M<=this.options.maxZoom;){const L=this.getChildren(I);if(M++,L.length!==1)break;I=L[0].properties.cluster_id}return M}_appendLeaves(I,M,L,j,Z){const J=this.getChildren(M);for(const W of J){const G=W.properties;if(G&&G.cluster?Z+G.point_count<=j?Z+=G.point_count:Z=this._appendLeaves(I,G.cluster_id,L,j,Z):Z1;let ue,fe,pe;if(ee)ue=Kr(M,G,this.clusterProps),fe=M[G],pe=M[G+1];else{const Le=this.points[M[G+bi]];ue=Le.properties;const[Oe,Ge]=Le.geometry.coordinates;fe=Rr(Oe),pe=br(Ge)}const $e={type:1,geometry:[[Math.round(this.options.extent*(fe*Z-L)),Math.round(this.options.extent*(pe*Z-j))]],tags:ue};let Xe;Xe=ee||this.options.generateId?M[G+bi]:this.points[M[G+bi]].id,Xe!==void 0&&($e.id=Xe),J.features.push($e)}}_limitZoom(I){return Math.max(this.options.minZoom,Math.min(Math.floor(+I),this.options.maxZoom+1))}_cluster(I,M){const{radius:L,extent:j,reduce:Z,minPoints:J}=this.options,W=L/(j*Math.pow(2,M)),G=I.data,ee=[],ue=this.stride;for(let fe=0;feM&&(Oe+=G[at+Gi])}if(Oe>Le&&Oe>=J){let Ge,at=pe*Le,tt=$e*Le,ct=-1;const Tt=((fe/ue|0)<<5)+(M+1)+this.points.length;for(const Xt of Xe){const Ze=Xt*ue;if(G[Ze+2]<=M)continue;G[Ze+2]=M;const Lt=G[Ze+Gi];at+=G[Ze]*Lt,tt+=G[Ze+1]*Lt,G[Ze+4]=Tt,Z&&(Ge||(Ge=this._map(G,fe,!0),ct=this.clusterProps.length,this.clusterProps.push(Ge)),Z(Ge,this._map(G,Ze)))}G[fe+4]=Tt,ee.push(at/Oe,tt/Oe,1/0,Tt,-1,Oe),Z&&ee.push(ct)}else{for(let Ge=0;Ge1)for(const Ge of Xe){const at=Ge*ue;if(!(G[at+2]<=M)){G[at+2]=M;for(let tt=0;tt>5}_getOriginZoom(I){return(I-this.points.length)%32}_map(I,M,L){if(I[M+Gi]>1){const J=this.clusterProps[I[M+hi]];return L?Object.assign({},J):J}const j=this.points[I[M+bi]].properties,Z=this.options.map(j);return L&&Z===j?Object.assign({},Z):Z}}function xn(V,I,M){return{type:"Feature",id:V[I+bi],properties:Kr(V,I,M),geometry:{type:"Point",coordinates:[(L=V[I],360*(L-.5)),wr(V[I+1])]}};var L}function Kr(V,I,M){const L=V[I+Gi],j=L>=1e4?`${Math.round(L/1e3)}k`:L>=1e3?Math.round(L/100)/10+"k":L,Z=V[I+hi],J=Z===-1?{}:Object.assign({},M[Z]);return Object.assign(J,{cluster:!0,cluster_id:V[I+bi],point_count:L,point_count_abbreviated:j})}function Rr(V){return V/360+.5}function br(V){const I=Math.sin(V*Math.PI/180),M=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return M<0?0:M>1?1:M}function wr(V){const I=(180-360*V)*Math.PI/180;return 360*Math.atan(Math.exp(I))/Math.PI-90}function Xi(V,I,M,L){for(var j,Z=L,J=M-I>>1,W=M-I,G=V[I],ee=V[I+1],ue=V[M],fe=V[M+1],pe=I+3;peZ)j=pe,Z=$e;else if($e===Z){var Xe=Math.abs(pe-J);XeL&&(j-I>3&&Xi(V,I,j,L),V[j+2]=Z,M-j>3&&Xi(V,j,M,L))}function vn(V,I,M,L,j,Z){var J=j-M,W=Z-L;if(J!==0||W!==0){var G=((V-M)*J+(I-L)*W)/(J*J+W*W);G>1?(M=j,L=Z):G>0&&(M+=J*G,L+=W*G)}return(J=V-M)*J+(W=I-L)*W}function le(V,I,M,L){var j={id:V===void 0?null:V,type:I,geometry:M,tags:L,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Z){var J=Z.geometry,W=Z.type;if(W==="Point"||W==="MultiPoint"||W==="LineString")Fr(Z,J);else if(W==="Polygon"||W==="MultiLineString")for(var G=0;G0&&(J+=L?(j*ee-G*Z)/2:Math.sqrt(Math.pow(G-j,2)+Math.pow(ee-Z,2))),j=G,Z=ee}var ue=I.length-3;I[2]=1,Xi(I,0,ue,M),I[ue+2]=1,I.size=Math.abs(J),I.start=0,I.end=I.size}function Yr(V,I,M,L){for(var j=0;j1?1:M}function Gt(V,I,M,L,j,Z,J,W){if(L/=I,Z>=(M/=I)&&J=L)return null;for(var G=[],ee=0;ee=M&&Xe=L)){var Le=[];if(pe==="Point"||pe==="MultiPoint")Jr(fe,Le,M,L,j);else if(pe==="LineString")bn(fe,Le,M,L,j,!1,W.lineMetrics);else if(pe==="MultiLineString")we(fe,Le,M,L,j,!1);else if(pe==="Polygon")we(fe,Le,M,L,j,!0);else if(pe==="MultiPolygon")for(var Oe=0;Oe=M&&J<=L&&(I.push(V[Z]),I.push(V[Z+1]),I.push(V[Z+2]))}}function bn(V,I,M,L,j,Z,J){for(var W,G,ee=Qr(V),ue=j===0?fi:wn,fe=V.start,pe=0;peM&&(G=ue(ee,$e,Xe,Oe,Ge,M),J&&(ee.start=fe+W*G)):at>L?tt=M&&(G=ue(ee,$e,Xe,Oe,Ge,M),ct=!0),tt>L&&at<=L&&(G=ue(ee,$e,Xe,Oe,Ge,L),ct=!0),!Z&&ct&&(J&&(ee.end=fe+W*G),I.push(ee),ee=Qr(V)),J&&(fe+=W)}var Tt=V.length-3;$e=V[Tt],Xe=V[Tt+1],Le=V[Tt+2],(at=j===0?$e:Xe)>=M&&at<=L&&lr(ee,$e,Xe,Le),Tt=ee.length-3,Z&&Tt>=3&&(ee[Tt]!==ee[0]||ee[Tt+1]!==ee[1])&&lr(ee,ee[0],ee[1],ee[2]),ee.length&&I.push(ee)}function Qr(V){var I=[];return I.size=V.size,I.start=V.start,I.end=V.end,I}function we(V,I,M,L,j,Z){for(var J=0;JJ.maxX&&(J.maxX=ue),fe>J.maxY&&(J.maxY=fe)}return J}function Qt(V,I,M,L){var j=I.geometry,Z=I.type,J=[];if(Z==="Point"||Z==="MultiPoint")for(var W=0;W0&&I.size<(j?J:L))M.numPoints+=I.length/3;else{for(var W=[],G=0;GJ)&&(M.numSimplified++,W.push(I[G]),W.push(I[G+1])),M.numPoints++;j&&function(ee,ue){for(var fe=0,pe=0,$e=ee.length,Xe=$e-2;pe<$e;Xe=pe,pe+=2)fe+=(ee[pe]-ee[Xe])*(ee[pe+1]+ee[Xe+1]);if(fe>0===ue)for(pe=0,$e=ee.length;pe<$e/2;pe+=2){var Le=ee[pe],Oe=ee[pe+1];ee[pe]=ee[$e-2-pe],ee[pe+1]=ee[$e-1-pe],ee[$e-2-pe]=Le,ee[$e-1-pe]=Oe}}(W,Z),V.push(W)}}function Tr(V,I){var M=(I=this.options=function(j,Z){for(var J in Z)j[J]=Z[J];return j}(Object.create(this.options),I)).debug;if(M&&console.time("preprocess data"),I.maxZoom<0||I.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(I.promoteId&&I.generateId)throw new Error("promoteId and generateId cannot be used together.");var L=function(j,Z){var J=[];if(j.type==="FeatureCollection")for(var W=0;W1&&console.time("creation"),pe=this.tiles[fe]=Pi(V,I,M,L,G),this.tileCoords.push({z:I,x:M,y:L}),ee)){ee>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",I,M,L,pe.numFeatures,pe.numPoints,pe.numSimplified),console.timeEnd("creation"));var $e="z"+I;this.stats[$e]=(this.stats[$e]||0)+1,this.total++}if(pe.source=V,j){if(I===G.maxZoom||I===j)continue;var Xe=1<1&&console.time("clipping");var Le,Oe,Ge,at,tt,ct,Tt=.5*G.buffer/G.extent,Xt=.5-Tt,Ze=.5+Tt,Lt=1+Tt;Le=Oe=Ge=at=null,tt=Gt(V,ue,M-Tt,M+Ze,0,pe.minX,pe.maxX,G),ct=Gt(V,ue,M+Xt,M+Lt,0,pe.minX,pe.maxX,G),V=null,tt&&(Le=Gt(tt,ue,L-Tt,L+Ze,1,pe.minY,pe.maxY,G),Oe=Gt(tt,ue,L+Xt,L+Lt,1,pe.minY,pe.maxY,G),tt=null),ct&&(Ge=Gt(ct,ue,L-Tt,L+Ze,1,pe.minY,pe.maxY,G),at=Gt(ct,ue,L+Xt,L+Lt,1,pe.minY,pe.maxY,G),ct=null),ee>1&&console.timeEnd("clipping"),W.push(Le||[],I+1,2*M,2*L),W.push(Oe||[],I+1,2*M,2*L+1),W.push(Ge||[],I+1,2*M+1,2*L),W.push(at||[],I+1,2*M+1,2*L+1)}}},Tr.prototype.getTile=function(V,I,M){var L=this.options,j=L.extent,Z=L.debug;if(V<0||V>24)return null;var J=1<1&&console.log("drilling down to z%d-%d-%d",V,I,M);for(var G,ee=V,ue=I,fe=M;!G&&ee>0;)ee--,ue=Math.floor(ue/2),fe=Math.floor(fe/2),G=this.tiles[Er(ee,ue,fe)];return G&&G.source?(Z>1&&console.log("found parent tile z%d-%d-%d",ee,ue,fe),Z>1&&console.time("drilling down"),this.splitTile(G.source,ee,ue,fe,V,I,M),Z>1&&console.timeEnd("drilling down"),this.tiles[W]?Qe(this.tiles[W],j):null):null};class jn extends ot{constructor(I,M,L,j){super(I,M,L,St),this._dataUpdateable=new Map,this.loadGeoJSON=(Z,J)=>{const{promoteId:W}=Z;if(Z.request)return h.getJSON(Z.request,(G,ee,ue,fe)=>{this._dataUpdateable=Sr(ee,W)?ui(ee,W):void 0,J(G,ee,ue,fe)});if(typeof Z.data=="string")try{const G=JSON.parse(Z.data);this._dataUpdateable=Sr(G,W)?ui(G,W):void 0,J(null,G)}catch{J(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`))}else Z.dataDiff?this._dataUpdateable?(function(G,ee,ue){var fe,pe,$e,Xe;if(ee.removeAll&&G.clear(),ee.remove)for(const Le of ee.remove)G.delete(Le);if(ee.add)for(const Le of ee.add){const Oe=er(Le,ue);Oe!=null&&G.set(Oe,Le)}if(ee.update)for(const Le of ee.update){let Oe=G.get(Le.id);if(Oe==null)continue;const Ge=!Le.removeAllProperties&&(((fe=Le.removeProperties)===null||fe===void 0?void 0:fe.length)>0||((pe=Le.addOrUpdateProperties)===null||pe===void 0?void 0:pe.length)>0);if((Le.newGeometry||Le.removeAllProperties||Ge)&&(Oe={...Oe},G.set(Le.id,Oe),Ge&&(Oe.properties={...Oe.properties})),Le.newGeometry&&(Oe.geometry=Le.newGeometry),Le.removeAllProperties)Oe.properties={};else if((($e=Le.removeProperties)===null||$e===void 0?void 0:$e.length)>0)for(const at of Le.removeProperties)Object.prototype.hasOwnProperty.call(Oe.properties,at)&&delete Oe.properties[at];if(((Xe=Le.addOrUpdateProperties)===null||Xe===void 0?void 0:Xe.length)>0)for(const{key:at,value:tt}of Le.addOrUpdateProperties)Oe.properties[at]=tt}}(this._dataUpdateable,Z.dataDiff,W),J(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):J(new Error(`Cannot update existing geojson data in ${Z.source}`)):J(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},j&&(this.loadGeoJSON=j)}loadData(I,M){var L;(L=this._pendingRequest)===null||L===void 0||L.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const j=!!(I&&I.request&&I.request.collectResourceTiming)&&new h.RequestPerformance(I.request);this._pendingCallback=M,this._pendingRequest=this.loadGeoJSON(I,(Z,J)=>{if(delete this._pendingCallback,delete this._pendingRequest,Z||!J)return M(Z);if(typeof J!="object")return M(new Error(`Input data given to '${I.source}' is not a valid GeoJSON object.`));{et(J,!0);try{if(I.filter){const G=h.createExpression(I.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(G.result==="error")throw new Error(G.value.map(ue=>`${ue.key}: ${ue.message}`).join(", "));J={type:"FeatureCollection",features:J.features.filter(ue=>G.value.evaluate({zoom:0},ue))}}this._geoJSONIndex=I.cluster?new yn(function({superclusterOptions:G,clusterProperties:ee}){if(!ee||!G)return G;const ue={},fe={},pe={accumulated:null,zoom:0},$e={properties:null},Xe=Object.keys(ee);for(const Le of Xe){const[Oe,Ge]=ee[Le],at=h.createExpression(Ge),tt=h.createExpression(typeof Oe=="string"?[Oe,["accumulated"],["get",Le]]:Oe);ue[Le]=at.value,fe[Le]=tt.value}return G.map=Le=>{$e.properties=Le;const Oe={};for(const Ge of Xe)Oe[Ge]=ue[Ge].evaluate(pe,$e);return Oe},G.reduce=(Le,Oe)=>{$e.properties=Oe;for(const Ge of Xe)pe.accumulated=Le[Ge],Le[Ge]=fe[Ge].evaluate(pe,$e)},G}(I)).load(J.features):function(G,ee){return new Tr(G,ee)}(J,I.geojsonVtOptions)}catch(G){return M(G)}this.loaded={};const W={};if(j){const G=j.finish();G&&(W.resourceTiming={},W.resourceTiming[I.source]=JSON.parse(JSON.stringify(G)))}M(null,W)}})}reloadTile(I,M){const L=this.loaded;return L&&L[I.uid]?super.reloadTile(I,M):this.loadTile(I,M)}removeSource(I,M){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),M()}getClusterExpansionZoom(I,M){try{M(null,this._geoJSONIndex.getClusterExpansionZoom(I.clusterId))}catch(L){M(L)}}getClusterChildren(I,M){try{M(null,this._geoJSONIndex.getChildren(I.clusterId))}catch(L){M(L)}}getClusterLeaves(I,M){try{M(null,this._geoJSONIndex.getLeaves(I.clusterId,I.limit,I.offset))}catch(L){M(L)}}}class cr{constructor(I){this.self=I,this.actor=new h.Actor(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:ot,geojson:jn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(M,L)=>{if(this.workerSourceTypes[M])throw new Error(`Worker source with name "${M}" already registered.`);this.workerSourceTypes[M]=L},this.self.registerRTLTextPlugin=M=>{if(h.plugin.isParsed())throw new Error("RTL text plugin already registered.");h.plugin.applyArabicShaping=M.applyArabicShaping,h.plugin.processBidirectionalText=M.processBidirectionalText,h.plugin.processStyledBidirectionalText=M.processStyledBidirectionalText}}setReferrer(I,M){this.referrer=M}setImages(I,M,L){this.availableImages[I]=M;for(const j in this.workerSources[I]){const Z=this.workerSources[I][j];for(const J in Z)Z[J].availableImages=M}L()}setLayers(I,M,L){this.getLayerIndex(I).replace(M),L()}updateLayers(I,M,L){this.getLayerIndex(I).update(M.layers,M.removedIds),L()}loadTile(I,M,L){this.getWorkerSource(I,M.type,M.source).loadTile(M,L)}loadDEMTile(I,M,L){this.getDEMWorkerSource(I,M.source).loadTile(M,L)}reloadTile(I,M,L){this.getWorkerSource(I,M.type,M.source).reloadTile(M,L)}abortTile(I,M,L){this.getWorkerSource(I,M.type,M.source).abortTile(M,L)}removeTile(I,M,L){this.getWorkerSource(I,M.type,M.source).removeTile(M,L)}removeDEMTile(I,M){this.getDEMWorkerSource(I,M.source).removeTile(M)}removeSource(I,M,L){if(!this.workerSources[I]||!this.workerSources[I][M.type]||!this.workerSources[I][M.type][M.source])return;const j=this.workerSources[I][M.type][M.source];delete this.workerSources[I][M.type][M.source],j.removeSource!==void 0?j.removeSource(M,L):L()}loadWorkerSource(I,M,L){try{this.self.importScripts(M.url),L()}catch(j){L(j.toString())}}syncRTLPluginState(I,M,L){try{h.plugin.setState(M);const j=h.plugin.getPluginURL();if(h.plugin.isLoaded()&&!h.plugin.isParsed()&&j!=null){this.self.importScripts(j);const Z=h.plugin.isParsed();L(Z?void 0:new Error(`RTL Text Plugin failed to import scripts from ${j}`),Z)}}catch(j){L(j.toString())}}getAvailableImages(I){let M=this.availableImages[I];return M||(M=[]),M}getLayerIndex(I){let M=this.layerIndexes[I];return M||(M=this.layerIndexes[I]=new ce),M}getWorkerSource(I,M,L){if(this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][M]||(this.workerSources[I][M]={}),!this.workerSources[I][M][L]){const j={send:(Z,J,W)=>{this.actor.send(Z,J,W,I)}};this.workerSources[I][M][L]=new this.workerSourceTypes[M](j,this.getLayerIndex(I),this.getAvailableImages(I))}return this.workerSources[I][M][L]}getDEMWorkerSource(I,M){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][M]||(this.demWorkerSources[I][M]=new We),this.demWorkerSources[I][M]}}return h.isWorker()&&(self.worker=new cr(self)),cr}),ie(["./shared"],function(h){var ce="3.1.0";class Y{static testProp(t){if(!Y.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",Y.suppressClickInternal,!0)},0)}static mousePos(t,n){const a=t.getBoundingClientRect();return new h.Point(n.clientX-a.left-t.clientLeft,n.clientY-a.top-t.clientTop)}static touchPos(t,n){const a=t.getBoundingClientRect(),c=[];for(let p=0;p{t=[],n=0,a=0,c={}},o.addThrottleControl=x=>{const T=a++;return c[T]=x,T},o.removeThrottleControl=x=>{delete c[x],y()},o.getImage=(x,T,w=!0)=>{Ne.supported&&(x.headers||(x.headers={}),x.headers.accept="image/webp,*/*");const k={requestParameters:x,supportImageRefresh:w,callback:T,cancelled:!1,completed:!1,cancel:()=>{k.completed||k.cancelled||(k.cancelled=!0,k.innerRequest&&(k.innerRequest.cancel(),n--),y())}};return t.push(k),y(),k};const p=x=>{const{requestParameters:T,supportImageRefresh:w,callback:k}=x;return h.extend(T,{type:"image"}),(w!==!1||h.isWorker()||h.getProtocolAction(T.url)||T.headers&&!Object.keys(T.headers).reduce((O,B)=>O&&B==="accept",!0)?h.makeRequest:_)(T,(O,B,R,q)=>{m(x,k,O,B,R,q)})},m=(x,T,w,k,O,B)=>{w?T(w):k instanceof HTMLImageElement||k instanceof ImageBitmap?T(null,k):k&&((R,q)=>{typeof createImageBitmap=="function"?h.arrayBufferToImageBitmap(R,q):h.arrayBufferToImage(R,q)})(k,(R,q)=>{R!=null?T(R):q!=null&&T(null,q,{cacheControl:O,expires:B})}),x.cancelled||(x.completed=!0,n--,y())},y=()=>{const x=(()=>{const T=Object.keys(c);let w=!1;if(T.length>0){for(const k of T)if(w=c[k](),w)break}return w})()?h.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:h.config.MAX_PARALLEL_IMAGE_REQUESTS;for(let T=n;T0;T++){const w=t.shift();if(w.cancelled){T--;continue}const k=p(w);n++,w.innerRequest=k}},_=(x,T)=>{const w=new Image,k=x.url;let O=!1;const B=x.credentials;return B&&B==="include"?w.crossOrigin="use-credentials":(B&&B==="same-origin"||!h.sameOrigin(k))&&(w.crossOrigin="anonymous"),w.fetchPriority="high",w.onload=()=>{T(null,w),w.onerror=w.onload=null},w.onerror=()=>{O||T(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.")),w.onerror=w.onload=null},w.src=k,{cancel:()=>{O=!0,w.src=""}}}}(bt||(bt={})),bt.resetRequestQueue();var et,Bt=bt;(function(o){o.Glyphs="Glyphs",o.Image="Image",o.Source="Source",o.SpriteImage="SpriteImage",o.SpriteJSON="SpriteJSON",o.Style="Style",o.Tile="Tile",o.Unknown="Unknown"})(et||(et={}));class pt{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,a){const c=function(p){const m=p.match(ri);if(!m)throw new Error(`Unable to parse URL "${p}"`);return{protocol:m[1],authority:m[2],path:m[3]||"/",params:m[4]?m[4].split("&"):[]}}(t);return c.path+=`${n}${a}`,function(p){const m=p.params.length?`?${p.params.join("&")}`:"";return`${p.protocol}://${p.authority}${p.path}${m}`}(c)}setTransformRequest(t){this._transformRequestFn=t}}const ri=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Rt(o){var t=new h.ARRAY_TYPE(3);return t[0]=o[0],t[1]=o[1],t[2]=o[2],t}var Ai,Mt=function(o,t,n){return o[0]=t[0]-n[0],o[1]=t[1]-n[1],o[2]=t[2]-n[2],o};Ai=new h.ARRAY_TYPE(3),h.ARRAY_TYPE!=Float32Array&&(Ai[0]=0,Ai[1]=0,Ai[2]=0);var Ct=function(o){var t=o[0],n=o[1];return t*t+n*n};function ni(o){const t=[];if(typeof o=="string")t.push({id:"default",url:o});else if(o&&o.length>0){const n=[];for(const{id:a,url:c}of o){const p=`${a}${c}`;n.indexOf(p)===-1&&(n.push(p),t.push({id:a,url:c}))}}return t}function Vt(o,t,n,a,c){if(a)return void o(a);if(c!==Object.values(t).length||c!==Object.values(n).length)return;const p={};for(const m in t){p[m]={};const y=h.exported.getImageCanvasContext(n[m]),_=t[m];for(const x in _){const{width:T,height:w,x:k,y:O,sdf:B,pixelRatio:R,stretchX:q,stretchY:H,content:se}=_[x];p[m][x]={data:null,pixelRatio:R,sdf:B,stretchX:q,stretchY:H,content:se,spriteData:{width:T,height:w,x:k,y:O,context:y}}}}o(null,p)}(function(){var o=new h.ARRAY_TYPE(2);h.ARRAY_TYPE!=Float32Array&&(o[0]=0,o[1]=0)})();class yt{constructor(t,n,a,c){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(n,c)}update(t,n,a){const{width:c,height:p}=t,m=!(this.size&&this.size[0]===c&&this.size[1]===p||a),{context:y}=this,{gl:_}=y;if(this.useMipmap=!!(n&&n.useMipmap),_.bindTexture(_.TEXTURE_2D,this.texture),y.pixelStoreUnpackFlipY.set(!1),y.pixelStoreUnpack.set(1),y.pixelStoreUnpackPremultiplyAlpha.set(this.format===_.RGBA&&(!n||n.premultiply!==!1)),m)this.size=[c,p],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||h.isImageBitmap(t)?_.texImage2D(_.TEXTURE_2D,0,this.format,this.format,_.UNSIGNED_BYTE,t):_.texImage2D(_.TEXTURE_2D,0,this.format,c,p,0,this.format,_.UNSIGNED_BYTE,t.data);else{const{x,y:T}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||h.isImageBitmap(t)?_.texSubImage2D(_.TEXTURE_2D,0,x,T,_.RGBA,_.UNSIGNED_BYTE,t):_.texSubImage2D(_.TEXTURE_2D,0,x,T,c,p,_.RGBA,_.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&_.generateMipmap(_.TEXTURE_2D)}bind(t,n,a){const{context:c}=this,{gl:p}=c;p.bindTexture(p.TEXTURE_2D,this.texture),a!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=p.LINEAR),t!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,t),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,a||t),this.filter=t),n!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,n),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function ga(o){const{userImage:t}=o;return!!(t&&t.render&&t.render())&&(o.data.replace(new Uint8Array(t.data.buffer)),!0)}class Zi extends h.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new h.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,callback:a}of this.requestors)this._notify(n,a);this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const a=n.spriteData;n.data=new h.RGBAImage({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let a=!0;const c=n.data||n.spriteData;return this._validateStretch(n.stretchX,c&&c.width)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,c&&c.height)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),a=!1),a}_validateStretch(t,n){if(!t)return!0;let a=0;for(const c of t){if(c[0]-1);_++,p[_]=y,m[_]=x,m[_+1]=xr}for(let y=0,_=0;y{let y=this.entries[c];y||(y=this.entries[c]={glyphs:{},requests:{},ranges:{}});let _=y.glyphs[p];if(_!==void 0)return void m(null,{stack:c,id:p,glyph:_});if(_=this._tinySDF(y,c,p),_)return y.glyphs[p]=_,void m(null,{stack:c,id:p,glyph:_});const x=Math.floor(p/256);if(256*x>65535)return void m(new Error("glyphs > 65535 not supported"));if(y.ranges[x])return void m(null,{stack:c,id:p,glyph:_});if(!this.url)return void m(new Error("glyphsUrl is not set"));let T=y.requests[x];T||(T=y.requests[x]=[],vr.loadGlyphRange(c,x,this.url,this.requestManager,(w,k)=>{if(k){for(const O in k)this._doesCharSupportLocalGlyph(+O)||(y.glyphs[+O]=k[+O]);y.ranges[x]=!0}for(const O of T)O(w,k);delete y.requests[x]})),T.push((w,k)=>{w?m(w):k&&m(null,{stack:c,id:p,glyph:k[p]||null})})},(c,p)=>{if(c)n(c);else if(p){const m={};for(const{stack:y,id:_,glyph:x}of p)(m[y]||(m[y]={}))[_]=x&&{id:x.id,bitmap:x.bitmap.clone(),metrics:x.metrics};n(null,m)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(h.unicodeBlockLookup["CJK Unified Ideographs"](t)||h.unicodeBlockLookup["Hangul Syllables"](t)||h.unicodeBlockLookup.Hiragana(t)||h.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,a){const c=this.localIdeographFontFamily;if(!c||!this._doesCharSupportLocalGlyph(a))return;let p=t.tinySDF;if(!p){let y="400";/bold/i.test(n)?y="900":/medium/i.test(n)?y="500":/light/i.test(n)&&(y="200"),p=t.tinySDF=new vr.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:c,fontWeight:y})}const m=p.draw(String.fromCharCode(a));return{id:a,bitmap:new h.AlphaImage({width:m.width||30,height:m.height||30},m.data),metrics:{width:m.glyphWidth||24,height:m.glyphHeight||24,left:m.glyphLeft||0,top:m.glyphTop-27||-8,advance:m.glyphAdvance||24}}}}vr.loadGlyphRange=function(o,t,n,a,c){const p=256*t,m=p+255,y=a.transformRequest(n.replace("{fontstack}",o).replace("{range}",`${p}-${m}`),et.Glyphs);h.getArrayBuffer(y,(_,x)=>{if(_)c(_);else if(x){const T={};for(const w of h.parseGlyphPbf(x))T[w.id]=w;c(null,T)}})},vr.TinySDF=class{constructor({fontSize:o=24,buffer:t=3,radius:n=8,cutoff:a=.25,fontFamily:c="sans-serif",fontWeight:p="normal",fontStyle:m="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=n;const y=this.size=o+4*t,_=this._createCanvas(y),x=this.ctx=_.getContext("2d",{willReadFrequently:!0});x.font=`${m} ${p} ${o}px ${c}`,x.textBaseline="alphabetic",x.textAlign="left",x.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(o){const t=document.createElement("canvas");return t.width=t.height=o,t}draw(o){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:c,actualBoundingBoxRight:p}=this.ctx.measureText(o),m=Math.ceil(n),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-c))),_=Math.min(this.size-this.buffer,m+Math.ceil(a)),x=y+2*this.buffer,T=_+2*this.buffer,w=Math.max(x*T,0),k=new Uint8ClampedArray(w),O={data:k,width:x,height:T,glyphWidth:y,glyphHeight:_,glyphTop:m,glyphLeft:0,glyphAdvance:t};if(y===0||_===0)return O;const{ctx:B,buffer:R,gridInner:q,gridOuter:H}=this;B.clearRect(R,R,y,_),B.fillText(o,R,R+m);const se=B.getImageData(R,R,y,_);H.fill(xr,0,w),q.fill(0,0,w);for(let $=0;$<_;$++)for(let re=0;re0?_e*_e:0,q[me]=_e<0?_e*_e:0}}Lr(H,0,0,x,T,x,this.f,this.v,this.z),Lr(q,R,R,y,_,x,this.f,this.v,this.z);for(let $=0;$1&&(_=t[++y]);const T=Math.abs(x-_.left),w=Math.abs(x-_.right),k=Math.min(T,w);let O;const B=p/a*(c+1);if(_.isDash){const R=c-Math.abs(B);O=Math.sqrt(k*k+R*R)}else O=c-Math.sqrt(k*k+B*B);this.data[m+x]=Math.max(0,Math.min(255,O+128))}}}addRegularDash(t){for(let y=t.length-1;y>=0;--y){const _=t[y],x=t[y+1];_.zeroLength?t.splice(y,1):x&&x.isDash===_.isDash&&(x.left=_.left,t.splice(y,1))}const n=t[0],a=t[t.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);const c=this.width*this.nextRow;let p=0,m=t[p];for(let y=0;y1&&(m=t[++p]);const _=Math.abs(y-m.left),x=Math.abs(y-m.right),T=Math.min(_,x);this.data[c+y]=Math.max(0,Math.min(255,(m.isDash?T:-T)+128))}}addDash(t,n){const a=n?7:0,c=2*a+1;if(this.nextRow+c>this.height)return h.warnOnce("LineAtlas out of space"),null;let p=0;for(let y=0;y{c.send(t,n,p)},a=a||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function Gi(o,t,n){const a=function(c,p){if(c)return n(c);if(p){const m=h.pick(h.extend(p,o),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);p.vector_layers&&(m.vectorLayers=p.vector_layers,m.vectorLayerIds=m.vectorLayers.map(y=>y.id)),n(null,m)}};return o.url?h.getJSON(t.transformRequest(o.url,et.Source),a):h.exported.frame(()=>a(null,o))}bi.Actor=h.Actor;class hi{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof h.LngLat?new h.LngLat(t.lng,t.lat):h.LngLat.convert(t),this}setSouthWest(t){return this._sw=t instanceof h.LngLat?new h.LngLat(t.lng,t.lat):h.LngLat.convert(t),this}extend(t){const n=this._sw,a=this._ne;let c,p;if(t instanceof h.LngLat)c=t,p=t;else{if(!(t instanceof hi))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(hi.convert(t)):this.extend(h.LngLat.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(h.LngLat.convert(t)):this;if(c=t._sw,p=t._ne,!c||!p)return this}return n||a?(n.lng=Math.min(c.lng,n.lng),n.lat=Math.min(c.lat,n.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new h.LngLat(c.lng,c.lat),this._ne=new h.LngLat(p.lng,p.lat)),this}getCenter(){return new h.LngLat((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 h.LngLat(this.getWest(),this.getNorth())}getSouthEast(){return new h.LngLat(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(t){const{lng:n,lat:a}=h.LngLat.convert(t);let c=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&c}static convert(t){return t instanceof hi?t:t&&new hi(t)}static fromLngLat(t,n=0){const a=360*n/40075017,c=a/Math.cos(Math.PI/180*t.lat);return new hi(new h.LngLat(t.lng-c,t.lat-a),new h.LngLat(t.lng+c,t.lat+a))}}class yn{constructor(t,n,a){this.bounds=hi.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=a||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),a=Math.floor(h.mercatorXfromLng(this.bounds.getWest())*n),c=Math.floor(h.mercatorYfromLat(this.bounds.getNorth())*n),p=Math.ceil(h.mercatorXfromLng(this.bounds.getEast())*n),m=Math.ceil(h.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=a&&t.x=c&&t.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new yn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(a,et.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function p(m,y){return delete t.request,t.aborted?n(null):m&&m.status!==404?n(m):(y&&y.resourceTiming&&(t.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&t.setExpiryData(y),t.loadVectorData(y,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}c.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",c,p.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",c,p.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Kr extends h.Evented{constructor(t,n,a,c){super(),this.id=t,this.dispatcher=a,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h.extend({type:"raster"},n),h.extend(this,h.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Gi(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new yn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=Bt.getImage(this.map._requestManager.transformRequest(a,et.Tile),(c,p,m)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(c)t.state="errored",n(c);else if(p){this.map._refreshExpiredTiles&&m&&t.setExpiryData(m);const y=this.map.painter.context,_=y.gl;t.texture=this.map.painter.getTileTexture(p.width),t.texture?t.texture.update(p,{useMipmap:!0}):(t.texture=new yt(y,p,_.RGBA,{useMipmap:!0}),t.texture.bind(_.LINEAR,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST),y.extTextureFilterAnisotropic&&_.texParameterf(_.TEXTURE_2D,y.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,y.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}},this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Rr extends Kr{constructor(t,n,a,c){super(t,n,a,c),this.type="raster-dem",this.maxzoom=22,this._options=h.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function c(p,m){p&&(t.state="errored",n(p)),m&&(t.dem=m,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.request=Bt.getImage(this.map._requestManager.transformRequest(a,et.Tile),function(p,m){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(p)t.state="errored",n(p);else if(m){this.map._refreshExpiredTiles&&t.setExpiryData(m),delete m.cacheControl,delete m.expires;const y=h.isImageBitmap(m)&&(_n==null&&(_n=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),_n)?m:h.exported.getImageData(m,1),_={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:y,encoding:this.encoding};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",_,c.bind(this)))}}.bind(this),this.map._refreshExpiredTiles),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}_getNeighboringTiles(t){const n=t.canonical,a=Math.pow(2,n.z),c=(n.x-1+a)%a,p=n.x===0?t.wrap-1:t.wrap,m=(n.x+1+a)%a,y=n.x+1===a?t.wrap+1:t.wrap,_={};return _[new h.OverscaledTileID(t.overscaledZ,p,n.z,c,n.y).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,y,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(_[new h.OverscaledTileID(t.overscaledZ,p,n.z,c,n.y-1).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,y,n.z,m,n.y-1).key]={backfilled:!1}),n.y+1{if(this._pendingLoads--,this._removed||c&&c.abandoned)return void this.fire(new h.Event("dataabort",{dataType:"source"}));let p=null;if(c&&c.resourceTiming&&c.resourceTiming[this.id]&&(p=c.resourceTiming[this.id].slice(0)),a)return void this.fire(new h.ErrorEvent(a));const m={dataType:"source"};this._collectResourceTiming&&p&&p.length>0&&h.extend(m,{resourceTiming:p}),this.fire(new h.Event("data",{...m,sourceDataType:"metadata"})),this.fire(new h.Event("data",{...m,sourceDataType:"content"}))})}loaded(){return this._pendingLoads===0}loadTile(t,n){const a=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const c={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(a,c,(p,m)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):p?n(p):(t.loadVectorData(m,this.map.painter,a==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return h.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var wr=h.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Xi extends h.Evented{constructor(t,n,a,c){super(),this.id=t,this.dispatcher=a,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}load(t,n){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Bt.getImage(this.map._requestManager.transformRequest(this.url,et.Image),(a,c)=>{this._request=null,this._loaded=!0,a?this.fire(new h.ErrorEvent(a)):c&&(this.image=c,t&&(this.coordinates=t),n&&n(),this._finishLoading())})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(h.MercatorCoordinate.fromLngLat);this.tileID=function(c){let p=1/0,m=1/0,y=-1/0,_=-1/0;for(const k of c)p=Math.min(p,k.x),m=Math.min(m,k.y),y=Math.max(y,k.x),_=Math.max(_,k.y);const x=Math.max(y-p,_-m),T=Math.max(0,Math.floor(-Math.log(x)/Math.LN2)),w=Math.pow(2,T);return new h.CanonicalTileID(T,Math.floor((p+y)/2*w),Math.floor((m+_)/2*w))}(n),this.minzoom=this.maxzoom=this.tileID.z;const a=n.map(c=>this.tileID.getTilePoint(c)._round());return this._boundsArray=new h.RasterBoundsArray,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,h.EXTENT,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,h.EXTENT),this._boundsArray.emplaceBack(a[2].x,a[2].y,h.EXTENT,h.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,wr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new yt(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const c in this.tiles){const p=this.tiles[c];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,a=!0)}a&&this.fire(new h.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class vn extends Xi{constructor(t,n,a,c){super(t,n,a,c),this.roundZoom=!0,this.type="video",this.options=n}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,et.Source).url);h.getVideo(this.urls,(n,a)=>{this._loaded=!0,n?this.fire(new h.ErrorEvent(n)):a&&(this.video=a,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,wr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new yt(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const c in this.tiles){const p=this.tiles[c];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,a=!0)}a&&this.fire(new h.Event("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 le extends Xi{constructor(t,n,a,c){super(t,n,a,c),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(m=>typeof m!="number"))||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new h.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,a=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,wr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new yt(n,this.canvas,a.RGBA,{premultiply:!0});let c=!1;for(const p in this.tiles){const m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,c=!0)}c&&this.fire(new h.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Fr={vector:xn,raster:Kr,"raster-dem":Rr,geojson:br,video:vn,image:Xi,canvas:le};function $n(o,t){const n=h.create();return h.translate(n,n,[1,1,0]),h.scale(n,n,[.5*o.width,.5*o.height,1]),h.multiply(n,n,o.calculatePosMatrix(t.toUnwrapped()))}function wt(o,t,n,a,c,p){const m=function(w,k,O){if(w)for(const B of w){const R=k[B];if(R&&R.source===O&&R.type==="fill-extrusion")return!0}else for(const B in k){const R=k[B];if(R.source===O&&R.type==="fill-extrusion")return!0}return!1}(c&&c.layers,t,o.id),y=p.maxPitchScaleFactor(),_=o.tilesIn(a,y,m);_.sort(lt);const x=[];for(const w of _)x.push({wrappedTileID:w.tileID.wrapped().key,queryResults:w.tile.queryRenderedFeatures(t,n,o._state,w.queryGeometry,w.cameraQueryGeometry,w.scale,c,p,y,$n(o.transform,w.tileID))});const T=function(w){const k={},O={};for(const B of w){const R=B.queryResults,q=B.wrappedTileID,H=O[q]=O[q]||{};for(const se in R){const $=R[se],re=H[se]=H[se]||{},oe=k[se]=k[se]||[];for(const me of $)re[me.featureIndex]||(re[me.featureIndex]=!0,oe.push(me))}}return k}(x);for(const w in T)T[w].forEach(k=>{const O=k.feature,B=o.getFeatureState(O.layer["source-layer"],O.id);O.source=O.layer.source,O.layer["source-layer"]&&(O.sourceLayer=O.layer["source-layer"]),O.state=B});return T}function lt(o,t){const n=o.tileID,a=t.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}class Yr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=h.uniqueId(),this.uses=0,this.tileSize=n,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(t){const n=t+this.timeAdded;np.getLayer(x)).filter(Boolean);if(_.length!==0){y.layers=_,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(x=>_.filter(T=>T.id===x)[0]));for(const x of _)m[x.id]=y}}return m}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const p=this.buckets[c];if(p instanceof h.SymbolBucket){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const p=this.buckets[c];if(p instanceof h.SymbolBucket&&p.hasRTLText){this.hasRTLText=!0,h.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const c in this.buckets){const p=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new h.CollisionBoxArray}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const c=this.buckets[a];c.uploadPending()&&c.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new yt(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new yt(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,a,c,p,m,y,_,x,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:p,scale:m,tileSize:this.tileSize,pixelPosMatrix:T,transform:_,params:y,queryPadding:this.queryPadding*x},t,n,a):{}}querySourceFeatures(t,n){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const c=a.loadVTLayers(),p=n&&n.sourceLayer?n.sourceLayer:"",m=c._geojsonTileLayer||c[p];if(!m)return;const y=h.createFilter(n&&n.filter),{z:_,x,y:T}=this.tileID.canonical,w={z:_,x,y:T};for(let k=0;ka)c=!1;else if(n)if(this.expirationTime{this.remove(t,p)},a)),this.data[c].push(p),this.order.push(c),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const a=t.wrapped().key,c=n===void 0?0:this.data[a].indexOf(n),p=this.data[a][c];return this.data[a].splice(c,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const a in this.data)for(const c of this.data[a])t(c.value)||n.push(c);for(const a of n)this.remove(a.value.tileID,a)}}class fs{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,a){const c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},h.extend(this.stateChanges[t][c],a),this.deletedStates[t]===null){this.deletedStates[t]={};for(const p in this.state[t])p!==c&&(this.deletedStates[t][p]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(const p in this.state[t][c])a[p]||(this.deletedStates[t][c][p]=null)}else for(const p in a)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][p]===null&&delete this.deletedStates[t][c][p]}removeFeatureState(t,n,a){if(this.deletedStates[t]===null)return;const c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},a&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][a]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(a in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][a]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){const a=String(n),c=h.extend({},(this.state[t]||{})[a],(this.stateChanges[t]||{})[a]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const p=this.deletedStates[t][n];if(p===null)return{};for(const m in p)delete c[m]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const a={};for(const c in this.stateChanges){this.state[c]=this.state[c]||{};const p={};for(const m in this.stateChanges[c])this.state[c][m]||(this.state[c][m]={}),h.extend(this.state[c][m],this.stateChanges[c][m]),p[m]=this.state[c][m];a[c]=p}for(const c in this.deletedStates){this.state[c]=this.state[c]||{};const p={};if(this.deletedStates[c]===null)for(const m in this.state[c])p[m]={},this.state[c][m]={};else for(const m in this.deletedStates[c]){if(this.deletedStates[c][m]===null)this.state[c][m]={};else for(const y of Object.keys(this.deletedStates[c][m]))delete this.state[c][m][y];p[m]=this.state[c][m]}a[c]=a[c]||{},h.extend(a[c],p)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const c in t)t[c].setFeatureState(a,n)}}class Gt extends h.Evented{constructor(t,n,a){super(),this.id=t,this.dispatcher=a,this.on("data",c=>{c.dataType==="source"&&c.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&c.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(c,p,m,y){const _=new Fr[p.type](c,p,m,y);if(_.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${_.id}`);return h.bindAll(["load","abort","unload","serialize","prepare"],_),_}(t,n,a,this),this._tiles={},this._cache=new qn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new fs,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new h.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const a=this._tiles[n];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Jr).map(t=>t.key)}getRenderableIds(t){const n=[];for(const a in this._tiles)this._isIdRenderable(a,t)&&n.push(this._tiles[a]);return t?n.sort((a,c)=>{const p=a.tileID,m=c.tileID,y=new h.Point(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),_=new h.Point(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-m.overscaledZ||_.y-y.y||_.x-y.x}).map(a=>a.tileID.key):n.map(a=>a.tileID).sort(Jr).map(a=>a.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=n),this._loadTile(a,this._tileLoaded.bind(this,a,t,n)))}_tileLoaded(t,n,a,c){if(c)return t.state="errored",void(c.status!==404?this._source.fire(new h.ErrorEvent(c,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=h.exported.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new h.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let c=0;c1||(Math.abs(m)>1&&(Math.abs(m+_)===1?m+=_:Math.abs(m-_)===1&&(m-=_)),p.dem&&c.dem&&(c.dem.backfillBorder(p.dem,m,y),c.neighboringTiles&&c.neighboringTiles[x]&&(c.neighboringTiles[x].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,a,c){for(const p in this._tiles){let m=this._tiles[p];if(c[p]||!m.hasData()||m.tileID.overscaledZ<=n||m.tileID.overscaledZ>a)continue;let y=m.tileID;for(;m&&m.tileID.overscaledZ>n+1;){const x=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[x.key],m&&m.hasData()&&(y=x)}let _=y;for(;_.overscaledZ>n;)if(_=_.scaledTo(_.overscaledZ-1),t[_.key]){c[y.key]=y;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=n?a:null}for(let a=t.overscaledZ-1;a>=n;a--){const c=t.scaledTo(a),p=this._getLoadedTile(c);if(p)return p}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,a=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*a*(this._maxTileCacheZoomLevels===null?h.config.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._cache.setMaxSize(p)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const a={};for(const c in this._tiles){const p=this._tiles[c];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+n),a[p.tileID.key]=p}this._tiles=a;for(const c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(const c in this._tiles)this._setTileReloadTimer(c,this._tiles[c])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(T=>new h.OverscaledTileID(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y)):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(a=a.filter(T=>this._source.hasTile(T)))):a=[];const c=t.coveringZoomLevel(this._source),p=Math.max(c-Gt.maxOverzooming,this._source.minzoom),m=Math.max(c+Gt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const T={};for(const w of a)if(w.canonical.z>this._source.minzoom){const k=w.scaledTo(w.canonical.z-1);T[k.key]=k;const O=w.scaledTo(Math.max(this._source.minzoom,Math.min(w.canonical.z,5)));T[O.key]=O}a=a.concat(Object.values(T))}const y=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,y&&this.fire(new h.Event("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const _=this._updateRetainedTiles(a,c);if(bn(this._source.type)){const T={},w={},k=Object.keys(_),O=h.exported.now();for(const B of k){const R=_[B],q=this._tiles[B];if(!q||q.fadeEndTime!==0&&q.fadeEndTime<=O)continue;const H=this.findLoadedParent(R,p);H&&(this._addTile(H.tileID),T[H.tileID.key]=H.tileID),w[B]=R}this._retainLoadedChildren(w,c,m,_);for(const B in T)_[B]||(this._coveredTiles[B]=!0,_[B]=T[B]);if(n){const B={},R={};for(const q of a)this._tiles[q.key].hasData()?B[q.key]=q:R[q.key]=q;for(const q in R){const H=R[q].children(this._source.maxzoom);this._tiles[H[0].key]&&this._tiles[H[1].key]&&this._tiles[H[2].key]&&this._tiles[H[3].key]&&(B[H[0].key]=_[H[0].key]=H[0],B[H[1].key]=_[H[1].key]=H[1],B[H[2].key]=_[H[2].key]=H[2],B[H[3].key]=_[H[3].key]=H[3],delete R[q])}for(const q in R){const H=this.findLoadedParent(R[q],this._source.minzoom);if(H){B[H.tileID.key]=_[H.tileID.key]=H.tileID;for(const se in B)B[se].isChildOf(H.tileID)&&delete B[se]}}for(const q in this._tiles)B[q]||(this._coveredTiles[q]=!0)}}for(const T in _)this._tiles[T].clearFadeHold();const x=h.keysDifference(this._tiles,_);for(const T of x){const w=this._tiles[T];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const a={},c={},p=Math.max(n-Gt.maxOverzooming,this._source.minzoom),m=Math.max(n+Gt.maxUnderzooming,this._source.minzoom),y={};for(const _ of t){const x=this._addTile(_);a[_.key]=_,x.hasData()||nthis._source.maxzoom){const w=_.children(this._source.maxzoom)[0],k=this.getTile(w);if(k&&k.hasData()){a[w.key]=w;continue}}else{const w=_.children(this._source.maxzoom);if(a[w[0].key]&&a[w[1].key]&&a[w[2].key]&&a[w[3].key])continue}let T=x.wasRequested();for(let w=_.overscaledZ-1;w>=p;--w){const k=_.scaledTo(w);if(c[k.key])break;if(c[k.key]=!0,x=this.getTile(k),!x&&T&&(x=this._addTile(k)),x){const O=x.hasData();if((T||O)&&(a[k.key]=k),T=x.wasRequested(),O)break}}}return a}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let a,c=this._tiles[t].tileID;for(;c.overscaledZ>0;){if(c.key in this._loadedParentTiles){a=this._loadedParentTiles[c.key];break}n.push(c.key);const p=c.scaledTo(c.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;c=p}for(const p of n)this._loadedParentTiles[p]=a}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const a=n;return n||(n=new Yr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,a||this._source.fire(new h.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=n.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,a){const c=[],p=this.transform;if(!p)return c;const m=a?p.getCameraQueryGeometry(t):t,y=t.map(B=>p.pointCoordinate(B,this.terrain)),_=m.map(B=>p.pointCoordinate(B,this.terrain)),x=this.getIds();let T=1/0,w=1/0,k=-1/0,O=-1/0;for(const B of _)T=Math.min(T,B.x),w=Math.min(w,B.y),k=Math.max(k,B.x),O=Math.max(O,B.y);for(let B=0;B=0&&$[1].y+se>=0){const re=y.map(me=>q.getTilePoint(me)),oe=_.map(me=>q.getTilePoint(me));c.push({tile:R,tileID:q,queryGeometry:re,cameraQueryGeometry:oe,scale:H})}}return c}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of n)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(bn(this._source.type)){const t=h.exported.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,a){this._state.updateState(t=t||"_geojsonTileLayer",n,a)}removeFeatureState(t,n,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,a)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,a){const c=this._tiles[t];c&&c.setDependencies(n,a)}reloadTilesForDependencies(t,n){for(const a in this._tiles)this._tiles[a].hasDependency(t,n)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(t,n))}}function Jr(o,t){const n=Math.abs(2*o.wrap)-+(o.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return o.overscaledZ-t.overscaledZ||a-n||t.canonical.y-o.canonical.y||t.canonical.x-o.canonical.x}function bn(o){return o==="raster"||o==="image"||o==="video"}Gt.maxOverzooming=10,Gt.maxUnderzooming=3;const Qr="mapboxgl_preloaded_worker_pool";class we{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Qr]}numActive(){return Object.keys(this.active).length}}const lr=Math.floor(h.exported.hardwareConcurrency/2);let fi;function wn(){return fi||(fi=new we),fi}we.workerCount=h.isSafari(globalThis)?Math.max(Math.min(lr,3),1):1;class Or{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let a=1;a0?(c-m)/y:0;return this.points[p].mult(1-_).add(this.points[n].mult(_))}}function be(o,t){let n=!0;return o==="always"||o!=="never"&&t!=="never"||(n=!1),n}class Qe{constructor(t,n,a){const c=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(t/a),this.yCellCount=Math.ceil(n/a);for(let m=0;mthis.width||c<0||n>this.height)return[];const _=[];if(t<=0&&n<=0&&this.width<=a&&this.height<=c){if(p)return[{key:null,x1:t,y1:n,x2:a,y2:c}];for(let x=0;x0}hitTestCircle(t,n,a,c,p){const m=t-a,y=t+a,_=n-a,x=n+a;if(y<0||m>this.width||x<0||_>this.height)return!1;const T=[];return this._forEachCell(m,_,y,x,this._queryCellCircle,T,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:a},seenUids:{box:{},circle:{}}},p),T.length>0}_queryCell(t,n,a,c,p,m,y,_){const{seenUids:x,hitTest:T,overlapMode:w}=y,k=this.boxCells[p];if(k!==null){const B=this.bboxes;for(const R of k)if(!x.box[R]){x.box[R]=!0;const q=4*R,H=this.boxKeys[R];if(t<=B[q+2]&&n<=B[q+3]&&a>=B[q+0]&&c>=B[q+1]&&(!_||_(H))&&(!T||!be(w,H.overlapMode))&&(m.push({key:H,x1:B[q],y1:B[q+1],x2:B[q+2],y2:B[q+3]}),T))return!0}}const O=this.circleCells[p];if(O!==null){const B=this.circles;for(const R of O)if(!x.circle[R]){x.circle[R]=!0;const q=3*R,H=this.circleKeys[R];if(this._circleAndRectCollide(B[q],B[q+1],B[q+2],t,n,a,c)&&(!_||_(H))&&(!T||!be(w,H.overlapMode))){const se=B[q],$=B[q+1],re=B[q+2];if(m.push({key:H,x1:se-re,y1:$-re,x2:se+re,y2:$+re}),T)return!0}}}return!1}_queryCellCircle(t,n,a,c,p,m,y,_){const{circle:x,seenUids:T,overlapMode:w}=y,k=this.boxCells[p];if(k!==null){const B=this.bboxes;for(const R of k)if(!T.box[R]){T.box[R]=!0;const q=4*R,H=this.boxKeys[R];if(this._circleAndRectCollide(x.x,x.y,x.radius,B[q+0],B[q+1],B[q+2],B[q+3])&&(!_||_(H))&&!be(w,H.overlapMode))return m.push(!0),!0}}const O=this.circleCells[p];if(O!==null){const B=this.circles;for(const R of O)if(!T.circle[R]){T.circle[R]=!0;const q=3*R,H=this.circleKeys[R];if(this._circlesCollide(B[q],B[q+1],B[q+2],x.x,x.y,x.radius)&&(!_||_(H))&&!be(w,H.overlapMode))return m.push(!0),!0}}}_forEachCell(t,n,a,c,p,m,y,_){const x=this._convertToXCellCoord(t),T=this._convertToYCellCoord(n),w=this._convertToXCellCoord(a),k=this._convertToYCellCoord(c);for(let O=x;O<=w;O++)for(let B=T;B<=k;B++)if(p.call(this,t,n,a,c,this.xCellCount*B+O,m,y,_))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,a,c,p,m){const y=c-t,_=p-n,x=a+m;return x*x>y*y+_*_}_circleAndRectCollide(t,n,a,c,p,m,y){const _=(m-c)/2,x=Math.abs(t-(c+_));if(x>_+a)return!1;const T=(y-p)/2,w=Math.abs(n-(p+T));if(w>T+a)return!1;if(x<=_||w<=T)return!0;const k=x-_,O=w-T;return k*k+O*O<=a*a}}function Ye(o,t,n,a,c){const p=h.create();return t?(h.scale(p,p,[1/c,1/c,1]),n||h.rotateZ(p,p,a.angle)):h.multiply(p,a.labelPlaneMatrix,o),p}function Pi(o,t,n,a,c){if(t){const p=h.clone(o);return h.scale(p,p,[c,c,1]),n||h.rotateZ(p,p,-a.angle),p}return a.glCoordMatrix}function Qt(o,t,n){let a;n?(a=[o.x,o.y,n(o.x,o.y),1],h.transformMat4(a,a,t)):(a=[o.x,o.y,0,1],j(a,a,t));const c=a[3];return{point:new h.Point(a[0]/c,a[1]/c),signedDistanceFromCamera:c}}function He(o,t){return .5+o/t*.5}function Tr(o,t){const n=o[0]/o[3],a=o[1]/o[3];return n>=-t[0]&&n<=t[0]&&a>=-t[1]&&a<=t[1]}function Er(o,t,n,a,c,p,m,y,_,x){const T=a?o.textSizeData:o.iconSizeData,w=h.evaluateSizeForZoom(T,n.transform.zoom),k=[256/n.width*2+1,256/n.height*2+1],O=a?o.text.dynamicLayoutVertexArray:o.icon.dynamicLayoutVertexArray;O.clear();const B=o.lineVertexArray,R=a?o.text.placedSymbolArray:o.icon.placedSymbolArray,q=n.transform.width/n.transform.height;let H=!1;for(let se=0;seMath.abs(n.x-t.x)*a?{useVertical:!0}:(o===h.WritingMode.vertical?t.yn.x)?{needsFlipping:!0}:null}function ui(o,t,n,a,c,p,m,y,_,x,T,w,k,O,B,R){const q=t/24,H=o.lineOffsetX*q,se=o.lineOffsetY*q;let $;if(o.numGlyphs>1){const re=o.glyphStartIndex+o.numGlyphs,oe=o.lineStartIndex,me=o.lineStartIndex+o.lineLength,_e=er(q,y,H,se,n,T,w,o,_,p,k,B,R);if(!_e)return{notEnoughRoom:!0};const ve=Qt(_e.first.point,m,R).point,ge=Qt(_e.last.point,m,R).point;if(a&&!n){const Ce=Sr(o.writingMode,ve,ge,O);if(Ce)return Ce}$=[_e.first];for(let Ce=o.glyphStartIndex+1;Ce0?ve.point:St(w,_e,oe,1,c,R),Ce=Sr(o.writingMode,oe,ge,O);if(Ce)return Ce}const re=I(q*y.getoffsetX(o.glyphStartIndex),H,se,n,T,w,o.segment,o.lineStartIndex,o.lineStartIndex+o.lineLength,_,p,k,B,R);if(!re)return{notEnoughRoom:!0};$=[re]}for(const re of $)h.addDynamicAttributes(x,re.point,re.angle);return{}}function St(o,t,n,a,c,p){const m=Qt(o.add(o.sub(t)._unit()),c,p).point,y=n.sub(m);return n.add(y._mult(a/y.mag()))}function jn(o,t){const{projectionCache:n,lineVertexArray:a,labelPlaneMatrix:c,tileAnchorPoint:p,distanceFromAnchor:m,getElevation:y,previousVertex:_,direction:x,absOffsetX:T}=t;if(n.projections[o])return n.projections[o];const w=new h.Point(a.getx(o),a.gety(o)),k=Qt(w,c,y);if(k.signedDistanceFromCamera>0)return n.projections[o]=k.point,k.point;const O=o-x;return St(m===0?p:new h.Point(a.getx(O),a.gety(O)),w,_,T-m+1,c,y)}function cr(o,t,n){return o._unit()._perp()._mult(t*n)}function V(o,t,n,a,c,p,m,y){const{projectionCache:_,direction:x}=y;if(_.offsets[o])return _.offsets[o];const T=n.add(t);if(o+x=c)return _.offsets[o]=T,T;const w=jn(o+x,y),k=cr(w.sub(n),m,x),O=n.add(k),B=w.add(k);return _.offsets[o]=h.findLineIntersection(p,T,O,B)||T,_.offsets[o]}function I(o,t,n,a,c,p,m,y,_,x,T,w,k,O){const B=a?o-t:o+t;let R=B>0?1:-1,q=0;a&&(R*=-1,q=Math.PI),R<0&&(q+=Math.PI);let H,se,$=R>0?y+m:y+m+1,re=c,oe=c,me=0,_e=0;const ve=Math.abs(B),ge=[];let Ce;for(;me+_e<=ve;){if($+=R,$=_)return null;me+=_e,oe=re,se=H;const Ee={projectionCache:w,lineVertexArray:x,labelPlaneMatrix:T,tileAnchorPoint:p,distanceFromAnchor:me,getElevation:O,previousVertex:oe,direction:R,absOffsetX:ve};if(re=jn($,Ee),n===0)ge.push(oe),Ce=re.sub(oe);else{let je;const ke=re.sub(oe);je=ke.mag()===0?cr(jn($+R,Ee).sub(re),n,R):cr(ke,n,R),se||(se=oe.add(je)),H=V($,je,re,y,_,se,n,Ee),ge.push(se),Ce=H.sub(se)}_e=Ce.mag()}const Ue=Ce._mult((ve-me)/_e)._add(se||oe),Ke=q+Math.atan2(re.y-oe.y,re.x-oe.x);return ge.push(Ue),{point:Ue,angle:k?Ke:0,path:ge}}const M=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function L(o,t){for(let n=0;n=1;dt--)ke.push(Ee.path[dt]);for(let dt=1;dtQt(Je,_,B));ke=dt.some(Je=>Je.signedDistanceFromCamera<=0)?[]:dt.map(Je=>Je.point)}let qt=[];if(ke.length>0){const dt=ke[0].clone(),Je=ke[0].clone();for(let Ot=1;Ot=Ce.x&&Je.x<=Ue.x&&dt.y>=Ce.y&&Je.y<=Ue.y?[ke]:Je.xUe.x||Je.yUe.y?[]:h.clipLine([ke],Ce.x,Ce.y,Ue.x,Ue.y)}for(const dt of qt){Ke.reset(dt,.25*ge);let Je=0;Je=Ke.length<=.5*ge?1:Math.ceil(Ke.paddedLength/ut)+1;for(let Ot=0;Ot=this.screenRightBoundary||cthis.screenBottomBoundary}isInsideGrid(t,n,a,c){return a>=0&&t=0&&na.collisionGroupID===n}}return this.collisionGroups[t]}}function Xe(o,t,n,a,c){const{horizontalAlign:p,verticalAlign:m}=h.getAnchorAlignment(o),y=-(p-.5)*t,_=-(m-.5)*n,x=h.evaluateVariableOffset(o,a);return new h.Point(y+x[0]*c,_+x[1]*c)}function Le(o,t,n,a,c,p){const{x1:m,x2:y,y1:_,y2:x,anchorPointX:T,anchorPointY:w}=o,k=new h.Point(t,n);return a&&k._rotate(c?p:-p),{x1:m+k.x,y1:_+k.y,x2:y+k.x,y2:x+k.y,anchorPointX:T,anchorPointY:w}}class Oe{constructor(t,n,a,c,p){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new J(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=a,this.retainedQueryData={},this.collisionGroups=new $e(c),this.collisionCircleArrays={},this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,a,c){const p=a.getBucket(n),m=a.latestFeatureIndex;if(!p||!m||n.id!==p.layerIds[0])return;const y=a.collisionBoxArray,_=p.layers[0].layout,x=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),T=a.tileSize/h.EXTENT,w=this.transform.calculatePosMatrix(a.tileID.toUnwrapped()),k=_.get("text-pitch-alignment")==="map",O=_.get("text-rotation-alignment")==="map",B=W(a,1,this.transform.zoom),R=Ye(w,k,O,this.transform,B);let q=null;if(k){const se=Pi(w,k,O,this.transform,B);q=h.multiply([],this.transform.labelPlaneMatrix,se)}this.retainedQueryData[p.bucketInstanceId]=new pe(p.bucketInstanceId,m,p.sourceLayerIndex,p.index,a.tileID);const H={bucket:p,layout:_,posMatrix:w,textLabelPlaneMatrix:R,labelToScreenMatrix:q,scale:x,textPixelRatio:T,holdingForFade:a.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:h.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(c)for(const se of p.sortKeyRanges){const{sortKey:$,symbolInstanceStart:re,symbolInstanceEnd:oe}=se;t.push({sortKey:$,symbolInstanceStart:re,symbolInstanceEnd:oe,parameters:H})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:H})}attemptAnchorPlacement(t,n,a,c,p,m,y,_,x,T,w,k,O,B,R,q){const H=[k.textOffset0,k.textOffset1],se=Xe(t,a,c,H,p),$=this.collisionIndex.placeCollisionBox(Le(n,se.x,se.y,m,y,this.transform.angle),w,_,x,T.predicate,q);if((!R||this.collisionIndex.placeCollisionBox(Le(R,se.x,se.y,m,y,this.transform.angle),w,_,x,T.predicate,q).box.length!==0)&&$.box.length>0){let re;if(this.prevPlacement&&this.prevPlacement.variableOffsets[k.crossTileID]&&this.prevPlacement.placements[k.crossTileID]&&this.prevPlacement.placements[k.crossTileID].text&&(re=this.prevPlacement.variableOffsets[k.crossTileID].anchor),k.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[k.crossTileID]={textOffset:H,width:a,height:c,anchor:t,textBoxScale:p,prevAnchor:re},this.markUsedJustification(O,t,k,B),O.allowVerticalPlacement&&(this.markUsedOrientation(O,B,k),this.placedOrientations[k.crossTileID]=B),{shift:se,placedGlyphBoxes:$}}}placeLayerBucketPart(t,n,a){const{bucket:c,layout:p,posMatrix:m,textLabelPlaneMatrix:y,labelToScreenMatrix:_,textPixelRatio:x,holdingForFade:T,collisionBoxArray:w,partiallyEvaluatedTextSize:k,collisionGroup:O}=t.parameters,B=p.get("text-optional"),R=p.get("icon-optional"),q=h.getOverlapMode(p,"text-overlap","text-allow-overlap"),H=q==="always",se=h.getOverlapMode(p,"icon-overlap","icon-allow-overlap"),$=se==="always",re=p.get("text-rotation-alignment")==="map",oe=p.get("text-pitch-alignment")==="map",me=p.get("icon-text-fit")!=="none",_e=p.get("symbol-z-order")==="viewport-y",ve=H&&($||!c.hasIconData()||R),ge=$&&(H||!c.hasTextData()||B);!c.collisionArrays&&w&&c.deserializeCollisionBoxes(w);const Ce=this.retainedQueryData[c.bucketInstanceId].tileID,Ue=this.terrain?(Ee,je)=>this.terrain.getElevation(Ce,Ee,je):null,Ke=(Ee,je)=>{if(n[Ee.crossTileID])return;if(T)return void(this.placements[Ee.crossTileID]=new ue(!1,!1,!1));let ke=!1,ut=!1,qt=!0,dt=null,Je={box:null,offscreen:null},Ot={box:null,offscreen:null},wi=null,jt=null,si=null,Fi=0,ir=0,rr=0;je.textFeatureIndex?Fi=je.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(Fi=Ee.featureIndex),je.verticalTextFeatureIndex&&(ir=je.verticalTextFeatureIndex);const Ti=je.textBox;if(Ti){const mi=ft=>{let ei=h.WritingMode.horizontal;if(c.allowVerticalPlacement&&!ft&&this.prevPlacement){const oi=this.prevPlacement.placedOrientations[Ee.crossTileID];oi&&(this.placedOrientations[Ee.crossTileID]=oi,ei=oi,this.markUsedOrientation(c,ei,Ee))}return ei},ai=(ft,ei)=>{if(c.allowVerticalPlacement&&Ee.numVerticalGlyphVertices>0&&je.verticalTextBox){for(const oi of c.writingModes)if(oi===h.WritingMode.vertical?(Je=ei(),Ot=Je):Je=ft(),Je&&Je.box&&Je.box.length)break}else Je=ft()};if(p.get("text-variable-anchor")){let ft=p.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Ee.crossTileID]){const gt=this.prevPlacement.variableOffsets[Ee.crossTileID];ft.indexOf(gt.anchor)>0&&(ft=ft.filter(ti=>ti!==gt.anchor),ft.unshift(gt.anchor))}const ei=(gt,ti,Oi)=>{const Qs=gt.x2-gt.x1,Mr=gt.y2-gt.y1,ac=Ee.textBoxScale,cl=me&&se==="never"?ti:null;let At={box:[],offscreen:!1};const Qa=q!=="never"?2*ft.length:ft.length;for(let cs=0;cs=ft.length?q:"never",Ee,c,Oi,cl,Ue);if(Cr&&(At=Cr.placedGlyphBoxes,At&&At.box&&At.box.length)){ke=!0,dt=Cr.shift;break}}return At};ai(()=>ei(Ti,je.iconBox,h.WritingMode.horizontal),()=>{const gt=je.verticalTextBox;return c.allowVerticalPlacement&&!(Je&&Je.box&&Je.box.length)&&Ee.numVerticalGlyphVertices>0&>?ei(gt,je.verticalIconBox,h.WritingMode.vertical):{box:null,offscreen:null}}),Je&&(ke=Je.box,qt=Je.offscreen);const oi=mi(Je&&Je.box);if(!ke&&this.prevPlacement){const gt=this.prevPlacement.variableOffsets[Ee.crossTileID];gt&&(this.variableOffsets[Ee.crossTileID]=gt,this.markUsedJustification(c,gt.anchor,Ee,oi))}}else{const ft=(ei,oi)=>{const gt=this.collisionIndex.placeCollisionBox(ei,q,x,m,O.predicate,Ue);return gt&>.box&>.box.length&&(this.markUsedOrientation(c,oi,Ee),this.placedOrientations[Ee.crossTileID]=oi),gt};ai(()=>ft(Ti,h.WritingMode.horizontal),()=>{const ei=je.verticalTextBox;return c.allowVerticalPlacement&&Ee.numVerticalGlyphVertices>0&&ei?ft(ei,h.WritingMode.vertical):{box:null,offscreen:null}}),mi(Je&&Je.box&&Je.box.length)}}if(wi=Je,ke=wi&&wi.box&&wi.box.length>0,qt=wi&&wi.offscreen,Ee.useRuntimeCollisionCircles){const mi=c.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex),ai=h.evaluateSizeForFeature(c.textSizeData,k,mi),ft=p.get("text-padding");jt=this.collisionIndex.placeCollisionCircles(q,mi,c.lineVertexArray,c.glyphOffsetArray,ai,m,y,_,a,oe,O.predicate,Ee.collisionCircleDiameter,ft,Ue),jt.circles.length&&jt.collisionDetected&&!a&&h.warnOnce("Collisions detected, but collision boxes are not shown"),ke=H||jt.circles.length>0&&!jt.collisionDetected,qt=qt&&jt.offscreen}if(je.iconFeatureIndex&&(rr=je.iconFeatureIndex),je.iconBox){const mi=ai=>{const ft=me&&dt?Le(ai,dt.x,dt.y,re,oe,this.transform.angle):ai;return this.collisionIndex.placeCollisionBox(ft,se,x,m,O.predicate,Ue)};Ot&&Ot.box&&Ot.box.length&&je.verticalIconBox?(si=mi(je.verticalIconBox),ut=si.box.length>0):(si=mi(je.iconBox),ut=si.box.length>0),qt=qt&&si.offscreen}const gr=B||Ee.numHorizontalGlyphVertices===0&&Ee.numVerticalGlyphVertices===0,ls=R||Ee.numIconVertices===0;if(gr||ls?ls?gr||(ut=ut&&ke):ke=ut&&ke:ut=ke=ut&&ke,ke&&wi&&wi.box&&this.collisionIndex.insertCollisionBox(wi.box,q,p.get("text-ignore-placement"),c.bucketInstanceId,Ot&&Ot.box&&ir?ir:Fi,O.ID),ut&&si&&this.collisionIndex.insertCollisionBox(si.box,se,p.get("icon-ignore-placement"),c.bucketInstanceId,rr,O.ID),jt&&(ke&&this.collisionIndex.insertCollisionCircles(jt.circles,q,p.get("text-ignore-placement"),c.bucketInstanceId,Fi,O.ID),a)){const mi=c.bucketInstanceId;let ai=this.collisionCircleArrays[mi];ai===void 0&&(ai=this.collisionCircleArrays[mi]=new fe);for(let ft=0;ft=0;--je){const ke=Ee[je];Ke(c.symbolInstances.get(ke),c.collisionArrays[ke])}}else for(let Ee=t.symbolInstanceStart;Ee=0&&(t.text.placedSymbolArray.get(y).crossTileID=p>=0&&y!==p?0:a.crossTileID)}markUsedOrientation(t,n,a){const c=n===h.WritingMode.horizontal||n===h.WritingMode.horizontalOnly?n:0,p=n===h.WritingMode.vertical?n:0,m=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const y of m)t.text.placedSymbolArray.get(y).placedOrientation=c;a.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=p)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let a=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const c=n?n.symbolFadeChange(t):1,p=n?n.opacities:{},m=n?n.variableOffsets:{},y=n?n.placedOrientations:{};for(const _ in this.placements){const x=this.placements[_],T=p[_];T?(this.opacities[_]=new ee(T,c,x.text,x.icon),a=a||x.text!==T.text.placed||x.icon!==T.icon.placed):(this.opacities[_]=new ee(null,c,x.text,x.icon,x.skipFade),a=a||x.text||x.icon)}for(const _ in p){const x=p[_];if(!this.opacities[_]){const T=new ee(x,c,!1,!1);T.isHidden()||(this.opacities[_]=T,a=a||x.text.placed||x.icon.placed)}}for(const _ in m)this.variableOffsets[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.variableOffsets[_]=m[_]);for(const _ in y)this.placedOrientations[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.placedOrientations[_]=y[_]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const a={};for(const c of n){const p=c.getBucket(t);p&&c.latestFeatureIndex&&t.id===p.layerIds[0]&&this.updateBucketOpacities(p,a,c.collisionBoxArray)}}updateBucketOpacities(t,n,a){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,p=new ee(null,0,!1,!1,!0),m=c.get("text-allow-overlap"),y=c.get("icon-allow-overlap"),_=c.get("text-variable-anchor"),x=c.get("text-rotation-alignment")==="map",T=c.get("text-pitch-alignment")==="map",w=c.get("icon-text-fit")!=="none",k=new ee(null,0,m&&(y||!t.hasIconData()||c.get("icon-optional")),y&&(m||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&a&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(a);const O=(B,R,q)=>{for(let H=0;H0,oe=this.placedOrientations[R.crossTileID],me=oe===h.WritingMode.vertical,_e=oe===h.WritingMode.horizontal||oe===h.WritingMode.horizontalOnly;if(q>0||H>0){const ve=Ur($.text);O(t.text,q,me?di:ve),O(t.text,H,_e?di:ve);const ge=$.text.isHidden();[R.rightJustifiedTextSymbolIndex,R.centerJustifiedTextSymbolIndex,R.leftJustifiedTextSymbolIndex].forEach(Ke=>{Ke>=0&&(t.text.placedSymbolArray.get(Ke).hidden=ge||me?1:0)}),R.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(R.verticalPlacedTextSymbolIndex).hidden=ge||_e?1:0);const Ce=this.variableOffsets[R.crossTileID];Ce&&this.markUsedJustification(t,Ce.anchor,R,oe);const Ue=this.placedOrientations[R.crossTileID];Ue&&(this.markUsedJustification(t,"left",R,Ue),this.markUsedOrientation(t,Ue,R))}if(re){const ve=Ur($.icon),ge=!(w&&R.verticalPlacedIconSymbolIndex&&me);R.placedIconSymbolIndex>=0&&(O(t.icon,R.numIconVertices,ge?ve:di),t.icon.placedSymbolArray.get(R.placedIconSymbolIndex).hidden=$.icon.isHidden()),R.verticalPlacedIconSymbolIndex>=0&&(O(t.icon,R.numVerticalIconVertices,ge?di:ve),t.icon.placedSymbolArray.get(R.verticalPlacedIconSymbolIndex).hidden=$.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ve=t.collisionArrays[B];if(ve){let ge=new h.Point(0,0);if(ve.textBox||ve.verticalTextBox){let Ue=!0;if(_){const Ke=this.variableOffsets[se];Ke?(ge=Xe(Ke.anchor,Ke.width,Ke.height,Ke.textOffset,Ke.textBoxScale),x&&ge._rotate(T?this.transform.angle:-this.transform.angle)):Ue=!1}ve.textBox&&Ge(t.textCollisionBox.collisionVertexArray,$.text.placed,!Ue||me,ge.x,ge.y),ve.verticalTextBox&&Ge(t.textCollisionBox.collisionVertexArray,$.text.placed,!Ue||_e,ge.x,ge.y)}const Ce=!!(!_e&&ve.verticalIconBox);ve.iconBox&&Ge(t.iconCollisionBox.collisionVertexArray,$.icon.placed,Ce,w?ge.x:0,w?ge.y:0),ve.verticalIconBox&&Ge(t.iconCollisionBox.collisionVertexArray,$.icon.placed,!Ce,w?ge.x:0,w?ge.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const B=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=B.invProjMatrix,t.placementViewportMatrix=B.viewportMatrix,t.collisionCircleArray=B.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function Ge(o,t,n,a,c){o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0)}const at=Math.pow(2,25),tt=Math.pow(2,24),ct=Math.pow(2,17),Tt=Math.pow(2,16),Xt=Math.pow(2,9),Ze=Math.pow(2,8),Lt=Math.pow(2,1);function Ur(o){if(o.opacity===0&&!o.placed)return 0;if(o.opacity===1&&o.placed)return 4294967295;const t=o.placed?1:0,n=Math.floor(127*o.opacity);return n*at+t*tt+n*ct+t*Tt+n*Xt+t*Ze+n*Lt+t}const di=0;class Li{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,a,c,p){const m=this._bucketParts;for(;this._currentTileIndexy.sortKey-_.sortKey));this._currentPartIndex!this._forceFullPlacement&&h.exported.now()-c>2;for(;this._currentPlacementIndex>=0;){const m=n[t[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=y)&&(!m.maxzoom||m.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Li(m)),this._inProgressLayer.continuePlacement(a[m.source],this.placement,this._showCollisionBoxes,m,p))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Tn=512/h.EXTENT/2;class ms{constructor(t,n,a){this.tileID=t,this.bucketInstanceId=a,this._symbolsByKey={};const c=new Map;for(let p=0;p({x:Math.floor(_.anchorX*Tn),y:Math.floor(_.anchorY*Tn)})),crossTileIDs:m.map(_=>_.crossTileID)};if(y.positions.length>128){const _=new h.KDBush(y.positions.length,16,Uint16Array);for(const{x,y:T}of y.positions)_.add(x,T);_.finish(),delete y.positions,y.index=_}this._symbolsByKey[p]=y}}getScaledCoordinates(t,n){const{x:a,y:c,z:p}=this.tileID.canonical,{x:m,y,z:_}=n.canonical,x=Tn/Math.pow(2,_-p),T=(y*h.EXTENT+t.anchorY)*x,w=c*h.EXTENT*Tn;return{x:Math.floor((m*h.EXTENT+t.anchorX)*x-a*h.EXTENT*Tn),y:Math.floor(T-w)}}findMatches(t,n,a){const c=this.tileID.canonical.zt)}}class Wt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Zn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const a in this.indexes){const c=this.indexes[a],p={};for(const m in c){const y=c[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+n),p[y.tileID.key]=y}this.indexes[a]=p}this.lng=t}addBucket(t,n,a){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let p=0;pt.overscaledZ)for(const y in m){const _=m[y];_.tileID.isChildOf(t)&&_.findMatches(n.symbolInstances,t,c)}else{const y=m[t.scaledTo(Number(p)).key];y&&y.findMatches(n.symbolInstances,t,c)}}for(let p=0;p{n[a]=!0});for(const a in this.layerIndexes)n[a]||delete this.layerIndexes[a]}}const Nt=(o,t)=>h.emitValidationErrors(o,t&&t.filter(n=>n.identifier!=="source.canvas")),gs=h.pick(h.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),tr=h.pick(h.operations,["setCenter","setZoom","setBearing","setPitch"]),Ao=h.emptyStyle();class pi extends h.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new bi(wn(),this,t._getMapId()),this.imageManager=new Zi,this.imageManager.setEventedParent(this),this.glyphManager=new vr(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new Br(256,512),this.crossTileSymbolIndex=new Vr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new h.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",h.getReferrer());const a=this;this._rtlTextPluginCallback=pi.registerForPluginStateChange(c=>{a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:c.pluginStatus,pluginURL:c.pluginURL},(p,m)=>{if(h.triggerPluginCompletionEvent(p),m&&m.every(y=>y))for(const y in a.sourceCaches){const _=a.sourceCaches[y].getSource().type;_!=="vector"&&_!=="geojson"||a.sourceCaches[y].reload()}})}),this.on("data",c=>{if(c.dataType!=="source"||c.sourceDataType!=="metadata")return;const p=this.sourceCaches[c.sourceId];if(!p)return;const m=p.getSource();if(m&&m.vectorLayerIds)for(const y in this._layers){const _=this._layers[y];_.source===m.id&&this._validateLayer(_)}})}loadURL(t,n={},a){this.fire(new h.Event("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const c=this.map._requestManager.transformRequest(t,et.Style);this._request=h.getJSON(c,(p,m)=>{this._request=null,p?this.fire(new h.ErrorEvent(p)):m&&this._load(m,n,a)})}loadJSON(t,n={},a){this.fire(new h.Event("dataloading",{dataType:"style"})),this._request=h.exported.frame(()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,a)})}loadEmpty(){this.fire(new h.Event("dataloading",{dataType:"style"})),this._load(Ao,{validate:!1})}_load(t,n,a){const c=n.transformStyle?n.transformStyle(a,t):t;if(!n.validate||!Nt(this,h.validateStyle(c))){this._loaded=!0,this.stylesheet=c;for(const p in c.sources)this.addSource(p,c.sources[p],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs),this._createLayers(),this.light=new Nn(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new h.Event("data",{dataType:"style"})),this.fire(new h.Event("style.load"))}}_createLayers(){const t=h.derefLayers(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const a=h.createStyleLayer(n);a.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=a}}_loadSprite(t,n=!1,a=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(c,p,m,y){const _=ni(c),x=_.length,T=m>1?"@2x":"",w={},k={},O={};for(const{id:B,url:R}of _){const q=p.transformRequest(p.normalizeSpriteURL(R,T,".json"),et.SpriteJSON),H=`${B}_${q.url}`;w[H]=h.getJSON(q,(re,oe)=>{delete w[H],k[B]=oe,Vt(y,k,O,re,x)});const se=p.transformRequest(p.normalizeSpriteURL(R,T,".png"),et.SpriteImage),$=`${B}_${se.url}`;w[$]=Bt.getImage(se,(re,oe)=>{delete w[$],O[B]=oe,Vt(y,k,O,re,x)})}return{cancel(){for(const B of Object.values(w))B.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(c,p)=>{if(this._spriteRequest=null,c)this.fire(new h.ErrorEvent(c));else if(p)for(const m in p){this._spritesImagesIds[m]=[];const y=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(_=>!(_ in p)):[];for(const _ of y)this.imageManager.removeImage(_),this._changedImages[_]=!0;for(const _ in p[m]){const x=m==="default"?_:`${m}:${_}`;this._spritesImagesIds[m].push(x),x in this.imageManager.images?this.imageManager.updateImage(x,p[m][_],!1):this.imageManager.addImage(x,p[m][_]),n&&(this._changedImages[x]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"})),a&&a(c)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const a=t.sourceLayer;if(!a)return;const c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(a)===-1)&&this.fire(new h.ErrorEvent(new Error(`Source layer "${a}" does not exist on source "${c.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const a=[];for(const c of t)n[c]&&a.push(n[c]);return a}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const a of n){const c=this._layers[a];c.type!=="custom"&&(t[a]=c.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const c=Object.keys(this._updatedLayers),p=Object.keys(this._removedLayers);(c.length||p.length)&&this._updateWorkerLayers(c,p);for(const m in this._updatedSources){const y=this._updatedSources[m];if(y==="reload")this._reloadSource(m);else{if(y!=="clear")throw new Error(`Invalid action ${y}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const a={};for(const c in this.sourceCaches){const p=this.sourceCaches[c];a[c]=p.used,p.used=!1}for(const c of this._order){const p=this._layers[c];p.recalculate(t,this._availableImages),!p.isHidden(t.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(const c in a){const p=this.sourceCaches[c];a[c]!==p.used&&p.fire(new h.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new h.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const a=this.serialize();if(t=n.transformStyle?n.transformStyle(a,t):t,Nt(this,h.validateStyle(t)))return!1;(t=h.clone$1(t)).layers=h.derefLayers(t.layers);const c=h.diffStyles(a,t).filter(m=>!(m.command in tr));if(c.length===0)return!1;const p=c.filter(m=>!(m.command in gs));if(p.length>0)throw new Error(`Unimplemented: ${p.map(m=>m.command).join(", ")}.`);for(const m of c)m.command!=="setTransition"&&this[m.command].apply(this,m.args);return this.stylesheet=t,!0}addImage(t,n){if(this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,a={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(h.validateStyle.source,`sources.${t}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const c=this.sourceCaches[t]=new Gt(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,()=>({isSourceLoaded:c.loaded(),source:c.serialize(),sourceId:t})),c.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===t)return this.fire(new h.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${a}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new h.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const a=this.sourceCaches[t].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,a={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new h.ErrorEvent(new Error(`Layer "${c}" already exists on this map.`)));let p;if(t.type==="custom"){if(Nt(this,h.validateCustomStyleLayer(t)))return;p=h.createStyleLayer(t)}else{if(typeof t.source=="object"&&(this.addSource(c,t.source),t=h.clone$1(t),t=h.extend(t,{source:c})),this._validate(h.validateStyle.layer,`layers.${c}`,t,{arrayIndex:-1},a))return;p=h.createStyleLayer(t),this._validateLayer(p),p.setEventedParent(this,{layer:{id:c}})}const m=n?this._order.indexOf(n):this._order.length;if(n&&m===-1)this.fire(new h.ErrorEvent(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(m,0,c),this._layerOrderChanged=!0,this._layers[c]=p,this._removedLayers[c]&&p.source&&p.type!=="custom"){const y=this._removedLayers[c];delete this._removedLayers[c],y.type!==p.type?this._updatedSources[p.source]="clear":(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause())}this._updateLayer(p),p.onAdd&&p.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new h.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const a=this._order.indexOf(t);this._order.splice(a,1);const c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new h.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new h.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const a=this._order.indexOf(t);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,a){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===a||(n!=null&&(c.minzoom=n),a!=null&&(c.maxzoom=a),this._updateLayer(c)):this.fire(new h.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,a={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!h.deepEqual(c.filter,n))return n==null?(c.filter=void 0,void this._updateLayer(c)):void(this._validate(h.validateStyle.filter,`layers.${c.id}.filter`,n,null,a)||(c.filter=h.clone$1(n),this._updateLayer(c)))}else this.fire(new h.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return h.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,a,c={}){this._checkLoaded();const p=this.getLayer(t);p?h.deepEqual(p.getLayoutProperty(n),a)||(p.setLayoutProperty(n,a,c),this._updateLayer(p)):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const a=this.getLayer(t);if(a)return a.getLayoutProperty(n);this.fire(new h.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,a,c={}){this._checkLoaded();const p=this.getLayer(t);p?h.deepEqual(p.getPaintProperty(n),a)||(p.setPaintProperty(n,a,c)&&this._updateLayer(p),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const a=t.source,c=t.sourceLayer,p=this.sourceCaches[a];if(p===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${a}' does not exist in the map's style.`)));const m=p.getSource().type;m==="geojson"&&c?this.fire(new h.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||c?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),p.setFeatureState(c,t.id,n)):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const a=t.source,c=this.sourceCaches[a];if(c===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${a}' does not exist in the map's style.`)));const p=c.getSource().type,m=p==="vector"?t.sourceLayer:void 0;p!=="vector"||m?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new h.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(m,t.id,n):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,a=t.sourceLayer,c=this.sourceCaches[n];if(c!==void 0)return c.getSource().type!=="vector"||a?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),c.getFeatureState(a,t.id)):void this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new h.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return h.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const t=h.mapObject(this.sourceCaches,c=>c.serialize()),n=this._serializeByIds(this._order),a=this.stylesheet;return h.filterObject({version:a.version,name:a.name,metadata:a.metadata,light:a.light,center:a.center,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,sprite:a.sprite,glyphs:a.glyphs,transition:a.transition,sources:t,layers:n},c=>c!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=m=>this._layers[m].type==="fill-extrusion",a={},c=[];for(let m=this._order.length-1;m>=0;m--){const y=this._order[m];if(n(y)){a[y]=m;for(const _ of t){const x=_[y];if(x)for(const T of x)c.push(T)}}}c.sort((m,y)=>y.intersectionZ-m.intersectionZ);const p=[];for(let m=this._order.length-1;m>=0;m--){const y=this._order[m];if(n(y))for(let _=c.length-1;_>=0;_--){const x=c[_].feature;if(a[x.layer.id]{const ve=H.featureSortOrder;if(ve){const ge=ve.indexOf(me.featureIndex);return ve.indexOf(_e.featureIndex)-ge}return _e.featureIndex-me.featureIndex});for(const me of oe)re.push(me)}}for(const H in B)B[H].forEach(se=>{const $=se.feature,re=x[y[H].source].getFeatureState($.layer["source-layer"],$.id);$.source=$.layer.source,$.layer["source-layer"]&&($.sourceLayer=$.layer["source-layer"]),$.state=re});return B}(this._layers,m,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)}querySourceFeatures(t,n){n&&n.filter&&this._validate(h.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);const a=this.sourceCaches[t];return a?function(c,p){const m=c.getRenderableIds().map(x=>c.getTileByID(x)),y=[],_={};for(let x=0;xk.getTileByID(O)).sort((O,B)=>B.tileID.overscaledZ-O.tileID.overscaledZ||(O.tileID.isLessThan(B.tileID)?-1:1))}const w=this.crossTileSymbolIndex.addLayer(T,_[T.source],t.center.lng);m=m||w}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((p=p||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(h.exported.now(),t.zoom))&&(this.pauseablePlacement=new Wi(t,this.map.terrain,this._order,p,n,a,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,_),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(h.exported.now()),y=!0),m&&this.pauseablePlacement.placement.setStale()),y||m)for(const x of this._order){const T=this._layers[x];T.type==="symbol"&&this.placement.updateLayerOpacities(T,_[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(h.exported.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,a){this.imageManager.getImages(n.icons,a),this._updateTilesForChangedImages();const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,a){this.glyphManager.getGlyphs(n.stacks,a);const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,a){return h.makeRequest(n,a)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(h.validateStyle.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,a={},c){this._checkLoaded();const p=[{id:t,url:n}],m=[...ni(this.stylesheet.sprite),...p];this._validate(h.validateStyle.sprite,"sprite",m,null,a)||(this.stylesheet.sprite=m,this._loadSprite(p,!0,c))}removeSprite(t){this._checkLoaded();const n=ni(this.stylesheet.sprite);if(n.find(a=>a.id===t)){if(this._spritesImagesIds[t])for(const a of this._spritesImagesIds[t])this.imageManager.removeImage(a),this._changedImages[a]=!0;n.splice(n.findIndex(a=>a.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}else this.fire(new h.ErrorEvent(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return ni(this.stylesheet.sprite)}setSprite(t,n={},a){this._checkLoaded(),t&&this._validate(h.validateStyle.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,a):(this._unloadSprite(),a&&a(null)))}}pi.getSourceType=function(o){return Fr[o]},pi.setSourceType=function(o,t){Fr[o]=t},pi.registerForPluginStateChange=h.registerForPluginStateChange;var _a=h.createLayout([{name:"a_pos",type:"Int16",components:2}]),_s="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Nr={prelude:mt(`#ifdef GL_ES +var ff=Object.defineProperty;var mf=(E,I,D)=>I in E?ff(E,I,{enumerable:!0,configurable:!0,writable:!0,value:D}):E[I]=D;var ih=(E,I,D)=>(mf(E,typeof I!="symbol"?I+"":I,D),D);(function(){const I=document.createElement("link").relList;if(I&&I.supports&&I.supports("modulepreload"))return;for(const ee of document.querySelectorAll('link[rel="modulepreload"]'))V(ee);new MutationObserver(ee=>{for(const ie of ee)if(ie.type==="childList")for(const ue of ie.addedNodes)ue.tagName==="LINK"&&ue.rel==="modulepreload"&&V(ue)}).observe(document,{childList:!0,subtree:!0});function D(ee){const ie={};return ee.integrity&&(ie.integrity=ee.integrity),ee.referrerPolicy&&(ie.referrerPolicy=ee.referrerPolicy),ee.crossOrigin==="use-credentials"?ie.credentials="include":ee.crossOrigin==="anonymous"?ie.credentials="omit":ie.credentials="same-origin",ie}function V(ee){if(ee.ep)return;ee.ep=!0;const ie=D(ee);fetch(ee.href,ie)}})();function Nn(){}const gf=E=>E;function Ll(E,I){for(const D in I)E[D]=I[D];return E}function td(E){return E()}function Hu(){return Object.create(null)}function gs(E){E.forEach(td)}function ch(E){return typeof E=="function"}function Vl(E,I){return E!=E?I==I:E!==I||E&&typeof E=="object"||typeof E=="function"}let zl;function wm(E,I){return zl||(zl=document.createElement("a")),zl.href=I,E===zl.href}function _f(E){return Object.keys(E).length===0}function id(E,...I){if(E==null){for(const V of I)V(void 0);return Nn}const D=E.subscribe(...I);return D.unsubscribe?()=>D.unsubscribe():D}function Tm(E){let I;return id(E,D=>I=D)(),I}function Em(E,I,D){E.$$.on_destroy.push(id(I,D))}function rd(E,I,D,V){if(E){const ee=nd(E,I,D,V);return E[0](ee)}}function nd(E,I,D,V){return E[1]&&V?Ll(D.ctx.slice(),E[1](V(I))):D.ctx}function sd(E,I,D,V){if(E[2]&&V){const ee=E[2](V(D));if(I.dirty===void 0)return ee;if(typeof ee=="object"){const ie=[],ue=Math.max(I.dirty.length,ee.length);for(let h=0;h32){const I=[],D=E.ctx.length/32;for(let V=0;Vwindow.performance.now():()=>Date.now(),hh=ld?E=>requestAnimationFrame(E):Nn;const ma=new Set;function cd(E){ma.forEach(I=>{I.c(E)||(ma.delete(I),I.f())}),ma.size!==0&&hh(cd)}function xf(E){let I;return ma.size===0&&hh(cd),{promise:new Promise(D=>{ma.add(I={c:E,f:D})}),abort(){ma.delete(I)}}}function fs(E,I){E.appendChild(I)}function hd(E){if(!E)return document;const I=E.getRootNode?E.getRootNode():E.ownerDocument;return I&&I.host?I:E.ownerDocument}function vf(E){const I=ms("style");return I.textContent="/* empty */",bf(hd(E),I),I.sheet}function bf(E,I){return fs(E.head||E,I),I.sheet}function Nl(E,I,D){E.insertBefore(I,D||null)}function _a(E){E.parentNode&&E.parentNode.removeChild(E)}function Im(E,I){for(let D=0;DE.removeEventListener(I,D,V)}function Mm(E){return function(I){return I.stopPropagation(),E.call(this,I)}}function Lr(E,I,D){D==null?E.removeAttribute(I):E.getAttribute(I)!==D&&E.setAttribute(I,D)}const wf=["width","height"];function Yu(E,I){const D=Object.getOwnPropertyDescriptors(E.__proto__);for(const V in I)I[V]==null?E.removeAttribute(V):V==="style"?E.style.cssText=I[V]:V==="__value"?E.value=E[V]=I[V]:D[V]&&D[V].set&&wf.indexOf(V)===-1?E[V]=I[V]:Lr(E,V,I[V])}function Cm(E){let I;return{p(...D){I=D,I.forEach(V=>E.push(V))},r(){I.forEach(D=>E.splice(E.indexOf(D),1))}}}function km(E){return E===""?null:+E}function Tf(E){return Array.from(E.childNodes)}function pd(E,I){I=""+I,E.data!==I&&(E.data=I)}function zm(E,I){E.value=I??""}function Dm(E,I,D,V){D==null?E.style.removeProperty(I):E.style.setProperty(I,D,V?"important":"")}function Lm(E,I,D){for(let V=0;V>>0}function Sf(E,I){const D={stylesheet:vf(I),rules:{}};return Bl.set(E,D),D}function Ju(E,I,D,V,ee,ie,ue,h=0){const ce=16.666/V;let Y=`{ +`;for(let bt=0;bt<=1;bt+=ce){const et=I+(D-I)*ie(bt);Y+=bt*100+`%{${ue(et,1-et)}} +`}const Ne=Y+`100% {${ue(D,1-D)}} +}`,xe=`__svelte_${Ef(Ne)}_${h}`,nt=hd(E),{stylesheet:ot,rules:We}=Bl.get(nt)||Sf(nt,E);We[xe]||(We[xe]=!0,ot.insertRule(`@keyframes ${xe} ${Ne}`,ot.cssRules.length));const xt=E.style.animation||"";return E.style.animation=`${xt?`${xt}, `:""}${xe} ${V}ms linear ${ee}ms 1 both`,Rl+=1,xe}function If(E,I){const D=(E.style.animation||"").split(", "),V=D.filter(I?ie=>ie.indexOf(I)<0:ie=>ie.indexOf("__svelte")===-1),ee=D.length-V.length;ee&&(E.style.animation=V.join(", "),Rl-=ee,Rl||Af())}function Af(){hh(()=>{Rl||(Bl.forEach(E=>{const{ownerNode:I}=E.stylesheet;I&&_a(I)}),Bl.clear())})}let So;function Eo(E){So=E}function Io(){if(!So)throw new Error("Function called outside component initialization");return So}function Fm(E){Io().$$.on_mount.push(E)}function Om(E){Io().$$.on_destroy.push(E)}function Um(){const E=Io();return(I,D,{cancelable:V=!1}={})=>{const ee=E.$$.callbacks[I];if(ee){const ie=fd(I,D,{cancelable:V});return ee.slice().forEach(ue=>{ue.call(E,ie)}),!ie.defaultPrevented}return!0}}function Vm(E,I){return Io().$$.context.set(E,I),I}function Nm(E){return Io().$$.context.get(E)}function Pf(E,I){const D=E.$$.callbacks[I.type];D&&D.slice().forEach(V=>V.call(this,I))}const fa=[],sh=[];let ga=[];const ah=[],Mf=Promise.resolve();let oh=!1;function Cf(){oh||(oh=!0,Mf.then(md))}function Fl(E){ga.push(E)}function $m(E){ah.push(E)}const rh=new Set;let pa=0;function md(){if(pa!==0)return;const E=So;do{try{for(;paE.indexOf(V)===-1?I.push(V):D.push(V)),D.forEach(V=>V()),ga=I}let To;function Df(){return To||(To=Promise.resolve(),To.then(()=>{To=null})),To}function nh(E,I,D){E.dispatchEvent(fd(`${I?"intro":"outro"}${D}`))}const Dl=new Set;let fn;function qm(){fn={r:0,c:[],p:fn}}function jm(){fn.r||gs(fn.c),fn=fn.p}function Ao(E,I){E&&E.i&&(Dl.delete(E),E.i(I))}function ql(E,I,D,V){if(E&&E.o){if(Dl.has(E))return;Dl.add(E),fn.c.push(()=>{Dl.delete(E),V&&(D&&E.d(1),V())}),E.o(I)}else V&&V()}const Lf={duration:0};function Zm(E,I,D,V){let ie=I(E,D,{direction:"both"}),ue=V?0:1,h=null,ce=null,Y=null,Ne;function xe(){Y&&If(E,Y)}function nt(We,xt){const bt=We.b-ue;return xt*=Math.abs(bt),{a:ue,b:We.b,d:bt,duration:xt,start:We.start,end:We.start+xt,group:We.group}}function ot(We){const{delay:xt=0,duration:bt=300,easing:et=gf,tick:Bt=Nn,css:pt}=ie||Lf,ri={start:yf()+xt,b:We};We||(ri.group=fn,fn.r+=1),"inert"in E&&(We?Ne!==void 0&&(E.inert=Ne):(Ne=E.inert,E.inert=!0)),h||ce?ce=ri:(pt&&(xe(),Y=Ju(E,ue,We,bt,xt,et,pt)),We&&Bt(0,1),h=nt(ri,bt),Fl(()=>nh(E,We,"start")),xf(Rt=>{if(ce&&Rt>ce.start&&(h=nt(ce,bt),ce=null,nh(E,h.b,"start"),pt&&(xe(),Y=Ju(E,ue,h.b,h.duration,0,et,ie.css))),h){if(Rt>=h.end)Bt(ue=h.b,1-ue),nh(E,h.b,"end"),ce||(h.b?xe():--h.group.r||gs(h.group.c)),h=null;else if(Rt>=h.start){const Ai=Rt-h.start;ue=h.a+h.d*et(Ai/h.duration),Bt(ue,1-ue)}}return!!(h||ce)}))}return{run(We){ch(ie)?Df().then(()=>{ie=ie({direction:We?"in":"out"}),ot(We)}):ot(We)},end(){xe(),h=ce=null}}}function Gm(E){return(E==null?void 0:E.length)!==void 0?E:Array.from(E)}function Xm(E,I){ql(E,1,1,()=>{I.delete(E.key)})}function Wm(E,I,D,V,ee,ie,ue,h,ce,Y,Ne,xe){let nt=E.length,ot=ie.length,We=nt;const xt={};for(;We--;)xt[E[We].key]=We;const bt=[],et=new Map,Bt=new Map,pt=[];for(We=ot;We--;){const Mt=xe(ee,ie,We),Ct=D(Mt);let ni=ue.get(Ct);ni?V&&pt.push(()=>ni.p(Mt,I)):(ni=Y(Ct,Mt),ni.c()),et.set(Ct,bt[We]=ni),Ct in xt&&Bt.set(Ct,Math.abs(We-xt[Ct]))}const ri=new Set,Rt=new Set;function Ai(Mt){Ao(Mt,1),Mt.m(h,Ne),ue.set(Mt.key,Mt),Ne=Mt.first,ot--}for(;nt&&ot;){const Mt=bt[ot-1],Ct=E[nt-1],ni=Mt.key,Vt=Ct.key;Mt===Ct?(Ne=Mt.first,nt--,ot--):et.has(Vt)?!ue.has(ni)||ri.has(ni)?Ai(Mt):Rt.has(Vt)?nt--:Bt.get(ni)>Bt.get(Vt)?(Rt.add(ni),Ai(Mt)):(ri.add(Vt),nt--):(ce(Ct,ue),nt--)}for(;nt--;){const Mt=E[nt];et.has(Mt.key)||ce(Mt,ue)}for(;ot;)Ai(bt[ot-1]);return gs(pt),bt}function Bf(E,I){const D={},V={},ee={$$scope:1};let ie=E.length;for(;ie--;){const ue=E[ie],h=I[ie];if(h){for(const ce in ue)ce in h||(V[ce]=1);for(const ce in h)ee[ce]||(D[ce]=h[ce],ee[ce]=1);E[ie]=h}else for(const ce in ue)ee[ce]=1}for(const ue in V)ue in D||(D[ue]=void 0);return D}function Hm(E,I,D){const V=E.$$.props[I];V!==void 0&&(E.$$.bound[V]=D,D(E.$$.ctx[V]))}function Rf(E){E&&E.c()}function gd(E,I,D){const{fragment:V,after_update:ee}=E.$$;V&&V.m(I,D),Fl(()=>{const ie=E.$$.on_mount.map(td).filter(ch);E.$$.on_destroy?E.$$.on_destroy.push(...ie):gs(ie),E.$$.on_mount=[]}),ee.forEach(Fl)}function _d(E,I){const D=E.$$;D.fragment!==null&&(zf(D.after_update),gs(D.on_destroy),D.fragment&&D.fragment.d(I),D.on_destroy=D.fragment=null,D.ctx=[])}function Ff(E,I){E.$$.dirty[0]===-1&&(fa.push(E),Cf(),E.$$.dirty.fill(0)),E.$$.dirty[I/31|0]|=1<{const We=ot.length?ot[0]:nt;return Y.ctx&&ee(Y.ctx[xe],Y.ctx[xe]=We)&&(!Y.skip_bound&&Y.bound[xe]&&Y.bound[xe](We),Ne&&Ff(E,xe)),nt}):[],Y.update(),Ne=!0,gs(Y.before_update),Y.fragment=V?V(Y.ctx):!1,I.target){if(I.hydrate){const xe=Tf(I.target);Y.fragment&&Y.fragment.l(xe),xe.forEach(_a)}else Y.fragment&&Y.fragment.c();I.intro&&Ao(E.$$.fragment),gd(E,I.target,I.anchor),md()}Eo(ce)}class Zl{constructor(){ih(this,"$$");ih(this,"$$set")}$destroy(){_d(this,1),this.$destroy=Nn}$on(I,D){if(!ch(D))return Nn;const V=this.$$.callbacks[I]||(this.$$.callbacks[I]=[]);return V.push(D),()=>{const ee=V.indexOf(D);ee!==-1&&V.splice(ee,1)}}$set(I){this.$$set&&!_f(I)&&(this.$$.skip_bound=!0,this.$$set(I),this.$$.skip_bound=!1)}}const Of="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Of);var Uf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Km(E){return E&&E.__esModule&&Object.prototype.hasOwnProperty.call(E,"default")?E.default:E}function Ym(E){if(E.__esModule)return E;var I=E.default;if(typeof I=="function"){var D=function V(){if(this instanceof V){var ee=[null];ee.push.apply(ee,arguments);var ie=Function.bind.apply(I,ee);return new ie}return I.apply(this,arguments)};D.prototype=I.prototype}else D={};return Object.defineProperty(D,"__esModule",{value:!0}),Object.keys(E).forEach(function(V){var ee=Object.getOwnPropertyDescriptor(E,V);Object.defineProperty(D,V,ee.get?ee:{enumerable:!0,get:function(){return E[V]}})}),D}var yd={exports:{}};(function(E,I){(function(D,V){E.exports=V()})(Uf,function(){var D,V,ee;function ie(h,ce){if(!D)D=ce;else if(!V)V=ce;else{var Y="var sharedChunk = {}; ("+D+")(sharedChunk); ("+V+")(sharedChunk);",Ne={};D(Ne),ee=ce(Ne),typeof window<"u"&&(ee.workerUrl=window.URL.createObjectURL(new Blob([Y],{type:"text/javascript"})))}}ie(["exports"],function(h){function ce(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Y=Ne;function Ne(i,e){this.x=i,this.y=e}Ne.prototype={clone:function(){return new Ne(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),s=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,e){var r=Math.cos(i),s=Math.sin(i),l=e.y+s*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-s*(this.y-e.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ne.convert=function(i){return i instanceof Ne?i:Array.isArray(i)?new Ne(i[0],i[1]):i};var xe=ce(Y),nt=ot;function ot(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}ot.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var We=ce(nt);function xt(i,e,r,s){const l=new We(i,e,r,s);return function(u){return l.solve(u)}}const bt=xt(.25,.1,.25,1);function et(i,e,r){return Math.min(r,Math.max(e,i))}function Bt(i,e,r){const s=r-e,l=((i-e)%s+s)%s+e;return l===e?r:l}function pt(i,...e){for(const r of e)for(const s in r)i[s]=r[s];return i}let ri=1;function Rt(i,e){i.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Ai(i,e,r){const s={};for(const l in i)s[l]=e.call(r||this,i[l],l,i);return s}function Mt(i,e,r){const s={};for(const l in i)e.call(r||this,i[l],l,i)&&(s[l]=i[l]);return s}function Ct(i){return Array.isArray(i)?i.map(Ct):typeof i=="object"&&i?Ai(i,Ct):i}const ni={};function Vt(i){ni[i]||(typeof console<"u"&&console.warn(i),ni[i]=!0)}function yt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function xa(i){let e=0;for(let r,s,l=0,u=i.length,d=u-1;lcancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(gn||(gn=document.createElement("a")),gn.href=i,gn.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Kr==null&&(Kr=matchMedia("(prefers-reduced-motion: reduce)")),Kr.matches)}},$n={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Rr extends Error{constructor(e,r,s,l){super(`AJAXError: ${r} (${e}): ${s}`),this.status=e,this.statusText=r,this.url=s,this.body=l}}const bi=Zi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Gi=i=>$n.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function hi(i,e){const r=new AbortController,s=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:bi(),signal:r.signal});let l=!1,u=!1;return i.type==="json"&&s.headers.set("Accept","application/json"),u||fetch(s).then(d=>d.ok?(f=>{(i.type==="arrayBuffer"||i.type==="image"?f.arrayBuffer():i.type==="json"?f.json():f.text()).then(g=>{u||(l=!0,e(null,g,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(g=>{u||e(new Error(g.message))})})(d):d.blob().then(f=>e(new Rr(d.status,d.statusText,i.url,f)))).catch(d=>{d.code!==20&&e(new Error(d.message))}),{cancel:()=>{u=!0,l||r.abort()}}}const yn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Zi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Zi())return(Gi(i.url)||hi)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(bi())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return hi(i,e);if(Zi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(s,l){const u=new XMLHttpRequest;u.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(u.responseType="arraybuffer");for(const d in s.headers)u.setRequestHeader(d,s.headers[d]);return s.type==="json"&&(u.responseType="text",u.setRequestHeader("Accept","application/json")),u.withCredentials=s.credentials==="include",u.onerror=()=>{l(new Error(u.statusText))},u.onload=()=>{if((u.status>=200&&u.status<300||u.status===0)&&u.response!==null){let d=u.response;if(s.type==="json")try{d=JSON.parse(u.response)}catch(f){return l(f)}l(null,d,u.getResponseHeader("Cache-Control"),u.getResponseHeader("Expires"))}else{const d=new Blob([u.response],{type:u.getResponseHeader("Content-Type")});l(new Rr(u.status,u.statusText,s.url,d))}},u.send(s.body),{cancel:()=>u.abort()}}(i,e)},xn=function(i,e){return yn(pt(i,{type:"arrayBuffer"}),e)};function Yr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Fr(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function br(i,e,r){if(r&&r[i]){const s=r[i].indexOf(e);s!==-1&&r[i].splice(s,1)}}class wr{constructor(e,r={}){pt(this,r),this.type=e}}class Xi extends wr{constructor(e,r={}){super("error",pt({error:e},r))}}class vn{on(e,r){return this._listeners=this._listeners||{},Fr(e,r,this._listeners),this}off(e,r){return br(e,r,this._listeners),br(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Fr(e,r,this._oneTimeListeners),this):new Promise(s=>this.once(e,s))}fire(e,r){typeof e=="string"&&(e=new wr(e,r||{}));const s=e.type;if(this.listens(s)){e.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const f of l)f.call(this,e);const u=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of u)br(s,f,this._oneTimeListeners),f.call(this,e);const d=this._eventedParent;d&&(pt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof Xi&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var le={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"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:{}},default:"mapbox"},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-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 Or=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function qn(i,e){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return Or.forEach(s=>{s in e&&(r[s]=e[s])}),r}function wt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const Zn=[Ur,be,Qe,Ye,Pi,Er,Qt,ui(He),er,Sr];function cr(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!cr(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of Zn)if(!cr(r,e))return null}}return`Expected ${St(i)} but found ${St(e)} instead.`}function N(i,e){return e.some(r=>r.kind===i.kind)}function A(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function M(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const L=.96422,j=.82521,Z=4/29,J=6/29,W=3*J*J,G=J*J*J,te=Math.PI/180,de=180/Math.PI;function fe(i){return(i%=360)<0&&(i+=360),i}function pe([i,e,r,s]){let l,u;const d=Xe((.2225045*(i=$e(i))+.7168786*(e=$e(e))+.0606169*(r=$e(r)))/1);i===e&&e===r?l=u=d:(l=Xe((.4360747*i+.3850649*e+.1430804*r)/L),u=Xe((.0139322*i+.0971045*e+.7141733*r)/j));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-u),s]}function $e(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Xe(i){return i>G?Math.pow(i,1/3):i/W+Z}function Le([i,e,r,s]){let l=(i+16)/116,u=isNaN(e)?l:l+e/500,d=isNaN(r)?l:l-r/200;return l=1*Ge(l),u=L*Ge(u),d=j*Ge(d),[Oe(3.1338561*u-1.6168667*l-.4906146*d),Oe(-.9787684*u+1.9161415*l+.033454*d),Oe(.0719453*u-.2289914*l+1.4052427*d),s]}function Oe(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Ge(i){return i>J?i*i*i:W*(i-Z)}function at(i){return parseInt(i.padEnd(2,i),16)/255}function tt(i,e){return ct(e?i/100:i,0,1)}function ct(i,e,r){return Math.min(Math.max(e,i),r)}function Tt(i){return!i.some(Number.isNaN)}const Xt={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 Ze{constructor(e,r,s,l=1,u=!0){this.r=e,this.g=r,this.b=s,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[e,r,s,l]))}static parse(e){if(e instanceof Ze)return e;if(typeof e!="string")return;const r=function(s){if((s=s.toLowerCase())==="transparent")return[0,0,0,0];const l=Xt[s];if(l){const[d,f,g]=l;return[d/255,f/255,g/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const d=s.length<6?1:2;let f=1;return[at(s.slice(f,f+=d)),at(s.slice(f,f+=d)),at(s.slice(f,f+=d)),at(s.slice(f,f+d)||"ff")]}if(s.startsWith("rgb")){const d=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,g,v,b,S,P,C,z,U,F,K,Q]=d,X=[b||" ",C||" ",F].join("");if(X===" "||X===" /"||X===",,"||X===",,,"){const ne=[v,P,U].join(""),ae=ne==="%%%"?100:ne===""?255:0;if(ae){const he=[ct(+g/ae,0,1),ct(+S/ae,0,1),ct(+z/ae,0,1),K?tt(+K,Q):1];if(Tt(he))return he}}return}}const u=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[d,f,g,v,b,S,P,C,z]=u,U=[g||" ",b||" ",P].join("");if(U===" "||U===" /"||U===",,"||U===",,,"){const F=[+f,ct(+v,0,100),ct(+S,0,100),C?tt(+C,z):1];if(Tt(F))return function([K,Q,X,ne]){function ae(he){const ze=(he+K/30)%12,Be=Q*Math.min(X,1-X);return X-Be*Math.max(-1,Math.min(ze-3,9-ze,1))}return K=fe(K),Q/=100,X/=100,[ae(0),ae(8),ae(4),ne]}(F)}}}(e);return r?new Ze(...r,!1):void 0}get rgb(){const{r:e,g:r,b:s,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[e/u,r/u,s/u,l])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,s,l,u]=pe(e),d=Math.sqrt(s*s+l*l);return[Math.round(1e4*d)?fe(Math.atan2(l,s)*de):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",pe(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,s,l]=this.rgb;return`rgba(${[e,r,s].map(u=>Math.round(255*u)).join(",")},${l})`}}Ze.black=new Ze(0,0,0,1),Ze.white=new Ze(1,1,1,1),Ze.transparent=new Ze(0,0,0,0),Ze.red=new Ze(1,0,0,1);class Lt{constructor(e,r,s){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Vr{constructor(e,r,s,l,u){this.text=e,this.image=r,this.scale=s,this.fontStack=l,this.textColor=u}}class di{constructor(e){this.sections=e}static fromString(e){return new di([new Vr(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof di?e:di.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e=="number")return new Li([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Li(e)}}toString(){return JSON.stringify(this.values)}}class Wi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Wi({name:e,available:!1}):null}}function Tn(i,e,r,s){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,e,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,e,r,s]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ys(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Ze||i instanceof Lt||i instanceof di||i instanceof Li||i instanceof Wi)return!0;if(Array.isArray(i)){for(const e of i)if(!ys(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!ys(i[e]))return!1;return!0}return!1}function Wt(i){if(i===null)return Ur;if(typeof i=="string")return Qe;if(typeof i=="boolean")return Ye;if(typeof i=="number")return be;if(i instanceof Ze)return Pi;if(i instanceof Lt)return Tr;if(i instanceof di)return Er;if(i instanceof Li)return er;if(i instanceof Wi)return Sr;if(Array.isArray(i)){const e=i.length;let r;for(const s of i){const l=Wt(s);if(r){if(r===l)continue;r=He;break}r=l}return ui(r||He,e)}return Qt}function Gn(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof Ze||i instanceof di||i instanceof Li||i instanceof Wi?i.toString():JSON.stringify(i)}class Nr{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ys(e[1]))return r.error("invalid value");const s=e[1];let l=Wt(s);const u=r.expectedType;return l.kind!=="array"||l.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(l=u),new Nr(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Nt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const xs={string:Qe,number:be,boolean:Ye,object:Qt};class tr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let s,l=1;const u=e[0];if(u==="array"){let f,g;if(e.length>2){const v=e[1];if(typeof v!="string"||!(v in xs)||v==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=xs[v],l++}else f=He;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=e[2],l++}s=ui(f,g)}else{if(!xs[u])throw new Error(`Types doesn't contain name = ${u}`);s=xs[u]}const d=[];for(;le.outputDefined())}}const Po={"to-boolean":Ye,"to-color":Pi,"to-number":be,"to-string":Qe};class pi{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[0];if(!Po[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return r.error("Expected one argument.");const l=Po[s],u=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Tn(r[0],r[1],r[2],r[3]),!s))return new Ze(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Nt(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="padding"){let r;for(const s of this.args){r=s.evaluate(e);const l=Li.parse(r);if(l)return l}throw new Nt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}if(this.type.kind==="number"){let r=null;for(const s of this.args){if(r=s.evaluate(e),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new Nt(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?di.fromString(Gn(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Wi.fromString(Gn(this.args[0].evaluate(e))):Gn(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const va=["Unknown","Point","LineString","Polygon"];class vs{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"?va[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Ze.parse(e)),r}}class $r{constructor(e,r,s=[],l,u=new wn,d=[]){this.registry=e,this.path=s,this.key=s.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=l,this._isConstant=r}parse(e,r,s,l,u={}){return r?this.concat(r,s,l)._parse(e,u):this._parse(e,u)}_parse(e,r){function s(l,u,d){return d==="assert"?new tr(u,[l]):d==="coerce"?new pi(u,[l]):l}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=e[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const u=this.registry[l];if(u){let d=u.parse(e,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,g=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||g.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(f.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array"){if(this.checkSubtype(f,g))return null}else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Nr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new vs;try{d=new Nr(d.type,d.evaluate(f))}catch(g){return this.error(g.message),null}}return d}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,s){const l=typeof e=="number"?this.path.concat(e):this.path,u=s?this.scope.concat(s):this.scope;return new $r(this.registry,this._isConstant,l,r||null,u,this.errors)}error(e,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new fi(s,e))}checkSubtype(e,r){const s=cr(e,r);return s&&this.error(s),s}}class mt{constructor(e,r,s){this.type=Tr,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,Ye);if(!l)return null;const u=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Ye);if(!u)return null;let d=null;return s.locale&&(d=r.parse(s.locale,1,Qe),!d)?null:new mt(l,u,d)}evaluate(e){return new Lt(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const qr=8192;function Xn(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function bs(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Mo(i,e){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,e.z);return[Math.round(r*l*qr),Math.round(s*l*qr)]}function Co(i,e,r){const s=i[0]-e[0],l=i[1]-e[1],u=i[0]-r[0],d=i[1]-r[1];return s*d-u*l==0&&s*u<=0&&l*d<=0}function ba(i,e){let r=!1;for(let d=0,f=e.length;d(s=i)[1]!=(u=g[v+1])[1]>s[1]&&s[0]<(u[0]-l[0])*(s[1]-l[1])/(u[1]-l[1])+l[0]&&(r=!r)}}var s,l,u;return r}function ko(i,e){for(let r=0;r0&&f<0||d<0&&f>0}function Wl(i,e,r){for(const v of r)for(let b=0;br[2]){const l=.5*s;let u=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;u===0&&(u=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=u}Xn(e,i)}function Do(i,e,r,s){const l=Math.pow(2,s.z)*qr,u=[s.x*qr,s.y*qr],d=[];for(const f of i)for(const g of f){const v=[g.x+u[0],g.y+u[1]];Sa(v,e,r,l),d.push(v)}return d}function Lo(i,e,r,s){const l=Math.pow(2,s.z)*qr,u=[s.x*qr,s.y*qr],d=[];for(const g of i){const v=[];for(const b of g){const S=[b.x+u[0],b.y+u[1]];Xn(e,S),v.push(S)}d.push(v)}if(e[2]-e[0]<=l/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const g of d)for(const v of g)Sa(v,e,r,l)}var f;return d}class Ir{constructor(e,r){this.type=Ye,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ys(e[1])){const s=e[1];if(s.type==="FeatureCollection")for(let l=0;l!Array.isArray(v)||v.length===e.length-1);let g=null;for(const[v,b]of f){g=new $r(r.registry,Ts,r.path,null,r.scope);const S=[];let P=!1;for(let C=1;C{return P=S,Array.isArray(P)?`(${P.map(St).join(", ")})`:`(${St(P.type)}...)`;var P}).join(" | "),b=[];for(let S=1;S{r=e?r&&Ts(s):r&&s instanceof Nr}),!!r&&Wn(i)&&Es(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Wn(i){if(i instanceof Hi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Ir)return!1;let e=!0;return i.eachChild(r=>{e&&!Wn(r)&&(e=!1)}),e}function En(i){if(i instanceof Hi&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!En(r)&&(e=!1)}),e}function Es(i,e){if(i instanceof Hi&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!Es(s,e)&&(r=!1)}),r}function Ss(i,e){const r=i.length-1;let s,l,u=0,d=r,f=0;for(;u<=d;)if(f=Math.floor((u+d)/2),s=i[f],l=i[f+1],s<=e){if(f===r||ee))throw new Nt("Input is not a number.");d=f-1}return 0}class Sn{constructor(e,r,s){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[l,u]of s)this.labels.push(l),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(e[1],1,be);if(!s)return null;const l=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let d=1;d=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',v);const S=r.parse(g,b,u);if(!S)return null;u=u||S.type,l.push([f,S])}return new Sn(u,s,l)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const u=r.length;return l>=r[u-1]?s[u-1].evaluate(e):s[Ss(r,l)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function In(i,e,r){return i+r*(e-i)}function Is(i,e,r){return i.map((s,l)=>In(s,e[l],r))}const Bi={number:In,color:function(i,e,r,s="rgb"){switch(s){case"rgb":{const[l,u,d,f]=Is(i.rgb,e.rgb,r);return new Ze(l,u,d,f,!1)}case"hcl":{const[l,u,d,f]=i.hcl,[g,v,b,S]=e.hcl;let P,C;if(isNaN(l)||isNaN(g))isNaN(l)?isNaN(g)?P=NaN:(P=g,d!==1&&d!==0||(C=v)):(P=l,b!==1&&b!==0||(C=u));else{let Q=g-l;g>l&&Q>180?Q-=360:g180&&(Q+=360),P=l+r*Q}const[z,U,F,K]=function([Q,X,ne,ae]){return Q=isNaN(Q)?0:Q*te,Le([ne,Math.cos(Q)*X,Math.sin(Q)*X,ae])}([P,C??In(u,v,r),In(d,b,r),In(f,S,r)]);return new Ze(z,U,F,K,!1)}case"lab":{const[l,u,d,f]=Le(Is(i.lab,e.lab,r));return new Ze(l,u,d,f,!1)}}},array:Is,padding:function(i,e,r){return new Li(Is(i.values,e.values,r))}};class Ri{constructor(e,r,s,l,u){this.type=e,this.operator=r,this.interpolation=s,this.input=l,this.labels=[],this.outputs=[];for(const[d,f]of u)this.labels.push(d),this.outputs.push(f)}static interpolationFactor(e,r,s,l){let u=0;if(e.name==="exponential")u=Ia(r,e.base,s,l);else if(e.name==="linear")u=Ia(r,1,s,l);else if(e.name==="cubic-bezier"){const d=e.controlPoints;u=new We(d[0],d[1],d[2],d[3]).solve(Ia(r,1,s,l))}return u}static parse(e,r){let[s,l,u,...d]=e;if(!Array.isArray(l)||l.length===0)return r.error("Expected an interpolation type expression.",1);if(l[0]==="linear")l={name:"linear"};else if(l[0]==="exponential"){const v=l[1];if(typeof v!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);l={name:"exponential",base:v}}else{if(l[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(l[0])}`,1,0);{const v=l.slice(1);if(v.length!==4||v.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:v}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,be),!u)return null;const f=[];let g=null;s==="interpolate-hcl"||s==="interpolate-lab"?g=Pi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let v=0;v=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',P);const z=r.parse(S,C,g);if(!z)return null;g=g||z.type,f.push([b,z])}return M(g,be)||M(g,Pi)||M(g,er)||M(g,ui(be))?new Ri(g,s,l,u,f):r.error(`Type ${St(g)} is not interpolatable.`)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return s[0].evaluate(e);const u=r.length;if(l>=r[u-1])return s[u-1].evaluate(e);const d=Ss(r,l),f=Ri.interpolationFactor(this.interpolation,l,r[d],r[d+1]),g=s[d].evaluate(e),v=s[d+1].evaluate(e);switch(this.operator){case"interpolate":return Bi[this.type.kind](g,v,f);case"interpolate-hcl":return Bi.color(g,v,f,"hcl");case"interpolate-lab":return Bi.color(g,v,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ia(i,e,r,s){const l=s-r,u=i-r;return l===0?0:e===1?u/l:(Math.pow(e,u)-1)/(Math.pow(e,l)-1)}class As{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const u=[];for(const f of e.slice(1)){const g=r.parse(f,1+u.length,s,void 0,{typeAnnotation:"omit"});if(!g)return null;s=s||g.type,u.push(g)}if(!s)throw new Error("No output type");const d=l&&u.some(f=>cr(l,f.type));return new As(d?He:s,u)}evaluate(e){let r,s=null,l=0;for(const u of this.args)if(l++,s=u.evaluate(e),s&&s instanceof Wi&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ps{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let u=1;u=s.length)throw new Nt(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new Nt(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Hn{constructor(e,r){this.type=Ye,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,He),l=r.parse(e[2],2,He);return s&&l?N(s.type,[Ye,Qe,be,Ur,He])?new Hn(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(s.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!A(r,["boolean","string","number","null"]))throw new Nt(`Expected first argument to be of type boolean, string, number or null, but found ${St(Wt(r))} instead.`);if(!A(s,["string","array"]))throw new Nt(`Expected second argument to be of type array or string, but found ${St(Wt(s))} instead.`);return s.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class tn{constructor(e,r,s){this.type=be,this.needle=e,this.haystack=r,this.fromIndex=s}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,He),l=r.parse(e[2],2,He);if(!s||!l)return null;if(!N(s.type,[Ye,Qe,be,Ur,He]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(s.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,be);return u?new tn(s,l,u):null}return new tn(s,l)}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!A(r,["boolean","string","number","null"]))throw new Nt(`Expected first argument to be of type boolean, string, number or null, but found ${St(Wt(r))} instead.`);if(!A(s,["string","array"]))throw new Nt(`Expected second argument to be of type array or string, but found ${St(Wt(s))} instead.`);if(this.fromIndex){const l=this.fromIndex.evaluate(e);return s.indexOf(r,l)}return s.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class ht{constructor(e,r,s,l,u,d){this.inputType=e,this.type=r,this.input=s,this.cases=l,this.outputs=u,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const u={},d=[];for(let v=2;vNumber.MAX_SAFE_INTEGER)return P.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof z=="number"&&Math.floor(z)!==z)return P.error("Numeric branch labels must be integer values.");if(s){if(P.checkSubtype(s,Wt(z)))return null}else s=Wt(z);if(u[String(z)]!==void 0)return P.error("Branch labels must be unique.");u[String(z)]=d.length}const C=r.parse(S,v,l);if(!C)return null;l=l||C.type,d.push(C)}const f=r.parse(e[1],1,He);if(!f)return null;const g=r.parse(e[e.length-1],e.length-1,l);return g?f.type.kind!=="value"&&r.concat(1).checkSubtype(s,f.type)?null:new ht(s,l,f,u,d,g):null}evaluate(e){const r=this.input.evaluate(e);return(Wt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Pa{constructor(e,r,s){this.type=e,this.branches=r,this.otherwise=s}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class Ms{constructor(e,r,s,l){this.type=e,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,He),l=r.parse(e[2],2,be);if(!s||!l)return null;if(!N(s.type,[ui(He),Qe,He]))return r.error(`Expected first argument to be of type array or string, but found ${St(s.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,be);return u?new Ms(s.type,s,l,u):null}return new Ms(s.type,s,l)}evaluate(e){const r=this.input.evaluate(e),s=this.beginIndex.evaluate(e);if(!A(r,["string","array"]))throw new Nt(`Expected first argument to be of type array or string, but found ${St(Wt(r))} instead.`);if(this.endIndex){const l=this.endIndex.evaluate(e);return r.slice(s,l)}return r.slice(s)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Bo(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Ro(i,e,r,s){return s.compare(e,r)===0}function An(i,e,r){const s=i!=="=="&&i!=="!=";return class xd{constructor(u,d,f){this.type=Ye,this.lhs=u,this.rhs=d,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");const f=u[0];let g=d.parse(u[1],1,He);if(!g)return null;if(!Bo(f,g.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${St(g.type)}'.`);let v=d.parse(u[2],2,He);if(!v)return null;if(!Bo(f,v.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${St(v.type)}'.`);if(g.type.kind!==v.type.kind&&g.type.kind!=="value"&&v.type.kind!=="value")return d.error(`Cannot compare types '${St(g.type)}' and '${St(v.type)}'.`);s&&(g.type.kind==="value"&&v.type.kind!=="value"?g=new tr(v.type,[g]):g.type.kind!=="value"&&v.type.kind==="value"&&(v=new tr(g.type,[v])));let b=null;if(u.length===4){if(g.type.kind!=="string"&&v.type.kind!=="string"&&g.type.kind!=="value"&&v.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(u[3],3,Tr),!b)return null}return new xd(g,v,b)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(s&&this.hasUntypedArgument){const g=Wt(d),v=Wt(f);if(g.kind!==v.kind||g.kind!=="string"&&g.kind!=="number")throw new Nt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${v.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const g=Wt(d),v=Wt(f);if(g.kind!=="string"||v.kind!=="string")return e(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):e(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const Kl=An("==",function(i,e,r){return e===r},Ro),Yl=An("!=",function(i,e,r){return e!==r},function(i,e,r,s){return!Ro(0,e,r,s)}),Jl=An("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,s){return s.compare(e,r)>0}),ec=An("<=",function(i,e,r){return e<=r},function(i,e,r,s){return s.compare(e,r)<=0}),tc=An(">=",function(i,e,r){return e>=r},function(i,e,r,s){return s.compare(e,r)>=0});class Ma{constructor(e,r,s,l,u){this.type=Qe,this.number=e,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const s=r.parse(e[1],1,be);if(!s)return null;const l=e[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let u=null;if(l.locale&&(u=r.parse(l.locale,1,Qe),!u))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,Qe),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,be),!f))return null;let g=null;return l["max-fraction-digits"]&&(g=r.parse(l["max-fraction-digits"],1,be),!g)?null:new Ma(s,u,d,f,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Cs{constructor(e){this.type=Er,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let u=!1;for(let d=1;d<=e.length-1;++d){const f=e[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let g=null;if(f["font-scale"]&&(g=r.parse(f["font-scale"],1,be),!g))return null;let v=null;if(f["text-font"]&&(v=r.parse(f["text-font"],1,ui(Qe)),!v))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,Pi),!b))return null;const S=l[l.length-1];S.scale=g,S.font=v,S.textColor=b}else{const g=r.parse(e[d],1,He);if(!g)return null;const v=g.type.kind;if(v!=="string"&&v!=="value"&&v!=="null"&&v!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,l.push({content:g,scale:null,font:null,textColor:null})}}return new Cs(l)}evaluate(e){return new di(this.sections.map(r=>{const s=r.content.evaluate(e);return Wt(s)===Sr?new Vr("",s,null,null,null):new Vr(Gn(s),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class Ca{constructor(e){this.type=Sr,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const s=r.parse(e[1],1,Qe);return s?new Ca(s):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),s=Wi.fromString(r);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(r)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class ka{constructor(e){this.type=be,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=r.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${St(s.type)} instead.`):new ka(s):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Nt(`Expected value to be of type string or array, but found ${St(Wt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Pn={"==":Kl,"!=":Yl,">":Ql,"<":Jl,">=":tc,"<=":ec,array:tr,at:Aa,boolean:tr,case:Pa,coalesce:As,collator:mt,format:Cs,image:Ca,in:Hn,"index-of":tn,interpolate:Ri,"interpolate-hcl":Ri,"interpolate-lab":Ri,length:ka,let:Ps,literal:Nr,match:ht,number:tr,"number-format":Ma,object:tr,slice:Ms,step:Sn,string:tr,"to-boolean":pi,"to-color":pi,"to-number":pi,"to-string":pi,var:ws,within:Ir};function Fo(i,[e,r,s,l]){e=e.evaluate(i),r=r.evaluate(i),s=s.evaluate(i);const u=l?l.evaluate(i):1,d=Tn(e,r,s,u);if(d)throw new Nt(d);return new Ze(e/255,r/255,s/255,u,!1)}function Oo(i,e){return i in e}function za(i,e){const r=e[i];return r===void 0?null:r}function rn(i){return{type:i}}function Uo(i){return{result:"success",value:i}}function Mn(i){return{result:"error",value:i}}function Cn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Vo(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Da(i){return!!i.expression&&i.expression.interpolated}function _t(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function ks(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ic(i){return i}function No(i,e){const r=e.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),u=i.type||(Da(e)?"exponential":"interval");if(r||e.type==="padding"){const b=r?Ze.parse:Li.parse;(i=lr({},i)).stops&&(i.stops=i.stops.map(S=>[S[0],b(S[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,g,v;if(u==="exponential")f=$o;else if(u==="interval")f=La;else if(u==="categorical"){f=rc,g=Object.create(null);for(const b of i.stops)g[b[0]]=b[1];v=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=nc}if(s){const b={},S=[];for(let z=0;zz[0]),evaluate:({zoom:z},U)=>$o({stops:P,base:i.base},e,z).evaluate(z,U)}}if(l){const b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Ri.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(S=>S[0]),evaluate:({zoom:S})=>f(i,e,S,g,v)}}return{kind:"source",evaluate(b,S){const P=S&&S.properties?S.properties[i.property]:void 0;return P===void 0?Kn(i.default,e.default):f(i,e,P,g,v)}}}function Kn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function rc(i,e,r,s,l){return Kn(typeof r===l?s[r]:void 0,i.default,e.default)}function La(i,e,r){if(_t(r)!=="number")return Kn(i.default,e.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const l=Ss(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function $o(i,e,r){const s=i.base!==void 0?i.base:1;if(_t(r)!=="number")return Kn(i.default,e.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const u=Ss(i.stops.map(b=>b[0]),r),d=function(b,S,P,C){const z=C-P,U=b-P;return z===0?0:S===1?U/z:(Math.pow(S,U)-1)/(Math.pow(S,z)-1)}(r,s,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],g=i.stops[u+1][1],v=Bi[e.type]||ic;return typeof f.evaluate=="function"?{evaluate(...b){const S=f.evaluate.apply(void 0,b),P=g.evaluate.apply(void 0,b);if(S!==void 0&&P!==void 0)return v(S,P,d,i.colorSpace)}}:v(f,g,d,i.colorSpace)}function nc(i,e,r){switch(e.type){case"color":r=Ze.parse(r);break;case"formatted":r=di.fromString(r.toString());break;case"resolvedImage":r=Wi.fromString(r.toString());break;case"padding":r=Li.parse(r);break;default:_t(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return Kn(r,i.default,e.default)}Hi.register(Pn,{error:[{kind:"error"},[Qe],(i,[e])=>{throw new Nt(e.evaluate(i))}],typeof:[Qe,[He],(i,[e])=>St(Wt(e.evaluate(i)))],"to-rgba":[ui(be,4),[Pi],(i,[e])=>{const[r,s,l,u]=e.evaluate(i).rgb;return[255*r,255*s,255*l,u]}],rgb:[Pi,[be,be,be],Fo],rgba:[Pi,[be,be,be,be],Fo],has:{type:Ye,overloads:[[[Qe],(i,[e])=>Oo(e.evaluate(i),i.properties())],[[Qe,Qt],(i,[e,r])=>Oo(e.evaluate(i),r.evaluate(i))]]},get:{type:He,overloads:[[[Qe],(i,[e])=>za(e.evaluate(i),i.properties())],[[Qe,Qt],(i,[e,r])=>za(e.evaluate(i),r.evaluate(i))]]},"feature-state":[He,[Qe],(i,[e])=>za(e.evaluate(i),i.featureState||{})],properties:[Qt,[],i=>i.properties()],"geometry-type":[Qe,[],i=>i.geometryType()],id:[He,[],i=>i.id()],zoom:[be,[],i=>i.globals.zoom],"heatmap-density":[be,[],i=>i.globals.heatmapDensity||0],"line-progress":[be,[],i=>i.globals.lineProgress||0],accumulated:[He,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[be,rn(be),(i,e)=>{let r=0;for(const s of e)r+=s.evaluate(i);return r}],"*":[be,rn(be),(i,e)=>{let r=1;for(const s of e)r*=s.evaluate(i);return r}],"-":{type:be,overloads:[[[be,be],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[be],(i,[e])=>-e.evaluate(i)]]},"/":[be,[be,be],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[be,[be,be],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[be,[],()=>Math.LN2],pi:[be,[],()=>Math.PI],e:[be,[],()=>Math.E],"^":[be,[be,be],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[be,[be],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[be,[be],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[be,[be],(i,[e])=>Math.log(e.evaluate(i))],log2:[be,[be],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[be,[be],(i,[e])=>Math.sin(e.evaluate(i))],cos:[be,[be],(i,[e])=>Math.cos(e.evaluate(i))],tan:[be,[be],(i,[e])=>Math.tan(e.evaluate(i))],asin:[be,[be],(i,[e])=>Math.asin(e.evaluate(i))],acos:[be,[be],(i,[e])=>Math.acos(e.evaluate(i))],atan:[be,[be],(i,[e])=>Math.atan(e.evaluate(i))],min:[be,rn(be),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[be,rn(be),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[be,[be],(i,[e])=>Math.abs(e.evaluate(i))],round:[be,[be],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[be,[be],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[be,[be],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ye,[Qe,He],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ye,[He],(i,[e])=>i.id()===e.value],"filter-type-==":[Ye,[Qe],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s{const r=i.id(),s=e.value;return typeof r==typeof s&&r":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[Ye,[He],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>s}],"filter-<=":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[Ye,[He],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r<=s}],"filter->=":[Ye,[Qe,He],(i,[e,r])=>{const s=i.properties()[e.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[Ye,[He],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>=s}],"filter-has":[Ye,[He],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ye,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ye,[ui(Qe)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ye,[ui(He)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ye,[Qe,ui(He)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ye,[Qe,ui(He)],(i,[e,r])=>function(s,l,u,d){for(;u<=d;){const f=u+d>>1;if(l[f]===s)return!0;l[f]>s?d=f-1:u=f+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[rn(Ye),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[rn(Ye),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ye,[Ye],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ye,[Qe],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Qe,[Qe],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Qe,[Qe],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Qe,rn(He),(i,e)=>e.map(r=>Gn(r.evaluate(i))).join("")],"resolved-locale":[Qe,[Tr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Ba{constructor(e,r){var s;this.expression=e,this._warningHistory={},this._evaluator=new vs,this._defaultValue=r?(s=r).type==="color"&&ks(s.default)?new Ze(0,0,0,0):s.type==="color"?Ze.parse(s.default)||null:s.type==="padding"?Li.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,s,l,u,d){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,r,s,l,u,d){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new Nt(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function zs(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Pn}function Dt(i,e){const r=new $r(Pn,Ts,[],e?function(l){const u={color:Pi,string:Qe,number:be,enum:Qe,boolean:Ye,formatted:Er,padding:er,resolvedImage:Sr};return l.type==="array"?ui(u[l.value]||He,l.length):u[l.type]}(e):void 0),s=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Uo(new Ba(s,e)):Mn(r.errors)}class Ra{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!En(r.expression)}evaluateWithoutErrorHandling(e,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,u,d)}evaluate(e,r,s,l,u,d){return this._styleExpression.evaluate(e,r,s,l,u,d)}}class st{constructor(e,r,s,l){this.kind=e,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!En(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(e,r,s,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,l,u,d)}evaluate(e,r,s,l,u,d){return this._styleExpression.evaluate(e,r,s,l,u,d)}interpolationFactor(e,r,s){return this.interpolationType?Ri.interpolationFactor(this.interpolationType,e,r,s):0}}function Ds(i,e){const r=Dt(i,e);if(r.result==="error")return r;const s=r.value.expression,l=Wn(s);if(!l&&!Cn(e))return Mn([new fi("","data expressions not supported")]);const u=Es(s,["zoom"]);if(!u&&!Vo(e))return Mn([new fi("","zoom expressions not supported")]);const d=Et(s);return d||u?d instanceof fi?Mn([d]):d instanceof Ri&&!Da(e)?Mn([new fi("",'"interpolate" expressions cannot be used with this property')]):Uo(d?new st(l?"camera":"composite",r.value,d.labels,d instanceof Ri?d.interpolation:void 0):new Ra(l?"constant":"source",r.value)):Mn([new fi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class It{constructor(e,r){this._parameters=e,this._specification=r,lr(this,No(this._parameters,this._specification))}static deserialize(e){return new It(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Et(i){let e=null;if(i instanceof Ps)e=Et(i.result);else if(i instanceof As){for(const r of i.args)if(e=Et(r),e)break}else(i instanceof Sn||i instanceof Ri)&&i.input instanceof Hi&&i.input.name==="zoom"&&(e=i);return e instanceof fi||i.eachChild(r=>{const s=Et(r);s instanceof fi?e=s:!e&&s?e=new fi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new fi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function kn(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!kn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const qo={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Fa(i){if(i==null)return{filter:()=>!0,needGeometry:!1};kn(i)||(i=Ls(i));const e=Dt(i,qo);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>e.value.evaluate(r,s,{},l),needGeometry:jo(i)}}function sc(i,e){return ie?1:0}function jo(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Bs(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Ls))):e==="all"?["all"].concat(i.slice(1).map(Ls)):e==="none"?["all"].concat(i.slice(1).map(Ls).map(Yn)):e==="in"?Oa(i[1],i.slice(2)):e==="!in"?Yn(Oa(i[1],i.slice(2))):e==="has"?Ua(i[1]):e==="!has"?Yn(Ua(i[1])):e!=="within"||i;var r}function Bs(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Oa(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(sc)]]:["filter-in-small",i,["literal",e]]}}function Ua(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Yn(i){return["!",i]}function Jn(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const u of i)l+=`${Jn(u)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new we(e,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function Xo(i){const e=i.valueSpec,r=$t(i.value.type);let s,l,u,d={};const f=r!=="categorical"&&i.value.property===void 0,g=!f,v=_t(i.value.stops)==="array"&&_t(i.value.stops[0])==="array"&&_t(i.value.stops[0][0])==="object",b=Ki({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new we(C.key,C.value,'identity function may not have a "stops" property')];let z=[];const U=C.value;return z=z.concat(Go({key:C.key,value:U,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:S})),_t(U)==="array"&&U.length===0&&z.push(new we(C.key,U,"array must have at least one stop")),z},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new we(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new we(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Da(i.valueSpec)&&b.push(new we(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!Cn(i.valueSpec)?b.push(new we(i.key,i.value,"property functions not supported")):f&&!Vo(i.valueSpec)&&b.push(new we(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!v||i.value.property!==void 0||b.push(new we(i.key,i.value,'"property" property is required')),b;function S(C){let z=[];const U=C.value,F=C.key;if(_t(U)!=="array")return[new we(F,U,`array expected, ${_t(U)} found`)];if(U.length!==2)return[new we(F,U,`array length 2 expected, length ${U.length} found`)];if(v){if(_t(U[0])!=="object")return[new we(F,U,`object expected, ${_t(U[0])} found`)];if(U[0].zoom===void 0)return[new we(F,U,"object stop key must have zoom")];if(U[0].value===void 0)return[new we(F,U,"object stop key must have value")];if(u&&u>$t(U[0].zoom))return[new we(F,U[0].zoom,"stop zoom values must appear in ascending order")];$t(U[0].zoom)!==u&&(u=$t(U[0].zoom),l=void 0,d={}),z=z.concat(Ki({key:`${F}[0]`,value:U[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Va,value:P}}))}else z=z.concat(P({key:`${F}[0]`,value:U[0],valueSpec:{},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},U));return zs(nn(U[1]))?z.concat([new we(`${F}[1]`,U[1],"expressions are not allowed in function stops.")]):z.concat(C.validateSpec({key:`${F}[1]`,value:U[1],valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function P(C,z){const U=_t(C.value),F=$t(C.value),K=C.value!==null?C.value:z;if(s){if(U!==s)return[new we(C.key,K,`${U} stop domain type must match previous stop domain type ${s}`)]}else s=U;if(U!=="number"&&U!=="string"&&U!=="boolean")return[new we(C.key,K,"stop domain value must be a number, string, or boolean")];if(U!=="number"&&r!=="categorical"){let Q=`number expected, ${U} found`;return Cn(e)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new we(C.key,K,Q)]}return r!=="categorical"||U!=="number"||isFinite(F)&&Math.floor(F)===F?r!=="categorical"&&U==="number"&&l!==void 0&&Fnew we(`${i.key}${s.key}`,i.value,s.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new we(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!En(r))return[new we(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!En(r))return[new we(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Es(r,["zoom","feature-state"]))return[new we(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Wn(r))return[new we(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qn(i){const e=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf($t(r))===-1&&l.push(new we(e,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf($t(r))===-1&&l.push(new we(e,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function zn(i){return kn(nn(i.value))?sn(lr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wo(i)}function Wo(i){const e=i.value,r=i.key;if(_t(e)!=="array")return[new we(r,e,`array expected, ${_t(e)} found`)];const s=i.styleSpec;let l,u=[];if(e.length<1)return[new we(r,e,"filter array must have at least 1 element")];switch(u=u.concat(Qn({key:`${r}[0]`,value:e[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),$t(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&$t(e[1])==="$type"&&u.push(new we(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new we(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(l=_t(e[1]),l!=="string"&&u.push(new we(`${r}[1]`,e[1],`string expected, ${l} found`)));for(let d=2;d{v in r&&e.push(new we(s,r[v],`"${v}" is prohibited for ref layers`))}),l.layers.forEach(v=>{$t(v.id)===f&&(g=v)}),g?g.ref?e.push(new we(s,r.ref,"ref cannot reference another ref layer")):d=$t(g.type):e.push(new we(s,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const g=l.sources&&l.sources[r.source],v=g&&$t(g.type);g?v==="vector"&&d==="raster"?e.push(new we(s,r.source,`layer "${r.id}" requires a raster source`)):v==="raster"&&d!=="raster"?e.push(new we(s,r.source,`layer "${r.id}" requires a vector source`)):v!=="vector"||r["source-layer"]?v==="raster-dem"&&d!=="hillshade"?e.push(new we(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||v==="geojson"&&g.lineMetrics||e.push(new we(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new we(s,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new we(s,r.source,`source "${r.source}" not found`))}else e.push(new we(s,r,'missing required property "source"'));return e=e.concat(Ki({key:s,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:zn,layout:g=>Ki({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":v=>Ho(lr({layerType:d},v))}}),paint:g=>Ki({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":v=>$a(lr({layerType:d},v))}})}})),e}function hr(i){const e=i.value,r=i.key,s=_t(e);return s!=="string"?[new we(r,e,`string expected, ${s} found`)]:[]}const Fs={promoteId:function({key:i,value:e}){if(_t(e)==="string")return hr({key:i,value:e});{const r=[];for(const s in e)r.push(...hr({key:`${i}.${s}`,value:e[s]}));return r}}};function Os(i){const e=i.value,r=i.key,s=i.styleSpec,l=i.style,u=i.validateSpec;if(!e.type)return[new we(r,e,'"type" is required')];const d=$t(e.type);let f;switch(d){case"vector":case"raster":case"raster-dem":return f=Ki({key:r,value:e,valueSpec:s[`source_${d.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:Fs,validateSpec:u}),f;case"geojson":if(f=Ki({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s,validateSpec:u,objectElementValidators:Fs}),e.cluster)for(const g in e.clusterProperties){const[v,b]=e.clusterProperties[g],S=typeof v=="string"?[v,["accumulated"],["get",g]]:v;f.push(...sn({key:`${r}.${g}.map`,value:b,validateSpec:u,expressionContext:"cluster-map"})),f.push(...sn({key:`${r}.${g}.reduce`,value:S,validateSpec:u,expressionContext:"cluster-reduce"}))}return f;case"video":return Ki({key:r,value:e,valueSpec:s.source_video,style:l,validateSpec:u,styleSpec:s});case"image":return Ki({key:r,value:e,valueSpec:s.source_image,style:l,validateSpec:u,styleSpec:s});case"canvas":return[new we(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Qn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:u,styleSpec:s})}}function Ko(i){const e=i.value,r=i.styleSpec,s=r.light,l=i.style;let u=[];const d=_t(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new we("light",e,`object expected, ${d} found`)]),u;for(const f in e){const g=f.match(/^(.*)-transition$/);u=u.concat(g&&s[g[1]]&&s[g[1]].transition?i.validateSpec({key:f,value:e[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):s[f]?i.validateSpec({key:f,value:e[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new we(f,e[f],`unknown property "${f}"`)])}return u}function es(i){const e=i.value,r=i.styleSpec,s=r.terrain,l=i.style;let u=[];const d=_t(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new we("terrain",e,`object expected, ${d} found`)]),u;for(const f in e)u=u.concat(s[f]?i.validateSpec({key:f,value:e[f],valueSpec:s[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new we(f,e[f],`unknown property "${f}"`)]);return u}function Yo(i){let e=[];const r=i.value,s=i.key;if(Array.isArray(r)){const l=[],u=[];for(const d in r)r[d].id&&l.includes(r[d].id)&&e.push(new we(s,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),l.push(r[d].id),r[d].url&&u.includes(r[d].url)&&e.push(new we(s,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),u.push(r[d].url),e=e.concat(Ki({key:`${s}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return hr({key:s,value:r})}const Jo={"*":()=>[],array:Go,boolean:function(i){const e=i.value,r=i.key,s=_t(e);return s!=="boolean"?[new we(r,e,`boolean expected, ${s} found`)]:[]},number:Va,color:function(i){const e=i.key,r=i.value,s=_t(r);return s!=="string"?[new we(e,r,`color expected, ${s} found`)]:Ze.parse(String(r))?[]:[new we(e,r,`color expected, "${r}" found`)]},constants:Zo,enum:Qn,filter:zn,function:Xo,layer:Rs,object:Ki,source:Os,light:Ko,terrain:es,string:hr,formatted:function(i){return hr(i).length===0?[]:sn(i)},resolvedImage:function(i){return hr(i).length===0?[]:sn(i)},padding:function(i){const e=i.key,r=i.value;if(_t(r)==="array"){if(r.length<1||r.length>4)return[new we(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let l=[];for(let u=0;u[]}})),i.constants&&(r=r.concat(Zo({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:ts}))),is(r)}function Yi(i){return function(e){return i({...e,validateSpec:ts})}}function is(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Ht(i){return function(...e){return is(i.apply(this,e))}}ur.source=Ht(Yi(Os)),ur.sprite=Ht(Yi(Yo)),ur.glyphs=Ht(Yi(Qo)),ur.light=Ht(Yi(Ko)),ur.terrain=Ht(Yi(es)),ur.layer=Ht(Yi(Rs)),ur.filter=Ht(Yi(zn)),ur.paintProperty=Ht(Yi($a)),ur.layoutProperty=Ht(Yi(Ho));const jr=ur,oc=jr.light,lc=jr.paintProperty,cc=jr.layoutProperty;function Dn(i,e){let r=!1;if(e&&e.length)for(const s of e)i.fire(new Xi(new Error(s.message))),r=!0;return r}class rs{constructor(e,r,s){const l=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const d=new Int32Array(this.arrayBuffer);e=d[0],this.d=(r=d[1])+2*(s=d[2]);for(let g=0;g=S[z+0]&&l>=S[z+1])?(f[C]=!0,d.push(b[C])):f[C]=!1}}}}_forEachCell(e,r,s,l,u,d,f,g){const v=this._convertToCellCoord(e),b=this._convertToCellCoord(r),S=this._convertToCellCoord(s),P=this._convertToCellCoord(l);for(let C=v;C<=S;C++)for(let z=b;z<=P;z++){const U=this.d*z+C;if((!g||g(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&u.call(this,e,r,s,l,U,d,f,g))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let s=0;for(let d=0;d=0)continue;const d=i[u];l[u]=dr[s].shallow.indexOf(u)>=0?d:ns(d,e)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof i)}function Ar(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Us(i)||Hr(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Ar);if(typeof i=="object"){const e=i.$name||"Object";if(!dr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=dr[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const u=i[l];s[l]=dr[e].shallow.indexOf(l)>=0?u:Ar(u)}return s}throw new Error("can't deserialize object of type "+typeof i)}class el{constructor(){this.first=!0}update(e,r){const s=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Vs(i){for(const e of i)if(Ns(e.charCodeAt(0)))return!0;return!1}function qa(i){for(const e of i)if(!tl(e.charCodeAt(0)))return!1;return!0}function tl(i){return!(Ae.Arabic(i)||Ae["Arabic Supplement"](i)||Ae["Arabic Extended-A"](i)||Ae["Arabic Presentation Forms-A"](i)||Ae["Arabic Presentation Forms-B"](i))}function Ns(i){return!(i!==746&&i!==747&&(i<4352||!(Ae["Bopomofo Extended"](i)||Ae.Bopomofo(i)||Ae["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Ae["CJK Compatibility Ideographs"](i)||Ae["CJK Compatibility"](i)||Ae["CJK Radicals Supplement"](i)||Ae["CJK Strokes"](i)||!(!Ae["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Ae["CJK Unified Ideographs Extension A"](i)||Ae["CJK Unified Ideographs"](i)||Ae["Enclosed CJK Letters and Months"](i)||Ae["Hangul Compatibility Jamo"](i)||Ae["Hangul Jamo Extended-A"](i)||Ae["Hangul Jamo Extended-B"](i)||Ae["Hangul Jamo"](i)||Ae["Hangul Syllables"](i)||Ae.Hiragana(i)||Ae["Ideographic Description Characters"](i)||Ae.Kanbun(i)||Ae["Kangxi Radicals"](i)||Ae["Katakana Phonetic Extensions"](i)||Ae.Katakana(i)&&i!==12540||!(!Ae["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Ae["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Ae["Unified Canadian Aboriginal Syllabics"](i)||Ae["Unified Canadian Aboriginal Syllabics Extended"](i)||Ae["Vertical Forms"](i)||Ae["Yijing Hexagram Symbols"](i)||Ae["Yi Syllables"](i)||Ae["Yi Radicals"](i))))}function il(i){return!(Ns(i)||function(e){return!!(Ae["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Ae["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Ae["Letterlike Symbols"](e)||Ae["Number Forms"](e)||Ae["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ae["Control Pictures"](e)&&e!==9251||Ae["Optical Character Recognition"](e)||Ae["Enclosed Alphanumerics"](e)||Ae["Geometric Shapes"](e)||Ae["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Ae["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ae["CJK Symbols and Punctuation"](e)||Ae.Katakana(e)||Ae["Private Use Area"](e)||Ae["CJK Compatibility Forms"](e)||Ae["Small Form Variants"](e)||Ae["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function $s(i){return i>=1424&&i<=2303||Ae["Arabic Presentation Forms-A"](i)||Ae["Arabic Presentation Forms-B"](i)}function qs(i,e){return!(!e&&$s(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Ae.Khmer(i))}function rl(i){for(const e of i)if($s(e.charCodeAt(0)))return!0;return!1}const ja="deferred",js="loading",Za="loaded";let ss=null,Mi="unavailable",Zr=null;const nl=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(Mi="error"),ss&&ss(i)};function Ga(){Zs.fire(new wr("pluginStateChange",{pluginStatus:Mi,pluginURL:Zr}))}const Zs=new vn,Xa=function(){return Mi},sl=function(){if(Mi!==ja||!Zr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Mi=js,Ga(),Zr&&xn({url:Zr},i=>{i?nl(i):(Mi=Za,Ga())})},Ji={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Mi===Za||Ji.applyArabicShaping!=null,isLoading:()=>Mi===js,setState(i){if(!Zi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Mi=i.pluginStatus,Zr=i.pluginURL},isParsed(){if(!Zi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ji.applyArabicShaping!=null&&Ji.processBidirectionalText!=null&&Ji.processStyledBidirectionalText!=null},getPluginURL(){if(!Zi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Zr}};class kt{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new el,this.transition={})}isSupportedScript(e){return function(r,s){for(const l of r)if(!qs(l.charCodeAt(0),s))return!1;return!0}(e,Ji.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),s=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class Gs{constructor(e,r){this.property=e,this.value=r,this.expression=function(s,l){if(ks(s))return new It(s,l);if(zs(s)){const u=Ds(s,l);if(u.result==="error")throw new Error(u.value.map(d=>`${d.key}: ${d.message}`).join(", "));return u.value}{let u=s;return l.type==="color"&&typeof s=="string"?u=Ze.parse(s):l.type!=="padding"||typeof s!="number"&&!Array.isArray(s)||(u=Li.parse(s)),{kind:"constant",evaluate:()=>u}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,s){return this.property.possiblyEvaluate(this,e,r,s)}}class Wa{constructor(e){this.property=e,this.value=new Gs(e,void 0)}transitioned(e,r){return new as(this.property,this.value,r,pt({},e.transition,this.transition),e.now)}untransitioned(){return new as(this.property,this.value,null,{},0)}}class al{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Ct(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Wa(this._values[e].property)),this._values[e].value=new Gs(this._values[e].property,r===null?void 0:Ct(r))}getTransition(e){return Ct(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Wa(this._values[e].property)),this._values[e].transition=Ct(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s);const l=this.getTransition(r);l!==void 0&&(e[`${r}-transition`]=l)}return e}transitioned(e,r){const s=new ol(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].transitioned(e,r._values[l]);return s}untransitioned(){const e=new ol(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class as{constructor(e,r,s,l,u){this.property=e,this.value=r,this.begin=u+l.delay||0,this.end=this.begin+l.duration||0,e.specification.transition&&(l.delay||l.duration)&&(this.prior=s)}possiblyEvaluate(e,r,s){const l=e.now||0,u=this.value.possiblyEvaluate(e,r,s),d=this.prior;if(d){if(l>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(l=1)return 1;const v=g*g,b=v*g;return 4*(g<.5?b:3*(g-v)+b-.75)}(f))}}return u}}class ol{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,s){const l=new Xs(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,s);return l}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ha{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return Ct(this._values[e].value)}setValue(e,r){this._values[e]=new Gs(this._values[e].property,r===null?void 0:Ct(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s)}return e}possiblyEvaluate(e,r,s){const l=new Xs(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,s);return l}}class pr{constructor(e,r,s){this.property=e,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,s,l){return this.property.evaluate(this.value,this.parameters,e,r,s,l)}}class Xs{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Fe{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,s){const l=Bi[this.specification.type];return l?l(e,r,s):e}}class qe{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,s,l){return new pr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},s,l)}:e.expression,r)}interpolate(e,r,s){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new pr(this,{kind:"constant",value:void 0},e.parameters);const l=Bi[this.specification.type];if(l){const u=l(e.value.value,r.value.value,s);return new pr(this,{kind:"constant",value:u},e.parameters)}return e}evaluate(e,r,s,l,u,d){return e.kind==="constant"?e.value:e.evaluate(r,s,l,u,d)}}class os extends qe{possiblyEvaluate(e,r,s,l){if(e.value===void 0)return new pr(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},s,l),d=e.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,f=this._calculate(d,d,d,r);return new pr(this,{kind:"constant",value:f},r)}if(e.expression.kind==="camera"){const u=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new pr(this,{kind:"constant",value:u},r)}return new pr(this,e.expression,r)}evaluate(e,r,s,l,u,d){if(e.kind==="source"){const f=e.evaluate(r,s,l,u,d);return this._calculate(f,f,f,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},s,l),e.evaluate({zoom:Math.floor(r.zoom)},s,l),e.evaluate({zoom:Math.floor(r.zoom)+1},s,l),r):e.value}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Ka{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){if(e.value!==void 0){if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},s,l);return this._calculate(u,u,u,r)}return this._calculate(e.expression.evaluate(new kt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new kt(Math.floor(r.zoom),r)),e.expression.evaluate(new kt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,s,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class Ya{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,l){return!!e.expression.evaluate(r,null,{},s,l)}interpolate(){return!1}}class Ci{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const s=e[r];s.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new Gs(s,void 0),u=this.defaultTransitionablePropertyValues[r]=new Wa(s);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}De("DataDrivenProperty",qe),De("DataConstantProperty",Fe),De("CrossFadedDataDrivenProperty",os),De("CrossFadedProperty",Ka),De("ColorRampProperty",Ya);const ll="-transition";class fr extends vn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Ha(r.layout)),r.paint)){this._transitionablePaint=new al(r.paint);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Xs(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,s={}){r!=null&&this._validate(cc,`layers.${this.id}.layout.${e}`,e,r,s)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(ll)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,s={}){if(r!=null&&this._validate(lc,`layers.${this.id}.paint.${e}`,e,r,s))return!1;if(e.endsWith(ll))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[e],u=l.property.specification["property-type"]==="cross-faded-data-driven",d=l.value.isDataDriven(),f=l.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const g=this._transitionablePaint._values[e].value;return g.isDataDriven()||d||u||this._handleOverridablePaintPropertyUpdate(e,f,g)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,s){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Mt(e,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(e,r,s,l,u={}){return(!u||u.validate!==!1)&&Dn(this,e.call(jr,{key:r,layerType:this.type,objectKey:s,value:l,styleSpec:le,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof pr&&Cn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const hc={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Pr{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ft{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Kt(i,e=1){let r=0,s=0;return{members:i.map(l=>{const u=hc[l.type].BYTES_PER_ELEMENT,d=r=cl(r,Math.max(e,u)),f=l.components||1;return s=Math.max(s,u),r+=u*f,{name:l.name,type:l.type,components:f,offset:d}}),size:cl(r,Math.max(s,e)),alignment:e}}function cl(i,e){return Math.ceil(i/e)*e}class Ln extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.int16[l+0]=r,this.int16[l+1]=s,e}}Ln.prototype.bytesPerElement=4,De("StructArrayLayout2i4",Ln);class Ws extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.int16[u+0]=r,this.int16[u+1]=s,this.int16[u+2]=l,e}}Ws.prototype.bytesPerElement=6,De("StructArrayLayout3i6",Ws);class Ja extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const d=4*e;return this.int16[d+0]=r,this.int16[d+1]=s,this.int16[d+2]=l,this.int16[d+3]=u,e}}Ja.prototype.bytesPerElement=8,De("StructArrayLayout4i8",Ja);class mr extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,d)}emplace(e,r,s,l,u,d,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=d,this.int16[g+5]=f,e}}mr.prototype.bytesPerElement=12,De("StructArrayLayout2i4i12",mr);class Hs extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,d)}emplace(e,r,s,l,u,d,f){const g=4*e,v=8*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.uint8[v+4]=l,this.uint8[v+5]=u,this.uint8[v+6]=d,this.uint8[v+7]=f,e}}Hs.prototype.bytesPerElement=8,De("StructArrayLayout2i4ub8",Hs);class an extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.float32[l+0]=r,this.float32[l+1]=s,e}}an.prototype.bytesPerElement=8,De("StructArrayLayout2f8",an);class Ks extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b){const S=this.length;return this.resize(S+1),this.emplace(S,e,r,s,l,u,d,f,g,v,b)}emplace(e,r,s,l,u,d,f,g,v,b,S){const P=10*e;return this.uint16[P+0]=r,this.uint16[P+1]=s,this.uint16[P+2]=l,this.uint16[P+3]=u,this.uint16[P+4]=d,this.uint16[P+5]=f,this.uint16[P+6]=g,this.uint16[P+7]=v,this.uint16[P+8]=b,this.uint16[P+9]=S,e}}Ks.prototype.bytesPerElement=20,De("StructArrayLayout10ui20",Ks);class ls extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b,S,P){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,s,l,u,d,f,g,v,b,S,P)}emplace(e,r,s,l,u,d,f,g,v,b,S,P,C){const z=12*e;return this.int16[z+0]=r,this.int16[z+1]=s,this.int16[z+2]=l,this.int16[z+3]=u,this.uint16[z+4]=d,this.uint16[z+5]=f,this.uint16[z+6]=g,this.uint16[z+7]=v,this.int16[z+8]=b,this.int16[z+9]=S,this.int16[z+10]=P,this.int16[z+11]=C,e}}ls.prototype.bytesPerElement=24,De("StructArrayLayout4i4ui4i24",ls);class Qa extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.float32[u+0]=r,this.float32[u+1]=s,this.float32[u+2]=l,e}}Qa.prototype.bytesPerElement=12,De("StructArrayLayout3f12",Qa);class Bn extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}Bn.prototype.bytesPerElement=4,De("StructArrayLayout1ul4",Bn);class on extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,s,l,u,d,f,g,v)}emplace(e,r,s,l,u,d,f,g,v,b){const S=10*e,P=5*e;return this.int16[S+0]=r,this.int16[S+1]=s,this.int16[S+2]=l,this.int16[S+3]=u,this.int16[S+4]=d,this.int16[S+5]=f,this.uint32[P+3]=g,this.uint16[S+8]=v,this.uint16[S+9]=b,e}}on.prototype.bytesPerElement=20,De("StructArrayLayout6i1ul2ui20",on);class eo extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,s,l,u,d)}emplace(e,r,s,l,u,d,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=d,this.int16[g+5]=f,e}}eo.prototype.bytesPerElement=12,De("StructArrayLayout2i2i2i12",eo);class Ys extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,s,l,u)}emplace(e,r,s,l,u,d){const f=4*e,g=8*e;return this.float32[f+0]=r,this.float32[f+1]=s,this.float32[f+2]=l,this.int16[g+6]=u,this.int16[g+7]=d,e}}Ys.prototype.bytesPerElement=16,De("StructArrayLayout2f1f2i16",Ys);class ln extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const d=12*e,f=3*e;return this.uint8[d+0]=r,this.uint8[d+1]=s,this.float32[f+1]=l,this.float32[f+2]=u,e}}ln.prototype.bytesPerElement=12,De("StructArrayLayout2ub2f12",ln);class Js extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=3*e;return this.uint16[u+0]=r,this.uint16[u+1]=s,this.uint16[u+2]=l,e}}Js.prototype.bytesPerElement=6,De("StructArrayLayout3ui6",Js);class to extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K)}emplace(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q){const X=24*e,ne=12*e,ae=48*e;return this.int16[X+0]=r,this.int16[X+1]=s,this.uint16[X+2]=l,this.uint16[X+3]=u,this.uint32[ne+2]=d,this.uint32[ne+3]=f,this.uint32[ne+4]=g,this.uint16[X+10]=v,this.uint16[X+11]=b,this.uint16[X+12]=S,this.float32[ne+7]=P,this.float32[ne+8]=C,this.uint8[ae+36]=z,this.uint8[ae+37]=U,this.uint8[ae+38]=F,this.uint32[ne+10]=K,this.int16[X+22]=Q,e}}to.prototype.bytesPerElement=48,De("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",to);class Qs extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q,X,ne,ae,he,ze,Be,Pe,Se,Te,Me){const Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q,X,ne,ae,he,ze,Be,Pe,Se,Te,Me)}emplace(e,r,s,l,u,d,f,g,v,b,S,P,C,z,U,F,K,Q,X,ne,ae,he,ze,Be,Pe,Se,Te,Me,Ie){const ye=34*e,Ve=17*e;return this.int16[ye+0]=r,this.int16[ye+1]=s,this.int16[ye+2]=l,this.int16[ye+3]=u,this.int16[ye+4]=d,this.int16[ye+5]=f,this.int16[ye+6]=g,this.int16[ye+7]=v,this.uint16[ye+8]=b,this.uint16[ye+9]=S,this.uint16[ye+10]=P,this.uint16[ye+11]=C,this.uint16[ye+12]=z,this.uint16[ye+13]=U,this.uint16[ye+14]=F,this.uint16[ye+15]=K,this.uint16[ye+16]=Q,this.uint16[ye+17]=X,this.uint16[ye+18]=ne,this.uint16[ye+19]=ae,this.uint16[ye+20]=he,this.uint16[ye+21]=ze,this.uint16[ye+22]=Be,this.uint32[Ve+12]=Pe,this.float32[Ve+13]=Se,this.float32[Ve+14]=Te,this.float32[Ve+15]=Me,this.float32[Ve+16]=Ie,e}}Qs.prototype.bytesPerElement=68,De("StructArrayLayout8i15ui1ul4f68",Qs);class ea extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}ea.prototype.bytesPerElement=4,De("StructArrayLayout1f4",ea);class ta extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,s)}emplace(e,r,s,l){const u=4*e;return this.uint32[2*e+0]=r,this.uint16[u+2]=s,this.uint16[u+3]=l,e}}ta.prototype.bytesPerElement=8,De("StructArrayLayout1ul2ui8",ta);class o extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const l=2*e;return this.uint16[l+0]=r,this.uint16[l+1]=s,e}}o.prototype.bytesPerElement=4,De("StructArrayLayout2ui4",o);class t extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}t.prototype.bytesPerElement=2,De("StructArrayLayout1ui2",t);class n extends Ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,s,l)}emplace(e,r,s,l,u){const d=4*e;return this.float32[d+0]=r,this.float32[d+1]=s,this.float32[d+2]=l,this.float32[d+3]=u,e}}n.prototype.bytesPerElement=16,De("StructArrayLayout4f16",n);class a extends Pr{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new xe(this.anchorPointX,this.anchorPointY)}}a.prototype.size=20;class c extends on{get(e){return new a(this,e)}}De("CollisionBoxArray",c);class p extends Pr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}p.prototype.size=48;class m extends to{get(e){return new p(this,e)}}De("PlacedSymbolArray",m);class y extends Pr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}y.prototype.size=68;class _ extends Qs{get(e){return new y(this,e)}}De("SymbolInstanceArray",_);class x extends ea{getoffsetX(e){return this.float32[1*e+0]}}De("GlyphOffsetArray",x);class T extends Ws{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}De("SymbolLineVertexArray",T);class w extends Pr{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]}}w.prototype.size=8;class k extends ta{get(e){return new w(this,e)}}De("FeatureIndexArray",k);class O extends Ln{}class B extends Ln{}class R extends Ln{}class q extends mr{}class H extends Hs{}class se extends an{}class $ extends Ks{}class re extends ls{}class oe extends Qa{}class me extends Bn{}class _e extends eo{}class ve extends ln{}class ge extends Js{}class Ce extends o{}const Ue=Kt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ke}=Ue;class Ee{constructor(e=[]){this.segments=e}prepareSegment(e,r,s,l){let u=this.segments[this.segments.length-1];return e>Ee.MAX_VERTEX_ARRAY_LENGTH&&Vt(`Max vertices per segment is ${Ee.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!u||u.vertexLength+e>Ee.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==l)&&(u={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},l!==void 0&&(u.sortKey=l),this.segments.push(u)),u}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,s,l){return new Ee([{vertexOffset:e,primitiveOffset:r,vertexLength:s,primitiveLength:l,vaos:{},sortKey:0}])}}function je(i,e){return 256*(i=et(Math.floor(i),0,255))+et(Math.floor(e),0,255)}Ee.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,De("SegmentVector",Ee);const ke=Kt([{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 ut={exports:{}},qt={exports:{}};qt.exports=function(i,e){var r,s,l,u,d,f,g,v;for(s=i.length-(r=3&i.length),l=e,d=3432918353,f=461845907,v=0;v>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>16)*f&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(g=0,r){case 3:g^=(255&i.charCodeAt(v+2))<<16;case 2:g^=(255&i.charCodeAt(v+1))<<8;case 1:l^=g=(65535&(g=(g=(65535&(g^=255&i.charCodeAt(v)))*d+(((g>>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>16)*f&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var dt=qt.exports,Je={exports:{}};Je.exports=function(i,e){for(var r,s=i.length,l=e^s,u=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++u;switch(s){case 3:l^=(255&i.charCodeAt(u+2))<<16;case 2:l^=(255&i.charCodeAt(u+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(u)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var Ot=dt,wi=Je.exports;ut.exports=Ot,ut.exports.murmur3=Ot,ut.exports.murmur2=wi;var jt=ce(ut.exports);class si{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,s,l){this.ids.push(Fi(e)),this.positions.push(r,s,l)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Fi(e);let s=0,l=this.ids.length-1;for(;s>1;this.ids[d]>=r?l=d:s=d+1}const u=[];for(;this.ids[s]===r;)u.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return u}static serialize(e,r){const s=new Float64Array(e.ids),l=new Uint32Array(e.positions);return ir(s,l,0,s.length-1),r&&r.push(s.buffer,l.buffer),{ids:s,positions:l}}static deserialize(e){const r=new si;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Fi(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:jt(String(i))}function ir(i,e,r,s){for(;r>1];let u=r-1,d=s+1;for(;;){do u++;while(i[u]l);if(u>=d)break;rr(i,u,d),rr(e,3*u,3*d),rr(e,3*u+1,3*d+1),rr(e,3*u+2,3*d+2)}d-r`u_${l}`),this.type=s}setUniform(e,r,s){e.set(s.constantOr(this.value))}getBinding(e,r,s){return this.type==="color"?new mi(e,r):new gr(e,r)}}class oi{constructor(e,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,s,l){const u=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)}getBinding(e,r,s){return s.substr(0,9)==="u_pattern"?new cs(e,r):new gr(e,r)}}class gt{constructor(e,r,s,l){this.expression=e,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(e,r,s,l,u){const d=this.paintVertexArray.length,f=this.expression.evaluate(new kt(0),r,{},l,[],u);this.paintVertexArray.resize(e),this._setPaintValue(d,e,f)}updatePaintArray(e,r,s,l){const u=this.expression.evaluate({zoom:0},s,l);this._setPaintValue(e,r,u)}_setPaintValue(e,r,s){if(this.type==="color"){const l=ft(s);for(let u=e;u`u_${f}_t`),this.type=s,this.useIntegerZoom=l,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(e,r,s,l,u){const d=this.expression.evaluate(new kt(this.zoom),r,{},l,[],u),f=this.expression.evaluate(new kt(this.zoom+1),r,{},l,[],u),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,d,f)}updatePaintArray(e,r,s,l){const u=this.expression.evaluate({zoom:this.zoom},s,l),d=this.expression.evaluate({zoom:this.zoom+1},s,l);this._setPaintValue(e,r,u,d)}_setPaintValue(e,r,s,l){if(this.type==="color"){const u=ft(s),d=ft(l);for(let f=e;f`#define HAS_UNIFORM_${l}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof gt||s instanceof ti)for(let l=0;l!0){this.programConfigurations={};for(const l of e)this.programConfigurations[l.id]=new ia(l,r,s);this.needsUpload=!1,this._featureMap=new si,this._bufferOffset=0}populatePaintArrays(e,r,s,l,u,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,l,u,d);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,s,l){for(const u of s)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,l)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function uc(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function hl(i,e,r){const s={color:{source:an,composite:n},number:{source:ea,composite:an}},l=function(u){return{"line-pattern":{source:$,composite:$},"fill-pattern":{source:$,composite:$},"fill-extrusion-pattern":{source:$,composite:$}}[u]}(i);return l&&l[r]||s[e][r]}De("ConstantBinder",ei),De("CrossFadedConstantBinder",oi),De("SourceExpressionBinder",gt),De("CrossFadedCompositeBinder",Oi),De("CompositeExpressionBinder",ti),De("ProgramConfiguration",ia,{omit:["_buffers"]}),De("ProgramConfigurationSet",Mr);var At=8192;const io=Math.pow(2,14)-1,hs=-io-1;function Cr(i){const e=At/i.extent,r=i.loadGeometry();for(let s=0;sd.x+1||gd.y+1)&&Vt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function us(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Cr(i):[]}}function ul(i,e,r,s,l){i.emplaceBack(2*e+(s+1)/2,2*r+(l+1)/2)}class dc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new B,this.indexArray=new ge,this.segments=new Ee,this.programConfigurations=new Mr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){const l=this.layers[0],u=[];let d=null,f=!1;l.type==="circle"&&(d=l.layout.get("circle-sort-key"),f=!d.isConstant());for(const{feature:g,id:v,index:b,sourceLayerIndex:S}of e){const P=this.layers[0]._featureFilter.needGeometry,C=us(g,P);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),C,s))continue;const z=f?d.evaluate(C,{},s):void 0,U={id:v,properties:g.properties,type:g.type,sourceLayerIndex:S,index:b,geometry:P?C.geometry:Cr(g),patterns:{},sortKey:z};u.push(U)}f&&u.sort((g,v)=>g.sortKey-v.sortKey);for(const g of u){const{geometry:v,index:b,sourceLayerIndex:S}=g,P=e[b].feature;this.addFeature(g,v,b,s),r.featureIndex.insert(P,v,b,S,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ke),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,s,l){for(const u of r)for(const d of u){const f=d.x,g=d.y;if(f<0||f>=At||g<0||g>=At)continue;const v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=v.vertexLength;ul(this.layoutVertexArray,f,g,-1,-1),ul(this.layoutVertexArray,f,g,1,-1),ul(this.layoutVertexArray,f,g,1,1),ul(this.layoutVertexArray,f,g,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),v.vertexLength+=4,v.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,{},l)}}function yh(i,e){for(let r=0;r1){if(pc(i,e))return!0;for(let s=0;s1?r:r.sub(e)._mult(l)._add(e))}function bh(i,e){let r,s,l,u=!1;for(let d=0;de.y!=l.y>e.y&&e.x<(l.x-s.x)*(e.y-s.y)/(l.y-s.y)+s.x&&(u=!u)}return u}function ra(i,e){let r=!1;for(let s=0,l=i.length-1;se.y!=d.y>e.y&&e.x<(d.x-u.x)*(e.y-u.y)/(d.y-u.y)+u.x&&(r=!r)}return r}function Dd(i,e,r){const s=r[0],l=r[2];if(i.xl.x&&e.x>l.x||i.yl.y&&e.y>l.y)return!1;const u=yt(i,e,r[0]);return u!==yt(i,e,r[1])||u!==yt(i,e,r[2])||u!==yt(i,e,r[3])}function ro(i,e,r){const s=e.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(e.id).getMaxValue(i)}function dl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function pl(i,e,r,s,l){if(!e[0]&&!e[1])return i;const u=xe.convert(e)._mult(l);r==="viewport"&&u._rotate(-s);const d=[];for(let f=0;fi.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>e.width||l.height>e.height||s.x>e.width-l.width||s.y>e.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=e.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g{e[i.evaluationKey]=g;const v=i.expression.evaluate(e);l.data[d+f+0]=Math.floor(255*v.r/v.a),l.data[d+f+1]=Math.floor(255*v.g/v.a),l.data[d+f+2]=Math.floor(255*v.b/v.a),l.data[d+f+3]=Math.floor(255*v.a)};if(i.clips)for(let d=0,f=0;d80*r){s=u=i[0],l=d=i[1];for(var z=r;zu&&(u=f),g>d&&(d=g);v=(v=Math.max(u-s,d-l))!==0?32767/v:0}return ao(P,C,r,s,l,v,0),C}function kh(i,e,r,s,l){var u,d;if(l===bc(i,e,r,s)>0)for(u=e;u=e;u-=s)d=Lh(u,i[u],i[u+1],d);return d&&gl(d,d.next)&&(lo(d),d=d.next),d}function ds(i,e){if(!i)return i;e||(e=i);var r,s=i;do if(r=!1,s.steiner||!gl(s,s.next)&&Zt(s.prev,s,s.next)!==0)s=s.next;else{if(lo(s),(s=e=s.prev)===s.next)break;r=!0}while(r||s!==e);return e}function ao(i,e,r,s,l,u,d){if(i){!d&&u&&function(b,S,P,C){var z=b;do z.z===0&&(z.z=xc(z.x,z.y,S,P,C)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==b);z.prevZ.nextZ=null,z.prevZ=null,function(U){var F,K,Q,X,ne,ae,he,ze,Be=1;do{for(K=U,U=null,ne=null,ae=0;K;){for(ae++,Q=K,he=0,F=0;F0||ze>0&&Q;)he!==0&&(ze===0||!Q||K.z<=Q.z)?(X=K,K=K.nextZ,he--):(X=Q,Q=Q.nextZ,ze--),ne?ne.nextZ=X:U=X,X.prevZ=ne,ne=X;K=Q}ne.nextZ=null,Be*=2}while(ae>1)}(z)}(i,s,l,u);for(var f,g,v=i;i.prev!==i.next;)if(f=i.prev,g=i.next,u?Nd(i,s,l,u):Vd(i))e.push(f.i/r|0),e.push(i.i/r|0),e.push(g.i/r|0),lo(i),i=g.next,v=g.next;else if((i=g)===v){d?d===1?ao(i=$d(ds(i),e,r),e,r,s,l,u,2):d===2&&qd(i,e,r,s,l,u):ao(ds(i),e,r,s,l,u,1);break}}}function Vd(i){var e=i.prev,r=i,s=i.next;if(Zt(e,r,s)>=0)return!1;for(var l=e.x,u=r.x,d=s.x,f=e.y,g=r.y,v=s.y,b=lu?l>d?l:d:u>d?u:d,C=f>g?f>v?f:v:g>v?g:v,z=s.next;z!==e;){if(z.x>=b&&z.x<=P&&z.y>=S&&z.y<=C&&sa(l,f,u,g,d,v,z.x,z.y)&&Zt(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function Nd(i,e,r,s){var l=i.prev,u=i,d=i.next;if(Zt(l,u,d)>=0)return!1;for(var f=l.x,g=u.x,v=d.x,b=l.y,S=u.y,P=d.y,C=fg?f>v?f:v:g>v?g:v,F=b>S?b>P?b:P:S>P?S:P,K=xc(C,z,e,r,s),Q=xc(U,F,e,r,s),X=i.prevZ,ne=i.nextZ;X&&X.z>=K&&ne&&ne.z<=Q;){if(X.x>=C&&X.x<=U&&X.y>=z&&X.y<=F&&X!==l&&X!==d&&sa(f,b,g,S,v,P,X.x,X.y)&&Zt(X.prev,X,X.next)>=0||(X=X.prevZ,ne.x>=C&&ne.x<=U&&ne.y>=z&&ne.y<=F&&ne!==l&&ne!==d&&sa(f,b,g,S,v,P,ne.x,ne.y)&&Zt(ne.prev,ne,ne.next)>=0))return!1;ne=ne.nextZ}for(;X&&X.z>=K;){if(X.x>=C&&X.x<=U&&X.y>=z&&X.y<=F&&X!==l&&X!==d&&sa(f,b,g,S,v,P,X.x,X.y)&&Zt(X.prev,X,X.next)>=0)return!1;X=X.prevZ}for(;ne&&ne.z<=Q;){if(ne.x>=C&&ne.x<=U&&ne.y>=z&&ne.y<=F&&ne!==l&&ne!==d&&sa(f,b,g,S,v,P,ne.x,ne.y)&&Zt(ne.prev,ne,ne.next)>=0)return!1;ne=ne.nextZ}return!0}function $d(i,e,r){var s=i;do{var l=s.prev,u=s.next.next;!gl(l,u)&&zh(l,s,s.next,u)&&oo(l,u)&&oo(u,l)&&(e.push(l.i/r|0),e.push(s.i/r|0),e.push(u.i/r|0),lo(s),lo(s.next),s=i=u),s=s.next}while(s!==i);return ds(s)}function qd(i,e,r,s,l,u){var d=i;do{for(var f=d.next.next;f!==d.prev;){if(d.i!==f.i&&Wd(d,f)){var g=Dh(d,f);return d=ds(d,d.next),g=ds(g,g.next),ao(d,e,r,s,l,u,0),void ao(g,e,r,s,l,u,0)}f=f.next}d=d.next}while(d!==i)}function jd(i,e){return i.x-e.x}function Zd(i,e){var r=function(l,u){var d,f=u,g=l.x,v=l.y,b=-1/0;do{if(v<=f.y&&v>=f.next.y&&f.next.y!==f.y){var S=f.x+(v-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(S<=g&&S>b&&(b=S,d=f.x=f.x&&f.x>=z&&g!==f.x&&sa(vd.x||f.x===d.x&&Gd(d,f)))&&(d=f,F=P)),f=f.next;while(f!==C);return d}(i,e);if(!r)return e;var s=Dh(r,i);return ds(s,s.next),ds(r,r.next)}function Gd(i,e){return Zt(i.prev,i,e.prev)<0&&Zt(e.next,i,i.next)<0}function xc(i,e,r,s,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*l|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Xd(i){var e=i,r=i;do(e.x=(i-d)*(u-f)&&(i-d)*(s-f)>=(r-d)*(e-f)&&(r-d)*(u-f)>=(l-d)*(s-f)}function Wd(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,s){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==s.i&&l.next.i!==s.i&&zh(l,l.next,r,s))return!0;l=l.next}while(l!==r);return!1}(i,e)&&(oo(i,e)&&oo(e,i)&&function(r,s){var l=r,u=!1,d=(r.x+s.x)/2,f=(r.y+s.y)/2;do l.y>f!=l.next.y>f&&l.next.y!==l.y&&d<(l.next.x-l.x)*(f-l.y)/(l.next.y-l.y)+l.x&&(u=!u),l=l.next;while(l!==r);return u}(i,e)&&(Zt(i.prev,i,e.prev)||Zt(i,e.prev,e))||gl(i,e)&&Zt(i.prev,i,i.next)>0&&Zt(e.prev,e,e.next)>0)}function Zt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function gl(i,e){return i.x===e.x&&i.y===e.y}function zh(i,e,r,s){var l=yl(Zt(i,e,r)),u=yl(Zt(i,e,s)),d=yl(Zt(r,s,i)),f=yl(Zt(r,s,e));return l!==u&&d!==f||!(l!==0||!_l(i,r,e))||!(u!==0||!_l(i,s,e))||!(d!==0||!_l(r,i,s))||!(f!==0||!_l(r,e,s))}function _l(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function yl(i){return i>0?1:i<0?-1:0}function oo(i,e){return Zt(i.prev,i,i.next)<0?Zt(i,e,i.next)>=0&&Zt(i,i.prev,e)>=0:Zt(i,e,i.prev)<0||Zt(i,i.next,e)<0}function Dh(i,e){var r=new vc(i.i,i.x,i.y),s=new vc(e.i,e.x,e.y),l=i.next,u=e.prev;return i.next=e,e.prev=i,r.next=l,l.prev=r,s.next=r,r.prev=s,u.next=s,s.prev=u,s}function Lh(i,e,r,s){var l=new vc(i,e,r);return s?(l.next=s.next,l.prev=s,s.next.prev=l,s.next=l):(l.prev=l,l.next=l),l}function lo(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function vc(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function bc(i,e,r,s){for(var l=0,u=e,d=r-s;u0&&r.holes.push(s+=i[l-1].length)}return r};var Bh=ce(yc.exports);function Hd(i,e,r,s,l){Rh(i,e,r||0,s||i.length-1,l||Kd)}function Rh(i,e,r,s,l){for(;s>r;){if(s-r>600){var u=s-r+1,d=e-r+1,f=Math.log(u),g=.5*Math.exp(2*f/3),v=.5*Math.sqrt(f*g*(u-g)/u)*(d-u/2<0?-1:1);Rh(i,e,Math.max(r,Math.floor(e-d*g/u+v)),Math.min(s,Math.floor(e+(u-d)*g/u+v)),l)}var b=i[e],S=r,P=s;for(co(i,r,e),l(i[s],b)>0&&co(i,r,s);S0;)P--}l(i[r],b)===0?co(i,r,P):co(i,++P,s),P<=e&&(r=P+1),e<=P&&(s=P-1)}}function co(i,e,r){var s=i[e];i[e]=i[r],i[r]=s}function Kd(i,e){return ie?1:0}function wc(i,e){const r=i.length;if(r<=1)return[i];const s=[];let l,u;for(let d=0;d1)for(let d=0;dr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new R,this.indexArray=new ge,this.indexArray2=new Ce,this.programConfigurations=new Mr(e.layers,e.zoom),this.segments=new Ee,this.segments2=new Ee,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=Tc("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:g,index:v,sourceLayerIndex:b}of e){const S=this.layers[0]._featureFilter.needGeometry,P=us(f,S);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),P,s))continue;const C=u?l.evaluate(P,{},s,r.availableImages):void 0,z={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:v,geometry:S?P.geometry:Cr(f),patterns:{},sortKey:C};d.push(z)}u&&d.sort((f,g)=>f.sortKey-g.sortKey);for(const f of d){const{geometry:g,index:v,sourceLayerIndex:b}=f;if(this.hasPattern){const S=Ec("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(S)}else this.addFeature(f,g,v,s,{});r.featureIndex.insert(e[v].feature,g,v,b,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ud),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,s,l,u){for(const d of wc(r,500)){let f=0;for(const C of d)f+=C.length;const g=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),v=g.vertexLength,b=[],S=[];for(const C of d){if(C.length===0)continue;C!==d[0]&&S.push(b.length/2);const z=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),U=z.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(U+C.length-1,U),b.push(C[0].x),b.push(C[0].y);for(let F=1;F>3}if(l--,s===1||s===2)u+=i.readSVarint(),d+=i.readSVarint(),s===1&&(e&&f.push(e),e=[]),e.push(new ip(u,d));else{if(s!==7)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&f.push(e),f},aa.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,s=0,l=0,u=0,d=1/0,f=-1/0,g=1/0,v=-1/0;i.pos>3}if(s--,r===1||r===2)(l+=i.readSVarint())f&&(f=l),(u+=i.readSVarint())v&&(v=u);else if(r!==7)throw new Error("unknown command "+r)}return[d,g,f,v]},aa.prototype.toGeoJSON=function(i,e,r){var s,l,u=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*e,g=this.loadGeometry(),v=aa.types[this.type];function b(C){for(var z=0;z>3;l=d===1?s.readString():d===2?s.readFloat():d===3?s.readDouble():d===4?s.readVarint64():d===5?s.readVarint():d===6?s.readSVarint():d===7?s.readBoolean():null}return l}(r))}Nh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new sp(this._pbf,e,this.extent,this._keys,this._values)};var op=Vh;function lp(i,e,r){if(i===3){var s=new op(r,r.readVarint()+r.pos);s.length&&(e[s.name]=s)}}Rn.VectorTile=function(i,e){this.layers=i.readFields(lp,{},e)},Rn.VectorTileFeature=Uh,Rn.VectorTileLayer=Vh;const cp=Rn.VectorTileFeature.types,Ic=Math.pow(2,13);function ho(i,e,r,s,l,u,d,f){i.emplaceBack(e,r,2*Math.floor(s*Ic)+d,l*Ic*2,u*Ic*2,Math.round(f))}class Ac{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new q,this.centroidVertexArray=new O,this.indexArray=new ge,this.programConfigurations=new Mr(e.layers,e.zoom),this.segments=new Ee,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.features=[],this.hasPattern=Tc("fill-extrusion",this.layers,r);for(const{feature:l,id:u,index:d,sourceLayerIndex:f}of e){const g=this.layers[0]._featureFilter.needGeometry,v=us(l,g);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),v,s))continue;const b={id:u,sourceLayerIndex:f,index:d,geometry:g?v.geometry:Cr(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(Ec("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,d,s,{}),r.featureIndex.insert(l,b.geometry,d,f,this.index,!0)}}addFeatures(e,r,s){for(const l of this.features){const{geometry:u}=l;this.addFeature(l,u,l.index,r,s)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,tp),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,ep.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,s,l,u){const d={x:0,y:0,vertexCount:0};for(const f of wc(r,500)){let g=0;for(const z of f)g+=z.length;let v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const z of f){if(z.length===0||up(z))continue;let U=0;for(let F=0;F=1){const Q=z[F-1];if(!hp(K,Q)){v.vertexLength+4>Ee.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const X=K.sub(Q)._perp()._unit(),ne=Q.dist(K);U+ne>32768&&(U=0),ho(this.layoutVertexArray,K.x,K.y,X.x,X.y,0,0,U),ho(this.layoutVertexArray,K.x,K.y,X.x,X.y,0,1,U),d.x+=2*K.x,d.y+=2*K.y,d.vertexCount+=2,U+=ne,ho(this.layoutVertexArray,Q.x,Q.y,X.x,X.y,0,0,U),ho(this.layoutVertexArray,Q.x,Q.y,X.x,X.y,0,1,U),d.x+=2*Q.x,d.y+=2*Q.y,d.vertexCount+=2;const ae=v.vertexLength;this.indexArray.emplaceBack(ae,ae+2,ae+1),this.indexArray.emplaceBack(ae+1,ae+2,ae+3),v.vertexLength+=4,v.primitiveLength+=2}}}}if(v.vertexLength+g>Ee.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),cp[e.type]!=="Polygon")continue;const b=[],S=[],P=v.vertexLength;for(const z of f)if(z.length!==0){z!==f[0]&&S.push(b.length/2);for(let U=0;UAt)||i.y===e.y&&(i.y<0||i.y>At)}function up(i){return i.every(e=>e.x<0)||i.every(e=>e.x>At)||i.every(e=>e.y<0)||i.every(e=>e.y>At)}let $h;De("FillExtrusionBucket",Ac,{omit:["layers","features"]});var dp={get paint(){return $h=$h||new Ci({"fill-extrusion-opacity":new Fe(le["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qe(le["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Fe(le["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Fe(le["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new os(le["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qe(le["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qe(le["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Fe(le["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};function uo(i,e){return i.x*e.x+i.y*e.y}function qh(i,e){if(i.length===1){let r=0;const s=e[r++];let l;for(;!l||s.equals(l);)if(l=e[r++],!l)return 1/0;for(;rr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new H,this.layoutVertexArray2=new se,this.indexArray=new ge,this.programConfigurations=new Mr(e.layers,e.zoom),this.segments=new Ee,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=Tc("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:g,index:v,sourceLayerIndex:b}of e){const S=this.layers[0]._featureFilter.needGeometry,P=us(f,S);if(!this.layers[0]._featureFilter.filter(new kt(this.zoom),P,s))continue;const C=u?l.evaluate(P,{},s):void 0,z={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:v,geometry:S?P.geometry:Cr(f),patterns:{},sortKey:C};d.push(z)}u&&d.sort((f,g)=>f.sortKey-g.sortKey);for(const f of d){const{geometry:g,index:v,sourceLayerIndex:b}=f;if(this.hasPattern){const S=Ec("line",this.layers,f,this.zoom,r);this.patternFeatures.push(S)}else this.addFeature(f,g,v,s,{});r.featureIndex.insert(e[v].feature,g,v,b,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,gp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,fp),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,s,l,u){const d=this.layers[0].layout,f=d.get("line-join").evaluate(e,{}),g=d.get("line-cap"),v=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const S of r)this.addLine(S,e,f,g,v,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,u,l)}addLine(e,r,s,l,u,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&e[g-1].equals(e[g-2]);)g--;let v=0;for(;v0;if(ze&&K>v){const Te=P.dist(C);if(Te>2*b){const Me=P.sub(P.sub(C)._mult(b/Te)._round());this.updateDistance(C,Me),this.addCurrentVertex(Me,U,0,0,S),C=Me}}const Pe=C&&z;let Se=Pe?s:f?"butt":l;if(Pe&&Se==="round"&&(aeu&&(Se="bevel"),Se==="bevel"&&(ae>2&&(Se="flipbevel"),ae100)Q=F.mult(-1);else{const Te=ae*U.add(F).mag()/U.sub(F).mag();Q._perp()._mult(Te*(Be?-1:1))}this.addCurrentVertex(P,Q,0,0,S),this.addCurrentVertex(P,Q.mult(-1),0,0,S)}else if(Se==="bevel"||Se==="fakeround"){const Te=-Math.sqrt(ae*ae-1),Me=Be?Te:0,Ie=Be?0:Te;if(C&&this.addCurrentVertex(P,U,Me,Ie,S),Se==="fakeround"){const ye=Math.round(180*he/Math.PI/20);for(let Ve=1;Ve2*b){const Me=P.add(z.sub(P)._mult(b/Te)._round());this.updateDistance(P,Me),this.addCurrentVertex(Me,F,0,0,S),P=Me}}}}addCurrentVertex(e,r,s,l,u,d=!1){const f=r.y*l-r.x,g=-r.y-r.x*l;this.addHalfVertex(e,r.x+r.y*s,r.y-r.x*s,d,!1,s,u),this.addHalfVertex(e,f,g,d,!0,-l,u),this.distance>jh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,s,l,u,d))}addHalfVertex({x:e,y:r},s,l,u,d,f,g){const v=.5*(this.lineClips?this.scaledDistance*(jh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(u?1:0),(r<<1)+(d?1:0),Math.round(63*s)+128,Math.round(63*l)+128,1+(f===0?0:f<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),g.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let Zh,Gh;De("LineBucket",Pc,{omit:["layers","patternFeatures"]});var Xh={get paint(){return Gh=Gh||new Ci({"line-opacity":new qe(le.paint_line["line-opacity"]),"line-color":new qe(le.paint_line["line-color"]),"line-translate":new Fe(le.paint_line["line-translate"]),"line-translate-anchor":new Fe(le.paint_line["line-translate-anchor"]),"line-width":new qe(le.paint_line["line-width"]),"line-gap-width":new qe(le.paint_line["line-gap-width"]),"line-offset":new qe(le.paint_line["line-offset"]),"line-blur":new qe(le.paint_line["line-blur"]),"line-dasharray":new Ka(le.paint_line["line-dasharray"]),"line-pattern":new os(le.paint_line["line-pattern"]),"line-gradient":new Ya(le.paint_line["line-gradient"])})},get layout(){return Zh=Zh||new Ci({"line-cap":new Fe(le.layout_line["line-cap"]),"line-join":new qe(le.layout_line["line-join"]),"line-miter-limit":new Fe(le.layout_line["line-miter-limit"]),"line-round-limit":new Fe(le.layout_line["line-round-limit"]),"line-sort-key":new qe(le.layout_line["line-sort-key"])})}};class xp extends qe{possiblyEvaluate(e,r){return r=new kt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,s,l){return r=pt({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,s,l)}}let xl;function Wh(i,e){return e>0?e+2*i:i}const vp=Kt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),bp=Kt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Kt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const wp=Kt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Kt([{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 Hh=Kt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Tp=Kt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ep(i,e,r){return i.sections.forEach(s=>{s.text=function(l,u,d){const f=u.layout.get("text-transform").evaluate(d,{});return f==="uppercase"?l=l.toLocaleUpperCase():f==="lowercase"&&(l=l.toLocaleLowerCase()),Ji.applyArabicShaping&&(l=Ji.applyArabicShaping(l)),l}(s.text,e,r)}),i}Kt([{name:"triangle",components:3,type:"Uint16"}]),Kt([{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"}]),Kt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Kt([{type:"Float32",name:"offsetX"}]),Kt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const po={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var li=24,Kh=vt,Yh=function(i,e,r,s,l){var u,d,f=8*l-s-1,g=(1<>1,b=-7,S=r?l-1:0,P=r?-1:1,C=i[e+S];for(S+=P,u=C&(1<<-b)-1,C>>=-b,b+=f;b>0;u=256*u+i[e+S],S+=P,b-=8);for(d=u&(1<<-b)-1,u>>=-b,b+=s;b>0;d=256*d+i[e+S],S+=P,b-=8);if(u===0)u=1-v;else{if(u===g)return d?NaN:1/0*(C?-1:1);d+=Math.pow(2,s),u-=v}return(C?-1:1)*d*Math.pow(2,u-s)},Jh=function(i,e,r,s,l,u){var d,f,g,v=8*u-l-1,b=(1<>1,P=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=s?0:u-1,z=s?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,d=b):(d=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-d))<1&&(d--,g*=2),(e+=d+S>=1?P/g:P*Math.pow(2,1-S))*g>=2&&(d++,g/=2),d+S>=b?(f=0,d=b):d+S>=1?(f=(e*g-1)*Math.pow(2,l),d+=S):(f=e*Math.pow(2,S-1)*Math.pow(2,l),d=0));l>=8;i[r+C]=255&f,C+=z,f/=256,l-=8);for(d=d<0;i[r+C]=255&d,C+=z,d/=256,v-=8);i[r+C-z]|=128*U};function vt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}vt.Varint=0,vt.Fixed64=1,vt.Bytes=2,vt.Fixed32=5;var Mc=4294967296,Qh=1/Mc,eu=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function cn(i){return i.type===vt.Bytes?i.readVarint()+i.pos:i.pos+1}function oa(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function tu(i,e,r){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(s);for(var l=r.pos-1;l>=i;l--)r.buf[l+s]=r.buf[l]}function Sp(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function iu(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}vt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&s,i(l,e,this),this.pos===u&&this.skip(s)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=vl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=iu(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=vl(this.buf,this.pos)+vl(this.buf,this.pos+4)*Mc;return this.pos+=8,i},readSFixed64:function(){var i=vl(this.buf,this.pos)+iu(this.buf,this.pos+4)*Mc;return this.pos+=8,i},readFloat:function(){var i=Yh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Yh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,s=this.buf;return e=127&(r=s[this.pos++]),r<128?e:(e|=(127&(r=s[this.pos++]))<<7,r<128?e:(e|=(127&(r=s[this.pos++]))<<14,r<128?e:(e|=(127&(r=s[this.pos++]))<<21,r<128?e:function(l,u,d){var f,g,v=d.buf;if(f=(112&(g=v[d.pos++]))>>4,g<128||(f|=(127&(g=v[d.pos++]))<<3,g<128)||(f|=(127&(g=v[d.pos++]))<<10,g<128)||(f|=(127&(g=v[d.pos++]))<<17,g<128)||(f|=(127&(g=v[d.pos++]))<<24,g<128)||(f|=(1&(g=v[d.pos++]))<<31,g<128))return oa(l,f,u);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&eu?function(r,s,l){return eu.decode(r.subarray(s,l))}(this.buf,e,i):function(r,s,l){for(var u="",d=s;d239?4:b>223?3:b>191?2:1;if(d+P>l)break;P===1?b<128&&(S=b):P===2?(192&(f=r[d+1]))==128&&(S=(31&b)<<6|63&f)<=127&&(S=null):P===3?(g=r[d+2],(192&(f=r[d+1]))==128&&(192&g)==128&&((S=(15&b)<<12|(63&f)<<6|63&g)<=2047||S>=55296&&S<=57343)&&(S=null)):P===4&&(g=r[d+2],v=r[d+3],(192&(f=r[d+1]))==128&&(192&g)==128&&(192&v)==128&&((S=(15&b)<<18|(63&f)<<12|(63&g)<<6|63&v)<=65535||S>=1114112)&&(S=null)),S===null?(S=65533,P=1):S>65535&&(S-=65536,u+=String.fromCharCode(S>>>10&1023|55296),S=56320|1023&S),u+=String.fromCharCode(S),d+=P}return u}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==vt.Bytes)return i.push(this.readVarint(e));var r=cn(this);for(i=i||[];this.pos127;);else if(e===vt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===vt.Fixed32)this.pos+=4;else{if(e!==vt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var s,l;if(e>=0?(s=e%4294967296|0,l=e/4294967296|0):(l=~(-e/4294967296),4294967295^(s=~(-e%4294967296))?s=s+1|0:(s=0,l=l+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,d,f){f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,f.buf[f.pos]=127&(u>>>=7)}(s,0,r),function(u,d){var f=(7&u)<<4;d.buf[d.pos++]|=f|((u>>>=3)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u)))))}(l,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(s,l,u){for(var d,f,g=0;g55295&&d<57344){if(!f){d>56319||g+1===l.length?(s[u++]=239,s[u++]=191,s[u++]=189):f=d;continue}if(d<56320){s[u++]=239,s[u++]=191,s[u++]=189,f=d;continue}d=f-55296<<10|d-56320|65536,f=null}else f&&(s[u++]=239,s[u++]=191,s[u++]=189,f=null);d<128?s[u++]=d:(d<2048?s[u++]=d>>6|192:(d<65536?s[u++]=d>>12|224:(s[u++]=d>>18|240,s[u++]=d>>12&63|128),s[u++]=d>>6&63|128),s[u++]=63&d|128)}return u}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&tu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Jh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Jh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&tu(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,e,r){this.writeTag(i,vt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Sp,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Ip,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Mp,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Ap,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Pp,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Cp,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,kp,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,zp,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Dp,e)},writeBytesField:function(i,e){this.writeTag(i,vt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,vt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,vt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,vt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,vt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,vt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,vt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,vt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,vt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,vt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Cc=ce(Kh);const kc=3;function Lp(i,e,r){i===1&&r.readMessage(Bp,e)}function Bp(i,e,r){if(i===3){const{id:s,bitmap:l,width:u,height:d,left:f,top:g,advance:v}=r.readMessage(Rp,{});e.push({id:s,bitmap:new so({width:u+2*kc,height:d+2*kc},l),metrics:{width:u,height:d,left:f,top:g,advance:v}})}}function Rp(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const ru=kc;function nu(i){let e=0,r=0;for(const d of i)e+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,f)=>f.h-d.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let l=0,u=0;for(const d of i)for(let f=s.length-1;f>=0;f--){const g=s[f];if(!(d.w>g.w||d.h>g.h)){if(d.x=g.x,d.y=g.y,u=Math.max(u,d.y+d.h),l=Math.max(l,d.x+d.w),d.w===g.w&&d.h===g.h){const v=s.pop();f=0&&s>=e&&wl[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const s=new ca;return s.text=this.text.substring(e,r),s.sectionIndex=this.sectionIndex.slice(e,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(mo.forText(e.scale,e.fontStack||r));const s=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function bl(i,e,r,s,l,u,d,f,g,v,b,S,P,C,z,U){const F=ca.fromFeature(i,l);let K;S===h.WritingMode.vertical&&F.verticalizePunctuation();const{processBidirectionalText:Q,processStyledBidirectionalText:X}=Ji;if(Q&&F.sections.length===1){K=[];const he=Q(F.toString(),Dc(F,v,u,e,s,C,z));for(const ze of he){const Be=new ca;Be.text=ze,Be.sections=F.sections;for(let Pe=0;Pe0&&un>$i&&($i=un)}else{const or=Be[rt.fontStack],qi=or&&or[vi];if(qi&&qi.rect)kr=qi.rect,_r=qi.metrics;else{const un=ze[rt.fontStack],vo=un&&un[vi];if(!vo)continue;_r=vo.metrics}Ii=(yi-rt.scale)*li}yr?(he.verticalizable=!0,Ni.push({glyph:vi,imageName:zr,x:Pt,y:zt+Ii,vertical:yr,scale:rt.scale,fontStack:rt.fontStack,sectionIndex:Qi,metrics:_r,rect:kr}),Pt+=hn*rt.scale+Ve):(Ni.push({glyph:vi,imageName:zr,x:Pt,y:zt+Ii,vertical:yr,scale:rt.scale,fontStack:rt.fontStack,sectionIndex:Qi,metrics:_r,rect:kr}),Pt+=_r.advance*rt.scale+Ve)}Ni.length!==0&&(ii=Math.max(Pt-Ve,ii),Up(Ni,0,Ni.length-1,gi,$i)),Pt=0;const Ut=Te*yi+$i;zi.lineOffset=Math.max($i,Si),zt+=Ut,ar=Math.max(Ut,ar),++Yt}var ci;const _i=zt-fo,{horizontalAlign:Ei,verticalAlign:Vi}=Lc(Me);(function(Jt,yi,Si,zi,Ni,$i,Ut,xi,rt){const Qi=(yi-Si)*Ni;let vi=0;vi=$i!==Ut?-xi*zi-fo:(-zi*rt+.5)*Ut;for(const Ii of Jt)for(const _r of Ii.positionedGlyphs)_r.x+=Qi,_r.y+=vi})(he.positionedLines,gi,Ei,Vi,ii,ar,Te,_i,Se.length),he.top+=-Vi*_i,he.bottom=he.top+_i,he.left+=-Ei*ii,he.right=he.left+ii}(ae,e,r,s,K,d,f,g,S,v,P,U),!function(he){for(const ze of he)if(ze.positionedGlyphs.length!==0)return!1;return!0}(ne)&&ae}const wl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Fp={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function au(i,e,r,s,l,u){if(e.imageName){const d=s[e.imageName];return d?d.displaySize[0]*e.scale*li/u+l:0}{const d=r[e.fontStack],f=d&&d[i];return f?f.metrics.advance*e.scale+l:0}}function ou(i,e,r,s){const l=Math.pow(i-e,2);return s?i=0;let b=0;for(let P=0;Pd.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=mc([]),this.placementViewportMatrix=mc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=uu(this.zoom,r["text-size"]),this.iconSizeData=uu(this.zoom,r["icon-size"]);const s=this.layers[0].layout,l=s.get("symbol-sort-key"),u=s.get("symbol-z-order");this.canOverlap=Bc(s,"text-overlap","text-allow-overlap")!=="never"||Bc(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(d=>h.WritingMode[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=e.sourceID}createArrays(){this.text=new Fc(new Mr(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Fc(new Mr(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new x,this.lineVertexArray=new T,this.symbolInstances=new _}calculateGlyphDependencies(e,r,s,l,u){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],!v&&!b)return;const P=r.iconDependencies,C=r.glyphDependencies,z=r.availableImages,U=new kt(this.zoom);for(const{feature:F,id:K,index:Q,sourceLayerIndex:X}of e){const ne=l._featureFilter.needGeometry,ae=us(F,ne);if(!l._featureFilter.filter(U,ae,s))continue;let he,ze;if(ne||(ae.geometry=Cr(F)),v){const Pe=l.getValueAndResolveTokens("text-field",ae,s,z),Se=di.factory(Pe);qp(Se)&&(this.hasRTLText=!0),(!this.hasRTLText||Xa()==="unavailable"||this.hasRTLText&&Ji.isParsed())&&(he=Ep(Se,l,ae))}if(b){const Pe=l.getValueAndResolveTokens("icon-image",ae,s,z);ze=Pe instanceof Wi?Pe:Wi.fromString(Pe)}if(!he&&!ze)continue;const Be=this.sortFeaturesByKey?S.evaluate(ae,{},s):void 0;if(this.features.push({id:K,text:he,icon:ze,index:Q,sourceLayerIndex:X,geometry:ae.geometry,properties:F.properties,type:Np[F.type],sortKey:Be}),ze&&(P[ze.name]=!0),he){const Pe=d.evaluate(ae,{},s).join(","),Se=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(h.WritingMode.vertical)>=0;for(const Te of he.sections)if(Te.image)P[Te.image.name]=!0;else{const Me=Vs(he.toString()),Ie=Te.fontStack||Pe,ye=C[Ie]=C[Ie]||{};this.calculateGlyphDependencies(Te.text,ye,Se,this.allowVerticalPlacement,Me)}}}u.get("symbol-placement")==="line"&&(this.features=function(F){const K={},Q={},X=[];let ne=0;function ae(Pe){X.push(F[Pe]),ne++}function he(Pe,Se,Te){const Me=Q[Pe];return delete Q[Pe],Q[Se]=Me,X[Me].geometry[0].pop(),X[Me].geometry[0]=X[Me].geometry[0].concat(Te[0]),Me}function ze(Pe,Se,Te){const Me=K[Se];return delete K[Se],K[Pe]=Me,X[Me].geometry[0].shift(),X[Me].geometry[0]=Te[0].concat(X[Me].geometry[0]),Me}function Be(Pe,Se,Te){const Me=Te?Se[0][Se[0].length-1]:Se[0][0];return`${Pe}:${Me.x}:${Me.y}`}for(let Pe=0;PePe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((F,K)=>F.sortKey-K.sortKey)}update(e,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const s=this.lineVertexArray.length;if(e.segment!==void 0){let l=e.dist(r[e.segment+1]),u=e.dist(r[e.segment]);const d={};for(let f=e.segment+1;f=0;f--)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:u},f>0&&(u+=r[f-1].dist(r[f]));for(let f=0;f0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const s=e.placedSymbolArray.get(r),l=s.vertexStartIndex+4*s.numGlyphs;for(let u=s.vertexStartIndex;ul[f]-l[g]||u[g]-u[f]),d}addToSortKeyRanges(e,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((l,u,d)=>{l>=0&&d.indexOf(l)===u&&this.addIndicesForPlacedSymbol(this.text,l)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let du,pu;De("SymbolBucket",ha,{omit:["layers","collisionBoxArray","features","compareText"]}),ha.MAX_GLYPHS=65535,ha.addDynamicAttributes=Rc;var Uc={get paint(){return pu=pu||new Ci({"icon-opacity":new qe(le.paint_symbol["icon-opacity"]),"icon-color":new qe(le.paint_symbol["icon-color"]),"icon-halo-color":new qe(le.paint_symbol["icon-halo-color"]),"icon-halo-width":new qe(le.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qe(le.paint_symbol["icon-halo-blur"]),"icon-translate":new Fe(le.paint_symbol["icon-translate"]),"icon-translate-anchor":new Fe(le.paint_symbol["icon-translate-anchor"]),"text-opacity":new qe(le.paint_symbol["text-opacity"]),"text-color":new qe(le.paint_symbol["text-color"],{runtimeType:Pi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new qe(le.paint_symbol["text-halo-color"]),"text-halo-width":new qe(le.paint_symbol["text-halo-width"]),"text-halo-blur":new qe(le.paint_symbol["text-halo-blur"]),"text-translate":new Fe(le.paint_symbol["text-translate"]),"text-translate-anchor":new Fe(le.paint_symbol["text-translate-anchor"])})},get layout(){return du=du||new Ci({"symbol-placement":new Fe(le.layout_symbol["symbol-placement"]),"symbol-spacing":new Fe(le.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Fe(le.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qe(le.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Fe(le.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Fe(le.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Fe(le.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Fe(le.layout_symbol["icon-ignore-placement"]),"icon-optional":new Fe(le.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Fe(le.layout_symbol["icon-rotation-alignment"]),"icon-size":new qe(le.layout_symbol["icon-size"]),"icon-text-fit":new Fe(le.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Fe(le.layout_symbol["icon-text-fit-padding"]),"icon-image":new qe(le.layout_symbol["icon-image"]),"icon-rotate":new qe(le.layout_symbol["icon-rotate"]),"icon-padding":new qe(le.layout_symbol["icon-padding"]),"icon-keep-upright":new Fe(le.layout_symbol["icon-keep-upright"]),"icon-offset":new qe(le.layout_symbol["icon-offset"]),"icon-anchor":new qe(le.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Fe(le.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Fe(le.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Fe(le.layout_symbol["text-rotation-alignment"]),"text-field":new qe(le.layout_symbol["text-field"]),"text-font":new qe(le.layout_symbol["text-font"]),"text-size":new qe(le.layout_symbol["text-size"]),"text-max-width":new qe(le.layout_symbol["text-max-width"]),"text-line-height":new Fe(le.layout_symbol["text-line-height"]),"text-letter-spacing":new qe(le.layout_symbol["text-letter-spacing"]),"text-justify":new qe(le.layout_symbol["text-justify"]),"text-radial-offset":new qe(le.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Fe(le.layout_symbol["text-variable-anchor"]),"text-anchor":new qe(le.layout_symbol["text-anchor"]),"text-max-angle":new Fe(le.layout_symbol["text-max-angle"]),"text-writing-mode":new Fe(le.layout_symbol["text-writing-mode"]),"text-rotate":new qe(le.layout_symbol["text-rotate"]),"text-padding":new Fe(le.layout_symbol["text-padding"]),"text-keep-upright":new Fe(le.layout_symbol["text-keep-upright"]),"text-transform":new qe(le.layout_symbol["text-transform"]),"text-offset":new qe(le.layout_symbol["text-offset"]),"text-allow-overlap":new Fe(le.layout_symbol["text-allow-overlap"]),"text-overlap":new Fe(le.layout_symbol["text-overlap"]),"text-ignore-placement":new Fe(le.layout_symbol["text-ignore-placement"]),"text-optional":new Fe(le.layout_symbol["text-optional"])})}};class fu{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Ur,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}De("FormatSectionOverride",fu,{omit:["defaultValue"]});class El extends fr{constructor(e){super(e,Uc)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const l=[];for(const u of s)l.indexOf(u)<0&&l.push(u);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,s,l){const u=this.layout.get(e).evaluate(r,{},s,l),d=this._unevaluatedLayout._values[e];return d.isDataDriven()||zs(d.value)||!u?u:function(f,g){return g.replace(/{([^{}]+)}/g,(v,b)=>b in f?String(f[b]):"")}(r.properties,u)}createBucket(e){return new ha(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Uc.paint.overridableProperties){if(!El.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),s=new fu(r),l=new Ba(s,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new Ra("source",l):new st("composite",l,r.value.zoomStops),this.paint._values[e]=new pr(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&El.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const s=e.get("text-field"),l=Uc.paint.properties[r];let u=!1;const d=f=>{for(const g of f)if(l.overrides&&l.overrides.hasOverride(g))return void(u=!0)};if(s.value.kind==="constant"&&s.value.value instanceof di)d(s.value.value.sections);else if(s.value.kind==="source"){const f=v=>{u||(v instanceof Nr&&Wt(v.value)===Er?d(v.value.sections):v instanceof Cs?d(v.sections):v.eachChild(f))},g=s.value;g._styleExpression&&f(g._styleExpression.expression)}return u}}let mu;var jp={get paint(){return mu=mu||new Ci({"background-color":new Fe(le.paint_background["background-color"]),"background-pattern":new Ka(le.paint_background["background-pattern"]),"background-opacity":new Fe(le.paint_background["background-opacity"])})}};let gu;var Zp={get paint(){return gu=gu||new Ci({"raster-opacity":new Fe(le.paint_raster["raster-opacity"]),"raster-hue-rotate":new Fe(le.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Fe(le.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Fe(le.paint_raster["raster-brightness-max"]),"raster-saturation":new Fe(le.paint_raster["raster-saturation"]),"raster-contrast":new Fe(le.paint_raster["raster-contrast"]),"raster-resampling":new Fe(le.paint_raster["raster-resampling"]),"raster-fade-duration":new Fe(le.paint_raster["raster-fade-duration"])})}};class Gp extends fr{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const Xp={circle:class extends fr{constructor(i){super(i,Ld)}createBucket(i){return new dc(i)}queryRadius(i){const e=i;return ro("circle-radius",this,e)+ro("circle-stroke-width",this,e)+dl(this.paint.get("circle-translate"))}queryIntersectsFeature(i,e,r,s,l,u,d,f){const g=pl(i,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),u.angle,d),v=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),b=this.paint.get("circle-pitch-alignment")==="map",S=b?g:function(C,z){return C.map(U=>Sh(U,z))}(g,f),P=b?v*d:v;for(const C of s)for(const z of C){const U=b?z:Sh(z,f);let F=P;const K=fl([],[z.x,z.y,0,1],f);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?F*=K[3]/u.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(F*=u.cameraToCenterDistance/K[3]),Cd(S,U,F))return!0}return!1}},heatmap:class extends fr{createBucket(i){return new Ih(i)}constructor(i){super(i,Rd),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(i){i==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Mh({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends fr{constructor(i){super(i,Fd)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends fr{constructor(i){super(i,Jd)}recalculate(i,e){super.recalculate(i,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(i){return new Sc(i)}queryRadius(){return dl(this.paint.get("fill-translate"))}queryIntersectsFeature(i,e,r,s,l,u,d){return xh(pl(i,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),u.angle,d),s)}isTileClipped(){return!0}},"fill-extrusion":class extends fr{constructor(i){super(i,dp)}createBucket(i){return new Ac(i)}queryRadius(){return dl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,e,r,s,l,u,d,f){const g=pl(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),u.angle,d),v=this.paint.get("fill-extrusion-height").evaluate(e,r),b=this.paint.get("fill-extrusion-base").evaluate(e,r),S=function(C,z,U,F){const K=[];for(const Q of C){const X=[Q.x,Q.y,0,1];fl(X,X,z),K.push(new xe(X[0]/X[3],X[1]/X[3]))}return K}(g,f),P=function(C,z,U,F){const K=[],Q=[],X=F[8]*z,ne=F[9]*z,ae=F[10]*z,he=F[11]*z,ze=F[8]*U,Be=F[9]*U,Pe=F[10]*U,Se=F[11]*U;for(const Te of C){const Me=[],Ie=[];for(const ye of Te){const Ve=ye.x,Re=ye.y,it=F[0]*Ve+F[4]*Re+F[12],Pt=F[1]*Ve+F[5]*Re+F[13],zt=F[2]*Ve+F[6]*Re+F[14],ii=F[3]*Ve+F[7]*Re+F[15],ar=zt+ae,gi=ii+he,Yt=it+ze,ci=Pt+Be,_i=zt+Pe,Ei=ii+Se,Vi=new xe((it+X)/gi,(Pt+ne)/gi);Vi.z=ar/gi,Me.push(Vi);const Jt=new xe(Yt/Ei,ci/Ei);Jt.z=_i/Ei,Ie.push(Jt)}K.push(Me),Q.push(Ie)}return[K,Q]}(s,b,v,f);return function(C,z,U){let F=1/0;xh(U,z)&&(F=qh(U,z[0]));for(let K=0;K=3){for(let U=0;U{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const Vc=63710088e-1;class Un{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Un(Bt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,s=this.lat*r,l=e.lat*r,u=Math.sin(s)*Math.sin(l)+Math.cos(s)*Math.cos(l)*Math.cos((e.lng-this.lng)*r);return Vc*Math.acos(Math.min(u,1))}static convert(e){if(e instanceof Un)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Un(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Un(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const _u=2*Math.PI*Vc;function yu(i){return _u*Math.cos(i*Math.PI/180)}function xu(i){return(180+i)/360}function vu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function bu(i,e){return i/yu(e)}function Nc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class Sl{constructor(e,r,s=0){this.x=+e,this.y=+r,this.z=+s}static fromLngLat(e,r=0){const s=Un.convert(e);return new Sl(xu(s.lng),vu(s.lat),bu(r,s.lat))}toLngLat(){return new Un(360*this.x-180,Nc(this.y))}toAltitude(){return this.z*yu(Nc(this.y))}meterInMercatorCoordinateUnits(){return 1/_u*(e=Nc(this.y),1/Math.cos(e*Math.PI/180));var e}}function wu(i,e,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,e*s-2*Math.PI*6378137/2]}class $c{constructor(e,r,s){if(e<0||e>25||s<0||s>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${s}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=s,this.key=_o(0,e,e,r,s)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,s){const l=(d=this.y,f=this.z,g=wu(256*(u=this.x),256*(d=Math.pow(2,f)-d-1),f),v=wu(256*(u+1),256*(d+1),f),g[0]+","+g[1]+","+v[0]+","+v[1]);var u,d,f,g,v;const b=function(S,P,C){let z,U="";for(let F=S;F>0;F--)z=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new xe((e.x*r-this.x)*At,(e.y*r-this.y)*At)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Tu{constructor(e,r){this.wrap=e,this.canonical=r,this.key=_o(e,r.z,r.z,r.x,r.y)}}class sr{constructor(e,r,s,l,u){if(e= z; overscaledZ = ${e}; z = ${s}`);this.overscaledZ=e,this.wrap=r,this.canonical=new $c(s,+l,+u),this.key=_o(r,e,s,l,u)}clone(){return new sr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new sr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new sr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?_o(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):_o(this.wrap*+r,e,e,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new sr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,l=2*this.canonical.y;return[new sr(r,this.wrap,r,s,l),new sr(r,this.wrap,r,s+1,l),new sr(r,this.wrap,r,s,l+1),new sr(r,this.wrap,r,s+1,l+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=f),f=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}_unpackMapbox(e,r,s){return(256*e*256+256*r+s)/10-1e4}_unpackTerrarium(e,r,s){return 256*e+r+s/256-32768}getPixels(){return new nr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,s){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,u=r*this.dim+this.dim,d=s*this.dim,f=s*this.dim+this.dim;switch(r){case-1:l=u-1;break;case 1:u=l+1}switch(s){case-1:d=f-1;break;case 1:f=d+1}const g=-r*this.dim,v=-s*this.dim;for(let b=d;b=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Iu{constructor(e,r,s,l,u){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=s,e._y=l,this.properties=e.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Au{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new rs(At,16,0),this.grid3D=new rs(At,16,0),this.featureIndexArray=new k,this.promoteId=r}insert(e,r,s,l,u,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,l,u);const g=d?this.grid3D:this.grid;for(let v=0;v=0&&S[3]>=0&&g.insert(f,S[0],S[1],S[2],S[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Rn.VectorTile(new Cc(this.rawTileData)).layers,this.sourceLayerCoder=new Su(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,s,l){this.loadVTLayers();const u=e.params||{},d=At/e.tileSize/e.scale,f=Fa(u.filter),g=e.queryGeometry,v=e.queryPadding*d,b=Mu(g),S=this.grid.query(b.minX-v,b.minY-v,b.maxX+v,b.maxY+v),P=Mu(e.cameraQueryGeometry),C=this.grid3D.query(P.minX-v,P.minY-v,P.maxX+v,P.maxY+v,(F,K,Q,X)=>function(ne,ae,he,ze,Be){for(const Se of ne)if(ae<=Se.x&&he<=Se.y&&ze>=Se.x&&Be>=Se.y)return!0;const Pe=[new xe(ae,he),new xe(ae,Be),new xe(ze,Be),new xe(ze,he)];if(ne.length>2){for(const Se of Pe)if(ra(ne,Se))return!0}for(let Se=0;Se(X||(X=Cr(ne)),ae.queryIntersectsFeature(g,ne,he,X,this.z,e.transform,d,e.pixelPosMatrix)))}return z}loadMatchingFeature(e,r,s,l,u,d,f,g,v,b,S){const P=this.bucketLayerIDs[r];if(d&&!function(F,K){for(let Q=0;Q=0)return!0;return!1}(d,P))return;const C=this.sourceLayerCoder.decode(s),z=this.vtLayers[C].feature(l);if(u.needGeometry){const F=us(z,!0);if(!u.filter(new kt(this.tileID.overscaledZ),F,this.tileID.canonical))return}else if(!u.filter(new kt(this.tileID.overscaledZ),z))return;const U=this.getId(z,C);for(let F=0;F{const f=e instanceof Xs?e.get(d):null;return f&&f.evaluate?f.evaluate(r,s,l):f})}function Mu(i){let e=1/0,r=1/0,s=-1/0,l=-1/0;for(const u of i)e=Math.min(e,u.x),r=Math.min(r,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return{minX:e,minY:r,maxX:s,maxY:l}}function Hp(i,e){return e-i}function Cu(i,e,r,s,l){const u=[];for(let d=0;d=s&&S.x>=s||(b.x>=s?b=new xe(s,b.y+(s-b.x)/(S.x-b.x)*(S.y-b.y))._round():S.x>=s&&(S=new xe(s,b.y+(s-b.x)/(S.x-b.x)*(S.y-b.y))._round()),b.y>=l&&S.y>=l||(b.y>=l?b=new xe(b.x+(l-b.y)/(S.y-b.y)*(S.x-b.x),l)._round():S.y>=l&&(S=new xe(b.x+(l-b.y)/(S.y-b.y)*(S.x-b.x),l)._round()),g&&b.equals(g[g.length-1])||(g=[b],u.push(g)),g.push(S)))))}}return u}De("FeatureIndex",Au,{omit:["rawTileData","sourceLayerCoder"]});class Vn extends xe{constructor(e,r,s,l){super(e,r),this.angle=s,l!==void 0&&(this.segment=l)}clone(){return new Vn(this.x,this.y,this.angle,this.segment)}}function ku(i,e,r,s,l){if(e.segment===void 0)return!0;let u=e,d=e.segment+1,f=0;for(;f>-r/2;){if(d--,d<0)return!1;f-=i[d].dist(u),u=i[d]}f+=i[d].dist(i[d+1]),d++;const g=[];let v=0;for(;fs;)v-=g.shift().angleDelta;if(v>l)return!1;d++,f+=b.dist(S)}return!0}function zu(i){let e=0;for(let r=0;rv){const z=(v-g)/C,U=Bi.number(S.x,P.x,z),F=Bi.number(S.y,P.y,z),K=new Vn(U,F,P.angleTo(S),b);return K._round(),!d||ku(i,K,f,d,e)?K:void 0}g+=C}}function Yp(i,e,r,s,l,u,d,f,g){const v=Du(s,u,d),b=Lu(s,l),S=b*d,P=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return e-S=0&&ne=0&&ae=0&&P+v<=b){const he=new Vn(ne,ae,Q,z);he._round(),s&&!ku(i,he,u,s,l)||C.push(he)}}S+=K}return f||C.length||d||(C=Bu(i,S/2,r,s,l,u,d,!0,g)),C}De("Anchor",Vn);const ua=Ui;function Ru(i,e,r,s){const l=[],u=i.image,d=u.pixelRatio,f=u.paddedRect.w-2*ua,g=u.paddedRect.h-2*ua,v=i.right-i.left,b=i.bottom-i.top,S=u.stretchX||[[0,f]],P=u.stretchY||[[0,g]],C=(Te,Me)=>Te+Me[1]-Me[0],z=S.reduce(C,0),U=P.reduce(C,0),F=f-z,K=g-U;let Q=0,X=z,ne=0,ae=U,he=0,ze=F,Be=0,Pe=K;if(u.content&&s){const Te=u.content;Q=Il(S,0,Te[0]),ne=Il(P,0,Te[1]),X=Il(S,Te[0],Te[2]),ae=Il(P,Te[1],Te[3]),he=Te[0]-Q,Be=Te[1]-ne,ze=Te[2]-Te[0]-X,Pe=Te[3]-Te[1]-ae}const Se=(Te,Me,Ie,ye)=>{const Ve=Al(Te.stretch-Q,X,v,i.left),Re=Pl(Te.fixed-he,ze,Te.stretch,z),it=Al(Me.stretch-ne,ae,b,i.top),Pt=Pl(Me.fixed-Be,Pe,Me.stretch,U),zt=Al(Ie.stretch-Q,X,v,i.left),ii=Pl(Ie.fixed-he,ze,Ie.stretch,z),ar=Al(ye.stretch-ne,ae,b,i.top),gi=Pl(ye.fixed-Be,Pe,ye.stretch,U),Yt=new xe(Ve,it),ci=new xe(zt,it),_i=new xe(zt,ar),Ei=new xe(Ve,ar),Vi=new xe(Re/d,Pt/d),Jt=new xe(ii/d,gi/d),yi=e*Math.PI/180;if(yi){const Ni=Math.sin(yi),$i=Math.cos(yi),Ut=[$i,-Ni,Ni,$i];Yt._matMult(Ut),ci._matMult(Ut),Ei._matMult(Ut),_i._matMult(Ut)}const Si=Te.stretch+Te.fixed,zi=Me.stretch+Me.fixed;return{tl:Yt,tr:ci,bl:Ei,br:_i,tex:{x:u.paddedRect.x+ua+Si,y:u.paddedRect.y+ua+zi,w:Ie.stretch+Ie.fixed-Si,h:ye.stretch+ye.fixed-zi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Vi,pixelOffsetBR:Jt,minFontScaleX:ze/d/v,minFontScaleY:Pe/d/b,isSDF:r}};if(s&&(u.stretchX||u.stretchY)){const Te=Fu(S,F,z),Me=Fu(P,K,U);for(let Ie=0;Ie0&&(z=Math.max(10,z),this.circleDiameter=z)}else{let S=d.top*f-g[0],P=d.bottom*f+g[2],C=d.left*f-g[3],z=d.right*f+g[1];const U=d.collisionPadding;if(U&&(C-=U[0]*f,S-=U[1]*f,z+=U[2]*f,P+=U[3]*f),b){const F=new xe(C,S),K=new xe(z,S),Q=new xe(C,P),X=new xe(z,P),ne=b*Math.PI/180;F._rotate(ne),K._rotate(ne),Q._rotate(ne),X._rotate(ne),C=Math.min(F.x,K.x,Q.x,X.x),z=Math.max(F.x,K.x,Q.x,X.x),S=Math.min(F.y,K.y,Q.y,X.y),P=Math.max(F.y,K.y,Q.y,X.y)}e.emplaceBack(r.x,r.y,C,S,z,P,s,l,u)}this.boxEndIndex=e.length}}class Jp{constructor(e=[],r=Qp){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:s}=this,l=r[e];for(;e>0;){const u=e-1>>1,d=r[u];if(s(l,d)>=0)break;r[e]=d,e=u}r[e]=l}_down(e){const{data:r,compare:s}=this,l=this.length>>1,u=r[e];for(;e=0)break;r[e]=f,e=d}r[e]=u}}function Qp(i,e){return ie?1:0}function ef(i,e=1,r=!1){let s=1/0,l=1/0,u=-1/0,d=-1/0;const f=i[0];for(let C=0;Cu)&&(u=z.x),(!C||z.y>d)&&(d=z.y)}const g=Math.min(u-s,d-l);let v=g/2;const b=new Jp([],tf);if(g===0)return new xe(s,l);for(let C=s;CS.d||!S.d)&&(S=C,r&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,P)),C.max-S.d<=e||(v=C.h/2,b.push(new da(C.p.x-v,C.p.y-v,v,i)),b.push(new da(C.p.x+v,C.p.y-v,v,i)),b.push(new da(C.p.x-v,C.p.y+v,v,i)),b.push(new da(C.p.x+v,C.p.y+v,v,i)),P+=4)}return r&&(console.log(`num probes: ${P}`),console.log(`best distance: ${S.d}`)),S.p}function tf(i,e){return e.max-i.max}function da(i,e,r,s){this.p=new xe(i,e),this.h=r,this.d=function(l,u){let d=!1,f=1/0;for(let g=0;gl.y!=z.y>l.y&&l.x<(z.x-C.x)*(l.y-C.y)/(z.y-C.y)+C.x&&(d=!d),f=Math.min(f,vh(l,C,z))}}return(d?1:-1)*Math.sqrt(f)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}const qc=Number.POSITIVE_INFINITY;function Ou(i,e){return e[1]!==qc?function(r,s,l){let u=0,d=0;switch(s=Math.abs(s),l=Math.abs(l),r){case"top-right":case"top-left":case"top":d=l-7;break;case"bottom-right":case"bottom-left":case"bottom":d=7-l}switch(r){case"top-right":case"bottom-right":case"right":u=-s;break;case"top-left":case"bottom-left":case"left":u=s}return[u,d]}(i,e[0],e[1]):function(r,s){let l=0,u=0;s<0&&(s=0);const d=s/Math.sqrt(2);switch(r){case"top-right":case"top-left":u=d-7;break;case"bottom-right":case"bottom-left":u=7-d;break;case"bottom":u=7-s;break;case"top":u=s-7}switch(r){case"top-right":case"bottom-right":l=-d;break;case"top-left":case"bottom-left":l=d;break;case"left":l=s;break;case"right":l=-s}return[l,u]}(i,e[0])}function jc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function rf(i,e,r,s,l,u,d,f,g,v,b){let S=u.textMaxSize.evaluate(e,{});S===void 0&&(S=d);const P=i.layers[0].layout,C=P.get("icon-offset").evaluate(e,{},b),z=Vu(r.horizontal),U=d/24,F=i.tilePixelRatio*U,K=i.tilePixelRatio*S/24,Q=i.tilePixelRatio*f,X=i.tilePixelRatio*P.get("symbol-spacing"),ne=P.get("text-padding")*i.tilePixelRatio,ae=function(ye,Ve,Re,it=1){const Pt=ye.get("icon-padding").evaluate(Ve,{},Re),zt=Pt&&Pt.values;return[zt[0]*it,zt[1]*it,zt[2]*it,zt[3]*it]}(P,e,b,i.tilePixelRatio),he=P.get("text-max-angle")/180*Math.PI,ze=P.get("text-rotation-alignment")!=="viewport"&&P.get("symbol-placement")!=="point",Be=P.get("icon-rotation-alignment")==="map"&&P.get("symbol-placement")!=="point",Pe=P.get("symbol-placement"),Se=X/2,Te=P.get("icon-text-fit");let Me;s&&Te!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Me=hu(s,r.vertical,Te,P.get("icon-text-fit-padding"),C,U)),z&&(s=hu(s,z,Te,P.get("icon-text-fit-padding"),C,U)));const Ie=(ye,Ve)=>{Ve.x<0||Ve.x>=At||Ve.y<0||Ve.y>=At||function(Re,it,Pt,zt,ii,ar,gi,Yt,ci,_i,Ei,Vi,Jt,yi,Si,zi,Ni,$i,Ut,xi,rt,Qi,vi,Ii,_r){const kr=Re.addToLineVertexArray(it,Pt);let zr,hn,yr,or,qi=0,un=0,vo=0,ju=0,Jc=-1,Qc=-1;const dn={};let Zu=jt(""),eh=0,th=0;if(Yt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[eh,th]=Yt.layout.get("text-offset").evaluate(rt,{},Ii).map(ji=>ji*li):(eh=Yt.layout.get("text-radial-offset").evaluate(rt,{},Ii)*li,th=qc),Re.allowVerticalPlacement&&zt.vertical){const ji=Yt.layout.get("text-rotate").evaluate(rt,{},Ii)+90;yr=new Ml(ci,it,_i,Ei,Vi,zt.vertical,Jt,yi,Si,ji),gi&&(or=new Ml(ci,it,_i,Ei,Vi,gi,Ni,$i,Si,ji))}if(ii){const ji=Yt.layout.get("icon-rotate").evaluate(rt,{}),Xr=Yt.layout.get("icon-text-fit")!=="none",bo=Ru(ii,ji,vi,Xr),wo=gi?Ru(gi,ji,vi,Xr):void 0;hn=new Ml(ci,it,_i,Ei,Vi,ii,Ni,$i,!1,ji),qi=4*bo.length;const Wu=Re.iconSizeData;let ps=null;Wu.kind==="source"?(ps=[Gr*Yt.layout.get("icon-size").evaluate(rt,{})],ps[0]>On&&Vt(`${Re.layerIds[0]}: Value for "icon-size" is >= ${go}. Reduce your "icon-size".`)):Wu.kind==="composite"&&(ps=[Gr*Qi.compositeIconSizes[0].evaluate(rt,{},Ii),Gr*Qi.compositeIconSizes[1].evaluate(rt,{},Ii)],(ps[0]>On||ps[1]>On)&&Vt(`${Re.layerIds[0]}: Value for "icon-size" is >= ${go}. Reduce your "icon-size".`)),Re.addSymbols(Re.icon,bo,ps,xi,Ut,rt,h.WritingMode.none,it,kr.lineStartIndex,kr.lineLength,-1,Ii),Jc=Re.icon.placedSymbolArray.length-1,wo&&(un=4*wo.length,Re.addSymbols(Re.icon,wo,ps,xi,Ut,rt,h.WritingMode.vertical,it,kr.lineStartIndex,kr.lineLength,-1,Ii),Qc=Re.icon.placedSymbolArray.length-1)}const Gu=Object.keys(zt.horizontal);for(const ji of Gu){const Xr=zt.horizontal[ji];if(!zr){Zu=jt(Xr.text);const wo=Yt.layout.get("text-rotate").evaluate(rt,{},Ii);zr=new Ml(ci,it,_i,Ei,Vi,Xr,Jt,yi,Si,wo)}const bo=Xr.positionedLines.length===1;if(vo+=Uu(Re,it,Xr,ar,Yt,Si,rt,zi,kr,zt.vertical?h.WritingMode.horizontal:h.WritingMode.horizontalOnly,bo?Gu:[ji],dn,Jc,Qi,Ii),bo)break}zt.vertical&&(ju+=Uu(Re,it,zt.vertical,ar,Yt,Si,rt,zi,kr,h.WritingMode.vertical,["vertical"],dn,Qc,Qi,Ii));const af=zr?zr.boxStartIndex:Re.collisionBoxArray.length,of=zr?zr.boxEndIndex:Re.collisionBoxArray.length,lf=yr?yr.boxStartIndex:Re.collisionBoxArray.length,cf=yr?yr.boxEndIndex:Re.collisionBoxArray.length,hf=hn?hn.boxStartIndex:Re.collisionBoxArray.length,uf=hn?hn.boxEndIndex:Re.collisionBoxArray.length,df=or?or.boxStartIndex:Re.collisionBoxArray.length,pf=or?or.boxEndIndex:Re.collisionBoxArray.length;let Dr=-1;const kl=(ji,Xr)=>ji&&ji.circleDiameter?Math.max(ji.circleDiameter,Xr):Xr;Dr=kl(zr,Dr),Dr=kl(yr,Dr),Dr=kl(hn,Dr),Dr=kl(or,Dr);const Xu=Dr>-1?1:0;Xu&&(Dr*=_r/li),Re.glyphOffsetArray.length>=ha.MAX_GLYPHS&&Vt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),rt.sortKey!==void 0&&Re.addToSortKeyRanges(Re.symbolInstances.length,rt.sortKey),Re.symbolInstances.emplaceBack(it.x,it.y,dn.right>=0?dn.right:-1,dn.center>=0?dn.center:-1,dn.left>=0?dn.left:-1,dn.vertical||-1,Jc,Qc,Zu,af,of,lf,cf,hf,uf,df,pf,_i,vo,ju,qi,un,Xu,0,Jt,eh,th,Dr)}(i,Ve,ye,r,s,l,Me,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,F,[ne,ne,ne,ne],ze,g,Q,ae,Be,C,e,u,v,b,d)};if(Pe==="line")for(const ye of Cu(e.geometry,0,0,At,At)){const Ve=Yp(ye,X,he,r.vertical||z,s,24,K,i.overscaling,At);for(const Re of Ve)z&&nf(i,z.text,Se,Re)||Ie(ye,Re)}else if(Pe==="line-center"){for(const ye of e.geometry)if(ye.length>1){const Ve=Kp(ye,he,r.vertical||z,s,24,K);Ve&&Ie(ye,Ve)}}else if(e.type==="Polygon")for(const ye of wc(e.geometry,0)){const Ve=ef(ye,16);Ie(ye[0],new Vn(Ve.x,Ve.y,0))}else if(e.type==="LineString")for(const ye of e.geometry)Ie(ye,new Vn(ye[0].x,ye[0].y,0));else if(e.type==="Point")for(const ye of e.geometry)for(const Ve of ye)Ie([Ve],new Vn(Ve.x,Ve.y,0))}function Uu(i,e,r,s,l,u,d,f,g,v,b,S,P,C,z){const U=function(Q,X,ne,ae,he,ze,Be,Pe){const Se=ae.layout.get("text-rotate").evaluate(ze,{})*Math.PI/180,Te=[];for(const Me of X.positionedLines)for(const Ie of Me.positionedGlyphs){if(!Ie.rect)continue;const ye=Ie.rect||{};let Ve=ru+1,Re=!0,it=1,Pt=0;const zt=(he||Pe)&&Ie.vertical,ii=Ie.metrics.advance*Ie.scale/2;if(Pe&&X.verticalizable&&(Pt=Me.lineOffset/2-(Ie.imageName?-(li-Ie.metrics.width*Ie.scale)/2:(Ie.scale-1)*li)),Ie.imageName){const Ut=Be[Ie.imageName];Re=Ut.sdf,it=Ut.pixelRatio,Ve=Ui/it}const ar=he?[Ie.x+ii,Ie.y]:[0,0];let gi=he?[0,0]:[Ie.x+ii+ne[0],Ie.y+ne[1]-Pt],Yt=[0,0];zt&&(Yt=gi,gi=[0,0]);const ci=(Ie.metrics.left-Ve)*Ie.scale-ii+gi[0],_i=(-Ie.metrics.top-Ve)*Ie.scale+gi[1],Ei=ci+ye.w*Ie.scale/it,Vi=_i+ye.h*Ie.scale/it,Jt=new xe(ci,_i),yi=new xe(Ei,_i),Si=new xe(ci,Vi),zi=new xe(Ei,Vi);if(zt){const Ut=new xe(-ii,ii-fo),xi=-Math.PI/2,rt=li/2-ii,Qi=new xe(5-fo-rt,-(Ie.imageName?rt:0)),vi=new xe(...Yt);Jt._rotateAround(xi,Ut)._add(Qi)._add(vi),yi._rotateAround(xi,Ut)._add(Qi)._add(vi),Si._rotateAround(xi,Ut)._add(Qi)._add(vi),zi._rotateAround(xi,Ut)._add(Qi)._add(vi)}if(Se){const Ut=Math.sin(Se),xi=Math.cos(Se),rt=[xi,-Ut,Ut,xi];Jt._matMult(rt),yi._matMult(rt),Si._matMult(rt),zi._matMult(rt)}const Ni=new xe(0,0),$i=new xe(0,0);Te.push({tl:Jt,tr:yi,bl:Si,br:zi,tex:ye,writingMode:X.writingMode,glyphOffset:ar,sectionIndex:Ie.sectionIndex,isSDF:Re,pixelOffsetTL:Ni,pixelOffsetBR:$i,minFontScaleX:0,minFontScaleY:0})}return Te}(0,r,f,l,u,d,s,i.allowVerticalPlacement),F=i.textSizeData;let K=null;F.kind==="source"?(K=[Gr*l.layout.get("text-size").evaluate(d,{})],K[0]>On&&Vt(`${i.layerIds[0]}: Value for "text-size" is >= ${go}. Reduce your "text-size".`)):F.kind==="composite"&&(K=[Gr*C.compositeTextSizes[0].evaluate(d,{},z),Gr*C.compositeTextSizes[1].evaluate(d,{},z)],(K[0]>On||K[1]>On)&&Vt(`${i.layerIds[0]}: Value for "text-size" is >= ${go}. Reduce your "text-size".`)),i.addSymbols(i.text,U,K,f,u,d,v,e,g.lineStartIndex,g.lineLength,P,z);for(const Q of b)S[Q]=i.text.placedSymbolArray.length-1;return 4*U.length}function Vu(i){for(const e in i)return i[e];return null}function nf(i,e,r,s){const l=i.compareText;if(e in l){const u=l[e];for(let d=u.length-1;d>=0;d--)if(s.dist(u[d])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const u=Nu[15&s];if(!u)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new Zc(f,d,u,e)}constructor(e,r=64,s=Float64Array,l){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const u=Nu.indexOf(this.ArrayType),d=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-f%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${s}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=r,s}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Gc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,s,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:d,nodeSize:f}=this,g=[0,u.length-1,0],v=[];for(;g.length;){const b=g.pop()||0,S=g.pop()||0,P=g.pop()||0;if(S-P<=f){for(let F=P;F<=S;F++){const K=d[2*F],Q=d[2*F+1];K>=e&&K<=s&&Q>=r&&Q<=l&&v.push(u[F])}continue}const C=P+S>>1,z=d[2*C],U=d[2*C+1];z>=e&&z<=s&&U>=r&&U<=l&&v.push(u[C]),(b===0?e<=z:r<=U)&&(g.push(P),g.push(C-1),g.push(1-b)),(b===0?s>=z:l>=U)&&(g.push(C+1),g.push(S),g.push(1-b))}return v}within(e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:u,nodeSize:d}=this,f=[0,l.length-1,0],g=[],v=s*s;for(;f.length;){const b=f.pop()||0,S=f.pop()||0,P=f.pop()||0;if(S-P<=d){for(let F=P;F<=S;F++)qu(u[2*F],u[2*F+1],e,r)<=v&&g.push(l[F]);continue}const C=P+S>>1,z=u[2*C],U=u[2*C+1];qu(z,U,e,r)<=v&&g.push(l[C]),(b===0?e-s<=z:r-s<=U)&&(f.push(P),f.push(C-1),f.push(1-b)),(b===0?e+s>=z:r+s>=U)&&(f.push(C+1),f.push(S),f.push(1-b))}return g}}function Gc(i,e,r,s,l,u){if(l-s<=r)return;const d=s+l>>1;$u(i,e,d,s,l,u),Gc(i,e,r,s,d-1,1-u),Gc(i,e,r,d+1,l,1-u)}function $u(i,e,r,s,l,u){for(;l>s;){if(l-s>600){const v=l-s+1,b=r-s+1,S=Math.log(v),P=.5*Math.exp(2*S/3),C=.5*Math.sqrt(S*P*(v-P)/v)*(b-v/2<0?-1:1);$u(i,e,r,Math.max(s,Math.floor(r-b*P/v+C)),Math.min(l,Math.floor(r+(v-b)*P/v+C)),u)}const d=e[2*r+u];let f=s,g=l;for(yo(i,e,s,r),e[2*l+u]>d&&yo(i,e,s,l);fd;)g--}e[2*s+u]===d?yo(i,e,s,g):(g++,yo(i,e,g,l)),g<=r&&(s=g+1),r<=g&&(l=g-1)}}function yo(i,e,r,s){Xc(i,r,s),Xc(e,2*r,2*s),Xc(e,2*r+1,2*s+1)}function Xc(i,e,r){const s=i[e];i[e]=i[r],i[r]=s}function qu(i,e,r,s){const l=i-r,u=e-s;return l*l+u*u}var Wc;h.PerformanceMarkers=void 0,(Wc=h.PerformanceMarkers||(h.PerformanceMarkers={})).create="create",Wc.load="load",Wc.fullLoad="fullLoad";let Cl=null,xo=[];const Hc=1e3/60,Kc="loadTime",Yc="fullLoadTime",sf={mark(i){performance.mark(i)},frame(i){const e=i;Cl!=null&&xo.push(e-Cl),Cl=e},clearMetrics(){Cl=null,xo=[],performance.clearMeasures(Kc),performance.clearMeasures(Yc);for(const i in h.PerformanceMarkers)performance.clearMarks(h.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure(Kc,h.PerformanceMarkers.create,h.PerformanceMarkers.load),performance.measure(Yc,h.PerformanceMarkers.create,h.PerformanceMarkers.fullLoad);const i=performance.getEntriesByName(Kc)[0].duration,e=performance.getEntriesByName(Yc)[0].duration,r=xo.length,s=1/(xo.reduce((u,d)=>u+d,0)/r/1e3),l=xo.filter(u=>u>Hc).reduce((u,d)=>u+(d-Hc)/Hc,0);return{loadTime:i,fullLoadTime:e,fps:s,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};h.AJAXError=Rr,h.ARRAY_TYPE=na,h.Actor=class{constructor(i,e,r){this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Rt(["receive","process"],this),this.invoker=new Wp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Zi()?i:window}send(i,e,r,s,l=!1){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[u]=r);const d=Br(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:i,hasCallback:!!r,targetMapId:s,mustQueue:l,sourceMapId:this.mapId,data:ns(e,d)},d),{cancel:()=>{r&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:s,sourceMapId:this.mapId})}}}receive(i){const e=i.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type===""){delete this.tasks[r];const s=this.cancelCallbacks[r];delete this.cancelCallbacks[r],s&&s()}else Zi()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(!this.taskQueue.length)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){if(e.type===""){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Ar(e.error)):r(null,Ar(e.data)))}else{let r=!1;const s=Br(this.globalScope)?void 0:[],l=e.hasCallback?(f,g)=>{r=!0,delete this.cancelCallbacks[i],this.target.postMessage({id:i,type:"",sourceMapId:this.mapId,error:f?ns(f):null,data:ns(g,s)},s)}:f=>{r=!0};let u=null;const d=Ar(e.data);if(this.parent[e.type])u=this.parent[e.type](e.sourceMapId,d,l);else if(this.parent.getWorkerSource){const f=e.type.split(".");u=this.parent.getWorkerSource(e.sourceMapId,f[0],d.source)[f[1]](d,l)}else l(new Error(`Could not find function ${e.type}`));!r&&u&&u.cancel&&(this.cancelCallbacks[i]=u.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},h.AlphaImage=so,h.CanonicalTileID=$c,h.CollisionBoxArray=c,h.CollisionCircleLayoutArray=class extends Ys{},h.Color=Ze,h.DEMData=Eu,h.DataConstantProperty=Fe,h.DictionaryCoder=Su,h.EXTENT=At,h.ErrorEvent=Xi,h.EvaluationParameters=kt,h.Event=wr,h.Evented=vn,h.FeatureIndex=Au,h.FillBucket=Sc,h.FillExtrusionBucket=Ac,h.GeoJSONFeature=Iu,h.ImageAtlas=su,h.ImagePosition=zc,h.KDBush=Zc,h.LineBucket=Pc,h.LineStripIndexArray=class extends t{},h.LngLat=Un,h.MercatorCoordinate=Sl,h.ONE_EM=li,h.OverscaledTileID=sr,h.PerformanceUtils=sf,h.Point=xe,h.Pos3dArray=class extends Ws{},h.PosArray=O,h.Properties=Ci,h.Protobuf=Cc,h.QuadTriangleArray=class extends Js{},h.RGBAImage=nr,h.RasterBoundsArray=class extends Ja{},h.RequestPerformance=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},h.SegmentVector=Ee,h.SymbolBucket=ha,h.Transitionable=al,h.TriangleIndexArray=ge,h.Uniform1f=gr,h.Uniform1i=class extends Ti{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},h.Uniform2f=class extends Ti{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},h.Uniform3f=class extends Ti{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},h.Uniform4f=cs,h.UniformColor=mi,h.UniformMatrix4f=class extends Ti{constructor(i,e){super(i,e),this.current=ai}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},h.UnwrappedTileID=Tu,h.ValidationError=we,h.ZoomHistory=el,h.addDynamicAttributes=Rc,h.arrayBufferToImage=function(i,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=vr})},r.onerror=()=>e(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 s=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(s):vr},h.arrayBufferToImageBitmap=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(s=>{e(null,s)}).catch(s=>{e(new Error(`Could not load image because of ${s.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},h.asyncAll=function(i,e,r){if(!i.length)return r(null,[]);let s=i.length;const l=new Array(i.length);let u=null;i.forEach((d,f)=>{e(d,(g,v)=>{g&&(u=g),l[f]=v,--s==0&&r(u,l)})})},h.bezier=xt,h.bindAll=Rt,h.clamp=et,h.clipLine=Cu,h.clone=function(i){var e=new na(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},h.clone$1=Ct,h.collisionCircleLayout=Tp,h.config=$n,h.copy=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},h.create=function(){var i=new na(16);return na!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},h.createExpression=Dt,h.createFilter=Fa,h.createLayout=Kt,h.createStyleLayer=function(i){return i.type==="custom"?new Gp(i):new Xp[i.type](i)},h.deepEqual=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let s=0;s{s[d.source]?r.push({command:lt.removeLayer,args:[d.id]}):u.push(d)}),r=r.concat(l),function(d,f,g){f=f||[];const v=(d=d||[]).map(bn),b=f.map(bn),S=d.reduce(en,{}),P=f.reduce(en,{}),C=v.slice(),z=Object.create(null);let U,F,K,Q,X,ne,ae;for(U=0,F=0;U{}}},h.groupByLayout=function(i,e){const r={};for(let l=0;l@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,l,u)=>{const d=l||u;return e[s]=!d||d.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},h.parseGlyphPbf=function(i){return new Cc(i).readFields(Lp,[])},h.pbf=Kh,h.performSymbolLayout=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=At/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0].layout,r=i.bucket.layers[0]._unevaluatedLayout._values,s={layoutIconSize:r["icon-size"].possiblyEvaluate(new kt(i.bucket.zoom+1),i.canonical),layoutTextSize:r["text-size"].possiblyEvaluate(new kt(i.bucket.zoom+1),i.canonical),textMaxSize:r["text-size"].possiblyEvaluate(new kt(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:g,maxZoom:v}=i.bucket.textSizeData;s.compositeTextSizes=[r["text-size"].possiblyEvaluate(new kt(g),i.canonical),r["text-size"].possiblyEvaluate(new kt(v),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:g,maxZoom:v}=i.bucket.iconSizeData;s.compositeIconSizes=[r["icon-size"].possiblyEvaluate(new kt(g),i.canonical),r["icon-size"].possiblyEvaluate(new kt(v),i.canonical)]}const l=e.get("text-line-height")*li,u=e.get("text-rotation-alignment")!=="viewport"&&e.get("symbol-placement")!=="point",d=e.get("text-keep-upright"),f=e.get("text-size");for(const g of i.bucket.features){const v=e.get("text-font").evaluate(g,{},i.canonical).join(","),b=f.evaluate(g,{},i.canonical),S=s.layoutTextSize.evaluate(g,{},i.canonical),P=s.layoutIconSize.evaluate(g,{},i.canonical),C={horizontal:{},vertical:void 0},z=g.text;let U,F=[0,0];if(z){const X=z.toString(),ne=e.get("text-letter-spacing").evaluate(g,{},i.canonical)*li,ae=qa(X)?ne:0,he=e.get("text-anchor").evaluate(g,{},i.canonical),ze=e.get("text-variable-anchor");if(!ze){const Me=e.get("text-radial-offset").evaluate(g,{},i.canonical);F=Me?Ou(he,[Me*li,qc]):e.get("text-offset").evaluate(g,{},i.canonical).map(Ie=>Ie*li)}let Be=u?"center":e.get("text-justify").evaluate(g,{},i.canonical);const Pe=e.get("symbol-placement"),Se=Pe==="point"?e.get("text-max-width").evaluate(g,{},i.canonical)*li:0,Te=()=>{i.bucket.allowVerticalPlacement&&Vs(X)&&(C.vertical=bl(z,i.glyphMap,i.glyphPositions,i.imagePositions,v,Se,l,he,"left",ae,F,h.WritingMode.vertical,!0,Pe,S,b))};if(!u&&ze){const Me=Be==="auto"?ze.map(ye=>jc(ye)):[Be];let Ie=!1;for(let ye=0;yethis._layers[fe.id]),J=Z[0];if(J.visibility==="none")continue;const W=J.source||"";let G=this.familiesBySource[W];G||(G=this.familiesBySource[W]={});const te=J.sourceLayer||"_geojsonTileLayer";let de=G[te];de||(de=G[te]=[]),de.push(Z)}}}class Y{constructor(A){const M={},L=[];for(const W in A){const G=A[W],te=M[W]={};for(const de in G){const fe=G[+de];if(!fe||fe.bitmap.width===0||fe.bitmap.height===0)continue;const pe={x:0,y:0,w:fe.bitmap.width+2,h:fe.bitmap.height+2};L.push(pe),te[de]={rect:pe,metrics:fe.metrics}}}const{w:j,h:Z}=h.potpack(L),J=new h.AlphaImage({width:j||1,height:Z||1});for(const W in A){const G=A[W];for(const te in G){const de=G[+te];if(!de||de.bitmap.width===0||de.bitmap.height===0)continue;const fe=M[W][te].rect;h.AlphaImage.copy(de.bitmap,J,{x:0,y:0},{x:fe.x+1,y:fe.y+1},de.bitmap)}}this.image=J,this.positions=M}}h.register("GlyphAtlas",Y);class Ne{constructor(A){this.tileID=new h.OverscaledTileID(A.tileID.overscaledZ,A.tileID.wrap,A.tileID.canonical.z,A.tileID.canonical.x,A.tileID.canonical.y),this.uid=A.uid,this.zoom=A.zoom,this.pixelRatio=A.pixelRatio,this.tileSize=A.tileSize,this.source=A.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=A.showCollisionBoxes,this.collectResourceTiming=!!A.collectResourceTiming,this.returnDependencies=!!A.returnDependencies,this.promoteId=A.promoteId}parse(A,M,L,j,Z){this.status="parsing",this.data=A,this.collisionBoxArray=new h.CollisionBoxArray;const J=new h.DictionaryCoder(Object.keys(A.layers).sort()),W=new h.FeatureIndex(this.tileID,this.promoteId);W.bucketLayerIDs=[];const G={},te={featureIndex:W,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:L},de=M.familiesBySource[this.source];for(const tt in de){const ct=A.layers[tt];if(!ct)continue;ct.version===1&&h.warnOnce(`Vector tile source "${this.source}" layer "${tt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Tt=J.encode(tt),Xt=[];for(let Ze=0;Ze=Lt.maxzoom||Lt.visibility!=="none"&&(xe(Ze,this.zoom,L),(G[Lt.id]=Lt.createBucket({index:W.bucketLayerIDs.length,layers:Ze,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Tt,sourceID:this.source})).populate(Xt,te,this.tileID.canonical),W.bucketLayerIDs.push(Ze.map(Vr=>Vr.id)))}}let fe,pe,$e,Xe;const Le=h.mapObject(te.glyphDependencies,tt=>Object.keys(tt).map(Number));Object.keys(Le).length?j.send("getGlyphs",{uid:this.uid,stacks:Le,source:this.source,tileID:this.tileID,type:"glyphs"},(tt,ct)=>{fe||(fe=tt,pe=ct,at.call(this))}):pe={};const Oe=Object.keys(te.iconDependencies);Oe.length?j.send("getImages",{icons:Oe,source:this.source,tileID:this.tileID,type:"icons"},(tt,ct)=>{fe||(fe=tt,$e=ct,at.call(this))}):$e={};const Ge=Object.keys(te.patternDependencies);function at(){if(fe)return Z(fe);if(pe&&$e&&Xe){const tt=new Y(pe),ct=new h.ImageAtlas($e,Xe);for(const Tt in G){const Xt=G[Tt];Xt instanceof h.SymbolBucket?(xe(Xt.layers,this.zoom,L),h.performSymbolLayout({bucket:Xt,glyphMap:pe,glyphPositions:tt.positions,imageMap:$e,imagePositions:ct.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Xt.hasPattern&&(Xt instanceof h.LineBucket||Xt instanceof h.FillBucket||Xt instanceof h.FillExtrusionBucket)&&(xe(Xt.layers,this.zoom,L),Xt.addFeatures(te,this.tileID.canonical,ct.patternPositions))}this.status="done",Z(null,{buckets:Object.values(G).filter(Tt=>!Tt.isEmpty()),featureIndex:W,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:tt.image,imageAtlas:ct,glyphMap:this.returnDependencies?pe:null,iconMap:this.returnDependencies?$e:null,glyphPositions:this.returnDependencies?tt.positions:null})}}Ge.length?j.send("getImages",{icons:Ge,source:this.source,tileID:this.tileID,type:"patterns"},(tt,ct)=>{fe||(fe=tt,Xe=ct,at.call(this))}):Xe={},at.call(this)}}function xe(N,A,M){const L=new h.EvaluationParameters(A);for(const j of N)j.recalculate(L,M)}function nt(N,A){const M=h.getArrayBuffer(N.request,(L,j,Z,J)=>{L?A(L):j&&A(null,{vectorTile:new h.vectorTile.VectorTile(new h.Protobuf(j)),rawData:j,cacheControl:Z,expires:J})});return()=>{M.cancel(),A()}}class ot{constructor(A,M,L,j){this.actor=A,this.layerIndex=M,this.availableImages=L,this.loadVectorData=j||nt,this.loading={},this.loaded={}}loadTile(A,M){const L=A.uid;this.loading||(this.loading={});const j=!!(A&&A.request&&A.request.collectResourceTiming)&&new h.RequestPerformance(A.request),Z=this.loading[L]=new Ne(A);Z.abort=this.loadVectorData(A,(J,W)=>{if(delete this.loading[L],J||!W)return Z.status="done",this.loaded[L]=Z,M(J);const G=W.rawData,te={};W.expires&&(te.expires=W.expires),W.cacheControl&&(te.cacheControl=W.cacheControl);const de={};if(j){const fe=j.finish();fe&&(de.resourceTiming=JSON.parse(JSON.stringify(fe)))}Z.vectorTile=W.vectorTile,Z.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,(fe,pe)=>{if(fe||!pe)return M(fe);M(null,h.extend({rawTileData:G.slice(0)},pe,te,de))}),this.loaded=this.loaded||{},this.loaded[L]=Z})}reloadTile(A,M){const L=this.loaded,j=A.uid,Z=this;if(L&&L[j]){const J=L[j];J.showCollisionBoxes=A.showCollisionBoxes;const W=(G,te)=>{const de=J.reloadCallback;de&&(delete J.reloadCallback,J.parse(J.vectorTile,Z.layerIndex,this.availableImages,Z.actor,de)),M(G,te)};J.status==="parsing"?J.reloadCallback=W:J.status==="done"&&(J.vectorTile?J.parse(J.vectorTile,this.layerIndex,this.availableImages,this.actor,W):W())}}abortTile(A,M){const L=this.loading,j=A.uid;L&&L[j]&&L[j].abort&&(L[j].abort(),delete L[j]),M()}removeTile(A,M){const L=this.loaded,j=A.uid;L&&L[j]&&delete L[j],M()}}class We{constructor(){this.loaded={}}loadTile(A,M){const{uid:L,encoding:j,rawImageData:Z}=A,J=h.isImageBitmap(Z)?this.getImageData(Z):Z,W=new h.DEMData(L,J,j);this.loaded=this.loaded||{},this.loaded[L]=W,M(null,W)}getImageData(A){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(A.width,A.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=A.width,this.offscreenCanvas.height=A.height,this.offscreenCanvasContext.drawImage(A,0,0,A.width,A.height);const M=this.offscreenCanvasContext.getImageData(-1,-1,A.width+2,A.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new h.RGBAImage({width:M.width,height:M.height},M.data)}removeTile(A){const M=this.loaded,L=A.uid;M&&M[L]&&delete M[L]}}function xt(N,A){if(N.length!==0){bt(N[0],A);for(var M=1;M=Math.abs(W)?M-G+W:W-G+M,M=G}M+L>=0!=!!A&&N.reverse()}var et=h.getDefaultExportFromCjs(function N(A,M){var L,j=A&&A.type;if(j==="FeatureCollection")for(L=0;L>31}function vr(N,A){for(var M=N.loadGeometry(),L=N.type,j=0,Z=0,J=M.length,W=0;WN},$n=Math.fround||(Rr=new Float32Array(1),N=>(Rr[0]=+N,Rr[0]));var Rr;const bi=3,Gi=5,hi=6;class yn{constructor(A){this.options=Object.assign(Object.create(_n),A),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(A){const{log:M,minZoom:L,maxZoom:j}=this.options;M&&console.time("total time");const Z=`prepare ${A.length} points`;M&&console.time(Z),this.points=A;const J=[];for(let G=0;G=L;G--){const te=+Date.now();W=this.trees[G]=this._createTree(this._cluster(W,G)),M&&console.log("z%d: %d clusters in %dms",G,W.numItems,+Date.now()-te)}return M&&console.timeEnd("total time"),this}getClusters(A,M){let L=((A[0]+180)%360+360)%360-180;const j=Math.max(-90,Math.min(90,A[1]));let Z=A[2]===180?180:((A[2]+180)%360+360)%360-180;const J=Math.max(-90,Math.min(90,A[3]));if(A[2]-A[0]>=360)L=-180,Z=180;else if(L>Z){const fe=this.getClusters([L,j,180,J],M),pe=this.getClusters([-180,j,Z,J],M);return fe.concat(pe)}const W=this.trees[this._limitZoom(M)],G=W.range(Fr(L),br(J),Fr(Z),br(j)),te=W.data,de=[];for(const fe of G){const pe=this.stride*fe;de.push(te[pe+Gi]>1?xn(te,pe,this.clusterProps):this.points[te[pe+bi]])}return de}getChildren(A){const M=this._getOriginId(A),L=this._getOriginZoom(A),j="No cluster with the specified id.",Z=this.trees[L];if(!Z)throw new Error(j);const J=Z.data;if(M*this.stride>=J.length)throw new Error(j);const W=this.options.radius/(this.options.extent*Math.pow(2,L-1)),G=Z.within(J[M*this.stride],J[M*this.stride+1],W),te=[];for(const de of G){const fe=de*this.stride;J[fe+4]===A&&te.push(J[fe+Gi]>1?xn(J,fe,this.clusterProps):this.points[J[fe+bi]])}if(te.length===0)throw new Error(j);return te}getLeaves(A,M,L){const j=[];return this._appendLeaves(j,A,M=M||10,L=L||0,0),j}getTile(A,M,L){const j=this.trees[this._limitZoom(A)],Z=Math.pow(2,A),{extent:J,radius:W}=this.options,G=W/J,te=(L-G)/Z,de=(L+1+G)/Z,fe={features:[]};return this._addTileFeatures(j.range((M-G)/Z,te,(M+1+G)/Z,de),j.data,M,L,Z,fe),M===0&&this._addTileFeatures(j.range(1-G/Z,te,1,de),j.data,Z,L,Z,fe),M===Z-1&&this._addTileFeatures(j.range(0,te,G/Z,de),j.data,-1,L,Z,fe),fe.features.length?fe:null}getClusterExpansionZoom(A){let M=this._getOriginZoom(A)-1;for(;M<=this.options.maxZoom;){const L=this.getChildren(A);if(M++,L.length!==1)break;A=L[0].properties.cluster_id}return M}_appendLeaves(A,M,L,j,Z){const J=this.getChildren(M);for(const W of J){const G=W.properties;if(G&&G.cluster?Z+G.point_count<=j?Z+=G.point_count:Z=this._appendLeaves(A,G.cluster_id,L,j,Z):Z1;let de,fe,pe;if(te)de=Yr(M,G,this.clusterProps),fe=M[G],pe=M[G+1];else{const Le=this.points[M[G+bi]];de=Le.properties;const[Oe,Ge]=Le.geometry.coordinates;fe=Fr(Oe),pe=br(Ge)}const $e={type:1,geometry:[[Math.round(this.options.extent*(fe*Z-L)),Math.round(this.options.extent*(pe*Z-j))]],tags:de};let Xe;Xe=te||this.options.generateId?M[G+bi]:this.points[M[G+bi]].id,Xe!==void 0&&($e.id=Xe),J.features.push($e)}}_limitZoom(A){return Math.max(this.options.minZoom,Math.min(Math.floor(+A),this.options.maxZoom+1))}_cluster(A,M){const{radius:L,extent:j,reduce:Z,minPoints:J}=this.options,W=L/(j*Math.pow(2,M)),G=A.data,te=[],de=this.stride;for(let fe=0;feM&&(Oe+=G[at+Gi])}if(Oe>Le&&Oe>=J){let Ge,at=pe*Le,tt=$e*Le,ct=-1;const Tt=((fe/de|0)<<5)+(M+1)+this.points.length;for(const Xt of Xe){const Ze=Xt*de;if(G[Ze+2]<=M)continue;G[Ze+2]=M;const Lt=G[Ze+Gi];at+=G[Ze]*Lt,tt+=G[Ze+1]*Lt,G[Ze+4]=Tt,Z&&(Ge||(Ge=this._map(G,fe,!0),ct=this.clusterProps.length,this.clusterProps.push(Ge)),Z(Ge,this._map(G,Ze)))}G[fe+4]=Tt,te.push(at/Oe,tt/Oe,1/0,Tt,-1,Oe),Z&&te.push(ct)}else{for(let Ge=0;Ge1)for(const Ge of Xe){const at=Ge*de;if(!(G[at+2]<=M)){G[at+2]=M;for(let tt=0;tt>5}_getOriginZoom(A){return(A-this.points.length)%32}_map(A,M,L){if(A[M+Gi]>1){const J=this.clusterProps[A[M+hi]];return L?Object.assign({},J):J}const j=this.points[A[M+bi]].properties,Z=this.options.map(j);return L&&Z===j?Object.assign({},Z):Z}}function xn(N,A,M){return{type:"Feature",id:N[A+bi],properties:Yr(N,A,M),geometry:{type:"Point",coordinates:[(L=N[A],360*(L-.5)),wr(N[A+1])]}};var L}function Yr(N,A,M){const L=N[A+Gi],j=L>=1e4?`${Math.round(L/1e3)}k`:L>=1e3?Math.round(L/100)/10+"k":L,Z=N[A+hi],J=Z===-1?{}:Object.assign({},M[Z]);return Object.assign(J,{cluster:!0,cluster_id:N[A+bi],point_count:L,point_count_abbreviated:j})}function Fr(N){return N/360+.5}function br(N){const A=Math.sin(N*Math.PI/180),M=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return M<0?0:M>1?1:M}function wr(N){const A=(180-360*N)*Math.PI/180;return 360*Math.atan(Math.exp(A))/Math.PI-90}function Xi(N,A,M,L){for(var j,Z=L,J=M-A>>1,W=M-A,G=N[A],te=N[A+1],de=N[M],fe=N[M+1],pe=A+3;peZ)j=pe,Z=$e;else if($e===Z){var Xe=Math.abs(pe-J);XeL&&(j-A>3&&Xi(N,A,j,L),N[j+2]=Z,M-j>3&&Xi(N,j,M,L))}function vn(N,A,M,L,j,Z){var J=j-M,W=Z-L;if(J!==0||W!==0){var G=((N-M)*J+(A-L)*W)/(J*J+W*W);G>1?(M=j,L=Z):G>0&&(M+=J*G,L+=W*G)}return(J=N-M)*J+(W=A-L)*W}function le(N,A,M,L){var j={id:N===void 0?null:N,type:A,geometry:M,tags:L,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Z){var J=Z.geometry,W=Z.type;if(W==="Point"||W==="MultiPoint"||W==="LineString")Or(Z,J);else if(W==="Polygon"||W==="MultiLineString")for(var G=0;G0&&(J+=L?(j*te-G*Z)/2:Math.sqrt(Math.pow(G-j,2)+Math.pow(te-Z,2))),j=G,Z=te}var de=A.length-3;A[2]=1,Xi(A,0,de,M),A[de+2]=1,A.size=Math.abs(J),A.start=0,A.end=A.size}function Jr(N,A,M,L){for(var j=0;j1?1:M}function Gt(N,A,M,L,j,Z,J,W){if(L/=A,Z>=(M/=A)&&J=L)return null;for(var G=[],te=0;te=M&&Xe=L)){var Le=[];if(pe==="Point"||pe==="MultiPoint")Qr(fe,Le,M,L,j);else if(pe==="LineString")bn(fe,Le,M,L,j,!1,W.lineMetrics);else if(pe==="MultiLineString")we(fe,Le,M,L,j,!1);else if(pe==="Polygon")we(fe,Le,M,L,j,!0);else if(pe==="MultiPolygon")for(var Oe=0;Oe=M&&J<=L&&(A.push(N[Z]),A.push(N[Z+1]),A.push(N[Z+2]))}}function bn(N,A,M,L,j,Z,J){for(var W,G,te=en(N),de=j===0?fi:wn,fe=N.start,pe=0;peM&&(G=de(te,$e,Xe,Oe,Ge,M),J&&(te.start=fe+W*G)):at>L?tt=M&&(G=de(te,$e,Xe,Oe,Ge,M),ct=!0),tt>L&&at<=L&&(G=de(te,$e,Xe,Oe,Ge,L),ct=!0),!Z&&ct&&(J&&(te.end=fe+W*G),A.push(te),te=en(N)),J&&(fe+=W)}var Tt=N.length-3;$e=N[Tt],Xe=N[Tt+1],Le=N[Tt+2],(at=j===0?$e:Xe)>=M&&at<=L&&lr(te,$e,Xe,Le),Tt=te.length-3,Z&&Tt>=3&&(te[Tt]!==te[0]||te[Tt+1]!==te[1])&&lr(te,te[0],te[1],te[2]),te.length&&A.push(te)}function en(N){var A=[];return A.size=N.size,A.start=N.start,A.end=N.end,A}function we(N,A,M,L,j,Z){for(var J=0;JJ.maxX&&(J.maxX=de),fe>J.maxY&&(J.maxY=fe)}return J}function Qt(N,A,M,L){var j=A.geometry,Z=A.type,J=[];if(Z==="Point"||Z==="MultiPoint")for(var W=0;W0&&A.size<(j?J:L))M.numPoints+=A.length/3;else{for(var W=[],G=0;GJ)&&(M.numSimplified++,W.push(A[G]),W.push(A[G+1])),M.numPoints++;j&&function(te,de){for(var fe=0,pe=0,$e=te.length,Xe=$e-2;pe<$e;Xe=pe,pe+=2)fe+=(te[pe]-te[Xe])*(te[pe+1]+te[Xe+1]);if(fe>0===de)for(pe=0,$e=te.length;pe<$e/2;pe+=2){var Le=te[pe],Oe=te[pe+1];te[pe]=te[$e-2-pe],te[pe+1]=te[$e-1-pe],te[$e-2-pe]=Le,te[$e-1-pe]=Oe}}(W,Z),N.push(W)}}function Tr(N,A){var M=(A=this.options=function(j,Z){for(var J in Z)j[J]=Z[J];return j}(Object.create(this.options),A)).debug;if(M&&console.time("preprocess data"),A.maxZoom<0||A.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(A.promoteId&&A.generateId)throw new Error("promoteId and generateId cannot be used together.");var L=function(j,Z){var J=[];if(j.type==="FeatureCollection")for(var W=0;W1&&console.time("creation"),pe=this.tiles[fe]=Pi(N,A,M,L,G),this.tileCoords.push({z:A,x:M,y:L}),te)){te>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",A,M,L,pe.numFeatures,pe.numPoints,pe.numSimplified),console.timeEnd("creation"));var $e="z"+A;this.stats[$e]=(this.stats[$e]||0)+1,this.total++}if(pe.source=N,j){if(A===G.maxZoom||A===j)continue;var Xe=1<1&&console.time("clipping");var Le,Oe,Ge,at,tt,ct,Tt=.5*G.buffer/G.extent,Xt=.5-Tt,Ze=.5+Tt,Lt=1+Tt;Le=Oe=Ge=at=null,tt=Gt(N,de,M-Tt,M+Ze,0,pe.minX,pe.maxX,G),ct=Gt(N,de,M+Xt,M+Lt,0,pe.minX,pe.maxX,G),N=null,tt&&(Le=Gt(tt,de,L-Tt,L+Ze,1,pe.minY,pe.maxY,G),Oe=Gt(tt,de,L+Xt,L+Lt,1,pe.minY,pe.maxY,G),tt=null),ct&&(Ge=Gt(ct,de,L-Tt,L+Ze,1,pe.minY,pe.maxY,G),at=Gt(ct,de,L+Xt,L+Lt,1,pe.minY,pe.maxY,G),ct=null),te>1&&console.timeEnd("clipping"),W.push(Le||[],A+1,2*M,2*L),W.push(Oe||[],A+1,2*M,2*L+1),W.push(Ge||[],A+1,2*M+1,2*L),W.push(at||[],A+1,2*M+1,2*L+1)}}},Tr.prototype.getTile=function(N,A,M){var L=this.options,j=L.extent,Z=L.debug;if(N<0||N>24)return null;var J=1<1&&console.log("drilling down to z%d-%d-%d",N,A,M);for(var G,te=N,de=A,fe=M;!G&&te>0;)te--,de=Math.floor(de/2),fe=Math.floor(fe/2),G=this.tiles[Er(te,de,fe)];return G&&G.source?(Z>1&&console.log("found parent tile z%d-%d-%d",te,de,fe),Z>1&&console.time("drilling down"),this.splitTile(G.source,te,de,fe,N,A,M),Z>1&&console.timeEnd("drilling down"),this.tiles[W]?Qe(this.tiles[W],j):null):null};class Zn extends ot{constructor(A,M,L,j){super(A,M,L,St),this._dataUpdateable=new Map,this.loadGeoJSON=(Z,J)=>{const{promoteId:W}=Z;if(Z.request)return h.getJSON(Z.request,(G,te,de,fe)=>{this._dataUpdateable=Sr(te,W)?ui(te,W):void 0,J(G,te,de,fe)});if(typeof Z.data=="string")try{const G=JSON.parse(Z.data);this._dataUpdateable=Sr(G,W)?ui(G,W):void 0,J(null,G)}catch{J(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`))}else Z.dataDiff?this._dataUpdateable?(function(G,te,de){var fe,pe,$e,Xe;if(te.removeAll&&G.clear(),te.remove)for(const Le of te.remove)G.delete(Le);if(te.add)for(const Le of te.add){const Oe=er(Le,de);Oe!=null&&G.set(Oe,Le)}if(te.update)for(const Le of te.update){let Oe=G.get(Le.id);if(Oe==null)continue;const Ge=!Le.removeAllProperties&&(((fe=Le.removeProperties)===null||fe===void 0?void 0:fe.length)>0||((pe=Le.addOrUpdateProperties)===null||pe===void 0?void 0:pe.length)>0);if((Le.newGeometry||Le.removeAllProperties||Ge)&&(Oe={...Oe},G.set(Le.id,Oe),Ge&&(Oe.properties={...Oe.properties})),Le.newGeometry&&(Oe.geometry=Le.newGeometry),Le.removeAllProperties)Oe.properties={};else if((($e=Le.removeProperties)===null||$e===void 0?void 0:$e.length)>0)for(const at of Le.removeProperties)Object.prototype.hasOwnProperty.call(Oe.properties,at)&&delete Oe.properties[at];if(((Xe=Le.addOrUpdateProperties)===null||Xe===void 0?void 0:Xe.length)>0)for(const{key:at,value:tt}of Le.addOrUpdateProperties)Oe.properties[at]=tt}}(this._dataUpdateable,Z.dataDiff,W),J(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):J(new Error(`Cannot update existing geojson data in ${Z.source}`)):J(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},j&&(this.loadGeoJSON=j)}loadData(A,M){var L;(L=this._pendingRequest)===null||L===void 0||L.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const j=!!(A&&A.request&&A.request.collectResourceTiming)&&new h.RequestPerformance(A.request);this._pendingCallback=M,this._pendingRequest=this.loadGeoJSON(A,(Z,J)=>{if(delete this._pendingCallback,delete this._pendingRequest,Z||!J)return M(Z);if(typeof J!="object")return M(new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`));{et(J,!0);try{if(A.filter){const G=h.createExpression(A.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(G.result==="error")throw new Error(G.value.map(de=>`${de.key}: ${de.message}`).join(", "));J={type:"FeatureCollection",features:J.features.filter(de=>G.value.evaluate({zoom:0},de))}}this._geoJSONIndex=A.cluster?new yn(function({superclusterOptions:G,clusterProperties:te}){if(!te||!G)return G;const de={},fe={},pe={accumulated:null,zoom:0},$e={properties:null},Xe=Object.keys(te);for(const Le of Xe){const[Oe,Ge]=te[Le],at=h.createExpression(Ge),tt=h.createExpression(typeof Oe=="string"?[Oe,["accumulated"],["get",Le]]:Oe);de[Le]=at.value,fe[Le]=tt.value}return G.map=Le=>{$e.properties=Le;const Oe={};for(const Ge of Xe)Oe[Ge]=de[Ge].evaluate(pe,$e);return Oe},G.reduce=(Le,Oe)=>{$e.properties=Oe;for(const Ge of Xe)pe.accumulated=Le[Ge],Le[Ge]=fe[Ge].evaluate(pe,$e)},G}(A)).load(J.features):function(G,te){return new Tr(G,te)}(J,A.geojsonVtOptions)}catch(G){return M(G)}this.loaded={};const W={};if(j){const G=j.finish();G&&(W.resourceTiming={},W.resourceTiming[A.source]=JSON.parse(JSON.stringify(G)))}M(null,W)}})}reloadTile(A,M){const L=this.loaded;return L&&L[A.uid]?super.reloadTile(A,M):this.loadTile(A,M)}removeSource(A,M){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),M()}getClusterExpansionZoom(A,M){try{M(null,this._geoJSONIndex.getClusterExpansionZoom(A.clusterId))}catch(L){M(L)}}getClusterChildren(A,M){try{M(null,this._geoJSONIndex.getChildren(A.clusterId))}catch(L){M(L)}}getClusterLeaves(A,M){try{M(null,this._geoJSONIndex.getLeaves(A.clusterId,A.limit,A.offset))}catch(L){M(L)}}}class cr{constructor(A){this.self=A,this.actor=new h.Actor(A,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:ot,geojson:Zn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(M,L)=>{if(this.workerSourceTypes[M])throw new Error(`Worker source with name "${M}" already registered.`);this.workerSourceTypes[M]=L},this.self.registerRTLTextPlugin=M=>{if(h.plugin.isParsed())throw new Error("RTL text plugin already registered.");h.plugin.applyArabicShaping=M.applyArabicShaping,h.plugin.processBidirectionalText=M.processBidirectionalText,h.plugin.processStyledBidirectionalText=M.processStyledBidirectionalText}}setReferrer(A,M){this.referrer=M}setImages(A,M,L){this.availableImages[A]=M;for(const j in this.workerSources[A]){const Z=this.workerSources[A][j];for(const J in Z)Z[J].availableImages=M}L()}setLayers(A,M,L){this.getLayerIndex(A).replace(M),L()}updateLayers(A,M,L){this.getLayerIndex(A).update(M.layers,M.removedIds),L()}loadTile(A,M,L){this.getWorkerSource(A,M.type,M.source).loadTile(M,L)}loadDEMTile(A,M,L){this.getDEMWorkerSource(A,M.source).loadTile(M,L)}reloadTile(A,M,L){this.getWorkerSource(A,M.type,M.source).reloadTile(M,L)}abortTile(A,M,L){this.getWorkerSource(A,M.type,M.source).abortTile(M,L)}removeTile(A,M,L){this.getWorkerSource(A,M.type,M.source).removeTile(M,L)}removeDEMTile(A,M){this.getDEMWorkerSource(A,M.source).removeTile(M)}removeSource(A,M,L){if(!this.workerSources[A]||!this.workerSources[A][M.type]||!this.workerSources[A][M.type][M.source])return;const j=this.workerSources[A][M.type][M.source];delete this.workerSources[A][M.type][M.source],j.removeSource!==void 0?j.removeSource(M,L):L()}loadWorkerSource(A,M,L){try{this.self.importScripts(M.url),L()}catch(j){L(j.toString())}}syncRTLPluginState(A,M,L){try{h.plugin.setState(M);const j=h.plugin.getPluginURL();if(h.plugin.isLoaded()&&!h.plugin.isParsed()&&j!=null){this.self.importScripts(j);const Z=h.plugin.isParsed();L(Z?void 0:new Error(`RTL Text Plugin failed to import scripts from ${j}`),Z)}}catch(j){L(j.toString())}}getAvailableImages(A){let M=this.availableImages[A];return M||(M=[]),M}getLayerIndex(A){let M=this.layerIndexes[A];return M||(M=this.layerIndexes[A]=new ce),M}getWorkerSource(A,M,L){if(this.workerSources[A]||(this.workerSources[A]={}),this.workerSources[A][M]||(this.workerSources[A][M]={}),!this.workerSources[A][M][L]){const j={send:(Z,J,W)=>{this.actor.send(Z,J,W,A)}};this.workerSources[A][M][L]=new this.workerSourceTypes[M](j,this.getLayerIndex(A),this.getAvailableImages(A))}return this.workerSources[A][M][L]}getDEMWorkerSource(A,M){return this.demWorkerSources[A]||(this.demWorkerSources[A]={}),this.demWorkerSources[A][M]||(this.demWorkerSources[A][M]=new We),this.demWorkerSources[A][M]}}return h.isWorker()&&(self.worker=new cr(self)),cr}),ie(["./shared"],function(h){var ce="3.1.0";class Y{static testProp(t){if(!Y.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",Y.suppressClickInternal,!0)},0)}static mousePos(t,n){const a=t.getBoundingClientRect();return new h.Point(n.clientX-a.left-t.clientLeft,n.clientY-a.top-t.clientTop)}static touchPos(t,n){const a=t.getBoundingClientRect(),c=[];for(let p=0;p{t=[],n=0,a=0,c={}},o.addThrottleControl=x=>{const T=a++;return c[T]=x,T},o.removeThrottleControl=x=>{delete c[x],y()},o.getImage=(x,T,w=!0)=>{Ne.supported&&(x.headers||(x.headers={}),x.headers.accept="image/webp,*/*");const k={requestParameters:x,supportImageRefresh:w,callback:T,cancelled:!1,completed:!1,cancel:()=>{k.completed||k.cancelled||(k.cancelled=!0,k.innerRequest&&(k.innerRequest.cancel(),n--),y())}};return t.push(k),y(),k};const p=x=>{const{requestParameters:T,supportImageRefresh:w,callback:k}=x;return h.extend(T,{type:"image"}),(w!==!1||h.isWorker()||h.getProtocolAction(T.url)||T.headers&&!Object.keys(T.headers).reduce((O,B)=>O&&B==="accept",!0)?h.makeRequest:_)(T,(O,B,R,q)=>{m(x,k,O,B,R,q)})},m=(x,T,w,k,O,B)=>{w?T(w):k instanceof HTMLImageElement||k instanceof ImageBitmap?T(null,k):k&&((R,q)=>{typeof createImageBitmap=="function"?h.arrayBufferToImageBitmap(R,q):h.arrayBufferToImage(R,q)})(k,(R,q)=>{R!=null?T(R):q!=null&&T(null,q,{cacheControl:O,expires:B})}),x.cancelled||(x.completed=!0,n--,y())},y=()=>{const x=(()=>{const T=Object.keys(c);let w=!1;if(T.length>0){for(const k of T)if(w=c[k](),w)break}return w})()?h.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:h.config.MAX_PARALLEL_IMAGE_REQUESTS;for(let T=n;T0;T++){const w=t.shift();if(w.cancelled){T--;continue}const k=p(w);n++,w.innerRequest=k}},_=(x,T)=>{const w=new Image,k=x.url;let O=!1;const B=x.credentials;return B&&B==="include"?w.crossOrigin="use-credentials":(B&&B==="same-origin"||!h.sameOrigin(k))&&(w.crossOrigin="anonymous"),w.fetchPriority="high",w.onload=()=>{T(null,w),w.onerror=w.onload=null},w.onerror=()=>{O||T(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.")),w.onerror=w.onload=null},w.src=k,{cancel:()=>{O=!0,w.src=""}}}}(bt||(bt={})),bt.resetRequestQueue();var et,Bt=bt;(function(o){o.Glyphs="Glyphs",o.Image="Image",o.Source="Source",o.SpriteImage="SpriteImage",o.SpriteJSON="SpriteJSON",o.Style="Style",o.Tile="Tile",o.Unknown="Unknown"})(et||(et={}));class pt{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,a){const c=function(p){const m=p.match(ri);if(!m)throw new Error(`Unable to parse URL "${p}"`);return{protocol:m[1],authority:m[2],path:m[3]||"/",params:m[4]?m[4].split("&"):[]}}(t);return c.path+=`${n}${a}`,function(p){const m=p.params.length?`?${p.params.join("&")}`:"";return`${p.protocol}://${p.authority}${p.path}${m}`}(c)}setTransformRequest(t){this._transformRequestFn=t}}const ri=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Rt(o){var t=new h.ARRAY_TYPE(3);return t[0]=o[0],t[1]=o[1],t[2]=o[2],t}var Ai,Mt=function(o,t,n){return o[0]=t[0]-n[0],o[1]=t[1]-n[1],o[2]=t[2]-n[2],o};Ai=new h.ARRAY_TYPE(3),h.ARRAY_TYPE!=Float32Array&&(Ai[0]=0,Ai[1]=0,Ai[2]=0);var Ct=function(o){var t=o[0],n=o[1];return t*t+n*n};function ni(o){const t=[];if(typeof o=="string")t.push({id:"default",url:o});else if(o&&o.length>0){const n=[];for(const{id:a,url:c}of o){const p=`${a}${c}`;n.indexOf(p)===-1&&(n.push(p),t.push({id:a,url:c}))}}return t}function Vt(o,t,n,a,c){if(a)return void o(a);if(c!==Object.values(t).length||c!==Object.values(n).length)return;const p={};for(const m in t){p[m]={};const y=h.exported.getImageCanvasContext(n[m]),_=t[m];for(const x in _){const{width:T,height:w,x:k,y:O,sdf:B,pixelRatio:R,stretchX:q,stretchY:H,content:se}=_[x];p[m][x]={data:null,pixelRatio:R,sdf:B,stretchX:q,stretchY:H,content:se,spriteData:{width:T,height:w,x:k,y:O,context:y}}}}o(null,p)}(function(){var o=new h.ARRAY_TYPE(2);h.ARRAY_TYPE!=Float32Array&&(o[0]=0,o[1]=0)})();class yt{constructor(t,n,a,c){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(n,c)}update(t,n,a){const{width:c,height:p}=t,m=!(this.size&&this.size[0]===c&&this.size[1]===p||a),{context:y}=this,{gl:_}=y;if(this.useMipmap=!!(n&&n.useMipmap),_.bindTexture(_.TEXTURE_2D,this.texture),y.pixelStoreUnpackFlipY.set(!1),y.pixelStoreUnpack.set(1),y.pixelStoreUnpackPremultiplyAlpha.set(this.format===_.RGBA&&(!n||n.premultiply!==!1)),m)this.size=[c,p],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||h.isImageBitmap(t)?_.texImage2D(_.TEXTURE_2D,0,this.format,this.format,_.UNSIGNED_BYTE,t):_.texImage2D(_.TEXTURE_2D,0,this.format,c,p,0,this.format,_.UNSIGNED_BYTE,t.data);else{const{x,y:T}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||h.isImageBitmap(t)?_.texSubImage2D(_.TEXTURE_2D,0,x,T,_.RGBA,_.UNSIGNED_BYTE,t):_.texSubImage2D(_.TEXTURE_2D,0,x,T,c,p,_.RGBA,_.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&_.generateMipmap(_.TEXTURE_2D)}bind(t,n,a){const{context:c}=this,{gl:p}=c;p.bindTexture(p.TEXTURE_2D,this.texture),a!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=p.LINEAR),t!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,t),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,a||t),this.filter=t),n!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,n),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function xa(o){const{userImage:t}=o;return!!(t&&t.render&&t.render())&&(o.data.replace(new Uint8Array(t.data.buffer)),!0)}class Zi extends h.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new h.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,callback:a}of this.requestors)this._notify(n,a);this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const a=n.spriteData;n.data=new h.RGBAImage({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let a=!0;const c=n.data||n.spriteData;return this._validateStretch(n.stretchX,c&&c.width)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),a=!1),this._validateStretch(n.stretchY,c&&c.height)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),a=!1),this._validateContent(n.content,n)||(this.fire(new h.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),a=!1),a}_validateStretch(t,n){if(!t)return!0;let a=0;for(const c of t){if(c[0]-1);_++,p[_]=y,m[_]=x,m[_+1]=xr}for(let y=0,_=0;y{let y=this.entries[c];y||(y=this.entries[c]={glyphs:{},requests:{},ranges:{}});let _=y.glyphs[p];if(_!==void 0)return void m(null,{stack:c,id:p,glyph:_});if(_=this._tinySDF(y,c,p),_)return y.glyphs[p]=_,void m(null,{stack:c,id:p,glyph:_});const x=Math.floor(p/256);if(256*x>65535)return void m(new Error("glyphs > 65535 not supported"));if(y.ranges[x])return void m(null,{stack:c,id:p,glyph:_});if(!this.url)return void m(new Error("glyphsUrl is not set"));let T=y.requests[x];T||(T=y.requests[x]=[],vr.loadGlyphRange(c,x,this.url,this.requestManager,(w,k)=>{if(k){for(const O in k)this._doesCharSupportLocalGlyph(+O)||(y.glyphs[+O]=k[+O]);y.ranges[x]=!0}for(const O of T)O(w,k);delete y.requests[x]})),T.push((w,k)=>{w?m(w):k&&m(null,{stack:c,id:p,glyph:k[p]||null})})},(c,p)=>{if(c)n(c);else if(p){const m={};for(const{stack:y,id:_,glyph:x}of p)(m[y]||(m[y]={}))[_]=x&&{id:x.id,bitmap:x.bitmap.clone(),metrics:x.metrics};n(null,m)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(h.unicodeBlockLookup["CJK Unified Ideographs"](t)||h.unicodeBlockLookup["Hangul Syllables"](t)||h.unicodeBlockLookup.Hiragana(t)||h.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,a){const c=this.localIdeographFontFamily;if(!c||!this._doesCharSupportLocalGlyph(a))return;let p=t.tinySDF;if(!p){let y="400";/bold/i.test(n)?y="900":/medium/i.test(n)?y="500":/light/i.test(n)&&(y="200"),p=t.tinySDF=new vr.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:c,fontWeight:y})}const m=p.draw(String.fromCharCode(a));return{id:a,bitmap:new h.AlphaImage({width:m.width||30,height:m.height||30},m.data),metrics:{width:m.glyphWidth||24,height:m.glyphHeight||24,left:m.glyphLeft||0,top:m.glyphTop-27||-8,advance:m.glyphAdvance||24}}}}vr.loadGlyphRange=function(o,t,n,a,c){const p=256*t,m=p+255,y=a.transformRequest(n.replace("{fontstack}",o).replace("{range}",`${p}-${m}`),et.Glyphs);h.getArrayBuffer(y,(_,x)=>{if(_)c(_);else if(x){const T={};for(const w of h.parseGlyphPbf(x))T[w.id]=w;c(null,T)}})},vr.TinySDF=class{constructor({fontSize:o=24,buffer:t=3,radius:n=8,cutoff:a=.25,fontFamily:c="sans-serif",fontWeight:p="normal",fontStyle:m="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=n;const y=this.size=o+4*t,_=this._createCanvas(y),x=this.ctx=_.getContext("2d",{willReadFrequently:!0});x.font=`${m} ${p} ${o}px ${c}`,x.textBaseline="alphabetic",x.textAlign="left",x.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(o){const t=document.createElement("canvas");return t.width=t.height=o,t}draw(o){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:a,actualBoundingBoxLeft:c,actualBoundingBoxRight:p}=this.ctx.measureText(o),m=Math.ceil(n),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-c))),_=Math.min(this.size-this.buffer,m+Math.ceil(a)),x=y+2*this.buffer,T=_+2*this.buffer,w=Math.max(x*T,0),k=new Uint8ClampedArray(w),O={data:k,width:x,height:T,glyphWidth:y,glyphHeight:_,glyphTop:m,glyphLeft:0,glyphAdvance:t};if(y===0||_===0)return O;const{ctx:B,buffer:R,gridInner:q,gridOuter:H}=this;B.clearRect(R,R,y,_),B.fillText(o,R,R+m);const se=B.getImageData(R,R,y,_);H.fill(xr,0,w),q.fill(0,0,w);for(let $=0;$<_;$++)for(let re=0;re0?_e*_e:0,q[me]=_e<0?_e*_e:0}}Br(H,0,0,x,T,x,this.f,this.v,this.z),Br(q,R,R,y,_,x,this.f,this.v,this.z);for(let $=0;$1&&(_=t[++y]);const T=Math.abs(x-_.left),w=Math.abs(x-_.right),k=Math.min(T,w);let O;const B=p/a*(c+1);if(_.isDash){const R=c-Math.abs(B);O=Math.sqrt(k*k+R*R)}else O=c-Math.sqrt(k*k+B*B);this.data[m+x]=Math.max(0,Math.min(255,O+128))}}}addRegularDash(t){for(let y=t.length-1;y>=0;--y){const _=t[y],x=t[y+1];_.zeroLength?t.splice(y,1):x&&x.isDash===_.isDash&&(x.left=_.left,t.splice(y,1))}const n=t[0],a=t[t.length-1];n.isDash===a.isDash&&(n.left=a.left-this.width,a.right=n.right+this.width);const c=this.width*this.nextRow;let p=0,m=t[p];for(let y=0;y1&&(m=t[++p]);const _=Math.abs(y-m.left),x=Math.abs(y-m.right),T=Math.min(_,x);this.data[c+y]=Math.max(0,Math.min(255,(m.isDash?T:-T)+128))}}addDash(t,n){const a=n?7:0,c=2*a+1;if(this.nextRow+c>this.height)return h.warnOnce("LineAtlas out of space"),null;let p=0;for(let y=0;y{c.send(t,n,p)},a=a||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function Gi(o,t,n){const a=function(c,p){if(c)return n(c);if(p){const m=h.pick(h.extend(p,o),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);p.vector_layers&&(m.vectorLayers=p.vector_layers,m.vectorLayerIds=m.vectorLayers.map(y=>y.id)),n(null,m)}};return o.url?h.getJSON(t.transformRequest(o.url,et.Source),a):h.exported.frame(()=>a(null,o))}bi.Actor=h.Actor;class hi{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof h.LngLat?new h.LngLat(t.lng,t.lat):h.LngLat.convert(t),this}setSouthWest(t){return this._sw=t instanceof h.LngLat?new h.LngLat(t.lng,t.lat):h.LngLat.convert(t),this}extend(t){const n=this._sw,a=this._ne;let c,p;if(t instanceof h.LngLat)c=t,p=t;else{if(!(t instanceof hi))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(hi.convert(t)):this.extend(h.LngLat.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(h.LngLat.convert(t)):this;if(c=t._sw,p=t._ne,!c||!p)return this}return n||a?(n.lng=Math.min(c.lng,n.lng),n.lat=Math.min(c.lat,n.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new h.LngLat(c.lng,c.lat),this._ne=new h.LngLat(p.lng,p.lat)),this}getCenter(){return new h.LngLat((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 h.LngLat(this.getWest(),this.getNorth())}getSouthEast(){return new h.LngLat(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(t){const{lng:n,lat:a}=h.LngLat.convert(t);let c=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&c}static convert(t){return t instanceof hi?t:t&&new hi(t)}static fromLngLat(t,n=0){const a=360*n/40075017,c=a/Math.cos(Math.PI/180*t.lat);return new hi(new h.LngLat(t.lng-c,t.lat-a),new h.LngLat(t.lng+c,t.lat+a))}}class yn{constructor(t,n,a){this.bounds=hi.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=a||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),a=Math.floor(h.mercatorXfromLng(this.bounds.getWest())*n),c=Math.floor(h.mercatorYfromLat(this.bounds.getNorth())*n),p=Math.ceil(h.mercatorXfromLng(this.bounds.getEast())*n),m=Math.ceil(h.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=a&&t.x=c&&t.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new yn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(a,et.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function p(m,y){return delete t.request,t.aborted?n(null):m&&m.status!==404?n(m):(y&&y.resourceTiming&&(t.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&t.setExpiryData(y),t.loadVectorData(y,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}c.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",c,p.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",c,p.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Yr extends h.Evented{constructor(t,n,a,c){super(),this.id=t,this.dispatcher=a,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h.extend({type:"raster"},n),h.extend(this,h.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Gi(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new h.ErrorEvent(t)):n&&(h.extend(this,n),n.bounds&&(this.tileBounds=new yn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return h.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=Bt.getImage(this.map._requestManager.transformRequest(a,et.Tile),(c,p,m)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(c)t.state="errored",n(c);else if(p){this.map._refreshExpiredTiles&&m&&t.setExpiryData(m);const y=this.map.painter.context,_=y.gl;t.texture=this.map.painter.getTileTexture(p.width),t.texture?t.texture.update(p,{useMipmap:!0}):(t.texture=new yt(y,p,_.RGBA,{useMipmap:!0}),t.texture.bind(_.LINEAR,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST),y.extTextureFilterAnisotropic&&_.texParameterf(_.TEXTURE_2D,y.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,y.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}},this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Fr extends Yr{constructor(t,n,a,c){super(t,n,a,c),this.type="raster-dem",this.maxzoom=22,this._options=h.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,n){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function c(p,m){p&&(t.state="errored",n(p)),m&&(t.dem=m,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.request=Bt.getImage(this.map._requestManager.transformRequest(a,et.Tile),function(p,m){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(p)t.state="errored",n(p);else if(m){this.map._refreshExpiredTiles&&t.setExpiryData(m),delete m.cacheControl,delete m.expires;const y=h.isImageBitmap(m)&&(_n==null&&(_n=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),_n)?m:h.exported.getImageData(m,1),_={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:y,encoding:this.encoding};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",_,c.bind(this)))}}.bind(this),this.map._refreshExpiredTiles),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}_getNeighboringTiles(t){const n=t.canonical,a=Math.pow(2,n.z),c=(n.x-1+a)%a,p=n.x===0?t.wrap-1:t.wrap,m=(n.x+1+a)%a,y=n.x+1===a?t.wrap+1:t.wrap,_={};return _[new h.OverscaledTileID(t.overscaledZ,p,n.z,c,n.y).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,y,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(_[new h.OverscaledTileID(t.overscaledZ,p,n.z,c,n.y-1).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},_[new h.OverscaledTileID(t.overscaledZ,y,n.z,m,n.y-1).key]={backfilled:!1}),n.y+1{if(this._pendingLoads--,this._removed||c&&c.abandoned)return void this.fire(new h.Event("dataabort",{dataType:"source"}));let p=null;if(c&&c.resourceTiming&&c.resourceTiming[this.id]&&(p=c.resourceTiming[this.id].slice(0)),a)return void this.fire(new h.ErrorEvent(a));const m={dataType:"source"};this._collectResourceTiming&&p&&p.length>0&&h.extend(m,{resourceTiming:p}),this.fire(new h.Event("data",{...m,sourceDataType:"metadata"})),this.fire(new h.Event("data",{...m,sourceDataType:"content"}))})}loaded(){return this._pendingLoads===0}loadTile(t,n){const a=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const c={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(a,c,(p,m)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):p?n(p):(t.loadVectorData(m,this.map.painter,a==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return h.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var wr=h.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Xi extends h.Evented{constructor(t,n,a,c){super(),this.id=t,this.dispatcher=a,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}load(t,n){this._loaded=!1,this.fire(new h.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Bt.getImage(this.map._requestManager.transformRequest(this.url,et.Image),(a,c)=>{this._request=null,this._loaded=!0,a?this.fire(new h.ErrorEvent(a)):c&&(this.image=c,t&&(this.coordinates=t),n&&n(),this._finishLoading())})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(h.MercatorCoordinate.fromLngLat);this.tileID=function(c){let p=1/0,m=1/0,y=-1/0,_=-1/0;for(const k of c)p=Math.min(p,k.x),m=Math.min(m,k.y),y=Math.max(y,k.x),_=Math.max(_,k.y);const x=Math.max(y-p,_-m),T=Math.max(0,Math.floor(-Math.log(x)/Math.LN2)),w=Math.pow(2,T);return new h.CanonicalTileID(T,Math.floor((p+y)/2*w),Math.floor((m+_)/2*w))}(n),this.minzoom=this.maxzoom=this.tileID.z;const a=n.map(c=>this.tileID.getTilePoint(c)._round());return this._boundsArray=new h.RasterBoundsArray,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,h.EXTENT,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,h.EXTENT),this._boundsArray.emplaceBack(a[2].x,a[2].y,h.EXTENT,h.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new h.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,wr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new yt(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const c in this.tiles){const p=this.tiles[c];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,a=!0)}a&&this.fire(new h.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class vn extends Xi{constructor(t,n,a,c){super(t,n,a,c),this.roundZoom=!0,this.type="video",this.options=n}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,et.Source).url);h.getVideo(this.urls,(n,a)=>{this._loaded=!0,n?this.fire(new h.ErrorEvent(n)):a&&(this.video=a,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,wr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new yt(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let a=!1;for(const c in this.tiles){const p=this.tiles[c];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,a=!0)}a&&this.fire(new h.Event("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 le extends Xi{constructor(t,n,a,c){super(t,n,a,c),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(m=>typeof m!="number"))||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new h.ErrorEvent(new h.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new h.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,a=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,wr.members)),this.boundsSegments||(this.boundsSegments=h.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new yt(n,this.canvas,a.RGBA,{premultiply:!0});let c=!1;for(const p in this.tiles){const m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,c=!0)}c&&this.fire(new h.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Or={vector:xn,raster:Yr,"raster-dem":Fr,geojson:br,video:vn,image:Xi,canvas:le};function qn(o,t){const n=h.create();return h.translate(n,n,[1,1,0]),h.scale(n,n,[.5*o.width,.5*o.height,1]),h.multiply(n,n,o.calculatePosMatrix(t.toUnwrapped()))}function wt(o,t,n,a,c,p){const m=function(w,k,O){if(w)for(const B of w){const R=k[B];if(R&&R.source===O&&R.type==="fill-extrusion")return!0}else for(const B in k){const R=k[B];if(R.source===O&&R.type==="fill-extrusion")return!0}return!1}(c&&c.layers,t,o.id),y=p.maxPitchScaleFactor(),_=o.tilesIn(a,y,m);_.sort(lt);const x=[];for(const w of _)x.push({wrappedTileID:w.tileID.wrapped().key,queryResults:w.tile.queryRenderedFeatures(t,n,o._state,w.queryGeometry,w.cameraQueryGeometry,w.scale,c,p,y,qn(o.transform,w.tileID))});const T=function(w){const k={},O={};for(const B of w){const R=B.queryResults,q=B.wrappedTileID,H=O[q]=O[q]||{};for(const se in R){const $=R[se],re=H[se]=H[se]||{},oe=k[se]=k[se]||[];for(const me of $)re[me.featureIndex]||(re[me.featureIndex]=!0,oe.push(me))}}return k}(x);for(const w in T)T[w].forEach(k=>{const O=k.feature,B=o.getFeatureState(O.layer["source-layer"],O.id);O.source=O.layer.source,O.layer["source-layer"]&&(O.sourceLayer=O.layer["source-layer"]),O.state=B});return T}function lt(o,t){const n=o.tileID,a=t.tileID;return n.overscaledZ-a.overscaledZ||n.canonical.y-a.canonical.y||n.wrap-a.wrap||n.canonical.x-a.canonical.x}class Jr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=h.uniqueId(),this.uses=0,this.tileSize=n,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(t){const n=t+this.timeAdded;np.getLayer(x)).filter(Boolean);if(_.length!==0){y.layers=_,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(x=>_.filter(T=>T.id===x)[0]));for(const x of _)m[x.id]=y}}return m}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const p=this.buckets[c];if(p instanceof h.SymbolBucket){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const p=this.buckets[c];if(p instanceof h.SymbolBucket&&p.hasRTLText){this.hasRTLText=!0,h.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const c in this.buckets){const p=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new h.CollisionBoxArray}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const c=this.buckets[a];c.uploadPending()&&c.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new yt(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new yt(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,a,c,p,m,y,_,x,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:p,scale:m,tileSize:this.tileSize,pixelPosMatrix:T,transform:_,params:y,queryPadding:this.queryPadding*x},t,n,a):{}}querySourceFeatures(t,n){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const c=a.loadVTLayers(),p=n&&n.sourceLayer?n.sourceLayer:"",m=c._geojsonTileLayer||c[p];if(!m)return;const y=h.createFilter(n&&n.filter),{z:_,x,y:T}=this.tileID.canonical,w={z:_,x,y:T};for(let k=0;ka)c=!1;else if(n)if(this.expirationTime{this.remove(t,p)},a)),this.data[c].push(p),this.order.push(c),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const a=t.wrapped().key,c=n===void 0?0:this.data[a].indexOf(n),p=this.data[a][c];return this.data[a].splice(c,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const a in this.data)for(const c of this.data[a])t(c.value)||n.push(c);for(const a of n)this.remove(a.value.tileID,a)}}class _s{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,a){const c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},h.extend(this.stateChanges[t][c],a),this.deletedStates[t]===null){this.deletedStates[t]={};for(const p in this.state[t])p!==c&&(this.deletedStates[t][p]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(const p in this.state[t][c])a[p]||(this.deletedStates[t][c][p]=null)}else for(const p in a)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][p]===null&&delete this.deletedStates[t][c][p]}removeFeatureState(t,n,a){if(this.deletedStates[t]===null)return;const c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},a&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][a]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(a in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][a]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){const a=String(n),c=h.extend({},(this.state[t]||{})[a],(this.stateChanges[t]||{})[a]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const p=this.deletedStates[t][n];if(p===null)return{};for(const m in p)delete c[m]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const a={};for(const c in this.stateChanges){this.state[c]=this.state[c]||{};const p={};for(const m in this.stateChanges[c])this.state[c][m]||(this.state[c][m]={}),h.extend(this.state[c][m],this.stateChanges[c][m]),p[m]=this.state[c][m];a[c]=p}for(const c in this.deletedStates){this.state[c]=this.state[c]||{};const p={};if(this.deletedStates[c]===null)for(const m in this.state[c])p[m]={},this.state[c][m]={};else for(const m in this.deletedStates[c]){if(this.deletedStates[c][m]===null)this.state[c][m]={};else for(const y of Object.keys(this.deletedStates[c][m]))delete this.state[c][m][y];p[m]=this.state[c][m]}a[c]=a[c]||{},h.extend(a[c],p)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const c in t)t[c].setFeatureState(a,n)}}class Gt extends h.Evented{constructor(t,n,a){super(),this.id=t,this.dispatcher=a,this.on("data",c=>{c.dataType==="source"&&c.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&c.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(c,p,m,y){const _=new Or[p.type](c,p,m,y);if(_.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${_.id}`);return h.bindAll(["load","abort","unload","serialize","prepare"],_),_}(t,n,a,this),this._tiles={},this._cache=new jn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new _s,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new h.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const a=this._tiles[n];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Qr).map(t=>t.key)}getRenderableIds(t){const n=[];for(const a in this._tiles)this._isIdRenderable(a,t)&&n.push(this._tiles[a]);return t?n.sort((a,c)=>{const p=a.tileID,m=c.tileID,y=new h.Point(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),_=new h.Point(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-m.overscaledZ||_.y-y.y||_.x-y.x}).map(a=>a.tileID.key):n.map(a=>a.tileID).sort(Qr).map(a=>a.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=n),this._loadTile(a,this._tileLoaded.bind(this,a,t,n)))}_tileLoaded(t,n,a,c){if(c)return t.state="errored",void(c.status!==404?this._source.fire(new h.ErrorEvent(c,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=h.exported.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new h.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let c=0;c1||(Math.abs(m)>1&&(Math.abs(m+_)===1?m+=_:Math.abs(m-_)===1&&(m-=_)),p.dem&&c.dem&&(c.dem.backfillBorder(p.dem,m,y),c.neighboringTiles&&c.neighboringTiles[x]&&(c.neighboringTiles[x].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,a,c){for(const p in this._tiles){let m=this._tiles[p];if(c[p]||!m.hasData()||m.tileID.overscaledZ<=n||m.tileID.overscaledZ>a)continue;let y=m.tileID;for(;m&&m.tileID.overscaledZ>n+1;){const x=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[x.key],m&&m.hasData()&&(y=x)}let _=y;for(;_.overscaledZ>n;)if(_=_.scaledTo(_.overscaledZ-1),t[_.key]){c[y.key]=y;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=n?a:null}for(let a=t.overscaledZ-1;a>=n;a--){const c=t.scaledTo(a),p=this._getLoadedTile(c);if(p)return p}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,a=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*a*(this._maxTileCacheZoomLevels===null?h.config.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._cache.setMaxSize(p)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const a={};for(const c in this._tiles){const p=this._tiles[c];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+n),a[p.tileID.key]=p}this._tiles=a;for(const c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(const c in this._tiles)this._setTileReloadTimer(c,this._tiles[c])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(T=>new h.OverscaledTileID(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y)):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(a=a.filter(T=>this._source.hasTile(T)))):a=[];const c=t.coveringZoomLevel(this._source),p=Math.max(c-Gt.maxOverzooming,this._source.minzoom),m=Math.max(c+Gt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const T={};for(const w of a)if(w.canonical.z>this._source.minzoom){const k=w.scaledTo(w.canonical.z-1);T[k.key]=k;const O=w.scaledTo(Math.max(this._source.minzoom,Math.min(w.canonical.z,5)));T[O.key]=O}a=a.concat(Object.values(T))}const y=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,y&&this.fire(new h.Event("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const _=this._updateRetainedTiles(a,c);if(bn(this._source.type)){const T={},w={},k=Object.keys(_),O=h.exported.now();for(const B of k){const R=_[B],q=this._tiles[B];if(!q||q.fadeEndTime!==0&&q.fadeEndTime<=O)continue;const H=this.findLoadedParent(R,p);H&&(this._addTile(H.tileID),T[H.tileID.key]=H.tileID),w[B]=R}this._retainLoadedChildren(w,c,m,_);for(const B in T)_[B]||(this._coveredTiles[B]=!0,_[B]=T[B]);if(n){const B={},R={};for(const q of a)this._tiles[q.key].hasData()?B[q.key]=q:R[q.key]=q;for(const q in R){const H=R[q].children(this._source.maxzoom);this._tiles[H[0].key]&&this._tiles[H[1].key]&&this._tiles[H[2].key]&&this._tiles[H[3].key]&&(B[H[0].key]=_[H[0].key]=H[0],B[H[1].key]=_[H[1].key]=H[1],B[H[2].key]=_[H[2].key]=H[2],B[H[3].key]=_[H[3].key]=H[3],delete R[q])}for(const q in R){const H=this.findLoadedParent(R[q],this._source.minzoom);if(H){B[H.tileID.key]=_[H.tileID.key]=H.tileID;for(const se in B)B[se].isChildOf(H.tileID)&&delete B[se]}}for(const q in this._tiles)B[q]||(this._coveredTiles[q]=!0)}}for(const T in _)this._tiles[T].clearFadeHold();const x=h.keysDifference(this._tiles,_);for(const T of x){const w=this._tiles[T];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const a={},c={},p=Math.max(n-Gt.maxOverzooming,this._source.minzoom),m=Math.max(n+Gt.maxUnderzooming,this._source.minzoom),y={};for(const _ of t){const x=this._addTile(_);a[_.key]=_,x.hasData()||nthis._source.maxzoom){const w=_.children(this._source.maxzoom)[0],k=this.getTile(w);if(k&&k.hasData()){a[w.key]=w;continue}}else{const w=_.children(this._source.maxzoom);if(a[w[0].key]&&a[w[1].key]&&a[w[2].key]&&a[w[3].key])continue}let T=x.wasRequested();for(let w=_.overscaledZ-1;w>=p;--w){const k=_.scaledTo(w);if(c[k.key])break;if(c[k.key]=!0,x=this.getTile(k),!x&&T&&(x=this._addTile(k)),x){const O=x.hasData();if((T||O)&&(a[k.key]=k),T=x.wasRequested(),O)break}}}return a}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let a,c=this._tiles[t].tileID;for(;c.overscaledZ>0;){if(c.key in this._loadedParentTiles){a=this._loadedParentTiles[c.key];break}n.push(c.key);const p=c.scaledTo(c.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;c=p}for(const p of n)this._loadedParentTiles[p]=a}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const a=n;return n||(n=new Jr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,a||this._source.fire(new h.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=n.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,a){const c=[],p=this.transform;if(!p)return c;const m=a?p.getCameraQueryGeometry(t):t,y=t.map(B=>p.pointCoordinate(B,this.terrain)),_=m.map(B=>p.pointCoordinate(B,this.terrain)),x=this.getIds();let T=1/0,w=1/0,k=-1/0,O=-1/0;for(const B of _)T=Math.min(T,B.x),w=Math.min(w,B.y),k=Math.max(k,B.x),O=Math.max(O,B.y);for(let B=0;B=0&&$[1].y+se>=0){const re=y.map(me=>q.getTilePoint(me)),oe=_.map(me=>q.getTilePoint(me));c.push({tile:R,tileID:q,queryGeometry:re,cameraQueryGeometry:oe,scale:H})}}return c}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of n)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(bn(this._source.type)){const t=h.exported.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,a){this._state.updateState(t=t||"_geojsonTileLayer",n,a)}removeFeatureState(t,n,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,a)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,a){const c=this._tiles[t];c&&c.setDependencies(n,a)}reloadTilesForDependencies(t,n){for(const a in this._tiles)this._tiles[a].hasDependency(t,n)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(t,n))}}function Qr(o,t){const n=Math.abs(2*o.wrap)-+(o.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return o.overscaledZ-t.overscaledZ||a-n||t.canonical.y-o.canonical.y||t.canonical.x-o.canonical.x}function bn(o){return o==="raster"||o==="image"||o==="video"}Gt.maxOverzooming=10,Gt.maxUnderzooming=3;const en="mapboxgl_preloaded_worker_pool";class we{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[en]}numActive(){return Object.keys(this.active).length}}const lr=Math.floor(h.exported.hardwareConcurrency/2);let fi;function wn(){return fi||(fi=new we),fi}we.workerCount=h.isSafari(globalThis)?Math.max(Math.min(lr,3),1):1;class Ur{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let a=1;a0?(c-m)/y:0;return this.points[p].mult(1-_).add(this.points[n].mult(_))}}function be(o,t){let n=!0;return o==="always"||o!=="never"&&t!=="never"||(n=!1),n}class Qe{constructor(t,n,a){const c=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(t/a),this.yCellCount=Math.ceil(n/a);for(let m=0;mthis.width||c<0||n>this.height)return[];const _=[];if(t<=0&&n<=0&&this.width<=a&&this.height<=c){if(p)return[{key:null,x1:t,y1:n,x2:a,y2:c}];for(let x=0;x0}hitTestCircle(t,n,a,c,p){const m=t-a,y=t+a,_=n-a,x=n+a;if(y<0||m>this.width||x<0||_>this.height)return!1;const T=[];return this._forEachCell(m,_,y,x,this._queryCellCircle,T,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:a},seenUids:{box:{},circle:{}}},p),T.length>0}_queryCell(t,n,a,c,p,m,y,_){const{seenUids:x,hitTest:T,overlapMode:w}=y,k=this.boxCells[p];if(k!==null){const B=this.bboxes;for(const R of k)if(!x.box[R]){x.box[R]=!0;const q=4*R,H=this.boxKeys[R];if(t<=B[q+2]&&n<=B[q+3]&&a>=B[q+0]&&c>=B[q+1]&&(!_||_(H))&&(!T||!be(w,H.overlapMode))&&(m.push({key:H,x1:B[q],y1:B[q+1],x2:B[q+2],y2:B[q+3]}),T))return!0}}const O=this.circleCells[p];if(O!==null){const B=this.circles;for(const R of O)if(!x.circle[R]){x.circle[R]=!0;const q=3*R,H=this.circleKeys[R];if(this._circleAndRectCollide(B[q],B[q+1],B[q+2],t,n,a,c)&&(!_||_(H))&&(!T||!be(w,H.overlapMode))){const se=B[q],$=B[q+1],re=B[q+2];if(m.push({key:H,x1:se-re,y1:$-re,x2:se+re,y2:$+re}),T)return!0}}}return!1}_queryCellCircle(t,n,a,c,p,m,y,_){const{circle:x,seenUids:T,overlapMode:w}=y,k=this.boxCells[p];if(k!==null){const B=this.bboxes;for(const R of k)if(!T.box[R]){T.box[R]=!0;const q=4*R,H=this.boxKeys[R];if(this._circleAndRectCollide(x.x,x.y,x.radius,B[q+0],B[q+1],B[q+2],B[q+3])&&(!_||_(H))&&!be(w,H.overlapMode))return m.push(!0),!0}}const O=this.circleCells[p];if(O!==null){const B=this.circles;for(const R of O)if(!T.circle[R]){T.circle[R]=!0;const q=3*R,H=this.circleKeys[R];if(this._circlesCollide(B[q],B[q+1],B[q+2],x.x,x.y,x.radius)&&(!_||_(H))&&!be(w,H.overlapMode))return m.push(!0),!0}}}_forEachCell(t,n,a,c,p,m,y,_){const x=this._convertToXCellCoord(t),T=this._convertToYCellCoord(n),w=this._convertToXCellCoord(a),k=this._convertToYCellCoord(c);for(let O=x;O<=w;O++)for(let B=T;B<=k;B++)if(p.call(this,t,n,a,c,this.xCellCount*B+O,m,y,_))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,a,c,p,m){const y=c-t,_=p-n,x=a+m;return x*x>y*y+_*_}_circleAndRectCollide(t,n,a,c,p,m,y){const _=(m-c)/2,x=Math.abs(t-(c+_));if(x>_+a)return!1;const T=(y-p)/2,w=Math.abs(n-(p+T));if(w>T+a)return!1;if(x<=_||w<=T)return!0;const k=x-_,O=w-T;return k*k+O*O<=a*a}}function Ye(o,t,n,a,c){const p=h.create();return t?(h.scale(p,p,[1/c,1/c,1]),n||h.rotateZ(p,p,a.angle)):h.multiply(p,a.labelPlaneMatrix,o),p}function Pi(o,t,n,a,c){if(t){const p=h.clone(o);return h.scale(p,p,[c,c,1]),n||h.rotateZ(p,p,-a.angle),p}return a.glCoordMatrix}function Qt(o,t,n){let a;n?(a=[o.x,o.y,n(o.x,o.y),1],h.transformMat4(a,a,t)):(a=[o.x,o.y,0,1],j(a,a,t));const c=a[3];return{point:new h.Point(a[0]/c,a[1]/c),signedDistanceFromCamera:c}}function He(o,t){return .5+o/t*.5}function Tr(o,t){const n=o[0]/o[3],a=o[1]/o[3];return n>=-t[0]&&n<=t[0]&&a>=-t[1]&&a<=t[1]}function Er(o,t,n,a,c,p,m,y,_,x){const T=a?o.textSizeData:o.iconSizeData,w=h.evaluateSizeForZoom(T,n.transform.zoom),k=[256/n.width*2+1,256/n.height*2+1],O=a?o.text.dynamicLayoutVertexArray:o.icon.dynamicLayoutVertexArray;O.clear();const B=o.lineVertexArray,R=a?o.text.placedSymbolArray:o.icon.placedSymbolArray,q=n.transform.width/n.transform.height;let H=!1;for(let se=0;seMath.abs(n.x-t.x)*a?{useVertical:!0}:(o===h.WritingMode.vertical?t.yn.x)?{needsFlipping:!0}:null}function ui(o,t,n,a,c,p,m,y,_,x,T,w,k,O,B,R){const q=t/24,H=o.lineOffsetX*q,se=o.lineOffsetY*q;let $;if(o.numGlyphs>1){const re=o.glyphStartIndex+o.numGlyphs,oe=o.lineStartIndex,me=o.lineStartIndex+o.lineLength,_e=er(q,y,H,se,n,T,w,o,_,p,k,B,R);if(!_e)return{notEnoughRoom:!0};const ve=Qt(_e.first.point,m,R).point,ge=Qt(_e.last.point,m,R).point;if(a&&!n){const Ce=Sr(o.writingMode,ve,ge,O);if(Ce)return Ce}$=[_e.first];for(let Ce=o.glyphStartIndex+1;Ce0?ve.point:St(w,_e,oe,1,c,R),Ce=Sr(o.writingMode,oe,ge,O);if(Ce)return Ce}const re=A(q*y.getoffsetX(o.glyphStartIndex),H,se,n,T,w,o.segment,o.lineStartIndex,o.lineStartIndex+o.lineLength,_,p,k,B,R);if(!re)return{notEnoughRoom:!0};$=[re]}for(const re of $)h.addDynamicAttributes(x,re.point,re.angle);return{}}function St(o,t,n,a,c,p){const m=Qt(o.add(o.sub(t)._unit()),c,p).point,y=n.sub(m);return n.add(y._mult(a/y.mag()))}function Zn(o,t){const{projectionCache:n,lineVertexArray:a,labelPlaneMatrix:c,tileAnchorPoint:p,distanceFromAnchor:m,getElevation:y,previousVertex:_,direction:x,absOffsetX:T}=t;if(n.projections[o])return n.projections[o];const w=new h.Point(a.getx(o),a.gety(o)),k=Qt(w,c,y);if(k.signedDistanceFromCamera>0)return n.projections[o]=k.point,k.point;const O=o-x;return St(m===0?p:new h.Point(a.getx(O),a.gety(O)),w,_,T-m+1,c,y)}function cr(o,t,n){return o._unit()._perp()._mult(t*n)}function N(o,t,n,a,c,p,m,y){const{projectionCache:_,direction:x}=y;if(_.offsets[o])return _.offsets[o];const T=n.add(t);if(o+x=c)return _.offsets[o]=T,T;const w=Zn(o+x,y),k=cr(w.sub(n),m,x),O=n.add(k),B=w.add(k);return _.offsets[o]=h.findLineIntersection(p,T,O,B)||T,_.offsets[o]}function A(o,t,n,a,c,p,m,y,_,x,T,w,k,O){const B=a?o-t:o+t;let R=B>0?1:-1,q=0;a&&(R*=-1,q=Math.PI),R<0&&(q+=Math.PI);let H,se,$=R>0?y+m:y+m+1,re=c,oe=c,me=0,_e=0;const ve=Math.abs(B),ge=[];let Ce;for(;me+_e<=ve;){if($+=R,$=_)return null;me+=_e,oe=re,se=H;const Ee={projectionCache:w,lineVertexArray:x,labelPlaneMatrix:T,tileAnchorPoint:p,distanceFromAnchor:me,getElevation:O,previousVertex:oe,direction:R,absOffsetX:ve};if(re=Zn($,Ee),n===0)ge.push(oe),Ce=re.sub(oe);else{let je;const ke=re.sub(oe);je=ke.mag()===0?cr(Zn($+R,Ee).sub(re),n,R):cr(ke,n,R),se||(se=oe.add(je)),H=N($,je,re,y,_,se,n,Ee),ge.push(se),Ce=H.sub(se)}_e=Ce.mag()}const Ue=Ce._mult((ve-me)/_e)._add(se||oe),Ke=q+Math.atan2(re.y-oe.y,re.x-oe.x);return ge.push(Ue),{point:Ue,angle:k?Ke:0,path:ge}}const M=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function L(o,t){for(let n=0;n=1;dt--)ke.push(Ee.path[dt]);for(let dt=1;dtQt(Je,_,B));ke=dt.some(Je=>Je.signedDistanceFromCamera<=0)?[]:dt.map(Je=>Je.point)}let qt=[];if(ke.length>0){const dt=ke[0].clone(),Je=ke[0].clone();for(let Ot=1;Ot=Ce.x&&Je.x<=Ue.x&&dt.y>=Ce.y&&Je.y<=Ue.y?[ke]:Je.xUe.x||Je.yUe.y?[]:h.clipLine([ke],Ce.x,Ce.y,Ue.x,Ue.y)}for(const dt of qt){Ke.reset(dt,.25*ge);let Je=0;Je=Ke.length<=.5*ge?1:Math.ceil(Ke.paddedLength/ut)+1;for(let Ot=0;Ot=this.screenRightBoundary||cthis.screenBottomBoundary}isInsideGrid(t,n,a,c){return a>=0&&t=0&&na.collisionGroupID===n}}return this.collisionGroups[t]}}function Xe(o,t,n,a,c){const{horizontalAlign:p,verticalAlign:m}=h.getAnchorAlignment(o),y=-(p-.5)*t,_=-(m-.5)*n,x=h.evaluateVariableOffset(o,a);return new h.Point(y+x[0]*c,_+x[1]*c)}function Le(o,t,n,a,c,p){const{x1:m,x2:y,y1:_,y2:x,anchorPointX:T,anchorPointY:w}=o,k=new h.Point(t,n);return a&&k._rotate(c?p:-p),{x1:m+k.x,y1:_+k.y,x2:y+k.x,y2:x+k.y,anchorPointX:T,anchorPointY:w}}class Oe{constructor(t,n,a,c,p){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new J(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=a,this.retainedQueryData={},this.collisionGroups=new $e(c),this.collisionCircleArrays={},this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,a,c){const p=a.getBucket(n),m=a.latestFeatureIndex;if(!p||!m||n.id!==p.layerIds[0])return;const y=a.collisionBoxArray,_=p.layers[0].layout,x=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),T=a.tileSize/h.EXTENT,w=this.transform.calculatePosMatrix(a.tileID.toUnwrapped()),k=_.get("text-pitch-alignment")==="map",O=_.get("text-rotation-alignment")==="map",B=W(a,1,this.transform.zoom),R=Ye(w,k,O,this.transform,B);let q=null;if(k){const se=Pi(w,k,O,this.transform,B);q=h.multiply([],this.transform.labelPlaneMatrix,se)}this.retainedQueryData[p.bucketInstanceId]=new pe(p.bucketInstanceId,m,p.sourceLayerIndex,p.index,a.tileID);const H={bucket:p,layout:_,posMatrix:w,textLabelPlaneMatrix:R,labelToScreenMatrix:q,scale:x,textPixelRatio:T,holdingForFade:a.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:h.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(c)for(const se of p.sortKeyRanges){const{sortKey:$,symbolInstanceStart:re,symbolInstanceEnd:oe}=se;t.push({sortKey:$,symbolInstanceStart:re,symbolInstanceEnd:oe,parameters:H})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:H})}attemptAnchorPlacement(t,n,a,c,p,m,y,_,x,T,w,k,O,B,R,q){const H=[k.textOffset0,k.textOffset1],se=Xe(t,a,c,H,p),$=this.collisionIndex.placeCollisionBox(Le(n,se.x,se.y,m,y,this.transform.angle),w,_,x,T.predicate,q);if((!R||this.collisionIndex.placeCollisionBox(Le(R,se.x,se.y,m,y,this.transform.angle),w,_,x,T.predicate,q).box.length!==0)&&$.box.length>0){let re;if(this.prevPlacement&&this.prevPlacement.variableOffsets[k.crossTileID]&&this.prevPlacement.placements[k.crossTileID]&&this.prevPlacement.placements[k.crossTileID].text&&(re=this.prevPlacement.variableOffsets[k.crossTileID].anchor),k.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[k.crossTileID]={textOffset:H,width:a,height:c,anchor:t,textBoxScale:p,prevAnchor:re},this.markUsedJustification(O,t,k,B),O.allowVerticalPlacement&&(this.markUsedOrientation(O,B,k),this.placedOrientations[k.crossTileID]=B),{shift:se,placedGlyphBoxes:$}}}placeLayerBucketPart(t,n,a){const{bucket:c,layout:p,posMatrix:m,textLabelPlaneMatrix:y,labelToScreenMatrix:_,textPixelRatio:x,holdingForFade:T,collisionBoxArray:w,partiallyEvaluatedTextSize:k,collisionGroup:O}=t.parameters,B=p.get("text-optional"),R=p.get("icon-optional"),q=h.getOverlapMode(p,"text-overlap","text-allow-overlap"),H=q==="always",se=h.getOverlapMode(p,"icon-overlap","icon-allow-overlap"),$=se==="always",re=p.get("text-rotation-alignment")==="map",oe=p.get("text-pitch-alignment")==="map",me=p.get("icon-text-fit")!=="none",_e=p.get("symbol-z-order")==="viewport-y",ve=H&&($||!c.hasIconData()||R),ge=$&&(H||!c.hasTextData()||B);!c.collisionArrays&&w&&c.deserializeCollisionBoxes(w);const Ce=this.retainedQueryData[c.bucketInstanceId].tileID,Ue=this.terrain?(Ee,je)=>this.terrain.getElevation(Ce,Ee,je):null,Ke=(Ee,je)=>{if(n[Ee.crossTileID])return;if(T)return void(this.placements[Ee.crossTileID]=new de(!1,!1,!1));let ke=!1,ut=!1,qt=!0,dt=null,Je={box:null,offscreen:null},Ot={box:null,offscreen:null},wi=null,jt=null,si=null,Fi=0,ir=0,rr=0;je.textFeatureIndex?Fi=je.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(Fi=Ee.featureIndex),je.verticalTextFeatureIndex&&(ir=je.verticalTextFeatureIndex);const Ti=je.textBox;if(Ti){const mi=ft=>{let ei=h.WritingMode.horizontal;if(c.allowVerticalPlacement&&!ft&&this.prevPlacement){const oi=this.prevPlacement.placedOrientations[Ee.crossTileID];oi&&(this.placedOrientations[Ee.crossTileID]=oi,ei=oi,this.markUsedOrientation(c,ei,Ee))}return ei},ai=(ft,ei)=>{if(c.allowVerticalPlacement&&Ee.numVerticalGlyphVertices>0&&je.verticalTextBox){for(const oi of c.writingModes)if(oi===h.WritingMode.vertical?(Je=ei(),Ot=Je):Je=ft(),Je&&Je.box&&Je.box.length)break}else Je=ft()};if(p.get("text-variable-anchor")){let ft=p.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Ee.crossTileID]){const gt=this.prevPlacement.variableOffsets[Ee.crossTileID];ft.indexOf(gt.anchor)>0&&(ft=ft.filter(ti=>ti!==gt.anchor),ft.unshift(gt.anchor))}const ei=(gt,ti,Oi)=>{const ia=gt.x2-gt.x1,Mr=gt.y2-gt.y1,uc=Ee.textBoxScale,hl=me&&se==="never"?ti:null;let At={box:[],offscreen:!1};const io=q!=="never"?2*ft.length:ft.length;for(let hs=0;hs=ft.length?q:"never",Ee,c,Oi,hl,Ue);if(Cr&&(At=Cr.placedGlyphBoxes,At&&At.box&&At.box.length)){ke=!0,dt=Cr.shift;break}}return At};ai(()=>ei(Ti,je.iconBox,h.WritingMode.horizontal),()=>{const gt=je.verticalTextBox;return c.allowVerticalPlacement&&!(Je&&Je.box&&Je.box.length)&&Ee.numVerticalGlyphVertices>0&>?ei(gt,je.verticalIconBox,h.WritingMode.vertical):{box:null,offscreen:null}}),Je&&(ke=Je.box,qt=Je.offscreen);const oi=mi(Je&&Je.box);if(!ke&&this.prevPlacement){const gt=this.prevPlacement.variableOffsets[Ee.crossTileID];gt&&(this.variableOffsets[Ee.crossTileID]=gt,this.markUsedJustification(c,gt.anchor,Ee,oi))}}else{const ft=(ei,oi)=>{const gt=this.collisionIndex.placeCollisionBox(ei,q,x,m,O.predicate,Ue);return gt&>.box&>.box.length&&(this.markUsedOrientation(c,oi,Ee),this.placedOrientations[Ee.crossTileID]=oi),gt};ai(()=>ft(Ti,h.WritingMode.horizontal),()=>{const ei=je.verticalTextBox;return c.allowVerticalPlacement&&Ee.numVerticalGlyphVertices>0&&ei?ft(ei,h.WritingMode.vertical):{box:null,offscreen:null}}),mi(Je&&Je.box&&Je.box.length)}}if(wi=Je,ke=wi&&wi.box&&wi.box.length>0,qt=wi&&wi.offscreen,Ee.useRuntimeCollisionCircles){const mi=c.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex),ai=h.evaluateSizeForFeature(c.textSizeData,k,mi),ft=p.get("text-padding");jt=this.collisionIndex.placeCollisionCircles(q,mi,c.lineVertexArray,c.glyphOffsetArray,ai,m,y,_,a,oe,O.predicate,Ee.collisionCircleDiameter,ft,Ue),jt.circles.length&&jt.collisionDetected&&!a&&h.warnOnce("Collisions detected, but collision boxes are not shown"),ke=H||jt.circles.length>0&&!jt.collisionDetected,qt=qt&&jt.offscreen}if(je.iconFeatureIndex&&(rr=je.iconFeatureIndex),je.iconBox){const mi=ai=>{const ft=me&&dt?Le(ai,dt.x,dt.y,re,oe,this.transform.angle):ai;return this.collisionIndex.placeCollisionBox(ft,se,x,m,O.predicate,Ue)};Ot&&Ot.box&&Ot.box.length&&je.verticalIconBox?(si=mi(je.verticalIconBox),ut=si.box.length>0):(si=mi(je.iconBox),ut=si.box.length>0),qt=qt&&si.offscreen}const gr=B||Ee.numHorizontalGlyphVertices===0&&Ee.numVerticalGlyphVertices===0,cs=R||Ee.numIconVertices===0;if(gr||cs?cs?gr||(ut=ut&&ke):ke=ut&&ke:ut=ke=ut&&ke,ke&&wi&&wi.box&&this.collisionIndex.insertCollisionBox(wi.box,q,p.get("text-ignore-placement"),c.bucketInstanceId,Ot&&Ot.box&&ir?ir:Fi,O.ID),ut&&si&&this.collisionIndex.insertCollisionBox(si.box,se,p.get("icon-ignore-placement"),c.bucketInstanceId,rr,O.ID),jt&&(ke&&this.collisionIndex.insertCollisionCircles(jt.circles,q,p.get("text-ignore-placement"),c.bucketInstanceId,Fi,O.ID),a)){const mi=c.bucketInstanceId;let ai=this.collisionCircleArrays[mi];ai===void 0&&(ai=this.collisionCircleArrays[mi]=new fe);for(let ft=0;ft=0;--je){const ke=Ee[je];Ke(c.symbolInstances.get(ke),c.collisionArrays[ke])}}else for(let Ee=t.symbolInstanceStart;Ee=0&&(t.text.placedSymbolArray.get(y).crossTileID=p>=0&&y!==p?0:a.crossTileID)}markUsedOrientation(t,n,a){const c=n===h.WritingMode.horizontal||n===h.WritingMode.horizontalOnly?n:0,p=n===h.WritingMode.vertical?n:0,m=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const y of m)t.text.placedSymbolArray.get(y).placedOrientation=c;a.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=p)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let a=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const c=n?n.symbolFadeChange(t):1,p=n?n.opacities:{},m=n?n.variableOffsets:{},y=n?n.placedOrientations:{};for(const _ in this.placements){const x=this.placements[_],T=p[_];T?(this.opacities[_]=new te(T,c,x.text,x.icon),a=a||x.text!==T.text.placed||x.icon!==T.icon.placed):(this.opacities[_]=new te(null,c,x.text,x.icon,x.skipFade),a=a||x.text||x.icon)}for(const _ in p){const x=p[_];if(!this.opacities[_]){const T=new te(x,c,!1,!1);T.isHidden()||(this.opacities[_]=T,a=a||x.text.placed||x.icon.placed)}}for(const _ in m)this.variableOffsets[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.variableOffsets[_]=m[_]);for(const _ in y)this.placedOrientations[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.placedOrientations[_]=y[_]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const a={};for(const c of n){const p=c.getBucket(t);p&&c.latestFeatureIndex&&t.id===p.layerIds[0]&&this.updateBucketOpacities(p,a,c.collisionBoxArray)}}updateBucketOpacities(t,n,a){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,p=new te(null,0,!1,!1,!0),m=c.get("text-allow-overlap"),y=c.get("icon-allow-overlap"),_=c.get("text-variable-anchor"),x=c.get("text-rotation-alignment")==="map",T=c.get("text-pitch-alignment")==="map",w=c.get("icon-text-fit")!=="none",k=new te(null,0,m&&(y||!t.hasIconData()||c.get("icon-optional")),y&&(m||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&a&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(a);const O=(B,R,q)=>{for(let H=0;H0,oe=this.placedOrientations[R.crossTileID],me=oe===h.WritingMode.vertical,_e=oe===h.WritingMode.horizontal||oe===h.WritingMode.horizontalOnly;if(q>0||H>0){const ve=Vr($.text);O(t.text,q,me?di:ve),O(t.text,H,_e?di:ve);const ge=$.text.isHidden();[R.rightJustifiedTextSymbolIndex,R.centerJustifiedTextSymbolIndex,R.leftJustifiedTextSymbolIndex].forEach(Ke=>{Ke>=0&&(t.text.placedSymbolArray.get(Ke).hidden=ge||me?1:0)}),R.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(R.verticalPlacedTextSymbolIndex).hidden=ge||_e?1:0);const Ce=this.variableOffsets[R.crossTileID];Ce&&this.markUsedJustification(t,Ce.anchor,R,oe);const Ue=this.placedOrientations[R.crossTileID];Ue&&(this.markUsedJustification(t,"left",R,Ue),this.markUsedOrientation(t,Ue,R))}if(re){const ve=Vr($.icon),ge=!(w&&R.verticalPlacedIconSymbolIndex&&me);R.placedIconSymbolIndex>=0&&(O(t.icon,R.numIconVertices,ge?ve:di),t.icon.placedSymbolArray.get(R.placedIconSymbolIndex).hidden=$.icon.isHidden()),R.verticalPlacedIconSymbolIndex>=0&&(O(t.icon,R.numVerticalIconVertices,ge?di:ve),t.icon.placedSymbolArray.get(R.verticalPlacedIconSymbolIndex).hidden=$.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ve=t.collisionArrays[B];if(ve){let ge=new h.Point(0,0);if(ve.textBox||ve.verticalTextBox){let Ue=!0;if(_){const Ke=this.variableOffsets[se];Ke?(ge=Xe(Ke.anchor,Ke.width,Ke.height,Ke.textOffset,Ke.textBoxScale),x&&ge._rotate(T?this.transform.angle:-this.transform.angle)):Ue=!1}ve.textBox&&Ge(t.textCollisionBox.collisionVertexArray,$.text.placed,!Ue||me,ge.x,ge.y),ve.verticalTextBox&&Ge(t.textCollisionBox.collisionVertexArray,$.text.placed,!Ue||_e,ge.x,ge.y)}const Ce=!!(!_e&&ve.verticalIconBox);ve.iconBox&&Ge(t.iconCollisionBox.collisionVertexArray,$.icon.placed,Ce,w?ge.x:0,w?ge.y:0),ve.verticalIconBox&&Ge(t.iconCollisionBox.collisionVertexArray,$.icon.placed,!Ce,w?ge.x:0,w?ge.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const B=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=B.invProjMatrix,t.placementViewportMatrix=B.viewportMatrix,t.collisionCircleArray=B.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function Ge(o,t,n,a,c){o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0),o.emplaceBack(t?1:0,n?1:0,a||0,c||0)}const at=Math.pow(2,25),tt=Math.pow(2,24),ct=Math.pow(2,17),Tt=Math.pow(2,16),Xt=Math.pow(2,9),Ze=Math.pow(2,8),Lt=Math.pow(2,1);function Vr(o){if(o.opacity===0&&!o.placed)return 0;if(o.opacity===1&&o.placed)return 4294967295;const t=o.placed?1:0,n=Math.floor(127*o.opacity);return n*at+t*tt+n*ct+t*Tt+n*Xt+t*Ze+n*Lt+t}const di=0;class Li{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,a,c,p){const m=this._bucketParts;for(;this._currentTileIndexy.sortKey-_.sortKey));this._currentPartIndex!this._forceFullPlacement&&h.exported.now()-c>2;for(;this._currentPlacementIndex>=0;){const m=n[t[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=y)&&(!m.maxzoom||m.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Li(m)),this._inProgressLayer.continuePlacement(a[m.source],this.placement,this._showCollisionBoxes,m,p))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Tn=512/h.EXTENT/2;class ys{constructor(t,n,a){this.tileID=t,this.bucketInstanceId=a,this._symbolsByKey={};const c=new Map;for(let p=0;p({x:Math.floor(_.anchorX*Tn),y:Math.floor(_.anchorY*Tn)})),crossTileIDs:m.map(_=>_.crossTileID)};if(y.positions.length>128){const _=new h.KDBush(y.positions.length,16,Uint16Array);for(const{x,y:T}of y.positions)_.add(x,T);_.finish(),delete y.positions,y.index=_}this._symbolsByKey[p]=y}}getScaledCoordinates(t,n){const{x:a,y:c,z:p}=this.tileID.canonical,{x:m,y,z:_}=n.canonical,x=Tn/Math.pow(2,_-p),T=(y*h.EXTENT+t.anchorY)*x,w=c*h.EXTENT*Tn;return{x:Math.floor((m*h.EXTENT+t.anchorX)*x-a*h.EXTENT*Tn),y:Math.floor(T-w)}}findMatches(t,n,a){const c=this.tileID.canonical.zt)}}class Wt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Gn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const a in this.indexes){const c=this.indexes[a],p={};for(const m in c){const y=c[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+n),p[y.tileID.key]=y}this.indexes[a]=p}this.lng=t}addBucket(t,n,a){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let p=0;pt.overscaledZ)for(const y in m){const _=m[y];_.tileID.isChildOf(t)&&_.findMatches(n.symbolInstances,t,c)}else{const y=m[t.scaledTo(Number(p)).key];y&&y.findMatches(n.symbolInstances,t,c)}}for(let p=0;p{n[a]=!0});for(const a in this.layerIndexes)n[a]||delete this.layerIndexes[a]}}const Nt=(o,t)=>h.emitValidationErrors(o,t&&t.filter(n=>n.identifier!=="source.canvas")),xs=h.pick(h.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),tr=h.pick(h.operations,["setCenter","setZoom","setBearing","setPitch"]),Po=h.emptyStyle();class pi extends h.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new bi(wn(),this,t._getMapId()),this.imageManager=new Zi,this.imageManager.setEventedParent(this),this.glyphManager=new vr(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new Rr(256,512),this.crossTileSymbolIndex=new Nr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new h.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",h.getReferrer());const a=this;this._rtlTextPluginCallback=pi.registerForPluginStateChange(c=>{a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:c.pluginStatus,pluginURL:c.pluginURL},(p,m)=>{if(h.triggerPluginCompletionEvent(p),m&&m.every(y=>y))for(const y in a.sourceCaches){const _=a.sourceCaches[y].getSource().type;_!=="vector"&&_!=="geojson"||a.sourceCaches[y].reload()}})}),this.on("data",c=>{if(c.dataType!=="source"||c.sourceDataType!=="metadata")return;const p=this.sourceCaches[c.sourceId];if(!p)return;const m=p.getSource();if(m&&m.vectorLayerIds)for(const y in this._layers){const _=this._layers[y];_.source===m.id&&this._validateLayer(_)}})}loadURL(t,n={},a){this.fire(new h.Event("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const c=this.map._requestManager.transformRequest(t,et.Style);this._request=h.getJSON(c,(p,m)=>{this._request=null,p?this.fire(new h.ErrorEvent(p)):m&&this._load(m,n,a)})}loadJSON(t,n={},a){this.fire(new h.Event("dataloading",{dataType:"style"})),this._request=h.exported.frame(()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,a)})}loadEmpty(){this.fire(new h.Event("dataloading",{dataType:"style"})),this._load(Po,{validate:!1})}_load(t,n,a){const c=n.transformStyle?n.transformStyle(a,t):t;if(!n.validate||!Nt(this,h.validateStyle(c))){this._loaded=!0,this.stylesheet=c;for(const p in c.sources)this.addSource(p,c.sources[p],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs),this._createLayers(),this.light=new $n(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new h.Event("data",{dataType:"style"})),this.fire(new h.Event("style.load"))}}_createLayers(){const t=h.derefLayers(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const a=h.createStyleLayer(n);a.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=a}}_loadSprite(t,n=!1,a=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(c,p,m,y){const _=ni(c),x=_.length,T=m>1?"@2x":"",w={},k={},O={};for(const{id:B,url:R}of _){const q=p.transformRequest(p.normalizeSpriteURL(R,T,".json"),et.SpriteJSON),H=`${B}_${q.url}`;w[H]=h.getJSON(q,(re,oe)=>{delete w[H],k[B]=oe,Vt(y,k,O,re,x)});const se=p.transformRequest(p.normalizeSpriteURL(R,T,".png"),et.SpriteImage),$=`${B}_${se.url}`;w[$]=Bt.getImage(se,(re,oe)=>{delete w[$],O[B]=oe,Vt(y,k,O,re,x)})}return{cancel(){for(const B of Object.values(w))B.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(c,p)=>{if(this._spriteRequest=null,c)this.fire(new h.ErrorEvent(c));else if(p)for(const m in p){this._spritesImagesIds[m]=[];const y=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(_=>!(_ in p)):[];for(const _ of y)this.imageManager.removeImage(_),this._changedImages[_]=!0;for(const _ in p[m]){const x=m==="default"?_:`${m}:${_}`;this._spritesImagesIds[m].push(x),x in this.imageManager.images?this.imageManager.updateImage(x,p[m][_],!1):this.imageManager.addImage(x,p[m][_]),n&&(this._changedImages[x]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"})),a&&a(c)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const a=t.sourceLayer;if(!a)return;const c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(a)===-1)&&this.fire(new h.ErrorEvent(new Error(`Source layer "${a}" does not exist on source "${c.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const a=[];for(const c of t)n[c]&&a.push(n[c]);return a}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const a of n){const c=this._layers[a];c.type!=="custom"&&(t[a]=c.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const c=Object.keys(this._updatedLayers),p=Object.keys(this._removedLayers);(c.length||p.length)&&this._updateWorkerLayers(c,p);for(const m in this._updatedSources){const y=this._updatedSources[m];if(y==="reload")this._reloadSource(m);else{if(y!=="clear")throw new Error(`Invalid action ${y}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const a={};for(const c in this.sourceCaches){const p=this.sourceCaches[c];a[c]=p.used,p.used=!1}for(const c of this._order){const p=this._layers[c];p.recalculate(t,this._availableImages),!p.isHidden(t.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(const c in a){const p=this.sourceCaches[c];a[c]!==p.used&&p.fire(new h.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new h.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const a=this.serialize();if(t=n.transformStyle?n.transformStyle(a,t):t,Nt(this,h.validateStyle(t)))return!1;(t=h.clone$1(t)).layers=h.derefLayers(t.layers);const c=h.diffStyles(a,t).filter(m=>!(m.command in tr));if(c.length===0)return!1;const p=c.filter(m=>!(m.command in xs));if(p.length>0)throw new Error(`Unimplemented: ${p.map(m=>m.command).join(", ")}.`);for(const m of c)m.command!=="setTransition"&&this[m.command].apply(this,m.args);return this.stylesheet=t,!0}addImage(t,n){if(this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new h.ErrorEvent(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,a={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(h.validateStyle.source,`sources.${t}`,n,null,a))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const c=this.sourceCaches[t]=new Gt(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,()=>({isSourceLoaded:c.loaded(),source:c.serialize(),sourceId:t})),c.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===t)return this.fire(new h.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${a}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new h.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const a=this.sourceCaches[t].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,a={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new h.ErrorEvent(new Error(`Layer "${c}" already exists on this map.`)));let p;if(t.type==="custom"){if(Nt(this,h.validateCustomStyleLayer(t)))return;p=h.createStyleLayer(t)}else{if(typeof t.source=="object"&&(this.addSource(c,t.source),t=h.clone$1(t),t=h.extend(t,{source:c})),this._validate(h.validateStyle.layer,`layers.${c}`,t,{arrayIndex:-1},a))return;p=h.createStyleLayer(t),this._validateLayer(p),p.setEventedParent(this,{layer:{id:c}})}const m=n?this._order.indexOf(n):this._order.length;if(n&&m===-1)this.fire(new h.ErrorEvent(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(m,0,c),this._layerOrderChanged=!0,this._layers[c]=p,this._removedLayers[c]&&p.source&&p.type!=="custom"){const y=this._removedLayers[c];delete this._removedLayers[c],y.type!==p.type?this._updatedSources[p.source]="clear":(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause())}this._updateLayer(p),p.onAdd&&p.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new h.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const a=this._order.indexOf(t);this._order.splice(a,1);const c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new h.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new h.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const a=this._order.indexOf(t);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,a){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===a||(n!=null&&(c.minzoom=n),a!=null&&(c.maxzoom=a),this._updateLayer(c)):this.fire(new h.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,a={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!h.deepEqual(c.filter,n))return n==null?(c.filter=void 0,void this._updateLayer(c)):void(this._validate(h.validateStyle.filter,`layers.${c.id}.filter`,n,null,a)||(c.filter=h.clone$1(n),this._updateLayer(c)))}else this.fire(new h.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return h.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,a,c={}){this._checkLoaded();const p=this.getLayer(t);p?h.deepEqual(p.getLayoutProperty(n),a)||(p.setLayoutProperty(n,a,c),this._updateLayer(p)):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const a=this.getLayer(t);if(a)return a.getLayoutProperty(n);this.fire(new h.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,a,c={}){this._checkLoaded();const p=this.getLayer(t);p?h.deepEqual(p.getPaintProperty(n),a)||(p.setPaintProperty(n,a,c)&&this._updateLayer(p),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new h.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const a=t.source,c=t.sourceLayer,p=this.sourceCaches[a];if(p===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${a}' does not exist in the map's style.`)));const m=p.getSource().type;m==="geojson"&&c?this.fire(new h.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||c?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),p.setFeatureState(c,t.id,n)):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const a=t.source,c=this.sourceCaches[a];if(c===void 0)return void this.fire(new h.ErrorEvent(new Error(`The source '${a}' does not exist in the map's style.`)));const p=c.getSource().type,m=p==="vector"?t.sourceLayer:void 0;p!=="vector"||m?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new h.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(m,t.id,n):this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,a=t.sourceLayer,c=this.sourceCaches[n];if(c!==void 0)return c.getSource().type!=="vector"||a?(t.id===void 0&&this.fire(new h.ErrorEvent(new Error("The feature id parameter must be provided."))),c.getFeatureState(a,t.id)):void this.fire(new h.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new h.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return h.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const t=h.mapObject(this.sourceCaches,c=>c.serialize()),n=this._serializeByIds(this._order),a=this.stylesheet;return h.filterObject({version:a.version,name:a.name,metadata:a.metadata,light:a.light,center:a.center,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,sprite:a.sprite,glyphs:a.glyphs,transition:a.transition,sources:t,layers:n},c=>c!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=m=>this._layers[m].type==="fill-extrusion",a={},c=[];for(let m=this._order.length-1;m>=0;m--){const y=this._order[m];if(n(y)){a[y]=m;for(const _ of t){const x=_[y];if(x)for(const T of x)c.push(T)}}}c.sort((m,y)=>y.intersectionZ-m.intersectionZ);const p=[];for(let m=this._order.length-1;m>=0;m--){const y=this._order[m];if(n(y))for(let _=c.length-1;_>=0;_--){const x=c[_].feature;if(a[x.layer.id]{const ve=H.featureSortOrder;if(ve){const ge=ve.indexOf(me.featureIndex);return ve.indexOf(_e.featureIndex)-ge}return _e.featureIndex-me.featureIndex});for(const me of oe)re.push(me)}}for(const H in B)B[H].forEach(se=>{const $=se.feature,re=x[y[H].source].getFeatureState($.layer["source-layer"],$.id);$.source=$.layer.source,$.layer["source-layer"]&&($.sourceLayer=$.layer["source-layer"]),$.state=re});return B}(this._layers,m,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)}querySourceFeatures(t,n){n&&n.filter&&this._validate(h.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);const a=this.sourceCaches[t];return a?function(c,p){const m=c.getRenderableIds().map(x=>c.getTileByID(x)),y=[],_={};for(let x=0;xk.getTileByID(O)).sort((O,B)=>B.tileID.overscaledZ-O.tileID.overscaledZ||(O.tileID.isLessThan(B.tileID)?-1:1))}const w=this.crossTileSymbolIndex.addLayer(T,_[T.source],t.center.lng);m=m||w}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((p=p||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(h.exported.now(),t.zoom))&&(this.pauseablePlacement=new Wi(t,this.map.terrain,this._order,p,n,a,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,_),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(h.exported.now()),y=!0),m&&this.pauseablePlacement.placement.setStale()),y||m)for(const x of this._order){const T=this._layers[x];T.type==="symbol"&&this.placement.updateLayerOpacities(T,_[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(h.exported.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,a){this.imageManager.getImages(n.icons,a),this._updateTilesForChangedImages();const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,a){this.glyphManager.getGlyphs(n.stacks,a);const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,a){return h.makeRequest(n,a)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(h.validateStyle.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,a={},c){this._checkLoaded();const p=[{id:t,url:n}],m=[...ni(this.stylesheet.sprite),...p];this._validate(h.validateStyle.sprite,"sprite",m,null,a)||(this.stylesheet.sprite=m,this._loadSprite(p,!0,c))}removeSprite(t){this._checkLoaded();const n=ni(this.stylesheet.sprite);if(n.find(a=>a.id===t)){if(this._spritesImagesIds[t])for(const a of this._spritesImagesIds[t])this.imageManager.removeImage(a),this._changedImages[a]=!0;n.splice(n.findIndex(a=>a.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new h.Event("data",{dataType:"style"}))}else this.fire(new h.ErrorEvent(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return ni(this.stylesheet.sprite)}setSprite(t,n={},a){this._checkLoaded(),t&&this._validate(h.validateStyle.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,a):(this._unloadSprite(),a&&a(null)))}}pi.getSourceType=function(o){return Or[o]},pi.setSourceType=function(o,t){Or[o]=t},pi.registerForPluginStateChange=h.registerForPluginStateChange;var va=h.createLayout([{name:"a_pos",type:"Int16",components:2}]),vs="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const $r={prelude:mt(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -526,7 +526,7 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:mt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",_s),terrainDepth:mt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",_s),terrainCoords:mt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",_s)};function mt(o,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=t.match(/attribute ([\w]+) ([\w]+)/g),c=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),p=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=p?p.concat(c):c,y={};return{fragmentSource:o=o.replace(n,(_,x,T,w,k)=>(y[k]=!0,x==="define"?` +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:mt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",vs),terrainDepth:mt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",vs),terrainCoords:mt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",vs)};function mt(o,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=t.match(/attribute ([\w]+) ([\w]+)/g),c=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),p=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=p?p.concat(c):c,y={};return{fragmentSource:o=o.replace(n,(_,x,T,w,k)=>(y[k]=!0,x==="define"?` #ifndef HAS_UNIFORM_u_${k} varying ${T} ${w} ${k}; #else @@ -575,9 +575,9 @@ uniform ${T} ${w} u_${k}; #else ${T} ${w} ${k} = u_${k}; #endif -`}),staticAttributes:a,staticUniforms:m}}class $r{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,a,c,p,m,y,_,x){this.context=t;let T=this.boundPaintVertexBuffers.length!==c.length;for(let w=0;!T&&w({u_depth:new h.Uniform1i(_e,ve.u_depth),u_terrain:new h.Uniform1i(_e,ve.u_terrain),u_terrain_dim:new h.Uniform1f(_e,ve.u_terrain_dim),u_terrain_matrix:new h.UniformMatrix4f(_e,ve.u_terrain_matrix),u_terrain_unpack:new h.Uniform4f(_e,ve.u_terrain_unpack),u_terrain_exaggeration:new h.Uniform1f(_e,ve.u_terrain_exaggeration)}))(t,me),this.binderUniforms=c?c.getUniforms(t,me):[]}draw(t,n,a,c,p,m,y,_,x,T,w,k,O,B,R,q,H,se){const $=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(a),t.setStencilMode(c),t.setColorMode(p),t.setCullFace(m),_){t.activeTexture.set($.TEXTURE2),$.bindTexture($.TEXTURE_2D,_.depthTexture),t.activeTexture.set($.TEXTURE3),$.bindTexture($.TEXTURE_2D,_.texture);for(const oe in this.terrainUniforms)this.terrainUniforms[oe].set(_[oe])}for(const oe in this.fixedUniforms)this.fixedUniforms[oe].set(y[oe]);R&&R.setUniforms(t,this.binderUniforms,O,{zoom:B});let re=0;switch(n){case $.LINES:re=2;break;case $.TRIANGLES:re=3;break;case $.LINE_STRIP:re=1}for(const oe of k.get()){const me=oe.vaos||(oe.vaos={});(me[x]||(me[x]=new $r)).bind(t,this,T,R?R.getPaintVertexBuffers():[],w,oe.vertexOffset,q,H,se),$.drawElements(n,oe.primitiveLength*re,$.UNSIGNED_SHORT,oe.primitiveOffset*re*2)}}}function Po(o,t,n){const a=1/W(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),p=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,m=p*(n.tileID.canonical.x+n.tileID.wrap*c),y=p*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[a,o.fromScale,o.toScale],u_fade:o.t,u_pixel_coord_upper:[m>>16,y>>16],u_pixel_coord_lower:[65535&m,65535&y]}}const Mo=(o,t,n,a)=>{const c=t.style.light,p=c.properties.get("position"),m=[p.x,p.y,p.z],y=function(){var x=new h.ARRAY_TYPE(9);return h.ARRAY_TYPE!=Float32Array&&(x[1]=0,x[2]=0,x[3]=0,x[5]=0,x[6]=0,x[7]=0),x[0]=1,x[4]=1,x[8]=1,x}();c.properties.get("anchor")==="viewport"&&function(x,T){var w=Math.sin(T),k=Math.cos(T);x[0]=k,x[1]=w,x[2]=0,x[3]=-w,x[4]=k,x[5]=0,x[6]=0,x[7]=0,x[8]=1}(y,-t.transform.angle),function(x,T,w){var k=T[0],O=T[1],B=T[2];x[0]=k*w[0]+O*w[3]+B*w[6],x[1]=k*w[1]+O*w[4]+B*w[7],x[2]=k*w[2]+O*w[5]+B*w[8]}(m,m,y);const _=c.properties.get("color");return{u_matrix:o,u_lightpos:m,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[_.r,_.g,_.b],u_vertical_gradient:+n,u_opacity:a}},ya=(o,t,n,a,c,p,m)=>h.extend(Mo(o,t,n,a),Po(p,t,m),{u_height_factor:-Math.pow(2,c.overscaledZ)/m.tileSize/8}),Co=o=>({u_matrix:o}),xa=(o,t,n,a)=>h.extend(Co(o),Po(n,t,a)),ql=(o,t)=>({u_matrix:o,u_world:t}),ko=(o,t,n,a,c)=>h.extend(xa(o,t,n,a),{u_world:c}),jl=(o,t,n,a)=>{const c=o.transform;let p,m;if(a.paint.get("circle-pitch-alignment")==="map"){const y=W(n,1,c.zoom);p=!0,m=[y,y]}else p=!1,m=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:o.translatePosMatrix(t.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:o.pixelRatio,u_extrude_scale:m}},va=(o,t,n)=>{const a=W(n,1,t.zoom),c=Math.pow(2,t.zoom-n.tileID.overscaledZ),p=n.tileID.overscaleFactor();return{u_matrix:o,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:a,u_extrude_scale:[t.pixelsToGLUnits[0]/(a*c),t.pixelsToGLUnits[1]/(a*c)],u_overscale_factor:p}},ba=(o,t,n=1)=>({u_matrix:o,u_color:t,u_overlay:0,u_overlay_scale:n}),wa=o=>({u_matrix:o}),zo=(o,t,n,a)=>({u_matrix:o,u_extrude_scale:W(t,1,n),u_intensity:a});function Do(o,t){const n=Math.pow(2,t.canonical.z),a=t.canonical.y;return[new h.MercatorCoordinate(0,a/n).toLngLat().lat,new h.MercatorCoordinate(0,(a+1)/n).toLngLat().lat]}const Ir=(o,t,n,a)=>{const c=o.transform;return{u_matrix:En(o,t,n,a),u_ratio:1/W(t,1,c.zoom),u_device_pixel_ratio:o.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},xs=(o,t,n,a,c)=>h.extend(Ir(o,t,n,c),{u_image:0,u_image_height:a}),Hi=(o,t,n,a,c)=>{const p=o.transform,m=Xn(t,p);return{u_matrix:En(o,t,n,c),u_texsize:t.imageAtlasTexture.size,u_ratio:1/W(t,1,p.zoom),u_device_pixel_ratio:o.pixelRatio,u_image:0,u_scale:[m,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},vs=(o,t,n,a,c,p)=>{const m=o.lineAtlas,y=Xn(t,o.transform),_=n.layout.get("line-cap")==="round",x=m.getDash(a.from,_),T=m.getDash(a.to,_),w=x.width*c.fromScale,k=T.width*c.toScale;return h.extend(Ir(o,t,n,p),{u_patternscale_a:[y/w,-x.height/2],u_patternscale_b:[y/k,-T.height/2],u_sdfgamma:m.width/(256*Math.min(w,k)*o.pixelRatio)/2,u_image:0,u_tex_y_a:x.y,u_tex_y_b:T.y,u_mix:c.t})};function Xn(o,t){return 1/W(o,1,t.tileZoom)}function En(o,t,n,a){return o.translatePosMatrix(a?a.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const bs=(o,t,n,a,c)=>{return{u_matrix:o,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(m=c.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(p=c.paint.get("raster-contrast"),p>0?1/(1-p):1+p),u_spin_weights:ws(c.paint.get("raster-hue-rotate"))};var p,m};function ws(o){o*=Math.PI/180;const t=Math.sin(o),n=Math.cos(o);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const Sn=(o,t,n,a,c,p,m,y,_,x)=>{const T=c.transform;return{u_is_size_zoom_constant:+(o==="constant"||o==="source"),u_is_size_feature_constant:+(o==="constant"||o==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:T.cameraToCenterDistance,u_pitch:T.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:T.width/T.height,u_fade_change:c.options.fadeDuration?c.symbolFadeChange:1,u_matrix:p,u_label_plane_matrix:m,u_coord_matrix:y,u_is_text:+_,u_pitch_with_map:+a,u_texsize:x,u_texture:0}},In=(o,t,n,a,c,p,m,y,_,x,T)=>{const w=c.transform;return h.extend(Sn(o,t,n,a,c,p,m,y,_,x),{u_gamma_scale:a?Math.cos(w._pitch)*w.cameraToCenterDistance:1,u_device_pixel_ratio:c.pixelRatio,u_is_halo:+T})},Ts=(o,t,n,a,c,p,m,y,_,x)=>h.extend(In(o,t,n,a,c,p,m,y,!0,_,!0),{u_texsize_icon:x,u_texture_icon:1}),Bi=(o,t,n)=>({u_matrix:o,u_opacity:t,u_color:n}),Ri=(o,t,n,a,c,p)=>h.extend(function(m,y,_,x){const T=_.imageManager.getPattern(m.from.toString()),w=_.imageManager.getPattern(m.to.toString()),{width:k,height:O}=_.imageManager.getPixelSize(),B=Math.pow(2,x.tileID.overscaledZ),R=x.tileSize*Math.pow(2,_.transform.tileZoom)/B,q=R*(x.tileID.canonical.x+x.tileID.wrap*B),H=R*x.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:w.tl,u_pattern_br_b:w.br,u_texsize:[k,O],u_mix:y.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:w.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/W(x,1,_.transform.tileZoom),u_pixel_coord_upper:[q>>16,H>>16],u_pixel_coord_lower:[65535&q,65535&H]}}(a,p,n,c),{u_matrix:o,u_opacity:t}),Ta={fillExtrusion:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_lightpos:new h.Uniform3f(o,t.u_lightpos),u_lightintensity:new h.Uniform1f(o,t.u_lightintensity),u_lightcolor:new h.Uniform3f(o,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(o,t.u_vertical_gradient),u_opacity:new h.Uniform1f(o,t.u_opacity)}),fillExtrusionPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_lightpos:new h.Uniform3f(o,t.u_lightpos),u_lightintensity:new h.Uniform1f(o,t.u_lightintensity),u_lightcolor:new h.Uniform3f(o,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(o,t.u_vertical_gradient),u_height_factor:new h.Uniform1f(o,t.u_height_factor),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade),u_opacity:new h.Uniform1f(o,t.u_opacity)}),fill:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),fillPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),fillOutline:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world)}),fillOutlinePattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),circle:(o,t)=>({u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_scale_with_map:new h.Uniform1i(o,t.u_scale_with_map),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_extrude_scale:new h.Uniform2f(o,t.u_extrude_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),collisionBox:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pixels_to_tile_units:new h.Uniform1f(o,t.u_pixels_to_tile_units),u_extrude_scale:new h.Uniform2f(o,t.u_extrude_scale),u_overscale_factor:new h.Uniform1f(o,t.u_overscale_factor)}),collisionCircle:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_inv_matrix:new h.UniformMatrix4f(o,t.u_inv_matrix),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_viewport_size:new h.Uniform2f(o,t.u_viewport_size)}),debug:(o,t)=>({u_color:new h.UniformColor(o,t.u_color),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_overlay:new h.Uniform1i(o,t.u_overlay),u_overlay_scale:new h.Uniform1f(o,t.u_overlay_scale)}),clippingMask:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),heatmap:(o,t)=>({u_extrude_scale:new h.Uniform1f(o,t.u_extrude_scale),u_intensity:new h.Uniform1f(o,t.u_intensity),u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),heatmapTexture:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world),u_image:new h.Uniform1i(o,t.u_image),u_color_ramp:new h.Uniform1i(o,t.u_color_ramp),u_opacity:new h.Uniform1f(o,t.u_opacity)}),hillshade:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_latrange:new h.Uniform2f(o,t.u_latrange),u_light:new h.Uniform2f(o,t.u_light),u_shadow:new h.UniformColor(o,t.u_shadow),u_highlight:new h.UniformColor(o,t.u_highlight),u_accent:new h.UniformColor(o,t.u_accent)}),hillshadePrepare:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_dimension:new h.Uniform2f(o,t.u_dimension),u_zoom:new h.Uniform1f(o,t.u_zoom),u_unpack:new h.Uniform4f(o,t.u_unpack)}),line:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels)}),lineGradient:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_image:new h.Uniform1i(o,t.u_image),u_image_height:new h.Uniform1f(o,t.u_image_height)}),linePattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texsize:new h.Uniform2f(o,t.u_texsize),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_image:new h.Uniform1i(o,t.u_image),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),lineSDF:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_patternscale_a:new h.Uniform2f(o,t.u_patternscale_a),u_patternscale_b:new h.Uniform2f(o,t.u_patternscale_b),u_sdfgamma:new h.Uniform1f(o,t.u_sdfgamma),u_image:new h.Uniform1i(o,t.u_image),u_tex_y_a:new h.Uniform1f(o,t.u_tex_y_a),u_tex_y_b:new h.Uniform1f(o,t.u_tex_y_b),u_mix:new h.Uniform1f(o,t.u_mix)}),raster:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_tl_parent:new h.Uniform2f(o,t.u_tl_parent),u_scale_parent:new h.Uniform1f(o,t.u_scale_parent),u_buffer_scale:new h.Uniform1f(o,t.u_buffer_scale),u_fade_t:new h.Uniform1f(o,t.u_fade_t),u_opacity:new h.Uniform1f(o,t.u_opacity),u_image0:new h.Uniform1i(o,t.u_image0),u_image1:new h.Uniform1i(o,t.u_image1),u_brightness_low:new h.Uniform1f(o,t.u_brightness_low),u_brightness_high:new h.Uniform1f(o,t.u_brightness_high),u_saturation_factor:new h.Uniform1f(o,t.u_saturation_factor),u_contrast_factor:new h.Uniform1f(o,t.u_contrast_factor),u_spin_weights:new h.Uniform3f(o,t.u_spin_weights)}),symbolIcon:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texture:new h.Uniform1i(o,t.u_texture)}),symbolSDF:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texture:new h.Uniform1i(o,t.u_texture),u_gamma_scale:new h.Uniform1f(o,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(o,t.u_is_halo)}),symbolTextAndIcon:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texsize_icon:new h.Uniform2f(o,t.u_texsize_icon),u_texture:new h.Uniform1i(o,t.u_texture),u_texture_icon:new h.Uniform1i(o,t.u_texture_icon),u_gamma_scale:new h.Uniform1f(o,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(o,t.u_is_halo)}),background:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_opacity:new h.Uniform1f(o,t.u_opacity),u_color:new h.UniformColor(o,t.u_color)}),backgroundPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_opacity:new h.Uniform1f(o,t.u_opacity),u_image:new h.Uniform1i(o,t.u_image),u_pattern_tl_a:new h.Uniform2f(o,t.u_pattern_tl_a),u_pattern_br_a:new h.Uniform2f(o,t.u_pattern_br_a),u_pattern_tl_b:new h.Uniform2f(o,t.u_pattern_tl_b),u_pattern_br_b:new h.Uniform2f(o,t.u_pattern_br_b),u_texsize:new h.Uniform2f(o,t.u_texsize),u_mix:new h.Uniform1f(o,t.u_mix),u_pattern_size_a:new h.Uniform2f(o,t.u_pattern_size_a),u_pattern_size_b:new h.Uniform2f(o,t.u_pattern_size_b),u_scale_a:new h.Uniform1f(o,t.u_scale_a),u_scale_b:new h.Uniform1f(o,t.u_scale_b),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_tile_units_to_pixels:new h.Uniform1f(o,t.u_tile_units_to_pixels)}),terrain:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texture:new h.Uniform1i(o,t.u_texture),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)}),terrainDepth:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)}),terrainCoords:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texture:new h.Uniform1i(o,t.u_texture),u_terrain_coords_id:new h.Uniform1f(o,t.u_terrain_coords_id),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)})};class Es{constructor(t,n,a){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ss={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ea{constructor(t,n,a,c){this.length=n.length,this.attributes=a,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;const p=t.gl;this.buffer=p.createBuffer(),t.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let a=0;a0){const Ce=h.create(),Ue=_e;h.mul(Ce,me.placementInvProjMatrix,o.transform.glCoordMatrix),h.mul(Ce,Ce,me.placementViewportMatrix),T.push({circleArray:ge,circleOffset:k,transform:Ue,invTransform:Ce,coord:re}),w+=ge.length/4,k=w}ve&&x.draw(y,_.LINES,st.disabled,It.disabled,o.colorModeForRenderPass(),Et.disabled,va(_e,o.transform,oe),o.style.map.terrain&&o.style.map.terrain.getTerrainData(re),n.id,ve.layoutVertexBuffer,ve.indexBuffer,ve.segments,null,o.transform.zoom,null,null,ve.collisionVertexBuffer)}if(!m||!T.length)return;const O=o.useProgram("collisionCircle"),B=new h.CollisionCircleLayoutArray;B.resize(4*w),B._trim();let R=0;for(const $ of T)for(let re=0;re<$.circleArray.length/4;re++){const oe=4*re,me=$.circleArray[oe+0],_e=$.circleArray[oe+1],ve=$.circleArray[oe+2],ge=$.circleArray[oe+3];B.emplace(R++,me,_e,ve,ge,0),B.emplace(R++,me,_e,ve,ge,1),B.emplace(R++,me,_e,ve,ge,2),B.emplace(R++,me,_e,ve,ge,3)}(!kn||kn.length<2*w)&&(kn=function($){const re=2*$,oe=new h.QuadTriangleArray;oe.resize(re),oe._trim();for(let me=0;me=0&&(B[q.associatedIconIndex]={shiftedAnchor:Ke,angle:Ee})}else L(q.numGlyphs,k)}if(x){O.clear();const R=o.icon.placedSymbolArray;for(let q=0;qo.style.map.terrain.getElevation(ve,Qs,Mr):null,Oi=n.layout.get("text-rotation-alignment")==="map";Er(Ce,ve.posMatrix,o,c,rr,Ti,q,x,Oi,ti)}const mi=o.translatePosMatrix(ve.posMatrix,ge,p,m),ai=H||c&&me||ls?La:rr,ft=o.translatePosMatrix(Ti,ge,p,m,!0),ei=Ee&&n.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let oi;oi=Ee?Ce.iconsInText?Ts(je.kind,qt,se,q,o,mi,ai,ft,Je,si):In(je.kind,qt,se,q,o,mi,ai,ft,c,Je,!0):Sn(je.kind,qt,se,q,o,mi,ai,ft,c,Je);const gt={program:ut,buffers:Ue,uniformValues:oi,atlasTexture:Ot,atlasTextureIcon:Fi,atlasInterpolation:wi,atlasInterpolationIcon:jt,isSDF:Ee,hasHalo:ei};if($&&Ce.canOverlap){re=!0;const ti=Ue.segments.get();for(const Oi of ti)_e.push({segments:new h.SegmentVector([Oi]),sortKey:Oi.sortKey,state:gt,terrainData:dt})}else _e.push({segments:Ue.segments,sortKey:0,state:gt,terrainData:dt})}re&&_e.sort((ve,ge)=>ve.sortKey-ge.sortKey);for(const ve of _e){const ge=ve.state;if(k.activeTexture.set(O.TEXTURE0),ge.atlasTexture.bind(ge.atlasInterpolation,O.CLAMP_TO_EDGE),ge.atlasTextureIcon&&(k.activeTexture.set(O.TEXTURE1),ge.atlasTextureIcon&&ge.atlasTextureIcon.bind(ge.atlasInterpolationIcon,O.CLAMP_TO_EDGE)),ge.isSDF){const Ce=ge.uniformValues;ge.hasHalo&&(Ce.u_is_halo=1,Ba(ge.buffers,ve.segments,n,o,ge.program,oe,T,w,Ce,ve.terrainData)),Ce.u_is_halo=0}Ba(ge.buffers,ve.segments,n,o,ge.program,oe,T,w,ge.uniformValues,ve.terrainData)}}function Ba(o,t,n,a,c,p,m,y,_,x){const T=a.context;c.draw(T,T.gl.TRIANGLES,p,m,y,Et.disabled,_,x,n.id,o.layoutVertexBuffer,o.indexBuffer,t,n.paint,a.transform.zoom,o.programConfigurations.get(n.id),o.dynamicLayoutVertexBuffer,o.opacityVertexBuffer)}function Ra(o,t,n,a,c){if(!n||!a||!a.imageAtlas)return;const p=a.imageAtlas.patternPositions;let m=p[n.to.toString()],y=p[n.from.toString()];if(!m||!y){const _=c.getPaintProperty(t);m=p[_],y=p[_]}m&&y&&o.setConstantPatternPositions(m,y)}function Kn(o,t,n,a,c,p,m){const y=o.context.gl,_="fill-pattern",x=n.paint.get(_),T=x&&x.constantOr(1),w=n.getCrossfadeParameters();let k,O,B,R,q;m?(O=T&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",k=y.LINES):(O=T?"fillPattern":"fill",k=y.TRIANGLES);const H=x.constantOr(null);for(const se of a){const $=t.getTile(se);if(T&&!$.patternsLoaded())continue;const re=$.getBucket(n);if(!re)continue;const oe=re.programConfigurations.get(n.id),me=o.useProgram(O,oe),_e=o.style.map.terrain&&o.style.map.terrain.getTerrainData(se);T&&(o.context.activeTexture.set(y.TEXTURE0),$.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),oe.updatePaintBuffers(w)),Ra(oe,_,H,$,n);const ve=_e?se:null,ge=o.translatePosMatrix(ve?ve.posMatrix:se.posMatrix,$,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(m){R=re.indexBuffer2,q=re.segments2;const Ce=[y.drawingBufferWidth,y.drawingBufferHeight];B=O==="fillOutlinePattern"&&T?ko(ge,o,w,$,Ce):ql(ge,Ce)}else R=re.indexBuffer,q=re.segments,B=T?xa(ge,o,w,$):Co(ge);me.draw(o.context,k,c,o.stencilModeForClipping(se),p,Et.disabled,B,_e,n.id,re.layoutVertexBuffer,R,q,n.paint,o.transform.zoom,oe)}}function Yn(o,t,n,a,c,p,m){const y=o.context,_=y.gl,x="fill-extrusion-pattern",T=n.paint.get(x),w=T.constantOr(1),k=n.getCrossfadeParameters(),O=n.paint.get("fill-extrusion-opacity"),B=T.constantOr(null);for(const R of a){const q=t.getTile(R),H=q.getBucket(n);if(!H)continue;const se=o.style.map.terrain&&o.style.map.terrain.getTerrainData(R),$=H.programConfigurations.get(n.id),re=o.useProgram(w?"fillExtrusionPattern":"fillExtrusion",$);w&&(o.context.activeTexture.set(_.TEXTURE0),q.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),$.updatePaintBuffers(k)),Ra($,x,B,q,n);const oe=o.translatePosMatrix(R.posMatrix,q,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),me=n.paint.get("fill-extrusion-vertical-gradient"),_e=w?ya(oe,o,me,O,R,k,q):Mo(oe,o,me,O);re.draw(y,y.gl.TRIANGLES,c,p,m,Et.backCCW,_e,se,n.id,H.layoutVertexBuffer,H.indexBuffer,H.segments,n.paint,o.transform.zoom,$,o.style.map.terrain&&H.centroidVertexBuffer)}}function tc(o,t,n,a,c,p,m){const y=o.context,_=y.gl,x=n.fbo;if(!x)return;const T=o.useProgram("hillshade"),w=o.style.map.terrain&&o.style.map.terrain.getTerrainData(t);y.activeTexture.set(_.TEXTURE0),_.bindTexture(_.TEXTURE_2D,x.colorAttachment.get()),T.draw(y,_.TRIANGLES,c,p,m,Et.disabled,((k,O,B,R)=>{const q=B.paint.get("hillshade-shadow-color"),H=B.paint.get("hillshade-highlight-color"),se=B.paint.get("hillshade-accent-color");let $=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&($-=k.transform.angle);const re=!k.options.moving;return{u_matrix:R?R.posMatrix:k.transform.calculatePosMatrix(O.tileID.toUnwrapped(),re),u_image:0,u_latrange:Do(0,O.tileID),u_light:[B.paint.get("hillshade-exaggeration"),$],u_shadow:q,u_highlight:H,u_accent:se}})(o,n,a,w?t:null),w,a.id,o.rasterBoundsBuffer,o.quadTriangleIndexBuffer,o.rasterBoundsSegments)}function jo(o,t,n,a,c,p){const m=o.context,y=m.gl,_=t.dem;if(_&&_.data){const x=_.dim,T=_.stride,w=_.getPixels();if(m.activeTexture.set(y.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||o.getTileTexture(T),t.demTexture){const O=t.demTexture;O.update(w,{premultiply:!1}),O.bind(y.NEAREST,y.CLAMP_TO_EDGE)}else t.demTexture=new yt(m,w,y.RGBA,{premultiply:!1}),t.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);m.activeTexture.set(y.TEXTURE0);let k=t.fbo;if(!k){const O=new yt(m,{width:x,height:x,data:null},y.RGBA);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),k=t.fbo=m.createFramebuffer(x,x,!0,!1),k.colorAttachment.set(O.texture)}m.bindFramebuffer.set(k.framebuffer),m.viewport.set([0,0,x,x]),o.useProgram("hillshadePrepare").draw(m,y.TRIANGLES,a,c,p,Et.disabled,((O,B)=>{const R=B.stride,q=h.create();return h.ortho(q,0,h.EXTENT,-h.EXTENT,0,0,1),h.translate(q,q,[0,-h.EXTENT,0]),{u_matrix:q,u_image:1,u_dimension:[R,R],u_zoom:O.overscaledZ,u_unpack:B.getUnpackVector()}})(t.tileID,_),null,n.id,o.rasterBoundsBuffer,o.quadTriangleIndexBuffer,o.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function $t(o,t,n,a,c,p){const m=a.paint.get("raster-fade-duration");if(!p&&m>0){const y=h.exported.now(),_=(y-o.timeAdded)/m,x=t?(y-t.timeAdded)/m:-1,T=n.getSource(),w=c.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),k=!t||Math.abs(t.tileID.overscaledZ-w)>Math.abs(o.tileID.overscaledZ-w),O=k&&o.refreshedUponExpiration?1:h.clamp(k?_:1-x,0,1);return o.refreshedUponExpiration&&_>=1&&(o.refreshedUponExpiration=!1),t?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}const rn=new h.Color(1,0,0,1),Ki=new h.Color(0,1,0,1),Zo=new h.Color(0,0,1,1),Fa=new h.Color(1,0,1,1),Go=new h.Color(0,1,1,1);function nn(o,t,n,a){zn(o,0,t+n/2,o.transform.width,n,a)}function Jn(o,t,n,a){zn(o,t-n/2,0,n,o.transform.height,a)}function zn(o,t,n,a,c,p){const m=o.context,y=m.gl;y.enable(y.SCISSOR_TEST),y.scissor(t*o.pixelRatio,n*o.pixelRatio,a*o.pixelRatio,c*o.pixelRatio),m.clear({color:p}),y.disable(y.SCISSOR_TEST)}function Xo(o,t,n){const a=o.context,c=a.gl,p=n.posMatrix,m=o.useProgram("debug"),y=st.disabled,_=It.disabled,x=o.colorModeForRenderPass(),T="$debug",w=o.style.map.terrain&&o.style.map.terrain.getTerrainData(n);a.activeTexture.set(c.TEXTURE0);const k=t.getTileByID(n.key).latestRawTileData,O=Math.floor((k&&k.byteLength||0)/1024),B=t.getTile(n).tileSize,R=512/Math.min(B,512)*(n.overscaledZ/o.transform.zoom)*.5;let q=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(q+=` => ${n.overscaledZ}`),function(H,se){H.initDebugOverlayCanvas();const $=H.debugOverlayCanvas,re=H.context.gl,oe=H.debugOverlayCanvas.getContext("2d");oe.clearRect(0,0,$.width,$.height),oe.shadowColor="white",oe.shadowBlur=2,oe.lineWidth=1.5,oe.strokeStyle="white",oe.textBaseline="top",oe.font="bold 36px Open Sans, sans-serif",oe.fillText(se,5,5),oe.strokeText(se,5,5),H.debugOverlayTexture.update($),H.debugOverlayTexture.bind(re.LINEAR,re.CLAMP_TO_EDGE)}(o,`${q} ${O}kB`),m.draw(a,c.TRIANGLES,y,_,Dt.alphaBlended,Et.disabled,ba(p,h.Color.transparent,R),null,T,o.debugBuffer,o.quadTriangleIndexBuffer,o.debugSegments),m.draw(a,c.LINE_STRIP,y,_,x,Et.disabled,ba(p,h.Color.red),w,T,o.debugBuffer,o.tileBorderIndexBuffer,o.debugSegments)}function Oa(o,t,n){const a=o.context,c=a.gl,p=o.colorModeForRenderPass(),m=new st(c.LEQUAL,st.ReadWrite,o.depthRangeFor3D),y=o.useProgram("terrain"),_=t.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,o.width,o.height]);for(const x of n){const T=o.renderToTexture.getTexture(x),w=t.getTerrainData(x.tileID);a.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,T.texture);const k={u_matrix:o.transform.calculatePosMatrix(x.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(o.transform.zoom)};y.draw(a,c.TRIANGLES,m,It.disabled,p,Et.backCCW,k,w,"terrain",_.vertexBuffer,_.indexBuffer,_.segments)}}const Ua={symbol:function(o,t,n,a,c){if(o.renderPass!=="translucent")return;const p=It.disabled,m=o.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(y,_,x,T,w,k,O){const B=_.transform,R=w==="map",q=k==="map";for(const H of y){const se=T.getTile(H),$=se.getBucket(x);if(!$||!$.text||!$.text.segments.get().length)continue;const re=h.evaluateSizeForZoom($.textSizeData,B.zoom),oe=W(se,1,_.transform.zoom),me=Ye(H.posMatrix,q,R,_.transform,oe),_e=x.layout.get("icon-text-fit")!=="none"&&$.hasIconData();if(re){const ve=Math.pow(2,B.zoom-se.tileID.overscaledZ);qo($,R,q,O,B,me,H.posMatrix,ve,re,_e,_.style.map.terrain?(ge,Ce)=>_.style.map.terrain.getElevation(H,ge,Ce):null)}}}(a,o,n,t,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),c),n.paint.get("icon-opacity").constantOr(1)!==0&&zs(o,t,n,a,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),p,m),n.paint.get("text-opacity").constantOr(1)!==0&&zs(o,t,n,a,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),p,m),t.map.showCollisionBoxes&&($o(o,t,n,a,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),$o(o,t,n,a,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(o,t,n,a){if(o.renderPass!=="translucent")return;const c=n.paint.get("circle-opacity"),p=n.paint.get("circle-stroke-width"),m=n.paint.get("circle-stroke-opacity"),y=!n.layout.get("circle-sort-key").isConstant();if(c.constantOr(1)===0&&(p.constantOr(1)===0||m.constantOr(1)===0))return;const _=o.context,x=_.gl,T=o.depthModeForSublayer(0,st.ReadOnly),w=It.disabled,k=o.colorModeForRenderPass(),O=[];for(let B=0;BB.sortKey-R.sortKey);for(const B of O){const{programConfiguration:R,program:q,layoutVertexBuffer:H,indexBuffer:se,uniformValues:$,terrainData:re}=B.state;q.draw(_,x.TRIANGLES,T,w,k,Et.disabled,$,re,n.id,H,se,B.segments,n.paint,o.transform.zoom,R)}},heatmap:function(o,t,n,a){if(n.paint.get("heatmap-opacity")!==0)if(o.renderPass==="offscreen"){const c=o.context,p=c.gl,m=It.disabled,y=new Dt([p.ONE,p.ONE],h.Color.transparent,[!0,!0,!0,!0]);(function(_,x,T){const w=_.gl;_.activeTexture.set(w.TEXTURE1),_.viewport.set([0,0,x.width/4,x.height/4]);let k=T.heatmapFbo;if(k)w.bindTexture(w.TEXTURE_2D,k.colorAttachment.get()),_.bindFramebuffer.set(k.framebuffer);else{const O=w.createTexture();w.bindTexture(w.TEXTURE_2D,O),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,w.LINEAR),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,w.LINEAR),k=T.heatmapFbo=_.createFramebuffer(x.width/4,x.height/4,!1,!1),function(B,R,q,H){var se,$;const re=B.gl,oe=(se=B.HALF_FLOAT)!==null&&se!==void 0?se:re.UNSIGNED_BYTE,me=($=B.RGBA16F)!==null&&$!==void 0?$:re.RGBA;re.texImage2D(re.TEXTURE_2D,0,me,R.width/4,R.height/4,0,re.RGBA,oe,null),H.colorAttachment.set(q)}(_,x,O,k)}})(c,o,n),c.clear({color:h.Color.transparent});for(let _=0;_{const B=h.create();h.ortho(B,0,T.width,T.height,0,0,1);const R=T.context.gl;return{u_matrix:B,u_world:[R.drawingBufferWidth,R.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:w.paint.get("heatmap-opacity")}})(c,p),null,p.id,c.viewportBuffer,c.quadTriangleIndexBuffer,c.viewportSegments,p.paint,c.transform.zoom)}(o,n))},line:function(o,t,n,a){if(o.renderPass!=="translucent")return;const c=n.paint.get("line-opacity"),p=n.paint.get("line-width");if(c.constantOr(1)===0||p.constantOr(1)===0)return;const m=o.depthModeForSublayer(0,st.ReadOnly),y=o.colorModeForRenderPass(),_=n.paint.get("line-dasharray"),x=n.paint.get("line-pattern"),T=x.constantOr(1),w=n.paint.get("line-gradient"),k=n.getCrossfadeParameters(),O=T?"linePattern":_?"lineSDF":w?"lineGradient":"line",B=o.context,R=B.gl;let q=!0;for(const H of a){const se=t.getTile(H);if(T&&!se.patternsLoaded())continue;const $=se.getBucket(n);if(!$)continue;const re=$.programConfigurations.get(n.id),oe=o.context.program.get(),me=o.useProgram(O,re),_e=q||me.program!==oe,ve=o.style.map.terrain&&o.style.map.terrain.getTerrainData(H),ge=x.constantOr(null);if(ge&&se.imageAtlas){const Ke=se.imageAtlas,Ee=Ke.patternPositions[ge.to.toString()],je=Ke.patternPositions[ge.from.toString()];Ee&&je&&re.setConstantPatternPositions(Ee,je)}const Ce=ve?H:null,Ue=T?Hi(o,se,n,k,Ce):_?vs(o,se,n,_,k,Ce):w?xs(o,se,n,$.lineClipsArray.length,Ce):Ir(o,se,n,Ce);if(T)B.activeTexture.set(R.TEXTURE0),se.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),re.updatePaintBuffers(k);else if(_&&(_e||o.lineAtlas.dirty))B.activeTexture.set(R.TEXTURE0),o.lineAtlas.bind(B);else if(w){const Ke=$.gradients[n.id];let Ee=Ke.texture;if(n.gradientVersion!==Ke.version){let je=256;if(n.stepInterpolant){const ke=t.getSource().maxzoom,ut=H.canonical.z===ke?Math.ceil(1<256&&this.clearStencil(),a.setColorMode(Dt.disabled),a.setDepthMode(st.disabled);const p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of n){const y=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,_=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);p.draw(a,c.TRIANGLES,st.disabled,new It({func:c.ALWAYS,mask:0},y,255,c.KEEP,c.KEEP,c.REPLACE),Dt.disabled,Et.disabled,wa(m.posMatrix),_,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new It({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new It({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,a=t.sort((m,y)=>y.overscaledZ-m.overscaledZ),c=a[a.length-1].overscaledZ,p=a[0].overscaledZ-c+1;if(p>1){this.currentStencilSource=void 0,this.nextStencilID+p>256&&this.clearStencil();const m={};for(let y=0;y=0;this.currentLayer--){const _=this.style._layers[a[this.currentLayer]],x=c[_.source],T=p[_.source];this._renderTileClippingMasks(_,T),this.renderLayer(this,x,_,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerq.source&&!q.isHidden(T)?[x.sourceCaches[q.source]]:[]),O=k.filter(q=>q.getSource().type==="vector"),B=k.filter(q=>q.getSource().type!=="vector"),R=q=>{(!w||w.getSource().maxzoomR(q)),w||B.forEach(q=>R(q)),w}(this.style,this.transform.zoom);_&&Ua.debug(this,_,_.getVisibleCoordinates())}this.options.showPadding&&function(_){const x=_.transform.padding;nn(_,_.transform.height-(x.top||0),3,rn),nn(_,x.bottom||0,3,Ki),Jn(_,x.left||0,3,Zo),Jn(_,_.transform.width-(x.right||0),3,Fa);const T=_.transform.centerPoint;(function(w,k,O,B){zn(w,k-1,O-10,2,20,B),zn(w,k-10,O-1,20,2,B)})(_,T.x,_.transform.height-T.y,Go)}(this),this.context.setDefault()}renderLayer(t,n,a,c){a.isHidden(this.transform.zoom)||(a.type==="background"||a.type==="custom"||(c||[]).length)&&(this.id=a.id,Ua[a.type](t,n,a,c,this.style.placement.variableOffsets))}translatePosMatrix(t,n,a,c,p){if(!a[0]&&!a[1])return t;const m=p?c==="map"?this.transform.angle:0:c==="viewport"?-this.transform.angle:0;if(m){const x=Math.sin(m),T=Math.cos(m);a=[a[0]*T-a[1]*x,a[0]*x+a[1]*T]}const y=[p?a[0]:W(n,a[0],this.transform.zoom),p?a[1]:W(n,a[1],this.transform.zoom),0],_=new Float32Array(16);return h.translate(_,t,y),_}saveTileTexture(t){const n=this._tileTextures[t.size[0]];n?n.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),a=this.imageManager.getPattern(t.to.toString());return!n||!a}useProgram(t,n){this.cache=this.cache||{};const a=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new ys(this.context,t,Nr[t],n,Ta[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new yt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class Ds{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,a){const c=Math.pow(2,a),p=[[-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(y=>{const _=1/(y=h.transformMat4([],y,t))[3]/n*c;return h.mul$1(y,y,[_,_,1/y[3],_])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(y=>{const _=function(k,O){var B=O[0],R=O[1],q=O[2],H=B*B+R*R+q*q;return H>0&&(H=1/Math.sqrt(H)),k[0]=O[0]*H,k[1]=O[1]*H,k[2]=O[2]*H,k}([],function(k,O,B){var R=O[0],q=O[1],H=O[2],se=B[0],$=B[1],re=B[2];return k[0]=q*re-H*$,k[1]=H*se-R*re,k[2]=R*$-q*se,k}([],Mt([],p[y[0]],p[y[1]]),Mt([],p[y[2]],p[y[1]]))),x=-((T=_)[0]*(w=p[y[1]])[0]+T[1]*w[1]+T[2]*w[2]);var T,w;return _.concat(x)});return new Ds(p,m)}}class hr{constructor(t,n){this.min=t,this.max=n,this.center=function(a,c,p){return a[0]=.5*c[0],a[1]=.5*c[1],a[2]=.5*c[2],a}([],function(a,c,p){return a[0]=c[0]+p[0],a[1]=c[1]+p[1],a[2]=c[2]+p[2],a}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],a=Rt(this.min),c=Rt(this.max);for(let p=0;p=0&&m++;if(m===0)return 0;m!==n.length&&(a=!1)}if(a)return 2;for(let c=0;c<3;c++){let p=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let y=0;ythis.max[c]-this.min[c])return 0}return 1}}class Ls{constructor(t=0,n=0,a=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(a)||a<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=a,this.right=c}interpolate(t,n,a){return n.top!=null&&t.top!=null&&(this.top=h.interpolate.number(t.top,n.top,a)),n.bottom!=null&&t.bottom!=null&&(this.bottom=h.interpolate.number(t.bottom,n.bottom,a)),n.left!=null&&t.left!=null&&(this.left=h.interpolate.number(t.left,n.left,a)),n.right!=null&&t.right!=null&&(this.right=h.interpolate.number(t.right,n.right,a)),this}getCenter(t,n){const a=h.clamp((this.left+t-this.right)/2,0,t),c=h.clamp((this.top+n-this.bottom)/2,0,n);return new h.Point(a,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Ls(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Bs{constructor(t,n,a,c,p){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=p===void 0||!!p,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=c??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new h.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Ls,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const t=new Bs(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new h.Point(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-h.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var a=new h.ARRAY_TYPE(4);return h.ARRAY_TYPE!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,c,p){var m=c[0],y=c[1],_=c[2],x=c[3],T=Math.sin(p),w=Math.cos(p);a[0]=m*w+_*T,a[1]=y*w+x*T,a[2]=m*-T+_*w,a[3]=y*-T+x*w}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=h.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,a){this._unmodified=!1,this._edgeInsets.interpolate(t,n,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new h.UnwrappedTileID(0,t)];if(this._renderWorldCopies){const a=this.pointCoordinate(new h.Point(0,0)),c=this.pointCoordinate(new h.Point(this.width,0)),p=this.pointCoordinate(new h.Point(this.width,this.height)),m=this.pointCoordinate(new h.Point(0,this.height)),y=Math.floor(Math.min(a.x,c.x,p.x,m.x)),_=Math.floor(Math.max(a.x,c.x,p.x,m.x)),x=1;for(let T=y-x;T<=_+x;T++)T!==0&&n.push(new h.UnwrappedTileID(T,t))}return n}coveringTiles(t){var n,a;let c=this.coveringZoomLevel(t);const p=c;if(t.minzoom!==void 0&&ct.maxzoom&&(c=t.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),y=h.MercatorCoordinate.fromLngLat(this.center),_=Math.pow(2,c),x=[_*m.x,_*m.y,0],T=[_*y.x,_*y.y,0],w=Ds.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c);let k=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(k=c);const O=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,B=$=>({aabb:new hr([$*_,0,0],[($+1)*_,_,0]),zoom:0,x:0,y:0,wrap:$,fullyVisible:!1}),R=[],q=[],H=c,se=t.reparseOverscaled?p:c;if(this._renderWorldCopies)for(let $=1;$<=3;$++)R.push(B(-$)),R.push(B($));for(R.push(B(0));R.length>0;){const $=R.pop(),re=$.x,oe=$.y;let me=$.fullyVisible;if(!me){const Ue=$.aabb.intersects(w);if(Ue===0)continue;me=Ue===2}const _e=t.terrain?x:T,ve=$.aabb.distanceX(_e),ge=$.aabb.distanceY(_e),Ce=Math.max(Math.abs(ve),Math.abs(ge));if($.zoom===H||Ce>O+(1<=k){const Ue=H-$.zoom,Ke=x[0]-.5-(re<>1),je=$.zoom+1;let ke=$.aabb.quadrant(Ue);if(t.terrain){const ut=new h.OverscaledTileID(je,$.wrap,je,Ke,Ee),qt=t.terrain.getMinMaxElevation(ut),dt=(n=qt.minElevation)!==null&&n!==void 0?n:this.elevation,Je=(a=qt.maxElevation)!==null&&a!==void 0?a:this.elevation;ke=new hr([ke.min[0],ke.min[1],dt],[ke.max[0],ke.max[1],Je])}R.push({aabb:ke,zoom:je,x:Ke,y:Ee,wrap:$.wrap,fullyVisible:me})}}return q.sort(($,re)=>$.distanceSq-re.distanceSq).map($=>$.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const n=h.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new h.Point(h.mercatorXfromLng(t.lng)*this.worldSize,h.mercatorYfromLat(n)*this.worldSize)}unproject(t){return new h.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(t){this.freezeElevation||(this.elevation=t?this.getElevation(this._center,t):0)}getElevation(t,n){const a=h.MercatorCoordinate.fromLngLat(t.wrap()),c=(1<m&&(c=m-B)}if(this.lngRange){const O=(y+_)/2,B=h.wrap(w.x,O-this.worldSize/2,O+this.worldSize/2),R=x.x/2;B-R_&&(a=_-R)}a===void 0&&c===void 0||(this.center=this.unproject(new h.Point(a!==void 0?a:w.x,c!==void 0?c:w.y)).wrap()),this._unmodified=T,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=h.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let c=h.identity(new Float64Array(16));h.scale(c,c,[this.width/2,-this.height/2,1]),h.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=h.identity(new Float64Array(16)),h.scale(c,c,[1,-1,1]),h.translate(c,c,[-1,-1,0]),h.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const p=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,m=Math.PI/2+this._pitch,y=this._fov*(.5+t.y/this.height),_=Math.sin(y)*p/Math.sin(h.clamp(Math.PI-m-y,.01,Math.PI-.01)),x=this.getHorizon(),T=2*Math.atan(x/this.cameraToCenterDistance)*(.5+t.y/(2*x)),w=Math.sin(T)*p/Math.sin(h.clamp(Math.PI-m-T,.01,Math.PI-.01)),k=Math.min(_,w),O=1.01*(Math.cos(Math.PI/2-this._pitch)*k+p),B=this.height/50;c=new Float64Array(16),h.perspective(c,this._fov,this.width/this.height,B,O),c[8]=2*-t.x/this.width,c[9]=2*t.y/this.height,h.scale(c,c,[1,-1,1]),h.translate(c,c,[0,0,-this.cameraToCenterDistance]),h.rotateX(c,c,this._pitch),h.rotateZ(c,c,this.angle),h.translate(c,c,[-n,-a,0]),this.mercatorMatrix=h.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),h.scale(c,c,[1,1,this._pixelPerMeter]),this.pixelMatrix=h.multiply(new Float64Array(16),this.labelPlaneMatrix,c),h.translate(c,c,[0,0,-this.elevation]),this.projMatrix=c,this.invProjMatrix=h.invert([],c),this.pixelMatrix3D=h.multiply(new Float64Array(16),this.labelPlaneMatrix,c);const R=this.width%2/2,q=this.height%2/2,H=Math.cos(this.angle),se=Math.sin(this.angle),$=n-Math.round(n)+H*R+se*q,re=a-Math.round(a)+H*q+se*R,oe=new Float64Array(c);if(h.translate(oe,oe,[$>.5?$-1:$,re>.5?re-1:re,0]),this.alignedProjMatrix=oe,c=h.invert(new Float64Array(16),this.pixelMatrix),!c)throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new h.Point(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return h.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new h.Point(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let a=n.x,c=n.y,p=n.x,m=n.y;for(const y of t)a=Math.min(a,y.x),c=Math.min(c,y.y),p=Math.max(p,y.x),m=Math.max(m,y.y);return[new h.Point(a,c),new h.Point(p,c),new h.Point(p,m),new h.Point(a,m),new h.Point(a,c)]}}}class Ho{constructor(t){this._hashName=t&&encodeURIComponent(t),h.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(n,a){let c=!1,p=null;const m=()=>{p=null,c&&(n(),p=setTimeout(m,300),c=!1)};return()=>(c=!0,p||m(),p)}(this._updateHashUnthrottled.bind(this))}addTo(t){return this._map=t,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(t){const n=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,c=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,c),m=Math.round(n.lng*p)/p,y=Math.round(n.lat*p)/p,_=this._map.getBearing(),x=this._map.getPitch();let T="";if(T+=t?`/${m}/${y}/${a}`:`${a}/${y}/${m}`,(_||x)&&(T+="/"+Math.round(10*_)/10),x&&(T+=`/${Math.round(x)}`),this._hashName){const w=this._hashName;let k=!1;const O=window.location.hash.slice(1).split("&").map(B=>{const R=B.split("=")[0];return R===w?(k=!0,`${R}=${T}`):B}).filter(B=>B);return k||O.push(`${w}=${T}`),`#${O.join("&")}`}return`#${T}`}_getCurrentHash(){const t=window.location.hash.replace("#","");if(this._hashName){let n;return t.split("&").map(a=>a.split("=")).forEach(a=>{a[0]===this._hashName&&(n=a)}),(n&&n[1]||"").split("/")}return t.split("/")}_onHashChange(){const t=this._getCurrentHash();if(t.length>=3&&!t.some(n=>isNaN(n))){const n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,t)}catch{}}}const Qn={linearity:.3,easing:h.bezier(0,0,.3,1)},Ko=h.extend({deceleration:2500,maxSpeed:1400},Qn),Yo=h.extend({deceleration:20,maxSpeed:1400},Qn),es=h.extend({deceleration:1e3,maxSpeed:360},Qn),Jo=h.extend({deceleration:1e3,maxSpeed:90},Qn);class ur{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:h.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=h.exported.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new h.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:p}of this._inertiaBuffer)n.zoom+=p.zoomDelta||0,n.bearing+=p.bearingDelta||0,n.pitch+=p.pitchDelta||0,p.panDelta&&n.pan._add(p.panDelta),p.around&&(n.around=p.around),p.pinchAround&&(n.pinchAround=p.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){const p=ts(n.pan.mag(),a,h.extend({},Ko,t||{}));c.offset=n.pan.mult(p.amount/n.pan.mag()),c.center=this._map.transform.center,Yi(c,p)}if(n.zoom){const p=ts(n.zoom,a,Yo);c.zoom=this._map.transform.zoom+p.amount,Yi(c,p)}if(n.bearing){const p=ts(n.bearing,a,es);c.bearing=this._map.transform.bearing+h.clamp(p.amount,-179,179),Yi(c,p)}if(n.pitch){const p=ts(n.pitch,a,Jo);c.pitch=this._map.transform.pitch+p.amount,Yi(c,p)}if(c.zoom||c.bearing){const p=n.pinchAround===void 0?n.around:n.pinchAround;c.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),h.extend(c,{noMoveStart:!0})}}function Yi(o,t){(!o.duration||o.durationn.unproject(_)),y=p.reduce((_,x,T,w)=>_.add(x.div(w.length)),new h.Point(0,0));super(t,{points:p,point:y,lngLats:m,lngLat:n.unproject(y),originalEvent:a}),this._defaultPrevented=!1}}class ic extends h.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,a){super(t,{originalEvent:a}),this._defaultPrevented=!1}}class rc{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new ic(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Ht(t.type,this._map,t))}mouseup(t){this._map.fire(new Ht(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ht(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Ht(t.type,this._map,t))}mouseover(t){this._map.fire(new Ht(t.type,this._map,t))}mouseout(t){this._map.fire(new Ht(t.type,this._map,t))}touchstart(t){return this._firePreventable(new qr(t.type,this._map,t))}touchmove(t){this._map.fire(new qr(t.type,this._map,t))}touchend(t){this._map.fire(new qr(t.type,this._map,t))}touchcancel(t){this._map.fire(new qr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nc{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Ht(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ht("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Ht(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Dn{constructor(t){this._map=t}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(t){return this.transform.pointLocation(h.Point.convert(t),this._map.terrain)}}class is{constructor(t,n){this._map=t,this._tr=new Dn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(Y.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const a=n;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)p.fitScreenCoordinates(a,c,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Y.remove(this._box),this._box=null),Y.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new h.Event(t,{originalEvent:n}))}}function dr(o,t){if(o.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${o.length}, points ${t.length}`);const n={};for(let a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),a.length===this.numTouches&&(this.centroid=function(c){const p=new h.Point(0,0);for(const m of c)p._add(m);return p.div(c.length)}(n),this.touches=dr(a,n)))}touchmove(t,n,a){if(this.aborted||!this.centroid)return;const c=dr(a,n);for(const p in this.touches){const m=c[p];(!m||m.dist(this.touches[p])>30)&&(this.aborted=!0)}}touchend(t,n,a){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class Rs{constructor(t){this.singleTap=new De(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,a){this.singleTap.touchstart(t,n,a)}touchmove(t,n,a){this.singleTap.touchmove(t,n,a)}touchend(t,n,a){const c=this.singleTap.touchend(t,n,a);if(c){const p=t.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(c)<30;if(p&&m||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class rs{constructor(t){this._tr=new Dn(t),this._zoomIn=new Rs({numTouches:1,numTaps:2}),this._zoomOut=new Rs({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,a){this._zoomIn.touchstart(t,n,a),this._zoomOut.touchstart(t,n,a)}touchmove(t,n,a){this._zoomIn.touchmove(t,n,a),this._zoomOut.touchmove(t,n,a)}touchend(t,n,a){const c=this._zoomIn.touchend(t,n,a),p=this._zoomOut.touchend(t,n,a),m=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(c)},{originalEvent:t})}):p?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(p)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ar{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const c=n.length?n[0]:n;return!this._moved&&c.dist(a){o.mousedown=o.dragStart,o.mousemoveWindow=o.dragMove,o.mouseup=o.dragEnd,o.contextmenu=function(t){t.preventDefault()}},el=({enable:o,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const a=new Ae({checkCorrectEvent:c=>Y.mouseButton(c)===0&&c.ctrlKey||Y.mouseButton(c)===2});return new Ar({clickTolerance:t,move:(c,p)=>({bearingDelta:(p.x-c.x)*n}),moveStateManager:a,enable:o,assignEvents:Va})},Os=({enable:o,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const a=new Ae({checkCorrectEvent:c=>Y.mouseButton(c)===0&&c.ctrlKey||Y.mouseButton(c)===2});return new Ar({clickTolerance:t,move:(c,p)=>({pitchDelta:(p.y-c.y)*n}),moveStateManager:a,enable:o,assignEvents:Va})};class tl{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new h.Point(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,n,a){return this._calculateTransform(t,n,a)}touchmove(t,n,a){if(this._map._cooperativeGestures&&(this._minTouches===2&&a.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,a.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(a.length0&&(this._active=!0);const c=dr(a,n),p=new h.Point(0,0),m=new h.Point(0,0);let y=0;for(const x in c){const T=c[x],w=this._touches[x];w&&(p._add(T),m._add(T.sub(w)),y++,c[x]=T)}if(this._touches=c,yMath.abs(o.x)}class Mi extends Us{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,a){super.touchstart(t,n,a),this._currentTouchCount=a.length}_start(t){this._lastPoints=t,ns(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,a){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const c=t[0].sub(this._lastPoints[0]),p=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,p,a.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+p.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,a){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,p=n.mag()>=2;if(!c&&!p)return;if(!c||!p)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const m=t.y>0==n.y>0;return ns(t)&&ns(n)&&m}}const jr={panStep:100,bearingStep:15,pitchStep:10};class rl{constructor(t){this._tr=new Dn(t);const n=jr;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,a=0,c=0,p=0,m=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?a=-1:(t.preventDefault(),p=-1);break;case 39:t.shiftKey?a=1:(t.preventDefault(),p=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),m=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(a=0,c=0),{cameraAnimation:y=>{const _=this._tr;y.easeTo({duration:300,easeId:"keyboardHandler",easing:qa,zoom:n?Math.round(_.zoom)+n*(t.shiftKey?2:1):_.zoom,bearing:_.bearing+a*this._bearingStep,pitch:_.pitch+c*this._pitchStep,offset:[-p*this._panStep,-m*this._panStep],center:_.center},{originalEvent:t})}}}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 qa(o){return o*(2-o)}const $s=4.000244140625;class ja{constructor(t,n){this._map=t,this._tr=new Dn(t),this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,h.bindAll(["_onTimeout"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const a=h.exported.now(),c=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,n!==0&&n%$s==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){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 n=Y.mousePos(this._el,t),a=this._tr;this._around=h.LngLat.convert(this._aroundCenter?a.center:a.unproject(n)),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const y=this._type==="wheel"&&Math.abs(this._delta)>$s?this._wheelZoomRate:this._defaultZoomRate;let _=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&_!==0&&(_=1/_);const x=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(x*_))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,a=this._startZoom,c=this._easing;let p,m=!1;if(this._type==="wheel"&&a&&c){const y=Math.min((h.exported.now()-this._lastWheelEventTime)/200,1),_=c(y);p=h.interpolate.number(a,n,_),y<1?this._frameId||(this._frameId=!0):m=!0}else p=n,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:p-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=h.ease;if(this._prevEase){const a=this._prevEase,c=(h.exported.now()-a.start)/a.duration,p=a.easing(c+.01)-a.easing(c),m=.27/Math.sqrt(p*p+1e-4)*.01,y=Math.sqrt(.0729-m*m);n=h.bezier(m,y,.25,1)}return this._prevEase={start:h.exported.now(),duration:t,easing:n},n}reset(){this._active=!1}}class nl{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 Ji{constructor(t){this._tr=new Dn(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class kt{constructor(){this._tap=new Rs({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(t,n,a){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?a.length>0&&(this._swipePoint=n[0],this._swipeTouch=a[0].identifier):this._tap.touchstart(t,n,a))}touchmove(t,n,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const c=n[0],p=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(t,n,a)}touchend(t,n,a){this._tapTime?this._swipePoint&&a.length===0&&this.reset():this._tap.touchend(t,n,a)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qs{constructor(t,n,a){this._el=t,this._mousePan=n,this._touchPan=a}enable(t){this._inertiaOptions=t||{},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 Za{constructor(t,n,a){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=a}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 sl{constructor(t,n,a,c){this._el=t,this._touchZoom=n,this._touchRotate=a,this._tapDragZoom=c,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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()}}const ss=o=>o.zoom||o.drag||o.pitch||o.rotate;class al extends h.Event{}function Ga(o){return o.panDelta&&o.panDelta.mag()||o.zoomDelta||o.bearingDelta||o.pitchDelta}class pr{constructor(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ur(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),h.bindAll(["handleEvent","handleWindowEvent"],this);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[c,p,m]of this._listeners)Y.addEventListener(c,p,c===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[t,n,a]of this._listeners)Y.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(t){const n=this._map,a=n.getCanvasContainer();this._add("mapEvent",new rc(n,t));const c=n.boxZoom=new is(n,t);this._add("boxZoom",c);const p=new rs(n),m=new Ji(n);n.doubleClickZoom=new nl(m,p),this._add("tapZoom",p),this._add("clickZoom",m);const y=new kt;this._add("tapDragZoom",y);const _=n.touchPitch=new Mi(n);this._add("touchPitch",_);const x=el(t),T=Os(t);n.dragRotate=new Za(t,x,T),this._add("mouseRotate",x,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const w=(({enable:H,clickTolerance:se})=>{const $=new Ae({checkCorrectEvent:re=>Y.mouseButton(re)===0&&!re.ctrlKey});return new Ar({clickTolerance:se,move:(re,oe)=>({around:oe,panDelta:oe.sub(re)}),activateOnStart:!0,moveStateManager:$,enable:H,assignEvents:Va})})(t),k=new tl(t,n);n.dragPan=new qs(a,w,k),this._add("mousePan",w),this._add("touchPan",k,["touchZoom","touchRotate"]);const O=new $a,B=new Na;n.touchZoomRotate=new sl(a,B,O,y),this._add("touchRotate",O,["touchPan","touchZoom"]),this._add("touchZoom",B,["touchPan","touchRotate"]);const R=n.scrollZoom=new ja(n,this);this._add("scrollZoom",R,["mousePan"]);const q=n.keyboard=new rl(n);this._add("keyboard",q),this._add("blockableMapEvent",new nc(n));for(const H of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[H]&&n[H].enable(t[H])}_add(t,n,a){this._handlers.push({handlerName:t,handler:n,allowed:a}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ss(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,a){for(const c in t)if(c!==a&&(!n||n.indexOf(c)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const n=[];for(const a of t)this._el.contains(a.target)&&n.push(a);return n}handleEvent(t,n){if(t.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const a=t.type==="renderFrame"?void 0:t,c={needsRenderFrame:!1},p={},m={},y=t.touches,_=y?this._getMapTouches(y):void 0,x=_?Y.touchPos(this._el,_):Y.mousePos(this._el,t);for(const{handlerName:k,handler:O,allowed:B}of this._handlers){if(!O.isEnabled())continue;let R;this._blockedByActive(m,B,k)?O.reset():O[n||t.type]&&(R=O[n||t.type](t,x,_),this.mergeHandlerResult(c,p,R,k,a),R&&R.needsRenderFrame&&this._triggerRenderFrame()),(R||O.isActive())&&(m[k]=O)}const T={};for(const k in this._previousActiveHandlers)m[k]||(T[k]=a);this._previousActiveHandlers=m,(Object.keys(T).length||Ga(c))&&(this._changes.push([c,p,T]),this._triggerRenderFrame()),(Object.keys(m).length||Ga(c))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:w}=c;w&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],w(this._map))}mergeHandlerResult(t,n,a,c,p){if(!a)return;h.extend(t,a);const m={handlerName:c,originalEvent:a.originalEvent||p};a.zoomDelta!==void 0&&(n.zoom=m),a.panDelta!==void 0&&(n.drag=m),a.pitchDelta!==void 0&&(n.pitch=m),a.bearingDelta!==void 0&&(n.rotate=m)}_applyChanges(){const t={},n={},a={};for(const[c,p,m]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new h.Point(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),h.extend(n,p),h.extend(a,m);this._updateMapTransform(t,n,a),this._changes=[]}_updateMapTransform(t,n,a){const c=this._map,p=c._getTransformForUpdate(),m=c.terrain;if(!(Ga(t)||m&&this._terrainMovement))return this._fireEvents(n,a,!0);let{panDelta:y,zoomDelta:_,bearingDelta:x,pitchDelta:T,around:w,pinchAround:k}=t;k!==void 0&&(w=k),c._stop(!0),w=w||c.transform.centerPoint;const O=p.pointLocation(y?w.sub(y):w);x&&(p.bearing+=x),T&&(p.pitch+=T),_&&(p.zoom+=_),m?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?p.center=p.pointLocation(p.centerPoint.sub(y)):p.setLocationAtPoint(O,w):(this._terrainMovement=!0,p.freezeElevation=!0,p.setLocationAtPoint(O,w),this._map.once("moveend",()=>{p.freezeElevation=!1,this._terrainMovement=!1,p.recalculateZoom(c.terrain)})):p.setLocationAtPoint(O,w),c._applyUpdatedTransform(p),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,a,!0)}_fireEvents(t,n,a){const c=ss(this._eventsInProgress),p=ss(t),m={};for(const T in t){const{originalEvent:w}=t[T];this._eventsInProgress[T]||(m[`${T}start`]=w),this._eventsInProgress[T]=t[T]}!c&&p&&this._fireEvent("movestart",p.originalEvent);for(const T in m)this._fireEvent(T,m[T]);p&&this._fireEvent("move",p.originalEvent);for(const T in t){const{originalEvent:w}=t[T];this._fireEvent(T,w)}const y={};let _;for(const T in this._eventsInProgress){const{handlerName:w,originalEvent:k}=this._eventsInProgress[T];this._handlersById[w].isActive()||(delete this._eventsInProgress[T],_=n[w]||k,y[`${T}end`]=_)}for(const T in y)this._fireEvent(T,y[T]);const x=ss(this._eventsInProgress);if(a&&(c||p)&&!x){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=k=>k!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new al("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const js={extend:(o,...t)=>h.extend(o,...t),run(o){o()},logToElement(o,t=!1,n="log"){const a=window.document.getElementById(n);a&&(t&&(a.innerHTML=""),a.innerHTML+=`
    ${o}`)}};class Fe extends h.Evented{constructor(t,n){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,h.bindAll(["_renderFrameCallback"],this),this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new h.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,a){return t=h.Point.convert(t).mult(-1),this.panTo(this.transform.center,h.extend({offset:t},n),a)}panTo(t,n,a){return this.easeTo(h.extend({center:t},n),a)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,a){return this.easeTo(h.extend({zoom:t},n),a)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,a){return this.easeTo(h.extend({bearing:t},n),a)}resetNorth(t,n){return this.rotateTo(0,h.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(h.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(a.zoom=h.interpolate.number(c,_,me)),this._rotating&&(a.bearing=h.interpolate.number(p,x,me)),this._pitching&&(a.pitch=h.interpolate.number(m,T,me)),this._padding&&(a.interpolatePadding(y,w,me),O=a.centerPoint.add(k)),this.terrain&&!t.freezeElevation&&this._updateElevation(me),$)a.setLocationAtPoint($,re);else{const _e=a.zoomScale(a.zoom-c),ve=_>c?Math.min(2,se):Math.max(.5,se),ge=Math.pow(ve,1-me),Ce=a.unproject(q.add(H.mult(me*ge)).mult(_e));a.setLocationAtPoint(a.renderWorldCopies?Ce.wrap():Ce,O)}this._applyUpdatedTransform(a),this._fireMoveEvents(n)},me=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,me)},t),this}_prepareEase(t,n,a={}){this._moving=!0,n||a.moving||this.fire(new h.Event("movestart",t)),this._zooming&&!a.zooming&&this.fire(new h.Event("zoomstart",t)),this._rotating&&!a.rotating&&this.fire(new h.Event("rotatestart",t)),this._pitching&&!a.pitching&&this.fire(new h.Event("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(t,this.terrain),this.transform.freezeElevation=!0}_updateElevation(t){const n=this.transform.getElevation(this._elevationCenter,this.terrain);if(t<1&&n!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(a-(n-(a*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=h.interpolate.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:a,zoom:c,pitch:p,bearing:m,elevation:y}=this.transformCameraUpdate(n);a&&(n.center=a),c!==void 0&&(n.zoom=c),p!==void 0&&(n.pitch=p),m!==void 0&&(n.bearing=m),y!==void 0&&(n.elevation=y),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new h.Event("move",t)),this._zooming&&this.fire(new h.Event("zoom",t)),this._rotating&&this.fire(new h.Event("rotate",t)),this._pitching&&this.fire(new h.Event("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const a=this._zooming,c=this._rotating,p=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new h.Event("zoomend",t)),c&&this.fire(new h.Event("rotateend",t)),p&&this.fire(new h.Event("pitchend",t)),this.fire(new h.Event("moveend",t))}flyTo(t,n){if(!t.essential&&h.exported.prefersReducedMotion){const ke=h.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ke,n)}this.stop(),t=h.extend({offset:[0,0],speed:1.2,curve:1.42,easing:h.ease},t);const a=this._getTransformForUpdate(),c=this.getZoom(),p=this.getBearing(),m=this.getPitch(),y=this.getPadding(),_="zoom"in t?h.clamp(+t.zoom,a.minZoom,a.maxZoom):c,x="bearing"in t?this._normalizeBearing(t.bearing,p):p,T="pitch"in t?+t.pitch:m,w="padding"in t?t.padding:a.padding,k=a.zoomScale(_-c),O=h.Point.convert(t.offset);let B=a.centerPoint.add(O);const R=a.pointLocation(B),q=h.LngLat.convert(t.center||R);this._normalizeCenter(q);const H=a.project(R),se=a.project(q).sub(H);let $=t.curve;const re=Math.max(a.width,a.height),oe=re/k,me=se.mag();if("minZoom"in t){const ke=h.clamp(Math.min(t.minZoom,c,_),a.minZoom,a.maxZoom),ut=re/a.zoomScale(ke-c);$=Math.sqrt(ut/me*2)}const _e=$*$;function ve(ke){const ut=(oe*oe-re*re+(ke?-1:1)*_e*_e*me*me)/(2*(ke?oe:re)*_e*me);return Math.log(Math.sqrt(ut*ut+1)-ut)}function ge(ke){return(Math.exp(ke)-Math.exp(-ke))/2}function Ce(ke){return(Math.exp(ke)+Math.exp(-ke))/2}const Ue=ve(0);let Ke=function(ke){return Ce(Ue)/Ce(Ue+$*ke)},Ee=function(ke){return re*((Ce(Ue)*(ge(ut=Ue+$*ke)/Ce(ut))-ge(Ue))/_e)/me;var ut},je=(ve(1)-Ue)/$;if(Math.abs(me)<1e-6||!isFinite(je)){if(Math.abs(re-oe)<1e-6)return this.easeTo(t,n);const ke=oet.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=p!==x,this._pitching=T!==m,this._padding=!a.isPaddingEqual(w),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(q),this._ease(ke=>{const ut=ke*je,qt=1/Ke(ut);a.zoom=ke===1?_:c+a.scaleZoom(qt),this._rotating&&(a.bearing=h.interpolate.number(p,x,ke)),this._pitching&&(a.pitch=h.interpolate.number(m,T,ke)),this._padding&&(a.interpolatePadding(y,w,ke),B=a.centerPoint.add(O)),this.terrain&&!t.freezeElevation&&this._updateElevation(ke);const dt=ke===1?q:a.unproject(H.add(se.mult(Ee(ut))).mult(qt));a.setLocationAtPoint(a.renderWorldCopies?dt.wrap():dt,B),this._applyUpdatedTransform(a),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const a=this._onEaseEnd;delete this._onEaseEnd,a.call(this,n)}if(!t){const a=this.handlers;a&&a.stop(!1)}return this}_ease(t,n,a){a.animate===!1||a.duration===0?(t(1),n()):(this._easeStart=h.exported.now(),this._easeOptions=a,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((h.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,n){t=h.wrap(t,-180,180);const a=Math.abs(t-n);return Math.abs(t-360-n)180?-360:a<-180?360:0}queryTerrainElevation(t){return this.terrain?this.transform.getElevation(h.LngLat.convert(t),this.terrain)-this.transform.elevation:null}}class qe{constructor(t={}){this.options=t,h.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=Y.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Y.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Y.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(){Y.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(t,n){const a=this._map._getUIString(`AttributionControl.${n}`);t.title=a,t.setAttribute("aria-label",a)}_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")))}_updateData(t){!t||t.sourceDataType!=="metadata"&&t.sourceDataType!=="visibility"&&t.dataType!=="style"&&t.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(c=>typeof c!="string"?"":c)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const n=this._map.style.sourceCaches;for(const c in n){const p=n[c];if(p.used||p.usedForTerrain){const m=p.getSource();m.attribution&&t.indexOf(m.attribution)<0&&t.push(m.attribution)}}t=t.filter(c=>String(c).trim()),t.sort((c,p)=>c.length-p.length),t=t.filter((c,p)=>{for(let m=p+1;m=0)return!1;return!0});const a=t.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}_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"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")}}class as{constructor(t={}){this.options=t,h.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=Y.create("div","maplibregl-ctrl");const n=Y.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Y.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const t=this._container.children;if(t.length){const n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}}}class Xa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,a=n?this._queue.concat(n):this._queue;for(const c of a)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const a of n)if(!a.cancelled&&(a.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Wa={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var Ci=h.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class ol extends h.Evented{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const a={};for(const c of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))a[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.posMatrix=new Float64Array(16),h.ortho(c.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),this._tiles[c.key]=new Yr(c,this.tileSize));for(const c in this._tiles)a[c]||delete this._tiles[c]}freeRtt(t){for(const n in this._tiles){const a=this._tiles[n];(!t||a.tileID.equals(t)||a.tileID.isChildOf(t)||t.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const a of this._renderableTilesKeys){const c=this._tiles[a].tileID;if(c.canonical.equals(t.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16),h.ortho(p.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),n[a]=p}else if(c.canonical.isChildOf(t.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16);const m=c.canonical.z-t.canonical.z,y=c.canonical.x-(c.canonical.x>>m<>m<>m;h.ortho(p.posMatrix,0,x,0,x,0,1),h.translate(p.posMatrix,p.posMatrix,[-y*x,-_*x,0]),n[a]=p}else if(t.canonical.isChildOf(c.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16);const m=t.canonical.z-c.canonical.z,y=t.canonical.x-(t.canonical.x>>m<>m<>m;h.ortho(p.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),h.translate(p.posMatrix,p.posMatrix,[y*x,_*x,0]),h.scale(p.posMatrix,p.posMatrix,[1/2**m,1/2**m,0]),n[a]=p}}return n}getSourceTile(t,n){const a=this.sourceCache._source;let c=t.overscaledZ-this.deltaZoom;if(c>a.maxzoom&&(c=a.maxzoom),c=a.minzoom&&(!p||!p.dem);)p=this.sourceCache.getTileByID(t.scaledTo(c--).key);return p}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class fr{constructor(t,n,a){this.painter=t,this.sourceCache=new ol(n),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,a,c=h.EXTENT){if(!(n>=0&&n=0&&at.canonical.z&&(t.canonical.z>=c?p=t.canonical.z-c:h.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=t.canonical.x-(t.canonical.x>>p<>p<>8<<4|p>>8,n[m+3]=0;const a=new h.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),c=new yt(t,a,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){const n=new Uint8Array(4),a=this.painter.context,c=a.gl;a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),a.bindFramebuffer.set(null);const p=n[0]+(n[2]>>4<<8),m=n[1]+((15&n[2])<<8),y=this.coordsIndex[255-n[3]],_=y&&this.sourceCache.getTileByID(y);if(!_)return null;const x=this._coordsTextureSize,T=(1<<_.tileID.canonical.z)*x;return new h.MercatorCoordinate((_.tileID.canonical.x*x+p)/T,(_.tileID.canonical.y*x+m)/T,this.getElevation(_.tileID,p,m,x))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,n=new h.Pos3dArray,a=new h.TriangleIndexArray,c=this.meshSize,p=h.EXTENT/c,m=c*c;for(let w=0;w<=c;w++)for(let k=0;k<=c;k++)n.emplaceBack(k*p,w*p,0);for(let w=0;wt.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const Pr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ft{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new sc(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(a=>!t._layers[a].isHidden(n)),this._coordsDescendingInv={};for(const a in t.sourceCaches){this._coordsDescendingInv[a]={};const c=t.sourceCaches[a].getVisibleCoordinates();for(const p of c){const m=this.terrain.sourceCache.getTerrainCoords(p);for(const y in m)this._coordsDescendingInv[a][y]||(this._coordsDescendingInv[a][y]=[]),this._coordsDescendingInv[a][y].push(m[y])}}this._coordsDescendingInvStr={};for(const a of t._order){const c=t._layers[a],p=c.source;if(Pr[c.type]&&!this._coordsDescendingInvStr[p]){this._coordsDescendingInvStr[p]={};for(const m in this._coordsDescendingInv[p])this._coordsDescendingInvStr[p][m]=this._coordsDescendingInv[p][m].map(y=>y.key).sort().join()}}for(const a of this._renderableTiles)for(const c in this._coordsDescendingInvStr){const p=this._coordsDescendingInvStr[c][a.tileID.key];p&&p!==a.rttCoords[c]&&(a.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,a=this.painter,c=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Pr[n]&&(this._prevType&&Pr[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!c))return!0;if(Pr[this._prevType]||Pr[n]&&c){this._prevType=n;const p=this._stacks.length-1,m=this._stacks[p]||[];for(const y of this._renderableTiles){if(this.pool.isFull()&&(Oa(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(y),y.rtt[p]){const x=this.pool.getObjectForId(y.rtt[p].id);if(x.stamp===y.rtt[p].stamp){this.pool.useObject(x);continue}}const _=this.pool.getOrCreateFreeObject();this.pool.useObject(_),this.pool.stampObject(_),y.rtt[p]={id:_.id,stamp:_.stamp},a.context.bindFramebuffer.set(_.fbo.framebuffer),a.context.clear({color:h.Color.transparent,stencil:0}),a.currentStencilSource=void 0;for(let x=0;x{o.touchstart=o.dragStart,o.touchmoveWindow=o.dragMove,o.touchend=o.dragEnd},Zs={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ha{constructor(t,n,a=!1){this._clickTolerance=10;const c=t.dragRotate._mouseRotate.getClickTolerance(),p=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=el({clickTolerance:c,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:y,bearingDegreesPerPixelMoved:_=.8})=>{const x=new Fs;return new Ar({clickTolerance:y,move:(T,w)=>({bearingDelta:(w.x-T.x)*_}),moveStateManager:x,enable:m,assignEvents:Ln})})({clickTolerance:c,enable:!0}),this.map=t,a&&(this.mousePitch=Os({clickTolerance:p,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:y,pitchDegreesPerPixelMoved:_=-.5})=>{const x=new Fs;return new Ar({clickTolerance:y,move:(T,w)=>({pitchDelta:(w.y-T.y)*_}),moveStateManager:x,enable:m,assignEvents:Ln})})({clickTolerance:p,enable:!0})),h.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Y.addEventListener(n,"mousedown",this.mousedown),Y.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),Y.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),Y.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),Y.disableDrag()}moveMouse(t,n){const a=this.map,{bearingDelta:c}=this.mouseRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.mousePitch){const{pitchDelta:p}=this.mousePitch.dragMove(t,n)||{};p&&a.setPitch(a.getPitch()+p)}}moveTouch(t,n){const a=this.map,{bearingDelta:c}=this.touchRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.touchPitch){const{pitchDelta:p}=this.touchPitch.dragMove(t,n)||{};p&&a.setPitch(a.getPitch()+p)}}off(){const t=this.element;Y.removeEventListener(t,"mousedown",this.mousedown),Y.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),Y.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Y.removeEventListener(window,"touchend",this.touchend),Y.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){Y.enableDrag(),Y.removeEventListener(window,"mousemove",this.mousemove),Y.removeEventListener(window,"mouseup",this.mouseup),Y.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Y.removeEventListener(window,"touchend",this.touchend)}mousedown(t){this.startMouse(h.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),Y.mousePos(this.element,t)),Y.addEventListener(window,"mousemove",this.mousemove),Y.addEventListener(window,"mouseup",this.mouseup)}mousemove(t){this.moveMouse(t,Y.mousePos(this.element,t))}mouseup(t){this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()}touchstart(t){t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Y.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),Y.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Y.addEventListener(window,"touchend",this.touchend))}touchmove(t){t.targetTouches.length!==1?this.reset():(this._lastPos=Y.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))}touchend(t){t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const a=n.locationPoint(o);if(a.x>=0&&a.y>=0&&a.x<=n.width&&a.y<=n.height)break;o.lng>n.center.lng?o.lng-=360:o.lng+=360}return o}const sn={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 Xs(o,t,n){const a=o.classList;for(const c in sn)a.remove(`maplibregl-${n}-anchor-${c}`);a.add(`maplibregl-${n}-anchor-${t}`)}class os extends h.Evented{constructor(t,n){if(super(),(t instanceof HTMLElement||n)&&(t=h.extend({element:t},n)),h.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=h.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=Y.create("div"),this._element.setAttribute("aria-label","Map marker");const a=Y.createNS("http://www.w3.org/2000/svg","svg"),c=41,p=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${c}px`),a.setAttributeNS(null,"width",`${p}px`),a.setAttributeNS(null,"viewBox",`0 0 ${p} ${c}`);const m=Y.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");const y=Y.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const _=Y.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const x=[{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 se of x){const $=Y.createNS("http://www.w3.org/2000/svg","ellipse");$.setAttributeNS(null,"opacity","0.04"),$.setAttributeNS(null,"cx","10.5"),$.setAttributeNS(null,"cy","5.80029008"),$.setAttributeNS(null,"rx",se.rx),$.setAttributeNS(null,"ry",se.ry),_.appendChild($)}const T=Y.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill",this._color);const w=Y.createNS("http://www.w3.org/2000/svg","path");w.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"),T.appendChild(w);const k=Y.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"opacity","0.25"),k.setAttributeNS(null,"fill","#000000");const O=Y.createNS("http://www.w3.org/2000/svg","path");O.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"),k.appendChild(O);const B=Y.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(6.0, 7.0)"),B.setAttributeNS(null,"fill","#FFFFFF");const R=Y.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(8.0, 8.0)");const q=Y.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#000000"),q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962");const H=Y.createNS("http://www.w3.org/2000/svg","circle");H.setAttributeNS(null,"fill","#FFFFFF"),H.setAttributeNS(null,"cx","5.5"),H.setAttributeNS(null,"cy","5.5"),H.setAttributeNS(null,"r","5.4999962"),R.appendChild(q),R.appendChild(H),y.appendChild(_),y.appendChild(T),y.appendChild(k),y.appendChild(B),y.appendChild(R),a.appendChild(y),a.setAttributeNS(null,"height",c*this._scale+"px"),a.setAttributeNS(null,"width",p*this._scale+"px"),this._element.appendChild(a),this._offset=h.Point.convert(t&&t.offset||[0,-14])}this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",a=>{a.preventDefault()}),this._element.addEventListener("mousedown",a=>{a.preventDefault()}),Xs(this._element,this._anchor,"marker"),this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",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("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),Y.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=h.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const c=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(t){const n=t.code,a=t.charCode||t.keyCode;n!=="Space"&&n!=="Enter"&&a!==32&&a!==13||this.togglePopup()}_onMapClick(t){const n=t.originalEvent.target,a=this._element;this._popup&&(n===a||a.contains(n))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_update(t){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Gs(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let n="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?n=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?a="rotateX(0deg)":this._pitchAlignment==="map"&&(a=`rotateX(${this._map.getPitch()}deg)`),t&&t.type!=="moveend"||(this._pos=this._pos.round()),Y.setTransform(this._element,`${sn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${n}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const c=this._map.unproject(this._pos),p=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=c.distanceTo(this._lngLat)>20*p?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(t){return this._offset=h.Point.convert(t),this._update(),this}_onMove(t){if(!this._isDragging){const n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=t.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 h.Event("dragstart"))),this.fire(new h.Event("drag")))}_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 h.Event("dragend")),this._state="inactive"}_addDragHandler(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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))}setDraggable(t){return this._draggable=!!t,this._map&&(t?(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(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Ka={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Bn=0,an=!1;const Ya={maxWidth:100,unit:"metric"};function Ws(o,t,n){const a=n&&n.maxWidth||100,c=o._container.clientHeight/2,p=o.unproject([0,c]),m=o.unproject([a,c]),y=p.distanceTo(m);if(n&&n.unit==="imperial"){const _=3.2808*y;_>5280?on(t,a,_/5280,o._getUIString("ScaleControl.Miles")):on(t,a,_,o._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?on(t,a,y/1852,o._getUIString("ScaleControl.NauticalMiles")):y>=1e3?on(t,a,y/1e3,o._getUIString("ScaleControl.Kilometers")):on(t,a,y,o._getUIString("ScaleControl.Meters"))}function on(o,t,n,a){const c=function(p){const m=Math.pow(10,`${Math.floor(p)}`.length-1);let y=p/m;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(_){const x=Math.pow(10,Math.ceil(-Math.log(_)/Math.LN10));return Math.round(_*x)/x}(y),m*y}(n);o.style.width=t*(c/n)+"px",o.innerHTML=`${c} ${a}`}const Hs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Ja=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ks(o){if(o){if(typeof o=="number"){const t=Math.round(Math.sqrt(.5*Math.pow(o,2)));return{center:new h.Point(0,0),top:new h.Point(0,o),"top-left":new h.Point(t,t),"top-right":new h.Point(-t,t),bottom:new h.Point(0,-o),"bottom-left":new h.Point(t,-t),"bottom-right":new h.Point(-t,-t),left:new h.Point(o,0),right:new h.Point(-o,0)}}if(o instanceof h.Point||Array.isArray(o)){const t=h.Point.convert(o);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:h.Point.convert(o.center||[0,0]),top:h.Point.convert(o.top||[0,0]),"top-left":h.Point.convert(o["top-left"]||[0,0]),"top-right":h.Point.convert(o["top-right"]||[0,0]),bottom:h.Point.convert(o.bottom||[0,0]),"bottom-left":h.Point.convert(o["bottom-left"]||[0,0]),"bottom-right":h.Point.convert(o["bottom-right"]||[0,0]),left:h.Point.convert(o.left||[0,0]),right:h.Point.convert(o.right||[0,0])}}return Ks(new h.Point(0,0))}const Ys=ce,Js={setRTLTextPlugin:h.setRTLTextPlugin,getRTLTextPluginStatus:h.getRTLTextPluginStatus,Map:class extends Fe{constructor(o){var t;if(h.PerformanceUtils.mark(h.PerformanceMarkers.create),(o=h.extend({},ll,o)).minZoom!=null&&o.maxZoom!=null&&o.minZoom>o.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(o.minPitch!=null&&o.maxPitch!=null&&o.minPitch>o.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(o.minPitch!=null&&o.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(o.maxPitch!=null&&o.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Bs(o.minZoom,o.maxZoom,o.minPitch,o.maxPitch,o.renderWorldCopies),{bearingSnap:o.bearingSnap}),this._interactive=o.interactive,this._cooperativeGestures=o.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=o.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=o.preserveDrawingBuffer,this._antialias=o.antialias,this._trackResize=o.trackResize,this._bearingSnap=o.bearingSnap,this._refreshExpiredTiles=o.refreshExpiredTiles,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=o.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=o.collectResourceTiming,this._renderTaskQueue=new Xa,this._controls=[],this._mapId=h.uniqueId(),this._locale=h.extend({},Wa,o.locale),this._clickTolerance=o.clickTolerance,this._pixelRatio=(t=o.pixelRatio)!==null&&t!==void 0?t:devicePixelRatio,this.transformCameraUpdate=o.transformCameraUpdate,this._imageQueueHandle=Bt.addThrottleControl(()=>this.isMoving()),this._requestManager=new pt(o.transformRequest),typeof o.container=="string"){if(this._container=document.getElementById(o.container),!this._container)throw new Error(`Container '${o.container}' not found.`)}else{if(!(o.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=o.container}if(o.maxBounds&&this.setMaxBounds(o.maxBounds),h.bindAll(["_onWindowOnline","_onMapScroll","_cooperativeGesturesOnWheel","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let n=!1;this._resizeObserver=new ResizeObserver(a=>{n?this._trackResize&&this.resize(a)._update():n=!0}),this._resizeObserver.observe(this._container)}this.handlers=new pr(this,o),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=o.hash&&new Ho(typeof o.hash=="string"&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,h.extend({},o.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=o.localIdeographFontFamily,this._validateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new qe({customAttribution:o.customAttribution})),o.maplibreLogo&&this.addControl(new as,o.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new h.Event(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new h.Event(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new h.Event("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(o,t){if(t===void 0&&(t=o.getDefaultPosition?o.getDefaultPosition():"top-right"),!o||!o.onAdd)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=o.onAdd(this);this._controls.push(o);const a=this._controlPositions[t];return t.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this}removeControl(o){if(!o||!o.onRemove)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(o);return t>-1&&this._controls.splice(t,1),o.onRemove(this),this}hasControl(o){return this._controls.indexOf(o)>-1}calculateCameraOptionsFromTo(o,t,n,a){return a==null&&this.terrain&&(a=this.transform.getElevation(n,this.terrain)),super.calculateCameraOptionsFromTo(o,t,n,a)}resize(o){var t;const n=this._containerDimensions(),a=n[0],c=n[1];this._resizeCanvas(a,c,this.getPixelRatio()),this.transform.resize(a,c),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,c),this.painter.resize(a,c,this.getPixelRatio());const p=!this._moving;return p&&(this.stop(),this.fire(new h.Event("movestart",o)).fire(new h.Event("move",o))),this.fire(new h.Event("resize",o)),p&&this.fire(new h.Event("moveend",o)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(o){const[t,n]=this._containerDimensions();this._pixelRatio=o,this._resizeCanvas(t,n,o),this.painter.resize(t,n,o)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(o){return this.transform.setMaxBounds(hi.convert(o)),this._update()}setMinZoom(o){if((o=o??-2)>=-2&&o<=this.transform.maxZoom)return this.transform.minZoom=o,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=o,this._update(),this.getZoom()>o&&this.setZoom(o),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(o){if((o=o??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(o>=0&&o<=this.transform.maxPitch)return this.transform.minPitch=o,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(o>=this.transform.minPitch)return this.transform.maxPitch=o,this._update(),this.getPitch()>o&&this.setPitch(o),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(o){return this.transform.renderWorldCopies=o,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(o){return this._cooperativeGestures=o,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(o){return this.transform.locationPoint(h.LngLat.convert(o),this.style&&this.terrain)}unproject(o){return this.transform.pointLocation(h.Point.convert(o),this.terrain)}isMoving(){var o;return this._moving||((o=this.handlers)===null||o===void 0?void 0:o.isMoving())}isZooming(){var o;return this._zooming||((o=this.handlers)===null||o===void 0?void 0:o.isZooming())}isRotating(){var o;return this._rotating||((o=this.handlers)===null||o===void 0?void 0:o.isRotating())}_createDelegatedListener(o,t,n){if(o==="mouseenter"||o==="mouseover"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:p=>{const m=this.getLayer(t)?this.queryRenderedFeatures(p.point,{layers:[t]}):[];m.length?a||(a=!0,n.call(this,new Ht(o,this,p.originalEvent,{features:m}))):a=!1},mouseout:()=>{a=!1}}}}if(o==="mouseleave"||o==="mouseout"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:m=>{(this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[]).length?a=!0:a&&(a=!1,n.call(this,new Ht(o,this,m.originalEvent)))},mouseout:m=>{a&&(a=!1,n.call(this,new Ht(o,this,m.originalEvent)))}}}}{const a=c=>{const p=this.getLayer(t)?this.queryRenderedFeatures(c.point,{layers:[t]}):[];p.length&&(c.features=p,n.call(this,c),delete c.features)};return{layer:t,listener:n,delegates:{[o]:a}}}}on(o,t,n){if(n===void 0)return super.on(o,t);const a=this._createDelegatedListener(o,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[o]=this._delegatedListeners[o]||[],this._delegatedListeners[o].push(a);for(const c in a.delegates)this.on(c,a.delegates[c]);return this}once(o,t,n){if(n===void 0)return super.once(o,t);const a=this._createDelegatedListener(o,t,n);for(const c in a.delegates)this.once(c,a.delegates[c]);return this}off(o,t,n){return n===void 0?super.off(o,t):(this._delegatedListeners&&this._delegatedListeners[o]&&(a=>{const c=this._delegatedListeners[o];for(let p=0;pthis._updateStyle(o,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!o)),o?(this.style=new pi(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof o=="string"?this.style.loadURL(o,t,n):this.style.loadJSON(o,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(o,t){if(typeof o=="string"){const n=this._requestManager.transformRequest(o,et.Style);h.getJSON(n,(a,c)=>{a?this.fire(new h.ErrorEvent(a)):c&&this._updateDiff(c,t)})}else typeof o=="object"&&this._updateDiff(o,t)}_updateDiff(o,t){try{this.style.setState(o,t)&&this._update(!0)}catch(n){h.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(o,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():h.warnOnce("There is no style added to the map.")}addSource(o,t){return this._lazyInitEmptyStyle(),this.style.addSource(o,t),this._update(!0)}isSourceLoaded(o){const t=this.style&&this.style.sourceCaches[o];if(t!==void 0)return t.loaded();this.fire(new h.ErrorEvent(new Error(`There is no source with ID '${o}'`)))}setTerrain(o){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),o){const t=this.style.sourceCaches[o.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${o.source}`);for(const n in this.style._layers){const a=this.style._layers[n];a.type==="hillshade"&&a.source===o.source&&h.warnOnce("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 fr(this.painter,t,o),this.painter.renderToTexture=new Ft(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId===o.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(n.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.updateElevation(this.terrain);return this.fire(new h.Event("terrain",{terrain:o})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){const o=this.style&&this.style.sourceCaches;for(const t in o){const n=o[t]._tiles;for(const a in n){const c=n[a];if(c.state!=="loaded"&&c.state!=="errored")return!1}}return!0}addSourceType(o,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(o,t,n)}removeSource(o){return this.style.removeSource(o),this._update(!0)}getSource(o){return this.style.getSource(o)}addImage(o,t,{pixelRatio:n=1,sdf:a=!1,stretchX:c,stretchY:p,content:m}={}){if(this._lazyInitEmptyStyle(),t instanceof HTMLImageElement||h.isImageBitmap(t)){const{width:y,height:_,data:x}=h.exported.getImageData(t);this.style.addImage(o,{data:new h.RGBAImage({width:y,height:_},x),pixelRatio:n,stretchX:c,stretchY:p,content:m,sdf:a,version:0})}else{if(t.width===void 0||t.height===void 0)return this.fire(new h.ErrorEvent(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:y,height:_,data:x}=t,T=t;this.style.addImage(o,{data:new h.RGBAImage({width:y,height:_},new Uint8Array(x)),pixelRatio:n,stretchX:c,stretchY:p,content:m,sdf:a,version:0,userImage:T}),T.onAdd&&T.onAdd(this,o)}}}updateImage(o,t){const n=this.style.getImage(o);if(!n)return this.fire(new h.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=t instanceof HTMLImageElement||h.isImageBitmap(t)?h.exported.getImageData(t):t,{width:c,height:p,data:m}=a;if(c===void 0||p===void 0)return this.fire(new h.ErrorEvent(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(c!==n.data.width||p!==n.data.height)return this.fire(new h.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const y=!(t instanceof HTMLImageElement||h.isImageBitmap(t));n.data.replace(m,y),this.style.updateImage(o,n)}getImage(o){return this.style.getImage(o)}hasImage(o){return o?!!this.style.getImage(o):(this.fire(new h.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(o){this.style.removeImage(o)}loadImage(o,t){Bt.getImage(this._requestManager.transformRequest(o,et.Image),t)}listImages(){return this.style.listImages()}addLayer(o,t){return this._lazyInitEmptyStyle(),this.style.addLayer(o,t),this._update(!0)}moveLayer(o,t){return this.style.moveLayer(o,t),this._update(!0)}removeLayer(o){return this.style.removeLayer(o),this._update(!0)}getLayer(o){return this.style.getLayer(o)}setLayerZoomRange(o,t,n){return this.style.setLayerZoomRange(o,t,n),this._update(!0)}setFilter(o,t,n={}){return this.style.setFilter(o,t,n),this._update(!0)}getFilter(o){return this.style.getFilter(o)}setPaintProperty(o,t,n,a={}){return this.style.setPaintProperty(o,t,n,a),this._update(!0)}getPaintProperty(o,t){return this.style.getPaintProperty(o,t)}setLayoutProperty(o,t,n,a={}){return this.style.setLayoutProperty(o,t,n,a),this._update(!0)}getLayoutProperty(o,t){return this.style.getLayoutProperty(o,t)}setGlyphs(o,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(o,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(o,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(o,t,n,a=>{a||this._update(!0)}),this}removeSprite(o){return this._lazyInitEmptyStyle(),this.style.removeSprite(o),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(o,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(o,t,n=>{n||this._update(!0)}),this}setLight(o,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(o,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(o,t){return this.style.setFeatureState(o,t),this._update()}removeFeatureState(o,t){return this.style.removeFeatureState(o,t),this._update()}getFeatureState(o){return this.style.getFeatureState(o)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let o=0,t=0;return this._container&&(o=this._container.clientWidth||400,t=this._container.clientHeight||300),[o,t]}_setupContainer(){const o=this._container;o.classList.add("maplibregl-map");const t=this._canvasContainer=Y.create("div","maplibregl-canvas-container",o);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=Y.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const n=this._containerDimensions();this._resizeCanvas(n[0],n[1],this.getPixelRatio());const a=this._controlContainer=Y.create("div","maplibregl-control-container",o),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(p=>{c[p]=Y.create("div",`maplibregl-ctrl-${p} `,a)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_cooperativeGesturesOnWheel(o){this._onCooperativeGesture(o,o[this._metaKey],1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=Y.create("div","maplibregl-cooperative-gesture-screen",this._container);let o=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(o=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=` +`}),staticAttributes:a,staticUniforms:m}}class qr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,a,c,p,m,y,_,x){this.context=t;let T=this.boundPaintVertexBuffers.length!==c.length;for(let w=0;!T&&w({u_depth:new h.Uniform1i(_e,ve.u_depth),u_terrain:new h.Uniform1i(_e,ve.u_terrain),u_terrain_dim:new h.Uniform1f(_e,ve.u_terrain_dim),u_terrain_matrix:new h.UniformMatrix4f(_e,ve.u_terrain_matrix),u_terrain_unpack:new h.Uniform4f(_e,ve.u_terrain_unpack),u_terrain_exaggeration:new h.Uniform1f(_e,ve.u_terrain_exaggeration)}))(t,me),this.binderUniforms=c?c.getUniforms(t,me):[]}draw(t,n,a,c,p,m,y,_,x,T,w,k,O,B,R,q,H,se){const $=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(a),t.setStencilMode(c),t.setColorMode(p),t.setCullFace(m),_){t.activeTexture.set($.TEXTURE2),$.bindTexture($.TEXTURE_2D,_.depthTexture),t.activeTexture.set($.TEXTURE3),$.bindTexture($.TEXTURE_2D,_.texture);for(const oe in this.terrainUniforms)this.terrainUniforms[oe].set(_[oe])}for(const oe in this.fixedUniforms)this.fixedUniforms[oe].set(y[oe]);R&&R.setUniforms(t,this.binderUniforms,O,{zoom:B});let re=0;switch(n){case $.LINES:re=2;break;case $.TRIANGLES:re=3;break;case $.LINE_STRIP:re=1}for(const oe of k.get()){const me=oe.vaos||(oe.vaos={});(me[x]||(me[x]=new qr)).bind(t,this,T,R?R.getPaintVertexBuffers():[],w,oe.vertexOffset,q,H,se),$.drawElements(n,oe.primitiveLength*re,$.UNSIGNED_SHORT,oe.primitiveOffset*re*2)}}}function Mo(o,t,n){const a=1/W(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),p=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,m=p*(n.tileID.canonical.x+n.tileID.wrap*c),y=p*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[a,o.fromScale,o.toScale],u_fade:o.t,u_pixel_coord_upper:[m>>16,y>>16],u_pixel_coord_lower:[65535&m,65535&y]}}const Co=(o,t,n,a)=>{const c=t.style.light,p=c.properties.get("position"),m=[p.x,p.y,p.z],y=function(){var x=new h.ARRAY_TYPE(9);return h.ARRAY_TYPE!=Float32Array&&(x[1]=0,x[2]=0,x[3]=0,x[5]=0,x[6]=0,x[7]=0),x[0]=1,x[4]=1,x[8]=1,x}();c.properties.get("anchor")==="viewport"&&function(x,T){var w=Math.sin(T),k=Math.cos(T);x[0]=k,x[1]=w,x[2]=0,x[3]=-w,x[4]=k,x[5]=0,x[6]=0,x[7]=0,x[8]=1}(y,-t.transform.angle),function(x,T,w){var k=T[0],O=T[1],B=T[2];x[0]=k*w[0]+O*w[3]+B*w[6],x[1]=k*w[1]+O*w[4]+B*w[7],x[2]=k*w[2]+O*w[5]+B*w[8]}(m,m,y);const _=c.properties.get("color");return{u_matrix:o,u_lightpos:m,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[_.r,_.g,_.b],u_vertical_gradient:+n,u_opacity:a}},ba=(o,t,n,a,c,p,m)=>h.extend(Co(o,t,n,a),Mo(p,t,m),{u_height_factor:-Math.pow(2,c.overscaledZ)/m.tileSize/8}),ko=o=>({u_matrix:o}),wa=(o,t,n,a)=>h.extend(ko(o),Mo(n,t,a)),Wl=(o,t)=>({u_matrix:o,u_world:t}),zo=(o,t,n,a,c)=>h.extend(wa(o,t,n,a),{u_world:c}),Hl=(o,t,n,a)=>{const c=o.transform;let p,m;if(a.paint.get("circle-pitch-alignment")==="map"){const y=W(n,1,c.zoom);p=!0,m=[y,y]}else p=!1,m=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:o.translatePosMatrix(t.posMatrix,n,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:o.pixelRatio,u_extrude_scale:m}},Ta=(o,t,n)=>{const a=W(n,1,t.zoom),c=Math.pow(2,t.zoom-n.tileID.overscaledZ),p=n.tileID.overscaleFactor();return{u_matrix:o,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:a,u_extrude_scale:[t.pixelsToGLUnits[0]/(a*c),t.pixelsToGLUnits[1]/(a*c)],u_overscale_factor:p}},Ea=(o,t,n=1)=>({u_matrix:o,u_color:t,u_overlay:0,u_overlay_scale:n}),Sa=o=>({u_matrix:o}),Do=(o,t,n,a)=>({u_matrix:o,u_extrude_scale:W(t,1,n),u_intensity:a});function Lo(o,t){const n=Math.pow(2,t.canonical.z),a=t.canonical.y;return[new h.MercatorCoordinate(0,a/n).toLngLat().lat,new h.MercatorCoordinate(0,(a+1)/n).toLngLat().lat]}const Ir=(o,t,n,a)=>{const c=o.transform;return{u_matrix:En(o,t,n,a),u_ratio:1/W(t,1,c.zoom),u_device_pixel_ratio:o.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},ws=(o,t,n,a,c)=>h.extend(Ir(o,t,n,c),{u_image:0,u_image_height:a}),Hi=(o,t,n,a,c)=>{const p=o.transform,m=Wn(t,p);return{u_matrix:En(o,t,n,c),u_texsize:t.imageAtlasTexture.size,u_ratio:1/W(t,1,p.zoom),u_device_pixel_ratio:o.pixelRatio,u_image:0,u_scale:[m,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Ts=(o,t,n,a,c,p)=>{const m=o.lineAtlas,y=Wn(t,o.transform),_=n.layout.get("line-cap")==="round",x=m.getDash(a.from,_),T=m.getDash(a.to,_),w=x.width*c.fromScale,k=T.width*c.toScale;return h.extend(Ir(o,t,n,p),{u_patternscale_a:[y/w,-x.height/2],u_patternscale_b:[y/k,-T.height/2],u_sdfgamma:m.width/(256*Math.min(w,k)*o.pixelRatio)/2,u_image:0,u_tex_y_a:x.y,u_tex_y_b:T.y,u_mix:c.t})};function Wn(o,t){return 1/W(o,1,t.tileZoom)}function En(o,t,n,a){return o.translatePosMatrix(a?a.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Es=(o,t,n,a,c)=>{return{u_matrix:o,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(m=c.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(p=c.paint.get("raster-contrast"),p>0?1/(1-p):1+p),u_spin_weights:Ss(c.paint.get("raster-hue-rotate"))};var p,m};function Ss(o){o*=Math.PI/180;const t=Math.sin(o),n=Math.cos(o);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const Sn=(o,t,n,a,c,p,m,y,_,x)=>{const T=c.transform;return{u_is_size_zoom_constant:+(o==="constant"||o==="source"),u_is_size_feature_constant:+(o==="constant"||o==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:T.cameraToCenterDistance,u_pitch:T.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:T.width/T.height,u_fade_change:c.options.fadeDuration?c.symbolFadeChange:1,u_matrix:p,u_label_plane_matrix:m,u_coord_matrix:y,u_is_text:+_,u_pitch_with_map:+a,u_texsize:x,u_texture:0}},In=(o,t,n,a,c,p,m,y,_,x,T)=>{const w=c.transform;return h.extend(Sn(o,t,n,a,c,p,m,y,_,x),{u_gamma_scale:a?Math.cos(w._pitch)*w.cameraToCenterDistance:1,u_device_pixel_ratio:c.pixelRatio,u_is_halo:+T})},Is=(o,t,n,a,c,p,m,y,_,x)=>h.extend(In(o,t,n,a,c,p,m,y,!0,_,!0),{u_texsize_icon:x,u_texture_icon:1}),Bi=(o,t,n)=>({u_matrix:o,u_opacity:t,u_color:n}),Ri=(o,t,n,a,c,p)=>h.extend(function(m,y,_,x){const T=_.imageManager.getPattern(m.from.toString()),w=_.imageManager.getPattern(m.to.toString()),{width:k,height:O}=_.imageManager.getPixelSize(),B=Math.pow(2,x.tileID.overscaledZ),R=x.tileSize*Math.pow(2,_.transform.tileZoom)/B,q=R*(x.tileID.canonical.x+x.tileID.wrap*B),H=R*x.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:w.tl,u_pattern_br_b:w.br,u_texsize:[k,O],u_mix:y.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:w.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/W(x,1,_.transform.tileZoom),u_pixel_coord_upper:[q>>16,H>>16],u_pixel_coord_lower:[65535&q,65535&H]}}(a,p,n,c),{u_matrix:o,u_opacity:t}),Ia={fillExtrusion:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_lightpos:new h.Uniform3f(o,t.u_lightpos),u_lightintensity:new h.Uniform1f(o,t.u_lightintensity),u_lightcolor:new h.Uniform3f(o,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(o,t.u_vertical_gradient),u_opacity:new h.Uniform1f(o,t.u_opacity)}),fillExtrusionPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_lightpos:new h.Uniform3f(o,t.u_lightpos),u_lightintensity:new h.Uniform1f(o,t.u_lightintensity),u_lightcolor:new h.Uniform3f(o,t.u_lightcolor),u_vertical_gradient:new h.Uniform1f(o,t.u_vertical_gradient),u_height_factor:new h.Uniform1f(o,t.u_height_factor),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade),u_opacity:new h.Uniform1f(o,t.u_opacity)}),fill:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),fillPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),fillOutline:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world)}),fillOutlinePattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world),u_image:new h.Uniform1i(o,t.u_image),u_texsize:new h.Uniform2f(o,t.u_texsize),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),circle:(o,t)=>({u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_scale_with_map:new h.Uniform1i(o,t.u_scale_with_map),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_extrude_scale:new h.Uniform2f(o,t.u_extrude_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),collisionBox:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pixels_to_tile_units:new h.Uniform1f(o,t.u_pixels_to_tile_units),u_extrude_scale:new h.Uniform2f(o,t.u_extrude_scale),u_overscale_factor:new h.Uniform1f(o,t.u_overscale_factor)}),collisionCircle:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_inv_matrix:new h.UniformMatrix4f(o,t.u_inv_matrix),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_viewport_size:new h.Uniform2f(o,t.u_viewport_size)}),debug:(o,t)=>({u_color:new h.UniformColor(o,t.u_color),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_overlay:new h.Uniform1i(o,t.u_overlay),u_overlay_scale:new h.Uniform1f(o,t.u_overlay_scale)}),clippingMask:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),heatmap:(o,t)=>({u_extrude_scale:new h.Uniform1f(o,t.u_extrude_scale),u_intensity:new h.Uniform1f(o,t.u_intensity),u_matrix:new h.UniformMatrix4f(o,t.u_matrix)}),heatmapTexture:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_world:new h.Uniform2f(o,t.u_world),u_image:new h.Uniform1i(o,t.u_image),u_color_ramp:new h.Uniform1i(o,t.u_color_ramp),u_opacity:new h.Uniform1f(o,t.u_opacity)}),hillshade:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_latrange:new h.Uniform2f(o,t.u_latrange),u_light:new h.Uniform2f(o,t.u_light),u_shadow:new h.UniformColor(o,t.u_shadow),u_highlight:new h.UniformColor(o,t.u_highlight),u_accent:new h.UniformColor(o,t.u_accent)}),hillshadePrepare:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_image:new h.Uniform1i(o,t.u_image),u_dimension:new h.Uniform2f(o,t.u_dimension),u_zoom:new h.Uniform1f(o,t.u_zoom),u_unpack:new h.Uniform4f(o,t.u_unpack)}),line:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels)}),lineGradient:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_image:new h.Uniform1i(o,t.u_image),u_image_height:new h.Uniform1f(o,t.u_image_height)}),linePattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texsize:new h.Uniform2f(o,t.u_texsize),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_image:new h.Uniform1i(o,t.u_image),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_scale:new h.Uniform3f(o,t.u_scale),u_fade:new h.Uniform1f(o,t.u_fade)}),lineSDF:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ratio:new h.Uniform1f(o,t.u_ratio),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_units_to_pixels:new h.Uniform2f(o,t.u_units_to_pixels),u_patternscale_a:new h.Uniform2f(o,t.u_patternscale_a),u_patternscale_b:new h.Uniform2f(o,t.u_patternscale_b),u_sdfgamma:new h.Uniform1f(o,t.u_sdfgamma),u_image:new h.Uniform1i(o,t.u_image),u_tex_y_a:new h.Uniform1f(o,t.u_tex_y_a),u_tex_y_b:new h.Uniform1f(o,t.u_tex_y_b),u_mix:new h.Uniform1f(o,t.u_mix)}),raster:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_tl_parent:new h.Uniform2f(o,t.u_tl_parent),u_scale_parent:new h.Uniform1f(o,t.u_scale_parent),u_buffer_scale:new h.Uniform1f(o,t.u_buffer_scale),u_fade_t:new h.Uniform1f(o,t.u_fade_t),u_opacity:new h.Uniform1f(o,t.u_opacity),u_image0:new h.Uniform1i(o,t.u_image0),u_image1:new h.Uniform1i(o,t.u_image1),u_brightness_low:new h.Uniform1f(o,t.u_brightness_low),u_brightness_high:new h.Uniform1f(o,t.u_brightness_high),u_saturation_factor:new h.Uniform1f(o,t.u_saturation_factor),u_contrast_factor:new h.Uniform1f(o,t.u_contrast_factor),u_spin_weights:new h.Uniform3f(o,t.u_spin_weights)}),symbolIcon:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texture:new h.Uniform1i(o,t.u_texture)}),symbolSDF:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texture:new h.Uniform1i(o,t.u_texture),u_gamma_scale:new h.Uniform1f(o,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(o,t.u_is_halo)}),symbolTextAndIcon:(o,t)=>({u_is_size_zoom_constant:new h.Uniform1i(o,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.Uniform1i(o,t.u_is_size_feature_constant),u_size_t:new h.Uniform1f(o,t.u_size_t),u_size:new h.Uniform1f(o,t.u_size),u_camera_to_center_distance:new h.Uniform1f(o,t.u_camera_to_center_distance),u_pitch:new h.Uniform1f(o,t.u_pitch),u_rotate_symbol:new h.Uniform1i(o,t.u_rotate_symbol),u_aspect_ratio:new h.Uniform1f(o,t.u_aspect_ratio),u_fade_change:new h.Uniform1f(o,t.u_fade_change),u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_label_plane_matrix:new h.UniformMatrix4f(o,t.u_label_plane_matrix),u_coord_matrix:new h.UniformMatrix4f(o,t.u_coord_matrix),u_is_text:new h.Uniform1i(o,t.u_is_text),u_pitch_with_map:new h.Uniform1i(o,t.u_pitch_with_map),u_texsize:new h.Uniform2f(o,t.u_texsize),u_texsize_icon:new h.Uniform2f(o,t.u_texsize_icon),u_texture:new h.Uniform1i(o,t.u_texture),u_texture_icon:new h.Uniform1i(o,t.u_texture_icon),u_gamma_scale:new h.Uniform1f(o,t.u_gamma_scale),u_device_pixel_ratio:new h.Uniform1f(o,t.u_device_pixel_ratio),u_is_halo:new h.Uniform1i(o,t.u_is_halo)}),background:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_opacity:new h.Uniform1f(o,t.u_opacity),u_color:new h.UniformColor(o,t.u_color)}),backgroundPattern:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_opacity:new h.Uniform1f(o,t.u_opacity),u_image:new h.Uniform1i(o,t.u_image),u_pattern_tl_a:new h.Uniform2f(o,t.u_pattern_tl_a),u_pattern_br_a:new h.Uniform2f(o,t.u_pattern_br_a),u_pattern_tl_b:new h.Uniform2f(o,t.u_pattern_tl_b),u_pattern_br_b:new h.Uniform2f(o,t.u_pattern_br_b),u_texsize:new h.Uniform2f(o,t.u_texsize),u_mix:new h.Uniform1f(o,t.u_mix),u_pattern_size_a:new h.Uniform2f(o,t.u_pattern_size_a),u_pattern_size_b:new h.Uniform2f(o,t.u_pattern_size_b),u_scale_a:new h.Uniform1f(o,t.u_scale_a),u_scale_b:new h.Uniform1f(o,t.u_scale_b),u_pixel_coord_upper:new h.Uniform2f(o,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.Uniform2f(o,t.u_pixel_coord_lower),u_tile_units_to_pixels:new h.Uniform1f(o,t.u_tile_units_to_pixels)}),terrain:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texture:new h.Uniform1i(o,t.u_texture),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)}),terrainDepth:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)}),terrainCoords:(o,t)=>({u_matrix:new h.UniformMatrix4f(o,t.u_matrix),u_texture:new h.Uniform1i(o,t.u_texture),u_terrain_coords_id:new h.Uniform1f(o,t.u_terrain_coords_id),u_ele_delta:new h.Uniform1f(o,t.u_ele_delta)})};class As{constructor(t,n,a){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ps={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Aa{constructor(t,n,a,c){this.length=n.length,this.attributes=a,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;const p=t.gl;this.buffer=p.createBuffer(),t.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let a=0;a0){const Ce=h.create(),Ue=_e;h.mul(Ce,me.placementInvProjMatrix,o.transform.glCoordMatrix),h.mul(Ce,Ce,me.placementViewportMatrix),T.push({circleArray:ge,circleOffset:k,transform:Ue,invTransform:Ce,coord:re}),w+=ge.length/4,k=w}ve&&x.draw(y,_.LINES,st.disabled,It.disabled,o.colorModeForRenderPass(),Et.disabled,Ta(_e,o.transform,oe),o.style.map.terrain&&o.style.map.terrain.getTerrainData(re),n.id,ve.layoutVertexBuffer,ve.indexBuffer,ve.segments,null,o.transform.zoom,null,null,ve.collisionVertexBuffer)}if(!m||!T.length)return;const O=o.useProgram("collisionCircle"),B=new h.CollisionCircleLayoutArray;B.resize(4*w),B._trim();let R=0;for(const $ of T)for(let re=0;re<$.circleArray.length/4;re++){const oe=4*re,me=$.circleArray[oe+0],_e=$.circleArray[oe+1],ve=$.circleArray[oe+2],ge=$.circleArray[oe+3];B.emplace(R++,me,_e,ve,ge,0),B.emplace(R++,me,_e,ve,ge,1),B.emplace(R++,me,_e,ve,ge,2),B.emplace(R++,me,_e,ve,ge,3)}(!kn||kn.length<2*w)&&(kn=function($){const re=2*$,oe=new h.QuadTriangleArray;oe.resize(re),oe._trim();for(let me=0;me=0&&(B[q.associatedIconIndex]={shiftedAnchor:Ke,angle:Ee})}else L(q.numGlyphs,k)}if(x){O.clear();const R=o.icon.placedSymbolArray;for(let q=0;qo.style.map.terrain.getElevation(ve,ia,Mr):null,Oi=n.layout.get("text-rotation-alignment")==="map";Er(Ce,ve.posMatrix,o,c,rr,Ti,q,x,Oi,ti)}const mi=o.translatePosMatrix(ve.posMatrix,ge,p,m),ai=H||c&&me||cs?Fa:rr,ft=o.translatePosMatrix(Ti,ge,p,m,!0),ei=Ee&&n.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let oi;oi=Ee?Ce.iconsInText?Is(je.kind,qt,se,q,o,mi,ai,ft,Je,si):In(je.kind,qt,se,q,o,mi,ai,ft,c,Je,!0):Sn(je.kind,qt,se,q,o,mi,ai,ft,c,Je);const gt={program:ut,buffers:Ue,uniformValues:oi,atlasTexture:Ot,atlasTextureIcon:Fi,atlasInterpolation:wi,atlasInterpolationIcon:jt,isSDF:Ee,hasHalo:ei};if($&&Ce.canOverlap){re=!0;const ti=Ue.segments.get();for(const Oi of ti)_e.push({segments:new h.SegmentVector([Oi]),sortKey:Oi.sortKey,state:gt,terrainData:dt})}else _e.push({segments:Ue.segments,sortKey:0,state:gt,terrainData:dt})}re&&_e.sort((ve,ge)=>ve.sortKey-ge.sortKey);for(const ve of _e){const ge=ve.state;if(k.activeTexture.set(O.TEXTURE0),ge.atlasTexture.bind(ge.atlasInterpolation,O.CLAMP_TO_EDGE),ge.atlasTextureIcon&&(k.activeTexture.set(O.TEXTURE1),ge.atlasTextureIcon&&ge.atlasTextureIcon.bind(ge.atlasInterpolationIcon,O.CLAMP_TO_EDGE)),ge.isSDF){const Ce=ge.uniformValues;ge.hasHalo&&(Ce.u_is_halo=1,Oa(ge.buffers,ve.segments,n,o,ge.program,oe,T,w,Ce,ve.terrainData)),Ce.u_is_halo=0}Oa(ge.buffers,ve.segments,n,o,ge.program,oe,T,w,ge.uniformValues,ve.terrainData)}}function Oa(o,t,n,a,c,p,m,y,_,x){const T=a.context;c.draw(T,T.gl.TRIANGLES,p,m,y,Et.disabled,_,x,n.id,o.layoutVertexBuffer,o.indexBuffer,t,n.paint,a.transform.zoom,o.programConfigurations.get(n.id),o.dynamicLayoutVertexBuffer,o.opacityVertexBuffer)}function Ua(o,t,n,a,c){if(!n||!a||!a.imageAtlas)return;const p=a.imageAtlas.patternPositions;let m=p[n.to.toString()],y=p[n.from.toString()];if(!m||!y){const _=c.getPaintProperty(t);m=p[_],y=p[_]}m&&y&&o.setConstantPatternPositions(m,y)}function Yn(o,t,n,a,c,p,m){const y=o.context.gl,_="fill-pattern",x=n.paint.get(_),T=x&&x.constantOr(1),w=n.getCrossfadeParameters();let k,O,B,R,q;m?(O=T&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",k=y.LINES):(O=T?"fillPattern":"fill",k=y.TRIANGLES);const H=x.constantOr(null);for(const se of a){const $=t.getTile(se);if(T&&!$.patternsLoaded())continue;const re=$.getBucket(n);if(!re)continue;const oe=re.programConfigurations.get(n.id),me=o.useProgram(O,oe),_e=o.style.map.terrain&&o.style.map.terrain.getTerrainData(se);T&&(o.context.activeTexture.set(y.TEXTURE0),$.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),oe.updatePaintBuffers(w)),Ua(oe,_,H,$,n);const ve=_e?se:null,ge=o.translatePosMatrix(ve?ve.posMatrix:se.posMatrix,$,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(m){R=re.indexBuffer2,q=re.segments2;const Ce=[y.drawingBufferWidth,y.drawingBufferHeight];B=O==="fillOutlinePattern"&&T?zo(ge,o,w,$,Ce):Wl(ge,Ce)}else R=re.indexBuffer,q=re.segments,B=T?wa(ge,o,w,$):ko(ge);me.draw(o.context,k,c,o.stencilModeForClipping(se),p,Et.disabled,B,_e,n.id,re.layoutVertexBuffer,R,q,n.paint,o.transform.zoom,oe)}}function Jn(o,t,n,a,c,p,m){const y=o.context,_=y.gl,x="fill-extrusion-pattern",T=n.paint.get(x),w=T.constantOr(1),k=n.getCrossfadeParameters(),O=n.paint.get("fill-extrusion-opacity"),B=T.constantOr(null);for(const R of a){const q=t.getTile(R),H=q.getBucket(n);if(!H)continue;const se=o.style.map.terrain&&o.style.map.terrain.getTerrainData(R),$=H.programConfigurations.get(n.id),re=o.useProgram(w?"fillExtrusionPattern":"fillExtrusion",$);w&&(o.context.activeTexture.set(_.TEXTURE0),q.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),$.updatePaintBuffers(k)),Ua($,x,B,q,n);const oe=o.translatePosMatrix(R.posMatrix,q,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),me=n.paint.get("fill-extrusion-vertical-gradient"),_e=w?ba(oe,o,me,O,R,k,q):Co(oe,o,me,O);re.draw(y,y.gl.TRIANGLES,c,p,m,Et.backCCW,_e,se,n.id,H.layoutVertexBuffer,H.indexBuffer,H.segments,n.paint,o.transform.zoom,$,o.style.map.terrain&&H.centroidVertexBuffer)}}function ac(o,t,n,a,c,p,m){const y=o.context,_=y.gl,x=n.fbo;if(!x)return;const T=o.useProgram("hillshade"),w=o.style.map.terrain&&o.style.map.terrain.getTerrainData(t);y.activeTexture.set(_.TEXTURE0),_.bindTexture(_.TEXTURE_2D,x.colorAttachment.get()),T.draw(y,_.TRIANGLES,c,p,m,Et.disabled,((k,O,B,R)=>{const q=B.paint.get("hillshade-shadow-color"),H=B.paint.get("hillshade-highlight-color"),se=B.paint.get("hillshade-accent-color");let $=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&($-=k.transform.angle);const re=!k.options.moving;return{u_matrix:R?R.posMatrix:k.transform.calculatePosMatrix(O.tileID.toUnwrapped(),re),u_image:0,u_latrange:Lo(0,O.tileID),u_light:[B.paint.get("hillshade-exaggeration"),$],u_shadow:q,u_highlight:H,u_accent:se}})(o,n,a,w?t:null),w,a.id,o.rasterBoundsBuffer,o.quadTriangleIndexBuffer,o.rasterBoundsSegments)}function Zo(o,t,n,a,c,p){const m=o.context,y=m.gl,_=t.dem;if(_&&_.data){const x=_.dim,T=_.stride,w=_.getPixels();if(m.activeTexture.set(y.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||o.getTileTexture(T),t.demTexture){const O=t.demTexture;O.update(w,{premultiply:!1}),O.bind(y.NEAREST,y.CLAMP_TO_EDGE)}else t.demTexture=new yt(m,w,y.RGBA,{premultiply:!1}),t.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);m.activeTexture.set(y.TEXTURE0);let k=t.fbo;if(!k){const O=new yt(m,{width:x,height:x,data:null},y.RGBA);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),k=t.fbo=m.createFramebuffer(x,x,!0,!1),k.colorAttachment.set(O.texture)}m.bindFramebuffer.set(k.framebuffer),m.viewport.set([0,0,x,x]),o.useProgram("hillshadePrepare").draw(m,y.TRIANGLES,a,c,p,Et.disabled,((O,B)=>{const R=B.stride,q=h.create();return h.ortho(q,0,h.EXTENT,-h.EXTENT,0,0,1),h.translate(q,q,[0,-h.EXTENT,0]),{u_matrix:q,u_image:1,u_dimension:[R,R],u_zoom:O.overscaledZ,u_unpack:B.getUnpackVector()}})(t.tileID,_),null,n.id,o.rasterBoundsBuffer,o.quadTriangleIndexBuffer,o.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function $t(o,t,n,a,c,p){const m=a.paint.get("raster-fade-duration");if(!p&&m>0){const y=h.exported.now(),_=(y-o.timeAdded)/m,x=t?(y-t.timeAdded)/m:-1,T=n.getSource(),w=c.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),k=!t||Math.abs(t.tileID.overscaledZ-w)>Math.abs(o.tileID.overscaledZ-w),O=k&&o.refreshedUponExpiration?1:h.clamp(k?_:1-x,0,1);return o.refreshedUponExpiration&&_>=1&&(o.refreshedUponExpiration=!1),t?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}const nn=new h.Color(1,0,0,1),Ki=new h.Color(0,1,0,1),Go=new h.Color(0,0,1,1),Va=new h.Color(1,0,1,1),Xo=new h.Color(0,1,1,1);function sn(o,t,n,a){zn(o,0,t+n/2,o.transform.width,n,a)}function Qn(o,t,n,a){zn(o,t-n/2,0,n,o.transform.height,a)}function zn(o,t,n,a,c,p){const m=o.context,y=m.gl;y.enable(y.SCISSOR_TEST),y.scissor(t*o.pixelRatio,n*o.pixelRatio,a*o.pixelRatio,c*o.pixelRatio),m.clear({color:p}),y.disable(y.SCISSOR_TEST)}function Wo(o,t,n){const a=o.context,c=a.gl,p=n.posMatrix,m=o.useProgram("debug"),y=st.disabled,_=It.disabled,x=o.colorModeForRenderPass(),T="$debug",w=o.style.map.terrain&&o.style.map.terrain.getTerrainData(n);a.activeTexture.set(c.TEXTURE0);const k=t.getTileByID(n.key).latestRawTileData,O=Math.floor((k&&k.byteLength||0)/1024),B=t.getTile(n).tileSize,R=512/Math.min(B,512)*(n.overscaledZ/o.transform.zoom)*.5;let q=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(q+=` => ${n.overscaledZ}`),function(H,se){H.initDebugOverlayCanvas();const $=H.debugOverlayCanvas,re=H.context.gl,oe=H.debugOverlayCanvas.getContext("2d");oe.clearRect(0,0,$.width,$.height),oe.shadowColor="white",oe.shadowBlur=2,oe.lineWidth=1.5,oe.strokeStyle="white",oe.textBaseline="top",oe.font="bold 36px Open Sans, sans-serif",oe.fillText(se,5,5),oe.strokeText(se,5,5),H.debugOverlayTexture.update($),H.debugOverlayTexture.bind(re.LINEAR,re.CLAMP_TO_EDGE)}(o,`${q} ${O}kB`),m.draw(a,c.TRIANGLES,y,_,Dt.alphaBlended,Et.disabled,Ea(p,h.Color.transparent,R),null,T,o.debugBuffer,o.quadTriangleIndexBuffer,o.debugSegments),m.draw(a,c.LINE_STRIP,y,_,x,Et.disabled,Ea(p,h.Color.red),w,T,o.debugBuffer,o.tileBorderIndexBuffer,o.debugSegments)}function Na(o,t,n){const a=o.context,c=a.gl,p=o.colorModeForRenderPass(),m=new st(c.LEQUAL,st.ReadWrite,o.depthRangeFor3D),y=o.useProgram("terrain"),_=t.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,o.width,o.height]);for(const x of n){const T=o.renderToTexture.getTexture(x),w=t.getTerrainData(x.tileID);a.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,T.texture);const k={u_matrix:o.transform.calculatePosMatrix(x.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(o.transform.zoom)};y.draw(a,c.TRIANGLES,m,It.disabled,p,Et.backCCW,k,w,"terrain",_.vertexBuffer,_.indexBuffer,_.segments)}}const $a={symbol:function(o,t,n,a,c){if(o.renderPass!=="translucent")return;const p=It.disabled,m=o.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(y,_,x,T,w,k,O){const B=_.transform,R=w==="map",q=k==="map";for(const H of y){const se=T.getTile(H),$=se.getBucket(x);if(!$||!$.text||!$.text.segments.get().length)continue;const re=h.evaluateSizeForZoom($.textSizeData,B.zoom),oe=W(se,1,_.transform.zoom),me=Ye(H.posMatrix,q,R,_.transform,oe),_e=x.layout.get("icon-text-fit")!=="none"&&$.hasIconData();if(re){const ve=Math.pow(2,B.zoom-se.tileID.overscaledZ);jo($,R,q,O,B,me,H.posMatrix,ve,re,_e,_.style.map.terrain?(ge,Ce)=>_.style.map.terrain.getElevation(H,ge,Ce):null)}}}(a,o,n,t,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),c),n.paint.get("icon-opacity").constantOr(1)!==0&&Bs(o,t,n,a,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),p,m),n.paint.get("text-opacity").constantOr(1)!==0&&Bs(o,t,n,a,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),p,m),t.map.showCollisionBoxes&&(qo(o,t,n,a,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),qo(o,t,n,a,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(o,t,n,a){if(o.renderPass!=="translucent")return;const c=n.paint.get("circle-opacity"),p=n.paint.get("circle-stroke-width"),m=n.paint.get("circle-stroke-opacity"),y=!n.layout.get("circle-sort-key").isConstant();if(c.constantOr(1)===0&&(p.constantOr(1)===0||m.constantOr(1)===0))return;const _=o.context,x=_.gl,T=o.depthModeForSublayer(0,st.ReadOnly),w=It.disabled,k=o.colorModeForRenderPass(),O=[];for(let B=0;BB.sortKey-R.sortKey);for(const B of O){const{programConfiguration:R,program:q,layoutVertexBuffer:H,indexBuffer:se,uniformValues:$,terrainData:re}=B.state;q.draw(_,x.TRIANGLES,T,w,k,Et.disabled,$,re,n.id,H,se,B.segments,n.paint,o.transform.zoom,R)}},heatmap:function(o,t,n,a){if(n.paint.get("heatmap-opacity")!==0)if(o.renderPass==="offscreen"){const c=o.context,p=c.gl,m=It.disabled,y=new Dt([p.ONE,p.ONE],h.Color.transparent,[!0,!0,!0,!0]);(function(_,x,T){const w=_.gl;_.activeTexture.set(w.TEXTURE1),_.viewport.set([0,0,x.width/4,x.height/4]);let k=T.heatmapFbo;if(k)w.bindTexture(w.TEXTURE_2D,k.colorAttachment.get()),_.bindFramebuffer.set(k.framebuffer);else{const O=w.createTexture();w.bindTexture(w.TEXTURE_2D,O),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,w.LINEAR),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,w.LINEAR),k=T.heatmapFbo=_.createFramebuffer(x.width/4,x.height/4,!1,!1),function(B,R,q,H){var se,$;const re=B.gl,oe=(se=B.HALF_FLOAT)!==null&&se!==void 0?se:re.UNSIGNED_BYTE,me=($=B.RGBA16F)!==null&&$!==void 0?$:re.RGBA;re.texImage2D(re.TEXTURE_2D,0,me,R.width/4,R.height/4,0,re.RGBA,oe,null),H.colorAttachment.set(q)}(_,x,O,k)}})(c,o,n),c.clear({color:h.Color.transparent});for(let _=0;_{const B=h.create();h.ortho(B,0,T.width,T.height,0,0,1);const R=T.context.gl;return{u_matrix:B,u_world:[R.drawingBufferWidth,R.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:w.paint.get("heatmap-opacity")}})(c,p),null,p.id,c.viewportBuffer,c.quadTriangleIndexBuffer,c.viewportSegments,p.paint,c.transform.zoom)}(o,n))},line:function(o,t,n,a){if(o.renderPass!=="translucent")return;const c=n.paint.get("line-opacity"),p=n.paint.get("line-width");if(c.constantOr(1)===0||p.constantOr(1)===0)return;const m=o.depthModeForSublayer(0,st.ReadOnly),y=o.colorModeForRenderPass(),_=n.paint.get("line-dasharray"),x=n.paint.get("line-pattern"),T=x.constantOr(1),w=n.paint.get("line-gradient"),k=n.getCrossfadeParameters(),O=T?"linePattern":_?"lineSDF":w?"lineGradient":"line",B=o.context,R=B.gl;let q=!0;for(const H of a){const se=t.getTile(H);if(T&&!se.patternsLoaded())continue;const $=se.getBucket(n);if(!$)continue;const re=$.programConfigurations.get(n.id),oe=o.context.program.get(),me=o.useProgram(O,re),_e=q||me.program!==oe,ve=o.style.map.terrain&&o.style.map.terrain.getTerrainData(H),ge=x.constantOr(null);if(ge&&se.imageAtlas){const Ke=se.imageAtlas,Ee=Ke.patternPositions[ge.to.toString()],je=Ke.patternPositions[ge.from.toString()];Ee&&je&&re.setConstantPatternPositions(Ee,je)}const Ce=ve?H:null,Ue=T?Hi(o,se,n,k,Ce):_?Ts(o,se,n,_,k,Ce):w?ws(o,se,n,$.lineClipsArray.length,Ce):Ir(o,se,n,Ce);if(T)B.activeTexture.set(R.TEXTURE0),se.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),re.updatePaintBuffers(k);else if(_&&(_e||o.lineAtlas.dirty))B.activeTexture.set(R.TEXTURE0),o.lineAtlas.bind(B);else if(w){const Ke=$.gradients[n.id];let Ee=Ke.texture;if(n.gradientVersion!==Ke.version){let je=256;if(n.stepInterpolant){const ke=t.getSource().maxzoom,ut=H.canonical.z===ke?Math.ceil(1<256&&this.clearStencil(),a.setColorMode(Dt.disabled),a.setDepthMode(st.disabled);const p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of n){const y=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,_=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);p.draw(a,c.TRIANGLES,st.disabled,new It({func:c.ALWAYS,mask:0},y,255,c.KEEP,c.KEEP,c.REPLACE),Dt.disabled,Et.disabled,Sa(m.posMatrix),_,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new It({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new It({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,a=t.sort((m,y)=>y.overscaledZ-m.overscaledZ),c=a[a.length-1].overscaledZ,p=a[0].overscaledZ-c+1;if(p>1){this.currentStencilSource=void 0,this.nextStencilID+p>256&&this.clearStencil();const m={};for(let y=0;y=0;this.currentLayer--){const _=this.style._layers[a[this.currentLayer]],x=c[_.source],T=p[_.source];this._renderTileClippingMasks(_,T),this.renderLayer(this,x,_,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerq.source&&!q.isHidden(T)?[x.sourceCaches[q.source]]:[]),O=k.filter(q=>q.getSource().type==="vector"),B=k.filter(q=>q.getSource().type!=="vector"),R=q=>{(!w||w.getSource().maxzoomR(q)),w||B.forEach(q=>R(q)),w}(this.style,this.transform.zoom);_&&$a.debug(this,_,_.getVisibleCoordinates())}this.options.showPadding&&function(_){const x=_.transform.padding;sn(_,_.transform.height-(x.top||0),3,nn),sn(_,x.bottom||0,3,Ki),Qn(_,x.left||0,3,Go),Qn(_,_.transform.width-(x.right||0),3,Va);const T=_.transform.centerPoint;(function(w,k,O,B){zn(w,k-1,O-10,2,20,B),zn(w,k-10,O-1,20,2,B)})(_,T.x,_.transform.height-T.y,Xo)}(this),this.context.setDefault()}renderLayer(t,n,a,c){a.isHidden(this.transform.zoom)||(a.type==="background"||a.type==="custom"||(c||[]).length)&&(this.id=a.id,$a[a.type](t,n,a,c,this.style.placement.variableOffsets))}translatePosMatrix(t,n,a,c,p){if(!a[0]&&!a[1])return t;const m=p?c==="map"?this.transform.angle:0:c==="viewport"?-this.transform.angle:0;if(m){const x=Math.sin(m),T=Math.cos(m);a=[a[0]*T-a[1]*x,a[0]*x+a[1]*T]}const y=[p?a[0]:W(n,a[0],this.transform.zoom),p?a[1]:W(n,a[1],this.transform.zoom),0],_=new Float32Array(16);return h.translate(_,t,y),_}saveTileTexture(t){const n=this._tileTextures[t.size[0]];n?n.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),a=this.imageManager.getPattern(t.to.toString());return!n||!a}useProgram(t,n){this.cache=this.cache||{};const a=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new bs(this.context,t,$r[t],n,Ia[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new yt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class Rs{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,a){const c=Math.pow(2,a),p=[[-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(y=>{const _=1/(y=h.transformMat4([],y,t))[3]/n*c;return h.mul$1(y,y,[_,_,1/y[3],_])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(y=>{const _=function(k,O){var B=O[0],R=O[1],q=O[2],H=B*B+R*R+q*q;return H>0&&(H=1/Math.sqrt(H)),k[0]=O[0]*H,k[1]=O[1]*H,k[2]=O[2]*H,k}([],function(k,O,B){var R=O[0],q=O[1],H=O[2],se=B[0],$=B[1],re=B[2];return k[0]=q*re-H*$,k[1]=H*se-R*re,k[2]=R*$-q*se,k}([],Mt([],p[y[0]],p[y[1]]),Mt([],p[y[2]],p[y[1]]))),x=-((T=_)[0]*(w=p[y[1]])[0]+T[1]*w[1]+T[2]*w[2]);var T,w;return _.concat(x)});return new Rs(p,m)}}class hr{constructor(t,n){this.min=t,this.max=n,this.center=function(a,c,p){return a[0]=.5*c[0],a[1]=.5*c[1],a[2]=.5*c[2],a}([],function(a,c,p){return a[0]=c[0]+p[0],a[1]=c[1]+p[1],a[2]=c[2]+p[2],a}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],a=Rt(this.min),c=Rt(this.max);for(let p=0;p=0&&m++;if(m===0)return 0;m!==n.length&&(a=!1)}if(a)return 2;for(let c=0;c<3;c++){let p=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let y=0;ythis.max[c]-this.min[c])return 0}return 1}}class Fs{constructor(t=0,n=0,a=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(a)||a<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=a,this.right=c}interpolate(t,n,a){return n.top!=null&&t.top!=null&&(this.top=h.interpolate.number(t.top,n.top,a)),n.bottom!=null&&t.bottom!=null&&(this.bottom=h.interpolate.number(t.bottom,n.bottom,a)),n.left!=null&&t.left!=null&&(this.left=h.interpolate.number(t.left,n.left,a)),n.right!=null&&t.right!=null&&(this.right=h.interpolate.number(t.right,n.right,a)),this}getCenter(t,n){const a=h.clamp((this.left+t-this.right)/2,0,t),c=h.clamp((this.top+n-this.bottom)/2,0,n);return new h.Point(a,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Fs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Os{constructor(t,n,a,c,p){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=p===void 0||!!p,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=a??0,this._maxPitch=c??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new h.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Fs,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const t=new Os(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new h.Point(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-h.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var a=new h.ARRAY_TYPE(4);return h.ARRAY_TYPE!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,c,p){var m=c[0],y=c[1],_=c[2],x=c[3],T=Math.sin(p),w=Math.cos(p);a[0]=m*w+_*T,a[1]=y*w+x*T,a[2]=m*-T+_*w,a[3]=y*-T+x*w}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=h.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,a){this._unmodified=!1,this._edgeInsets.interpolate(t,n,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new h.UnwrappedTileID(0,t)];if(this._renderWorldCopies){const a=this.pointCoordinate(new h.Point(0,0)),c=this.pointCoordinate(new h.Point(this.width,0)),p=this.pointCoordinate(new h.Point(this.width,this.height)),m=this.pointCoordinate(new h.Point(0,this.height)),y=Math.floor(Math.min(a.x,c.x,p.x,m.x)),_=Math.floor(Math.max(a.x,c.x,p.x,m.x)),x=1;for(let T=y-x;T<=_+x;T++)T!==0&&n.push(new h.UnwrappedTileID(T,t))}return n}coveringTiles(t){var n,a;let c=this.coveringZoomLevel(t);const p=c;if(t.minzoom!==void 0&&ct.maxzoom&&(c=t.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),y=h.MercatorCoordinate.fromLngLat(this.center),_=Math.pow(2,c),x=[_*m.x,_*m.y,0],T=[_*y.x,_*y.y,0],w=Rs.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c);let k=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(k=c);const O=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,B=$=>({aabb:new hr([$*_,0,0],[($+1)*_,_,0]),zoom:0,x:0,y:0,wrap:$,fullyVisible:!1}),R=[],q=[],H=c,se=t.reparseOverscaled?p:c;if(this._renderWorldCopies)for(let $=1;$<=3;$++)R.push(B(-$)),R.push(B($));for(R.push(B(0));R.length>0;){const $=R.pop(),re=$.x,oe=$.y;let me=$.fullyVisible;if(!me){const Ue=$.aabb.intersects(w);if(Ue===0)continue;me=Ue===2}const _e=t.terrain?x:T,ve=$.aabb.distanceX(_e),ge=$.aabb.distanceY(_e),Ce=Math.max(Math.abs(ve),Math.abs(ge));if($.zoom===H||Ce>O+(1<=k){const Ue=H-$.zoom,Ke=x[0]-.5-(re<>1),je=$.zoom+1;let ke=$.aabb.quadrant(Ue);if(t.terrain){const ut=new h.OverscaledTileID(je,$.wrap,je,Ke,Ee),qt=t.terrain.getMinMaxElevation(ut),dt=(n=qt.minElevation)!==null&&n!==void 0?n:this.elevation,Je=(a=qt.maxElevation)!==null&&a!==void 0?a:this.elevation;ke=new hr([ke.min[0],ke.min[1],dt],[ke.max[0],ke.max[1],Je])}R.push({aabb:ke,zoom:je,x:Ke,y:Ee,wrap:$.wrap,fullyVisible:me})}}return q.sort(($,re)=>$.distanceSq-re.distanceSq).map($=>$.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const n=h.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new h.Point(h.mercatorXfromLng(t.lng)*this.worldSize,h.mercatorYfromLat(n)*this.worldSize)}unproject(t){return new h.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(t){this.freezeElevation||(this.elevation=t?this.getElevation(this._center,t):0)}getElevation(t,n){const a=h.MercatorCoordinate.fromLngLat(t.wrap()),c=(1<m&&(c=m-B)}if(this.lngRange){const O=(y+_)/2,B=h.wrap(w.x,O-this.worldSize/2,O+this.worldSize/2),R=x.x/2;B-R_&&(a=_-R)}a===void 0&&c===void 0||(this.center=this.unproject(new h.Point(a!==void 0?a:w.x,c!==void 0?c:w.y)).wrap()),this._unmodified=T,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=h.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let c=h.identity(new Float64Array(16));h.scale(c,c,[this.width/2,-this.height/2,1]),h.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=h.identity(new Float64Array(16)),h.scale(c,c,[1,-1,1]),h.translate(c,c,[-1,-1,0]),h.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const p=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,m=Math.PI/2+this._pitch,y=this._fov*(.5+t.y/this.height),_=Math.sin(y)*p/Math.sin(h.clamp(Math.PI-m-y,.01,Math.PI-.01)),x=this.getHorizon(),T=2*Math.atan(x/this.cameraToCenterDistance)*(.5+t.y/(2*x)),w=Math.sin(T)*p/Math.sin(h.clamp(Math.PI-m-T,.01,Math.PI-.01)),k=Math.min(_,w),O=1.01*(Math.cos(Math.PI/2-this._pitch)*k+p),B=this.height/50;c=new Float64Array(16),h.perspective(c,this._fov,this.width/this.height,B,O),c[8]=2*-t.x/this.width,c[9]=2*t.y/this.height,h.scale(c,c,[1,-1,1]),h.translate(c,c,[0,0,-this.cameraToCenterDistance]),h.rotateX(c,c,this._pitch),h.rotateZ(c,c,this.angle),h.translate(c,c,[-n,-a,0]),this.mercatorMatrix=h.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),h.scale(c,c,[1,1,this._pixelPerMeter]),this.pixelMatrix=h.multiply(new Float64Array(16),this.labelPlaneMatrix,c),h.translate(c,c,[0,0,-this.elevation]),this.projMatrix=c,this.invProjMatrix=h.invert([],c),this.pixelMatrix3D=h.multiply(new Float64Array(16),this.labelPlaneMatrix,c);const R=this.width%2/2,q=this.height%2/2,H=Math.cos(this.angle),se=Math.sin(this.angle),$=n-Math.round(n)+H*R+se*q,re=a-Math.round(a)+H*q+se*R,oe=new Float64Array(c);if(h.translate(oe,oe,[$>.5?$-1:$,re>.5?re-1:re,0]),this.alignedProjMatrix=oe,c=h.invert(new Float64Array(16),this.pixelMatrix),!c)throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new h.Point(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return h.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new h.Point(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let a=n.x,c=n.y,p=n.x,m=n.y;for(const y of t)a=Math.min(a,y.x),c=Math.min(c,y.y),p=Math.max(p,y.x),m=Math.max(m,y.y);return[new h.Point(a,c),new h.Point(p,c),new h.Point(p,m),new h.Point(a,m),new h.Point(a,c)]}}}class Ko{constructor(t){this._hashName=t&&encodeURIComponent(t),h.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(n,a){let c=!1,p=null;const m=()=>{p=null,c&&(n(),p=setTimeout(m,300),c=!1)};return()=>(c=!0,p||m(),p)}(this._updateHashUnthrottled.bind(this))}addTo(t){return this._map=t,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(t){const n=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,c=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,c),m=Math.round(n.lng*p)/p,y=Math.round(n.lat*p)/p,_=this._map.getBearing(),x=this._map.getPitch();let T="";if(T+=t?`/${m}/${y}/${a}`:`${a}/${y}/${m}`,(_||x)&&(T+="/"+Math.round(10*_)/10),x&&(T+=`/${Math.round(x)}`),this._hashName){const w=this._hashName;let k=!1;const O=window.location.hash.slice(1).split("&").map(B=>{const R=B.split("=")[0];return R===w?(k=!0,`${R}=${T}`):B}).filter(B=>B);return k||O.push(`${w}=${T}`),`#${O.join("&")}`}return`#${T}`}_getCurrentHash(){const t=window.location.hash.replace("#","");if(this._hashName){let n;return t.split("&").map(a=>a.split("=")).forEach(a=>{a[0]===this._hashName&&(n=a)}),(n&&n[1]||"").split("/")}return t.split("/")}_onHashChange(){const t=this._getCurrentHash();if(t.length>=3&&!t.some(n=>isNaN(n))){const n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,t)}catch{}}}const es={linearity:.3,easing:h.bezier(0,0,.3,1)},Yo=h.extend({deceleration:2500,maxSpeed:1400},es),Jo=h.extend({deceleration:20,maxSpeed:1400},es),ts=h.extend({deceleration:1e3,maxSpeed:360},es),Qo=h.extend({deceleration:1e3,maxSpeed:90},es);class ur{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:h.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=h.exported.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new h.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:p}of this._inertiaBuffer)n.zoom+=p.zoomDelta||0,n.bearing+=p.bearingDelta||0,n.pitch+=p.pitchDelta||0,p.panDelta&&n.pan._add(p.panDelta),p.around&&(n.around=p.around),p.pinchAround&&(n.pinchAround=p.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){const p=is(n.pan.mag(),a,h.extend({},Yo,t||{}));c.offset=n.pan.mult(p.amount/n.pan.mag()),c.center=this._map.transform.center,Yi(c,p)}if(n.zoom){const p=is(n.zoom,a,Jo);c.zoom=this._map.transform.zoom+p.amount,Yi(c,p)}if(n.bearing){const p=is(n.bearing,a,ts);c.bearing=this._map.transform.bearing+h.clamp(p.amount,-179,179),Yi(c,p)}if(n.pitch){const p=is(n.pitch,a,Qo);c.pitch=this._map.transform.pitch+p.amount,Yi(c,p)}if(c.zoom||c.bearing){const p=n.pinchAround===void 0?n.around:n.pinchAround;c.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),h.extend(c,{noMoveStart:!0})}}function Yi(o,t){(!o.duration||o.durationn.unproject(_)),y=p.reduce((_,x,T,w)=>_.add(x.div(w.length)),new h.Point(0,0));super(t,{points:p,point:y,lngLats:m,lngLat:n.unproject(y),originalEvent:a}),this._defaultPrevented=!1}}class oc extends h.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,a){super(t,{originalEvent:a}),this._defaultPrevented=!1}}class lc{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new oc(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Ht(t.type,this._map,t))}mouseup(t){this._map.fire(new Ht(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ht(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Ht(t.type,this._map,t))}mouseover(t){this._map.fire(new Ht(t.type,this._map,t))}mouseout(t){this._map.fire(new Ht(t.type,this._map,t))}touchstart(t){return this._firePreventable(new jr(t.type,this._map,t))}touchmove(t){this._map.fire(new jr(t.type,this._map,t))}touchend(t){this._map.fire(new jr(t.type,this._map,t))}touchcancel(t){this._map.fire(new jr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cc{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Ht(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ht("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Ht(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Dn{constructor(t){this._map=t}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(t){return this.transform.pointLocation(h.Point.convert(t),this._map.terrain)}}class rs{constructor(t,n){this._map=t,this._tr=new Dn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(Y.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const a=n;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)p.fitScreenCoordinates(a,c,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Y.remove(this._box),this._box=null),Y.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new h.Event(t,{originalEvent:n}))}}function dr(o,t){if(o.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${o.length}, points ${t.length}`);const n={};for(let a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),a.length===this.numTouches&&(this.centroid=function(c){const p=new h.Point(0,0);for(const m of c)p._add(m);return p.div(c.length)}(n),this.touches=dr(a,n)))}touchmove(t,n,a){if(this.aborted||!this.centroid)return;const c=dr(a,n);for(const p in this.touches){const m=c[p];(!m||m.dist(this.touches[p])>30)&&(this.aborted=!0)}}touchend(t,n,a){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class Us{constructor(t){this.singleTap=new De(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,a){this.singleTap.touchstart(t,n,a)}touchmove(t,n,a){this.singleTap.touchmove(t,n,a)}touchend(t,n,a){const c=this.singleTap.touchend(t,n,a);if(c){const p=t.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(c)<30;if(p&&m||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class ns{constructor(t){this._tr=new Dn(t),this._zoomIn=new Us({numTouches:1,numTaps:2}),this._zoomOut=new Us({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,a){this._zoomIn.touchstart(t,n,a),this._zoomOut.touchstart(t,n,a)}touchmove(t,n,a){this._zoomIn.touchmove(t,n,a),this._zoomOut.touchmove(t,n,a)}touchend(t,n,a){const c=this._zoomIn.touchend(t,n,a),p=this._zoomOut.touchend(t,n,a),m=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(c)},{originalEvent:t})}):p?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(p)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ar{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const c=n.length?n[0]:n;return!this._moved&&c.dist(a){o.mousedown=o.dragStart,o.mousemoveWindow=o.dragMove,o.mouseup=o.dragEnd,o.contextmenu=function(t){t.preventDefault()}},tl=({enable:o,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const a=new Ae({checkCorrectEvent:c=>Y.mouseButton(c)===0&&c.ctrlKey||Y.mouseButton(c)===2});return new Ar({clickTolerance:t,move:(c,p)=>({bearingDelta:(p.x-c.x)*n}),moveStateManager:a,enable:o,assignEvents:qa})},Ns=({enable:o,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const a=new Ae({checkCorrectEvent:c=>Y.mouseButton(c)===0&&c.ctrlKey||Y.mouseButton(c)===2});return new Ar({clickTolerance:t,move:(c,p)=>({pitchDelta:(p.y-c.y)*n}),moveStateManager:a,enable:o,assignEvents:qa})};class il{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new h.Point(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,n,a){return this._calculateTransform(t,n,a)}touchmove(t,n,a){if(this._map._cooperativeGestures&&(this._minTouches===2&&a.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,a.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(a.length0&&(this._active=!0);const c=dr(a,n),p=new h.Point(0,0),m=new h.Point(0,0);let y=0;for(const x in c){const T=c[x],w=this._touches[x];w&&(p._add(T),m._add(T.sub(w)),y++,c[x]=T)}if(this._touches=c,yMath.abs(o.x)}class Mi extends $s{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,a){super.touchstart(t,n,a),this._currentTouchCount=a.length}_start(t){this._lastPoints=t,ss(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,a){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const c=t[0].sub(this._lastPoints[0]),p=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,p,a.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+p.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,a){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,p=n.mag()>=2;if(!c&&!p)return;if(!c||!p)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const m=t.y>0==n.y>0;return ss(t)&&ss(n)&&m}}const Zr={panStep:100,bearingStep:15,pitchStep:10};class nl{constructor(t){this._tr=new Dn(t);const n=Zr;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,a=0,c=0,p=0,m=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?a=-1:(t.preventDefault(),p=-1);break;case 39:t.shiftKey?a=1:(t.preventDefault(),p=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),m=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(a=0,c=0),{cameraAnimation:y=>{const _=this._tr;y.easeTo({duration:300,easeId:"keyboardHandler",easing:Ga,zoom:n?Math.round(_.zoom)+n*(t.shiftKey?2:1):_.zoom,bearing:_.bearing+a*this._bearingStep,pitch:_.pitch+c*this._pitchStep,offset:[-p*this._panStep,-m*this._panStep],center:_.center},{originalEvent:t})}}}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 Ga(o){return o*(2-o)}const Zs=4.000244140625;class Xa{constructor(t,n){this._map=t,this._tr=new Dn(t),this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,h.bindAll(["_onTimeout"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const a=h.exported.now(),c=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,n!==0&&n%Zs==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){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 n=Y.mousePos(this._el,t),a=this._tr;this._around=h.LngLat.convert(this._aroundCenter?a.center:a.unproject(n)),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const y=this._type==="wheel"&&Math.abs(this._delta)>Zs?this._wheelZoomRate:this._defaultZoomRate;let _=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&_!==0&&(_=1/_);const x=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(x*_))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,a=this._startZoom,c=this._easing;let p,m=!1;if(this._type==="wheel"&&a&&c){const y=Math.min((h.exported.now()-this._lastWheelEventTime)/200,1),_=c(y);p=h.interpolate.number(a,n,_),y<1?this._frameId||(this._frameId=!0):m=!0}else p=n,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:p-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=h.ease;if(this._prevEase){const a=this._prevEase,c=(h.exported.now()-a.start)/a.duration,p=a.easing(c+.01)-a.easing(c),m=.27/Math.sqrt(p*p+1e-4)*.01,y=Math.sqrt(.0729-m*m);n=h.bezier(m,y,.25,1)}return this._prevEase={start:h.exported.now(),duration:t,easing:n},n}reset(){this._active=!1}}class sl{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 Ji{constructor(t){this._tr=new Dn(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class kt{constructor(){this._tap=new Us({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(t,n,a){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?a.length>0&&(this._swipePoint=n[0],this._swipeTouch=a[0].identifier):this._tap.touchstart(t,n,a))}touchmove(t,n,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const c=n[0],p=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(t,n,a)}touchend(t,n,a){this._tapTime?this._swipePoint&&a.length===0&&this.reset():this._tap.touchend(t,n,a)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gs{constructor(t,n,a){this._el=t,this._mousePan=n,this._touchPan=a}enable(t){this._inertiaOptions=t||{},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 Wa{constructor(t,n,a){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=a}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 al{constructor(t,n,a,c){this._el=t,this._touchZoom=n,this._touchRotate=a,this._tapDragZoom=c,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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()}}const as=o=>o.zoom||o.drag||o.pitch||o.rotate;class ol extends h.Event{}function Ha(o){return o.panDelta&&o.panDelta.mag()||o.zoomDelta||o.bearingDelta||o.pitchDelta}class pr{constructor(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ur(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),h.bindAll(["handleEvent","handleWindowEvent"],this);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[c,p,m]of this._listeners)Y.addEventListener(c,p,c===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[t,n,a]of this._listeners)Y.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(t){const n=this._map,a=n.getCanvasContainer();this._add("mapEvent",new lc(n,t));const c=n.boxZoom=new rs(n,t);this._add("boxZoom",c);const p=new ns(n),m=new Ji(n);n.doubleClickZoom=new sl(m,p),this._add("tapZoom",p),this._add("clickZoom",m);const y=new kt;this._add("tapDragZoom",y);const _=n.touchPitch=new Mi(n);this._add("touchPitch",_);const x=tl(t),T=Ns(t);n.dragRotate=new Wa(t,x,T),this._add("mouseRotate",x,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const w=(({enable:H,clickTolerance:se})=>{const $=new Ae({checkCorrectEvent:re=>Y.mouseButton(re)===0&&!re.ctrlKey});return new Ar({clickTolerance:se,move:(re,oe)=>({around:oe,panDelta:oe.sub(re)}),activateOnStart:!0,moveStateManager:$,enable:H,assignEvents:qa})})(t),k=new il(t,n);n.dragPan=new Gs(a,w,k),this._add("mousePan",w),this._add("touchPan",k,["touchZoom","touchRotate"]);const O=new Za,B=new ja;n.touchZoomRotate=new al(a,B,O,y),this._add("touchRotate",O,["touchPan","touchZoom"]),this._add("touchZoom",B,["touchPan","touchRotate"]);const R=n.scrollZoom=new Xa(n,this);this._add("scrollZoom",R,["mousePan"]);const q=n.keyboard=new nl(n);this._add("keyboard",q),this._add("blockableMapEvent",new cc(n));for(const H of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[H]&&n[H].enable(t[H])}_add(t,n,a){this._handlers.push({handlerName:t,handler:n,allowed:a}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!as(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,a){for(const c in t)if(c!==a&&(!n||n.indexOf(c)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const n=[];for(const a of t)this._el.contains(a.target)&&n.push(a);return n}handleEvent(t,n){if(t.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const a=t.type==="renderFrame"?void 0:t,c={needsRenderFrame:!1},p={},m={},y=t.touches,_=y?this._getMapTouches(y):void 0,x=_?Y.touchPos(this._el,_):Y.mousePos(this._el,t);for(const{handlerName:k,handler:O,allowed:B}of this._handlers){if(!O.isEnabled())continue;let R;this._blockedByActive(m,B,k)?O.reset():O[n||t.type]&&(R=O[n||t.type](t,x,_),this.mergeHandlerResult(c,p,R,k,a),R&&R.needsRenderFrame&&this._triggerRenderFrame()),(R||O.isActive())&&(m[k]=O)}const T={};for(const k in this._previousActiveHandlers)m[k]||(T[k]=a);this._previousActiveHandlers=m,(Object.keys(T).length||Ha(c))&&(this._changes.push([c,p,T]),this._triggerRenderFrame()),(Object.keys(m).length||Ha(c))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:w}=c;w&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],w(this._map))}mergeHandlerResult(t,n,a,c,p){if(!a)return;h.extend(t,a);const m={handlerName:c,originalEvent:a.originalEvent||p};a.zoomDelta!==void 0&&(n.zoom=m),a.panDelta!==void 0&&(n.drag=m),a.pitchDelta!==void 0&&(n.pitch=m),a.bearingDelta!==void 0&&(n.rotate=m)}_applyChanges(){const t={},n={},a={};for(const[c,p,m]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new h.Point(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),h.extend(n,p),h.extend(a,m);this._updateMapTransform(t,n,a),this._changes=[]}_updateMapTransform(t,n,a){const c=this._map,p=c._getTransformForUpdate(),m=c.terrain;if(!(Ha(t)||m&&this._terrainMovement))return this._fireEvents(n,a,!0);let{panDelta:y,zoomDelta:_,bearingDelta:x,pitchDelta:T,around:w,pinchAround:k}=t;k!==void 0&&(w=k),c._stop(!0),w=w||c.transform.centerPoint;const O=p.pointLocation(y?w.sub(y):w);x&&(p.bearing+=x),T&&(p.pitch+=T),_&&(p.zoom+=_),m?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?p.center=p.pointLocation(p.centerPoint.sub(y)):p.setLocationAtPoint(O,w):(this._terrainMovement=!0,p.freezeElevation=!0,p.setLocationAtPoint(O,w),this._map.once("moveend",()=>{p.freezeElevation=!1,this._terrainMovement=!1,p.recalculateZoom(c.terrain)})):p.setLocationAtPoint(O,w),c._applyUpdatedTransform(p),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,a,!0)}_fireEvents(t,n,a){const c=as(this._eventsInProgress),p=as(t),m={};for(const T in t){const{originalEvent:w}=t[T];this._eventsInProgress[T]||(m[`${T}start`]=w),this._eventsInProgress[T]=t[T]}!c&&p&&this._fireEvent("movestart",p.originalEvent);for(const T in m)this._fireEvent(T,m[T]);p&&this._fireEvent("move",p.originalEvent);for(const T in t){const{originalEvent:w}=t[T];this._fireEvent(T,w)}const y={};let _;for(const T in this._eventsInProgress){const{handlerName:w,originalEvent:k}=this._eventsInProgress[T];this._handlersById[w].isActive()||(delete this._eventsInProgress[T],_=n[w]||k,y[`${T}end`]=_)}for(const T in y)this._fireEvent(T,y[T]);const x=as(this._eventsInProgress);if(a&&(c||p)&&!x){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=k=>k!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ol("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Xs={extend:(o,...t)=>h.extend(o,...t),run(o){o()},logToElement(o,t=!1,n="log"){const a=window.document.getElementById(n);a&&(t&&(a.innerHTML=""),a.innerHTML+=`
    ${o}`)}};class Fe extends h.Evented{constructor(t,n){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,h.bindAll(["_renderFrameCallback"],this),this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new h.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,a){return t=h.Point.convert(t).mult(-1),this.panTo(this.transform.center,h.extend({offset:t},n),a)}panTo(t,n,a){return this.easeTo(h.extend({center:t},n),a)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,a){return this.easeTo(h.extend({zoom:t},n),a)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,a){return this.easeTo(h.extend({bearing:t},n),a)}resetNorth(t,n){return this.rotateTo(0,h.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(h.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(a.zoom=h.interpolate.number(c,_,me)),this._rotating&&(a.bearing=h.interpolate.number(p,x,me)),this._pitching&&(a.pitch=h.interpolate.number(m,T,me)),this._padding&&(a.interpolatePadding(y,w,me),O=a.centerPoint.add(k)),this.terrain&&!t.freezeElevation&&this._updateElevation(me),$)a.setLocationAtPoint($,re);else{const _e=a.zoomScale(a.zoom-c),ve=_>c?Math.min(2,se):Math.max(.5,se),ge=Math.pow(ve,1-me),Ce=a.unproject(q.add(H.mult(me*ge)).mult(_e));a.setLocationAtPoint(a.renderWorldCopies?Ce.wrap():Ce,O)}this._applyUpdatedTransform(a),this._fireMoveEvents(n)},me=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,me)},t),this}_prepareEase(t,n,a={}){this._moving=!0,n||a.moving||this.fire(new h.Event("movestart",t)),this._zooming&&!a.zooming&&this.fire(new h.Event("zoomstart",t)),this._rotating&&!a.rotating&&this.fire(new h.Event("rotatestart",t)),this._pitching&&!a.pitching&&this.fire(new h.Event("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(t,this.terrain),this.transform.freezeElevation=!0}_updateElevation(t){const n=this.transform.getElevation(this._elevationCenter,this.terrain);if(t<1&&n!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(a-(n-(a*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=h.interpolate.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:a,zoom:c,pitch:p,bearing:m,elevation:y}=this.transformCameraUpdate(n);a&&(n.center=a),c!==void 0&&(n.zoom=c),p!==void 0&&(n.pitch=p),m!==void 0&&(n.bearing=m),y!==void 0&&(n.elevation=y),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new h.Event("move",t)),this._zooming&&this.fire(new h.Event("zoom",t)),this._rotating&&this.fire(new h.Event("rotate",t)),this._pitching&&this.fire(new h.Event("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const a=this._zooming,c=this._rotating,p=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new h.Event("zoomend",t)),c&&this.fire(new h.Event("rotateend",t)),p&&this.fire(new h.Event("pitchend",t)),this.fire(new h.Event("moveend",t))}flyTo(t,n){if(!t.essential&&h.exported.prefersReducedMotion){const ke=h.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ke,n)}this.stop(),t=h.extend({offset:[0,0],speed:1.2,curve:1.42,easing:h.ease},t);const a=this._getTransformForUpdate(),c=this.getZoom(),p=this.getBearing(),m=this.getPitch(),y=this.getPadding(),_="zoom"in t?h.clamp(+t.zoom,a.minZoom,a.maxZoom):c,x="bearing"in t?this._normalizeBearing(t.bearing,p):p,T="pitch"in t?+t.pitch:m,w="padding"in t?t.padding:a.padding,k=a.zoomScale(_-c),O=h.Point.convert(t.offset);let B=a.centerPoint.add(O);const R=a.pointLocation(B),q=h.LngLat.convert(t.center||R);this._normalizeCenter(q);const H=a.project(R),se=a.project(q).sub(H);let $=t.curve;const re=Math.max(a.width,a.height),oe=re/k,me=se.mag();if("minZoom"in t){const ke=h.clamp(Math.min(t.minZoom,c,_),a.minZoom,a.maxZoom),ut=re/a.zoomScale(ke-c);$=Math.sqrt(ut/me*2)}const _e=$*$;function ve(ke){const ut=(oe*oe-re*re+(ke?-1:1)*_e*_e*me*me)/(2*(ke?oe:re)*_e*me);return Math.log(Math.sqrt(ut*ut+1)-ut)}function ge(ke){return(Math.exp(ke)-Math.exp(-ke))/2}function Ce(ke){return(Math.exp(ke)+Math.exp(-ke))/2}const Ue=ve(0);let Ke=function(ke){return Ce(Ue)/Ce(Ue+$*ke)},Ee=function(ke){return re*((Ce(Ue)*(ge(ut=Ue+$*ke)/Ce(ut))-ge(Ue))/_e)/me;var ut},je=(ve(1)-Ue)/$;if(Math.abs(me)<1e-6||!isFinite(je)){if(Math.abs(re-oe)<1e-6)return this.easeTo(t,n);const ke=oet.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=p!==x,this._pitching=T!==m,this._padding=!a.isPaddingEqual(w),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(q),this._ease(ke=>{const ut=ke*je,qt=1/Ke(ut);a.zoom=ke===1?_:c+a.scaleZoom(qt),this._rotating&&(a.bearing=h.interpolate.number(p,x,ke)),this._pitching&&(a.pitch=h.interpolate.number(m,T,ke)),this._padding&&(a.interpolatePadding(y,w,ke),B=a.centerPoint.add(O)),this.terrain&&!t.freezeElevation&&this._updateElevation(ke);const dt=ke===1?q:a.unproject(H.add(se.mult(Ee(ut))).mult(qt));a.setLocationAtPoint(a.renderWorldCopies?dt.wrap():dt,B),this._applyUpdatedTransform(a),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const a=this._onEaseEnd;delete this._onEaseEnd,a.call(this,n)}if(!t){const a=this.handlers;a&&a.stop(!1)}return this}_ease(t,n,a){a.animate===!1||a.duration===0?(t(1),n()):(this._easeStart=h.exported.now(),this._easeOptions=a,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((h.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,n){t=h.wrap(t,-180,180);const a=Math.abs(t-n);return Math.abs(t-360-n)180?-360:a<-180?360:0}queryTerrainElevation(t){return this.terrain?this.transform.getElevation(h.LngLat.convert(t),this.terrain)-this.transform.elevation:null}}class qe{constructor(t={}){this.options=t,h.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=Y.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Y.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Y.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(){Y.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(t,n){const a=this._map._getUIString(`AttributionControl.${n}`);t.title=a,t.setAttribute("aria-label",a)}_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")))}_updateData(t){!t||t.sourceDataType!=="metadata"&&t.sourceDataType!=="visibility"&&t.dataType!=="style"&&t.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(c=>typeof c!="string"?"":c)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const n=this._map.style.sourceCaches;for(const c in n){const p=n[c];if(p.used||p.usedForTerrain){const m=p.getSource();m.attribution&&t.indexOf(m.attribution)<0&&t.push(m.attribution)}}t=t.filter(c=>String(c).trim()),t.sort((c,p)=>c.length-p.length),t=t.filter((c,p)=>{for(let m=p+1;m=0)return!1;return!0});const a=t.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}_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"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")}}class os{constructor(t={}){this.options=t,h.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=Y.create("div","maplibregl-ctrl");const n=Y.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Y.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const t=this._container.children;if(t.length){const n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}}}class Ka{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,a=n?this._queue.concat(n):this._queue;for(const c of a)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const a of n)if(!a.cancelled&&(a.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Ya={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var Ci=h.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class ll extends h.Evented{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const a={};for(const c of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))a[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.posMatrix=new Float64Array(16),h.ortho(c.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),this._tiles[c.key]=new Jr(c,this.tileSize));for(const c in this._tiles)a[c]||delete this._tiles[c]}freeRtt(t){for(const n in this._tiles){const a=this._tiles[n];(!t||a.tileID.equals(t)||a.tileID.isChildOf(t)||t.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const a of this._renderableTilesKeys){const c=this._tiles[a].tileID;if(c.canonical.equals(t.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16),h.ortho(p.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),n[a]=p}else if(c.canonical.isChildOf(t.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16);const m=c.canonical.z-t.canonical.z,y=c.canonical.x-(c.canonical.x>>m<>m<>m;h.ortho(p.posMatrix,0,x,0,x,0,1),h.translate(p.posMatrix,p.posMatrix,[-y*x,-_*x,0]),n[a]=p}else if(t.canonical.isChildOf(c.canonical)){const p=t.clone();p.posMatrix=new Float64Array(16);const m=t.canonical.z-c.canonical.z,y=t.canonical.x-(t.canonical.x>>m<>m<>m;h.ortho(p.posMatrix,0,h.EXTENT,0,h.EXTENT,0,1),h.translate(p.posMatrix,p.posMatrix,[y*x,_*x,0]),h.scale(p.posMatrix,p.posMatrix,[1/2**m,1/2**m,0]),n[a]=p}}return n}getSourceTile(t,n){const a=this.sourceCache._source;let c=t.overscaledZ-this.deltaZoom;if(c>a.maxzoom&&(c=a.maxzoom),c=a.minzoom&&(!p||!p.dem);)p=this.sourceCache.getTileByID(t.scaledTo(c--).key);return p}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class fr{constructor(t,n,a){this.painter=t,this.sourceCache=new ll(n),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,a,c=h.EXTENT){if(!(n>=0&&n=0&&at.canonical.z&&(t.canonical.z>=c?p=t.canonical.z-c:h.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=t.canonical.x-(t.canonical.x>>p<>p<>8<<4|p>>8,n[m+3]=0;const a=new h.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),c=new yt(t,a,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){const n=new Uint8Array(4),a=this.painter.context,c=a.gl;a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),a.bindFramebuffer.set(null);const p=n[0]+(n[2]>>4<<8),m=n[1]+((15&n[2])<<8),y=this.coordsIndex[255-n[3]],_=y&&this.sourceCache.getTileByID(y);if(!_)return null;const x=this._coordsTextureSize,T=(1<<_.tileID.canonical.z)*x;return new h.MercatorCoordinate((_.tileID.canonical.x*x+p)/T,(_.tileID.canonical.y*x+m)/T,this.getElevation(_.tileID,p,m,x))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,n=new h.Pos3dArray,a=new h.TriangleIndexArray,c=this.meshSize,p=h.EXTENT/c,m=c*c;for(let w=0;w<=c;w++)for(let k=0;k<=c;k++)n.emplaceBack(k*p,w*p,0);for(let w=0;wt.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const Pr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ft{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new hc(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(a=>!t._layers[a].isHidden(n)),this._coordsDescendingInv={};for(const a in t.sourceCaches){this._coordsDescendingInv[a]={};const c=t.sourceCaches[a].getVisibleCoordinates();for(const p of c){const m=this.terrain.sourceCache.getTerrainCoords(p);for(const y in m)this._coordsDescendingInv[a][y]||(this._coordsDescendingInv[a][y]=[]),this._coordsDescendingInv[a][y].push(m[y])}}this._coordsDescendingInvStr={};for(const a of t._order){const c=t._layers[a],p=c.source;if(Pr[c.type]&&!this._coordsDescendingInvStr[p]){this._coordsDescendingInvStr[p]={};for(const m in this._coordsDescendingInv[p])this._coordsDescendingInvStr[p][m]=this._coordsDescendingInv[p][m].map(y=>y.key).sort().join()}}for(const a of this._renderableTiles)for(const c in this._coordsDescendingInvStr){const p=this._coordsDescendingInvStr[c][a.tileID.key];p&&p!==a.rttCoords[c]&&(a.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,a=this.painter,c=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Pr[n]&&(this._prevType&&Pr[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!c))return!0;if(Pr[this._prevType]||Pr[n]&&c){this._prevType=n;const p=this._stacks.length-1,m=this._stacks[p]||[];for(const y of this._renderableTiles){if(this.pool.isFull()&&(Na(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(y),y.rtt[p]){const x=this.pool.getObjectForId(y.rtt[p].id);if(x.stamp===y.rtt[p].stamp){this.pool.useObject(x);continue}}const _=this.pool.getOrCreateFreeObject();this.pool.useObject(_),this.pool.stampObject(_),y.rtt[p]={id:_.id,stamp:_.stamp},a.context.bindFramebuffer.set(_.fbo.framebuffer),a.context.clear({color:h.Color.transparent,stencil:0}),a.currentStencilSource=void 0;for(let x=0;x{o.touchstart=o.dragStart,o.touchmoveWindow=o.dragMove,o.touchend=o.dragEnd},Ws={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ja{constructor(t,n,a=!1){this._clickTolerance=10;const c=t.dragRotate._mouseRotate.getClickTolerance(),p=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=tl({clickTolerance:c,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:y,bearingDegreesPerPixelMoved:_=.8})=>{const x=new Vs;return new Ar({clickTolerance:y,move:(T,w)=>({bearingDelta:(w.x-T.x)*_}),moveStateManager:x,enable:m,assignEvents:Ln})})({clickTolerance:c,enable:!0}),this.map=t,a&&(this.mousePitch=Ns({clickTolerance:p,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:y,pitchDegreesPerPixelMoved:_=-.5})=>{const x=new Vs;return new Ar({clickTolerance:y,move:(T,w)=>({pitchDelta:(w.y-T.y)*_}),moveStateManager:x,enable:m,assignEvents:Ln})})({clickTolerance:p,enable:!0})),h.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Y.addEventListener(n,"mousedown",this.mousedown),Y.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),Y.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),Y.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),Y.disableDrag()}moveMouse(t,n){const a=this.map,{bearingDelta:c}=this.mouseRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.mousePitch){const{pitchDelta:p}=this.mousePitch.dragMove(t,n)||{};p&&a.setPitch(a.getPitch()+p)}}moveTouch(t,n){const a=this.map,{bearingDelta:c}=this.touchRotate.dragMove(t,n)||{};if(c&&a.setBearing(a.getBearing()+c),this.touchPitch){const{pitchDelta:p}=this.touchPitch.dragMove(t,n)||{};p&&a.setPitch(a.getPitch()+p)}}off(){const t=this.element;Y.removeEventListener(t,"mousedown",this.mousedown),Y.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),Y.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Y.removeEventListener(window,"touchend",this.touchend),Y.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){Y.enableDrag(),Y.removeEventListener(window,"mousemove",this.mousemove),Y.removeEventListener(window,"mouseup",this.mouseup),Y.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Y.removeEventListener(window,"touchend",this.touchend)}mousedown(t){this.startMouse(h.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),Y.mousePos(this.element,t)),Y.addEventListener(window,"mousemove",this.mousemove),Y.addEventListener(window,"mouseup",this.mouseup)}mousemove(t){this.moveMouse(t,Y.mousePos(this.element,t))}mouseup(t){this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()}touchstart(t){t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Y.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),Y.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Y.addEventListener(window,"touchend",this.touchend))}touchmove(t){t.targetTouches.length!==1?this.reset():(this._lastPos=Y.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))}touchend(t){t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const a=n.locationPoint(o);if(a.x>=0&&a.y>=0&&a.x<=n.width&&a.y<=n.height)break;o.lng>n.center.lng?o.lng-=360:o.lng+=360}return o}const an={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 Ks(o,t,n){const a=o.classList;for(const c in an)a.remove(`maplibregl-${n}-anchor-${c}`);a.add(`maplibregl-${n}-anchor-${t}`)}class ls extends h.Evented{constructor(t,n){if(super(),(t instanceof HTMLElement||n)&&(t=h.extend({element:t},n)),h.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=h.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=Y.create("div"),this._element.setAttribute("aria-label","Map marker");const a=Y.createNS("http://www.w3.org/2000/svg","svg"),c=41,p=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${c}px`),a.setAttributeNS(null,"width",`${p}px`),a.setAttributeNS(null,"viewBox",`0 0 ${p} ${c}`);const m=Y.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");const y=Y.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const _=Y.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const x=[{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 se of x){const $=Y.createNS("http://www.w3.org/2000/svg","ellipse");$.setAttributeNS(null,"opacity","0.04"),$.setAttributeNS(null,"cx","10.5"),$.setAttributeNS(null,"cy","5.80029008"),$.setAttributeNS(null,"rx",se.rx),$.setAttributeNS(null,"ry",se.ry),_.appendChild($)}const T=Y.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill",this._color);const w=Y.createNS("http://www.w3.org/2000/svg","path");w.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"),T.appendChild(w);const k=Y.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"opacity","0.25"),k.setAttributeNS(null,"fill","#000000");const O=Y.createNS("http://www.w3.org/2000/svg","path");O.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"),k.appendChild(O);const B=Y.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(6.0, 7.0)"),B.setAttributeNS(null,"fill","#FFFFFF");const R=Y.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(8.0, 8.0)");const q=Y.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#000000"),q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962");const H=Y.createNS("http://www.w3.org/2000/svg","circle");H.setAttributeNS(null,"fill","#FFFFFF"),H.setAttributeNS(null,"cx","5.5"),H.setAttributeNS(null,"cy","5.5"),H.setAttributeNS(null,"r","5.4999962"),R.appendChild(q),R.appendChild(H),y.appendChild(_),y.appendChild(T),y.appendChild(k),y.appendChild(B),y.appendChild(R),a.appendChild(y),a.setAttributeNS(null,"height",c*this._scale+"px"),a.setAttributeNS(null,"width",p*this._scale+"px"),this._element.appendChild(a),this._offset=h.Point.convert(t&&t.offset||[0,-14])}this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",a=>{a.preventDefault()}),this._element.addEventListener("mousedown",a=>{a.preventDefault()}),Ks(this._element,this._anchor,"marker"),this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",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("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),Y.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=h.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const c=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(t){const n=t.code,a=t.charCode||t.keyCode;n!=="Space"&&n!=="Enter"&&a!==32&&a!==13||this.togglePopup()}_onMapClick(t){const n=t.originalEvent.target,a=this._element;this._popup&&(n===a||a.contains(n))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_update(t){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Hs(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let n="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?n=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?a="rotateX(0deg)":this._pitchAlignment==="map"&&(a=`rotateX(${this._map.getPitch()}deg)`),t&&t.type!=="moveend"||(this._pos=this._pos.round()),Y.setTransform(this._element,`${an[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${n}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const c=this._map.unproject(this._pos),p=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=c.distanceTo(this._lngLat)>20*p?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(t){return this._offset=h.Point.convert(t),this._update(),this}_onMove(t){if(!this._isDragging){const n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=t.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 h.Event("dragstart"))),this.fire(new h.Event("drag")))}_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 h.Event("dragend")),this._state="inactive"}_addDragHandler(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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))}setDraggable(t){return this._draggable=!!t,this._map&&(t?(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(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Qa={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Bn=0,on=!1;const eo={maxWidth:100,unit:"metric"};function Ys(o,t,n){const a=n&&n.maxWidth||100,c=o._container.clientHeight/2,p=o.unproject([0,c]),m=o.unproject([a,c]),y=p.distanceTo(m);if(n&&n.unit==="imperial"){const _=3.2808*y;_>5280?ln(t,a,_/5280,o._getUIString("ScaleControl.Miles")):ln(t,a,_,o._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?ln(t,a,y/1852,o._getUIString("ScaleControl.NauticalMiles")):y>=1e3?ln(t,a,y/1e3,o._getUIString("ScaleControl.Kilometers")):ln(t,a,y,o._getUIString("ScaleControl.Meters"))}function ln(o,t,n,a){const c=function(p){const m=Math.pow(10,`${Math.floor(p)}`.length-1);let y=p/m;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(_){const x=Math.pow(10,Math.ceil(-Math.log(_)/Math.LN10));return Math.round(_*x)/x}(y),m*y}(n);o.style.width=t*(c/n)+"px",o.innerHTML=`${c} ${a}`}const Js={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},to=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Qs(o){if(o){if(typeof o=="number"){const t=Math.round(Math.sqrt(.5*Math.pow(o,2)));return{center:new h.Point(0,0),top:new h.Point(0,o),"top-left":new h.Point(t,t),"top-right":new h.Point(-t,t),bottom:new h.Point(0,-o),"bottom-left":new h.Point(t,-t),"bottom-right":new h.Point(-t,-t),left:new h.Point(o,0),right:new h.Point(-o,0)}}if(o instanceof h.Point||Array.isArray(o)){const t=h.Point.convert(o);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:h.Point.convert(o.center||[0,0]),top:h.Point.convert(o.top||[0,0]),"top-left":h.Point.convert(o["top-left"]||[0,0]),"top-right":h.Point.convert(o["top-right"]||[0,0]),bottom:h.Point.convert(o.bottom||[0,0]),"bottom-left":h.Point.convert(o["bottom-left"]||[0,0]),"bottom-right":h.Point.convert(o["bottom-right"]||[0,0]),left:h.Point.convert(o.left||[0,0]),right:h.Point.convert(o.right||[0,0])}}return Qs(new h.Point(0,0))}const ea=ce,ta={setRTLTextPlugin:h.setRTLTextPlugin,getRTLTextPluginStatus:h.getRTLTextPluginStatus,Map:class extends Fe{constructor(o){var t;if(h.PerformanceUtils.mark(h.PerformanceMarkers.create),(o=h.extend({},cl,o)).minZoom!=null&&o.maxZoom!=null&&o.minZoom>o.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(o.minPitch!=null&&o.maxPitch!=null&&o.minPitch>o.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(o.minPitch!=null&&o.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(o.maxPitch!=null&&o.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Os(o.minZoom,o.maxZoom,o.minPitch,o.maxPitch,o.renderWorldCopies),{bearingSnap:o.bearingSnap}),this._interactive=o.interactive,this._cooperativeGestures=o.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=o.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=o.preserveDrawingBuffer,this._antialias=o.antialias,this._trackResize=o.trackResize,this._bearingSnap=o.bearingSnap,this._refreshExpiredTiles=o.refreshExpiredTiles,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=o.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=o.collectResourceTiming,this._renderTaskQueue=new Ka,this._controls=[],this._mapId=h.uniqueId(),this._locale=h.extend({},Ya,o.locale),this._clickTolerance=o.clickTolerance,this._pixelRatio=(t=o.pixelRatio)!==null&&t!==void 0?t:devicePixelRatio,this.transformCameraUpdate=o.transformCameraUpdate,this._imageQueueHandle=Bt.addThrottleControl(()=>this.isMoving()),this._requestManager=new pt(o.transformRequest),typeof o.container=="string"){if(this._container=document.getElementById(o.container),!this._container)throw new Error(`Container '${o.container}' not found.`)}else{if(!(o.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=o.container}if(o.maxBounds&&this.setMaxBounds(o.maxBounds),h.bindAll(["_onWindowOnline","_onMapScroll","_cooperativeGesturesOnWheel","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let n=!1;this._resizeObserver=new ResizeObserver(a=>{n?this._trackResize&&this.resize(a)._update():n=!0}),this._resizeObserver.observe(this._container)}this.handlers=new pr(this,o),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=o.hash&&new Ko(typeof o.hash=="string"&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,h.extend({},o.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=o.localIdeographFontFamily,this._validateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new qe({customAttribution:o.customAttribution})),o.maplibreLogo&&this.addControl(new os,o.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new h.Event(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new h.Event(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new h.Event("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(o,t){if(t===void 0&&(t=o.getDefaultPosition?o.getDefaultPosition():"top-right"),!o||!o.onAdd)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=o.onAdd(this);this._controls.push(o);const a=this._controlPositions[t];return t.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this}removeControl(o){if(!o||!o.onRemove)return this.fire(new h.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(o);return t>-1&&this._controls.splice(t,1),o.onRemove(this),this}hasControl(o){return this._controls.indexOf(o)>-1}calculateCameraOptionsFromTo(o,t,n,a){return a==null&&this.terrain&&(a=this.transform.getElevation(n,this.terrain)),super.calculateCameraOptionsFromTo(o,t,n,a)}resize(o){var t;const n=this._containerDimensions(),a=n[0],c=n[1];this._resizeCanvas(a,c,this.getPixelRatio()),this.transform.resize(a,c),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,c),this.painter.resize(a,c,this.getPixelRatio());const p=!this._moving;return p&&(this.stop(),this.fire(new h.Event("movestart",o)).fire(new h.Event("move",o))),this.fire(new h.Event("resize",o)),p&&this.fire(new h.Event("moveend",o)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(o){const[t,n]=this._containerDimensions();this._pixelRatio=o,this._resizeCanvas(t,n,o),this.painter.resize(t,n,o)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(o){return this.transform.setMaxBounds(hi.convert(o)),this._update()}setMinZoom(o){if((o=o??-2)>=-2&&o<=this.transform.maxZoom)return this.transform.minZoom=o,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=o,this._update(),this.getZoom()>o&&this.setZoom(o),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(o){if((o=o??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(o>=0&&o<=this.transform.maxPitch)return this.transform.minPitch=o,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(o>=this.transform.minPitch)return this.transform.maxPitch=o,this._update(),this.getPitch()>o&&this.setPitch(o),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(o){return this.transform.renderWorldCopies=o,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(o){return this._cooperativeGestures=o,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(o){return this.transform.locationPoint(h.LngLat.convert(o),this.style&&this.terrain)}unproject(o){return this.transform.pointLocation(h.Point.convert(o),this.terrain)}isMoving(){var o;return this._moving||((o=this.handlers)===null||o===void 0?void 0:o.isMoving())}isZooming(){var o;return this._zooming||((o=this.handlers)===null||o===void 0?void 0:o.isZooming())}isRotating(){var o;return this._rotating||((o=this.handlers)===null||o===void 0?void 0:o.isRotating())}_createDelegatedListener(o,t,n){if(o==="mouseenter"||o==="mouseover"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:p=>{const m=this.getLayer(t)?this.queryRenderedFeatures(p.point,{layers:[t]}):[];m.length?a||(a=!0,n.call(this,new Ht(o,this,p.originalEvent,{features:m}))):a=!1},mouseout:()=>{a=!1}}}}if(o==="mouseleave"||o==="mouseout"){let a=!1;return{layer:t,listener:n,delegates:{mousemove:m=>{(this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[]).length?a=!0:a&&(a=!1,n.call(this,new Ht(o,this,m.originalEvent)))},mouseout:m=>{a&&(a=!1,n.call(this,new Ht(o,this,m.originalEvent)))}}}}{const a=c=>{const p=this.getLayer(t)?this.queryRenderedFeatures(c.point,{layers:[t]}):[];p.length&&(c.features=p,n.call(this,c),delete c.features)};return{layer:t,listener:n,delegates:{[o]:a}}}}on(o,t,n){if(n===void 0)return super.on(o,t);const a=this._createDelegatedListener(o,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[o]=this._delegatedListeners[o]||[],this._delegatedListeners[o].push(a);for(const c in a.delegates)this.on(c,a.delegates[c]);return this}once(o,t,n){if(n===void 0)return super.once(o,t);const a=this._createDelegatedListener(o,t,n);for(const c in a.delegates)this.once(c,a.delegates[c]);return this}off(o,t,n){return n===void 0?super.off(o,t):(this._delegatedListeners&&this._delegatedListeners[o]&&(a=>{const c=this._delegatedListeners[o];for(let p=0;pthis._updateStyle(o,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!o)),o?(this.style=new pi(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof o=="string"?this.style.loadURL(o,t,n):this.style.loadJSON(o,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(o,t){if(typeof o=="string"){const n=this._requestManager.transformRequest(o,et.Style);h.getJSON(n,(a,c)=>{a?this.fire(new h.ErrorEvent(a)):c&&this._updateDiff(c,t)})}else typeof o=="object"&&this._updateDiff(o,t)}_updateDiff(o,t){try{this.style.setState(o,t)&&this._update(!0)}catch(n){h.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(o,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():h.warnOnce("There is no style added to the map.")}addSource(o,t){return this._lazyInitEmptyStyle(),this.style.addSource(o,t),this._update(!0)}isSourceLoaded(o){const t=this.style&&this.style.sourceCaches[o];if(t!==void 0)return t.loaded();this.fire(new h.ErrorEvent(new Error(`There is no source with ID '${o}'`)))}setTerrain(o){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),o){const t=this.style.sourceCaches[o.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${o.source}`);for(const n in this.style._layers){const a=this.style._layers[n];a.type==="hillshade"&&a.source===o.source&&h.warnOnce("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 fr(this.painter,t,o),this.painter.renderToTexture=new Ft(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId===o.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(n.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.updateElevation(this.terrain);return this.fire(new h.Event("terrain",{terrain:o})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){const o=this.style&&this.style.sourceCaches;for(const t in o){const n=o[t]._tiles;for(const a in n){const c=n[a];if(c.state!=="loaded"&&c.state!=="errored")return!1}}return!0}addSourceType(o,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(o,t,n)}removeSource(o){return this.style.removeSource(o),this._update(!0)}getSource(o){return this.style.getSource(o)}addImage(o,t,{pixelRatio:n=1,sdf:a=!1,stretchX:c,stretchY:p,content:m}={}){if(this._lazyInitEmptyStyle(),t instanceof HTMLImageElement||h.isImageBitmap(t)){const{width:y,height:_,data:x}=h.exported.getImageData(t);this.style.addImage(o,{data:new h.RGBAImage({width:y,height:_},x),pixelRatio:n,stretchX:c,stretchY:p,content:m,sdf:a,version:0})}else{if(t.width===void 0||t.height===void 0)return this.fire(new h.ErrorEvent(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:y,height:_,data:x}=t,T=t;this.style.addImage(o,{data:new h.RGBAImage({width:y,height:_},new Uint8Array(x)),pixelRatio:n,stretchX:c,stretchY:p,content:m,sdf:a,version:0,userImage:T}),T.onAdd&&T.onAdd(this,o)}}}updateImage(o,t){const n=this.style.getImage(o);if(!n)return this.fire(new h.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=t instanceof HTMLImageElement||h.isImageBitmap(t)?h.exported.getImageData(t):t,{width:c,height:p,data:m}=a;if(c===void 0||p===void 0)return this.fire(new h.ErrorEvent(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(c!==n.data.width||p!==n.data.height)return this.fire(new h.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const y=!(t instanceof HTMLImageElement||h.isImageBitmap(t));n.data.replace(m,y),this.style.updateImage(o,n)}getImage(o){return this.style.getImage(o)}hasImage(o){return o?!!this.style.getImage(o):(this.fire(new h.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(o){this.style.removeImage(o)}loadImage(o,t){Bt.getImage(this._requestManager.transformRequest(o,et.Image),t)}listImages(){return this.style.listImages()}addLayer(o,t){return this._lazyInitEmptyStyle(),this.style.addLayer(o,t),this._update(!0)}moveLayer(o,t){return this.style.moveLayer(o,t),this._update(!0)}removeLayer(o){return this.style.removeLayer(o),this._update(!0)}getLayer(o){return this.style.getLayer(o)}setLayerZoomRange(o,t,n){return this.style.setLayerZoomRange(o,t,n),this._update(!0)}setFilter(o,t,n={}){return this.style.setFilter(o,t,n),this._update(!0)}getFilter(o){return this.style.getFilter(o)}setPaintProperty(o,t,n,a={}){return this.style.setPaintProperty(o,t,n,a),this._update(!0)}getPaintProperty(o,t){return this.style.getPaintProperty(o,t)}setLayoutProperty(o,t,n,a={}){return this.style.setLayoutProperty(o,t,n,a),this._update(!0)}getLayoutProperty(o,t){return this.style.getLayoutProperty(o,t)}setGlyphs(o,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(o,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(o,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(o,t,n,a=>{a||this._update(!0)}),this}removeSprite(o){return this._lazyInitEmptyStyle(),this.style.removeSprite(o),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(o,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(o,t,n=>{n||this._update(!0)}),this}setLight(o,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(o,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(o,t){return this.style.setFeatureState(o,t),this._update()}removeFeatureState(o,t){return this.style.removeFeatureState(o,t),this._update()}getFeatureState(o){return this.style.getFeatureState(o)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let o=0,t=0;return this._container&&(o=this._container.clientWidth||400,t=this._container.clientHeight||300),[o,t]}_setupContainer(){const o=this._container;o.classList.add("maplibregl-map");const t=this._canvasContainer=Y.create("div","maplibregl-canvas-container",o);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=Y.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const n=this._containerDimensions();this._resizeCanvas(n[0],n[1],this.getPixelRatio());const a=this._controlContainer=Y.create("div","maplibregl-control-container",o),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(p=>{c[p]=Y.create("div",`maplibregl-ctrl-${p} `,a)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_cooperativeGesturesOnWheel(o){this._onCooperativeGesture(o,o[this._metaKey],1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=Y.create("div","maplibregl-cooperative-gesture-screen",this._container);let o=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(o=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`
    ${o}
    ${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
    - `,this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){Y.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(o,t,n){this._canvas.width=n*o,this._canvas.height=n*t,this._canvas.style.width=`${o}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const o={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{t={requestedAttributes:o},a&&(t.statusMessage=a.statusMessage,t.type=a.type)},{once:!0});const n=this._canvas.getContext("webgl2",o)||this._canvas.getContext("webgl",o);if(!n){const a="Failed to initialize WebGL";throw t?(t.message=a,new Error(JSON.stringify(t))):new Error(a)}this.painter=new Wo(n,this.transform),Ne.testSupport(n)}_contextLost(o){o.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new h.Event("webglcontextlost",{originalEvent:o}))}_contextRestored(o){this._setupPainter(),this.resize(),this._update(),this.fire(new h.Event("webglcontextrestored",{originalEvent:o}))}_onMapScroll(o){if(o.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(o,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(o){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||o,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(o){return this._update(),this._renderTaskQueue.add(o)}_cancelRenderFrame(o){this._renderTaskQueue.remove(o)}_render(o){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(o),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,p=h.exported.now();this.style.zoomHistory.update(c,p);const m=new h.EvaluationParameters(c,{now:p,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),y=m.crossFadingFactor();y===1&&y===this._crossFadingFactor||(n=!0,this._crossFadingFactor=y),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new h.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.load),this.fire(new h.Event("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new h.Event("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var o;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Bt.removeThrottleControl(this._imageQueueHandle),(o=this._resizeObserver)===null||o===void 0||o.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Y.remove(this._canvasContainer),Y.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),h.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new h.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=h.exported.frame(o=>{h.PerformanceUtils.frame(o),this._frame=null,this._render(o)}))}_onWindowOnline(){this._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(o){this._showTileBoundaries!==o&&(this._showTileBoundaries=o,this._update())}get showPadding(){return!!this._showPadding}set showPadding(o){this._showPadding!==o&&(this._showPadding=o,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(o){this._showCollisionBoxes!==o&&(this._showCollisionBoxes=o,o?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(o){this._showOverdrawInspector!==o&&(this._showOverdrawInspector=o,this._update())}get repaint(){return!!this._repaint}set repaint(o){this._repaint!==o&&(this._repaint=o,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(o){this._vertices=o,this._update()}get version(){return Kt}getCameraTargetElevation(){return this.transform.elevation}},NavigationControl:class{constructor(o){this.options=h.extend({},Zs,o),this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(h.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),Y.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),Y.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(h.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=Y.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const o=this._map.getZoom(),t=o===this._map.getMaxZoom(),n=o===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const o=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=o}onAdd(o){return this._map=o,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 Ha(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Y.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(o,t){const n=Y.create("button",o,this._container);return n.type="button",n.addEventListener("click",t),n}_setButtonTitle(o,t){const n=this._map._getUIString(`NavigationControl.${t}`);o.title=n,o.setAttribute("aria-label",n)}},GeolocateControl:class extends h.Evented{constructor(o){super(),this.options=h.extend({},Ka,o),h.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(o){return this._map=o,this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,n=!1){mr===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(a=>{mr=a.state!=="denied",t(mr)}).catch(()=>{mr=!!window.navigator.geolocation,t(mr)}):(mr=!!window.navigator.geolocation,t(mr)):t(mr)}(this._setupUI),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(),Y.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Bn=0,an=!1}_isOutOfMapMaxBounds(o){const t=this._map.getMaxBounds(),n=o.coords;return t&&(n.longitudet.getEast()||n.latitudet.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}`)}}_onSuccess(o){if(this._map){if(this._isOutOfMapMaxBounds(o))return this._setErrorState(),this.fire(new h.Event("outofmaxbounds",o)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=o,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(o),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(o),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new h.Event("geolocate",o)),this._finish()}}_updateCamera(o){const t=new h.LngLat(o.coords.longitude,o.coords.latitude),n=o.coords.accuracy,a=this._map.getBearing(),c=h.extend({bearing:a},this.options.fitBoundsOptions),p=hi.fromLngLat(t,n);this._map.fitBounds(p,c,{geolocateSource:!0})}_updateMarker(o){if(o){const t=new h.LngLat(o.coords.longitude,o.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=o.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const o=this._map.getBounds(),t=o.getSouthEast(),n=o.getNorthEast(),a=t.distanceTo(n),c=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(o){if(this._map){if(this.options.trackUserLocation)if(o.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 t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(o.code===3&&an)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new h.Event("error",o)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(o){if(this._map){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=Y.create("button","maplibregl-ctrl-geolocate",this._container),Y.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",o===!1){h.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Y.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new os(this._dotElement),this._circleElement=Y.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new os({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||t.originalEvent&&t.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 h.Event("trackuserlocationend")))})}}trigger(){if(!this._setup)return h.warnOnce("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 h.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Bn--,an=!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 h.Event("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 h.Event("trackuserlocationstart"));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 o;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Bn++,Bn>1?(o={maximumAge:6e5,timeout:0},an=!0):(o=this.options.positionOptions,an=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,o)}}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)}},AttributionControl:qe,LogoControl:as,ScaleControl:class{constructor(o){this.options=h.extend({},Ya,o),h.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Ws(this._map,this._container,this.options)}onAdd(o){return this._map=o,this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-scale",o.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Y.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(o){this.options.unit=o,Ws(this._map,this._container,this.options)}},FullscreenControl:class extends h.Evented{constructor(o={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,o&&o.container&&(o.container instanceof HTMLElement?this._container=o.container:h.warnOnce("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(o){return this._map=o,this._container||(this._container=this._map.getContainer()),this._controlContainer=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Y.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const o=this._fullscreenButton=Y.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Y.create("span","maplibregl-ctrl-icon",o).setAttribute("aria-hidden","true"),o.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const o=this._getTitle();this._fullscreenButton.setAttribute("aria-label",o),this._fullscreenButton.title=o}_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 h.Event("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new h.Event("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_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()}},TerrainControl:class{constructor(o){this.options=o,h.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(o){return this._map=o,this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Y.create("button","maplibregl-ctrl-terrain",this._container),Y.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(){Y.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_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.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends h.Evented{constructor(o){super(),this.options=h.extend(Object.create(Hs),o),h.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(o){return this._map&&this.remove(),this._map=o,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 h.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Y.remove(this._content),this._container&&(Y.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),delete this._map),this.fire(new h.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=h.LngLat.convert(o),this._pos=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._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(o){return this.setDOMContent(document.createTextNode(o))}setHTML(o){const t=document.createDocumentFragment(),n=document.createElement("body");let a;for(n.innerHTML=o;a=n.firstChild,a;)t.appendChild(a);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(o){return this.options.maxWidth=o,this._update(),this}setDOMContent(o){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Y.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(o),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(o){this._container&&this._container.classList.add(o)}removeClassName(o){this._container&&this._container.classList.remove(o)}setOffset(o){return this.options.offset=o,this._update(),this}toggleClassName(o){if(this._container)return this._container.classList.toggle(o)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Y.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(o){this._update(o.point)}_onMouseMove(o){this._update(o.point)}_onDrag(o){this._update(o.point)}_update(o){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=Y.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Y.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(p=>this._container.classList.add(p)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Gs(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!o))return;const t=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);let n=this.options.anchor;const a=Ks(this.options.offset);if(!n){const p=this._container.offsetWidth,m=this._container.offsetHeight;let y;y=t.y+a.bottom.ythis._map.transform.height-m?["bottom"]:[],t.x

    this._map.transform.width-p/2&&y.push("right"),n=y.length===0?"bottom":y.join("-")}const c=t.add(a[n]).round();Y.setTransform(this._container,`${sn[n]} translate(${c.x}px,${c.y}px)`),Xs(this._container,n,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const o=this._container.querySelector(Ja);o&&o.focus()}_onClose(){this.remove()}},Marker:os,Style:pi,LngLat:h.LngLat,LngLatBounds:hi,Point:h.Point,MercatorCoordinate:h.MercatorCoordinate,Evented:h.Evented,AJAXError:h.AJAXError,config:h.config,CanvasSource:le,GeoJSONSource:br,ImageSource:Xi,RasterDEMTileSource:Rr,RasterTileSource:Kr,VectorTileSource:xn,VideoSource:vn,prewarm:function(){wn().acquire(Qr)},clearPrewarmedResources:function(){const o=fi;o&&(o.isPreloaded()&&o.numActive()===1?(o.release(Qr),fi=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()"))},get version(){return Ys},get workerCount(){return we.workerCount},set workerCount(o){we.workerCount=o},get maxParallelImageRequests(){return h.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(o){h.config.MAX_PARALLEL_IMAGE_REQUESTS=o},get workerUrl(){return h.config.WORKER_URL},set workerUrl(o){h.config.WORKER_URL=o},addProtocol(o,t){h.config.REGISTERED_PROTOCOLS[o]=t},removeProtocol(o){delete h.config.REGISTERED_PROTOCOLS[o]}};return js.extend(Js,{isSafari:h.isSafari,getPerformanceMetrics:h.PerformanceUtils.getPerformanceMetrics}),Js});var de=te;return de})})(gd);var Km=gd.exports;function Vf(E){let A,D,N,te,ie;const de=E[3].default,h=rd(de,E,E[2],null);return{c(){A=wo("div"),D=wo("label"),N=lh(E[0]),te=vf(),h&&h.c(),pn(D,"class","govuk-label"),pn(D,"for",E[1]),pn(A,"class","govuk-form-group")},m(ce,Y){oh(ce,A,Y),zl(A,D),zl(D,N),zl(A,te),h&&h.m(A,null),ie=!0},p(ce,[Y]){(!ie||Y&1)&&Tf(N,ce[0]),(!ie||Y&2)&&pn(D,"for",ce[1]),h&&h.p&&(!ie||Y&4)&&ad(h,de,ce,ce[2],ie?sd(de,ce[2],Y,null):od(ce[2]),null)},i(ce){ie||(Io(h,ce),ie=!0)},o(ce){Vl(h,ce),ie=!1},d(ce){ce&&Eo(A),h&&h.d(ce)}}}function Nf(E,A,D){let{$$slots:N={},$$scope:te}=A,{label:ie}=A,{id:de}=A;return E.$$set=h=>{"label"in h&&D(0,ie=h.label),"id"in h&&D(1,de=h.id),"$$scope"in h&&D(2,te=h.$$scope)},[ie,de,te,N]}class $f extends hh{constructor(A){super(),ch(this,A,Nf,Vf,sh,{label:0,id:1})}}function qf(E){let A,D,N,te;const ie=E[2].default,de=rd(ie,E,E[1],null);let h=[{type:"button"},{class:"govuk-button govuk-button--secondary"},{"data-module":"govuk-button"},E[0]],ce={};for(let Y=0;Y{D(0,A=Ll(Ll({},A),Ku(de))),"$$scope"in de&&D(1,te=de.$$scope)},A=Ku(A),[A,te,N,ie]}class Ym extends hh{constructor(A){super(),ch(this,A,jf,qf,sh,{})}}function Zf(E){let A,D,N;return{c(){A=wo("input"),A.disabled=E[2],pn(A,"class","govuk-file-upload"),pn(A,"id",E[1]),pn(A,"type","file")},m(te,ie){oh(te,A,ie),E[6](A),D||(N=ud(A,"change",E[4]),D=!0)},p(te,ie){ie&4&&(A.disabled=te[2]),ie&2&&pn(A,"id",te[1])},d(te){te&&Eo(A),E[6](null),D=!1,N()}}}function Gf(E){let A,D;return A=new $f({props:{label:E[0],id:E[1],$$slots:{default:[Zf]},$$scope:{ctx:E}}}),{c(){Rf(A.$$.fragment)},m(N,te){fd(A,N,te),D=!0},p(N,[te]){const ie={};te&1&&(ie.label=N[0]),te&2&&(ie.id=N[1]),te&142&&(ie.$$scope={dirty:te,ctx:N}),A.$set(ie)},i(N){D||(Io(A.$$.fragment,N),D=!0)},o(N){Vl(A.$$.fragment,N),D=!1},d(N){md(A,N)}}}function Xf(E,A,D){let{label:N}=A,{id:te}=A,{loadFile:ie}=A,{disabled:de=!1}=A,h;function ce(Ne){let xe=new FileReader;xe.onload=ot=>{ie(ot.target.result)};let nt=h.files;xe.readAsText(nt[0])}function Y(Ne){eh[Ne?"unshift":"push"](()=>{h=Ne,D(3,h)})}return E.$$set=Ne=>{"label"in Ne&&D(0,N=Ne.label),"id"in Ne&&D(1,te=Ne.id),"loadFile"in Ne&&D(5,ie=Ne.loadFile),"disabled"in Ne&&D(2,de=Ne.disabled)},[N,te,de,h,ce,ie,Y]}class Jm extends hh{constructor(A){super(),ch(this,A,Xf,Gf,sh,{label:0,id:1,loadFile:5,disabled:2})}}var Di=63710088e-1,uh={centimeters:Di*100,centimetres:Di*100,degrees:Di/111325,feet:Di*3.28084,inches:Di*39.37,kilometers:Di/1e3,kilometres:Di/1e3,meters:Di,metres:Di,miles:Di/1609.344,millimeters:Di*1e3,millimetres:Di*1e3,nauticalmiles:Di/1852,radians:1,yards:Di*1.0936},Wf={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/Di,yards:1.0936133},rh={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 Xr(E,A,D){D===void 0&&(D={});var N={type:"Feature"};return(D.id===0||D.id)&&(N.id=D.id),D.bbox&&(N.bbox=D.bbox),N.properties=A||{},N.geometry=E,N}function Hf(E,A,D){switch(E){case"Point":return dn(A).geometry;case"LineString":return mn(A).geometry;case"Polygon":return dh(A).geometry;case"MultiPoint":return xd(A).geometry;case"MultiLineString":return yd(A).geometry;case"MultiPolygon":return vd(A).geometry;default:throw new Error(E+" is invalid")}}function dn(E,A,D){if(D===void 0&&(D={}),!E)throw new Error("coordinates is required");if(!Array.isArray(E))throw new Error("coordinates must be an Array");if(E.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ol(E[0])||!Ol(E[1]))throw new Error("coordinates must contain numbers");var N={type:"Point",coordinates:E};return Xr(N,A,D)}function Kf(E,A,D){return D===void 0&&(D={}),Nl(E.map(function(N){return dn(N,A)}),D)}function dh(E,A,D){D===void 0&&(D={});for(var N=0,te=E;N=0))throw new Error("precision must be a positive number");var D=Math.pow(10,A||0);return Math.round(E*D)/D}function bd(E,A){A===void 0&&(A="kilometers");var D=uh[A];if(!D)throw new Error(A+" units is invalid");return E*D}function ph(E,A){A===void 0&&(A="kilometers");var D=uh[A];if(!D)throw new Error(A+" units is invalid");return E/D}function tm(E,A){return wd(ph(E,A))}function im(E){var A=E%360;return A<0&&(A+=360),A}function wd(E){var A=E%(2*Math.PI);return A*180/Math.PI}function rm(E){var A=E%360;return A*Math.PI/180}function nm(E,A,D){if(A===void 0&&(A="kilometers"),D===void 0&&(D="kilometers"),!(E>=0))throw new Error("length must be a positive number");return bd(ph(E,A),D)}function sm(E,A,D){if(A===void 0&&(A="meters"),D===void 0&&(D="kilometers"),!(E>=0))throw new Error("area must be a positive number");var N=rh[A];if(!N)throw new Error("invalid original units");var te=rh[D];if(!te)throw new Error("invalid final units");return E/N*te}function Ol(E){return!isNaN(E)&&E!==null&&!Array.isArray(E)}function fh(E){return!!E&&E.constructor===Object}function am(E){if(!E)throw new Error("bbox is required");if(!Array.isArray(E))throw new Error("bbox must be an Array");if(E.length!==4&&E.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");E.forEach(function(A){if(!Ol(A))throw new Error("bbox must only contain numbers")})}function om(E){if(!E)throw new Error("id is required");if(["string","number"].indexOf(typeof E)===-1)throw new Error("id must be a number or a string")}const Qm=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:rh,bearingToAzimuth:im,convertArea:sm,convertLength:nm,degreesToRadians:rm,earthRadius:Di,factors:uh,feature:Xr,featureCollection:Nl,geometry:Hf,geometryCollection:Qf,isNumber:Ol,isObject:fh,lengthToDegrees:tm,lengthToRadians:ph,lineString:mn,lineStrings:Jf,multiLineString:yd,multiPoint:xd,multiPolygon:vd,point:dn,points:Kf,polygon:dh,polygons:Yf,radiansToDegrees:wd,radiansToLength:bd,round:em,unitsFactors:Wf,validateBBox:am,validateId:om},Symbol.toStringTag,{value:"Module"}));function ma(E,A,D){if(E!==null)for(var N,te,ie,de,h,ce,Y,Ne=0,xe=0,nt,ot=E.type,We=ot==="FeatureCollection",xt=ot==="Feature",bt=We?E.features.length:1,et=0;etce||We>Y||xt>Ne){h=xe,ce=N,Y=We,Ne=xt,ie=0;return}var bt=mn([h,xe],D.properties);if(A(bt,N,te,xt,ie)===!1)return!1;ie++,h=xe})===!1)return!1}}})}function fm(E,A,D){var N=D,te=!1;return Sd(E,function(ie,de,h,ce,Y){te===!1&&D===void 0?N=ie:N=A(N,ie,de,h,ce,Y),te=!0}),N}function Id(E,A){if(!E)throw new Error("geojson is required");$l(E,function(D,N,te){if(D.geometry!==null){var ie=D.geometry.type,de=D.geometry.coordinates;switch(ie){case"LineString":if(A(D,N,te,0,0)===!1)return!1;break;case"Polygon":for(var h=0;hD[0]&&(A[0]=D[0]),A[1]>D[1]&&(A[1]=D[1]),A[2]=0;te--){let ie=ed[te];if(ie==A.id){N=!0;break}E.getLayer(ie)&&(D=ie)}if(!N)throw new Error(`Layer ID ${A.id} not defined in layerZorder`);E.addLayer(A,D)}function ag(E,A){_h(E,{id:A.id,source:A.source,filter:A.filter??gh,type:"fill",paint:{"fill-color":A.color,"fill-opacity":A.opacity}})}function og(E,A){_h(E,{id:A.id,source:A.source,filter:A.filter??gh,type:"circle",paint:{"circle-radius":A.radius,"circle-color":A.color??Qu,"circle-opacity":A.opacity??Ad,"circle-stroke-color":A.strokeColor??Qu,"circle-stroke-width":A.strokeWidth??0}})}function lg(E,A){_h(E,{id:A.id,source:A.source,filter:A.filter??gh,type:"line",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A.color,"line-width":A.width,"line-opacity":A.opacity??Ad}})}function cg(){return{type:"FeatureCollection",features:[]}}function hg(E){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:ym(E)}}}function ym(E){return[Math.round(E[0]*1e7)/1e7,Math.round(E[1]*1e7)/1e7]}function ug(E,A,D){let N=["case"];for(let[te,ie]of Object.entries(A))N.push(["==",["get",E],te]),N.push(ie);return N.push(D),N}function dg(E){return Ul(E)}const ed=["interventions-polygons","interventions-polygon-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","draw-street-view","speed-limits","lane-polygons-layer","intersection-polygons-layer","lane-markings-layer","intersection-markings-layer","route-points","route-lines","route-polygons","road_label","boundary"];export{Im as $,Cm as A,ps as B,Ym as C,eh as D,Xm as E,$f as F,Jm as G,Rf as H,fd as I,Vm as J,md as K,Bm as L,Km as M,dg as N,vd as O,dh as P,wm as Q,Um as R,hh as S,sg as T,ag as U,lg as V,og as W,cg as X,ig as Y,rg as Z,ng as _,Ll as a,Rm as a0,hg as a1,rm as a2,wd as a3,bd as a4,ph as a5,dn as a6,$l as a7,Nl as a8,mn as a9,Sm as aA,Lm as aB,Gm as aC,Zm as aD,Am as aE,Tm as aF,Om as aG,Uf as aa,Hm as ab,Qm as ac,eg as ad,tg as ae,Wm as af,Xr as ag,Ed as ah,ym as ai,km as aj,Nm as ak,$m as al,bm as am,fm as an,ma as ao,Ul as ap,hm as aq,vm as ar,Dm as as,Fl as at,zm as au,Fm as av,Mm as aw,qm as ax,_h as ay,ug as az,Yu as b,rd as c,oh as d,wo as e,sd as f,od as g,Bf as h,ch as i,Vl as j,Eo as k,ud as l,Ku as m,Pf as n,jm as o,lh as p,vf as q,pn as r,sh as s,Io as t,ad as u,zl as v,Tf as w,fa as x,Em as y,Pm as z}; + `,this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){Y.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(o,t,n){this._canvas.width=n*o,this._canvas.height=n*t,this._canvas.style.width=`${o}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const o={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{t={requestedAttributes:o},a&&(t.statusMessage=a.statusMessage,t.type=a.type)},{once:!0});const n=this._canvas.getContext("webgl2",o)||this._canvas.getContext("webgl",o);if(!n){const a="Failed to initialize WebGL";throw t?(t.message=a,new Error(JSON.stringify(t))):new Error(a)}this.painter=new Ho(n,this.transform),Ne.testSupport(n)}_contextLost(o){o.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new h.Event("webglcontextlost",{originalEvent:o}))}_contextRestored(o){this._setupPainter(),this.resize(),this._update(),this.fire(new h.Event("webglcontextrestored",{originalEvent:o}))}_onMapScroll(o){if(o.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(o,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(o){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||o,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(o){return this._update(),this._renderTaskQueue.add(o)}_cancelRenderFrame(o){this._renderTaskQueue.remove(o)}_render(o){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(o),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,p=h.exported.now();this.style.zoomHistory.update(c,p);const m=new h.EvaluationParameters(c,{now:p,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),y=m.crossFadingFactor();y===1&&y===this._crossFadingFactor||(n=!0,this._crossFadingFactor=y),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new h.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.load),this.fire(new h.Event("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new h.Event("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,h.PerformanceUtils.mark(h.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var o;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Bt.removeThrottleControl(this._imageQueueHandle),(o=this._resizeObserver)===null||o===void 0||o.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Y.remove(this._canvasContainer),Y.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),h.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new h.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=h.exported.frame(o=>{h.PerformanceUtils.frame(o),this._frame=null,this._render(o)}))}_onWindowOnline(){this._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(o){this._showTileBoundaries!==o&&(this._showTileBoundaries=o,this._update())}get showPadding(){return!!this._showPadding}set showPadding(o){this._showPadding!==o&&(this._showPadding=o,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(o){this._showCollisionBoxes!==o&&(this._showCollisionBoxes=o,o?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(o){this._showOverdrawInspector!==o&&(this._showOverdrawInspector=o,this._update())}get repaint(){return!!this._repaint}set repaint(o){this._repaint!==o&&(this._repaint=o,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(o){this._vertices=o,this._update()}get version(){return Kt}getCameraTargetElevation(){return this.transform.elevation}},NavigationControl:class{constructor(o){this.options=h.extend({},Ws,o),this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(h.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),Y.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),Y.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(h.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=Y.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const o=this._map.getZoom(),t=o===this._map.getMaxZoom(),n=o===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const o=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=o}onAdd(o){return this._map=o,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 Ja(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Y.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(o,t){const n=Y.create("button",o,this._container);return n.type="button",n.addEventListener("click",t),n}_setButtonTitle(o,t){const n=this._map._getUIString(`NavigationControl.${t}`);o.title=n,o.setAttribute("aria-label",n)}},GeolocateControl:class extends h.Evented{constructor(o){super(),this.options=h.extend({},Qa,o),h.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(o){return this._map=o,this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,n=!1){mr===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(a=>{mr=a.state!=="denied",t(mr)}).catch(()=>{mr=!!window.navigator.geolocation,t(mr)}):(mr=!!window.navigator.geolocation,t(mr)):t(mr)}(this._setupUI),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(),Y.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Bn=0,on=!1}_isOutOfMapMaxBounds(o){const t=this._map.getMaxBounds(),n=o.coords;return t&&(n.longitudet.getEast()||n.latitudet.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}`)}}_onSuccess(o){if(this._map){if(this._isOutOfMapMaxBounds(o))return this._setErrorState(),this.fire(new h.Event("outofmaxbounds",o)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=o,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(o),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(o),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new h.Event("geolocate",o)),this._finish()}}_updateCamera(o){const t=new h.LngLat(o.coords.longitude,o.coords.latitude),n=o.coords.accuracy,a=this._map.getBearing(),c=h.extend({bearing:a},this.options.fitBoundsOptions),p=hi.fromLngLat(t,n);this._map.fitBounds(p,c,{geolocateSource:!0})}_updateMarker(o){if(o){const t=new h.LngLat(o.coords.longitude,o.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=o.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const o=this._map.getBounds(),t=o.getSouthEast(),n=o.getNorthEast(),a=t.distanceTo(n),c=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(o){if(this._map){if(this.options.trackUserLocation)if(o.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 t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(o.code===3&&on)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new h.Event("error",o)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(o){if(this._map){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=Y.create("button","maplibregl-ctrl-geolocate",this._container),Y.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",o===!1){h.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Y.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ls(this._dotElement),this._circleElement=Y.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ls({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||t.originalEvent&&t.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 h.Event("trackuserlocationend")))})}}trigger(){if(!this._setup)return h.warnOnce("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 h.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Bn--,on=!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 h.Event("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 h.Event("trackuserlocationstart"));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 o;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Bn++,Bn>1?(o={maximumAge:6e5,timeout:0},on=!0):(o=this.options.positionOptions,on=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,o)}}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)}},AttributionControl:qe,LogoControl:os,ScaleControl:class{constructor(o){this.options=h.extend({},eo,o),h.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Ys(this._map,this._container,this.options)}onAdd(o){return this._map=o,this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-scale",o.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Y.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(o){this.options.unit=o,Ys(this._map,this._container,this.options)}},FullscreenControl:class extends h.Evented{constructor(o={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,o&&o.container&&(o.container instanceof HTMLElement?this._container=o.container:h.warnOnce("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(o){return this._map=o,this._container||(this._container=this._map.getContainer()),this._controlContainer=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Y.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const o=this._fullscreenButton=Y.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Y.create("span","maplibregl-ctrl-icon",o).setAttribute("aria-hidden","true"),o.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const o=this._getTitle();this._fullscreenButton.setAttribute("aria-label",o),this._fullscreenButton.title=o}_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 h.Event("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new h.Event("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_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()}},TerrainControl:class{constructor(o){this.options=o,h.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(o){return this._map=o,this._container=Y.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Y.create("button","maplibregl-ctrl-terrain",this._container),Y.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(){Y.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_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.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends h.Evented{constructor(o){super(),this.options=h.extend(Object.create(Js),o),h.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(o){return this._map&&this.remove(),this._map=o,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 h.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Y.remove(this._content),this._container&&(Y.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),delete this._map),this.fire(new h.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=h.LngLat.convert(o),this._pos=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._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(o){return this.setDOMContent(document.createTextNode(o))}setHTML(o){const t=document.createDocumentFragment(),n=document.createElement("body");let a;for(n.innerHTML=o;a=n.firstChild,a;)t.appendChild(a);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(o){return this.options.maxWidth=o,this._update(),this}setDOMContent(o){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Y.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(o),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(o){this._container&&this._container.classList.add(o)}removeClassName(o){this._container&&this._container.classList.remove(o)}setOffset(o){return this.options.offset=o,this._update(),this}toggleClassName(o){if(this._container)return this._container.classList.toggle(o)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Y.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(o){this._update(o.point)}_onMouseMove(o){this._update(o.point)}_onDrag(o){this._update(o.point)}_update(o){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=Y.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Y.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(p=>this._container.classList.add(p)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Hs(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!o))return;const t=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);let n=this.options.anchor;const a=Qs(this.options.offset);if(!n){const p=this._container.offsetWidth,m=this._container.offsetHeight;let y;y=t.y+a.bottom.ythis._map.transform.height-m?["bottom"]:[],t.x

    this._map.transform.width-p/2&&y.push("right"),n=y.length===0?"bottom":y.join("-")}const c=t.add(a[n]).round();Y.setTransform(this._container,`${an[n]} translate(${c.x}px,${c.y}px)`),Ks(this._container,n,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const o=this._container.querySelector(to);o&&o.focus()}_onClose(){this.remove()}},Marker:ls,Style:pi,LngLat:h.LngLat,LngLatBounds:hi,Point:h.Point,MercatorCoordinate:h.MercatorCoordinate,Evented:h.Evented,AJAXError:h.AJAXError,config:h.config,CanvasSource:le,GeoJSONSource:br,ImageSource:Xi,RasterDEMTileSource:Fr,RasterTileSource:Yr,VectorTileSource:xn,VideoSource:vn,prewarm:function(){wn().acquire(en)},clearPrewarmedResources:function(){const o=fi;o&&(o.isPreloaded()&&o.numActive()===1?(o.release(en),fi=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()"))},get version(){return ea},get workerCount(){return we.workerCount},set workerCount(o){we.workerCount=o},get maxParallelImageRequests(){return h.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(o){h.config.MAX_PARALLEL_IMAGE_REQUESTS=o},get workerUrl(){return h.config.WORKER_URL},set workerUrl(o){h.config.WORKER_URL=o},addProtocol(o,t){h.config.REGISTERED_PROTOCOLS[o]=t},removeProtocol(o){delete h.config.REGISTERED_PROTOCOLS[o]}};return Xs.extend(ta,{isSafari:h.isSafari,getPerformanceMetrics:h.PerformanceUtils.getPerformanceMetrics}),ta});var ue=ee;return ue})})(yd);var Jm=yd.exports;function Vf(E){let I,D,V,ee;return{c(){I=ms("p"),D=ms("span"),D.textContent="Error:",V=ud(),ee=$l(E[0]),Lr(D,"class","govuk-visually-hidden"),Lr(I,"class","govuk-error-message")},m(ie,ue){Nl(ie,I,ue),fs(I,D),fs(I,V),fs(I,ee)},p(ie,[ue]){ue&1&&pd(ee,ie[0])},i:Nn,o:Nn,d(ie){ie&&_a(I)}}}function Nf(E,I,D){let{errorMessage:V}=I;return E.$$set=ee=>{"errorMessage"in ee&&D(0,V=ee.errorMessage)},[V]}class Qm extends Zl{constructor(I){super(),jl(this,I,Nf,Vf,Vl,{errorMessage:0})}}function $f(E){let I,D,V,ee,ie;const ue=E[3].default,h=rd(ue,E,E[2],null);return{c(){I=ms("div"),D=ms("label"),V=$l(E[0]),ee=ud(),h&&h.c(),Lr(D,"class","govuk-label"),Lr(D,"for",E[1]),Lr(I,"class","govuk-form-group")},m(ce,Y){Nl(ce,I,Y),fs(I,D),fs(D,V),fs(I,ee),h&&h.m(I,null),ie=!0},p(ce,[Y]){(!ie||Y&1)&&pd(V,ce[0]),(!ie||Y&2)&&Lr(D,"for",ce[1]),h&&h.p&&(!ie||Y&4)&&ad(h,ue,ce,ce[2],ie?sd(ue,ce[2],Y,null):od(ce[2]),null)},i(ce){ie||(Ao(h,ce),ie=!0)},o(ce){ql(h,ce),ie=!1},d(ce){ce&&_a(I),h&&h.d(ce)}}}function qf(E,I,D){let{$$slots:V={},$$scope:ee}=I,{label:ie}=I,{id:ue}=I;return E.$$set=h=>{"label"in h&&D(0,ie=h.label),"id"in h&&D(1,ue=h.id),"$$scope"in h&&D(2,ee=h.$$scope)},[ie,ue,ee,V]}class jf extends Zl{constructor(I){super(),jl(this,I,qf,$f,Vl,{label:0,id:1})}}function Zf(E){let I,D,V,ee;const ie=E[2].default,ue=rd(ie,E,E[1],null);let h=[{type:"button"},{class:"govuk-button govuk-button--secondary"},{"data-module":"govuk-button"},E[0]],ce={};for(let Y=0;Y{D(0,I=Ll(Ll({},I),Ku(ue))),"$$scope"in ue&&D(1,ee=ue.$$scope)},I=Ku(I),[I,ee,V,ie]}class eg extends Zl{constructor(I){super(),jl(this,I,Gf,Zf,Vl,{})}}function Xf(E){let I,D,V;return{c(){I=ms("input"),I.disabled=E[2],Lr(I,"class","govuk-file-upload"),Lr(I,"id",E[1]),Lr(I,"type","file")},m(ee,ie){Nl(ee,I,ie),E[6](I),D||(V=dd(I,"change",E[4]),D=!0)},p(ee,ie){ie&4&&(I.disabled=ee[2]),ie&2&&Lr(I,"id",ee[1])},d(ee){ee&&_a(I),E[6](null),D=!1,V()}}}function Wf(E){let I,D;return I=new jf({props:{label:E[0],id:E[1],$$slots:{default:[Xf]},$$scope:{ctx:E}}}),{c(){Rf(I.$$.fragment)},m(V,ee){gd(I,V,ee),D=!0},p(V,[ee]){const ie={};ee&1&&(ie.label=V[0]),ee&2&&(ie.id=V[1]),ee&142&&(ie.$$scope={dirty:ee,ctx:V}),I.$set(ie)},i(V){D||(Ao(I.$$.fragment,V),D=!0)},o(V){ql(I.$$.fragment,V),D=!1},d(V){_d(I,V)}}}function Hf(E,I,D){let{label:V}=I,{id:ee}=I,{loadFile:ie}=I,{disabled:ue=!1}=I,h;function ce(Ne){let xe=new FileReader;xe.onload=ot=>{ie(ot.target.result)};let nt=h.files;xe.readAsText(nt[0])}function Y(Ne){sh[Ne?"unshift":"push"](()=>{h=Ne,D(3,h)})}return E.$$set=Ne=>{"label"in Ne&&D(0,V=Ne.label),"id"in Ne&&D(1,ee=Ne.id),"loadFile"in Ne&&D(5,ie=Ne.loadFile),"disabled"in Ne&&D(2,ue=Ne.disabled)},[V,ee,ue,h,ce,ie,Y]}class tg extends Zl{constructor(I){super(),jl(this,I,Hf,Wf,Vl,{label:0,id:1,loadFile:5,disabled:2})}}var Di=63710088e-1,uh={centimeters:Di*100,centimetres:Di*100,degrees:Di/111325,feet:Di*3.28084,inches:Di*39.37,kilometers:Di/1e3,kilometres:Di/1e3,meters:Di,metres:Di,miles:Di/1609.344,millimeters:Di*1e3,millimetres:Di*1e3,nauticalmiles:Di/1852,radians:1,yards:Di*1.0936},Kf={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/Di,yards:1.0936133},lh={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 Wr(E,I,D){D===void 0&&(D={});var V={type:"Feature"};return(D.id===0||D.id)&&(V.id=D.id),D.bbox&&(V.bbox=D.bbox),V.properties=I||{},V.geometry=E,V}function Yf(E,I,D){switch(E){case"Point":return pn(I).geometry;case"LineString":return mn(I).geometry;case"Polygon":return dh(I).geometry;case"MultiPoint":return bd(I).geometry;case"MultiLineString":return vd(I).geometry;case"MultiPolygon":return wd(I).geometry;default:throw new Error(E+" is invalid")}}function pn(E,I,D){if(D===void 0&&(D={}),!E)throw new Error("coordinates is required");if(!Array.isArray(E))throw new Error("coordinates must be an Array");if(E.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ol(E[0])||!Ol(E[1]))throw new Error("coordinates must contain numbers");var V={type:"Point",coordinates:E};return Wr(V,I,D)}function Jf(E,I,D){return D===void 0&&(D={}),Gl(E.map(function(V){return pn(V,I)}),D)}function dh(E,I,D){D===void 0&&(D={});for(var V=0,ee=E;V=0))throw new Error("precision must be a positive number");var D=Math.pow(10,I||0);return Math.round(E*D)/D}function Td(E,I){I===void 0&&(I="kilometers");var D=uh[I];if(!D)throw new Error(I+" units is invalid");return E*D}function ph(E,I){I===void 0&&(I="kilometers");var D=uh[I];if(!D)throw new Error(I+" units is invalid");return E/D}function rm(E,I){return Ed(ph(E,I))}function nm(E){var I=E%360;return I<0&&(I+=360),I}function Ed(E){var I=E%(2*Math.PI);return I*180/Math.PI}function sm(E){var I=E%360;return I*Math.PI/180}function am(E,I,D){if(I===void 0&&(I="kilometers"),D===void 0&&(D="kilometers"),!(E>=0))throw new Error("length must be a positive number");return Td(ph(E,I),D)}function om(E,I,D){if(I===void 0&&(I="meters"),D===void 0&&(D="kilometers"),!(E>=0))throw new Error("area must be a positive number");var V=lh[I];if(!V)throw new Error("invalid original units");var ee=lh[D];if(!ee)throw new Error("invalid final units");return E/V*ee}function Ol(E){return!isNaN(E)&&E!==null&&!Array.isArray(E)}function fh(E){return!!E&&E.constructor===Object}function lm(E){if(!E)throw new Error("bbox is required");if(!Array.isArray(E))throw new Error("bbox must be an Array");if(E.length!==4&&E.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");E.forEach(function(I){if(!Ol(I))throw new Error("bbox must only contain numbers")})}function cm(E){if(!E)throw new Error("id is required");if(["string","number"].indexOf(typeof E)===-1)throw new Error("id must be a number or a string")}const ig=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:lh,bearingToAzimuth:nm,convertArea:om,convertLength:am,degreesToRadians:sm,earthRadius:Di,factors:uh,feature:Wr,featureCollection:Gl,geometry:Yf,geometryCollection:tm,isNumber:Ol,isObject:fh,lengthToDegrees:rm,lengthToRadians:ph,lineString:mn,lineStrings:em,multiLineString:vd,multiPoint:bd,multiPolygon:wd,point:pn,points:Jf,polygon:dh,polygons:Qf,radiansToDegrees:Ed,radiansToLength:Td,round:im,unitsFactors:Kf,validateBBox:lm,validateId:cm},Symbol.toStringTag,{value:"Module"}));function ya(E,I,D){if(E!==null)for(var V,ee,ie,ue,h,ce,Y,Ne=0,xe=0,nt,ot=E.type,We=ot==="FeatureCollection",xt=ot==="Feature",bt=We?E.features.length:1,et=0;etce||We>Y||xt>Ne){h=xe,ce=V,Y=We,Ne=xt,ie=0;return}var bt=mn([h,xe],D.properties);if(I(bt,V,ee,xt,ie)===!1)return!1;ie++,h=xe})===!1)return!1}}})}function gm(E,I,D){var V=D,ee=!1;return Ad(E,function(ie,ue,h,ce,Y){ee===!1&&D===void 0?V=ie:V=I(V,ie,ue,h,ce,Y),ee=!0}),V}function Pd(E,I){if(!E)throw new Error("geojson is required");Xl(E,function(D,V,ee){if(D.geometry!==null){var ie=D.geometry.type,ue=D.geometry.coordinates;switch(ie){case"LineString":if(I(D,V,ee,0,0)===!1)return!1;break;case"Polygon":for(var h=0;hD[0]&&(I[0]=D[0]),I[1]>D[1]&&(I[1]=D[1]),I[2]=0;ee--){let ie=ed[ee];if(ie==I.id){V=!0;break}E.getLayer(ie)&&(D=ie)}if(!V)throw new Error(`Layer ID ${I.id} not defined in layerZorder`);E.addLayer(I,D)}function cg(E,I){_h(E,{id:I.id,source:I.source,filter:I.filter??gh,type:"fill",paint:{"fill-color":I.color,"fill-opacity":I.opacity}})}function hg(E,I){_h(E,{id:I.id,source:I.source,filter:I.filter??gh,type:"circle",paint:{"circle-radius":I.radius,"circle-color":I.color??Qu,"circle-opacity":I.opacity??Md,"circle-stroke-color":I.strokeColor??Qu,"circle-stroke-width":I.strokeWidth??0}})}function ug(E,I){_h(E,{id:I.id,source:I.source,filter:I.filter??gh,type:"line",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":I.color,"line-width":I.width,"line-opacity":I.opacity??Md}})}function dg(){return{type:"FeatureCollection",features:[]}}function pg(E){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:vm(E)}}}function vm(E){return[Math.round(E[0]*1e7)/1e7,Math.round(E[1]*1e7)/1e7]}function fg(E,I,D){let V=["case"];for(let[ee,ie]of Object.entries(I))V.push(["==",["get",E],ee]),V.push(ie);return V.push(D),V}function mg(E){return Ul(E)}const ed=["interventions-polygons","interventions-polygon-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","draw-street-view","speed-limits","lane-polygons-layer","intersection-polygons-layer","lane-markings-layer","intersection-markings-layer","route-points","route-lines","route-polygons","road_label","boundary"];export{sg as $,zm as A,gs as B,eg as C,sh as D,Hm as E,jf as F,tg as G,Rf as H,gd as I,jm as J,$m as K,_d as L,Fm as M,Qm as N,qm as O,Jm as P,mg as Q,wd as R,Zl as S,dh as T,Em as U,Nm as V,lg as W,cg as X,ug as Y,hg as Z,dg as _,Ll as a,ag as a0,og as a1,Pm as a2,Om as a3,pg as a4,sm as a5,Ed as a6,Td as a7,ph as a8,pn as a9,fg as aA,Am as aB,Rm as aC,Wm as aD,Xm as aE,Mm as aF,Sm as aG,Vm as aH,Xl as aa,Gl as ab,mn as ac,Uf as ad,Ym as ae,ig as af,rg as ag,ng as ah,Km as ai,Wr as aj,Id as ak,vm as al,Dm as am,Tm as an,gm as ao,ya as ap,Ul as aq,dm as ar,wm as as,Bm as at,Fl as au,Lm as av,Um as aw,km as ax,Zm as ay,_h as az,Yu as b,rd as c,Nl as d,ms as e,sd as f,od as g,Bf as h,jl as i,ql as j,_a as k,dd as l,Ku as m,Pf as n,Gm as o,$l as p,ud as q,Lr as r,Vl as s,Ao as t,ad as u,fs as v,pd as w,Nn as x,Im as y,Cm as z}; diff --git a/browse_dropdown_filters/assets/maplibre_helpers-35cb7a5b.css b/capitalize_auto_form/assets/maplibre_helpers-35cb7a5b.css similarity index 100% rename from browse_dropdown_filters/assets/maplibre_helpers-35cb7a5b.css rename to capitalize_auto_form/assets/maplibre_helpers-35cb7a5b.css diff --git a/capitalize_auto_form/assets/nested-7a2f99b6.js b/capitalize_auto_form/assets/nested-7a2f99b6.js new file mode 100644 index 000000000..16f529d13 --- /dev/null +++ b/capitalize_auto_form/assets/nested-7a2f99b6.js @@ -0,0 +1,50 @@ +var po=Object.defineProperty;var ho=(r,e,t)=>e in r?po(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var J=(r,e,t)=>(ho(r,typeof e!="symbol"?e+"":e,t),t);import{R as go,T as _o,S as ee,i as te,s as ne,U as W,V as mo,Q as bi,W as ut,X as er,Y as Nt,Z as mn,_ as nt,$ as tr,a0 as nr,a1 as rr,a2 as be,d as k,x as G,k as S,a3 as bn,e as $,p as U,v as E,w as Le,a4 as Gt,H as F,q as A,r as x,I as P,l as Y,t as M,j as C,L as N,a5 as Pe,a6 as xn,a7 as bo,a8 as yo,a9 as _t,aa as ir,ab as et,ac as mt,ad as vo,ae as or,af as wo,ag as ko,ah as So,ai as Eo,aj as dr,ak as nn,al as Yt,am as Ae,B as Ie,O as pe,J as de,an as st,M as Ht,ao as Mo,ap as $o,aq as Co,ar as Lo,as as In,z as jt,A as fe,D as ae,E as ve,K as we,o as He,y as rn,at as yi,au as yn,av as on,aw as To,G as Ao,N as Oo,ax as vi,ay as sn,az as Ro,aA as vn,aB as hr,aC as gr,c as xo,u as Io,g as Fo,f as Po,aD as No,aE as Bo}from"./maplibre_helpers-09c65b90.js";import{M as wi,A as Do,a as Ho}from"./About-1025697f.js";import{m as Ue,g as ce,s as ln,a as Ge,f as xe,i as Ut,c as Jt,l as Fn,b as ki,d as Ce,o as an,e as bt,C as yt,u as At,n as wn,M as jo,r as vt,h as Pn,j as _r,L as Uo,Z as zo,k as qo,p as Go,I as Yo,B as Jo,q as Xo}from"./ZoomOutMap-58aba399.js";/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const Si=Symbol("Comlink.proxy"),Wo=Symbol("Comlink.endpoint"),Vo=Symbol("Comlink.releaseProxy"),En=Symbol("Comlink.finalizer"),Xt=Symbol("Comlink.thrown"),Ei=r=>typeof r=="object"&&r!==null||typeof r=="function",Ko={canHandle:r=>Ei(r)&&r[Si],serialize(r){const{port1:e,port2:t}=new MessageChannel;return sr(r,e),[t,[t]]},deserialize(r){return r.start(),Ci(r)}},Zo={canHandle:r=>Ei(r)&&Xt in r,serialize({value:r}){let e;return r instanceof Error?e={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:e={isError:!1,value:r},[e,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},Mi=new Map([["proxy",Ko],["throw",Zo]]);function Qo(r,e){for(const t of r)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function sr(r,e=globalThis,t=["*"]){e.addEventListener("message",function n(i){if(!i||!i.data)return;if(!Qo(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:o,type:s,path:a}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(ot);let u;try{const f=a.slice(0,-1).reduce((p,g)=>p[g],r),c=a.reduce((p,g)=>p[g],r);switch(s){case"GET":u=c;break;case"SET":f[a.slice(-1)[0]]=ot(i.data.value),u=!0;break;case"APPLY":u=c.apply(f,l);break;case"CONSTRUCT":{const p=new c(...l);u=os(p)}break;case"ENDPOINT":{const{port1:p,port2:g}=new MessageChannel;sr(r,g),u=is(p,[p])}break;case"RELEASE":u=void 0;break;default:return}}catch(f){u={value:f,[Xt]:0}}Promise.resolve(u).catch(f=>({value:f,[Xt]:0})).then(f=>{const[c,p]=cn(f);e.postMessage(Object.assign(Object.assign({},c),{id:o}),p),s==="RELEASE"&&(e.removeEventListener("message",n),$i(e),En in r&&typeof r[En]=="function"&&r[En]())}).catch(f=>{const[c,p]=cn({value:new TypeError("Unserializable return value"),[Xt]:0});e.postMessage(Object.assign(Object.assign({},c),{id:o}),p)})}),e.start&&e.start()}function es(r){return r.constructor.name==="MessagePort"}function $i(r){es(r)&&r.close()}function Ci(r,e){return Nn(r,[],e)}function zt(r){if(r)throw new Error("Proxy has been released and is not useable")}function Li(r){return ht(r,{type:"RELEASE"}).then(()=>{$i(r)})}const un=new WeakMap,fn="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{const e=(un.get(r)||0)-1;un.set(r,e),e===0&&Li(r)});function ts(r,e){const t=(un.get(e)||0)+1;un.set(e,t),fn&&fn.register(r,e,r)}function ns(r){fn&&fn.unregister(r)}function Nn(r,e=[],t=function(){}){let n=!1;const i=new Proxy(t,{get(o,s){if(zt(n),s===Vo)return()=>{ns(i),Li(r),n=!0};if(s==="then"){if(e.length===0)return{then:()=>i};const a=ht(r,{type:"GET",path:e.map(l=>l.toString())}).then(ot);return a.then.bind(a)}return Nn(r,[...e,s])},set(o,s,a){zt(n);const[l,u]=cn(a);return ht(r,{type:"SET",path:[...e,s].map(f=>f.toString()),value:l},u).then(ot)},apply(o,s,a){zt(n);const l=e[e.length-1];if(l===Wo)return ht(r,{type:"ENDPOINT"}).then(ot);if(l==="bind")return Nn(r,e.slice(0,-1));const[u,f]=mr(a);return ht(r,{type:"APPLY",path:e.map(c=>c.toString()),argumentList:u},f).then(ot)},construct(o,s){zt(n);const[a,l]=mr(s);return ht(r,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:a},l).then(ot)}});return ts(i,r),i}function rs(r){return Array.prototype.concat.apply([],r)}function mr(r){const e=r.map(cn);return[e.map(t=>t[0]),rs(e.map(t=>t[1]))]}const Ti=new WeakMap;function is(r,e){return Ti.set(r,e),r}function os(r){return Object.assign(r,{[Si]:!0})}function cn(r){for(const[e,t]of Mi)if(t.canHandle(r)){const[n,i]=t.serialize(r);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:r},Ti.get(r)||[]]}function ot(r){switch(r.type){case"HANDLER":return Mi.get(r.name).deserialize(r.value);case"RAW":return r.value}}function ht(r,e,t){return new Promise(n=>{const i=ss();r.addEventListener("message",function o(s){!s.data||!s.data.id||s.data.id!==i||(r.removeEventListener("message",o),n(s.data))}),r.start&&r.start(),r.postMessage(Object.assign({id:i},e),t)})}function ss(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}/** + * splaytree v3.1.1 + * Fast Splay tree for Node and browser + * + * @author Alexander Milevski + * @license MIT + * @preserve + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */function ls(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]e?1:r0){if(e.right===null)break;if(t(r,e.right.key)>0){var a=e.right;if(e.right=a.left,a.left=e,e=a,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function Mn(r,e,t,n){var i=new rt(r,e);if(t===null)return i.left=i.right=null,i;t=Xe(r,t,n);var o=n(r,t.key);return o<0?(i.left=t.left,i.right=t,t.left=null):o>=0&&(i.right=t.right,i.left=t,t.right=null),i}function br(r,e,t){var n=null,i=null;if(e){e=Xe(r,e,t);var o=t(e.key,r);o===0?(n=e.left,i=e.right):o<0?(i=e.right,e.right=null,n=e):(n=e.left,e.left=null,i=e)}return{left:n,right:i}}function us(r,e,t){return e===null?r:(r===null||(e=Xe(r.key,e,t),e.left=r),e)}function Bn(r,e,t,n,i){if(r){n(""+e+(t?"└── ":"├── ")+i(r)+` +`);var o=e+(t?" ":"│ ");r.left&&Bn(r.left,o,!1,n,i),r.right&&Bn(r.right,o,!0,n,i)}}var lr=function(){function r(e){e===void 0&&(e=as),this._root=null,this._size=0,this._comparator=e}return r.prototype.insert=function(e,t){return this._size++,this._root=Mn(e,t,this._root,this._comparator)},r.prototype.add=function(e,t){var n=new rt(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=Xe(e,this._root,i),s=i(e,o.key);return s===0?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},r.prototype._remove=function(e,t,n){var i;if(t===null)return null;t=Xe(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?i=t.right:(i=Xe(e,t.left,n),i.right=t.right),this._size--,i):t},r.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Xe(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},r.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return t;i<0?t=t.left:t=t.right}return null},r.prototype.find=function(e){return this._root&&(this._root=Xe(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},r.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return!0;i<0?t=t.left:t=t.right}return!1},r.prototype.forEach=function(e,t){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),e.call(t,n),n=n.right):o=!0;return this},r.prototype.range=function(e,t,n,i){for(var o=[],s=this._comparator,a=this._root,l;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),l=s(a.key,t),l>0)break;if(s(a.key,e)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},r.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},r.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},r.prototype.at=function(e){for(var t=this._root,n=!1,i=0,o=[];!n;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),i===e)return t;i++,t=t.right}else n=!0;return null},r.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var i=this._comparator;t;){var o=i(e.key,t.key);if(o===0)break;o<0?(n=t,t=t.left):t=t.right}return n},r.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var i=this._comparator;t;){var o=i(e.key,t.key);if(o===0)break;o<0?t=t.left:(n=t,t=t.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return cs(this._root)},r.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var i=e.length,o=this._comparator;if(n&&jn(e,t,0,i-1,o),this._root===null)this._root=Dn(e,t,0,i),this._size=i;else{var s=ps(this.toList(),fs(e,t),o);i=this._size+i,this._root=Hn({head:s},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Bn(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},r.prototype.update=function(e,t,n){var i=this._comparator,o=br(e,this._root,i),s=o.left,a=o.right;i(e,t)<0?a=Mn(t,n,a,i):s=Mn(t,n,s,i),this._root=us(s,a,i)},r.prototype.split=function(e){return br(e,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var e;return ls(this,function(t){switch(t.label){case 0:e=this.minNode(),t.label=1;case 1:return e?[4,e]:[3,3];case 2:return t.sent(),e=this.next(e),[3,1];case 3:return[2]}})},r}();function Dn(r,e,t,n){var i=n-t;if(i>0){var o=t+Math.floor(i/2),s=r[o],a=e[o],l=new rt(s,a);return l.left=Dn(r,e,t,o),l.right=Dn(r,e,o+1,n),l}return null}function fs(r,e){for(var t=new rt(null,null),n=t,i=0;i0?(e=o=o.next=t.pop(),e=e.right):n=!0;return o.next=null,i.next}function Hn(r,e,t){var n=t-e;if(n>0){var i=e+Math.floor(n/2),o=Hn(r,e,i),s=r.head;return s.left=o,r.head=r.head.next,s.right=Hn(r,i+1,t),s}return null}function ps(r,e,t){for(var n=new rt(null,null),i=n,o=r,s=e;o!==null&&s!==null;)t(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),n.next}function jn(r,e,t,n,i){if(!(t>=n)){for(var o=r[t+n>>1],s=t-1,a=n+1;;){do s++;while(i(r[s],o)<0);do a--;while(i(r[a],o)>0);if(s>=a)break;var l=r[s];r[s]=r[a],r[a]=l,l=e[s],e[s]=e[a],e[a]=l}jn(r,e,t,a,i),jn(r,e,a+1,n,i)}}function Fe(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function yr(r,e){for(var t=0;tn.x?1:t.yn.y?1:0}}]);function r(e,t){Fe(this,r),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}return Re(r,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var n=t.point.events,i=0,o=n.length;i=0&&p>=0?fg?-1:0:u<0&&p<0?fg?1:0:pu?1:0}}}]),r}(),bs=0,dn=function(){Re(r,null,[{key:"compare",value:function(t,n){var i=t.leftSE.point.x,o=n.leftSE.point.x,s=t.rightSE.point.x,a=n.rightSE.point.x;if(al&&u>f)return-1;var p=t.comparePoint(n.leftSE.point);if(p<0)return 1;if(p>0)return-1;var g=n.comparePoint(t.rightSE.point);return g!==0?g:-1}if(i>o){if(lu&&l>c)return 1;var v=n.comparePoint(t.leftSE.point);if(v!==0)return v;var y=t.comparePoint(n.rightSE.point);return y<0?1:y>0?-1:1}if(lu)return 1;if(sa){var h=t.comparePoint(n.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(s!==a){var d=f-l,b=s-i,m=c-u,w=a-o;if(d>b&&mw)return-1}return s>a?1:sc?1:t.idn.id?1:0}}]);function r(e,t,n,i){Fe(this,r),this.id=++bs,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=i}return Re(r,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:tn?t:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var n=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(n.x===i.x)return t.x===n.x?0:t.x0&&l.swapEvents(),De.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,i=this.windings.length;n0){var s=n;n=i,i=s}if(n.prev===i){var a=n;n=i,i=a}for(var l=0,u=i.rings.length;l0)o=n,s=t,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var u=new De(o,!0),f=new De(s,!1);return new r(u,f,[i],[a])}}]),r}(),Er=function(){function r(e,t,n){if(Fe(this,r),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=Bt.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=e.length;sthis.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(dn.fromRing(o,i,this))}return Re(r,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,i=this.segments.length;nthis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}return Re(r,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),n=0,i=this.interiorRings.length;nthis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}return Re(r,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,i=this.polys.length;n0&&(t=o)}for(var s=t.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),r}(),$r=function(){function r(e){Fe(this,r),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Re(r,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var n=0,i=this.interiorRings.length;n1&&arguments[1]!==void 0?arguments[1]:dn.compare;Fe(this,r),this.queue=e,this.tree=new lr(t),this.segments=[]}return Re(r,[{key:"process",value:function(t){var n=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),i;var o=t.isLeft?this.tree.insert(n):this.tree.find(n);if(!o)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,l=void 0,u=void 0;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;u===void 0;)a=this.tree.next(a),a===null?u=null:a.key.consumedBy===void 0&&(u=a.key);if(t.isLeft){var f=null;if(l){var c=l.getIntersection(n);if(c!==null&&(n.isAnEndpoint(c)||(f=c),!l.isAnEndpoint(c)))for(var p=this._splitSafely(l,c),g=0,v=p.length;g0?(this.tree.remove(n),i.push(t)):(this.segments.push(n),n.prev=l)}else{if(l&&u){var I=l.getIntersection(u);if(I!==null){if(!l.isAnEndpoint(I))for(var B=this._splitSafely(l,I),D=0,j=B.length;DCr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new ks(y),L=y.size,O=y.pop();O;){var R=O.key;if(y.size===L){var I=R.segment;throw new Error("Unable to pop() ".concat(R.isLeft?"left":"right"," SweepEvent ")+"[".concat(R.point.x,", ").concat(R.point.y,"] from segment #").concat(I.id," ")+"[".concat(I.leftSE.point.x,", ").concat(I.leftSE.point.y,"] -> ")+"[".concat(I.rightSE.point.x,", ").concat(I.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(y.size>Cr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>Ss)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var B=w.process(R),D=0,j=B.length;D1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;it(1,n=s));let{boundaryGeojson:i}=e;return mo("setCamera")&&n.fitBounds(bi(i),{padding:20,animate:!1}),ut(n,"boundary",Ts(i)),er(n,{id:"boundary",source:"boundary",color:"black",opacity:.5}),r.$$set=s=>{"boundaryGeojson"in s&&t(0,i=s.boundaryGeojson)},[i]}class xs extends ee{constructor(e){super(),te(this,e,Rs,null,ne,{boundaryGeojson:0})}}let ft="hover";function Is(r,e,t){let n,i,o,s,a,l;return W(r,Ue,u=>t(0,n=u)),W(r,ce,u=>t(1,i=u)),W(r,ln,u=>t(2,o=u)),W(r,Ge,u=>t(3,s=u)),W(r,xe,u=>t(4,a=u)),W(r,Ut,u=>t(5,l=u)),ut(n,ft,nt()),Nt(n,{id:"hover-polygons",source:ft,filter:tr,color:Jt.hovering,width:.5*Fn}),Nt(n,{id:"hover-lines",source:ft,filter:nr,color:Jt.hovering,width:1.5*Fn}),mn(n,{id:"hover-points",source:ft,filter:rr,color:Jt.hovering,radius:1.5*ki}),r.$$.update=()=>{if(r.$$.dirty&41&&(l||(n.getCanvas().style.cursor=s?"pointer":"inherit")),r.$$.dirty&31){let u=a||s||o;u!=null?n.getSource(ft).setData(i.features.find(f=>f.id==u)):n.getSource(ft).setData(nt())}},[n,i,o,s,a,l]}class Fs extends ee{constructor(e){super(),te(this,e,Is,null,ne,{})}}const Ps="/atip/capitalize_auto_form/assets/edit_attributes-29b396e1.svg",Ns="/atip/capitalize_auto_form/assets/edit_geometry-02dad294.svg",Bs="/atip/capitalize_auto_form/assets/point-276f4055.svg",Ds="/atip/capitalize_auto_form/assets/polygon_freehand-cf965967.svg",Hs="/atip/capitalize_auto_form/assets/polygon_snapped-18efbbea.svg",js="/atip/capitalize_auto_form/assets/route-d3c0ebad.svg",Ri="/atip/capitalize_auto_form/assets/split_route-9e0ea2da.svg",Us="/atip/capitalize_auto_form/assets/street_view-48580b6a.svg";function Lr(r){let e;function t(o,s){return o[2]?qs:zs}let n=t(r),i=n(r);return{c(){i.c(),e=be()},m(o,s){i.m(o,s),k(o,e,s)},p(o,s){n===(n=t(o))&&i?i.p(o,s):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){o&&S(e),i.d(o)}}}function zs(r){let e,t,n=bt(r[0])+"",i,o;return{c(){e=$("p"),t=U("Click "),i=U(n),o=U(" to fill out its attributes")},m(s,a){k(s,e,a),E(e,t),E(e,i),E(e,o)},p(s,a){a&1&&n!==(n=bt(s[0])+"")&&Le(i,n)},d(s){s&&S(e)}}}function qs(r){let e,t,n=bt(r[0])+"",i;return{c(){e=$("p"),t=U("Edit attributes to the left, or click "),i=U(n)},m(o,s){k(o,e,s),E(e,t),E(e,i)},p(o,s){s&1&&n!==(n=bt(o[0])+"")&&Le(i,n)},d(o){o&&S(e)}}}function Gs(r){let e,t=r[1]==qn&&Lr(r);return{c(){t&&t.c(),e=be()},m(n,i){t&&t.m(n,i),k(n,e,i)},p(n,[i]){n[1]==qn?t?t.p(n,i):(t=Lr(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:G,o:G,d(n){n&&S(e),t&&t.d(n)}}}const qn="edit-attribute";function xi(){}function Ys(r,e,t){let n,i,o,s;W(r,Ue,p=>t(7,n=p)),W(r,ce,p=>t(8,i=p)),W(r,Ce,p=>t(1,o=p)),W(r,xe,p=>t(2,s=p));let{schema:a}=e,{changeMode:l}=e,{eventHandler:u}=e;function f(){xe.set(null)}const c=an.subscribe(p=>{if(p){let g=i.features.find(v=>v.id==p);g.geometry.type=="Point"?n.flyTo({center:g.geometry.coordinates,duration:500}):n.fitBounds(bi(g),{padding:200,duration:500}),l(qn)}});return bn(c),u.mapHandlers.mousemove=p=>{var v;let g=n.queryRenderedFeatures(p.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});Ge.set(((v=g[0])==null?void 0:v.id)||null)},u.mapHandlers.mouseout=()=>{Ge.set(null)},u.mapHandlers.click=p=>{let g=n.queryRenderedFeatures(p.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});g.length>0?xe.set(g[0].id):xe.set(null)},r.$$set=p=>{"schema"in p&&t(0,a=p.schema),"changeMode"in p&&t(4,l=p.changeMode),"eventHandler"in p&&t(3,u=p.eventHandler)},[a,o,s,u,l,xi,f]}class Js extends ee{constructor(e){super(),te(this,e,Ys,Gs,ne,{schema:0,changeMode:4,eventHandler:3,start:5,stop:6})}get start(){return xi}get stop(){return this.$$.ctx[6]}}const Tr=["click","dblclick","mousemove","mousedown","mouseup","mouseout","dragstart"],Ar=["keypress","keyup","keydown"];class Je{constructor(){J(this,"mapHandlers");J(this,"documentHandlers");this.mapHandlers={click:e=>{},dblclick:e=>{},mousemove:e=>{},mousedown:e=>{},mouseup:e=>{},mouseout:e=>{},dragstart:e=>{}},this.documentHandlers={keypress:e=>{},keyup:e=>{},keydown:e=>{}}}}class Xs{constructor(e){J(this,"map");J(this,"active");J(this,"eventListenersSuccess");J(this,"eventListenersFailure");J(this,"cursor");J(this,"onMouseMove",e=>{this.active&&(this.cursor=Gt(e.lngLat.toArray()))});J(this,"onClick",()=>{if(this.active&&this.cursor){for(let e of this.eventListenersSuccess)e(this.cursor);this.stop()}});J(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.preventDefault(),this.cancel())});J(this,"setHandlers",e=>{e.mapHandlers.mousemove=this.onMouseMove,e.mapHandlers.click=this.onClick,e.documentHandlers.keydown=this.onKeyDown});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersFailure=[],this.cursor=null}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}start(){this.map.getCanvas().style.cursor="crosshair",this.setActivity(!0)}stop(){this.map.getCanvas().style.cursor="inherit",this.cursor=null,this.setActivity(!1)}setActivity(e){this.active=e,Ut.set(e)}}function Ws(r){let e;return{c(){e=$("li"),e.textContent="Click to add a new point"},m(t,n){k(t,e,n)},d(t){t&&S(e)}}}function Vs(r){let e;return{c(){e=$("li"),e.textContent="Click to move the point here"},m(t,n){k(t,e,n)},d(t){t&&S(e)}}}function Ks(r){let e,t,n;function i(a,l){return a[1]?Vs:Ws}let o=i(r),s=o(r);return{c(){e=$("ul"),s.c(),t=A(),n=$("li"),n.innerHTML="Press Escape to cancel"},m(a,l){k(a,e,l),s.m(e,null),E(e,t),E(e,n)},p(a,l){o!==(o=i(a))&&(s.d(1),s=o(a),s&&(s.c(),s.m(e,t)))},d(a){a&&S(e),s.d()}}}function Zs(r){let e,t,n,i,o,s;return e=new yt({props:{label:"Help",$$slots:{default:[Ks]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("button"),n.textContent="Cancel",x(n,"type","button")},m(a,l){P(e,a,l),k(a,t,l),k(a,n,l),i=!0,o||(s=Y(n,"click",r[2]),o=!0)},p(a,[l]){const u={};l&10&&(u.$$scope={dirty:l,ctx:a}),e.$set(u)},i(a){i||(M(e.$$.fragment,a),i=!0)},o(a){C(e.$$.fragment,a),i=!1},d(a){a&&(S(t),S(n)),N(e,a),o=!1,s()}}}function Qs(r,e,t){let{pointTool:n}=e,{editingExisting:i}=e;const o=()=>n.cancel();return r.$$set=s=>{"pointTool"in s&&t(0,n=s.pointTool),"editingExisting"in s&&t(1,i=s.editingExisting)},[n,i,o]}class Ii extends ee{constructor(e){super(),te(this,e,Qs,Zs,ne,{pointTool:0,editingExisting:1})}}function tt(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function je(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Gn(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function Fi(r,e,t){if(t===void 0&&(t={}),t.final===!0)return el(r,e);var n=tt(r),i=tt(e),o=Pe(n[0]),s=Pe(i[0]),a=Pe(n[1]),l=Pe(i[1]),u=Math.sin(s-o)*Math.cos(l),f=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return xn(Math.atan2(u,f))}function el(r,e){var t=Fi(e,r);return t=(t+180)%360,t}function We(r,e,t){t===void 0&&(t={});var n=tt(r),i=tt(e),o=Pe(i[1]-n[1]),s=Pe(i[0]-n[0]),a=Pe(n[1]),l=Pe(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return bo(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),t.units)}function Or(r,e,t,n){n===void 0&&(n={});var i=tt(r),o=Pe(i[0]),s=Pe(i[1]),a=Pe(t),l=yo(e,n.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a)),f=o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u)),c=xn(f),p=xn(u);return _t([c,p],n.properties)}function Yn(r){if(!r)throw new Error("geojson is required");var e=[];return ir(r,function(t){tl(t,e)}),et(e)}function tl(r,e){var t=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":t=je(n);break;case"LineString":t=[je(n)]}t.forEach(function(i){var o=nl(i,r.properties);o.forEach(function(s){s.id=e.length,e.push(s)})})}}function nl(r,e){var t=[];return r.reduce(function(n,i){var o=mt([n,i],e);return o.bbox=rl(n,i),t.push(o),i}),t}function rl(r,e){var t=r[0],n=r[1],i=e[0],o=e[1],s=ti?t:i,u=n>o?n:o;return[s,a,l,u]}var ar={exports:{}},Pi={exports:{}};(function(r,e){(function(t,n){r.exports=n()})(vo,function(){function t(d,b,m,w,L){(function O(R,I,B,D,j){for(;D>B;){if(D-B>600){var T=D-B+1,z=I-B+1,ue=Math.log(T),he=.5*Math.exp(2*ue/3),Se=.5*Math.sqrt(ue*he*(T-he)/T)*(z-T/2<0?-1:1),Ee=Math.max(B,Math.floor(I-z*he/T+Se)),_e=Math.min(D,Math.floor(I+(T-z)*he/T+Se));O(R,I,Ee,_e,j)}var me=R[I],Te=B,se=D;for(n(R,B,I),j(R[D],me)>0&&n(R,B,D);Te0;)se--}j(R[B],me)===0?n(R,B,se):n(R,++se,D),se<=I&&(B=se+1),I<=se&&(D=se-1)}})(d,b,m||0,w||d.length-1,L||i)}function n(d,b,m){var w=d[b];d[b]=d[m],d[m]=w}function i(d,b){return db?1:0}var o=function(d){d===void 0&&(d=9),this._maxEntries=Math.max(4,d),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(d,b,m){if(!m)return b.indexOf(d);for(var w=0;w=d.minX&&b.maxY>=d.minY}function _(d){return{children:d,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function h(d,b,m,w,L){for(var O=[b,m];O.length;)if(!((m=O.pop())-(b=O.pop())<=w)){var R=b+Math.ceil((m-b)/w/2)*w;t(d,R,b,m,L),O.push(b,R,R,m)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(d){var b=this.data,m=[];if(!y(d,b))return m;for(var w=this.toBBox,L=[];b;){for(var O=0;O=0&&L[b].children.length>this._maxEntries;)this._split(L,b),b--;this._adjustParentBBoxes(w,L,b)},o.prototype._split=function(d,b){var m=d[b],w=m.children.length,L=this._minEntries;this._chooseSplitAxis(m,L,w);var O=this._chooseSplitIndex(m,L,w),R=_(m.children.splice(O,m.children.length-O));R.height=m.height,R.leaf=m.leaf,a(m,this.toBBox),a(R,this.toBBox),b?d[b-1].children.push(R):this._splitRoot(m,R)},o.prototype._splitRoot=function(d,b){this.data=_([d,b]),this.data.height=d.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(d,b,m){for(var w,L,O,R,I,B,D,j=1/0,T=1/0,z=b;z<=m-b;z++){var ue=l(d,0,z,this.toBBox),he=l(d,z,m,this.toBBox),Se=(L=ue,O=he,R=void 0,I=void 0,B=void 0,D=void 0,R=Math.max(L.minX,O.minX),I=Math.max(L.minY,O.minY),B=Math.min(L.maxX,O.maxX),D=Math.min(L.maxY,O.maxY),Math.max(0,B-R)*Math.max(0,D-I)),Ee=p(ue)+p(he);Se=b;j--){var T=d.children[j];u(R,d.leaf?L(T):T),I+=g(R)}return I},o.prototype._adjustParentBBoxes=function(d,b,m){for(var w=m;w>=0;w--)u(b[w],d)},o.prototype._condense=function(d){for(var b=d.length-1,m=void 0;b>=0;b--)d[b].children.length===0?b>0?(m=d[b-1].children).splice(m.indexOf(d[b]),1):this.clear():a(d[b],this.toBBox)},o})})(Pi);var il=Pi.exports;const ol=or(wo),sl=or(ko),ll=or(So);var Be=il,Ni=ol,Bi=sl,ct=ll.default,al=Bi.featureEach;Bi.coordEach;Ni.polygon;var Rr=Ni.featureCollection;function Di(r){var e=new Be(r);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ct(t),Be.prototype.insert.call(this,t)},e.load=function(t){var n=[];return Array.isArray(t)?t.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:ct(i),n.push(i)}):al(t,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:ct(i),n.push(i)}),Be.prototype.load.call(this,n)},e.remove=function(t,n){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ct(t),Be.prototype.remove.call(this,t,n)},e.clear=function(){return Be.prototype.clear.call(this)},e.search=function(t){var n=Be.prototype.search.call(this,this.toBBox(t));return Rr(n)},e.collides=function(t){return Be.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=Be.prototype.all.call(this);return Rr(t)},e.toJSON=function(){return Be.prototype.toJSON.call(this)},e.fromJSON=function(t){return Be.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var n;if(t.bbox)n=t.bbox;else if(Array.isArray(t)&&t.length===4)n=t;else if(Array.isArray(t)&&t.length===6)n=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")n=ct(t);else if(t.type==="FeatureCollection")n=ct(t);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},e}ar.exports=Di;ar.exports.default=Di;var ul=ar.exports;const ur=Eo(ul);function Hi(r,e){var t={},n=[];if(r.type==="LineString"&&(r=dr(r)),e.type==="LineString"&&(e=dr(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=xr(r,e);return i&&n.push(i),et(n)}var o=ur();return o.load(Yn(e)),nn(Yn(r),function(s){nn(o.search(s),function(a){var l=xr(s,a);if(l){var u=je(l).join(",");t[u]||(t[u]=!0,n.push(l))}})}),et(n)}function xr(r,e){var t=je(r),n=je(e);if(t.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(n.length!==2)throw new Error(" line2 must only contain 2 coordinates");var i=t[0][0],o=t[0][1],s=t[1][0],a=t[1][1],l=n[0][0],u=n[0][1],f=n[1][0],c=n[1][1],p=(c-u)*(s-i)-(f-l)*(a-o),g=(f-l)*(o-u)-(c-u)*(i-l),v=(s-i)*(o-u)-(a-o)*(i-l);if(p===0)return null;var y=g/p,_=v/p;if(y>=0&&y<=1&&_>=0&&_<=1){var h=i+y*(s-i),d=o+y*(a-o);return _t([h,d])}return null}function Dt(r,e,t){t===void 0&&(t={});var n=_t([1/0,1/0],{dist:1/0}),i=0;return ir(r,function(o){for(var s=je(o),a=0;a0&&(_=y.features[0],_.properties.dist=We(e,_,t),_.properties.location=i+We(l,_,t)),l.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,n=this.dragFrom[1]-e.lngLat.lat;for(let i of this.points)i[0]-=t,i[1]-=n}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});J(this,"onClick",e=>{if(this.active&&this.cursor){let t=[];if(Ir(this.points).forEach((n,i)=>{t.push([i+1,Dt(n,this.cursor).properties.dist])}),t.sort((n,i)=>n[1]-i[1]),t.length>0){let n=t[0][0];this.points.splice(n,0,this.cursor.geometry.coordinates),this.hover=n}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))});J(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=Gt(e.lngLat.toArray()),this.onClick(e),this.finish())});J(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.redraw())});J(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});J(this,"onKeypress",e=>{this.active&&e.key=="Enter"&&(e.preventDefault(),this.finish())});J(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.preventDefault(),this.cancel())});J(this,"setHandlers",e=>{e.mapHandlers.mousemove=this.onMouseMove,e.mapHandlers.click=this.onClick,e.mapHandlers.dblclick=this.onDoubleClick,e.mapHandlers.mousedown=this.onMouseDown,e.mapHandlers.mouseup=this.onMouseUp,e.documentHandlers.keypress=this.onKeypress,e.documentHandlers.keydown=this.onKeyDown});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,ut(e,pt,nt()),er(e,{id:"edit-polygon-fill",source:pt,filter:tr,color:"red",opacity:["case",["boolean",["get","hover"],"false"],1,.5]}),Nt(e,{id:"edit-polygon-lines",source:pt,filter:nr,color:"black",width:8,opacity:.5}),mn(e,{id:"edit-polygon-vertices",source:pt,filter:rr,color:Jt.hovering,radius:ki,opacity:["case",["boolean",["get","hover"],"false"],1,.5]})}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)}tearDown(){this.map.removeLayer("edit-polygon-vertices"),this.map.removeLayer("edit-polygon-fill"),this.map.removeLayer("edit-polygon-lines"),this.map.removeSource(pt)}startNew(){this.setActivity(!0),this.map.doubleClickZoom.disable()}editExisting(e){this.setActivity(!0),this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}setActivity(e){this.active=e,Ut.set(e)}stop(){this.map.getCanvas().style.cursor="inherit",this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.setActivity(!1),this.hover=null,this.dragFrom=null,this.redraw()}redraw(){let e=nt();this.points.forEach((i,o)=>{let s=Gt(i);s.properties.hover=this.hover==o,s.properties.idx=o,e.features.push(s)}),e.features=e.features.concat(Ir(this.points));let t=this.polygonFeature();t&&(t.properties.hover=this.hover=="polygon",e.features.push(t)),this.map.getSource(pt).setData(e);let n="crosshair";this.hover!=null&&(n=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=n}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=Gt(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(Yt),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:{}}}}function Ir(r){let e=[];for(let t=0;t=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[r[r.length-1],r[0]]},properties:{}}),e}function cl(r){let e;return{c(){e=$("ul"),e.innerHTML="

  • Click the map to add a vertex
  • Click a vertex to delete it
  • Drag a vertex or the polygon to move it
  • Press Enter or double click to finish
  • Press Escape to cancel
  • "},m(t,n){k(t,e,n)},p:G,d(t){t&&S(e)}}}function pl(r){let e,t,n,i,o,s,a,l,u;return e=new yt({props:{label:"Help",$$slots:{default:[cl]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("div"),i=$("button"),i.textContent="Finish",o=A(),s=$("button"),s.textContent="Cancel",x(i,"type","button"),x(s,"type","button"),Ae(n,"display","flex"),Ae(n,"justify-content","space-between")},m(f,c){P(e,f,c),k(f,t,c),k(f,n,c),E(n,i),E(n,o),E(n,s),a=!0,l||(u=[Y(i,"click",r[1]),Y(s,"click",r[2])],l=!0)},p(f,[c]){const p={};c&8&&(p.$$scope={dirty:c,ctx:f}),e.$set(p)},i(f){a||(M(e.$$.fragment,f),a=!0)},o(f){C(e.$$.fragment,f),a=!1},d(f){f&&(S(t),S(n)),N(e,f),l=!1,Ie(u)}}}function dl(r,e,t){let{polygonTool:n}=e;const i=()=>n.finish(),o=()=>n.cancel();return r.$$set=s=>{"polygonTool"in s&&t(0,n=s.polygonTool)},[n,i,o]}class ji extends ee{constructor(e){super(),te(this,e,dl,pl,ne,{polygonTool:0})}}let K;const ze=new Array(32).fill(void 0);ze.push(void 0,null,!0,!1);function Q(r){return ze[r]}let Rt=ze.length;function hl(r){r<36||(ze[r]=Rt,Rt=r)}function Jn(r){const e=Q(r);return hl(r),e}const Ui=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Ui.decode();let Vt=new Uint8Array;function xt(){return Vt.byteLength===0&&(Vt=new Uint8Array(K.memory.buffer)),Vt}function lt(r,e){return Ui.decode(xt().subarray(r,r+e))}function $e(r){Rt===ze.length&&ze.push(ze.length+1);const e=Rt;return Rt=ze[e],ze[e]=r,e}function $n(r){return r==null}let Kt=new Float64Array;function gl(){return Kt.byteLength===0&&(Kt=new Float64Array(K.memory.buffer)),Kt}let Zt=new Int32Array;function ke(){return Zt.byteLength===0&&(Zt=new Int32Array(K.memory.buffer)),Zt}let Ze=0;const Qt=new TextEncoder("utf-8"),_l=typeof Qt.encodeInto=="function"?function(r,e){return Qt.encodeInto(r,e)}:function(r,e){const t=Qt.encode(r);return e.set(t),{read:r.length,written:t.length}};function qt(r,e,t){if(t===void 0){const a=Qt.encode(r),l=e(a.length);return xt().subarray(l,l+a.length).set(a),Ze=a.length,l}let n=r.length,i=e(n);const o=xt();let s=0;for(;s127)break;o[i+s]=a}if(s!==n){s!==0&&(r=r.slice(s)),i=t(i,n,n=s+r.length*3);const a=xt().subarray(i+s,i+n),l=_l(r,a);s+=l.written}return Ze=s,i}function Xn(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){const i=r.length;let o="[";i>0&&(o+=Xn(r[0]));for(let s=1;s1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} +${r.stack}`:n}function ml(r,e){const t=e(r.length*1);return xt().set(r,t/1),Ze=r.length,t}function Cn(r,e){try{return r.apply(this,e)}catch(t){K.__wbindgen_exn_store($e(t))}}class hn{static __wrap(e){const t=Object.create(hn.prototype);return t.ptr=e,t}__destroy_into_raw(){const e=this.ptr;return this.ptr=0,e}free(){const e=this.__destroy_into_raw();K.__wbg_jsroutesnapper_free(e)}constructor(e){try{const o=K.__wbindgen_add_to_stack_pointer(-16),s=ml(e,K.__wbindgen_malloc),a=Ze;K.jsroutesnapper_new(o,s,a);var t=ke()[o/4+0],n=ke()[o/4+1],i=ke()[o/4+2];if(i)throw Jn(n);return hn.__wrap(t)}finally{K.__wbindgen_add_to_stack_pointer(16)}}setConfig(e){K.jsroutesnapper_setConfig(this.ptr,$e(e))}getConfig(){try{const n=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_getConfig(n,this.ptr);var e=ke()[n/4+0],t=ke()[n/4+1];return lt(e,t)}finally{K.__wbindgen_add_to_stack_pointer(16),K.__wbindgen_free(e,t)}}toFinalFeature(){try{const n=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_toFinalFeature(n,this.ptr);var e=ke()[n/4+0],t=ke()[n/4+1];let i;return e!==0&&(i=lt(e,t).slice(),K.__wbindgen_free(e,t*1)),i}finally{K.__wbindgen_add_to_stack_pointer(16)}}renderGeojson(){try{const n=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_renderGeojson(n,this.ptr);var e=ke()[n/4+0],t=ke()[n/4+1];return lt(e,t)}finally{K.__wbindgen_add_to_stack_pointer(16),K.__wbindgen_free(e,t)}}setSnapMode(e){K.jsroutesnapper_setSnapMode(this.ptr,e)}onMouseMove(e,t,n){return K.jsroutesnapper_onMouseMove(this.ptr,e,t,n)!==0}onClick(){K.jsroutesnapper_onClick(this.ptr)}onDragStart(){return K.jsroutesnapper_onDragStart(this.ptr)!==0}onMouseUp(){return K.jsroutesnapper_onMouseUp(this.ptr)!==0}clearState(){K.jsroutesnapper_clearState(this.ptr)}editExisting(e){try{const i=K.__wbindgen_add_to_stack_pointer(-16);K.jsroutesnapper_editExisting(i,this.ptr,$e(e));var t=ke()[i/4+0],n=ke()[i/4+1];if(n)throw Jn(t)}finally{K.__wbindgen_add_to_stack_pointer(16)}}}async function bl(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.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",n);else throw n}const t=await r.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}}function yl(){const r={};return r.wbg={},r.wbg.__wbindgen_object_drop_ref=function(e){Jn(e)},r.wbg.__wbindgen_boolean_get=function(e){const t=Q(e);return typeof t=="boolean"?t?1:0:2},r.wbg.__wbindgen_error_new=function(e,t){const n=new Error(lt(e,t));return $e(n)},r.wbg.__wbindgen_string_new=function(e,t){const n=lt(e,t);return $e(n)},r.wbg.__wbindgen_is_object=function(e){const t=Q(e);return typeof t=="object"&&t!==null},r.wbg.__wbindgen_is_undefined=function(e){return Q(e)===void 0},r.wbg.__wbindgen_in=function(e,t){return Q(e)in Q(t)},r.wbg.__wbindgen_number_get=function(e,t){const n=Q(t),i=typeof n=="number"?n:void 0;gl()[e/8+1]=$n(i)?0:i,ke()[e/4+0]=!$n(i)},r.wbg.__wbindgen_jsval_loose_eq=function(e,t){return Q(e)==Q(t)},r.wbg.__wbindgen_string_get=function(e,t){const n=Q(t),i=typeof n=="string"?n:void 0;var o=$n(i)?0:qt(i,K.__wbindgen_malloc,K.__wbindgen_realloc),s=Ze;ke()[e/4+1]=s,ke()[e/4+0]=o},r.wbg.__wbg_String_91fba7ded13ba54c=function(e,t){const n=String(Q(t)),i=qt(n,K.__wbindgen_malloc,K.__wbindgen_realloc),o=Ze;ke()[e/4+1]=o,ke()[e/4+0]=i},r.wbg.__wbindgen_object_clone_ref=function(e){const t=Q(e);return $e(t)},r.wbg.__wbg_getwithrefkey_15c62c2b8546208d=function(e,t){const n=Q(e)[Q(t)];return $e(n)},r.wbg.__wbg_debug_f15cb542ea509609=function(e){console.debug(Q(e))},r.wbg.__wbg_error_ef9a0be47931175f=function(e){console.error(Q(e))},r.wbg.__wbg_info_2874fdd5393f35ce=function(e){console.info(Q(e))},r.wbg.__wbg_log_4b5638ad60bdc54a=function(e){console.log(Q(e))},r.wbg.__wbg_warn_58110c4a199df084=function(e){console.warn(Q(e))},r.wbg.__wbg_get_57245cc7d7c7619d=function(e,t){const n=Q(e)[t>>>0];return $e(n)},r.wbg.__wbg_length_6e3bbe7c8bd4dbd8=function(e){return Q(e).length},r.wbg.__wbindgen_is_function=function(e){return typeof Q(e)=="function"},r.wbg.__wbg_next_579e583d33566a86=function(e){const t=Q(e).next;return $e(t)},r.wbg.__wbg_next_aaef7c8aa5e212ac=function(){return Cn(function(e){const t=Q(e).next();return $e(t)},arguments)},r.wbg.__wbg_done_1b73b0672e15f234=function(e){return Q(e).done},r.wbg.__wbg_value_1ccc36bc03462d71=function(e){const t=Q(e).value;return $e(t)},r.wbg.__wbg_iterator_6f9d4f28845f426c=function(){return $e(Symbol.iterator)},r.wbg.__wbg_get_765201544a2b6869=function(){return Cn(function(e,t){const n=Reflect.get(Q(e),Q(t));return $e(n)},arguments)},r.wbg.__wbg_call_97ae9d8645dc388b=function(){return Cn(function(e,t){const n=Q(e).call(Q(t));return $e(n)},arguments)},r.wbg.__wbg_isArray_27c46c67f498e15d=function(e){return Array.isArray(Q(e))},r.wbg.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b=function(e){let t;try{t=Q(e)instanceof ArrayBuffer}catch{t=!1}return t},r.wbg.__wbg_buffer_3f3d764d4747d564=function(e){const t=Q(e).buffer;return $e(t)},r.wbg.__wbg_new_8c3f0052272a457a=function(e){const t=new Uint8Array(Q(e));return $e(t)},r.wbg.__wbg_set_83db9690f9353e79=function(e,t,n){Q(e).set(Q(t),n>>>0)},r.wbg.__wbg_length_9e1ae1900cb0fbd5=function(e){return Q(e).length},r.wbg.__wbg_instanceof_Uint8Array_971eeda69eb75003=function(e){let t;try{t=Q(e)instanceof Uint8Array}catch{t=!1}return t},r.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return $e(e)},r.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const n=Q(t).stack,i=qt(n,K.__wbindgen_malloc,K.__wbindgen_realloc),o=Ze;ke()[e/4+1]=o,ke()[e/4+0]=i},r.wbg.__wbg_error_f851667af71bcfc6=function(e,t){try{console.error(lt(e,t))}finally{K.__wbindgen_free(e,t)}},r.wbg.__wbindgen_debug_string=function(e,t){const n=Xn(Q(t)),i=qt(n,K.__wbindgen_malloc,K.__wbindgen_realloc),o=Ze;ke()[e/4+1]=o,ke()[e/4+0]=i},r.wbg.__wbindgen_throw=function(e,t){throw new Error(lt(e,t))},r.wbg.__wbindgen_memory=function(){const e=K.memory;return $e(e)},r}function vl(r,e){return K=r.exports,zi.__wbindgen_wasm_module=e,Kt=new Float64Array,Zt=new Int32Array,Vt=new Uint8Array,K}async function zi(r){typeof r>"u"&&(r="/atip/capitalize_auto_form/assets/route_snapper_bg.wasm");const e=yl();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:t,module:n}=await bl(await r,e);return vl(t,n)}const St="route-snapper",Fr=10,wl=30;class kl{constructor(e,t,n){J(this,"map");J(this,"inner");J(this,"active");J(this,"eventListenersSuccess");J(this,"eventListenersUpdated");J(this,"eventListenersFailure");J(this,"onMouseMove",e=>{if(!this.active)return;const t=[e.point.x-wl,e.point.y],n=this.map.unproject(e.point).distanceTo(this.map.unproject(t));this.inner.onMouseMove(e.lngLat.lng,e.lngLat.lat,n)&&(this.redraw(),this.dataUpdated())});J(this,"onClick",()=>{this.active&&(this.inner.onClick(),this.redraw(),this.dataUpdated())});J(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.inner.onClick(),this.finish())});J(this,"onDragStart",()=>{this.active&&this.inner.onDragStart()&&this.map.dragPan.disable()});J(this,"onMouseUp",()=>{this.active&&this.inner.onMouseUp()&&this.map.dragPan.enable()});J(this,"onKeyPress",e=>{this.active&&e.key=="Enter"&&(e.preventDefault(),this.finish())});J(this,"onKeyDown",e=>{this.active&&(e.key=="Shift"?(e.preventDefault(),this.inner.setSnapMode(!1),this.redraw()):e.key=="Escape"&&(e.preventDefault(),this.cancel()))});J(this,"onKeyUp",e=>{this.active&&e.key=="Shift"&&(e.preventDefault(),this.inner.setSnapMode(!0),this.redraw())});J(this,"setHandlers",e=>{e.mapHandlers.mousemove=this.onMouseMove,e.mapHandlers.click=this.onClick,e.mapHandlers.dblclick=this.onDoubleClick,e.mapHandlers.dragstart=this.onDragStart,e.mapHandlers.mouseup=this.onMouseUp,e.documentHandlers.keypress=this.onKeyPress,e.documentHandlers.keydown=this.onKeyDown,e.documentHandlers.keyup=this.onKeyUp});this.map=e,console.time("Deserialize and setup JsRouteSnapper"),this.inner=new hn(t),console.timeEnd("Deserialize and setup JsRouteSnapper"),this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],ut(e,St,nt()),mn(e,{id:"route-points",source:St,filter:rr,color:["match",["get","type"],"hovered","green","important","red","black"],radius:["match",["get","type"],"unimportant",Fr/2,Fr]}),Nt(e,{id:"route-lines",source:St,filter:nr,color:"black",width:2.5}),er(e,{id:"route-polygons",source:St,filter:tr,color:"black",opacity:.5}),n()}startRoute(){this.active||(this.setActivity(!0),this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}startArea(){this.active||(this.inner.setConfig({avoid_doubling_back:!0,area_mode:!0,extend_route:!0}),this.setActivity(!0),this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}setActivity(e){this.active=e,Ut.set(e)}stop(){this.setActivity(!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()}tearDown(){this.map.removeLayer("route-points"),this.map.removeLayer("route-lines"),this.map.removeLayer("route-polygons"),this.map.removeSource("route-snapper")}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}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.setConfig({...e,area_mode:!1}),this.redraw()}redraw(){this.map.getSource(St).setData(JSON.parse(this.inner.renderGeojson()))}dataUpdated(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersUpdated)t(JSON.parse(e))}}function Sl(r){let e;return{c(){e=$("ul"),e.innerHTML="
  • Click green points on the transport network to create snapped routes
  • Hold Shift to draw a point anywhere
  • Click and drag any point to move it
  • Click a red waypoint to delete it
  • Press Enter or double click to finish
  • Press Escape to cancel
  • "},m(t,n){k(t,e,n)},p:G,d(t){t&&S(e)}}}function El(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y,_,h,d,b;return e=new yt({props:{label:"Help",$$slots:{default:[Sl]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("label"),i=$("input"),o=U(` + Add points to end`),s=A(),a=$("br"),l=A(),u=$("label"),f=$("input"),c=U(` + Avoid doubling back`),p=A(),g=$("div"),v=$("button"),v.textContent="Finish",y=A(),_=$("button"),_.textContent="Cancel",x(i,"type","checkbox"),x(n,"title","Keep clicking to add more points to the end of the route"),x(f,"type","checkbox"),x(u,"title","Try to make the route avoid using the same streets with multiple waypoints"),x(v,"type","button"),x(_,"type","button"),Ae(g,"display","flex"),Ae(g,"justify-content","space-between")},m(m,w){P(e,m,w),k(m,t,w),k(m,n,w),E(n,i),i.checked=r[0],E(n,o),k(m,s,w),k(m,a,w),k(m,l,w),k(m,u,w),E(u,f),f.checked=r[2].avoidDoublingBack,E(u,c),k(m,p,w),k(m,g,w),E(g,v),E(g,y),E(g,_),h=!0,d||(b=[Y(i,"change",r[3]),Y(f,"change",r[4]),Y(v,"click",r[5]),Y(_,"click",r[6])],d=!0)},p(m,[w]){const L={};w&128&&(L.$$scope={dirty:w,ctx:m}),e.$set(L),w&1&&(i.checked=m[0]),w&4&&(f.checked=m[2].avoidDoublingBack)},i(m){h||(M(e.$$.fragment,m),h=!0)},o(m){C(e.$$.fragment,m),h=!1},d(m){m&&(S(t),S(n),S(s),S(a),S(l),S(u),S(p),S(g)),N(e,m),d=!1,Ie(b)}}}function Ml(r,e,t){let n;W(r,At,f=>t(2,n=f));let{routeTool:i}=e,{extendRoute:o}=e;function s(){o=this.checked,t(0,o)}function a(){n.avoidDoublingBack=this.checked,At.set(n)}const l=()=>i.finish(),u=()=>i.cancel();return r.$$set=f=>{"routeTool"in f&&t(1,i=f.routeTool),"extendRoute"in f&&t(0,o=f.extendRoute)},r.$$.update=()=>{r.$$.dirty&7&&i.setRouteConfig({avoid_doubling_back:n.avoidDoublingBack,extend_route:o})},[o,i,n,s,a,l,u]}class qi extends ee{constructor(e){super(),te(this,e,Ml,El,ne,{routeTool:1,extendRoute:0})}}function $l(r){let e;return{c(){e=$("ul"),e.innerHTML="
  • Click green points on the transport network to create snapped routes
  • Click and drag any point to move it
  • Click a red waypoint to delete it
  • Press Enter or double click to finish
  • Press Escape to cancel
  • "},m(t,n){k(t,e,n)},p:G,d(t){t&&S(e)}}}function Cl(r){let e,t,n,i,o,s,a,l,u;return e=new yt({props:{label:"Help",$$slots:{default:[$l]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment),t=A(),n=$("div"),i=$("button"),i.textContent="Finish",o=A(),s=$("button"),s.textContent="Cancel",x(i,"type","button"),x(s,"type","button"),Ae(n,"display","flex"),Ae(n,"justify-content","space-between")},m(f,c){P(e,f,c),k(f,t,c),k(f,n,c),E(n,i),E(n,o),E(n,s),a=!0,l||(u=[Y(i,"click",r[1]),Y(s,"click",r[2])],l=!0)},p(f,[c]){const p={};c&8&&(p.$$scope={dirty:c,ctx:f}),e.$set(p)},i(f){a||(M(e.$$.fragment,f),a=!0)},o(f){C(e.$$.fragment,f),a=!1},d(f){f&&(S(t),S(n)),N(e,f),l=!1,Ie(u)}}}function Ll(r,e,t){let{routeTool:n}=e;const i=()=>n.finish(),o=()=>n.cancel();return r.$$set=s=>{"routeTool"in s&&t(0,n=s.routeTool)},[n,i,o]}class Gi extends ee{constructor(e){super(),te(this,e,Ll,Cl,ne,{routeTool:0})}}function Pr(r){let e,t,n,i;const o=[xl,Rl,Ol,Al,Tl],s=[];function a(l,u){return l[4]=="point"?0:l[4]=="free-polygon"?1:l[4]=="snap-polygon"?2:l[4]=="route"?3:4}return e=a(r),t=s[e]=o[e](r),{c(){t.c(),n=be()},m(l,u){s[e].m(l,u),k(l,n,u),i=!0},p(l,u){let f=e;e=a(l),e===f?s[e].p(l,u):(pe(),C(s[f],1,1,()=>{s[f]=null}),de(),t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),M(t,1),t.m(n.parentNode,n))},i(l){i||(M(t),i=!0)},o(l){C(t),i=!1},d(l){l&&S(n),s[e].d(l)}}}function Tl(r){let e,t,n=bt(r[0])+"",i,o;return{c(){e=$("p"),t=U("Click "),i=U(n),o=U(" to edit its geometry")},m(s,a){k(s,e,a),E(e,t),E(e,i),E(e,o)},p(s,a){a&1&&n!==(n=bt(s[0])+"")&&Le(i,n)},i:G,o:G,d(s){s&&S(e)}}}function Al(r){let e,t;return e=new qi({props:{routeTool:r[3],extendRoute:!1}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&8&&(o.routeTool=n[3]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Ol(r){let e,t;return e=new Gi({props:{routeTool:r[3]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&8&&(o.routeTool=n[3]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Rl(r){let e,t;return e=new ji({props:{polygonTool:r[2]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&4&&(o.polygonTool=n[2]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function xl(r){let e,t;return e=new Ii({props:{pointTool:r[1],editingExisting:!0}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&2&&(o.pointTool=n[1]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Il(r){let e,t,n=r[5]==It&&Pr(r);return{c(){n&&n.c(),e=be()},m(i,o){n&&n.m(i,o),k(i,e,o),t=!0},p(i,[o]){i[5]==It?n?(n.p(i,o),o&32&&M(n,1)):(n=Pr(i),n.c(),M(n,1),n.m(e.parentNode,e)):n&&(pe(),C(n,1,1,()=>{n=null}),de())},i(i){t||(M(n),t=!0)},o(i){C(n),t=!1},d(i){i&&S(e),n&&n.d(i)}}}const It="edit-geometry";function Yi(){}function Nr(r,e){r.geometry=e.geometry,e.properties.length_meters&&(r.properties.length_meters=e.properties.length_meters),e.properties.waypoints&&(r.properties.waypoints=e.properties.waypoints)}function Fl(r,e,t){let n,i;W(r,Ue,_=>t(11,n=_)),W(r,Ce,_=>t(5,i=_));let{schema:o}=e,{pointTool:s}=e,{polygonTool:a}=e,{routeTool:l}=e,{eventHandler:u}=e,f=null,c=null,p=null;function g(){f&&(s.stop(),a.stop(),l.stop(),ce.update(_=>{let h=_.features.find(d=>d.id==f);return h?(delete h.properties.hide_while_editing,p&&Nr(h,p),_):(window.alert("You loaded another file or cleared everything while editing. Your changes were lost."),_)})),y(),Ge.set(null)}for(let _ of[s,a,l])_.addEventListenerSuccess(h=>{i==It&&(ce.update(d=>{let b=d.features.find(m=>m.id==f);return b?(Nr(b,h),delete b.properties.hide_while_editing,d):(window.alert("You loaded another file or cleared everything while editing. Your changes were lost."),d)}),y())});for(let _ of[a,l])_.addEventListenerUpdated(h=>{i==It&&(p=h)});for(let _ of[s,a,l])_.addEventListenerFailure(()=>{i==It&&(ce.update(h=>{let d=h.features.find(b=>b.id==f);return d?(delete d.properties.hide_while_editing,h):(window.alert("You loaded another file or cleared everything while editing. Your changes were lost."),h)}),y())});u.mapHandlers.mousemove=_=>{var h;if(l.onMouseMove(_),s.onMouseMove(_),a.onMouseMove(_),f==null){let d=n.queryRenderedFeatures(_.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});Ge.set(((h=d[0])==null?void 0:h.id)||null)}},u.mapHandlers.mouseout=()=>{f==null&&Ge.set(null)},u.mapHandlers.click=_=>{if(l.onClick(),s.onClick(),a.onClick(_),f==null){let h=n.queryRenderedFeatures(_.point,{layers:["interventions-points","interventions-lines","interventions-polygons"]});h.length>0&&v(h[0].id)}},u.mapHandlers.mousedown=_=>{a.onMouseDown(_)},u.mapHandlers.dblclick=_=>{l.onDoubleClick(_),a.onDoubleClick(_)},u.mapHandlers.dragstart=()=>{l.onDragStart()},u.mapHandlers.mouseup=()=>{l.onMouseUp(),a.onMouseUp()},u.documentHandlers.keypress=_=>{l.onKeyPress(_),a.onKeypress(_)},u.documentHandlers.keydown=_=>{s.onKeyDown(_),a.onKeyDown(_),l.onKeyDown(_)},u.documentHandlers.keyup=_=>{l.onKeyUp(_)};function v(_){Ge.set(null);let h=null;ce.update(b=>(h=b.features.find(m=>m.id==_),h.properties.hide_while_editing=!0,b));let d=h;f=_,d.geometry.type=="LineString"?(l.editExistingRoute(d),t(4,c="route")):d.geometry.type=="Polygon"?d.properties.waypoints?(l.editExistingArea(d),t(4,c="snap-polygon")):(a.editExisting(d),t(4,c="free-polygon")):d.geometry.type=="Point"&&(s.start(),t(4,c="point"))}function y(){f=null,t(4,c=null),p=null}return r.$$set=_=>{"schema"in _&&t(0,o=_.schema),"pointTool"in _&&t(1,s=_.pointTool),"polygonTool"in _&&t(2,a=_.polygonTool),"routeTool"in _&&t(3,l=_.routeTool),"eventHandler"in _&&t(6,u=_.eventHandler)},[o,s,a,l,c,i,u,Yi,g]}class Pl extends ee{constructor(e){super(),te(this,e,Fl,Il,ne,{schema:0,pointTool:1,polygonTool:2,routeTool:3,eventHandler:6,start:7,stop:8})}get start(){return Yi}get stop(){return this.$$.ctx[8]}}function Br(r){let e,t;return e=new Ii({props:{pointTool:r[0],editingExisting:!1}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.pointTool=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Nl(r){let e,t,n=r[1]==gn&&Br(r);return{c(){n&&n.c(),e=be()},m(i,o){n&&n.m(i,o),k(i,e,o),t=!0},p(i,[o]){i[1]==gn?n?(n.p(i,o),o&2&&M(n,1)):(n=Br(i),n.c(),M(n,1),n.m(e.parentNode,e)):n&&(pe(),C(n,1,1,()=>{n=null}),de())},i(i){t||(M(n),t=!0)},o(i){C(n),t=!1},d(i){i&&S(e),n&&n.d(i)}}}const gn="point";function Bl(r,e,t){let n;W(r,Ce,u=>t(1,n=u));let{changeMode:i}=e,{pointTool:o}=e,{eventHandler:s}=e;function a(){o.setHandlers(s),o.start()}function l(){o.stop()}return o.addEventListenerSuccess(u=>{n==gn&&(ce.update(f=>(u.id=wn(f),u.properties.intervention_type="other",f.features.push(u),f)),i("edit-attribute"),xe.set(u.id))}),o.addEventListenerFailure(()=>{n==gn&&i("edit-attribute")}),r.$$set=u=>{"changeMode"in u&&t(2,i=u.changeMode),"pointTool"in u&&t(0,o=u.pointTool),"eventHandler"in u&&t(3,s=u.eventHandler)},[o,n,i,s,a,l]}class Dl extends ee{constructor(e){super(),te(this,e,Bl,Nl,ne,{changeMode:2,pointTool:0,eventHandler:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function fr(r,e,t,n,i){r.addEventListenerSuccess(o=>{st(Ce)==n&&(ce.update(s=>(o.id=wn(s),o.properties.intervention_type=t,s.features.push(o),s)),e.value=null,i("edit-attribute"),xe.set(o.id))}),r.addEventListenerUpdated(o=>{st(Ce)==n&&(e.value=o)}),r.addEventListenerFailure(()=>{st(Ce)==n&&(e.value=null,i("edit-attribute"))})}function cr(r,e){r.value&&(ce.update(t=>{let n=r.value;return n.id=wn(t),n.properties.intervention_type=e,t.features.push(n),t}),r.value=null)}function Dr(r){let e,t;return e=new ji({props:{polygonTool:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.polygonTool=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Hl(r){let e,t,n=r[1]==Wn&&Dr(r);return{c(){n&&n.c(),e=be()},m(i,o){n&&n.m(i,o),k(i,e,o),t=!0},p(i,[o]){i[1]==Wn?n?(n.p(i,o),o&2&&M(n,1)):(n=Dr(i),n.c(),M(n,1),n.m(e.parentNode,e)):n&&(pe(),C(n,1,1,()=>{n=null}),de())},i(i){t||(M(n),t=!0)},o(i){C(n),t=!1},d(i){i&&S(e),n&&n.d(i)}}}const Wn="free-polygon";function jl(r,e,t){let n;W(r,Ce,f=>t(1,n=f));let{changeMode:i}=e,{polygonTool:o}=e,{eventHandler:s}=e,a={value:null};function l(){o.setHandlers(s),o.startNew()}function u(){o.stop(),cr(a,"area")}return fr(o,a,"area",Wn,i),r.$$set=f=>{"changeMode"in f&&t(2,i=f.changeMode),"polygonTool"in f&&t(0,o=f.polygonTool),"eventHandler"in f&&t(3,s=f.eventHandler)},[o,n,i,s,l,u]}class Ul extends ee{constructor(e){super(),te(this,e,jl,Hl,ne,{changeMode:2,polygonTool:0,eventHandler:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function zl(r){let e,t;return e=new qi({props:{routeTool:r[0],extendRoute:!0}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.routeTool=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function ql(r){let e;return{c(){e=$("p"),e.textContent="Failed to load"},m(t,n){k(t,e,n)},p:G,i:G,o:G,d(t){t&&S(e)}}}function Gl(r){let e,t,n;return{c(){e=$("label"),e.textContent="Route data unpacking",t=A(),n=$("progress"),x(e,"for","route-unpacking"),x(n,"id","route-unpacking"),x(n,"class","svelte-q3473n")},m(i,o){k(i,e,o),k(i,t,o),k(i,n,o)},p:G,i:G,o:G,d(i){i&&(S(e),S(t),S(n))}}}function Yl(r){let e,t,n;return{c(){e=$("label"),e.textContent="Route tool loading",t=A(),n=$("progress"),x(e,"for","route-loading"),x(n,"id","route-loading"),n.value=r[1],x(n,"class","svelte-q3473n")},m(i,o){k(i,e,o),k(i,t,o),k(i,n,o)},p(i,o){o&2&&(n.value=i[1])},i:G,o:G,d(i){i&&(S(e),S(t),S(n))}}}function Jl(r){let e,t,n,i;const o=[Yl,Gl,ql,zl],s=[];function a(l,u){return!l[2]&&!l[3]&&!l[4]?0:l[4]&&!l[2]&&!l[3]?1:l[3]?2:l[5]==Ji?3:-1}return~(e=a(r))&&(t=s[e]=o[e](r)),{c(){t&&t.c(),n=be()},m(l,u){~e&&s[e].m(l,u),k(l,n,u),i=!0},p(l,[u]){let f=e;e=a(l),e===f?~e&&s[e].p(l,u):(t&&(pe(),C(s[f],1,1,()=>{s[f]=null}),de()),~e?(t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),M(t,1),t.m(n.parentNode,n)):t=null)},i(l){i||(M(t),i=!0)},o(l){C(t),i=!1},d(l){l&&S(n),~e&&s[e].d(l)}}}const Ji="route";async function Xl(r,e){const t=await fetch(r),n=t.body.getReader(),i=parseInt(t.headers.get("Content-Length"));let o=0,s=[];for(;;){const{done:u,value:f}=await n.read();if(u)break;s.push(f),o+=f.length;const c=100*o/i;e(c)}let a=new Uint8Array(o),l=0;for(let u of s)a.set(u,l),l+=u.length;return a}function Wl(r,e,t){let n,i,o;W(r,Ue,h=>t(11,i=h)),W(r,Ce,h=>t(5,o=h));let{changeMode:s}=e,{url:a}=e,{routeTool:l}=e,{eventHandler:u}=e,f=0,c=!1,p=!1,g={value:null};function v(){l.isActive()||(l.setHandlers(u),l.startRoute())}function y(){l==null||l.stop(),cr(g,"route")}Ht(async()=>{await zi(),console.log(`Grabbing ${a}`);try{const h=await Xl(a,d=>t(1,f=d));t(0,l=new kl(i,h,_))}catch(h){console.log(`Route tool broke: ${h}`),t(3,p=!0);return}fr(l,g,"route",Ji,s)});function _(){t(1,f=100),t(2,c=!0)}return r.$$set=h=>{"changeMode"in h&&t(6,s=h.changeMode),"url"in h&&t(7,a=h.url),"routeTool"in h&&t(0,l=h.routeTool),"eventHandler"in h&&t(8,u=h.eventHandler)},r.$$.update=()=>{r.$$.dirty&2&&t(4,n=f>=100)},[l,f,c,p,n,o,s,a,u,v,y]}class Vl extends ee{constructor(e){super(),te(this,e,Wl,Jl,ne,{changeMode:6,url:7,routeTool:0,eventHandler:8,start:9,stop:10})}get start(){return this.$$.ctx[9]}get stop(){return this.$$.ctx[10]}}function en(r,e){return e===void 0&&(e={}),Mo(r,function(t,n){var i=n.geometry.coordinates;return t+We(i[0],i[1],e)},0)}function Kl(r,e,t){var n=je(t);if(Gn(t)!=="LineString")throw new Error("line must be a LineString");var i=Dt(t,r),o=Dt(t,e),s;i.properties.index<=o.properties.index?s=[i,o]:s=[o,i];for(var a=[s[0].geometry.coordinates],l=s[0].properties.index+1;l=s){var a=(t+i)/2;return[e,a-(n-e)/2,n,a+(n-e)/2]}else{var l=(e+n)/2;return[l-(i-t)/2,t,l+(i-t)/2,i]}}function Ql(r,e){e===void 0&&(e={});var t=e.precision,n=e.coordinates,i=e.mutate;if(t=t==null||isNaN(t)?6:t,n=n==null||isNaN(n)?3:n,!r)throw new Error(" is required");if(typeof t!="number")throw new Error(" must be a number");if(typeof n!="number")throw new Error(" must be a number");(i===!1||i===void 0)&&(r=JSON.parse(JSON.stringify(r)));var o=Math.pow(10,t);return $o(r,function(s){ea(s,o,n)}),r}function ea(r,e,t){r.length>t&&r.splice(t,r.length);for(var n=0;n1&&t.push(mt(f)),et(t)}function Xi(r,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var t,n=1/0;return nn(e,function(i){var o=Dt(i,r),s=o.properties.dist;sClick on a route to split it
  • Click on the map or press Escape to cancel
  • "},m(t,n){k(t,e,n)},p:G,d(t){t&&S(e)}}}function ra(r){let e,t,n=r[0]==Ur&&jr(r);return{c(){n&&n.c(),e=be()},m(i,o){n&&n.m(i,o),k(i,e,o),t=!0},p(i,[o]){i[0]==Ur?n?o&1&&M(n,1):(n=jr(i),n.c(),M(n,1),n.m(e.parentNode,e)):n&&(pe(),C(n,1,1,()=>{n=null}),de())},i(i){t||(M(n),t=!0)},o(i){C(n),t=!1},d(i){i&&S(e),n&&n.d(i)}}}const Ur="split-route",ia=10,oa=30;let Tn="split-route";function sa(r,e,t){let n,i,o;W(r,ce,y=>t(8,n=y)),W(r,Ue,y=>t(6,i=y)),W(r,Ce,y=>t(0,o=y));let{changeMode:s}=e,{eventHandler:a}=e;function l(){i.getCanvas().style.cursor=`url(${Ri}), crosshair`}function u(){i.getCanvas().style.cursor="inherit",t(5,f=null),c=null}let f=null,c=null;ut(i,Tn,nt()),mn(i,{id:"draw-split-route",source:Tn,color:"black",radius:ia}),a.mapHandlers.mousemove=y=>{t(5,f=null),c=null;let _=p(y.lngLat.toArray());const h=[y.point.x-oa,y.point.y],d=i.unproject(y.point).distanceTo(i.unproject(h))/1e3;let b=[];for(let[m,w]of n.features.entries())if(w.geometry.type=="LineString"){let L=Dt(w.geometry,_,{units:"kilometers"});L.properties.dist!=null&&L.properties.dist<=d&&b.push([m,L.geometry.coordinates,L.properties.dist])}b.sort((m,w)=>m[2]-w[2]),b.length>0&&(t(5,f=p(b[0][1])),c=b[0][0])},a.mapHandlers.click=()=>{if(c==null)s("edit-attribute");else{let y=ta(n.features[c],f);if(y.features.length==2){let _=y.features[0],h=y.features[1];_.geometry.coordinates=_.geometry.coordinates.map(Yt),h.geometry.coordinates=h.geometry.coordinates.map(Yt),ce.update(d=>(_.id=d.features[c].id,h.id=wn(d),_.properties=JSON.parse(JSON.stringify(d.features[c].properties)),h.properties=JSON.parse(JSON.stringify(_.properties)),g(d.features[c],_,h,f),d.features.splice(c,1,_,h),d))}t(5,f=null),c=null}},a.documentHandlers.keydown=y=>{y.key=="Escape"&&(s("edit-attribute"),y.preventDefault())};function p(y){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:Yt(y)}}}function g(y,_,h,d){_.properties.length_meters=en(_,{units:"kilometers"})*1e3,h.properties.length_meters=en(h,{units:"kilometers"})*1e3,_.properties.waypoints=[],h.properties.waypoints=[];let b=v(y,d),m=!0,w=0;for(let L of y.properties.waypoints){let O=v(y,_t([L.lon,L.lat]));if(m)if(O{"changeMode"in y&&t(2,s=y.changeMode),"eventHandler"in y&&t(1,a=y.eventHandler)},r.$$.update=()=>{if(r.$$.dirty&96){let y=nt();f&&y.features.push(f),i.getSource(Tn).setData(y)}},[o,a,s,l,u,f,i]}class la extends ee{constructor(e){super(),te(this,e,sa,ra,ne,{changeMode:2,eventHandler:1,start:3,stop:4})}get start(){return this.$$.ctx[3]}get stop(){return this.$$.ctx[4]}}function aa(r){let e,t,n,i,o,s,a,l;return{c(){e=$("button"),t=$("img"),i=A(),o=U(r[1]),In(t.src,n=r[2])||x(t,"src",n),x(t,"alt",r[1]),x(t,"class","svelte-1vvpkg9"),x(e,"type","button"),e.disabled=s=r[4]==r[0],x(e,"class","svelte-1vvpkg9")},m(u,f){k(u,e,f),E(e,t),E(e,i),E(e,o),a||(l=Y(e,"click",r[5]),a=!0)},p(u,[f]){f&4&&!In(t.src,n=u[2])&&x(t,"src",n),f&2&&x(t,"alt",u[1]),f&2&&Le(o,u[1]),f&17&&s!==(s=u[4]==u[0])&&(e.disabled=s)},i:G,o:G,d(u){u&&S(e),a=!1,l()}}}function ua(r,e,t){let n;W(r,Ce,u=>t(4,n=u));let{thisMode:i}=e,{label:o}=e,{icon:s}=e,{changeMode:a}=e;const l=()=>a(i);return r.$$set=u=>{"thisMode"in u&&t(0,i=u.thisMode),"label"in u&&t(1,o=u.label),"icon"in u&&t(2,s=u.icon),"changeMode"in u&&t(3,a=u.changeMode)},[i,o,s,a,n,l]}class Ve extends ee{constructor(e){super(),te(this,e,ua,aa,ne,{thisMode:0,label:1,icon:2,changeMode:3})}}function zr(r){let e,t;return e=new Gi({props:{routeTool:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.routeTool=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function fa(r){let e,t,n=r[1]==Kn&&zr(r);return{c(){n&&n.c(),e=be()},m(i,o){n&&n.m(i,o),k(i,e,o),t=!0},p(i,[o]){i[1]==Kn?n?(n.p(i,o),o&2&&M(n,1)):(n=zr(i),n.c(),M(n,1),n.m(e.parentNode,e)):n&&(pe(),C(n,1,1,()=>{n=null}),de())},i(i){t||(M(n),t=!0)},o(i){C(n),t=!1},d(i){i&&S(e),n&&n.d(i)}}}const Kn="snap-polygon";function ca(r,e,t){let n;W(r,Ce,f=>t(1,n=f));let{changeMode:i}=e,{routeTool:o}=e,{eventHandler:s}=e,a={value:null};function l(){o.setHandlers(s),o.startArea()}function u(){o.stop(),cr(a,"area")}return fr(o,a,"area",Kn,i),r.$$set=f=>{"changeMode"in f&&t(2,i=f.changeMode),"routeTool"in f&&t(0,o=f.routeTool),"eventHandler"in f&&t(3,s=f.eventHandler)},[o,n,i,s,l,u]}class pa extends ee{constructor(e){super(),te(this,e,ca,fa,ne,{changeMode:2,routeTool:0,eventHandler:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function qr(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y;return c=new yt({props:{label:"Help",$$slots:{default:[da]},$$scope:{ctx:r}}}),g=jt(r[7][0]),{c(){e=$("label"),t=$("input"),n=U(` + Google Street View`),i=A(),o=$("br"),s=A(),a=$("label"),l=$("input"),u=U(` + Bing Streetside`),f=A(),F(c.$$.fragment),x(t,"type","radio"),t.__value="google",fe(t,t.__value),x(l,"type","radio"),l.__value="bing",fe(l,l.__value),g.p(t,l)},m(_,h){k(_,e,h),E(e,t),t.checked=t.__value===r[0].streetViewImagery,E(e,n),k(_,i,h),k(_,o,h),k(_,s,h),k(_,a,h),E(a,l),l.checked=l.__value===r[0].streetViewImagery,E(a,u),k(_,f,h),P(c,_,h),p=!0,v||(y=[Y(t,"change",r[6]),Y(l,"change",r[8])],v=!0)},p(_,h){h&1&&(t.checked=t.__value===_[0].streetViewImagery),h&1&&(l.checked=l.__value===_[0].streetViewImagery);const d={};h&1024&&(d.$$scope={dirty:h,ctx:_}),c.$set(d)},i(_){p||(M(c.$$.fragment,_),p=!0)},o(_){C(c.$$.fragment,_),p=!1},d(_){_&&(S(e),S(i),S(o),S(s),S(a),S(f)),N(c,_),g.r(),v=!1,Ie(y)}}}function da(r){let e;return{c(){e=$("ul"),e.innerHTML="
  • Click on the map to open a new tab with a 3rd-party imagery provider
  • Press Escape to exit this mode
  • "},m(t,n){k(t,e,n)},p:G,d(t){t&&S(e)}}}function ha(r){let e,t,n=r[1]==Gr&&qr(r);return{c(){n&&n.c(),e=be()},m(i,o){n&&n.m(i,o),k(i,e,o),t=!0},p(i,[o]){i[1]==Gr?n?(n.p(i,o),o&2&&M(n,1)):(n=qr(i),n.c(),M(n,1),n.m(e.parentNode,e)):n&&(pe(),C(n,1,1,()=>{n=null}),de())},i(i){t||(M(n),t=!0)},o(i){C(n),t=!1},d(i){i&&S(e),n&&n.d(i)}}}const Gr="street-view";function ga(r,e,t){let n,i,o;W(r,At,g=>t(0,n=g)),W(r,Ue,g=>t(9,i=g)),W(r,Ce,g=>t(1,o=g));let{eventHandler:s}=e,{changeMode:a}=e;function l(){i.getCanvas().style.cursor="zoom-in"}function u(){i.getCanvas().style.cursor="inherit"}s.mapHandlers.click=g=>{let v=g.lngLat.lng,y=g.lngLat.lat;n.streetViewImagery=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${y},${v}&cbp=11,0,0,0,0`,"_blank"):n.streetViewImagery=="bing"&&window.open(`https://www.bing.com/maps?cp=${y}~${v}&style=x`,"_blank")},s.documentHandlers.keydown=g=>{g.key=="Escape"&&(a("edit-attribute"),g.preventDefault())};const f=[[]];function c(){n.streetViewImagery=this.__value,At.set(n)}function p(){n.streetViewImagery=this.__value,At.set(n)}return r.$$set=g=>{"eventHandler"in g&&t(2,s=g.eventHandler),"changeMode"in g&&t(3,a=g.changeMode)},[n,o,s,a,l,u,c,f,p]}class _a extends ee{constructor(e){super(),te(this,e,ga,ha,ne,{eventHandler:2,changeMode:3,start:4,stop:5})}get start(){return this.$$.ctx[4]}get stop(){return this.$$.ctx[5]}}function Yr(r){let e,t,n={schema:r[1],pointTool:r[11],polygonTool:r[12],routeTool:r[2],eventHandler:r[13]["edit-geometry"]};return e=new Pl({props:n}),r[16](e),{c(){F(e.$$.fragment)},m(i,o){P(e,i,o),t=!0},p(i,o){const s={};o&2&&(s.schema=i[1]),o&4&&(s.routeTool=i[2]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){C(e.$$.fragment,i),t=!1},d(i){r[16](null),N(e,i)}}}function Jr(r){let e,t;return e=new Ve({props:{thisMode:"point",label:"New point",icon:Bs,changeMode:r[14]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:G,i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Xr(r){let e,t,n={changeMode:r[14],routeTool:r[2],eventHandler:r[13]["snap-polygon"]};return e=new pa({props:n}),r[19](e),{c(){F(e.$$.fragment)},m(i,o){P(e,i,o),t=!0},p(i,o){const s={};o&4&&(s.routeTool=i[2]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){C(e.$$.fragment,i),t=!1},d(i){r[19](null),N(e,i)}}}function Wr(r){let e,t;return e=new Ve({props:{thisMode:"route",label:"New route",icon:js,changeMode:r[14]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:G,i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Vr(r){let e,t;return e=new Ve({props:{thisMode:"split-route",label:"Split route",icon:Ri,changeMode:r[14]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:G,i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function ma(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y,_,h,d,b,m,w,L,O,R,I,B,D,j,T,z,ue,he,Se,Ee,_e,me,Te;n=new Ve({props:{thisMode:"edit-attribute",label:"Edit attributes",icon:Ps,changeMode:r[14]}});let se={schema:r[1],changeMode:r[14],eventHandler:r[13]["edit-attribute"]};o=new Js({props:se}),r[15](o),l=new Ve({props:{thisMode:"edit-geometry",label:"Edit geometry",icon:Ns,changeMode:r[14]}});let H=r[2]&&Yr(r),Z=r[1]!="planning"&&Jr(r),Ye={changeMode:r[14],pointTool:r[11],eventHandler:r[13].point};g=new Dl({props:Ye}),r[17](g),_=new Ve({props:{thisMode:"free-polygon",label:"New polygon (freehand)",icon:Ds,changeMode:r[14]}});let it={changeMode:r[14],polygonTool:r[12],eventHandler:r[13]["free-polygon"]};d=new Ul({props:it}),r[18](d),w=new Ve({props:{thisMode:"snap-polygon",label:"New polygon (snapped)",icon:Hs,changeMode:r[14]}});let le=r[2]&&Xr(r),ie=r[1]!="planning"&&Wr(r);function V(q){r[21](q)}let oe={changeMode:r[14],url:r[0],eventHandler:r[13].route};r[2]!==void 0&&(oe.routeTool=r[2]),B=new Vl({props:oe}),r[20](B),ae.push(()=>ve(B,"routeTool",V));let Me=r[1]!="planning"&&Vr(r),so={changeMode:r[14],eventHandler:r[13]["split-route"]};ue=new la({props:so}),r[22](ue),Ee=new Ve({props:{thisMode:"street-view",label:"Street View",icon:Us,changeMode:r[14]}});let lo={changeMode:r[14],eventHandler:r[13]["street-view"]};return me=new _a({props:lo}),r[23](me),{c(){e=$("div"),t=$("div"),F(n.$$.fragment),i=A(),F(o.$$.fragment),s=A(),a=$("div"),F(l.$$.fragment),u=A(),H&&H.c(),f=A(),c=$("div"),Z&&Z.c(),p=A(),F(g.$$.fragment),v=A(),y=$("div"),F(_.$$.fragment),h=A(),F(d.$$.fragment),b=A(),m=$("div"),F(w.$$.fragment),L=A(),le&&le.c(),O=A(),R=$("div"),ie&&ie.c(),I=A(),F(B.$$.fragment),j=A(),T=$("div"),Me&&Me.c(),z=A(),F(ue.$$.fragment),he=A(),Se=$("div"),F(Ee.$$.fragment),_e=A(),F(me.$$.fragment),x(e,"class","toolbox svelte-4s4d3o")},m(q,Oe){k(q,e,Oe),E(e,t),P(n,t,null),E(t,i),P(o,t,null),E(e,s),E(e,a),P(l,a,null),E(a,u),H&&H.m(a,null),E(e,f),E(e,c),Z&&Z.m(c,null),E(c,p),P(g,c,null),E(e,v),E(e,y),P(_,y,null),E(y,h),P(d,y,null),E(e,b),E(e,m),P(w,m,null),E(m,L),le&&le.m(m,null),E(e,O),E(e,R),ie&&ie.m(R,null),E(R,I),P(B,R,null),E(e,j),E(e,T),Me&&Me.m(T,null),E(T,z),P(ue,T,null),E(e,he),E(e,Se),P(Ee,Se,null),E(Se,_e),P(me,Se,null),Te=!0},p(q,[Oe]){const pr={};Oe&2&&(pr.schema=q[1]),o.$set(pr),q[2]?H?(H.p(q,Oe),Oe&4&&M(H,1)):(H=Yr(q),H.c(),M(H,1),H.m(a,null)):H&&(pe(),C(H,1,1,()=>{H=null}),de()),q[1]!="planning"?Z?(Z.p(q,Oe),Oe&2&&M(Z,1)):(Z=Jr(q),Z.c(),M(Z,1),Z.m(c,p)):Z&&(pe(),C(Z,1,1,()=>{Z=null}),de());const ao={};g.$set(ao);const uo={};d.$set(uo),q[2]?le?(le.p(q,Oe),Oe&4&&M(le,1)):(le=Xr(q),le.c(),M(le,1),le.m(m,null)):le&&(pe(),C(le,1,1,()=>{le=null}),de()),q[1]!="planning"?ie?(ie.p(q,Oe),Oe&2&&M(ie,1)):(ie=Wr(q),ie.c(),M(ie,1),ie.m(R,I)):ie&&(pe(),C(ie,1,1,()=>{ie=null}),de());const Sn={};Oe&1&&(Sn.url=q[0]),!D&&Oe&4&&(D=!0,Sn.routeTool=q[2],we(()=>D=!1)),B.$set(Sn),q[1]!="planning"?Me?(Me.p(q,Oe),Oe&2&&M(Me,1)):(Me=Vr(q),Me.c(),M(Me,1),Me.m(T,z)):Me&&(pe(),C(Me,1,1,()=>{Me=null}),de());const fo={};ue.$set(fo);const co={};me.$set(co)},i(q){Te||(M(n.$$.fragment,q),M(o.$$.fragment,q),M(l.$$.fragment,q),M(H),M(Z),M(g.$$.fragment,q),M(_.$$.fragment,q),M(d.$$.fragment,q),M(w.$$.fragment,q),M(le),M(ie),M(B.$$.fragment,q),M(Me),M(ue.$$.fragment,q),M(Ee.$$.fragment,q),M(me.$$.fragment,q),Te=!0)},o(q){C(n.$$.fragment,q),C(o.$$.fragment,q),C(l.$$.fragment,q),C(H),C(Z),C(g.$$.fragment,q),C(_.$$.fragment,q),C(d.$$.fragment,q),C(w.$$.fragment,q),C(le),C(ie),C(B.$$.fragment,q),C(Me),C(ue.$$.fragment,q),C(Ee.$$.fragment,q),C(me.$$.fragment,q),Te=!1},d(q){q&&S(e),N(n),r[15](null),N(o),N(l),H&&H.d(),Z&&Z.d(),r[17](null),N(g),N(_),r[18](null),N(d),N(w),le&&le.d(),ie&&ie.d(),r[20](null),N(B),Me&&Me.d(),r[22](null),N(ue),N(Ee),r[23](null),N(me)}}}function ba(r,e,t){let n,i;W(r,Ue,T=>t(24,n=T)),W(r,Ce,T=>t(25,i=T));let{routeSnapperUrl:o}=e,{schema:s}=e,a,l=new Xs(n),u=new fl(n),f,c,p,g,v,y,_,h;const d={"edit-attribute":new Je,"edit-geometry":new Je,route:new Je,point:new Je,"free-polygon":new Je,"snap-polygon":new Je,"split-route":new Je,"street-view":new Je};Tr.forEach(T=>{n.on(T,z=>{d[st(Ce)].mapHandlers[T](z)})}),Ar.forEach(T=>{document.addEventListener(T,z=>{d[st(Ce)].documentHandlers[T](z)})});function b(T){let z={"edit-attribute":f,"edit-geometry":c,route:p,point:g,"free-polygon":v,"snap-polygon":y,"split-route":_,"street-view":h};const ue=i;if(ue==T){console.log(`Mode is already ${ue}, not changing`);return}console.log(`Stopping old mode ${ue}`),z[ue].stop(),Ce.set(T),console.log(`Starting new mode ${T}`),z[T].start()}bn(()=>{u==null||u.tearDown(),a==null||a.tearDown(),Tr.forEach(T=>{n.off(T,z=>{d[st(Ce)].mapHandlers[T](z)})}),Ar.forEach(T=>{document.removeEventListener(T,z=>{d[st(Ce)].documentHandlers[T](z)})})});function m(T){ae[T?"unshift":"push"](()=>{f=T,t(3,f)})}function w(T){ae[T?"unshift":"push"](()=>{c=T,t(4,c)})}function L(T){ae[T?"unshift":"push"](()=>{g=T,t(6,g)})}function O(T){ae[T?"unshift":"push"](()=>{v=T,t(7,v)})}function R(T){ae[T?"unshift":"push"](()=>{y=T,t(8,y)})}function I(T){ae[T?"unshift":"push"](()=>{p=T,t(5,p)})}function B(T){a=T,t(2,a)}function D(T){ae[T?"unshift":"push"](()=>{_=T,t(9,_)})}function j(T){ae[T?"unshift":"push"](()=>{h=T,t(10,h)})}return r.$$set=T=>{"routeSnapperUrl"in T&&t(0,o=T.routeSnapperUrl),"schema"in T&&t(1,s=T.schema)},[o,s,a,f,c,p,g,v,y,_,h,l,u,d,b,m,w,L,O,R,I,B,D,j]}class ya extends ee{constructor(e){super(),te(this,e,ba,ma,ne,{routeSnapperUrl:0,schema:1})}}function Kr(r,e,t){const n=r.slice();return n[3]=e[t],n}function Zr(r,e,t){const n=r.slice();return n[6]=e[t],n}function Qr(r){let e;return{c(){e=$("td"),x(e,"class","svelte-11t6rxo"),Ae(e,"background-color",r[6])},m(t,n){k(t,e,n)},p(t,n){n&1&&Ae(e,"background-color",t[6])},d(t){t&&S(e)}}}function ei(r){let e,t=r[3]+"",n;return{c(){e=$("td"),n=U(t),x(e,"class","svelte-11t6rxo"),Ae(e,"width",r[2])},m(i,o){k(i,e,o),E(e,n)},p(i,o){o&2&&t!==(t=i[3]+"")&&Le(n,t)},d(i){i&&S(e)}}}function va(r){let e,t,n,i,o=He(r[0]),s=[];for(let u=0;u{"colors"in s&&t(0,n=s.colors),"labels"in s&&t(1,i=s.labels)},[n,i,o]}class ka extends ee{constructor(e){super(),te(this,e,wa,va,ne,{colors:0,labels:1})}}const Sa="/atip/capitalize_auto_form/assets/help-d011708a.svg";function Ea(r){let e,t;return{c(){e=$("img"),In(e.src,t=Sa)||x(e,"src",t),x(e,"title",r[0]),x(e,"alt",r[0])},m(n,i){k(n,e,i)},p(n,[i]){i&1&&x(e,"title",n[0]),i&1&&x(e,"alt",n[0])},i:G,o:G,d(n){n&&S(e)}}}function Ma(r,e,t){let{contents:n}=e;return r.$$set=i=>{"contents"in i&&t(0,n=i.contents)},[n]}class Wi extends ee{constructor(e){super(),te(this,e,Ma,Ea,ne,{contents:0})}}function $a(r){let e,t,n,i,o,s,a;return t=new Wi({props:{contents:"Data comes from OpenStreetMap, and may not always be correct. Unexpected values are treated as unknown. Freehand route segments and off-road paths generally have no speed data."}}),i=new ka({props:{colors:r[0],labels:["< 20","20","30","40",">= 50"]}}),s=new jo({props:{layers:["speed-limits"],contents:La}}),{c(){e=U(`(mph) +`),F(t.$$.fragment),n=A(),F(i.$$.fragment),o=A(),F(s.$$.fragment)},m(l,u){k(l,e,u),P(t,l,u),k(l,n,u),P(i,l,u),k(l,o,u),P(s,l,u),a=!0},p:G,i(l){a||(M(t.$$.fragment,l),M(i.$$.fragment,l),M(s.$$.fragment,l),a=!0)},o(l){C(t.$$.fragment,l),C(i.$$.fragment,l),C(s.$$.fragment,l),a=!1},d(l){l&&(S(e),S(n),S(o)),N(t,l),N(i,l),N(s,l)}}}let Ca="white",dt="speed-limits",An="speed-limits",Et=.8;function La(r){return r.speed_limit?`${Math.round(r.speed_limit)} mph`:"Unknown"}function Ta(r,e,t){let n,i,o;W(r,Ue,f=>t(2,n=f)),W(r,vt,f=>t(3,i=f)),W(r,ce,f=>t(4,o=f));let{id:s}=e,a=["#00AB4D","#8ECA4D","#F7BB00","#BB0000","#470000"];const l=["case",["<",["get","speed_limit"],20],a[0],["==",["get","speed_limit"],20],a[1],["==",["get","speed_limit"],30],a[2],["==",["get","speed_limit"],40],a[3],[">=",["get","speed_limit"],50],a[4],Ca],u=["case",["<",["get","speed_limit"],20],Et,["==",["get","speed_limit"],20],Et,["==",["get","speed_limit"],30],Et,["==",["get","speed_limit"],40],Et,[">=",["get","speed_limit"],50],Et,0];return ut(n,dt,nt()),Nt(n,{id:An,source:dt,color:l,width:Fn,opacity:u}),Ht(async()=>{try{if(s){let f=o.features.find(p=>p.id==s),c=JSON.parse(await i.speedLimitForRoute(f.properties.waypoints));n.getSource(dt).setData(c)}else{let f=JSON.parse(await i.allSpeedLimits());n.getSource(dt).setData(f)}}catch(f){window.alert(`Couldn't calculate speed limits for route: ${f}`)}}),bn(()=>{n.getLayer(An)&&n.removeLayer(An),n.getSource(dt)&&n.removeSource(dt)}),r.$$set=f=>{"id"in f&&t(1,s=f.id)},[a,s]}class Vi extends ee{constructor(e){super(),te(this,e,Ta,$a,ne,{id:1})}}function Aa(r){let e;return{c(){e=$("p"),e.textContent="Route info loading..."},m(t,n){k(t,e,n)},p:G,i:G,o:G,d(t){t&&S(e)}}}function Oa(r){let e,t,n,i,o,s,a,l,u,f,c,p=r[1]=="speed limits"&&ti();return{c(){e=$("label"),t=U(`Show layer: + `),n=$("select"),i=$("option"),i.textContent="None",o=$("option"),o.textContent="Speed limits",a=A(),p&&p.c(),l=be(),i.__value="none",fe(i,i.__value),o.__value="speed limits",fe(o,o.__value),n.disabled=s=r[0]!=null,r[1]===void 0&&yn(()=>r[3].call(n))},m(g,v){k(g,e,v),E(e,t),E(e,n),E(n,i),E(n,o),on(n,r[1],!0),k(g,a,v),p&&p.m(g,v),k(g,l,v),u=!0,f||(c=Y(n,"change",r[3]),f=!0)},p(g,v){(!u||v&1&&s!==(s=g[0]!=null))&&(n.disabled=s),v&2&&on(n,g[1]),g[1]=="speed limits"?p?(p.p(g,v),v&2&&M(p,1)):(p=ti(),p.c(),M(p,1),p.m(l.parentNode,l)):p&&(pe(),C(p,1,1,()=>{p=null}),de())},i(g){u||(M(p),u=!0)},o(g){C(p),u=!1},d(g){g&&(S(e),S(a),S(l)),p&&p.d(g),f=!1,c()}}}function ti(r){let e,t;return e=new Vi({props:{id:void 0}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p:G,i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Ra(r){let e,t,n,i;const o=[Oa,Aa],s=[];function a(l,u){return l[2]?0:1}return e=a(r),t=s[e]=o[e](r),{c(){t.c(),n=be()},m(l,u){s[e].m(l,u),k(l,n,u),i=!0},p(l,[u]){let f=e;e=a(l),e===f?s[e].p(l,u):(pe(),C(s[f],1,1,()=>{s[f]=null}),de(),t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),M(t,1),t.m(n.parentNode,n))},i(l){i||(M(t),i=!0)},o(l){C(t),i=!1},d(l){l&&S(n),s[e].d(l)}}}function xa(r,e,t){let n,i;W(r,xe,a=>t(0,n=a)),W(r,vt,a=>t(2,i=a));let o="none";function s(){o=yi(this),t(1,o),t(0,n)}return r.$$.update=()=>{r.$$.dirty&1&&n&&t(1,o="none")},[n,o,i,s]}class Ia extends ee{constructor(e){super(),te(this,e,xa,Ra,ne,{})}}function Fa(r){let e,t,n,i,o,s,a,l,u,f;return{c(){e=$("p"),t=U(r[4]),n=A(),i=$("button"),o=U(r[5]),s=A(),a=$("button"),l=U(r[6]),x(i,"type","button"),x(a,"type","button")},m(c,p){k(c,e,p),E(e,t),k(c,n,p),k(c,i,p),E(i,o),k(c,s,p),k(c,a,p),E(a,l),u||(f=[Y(i,"click",r[7]),Y(a,"click",r[8])],u=!0)},p(c,p){p&16&&Le(t,c[4]),p&32&&Le(o,c[5]),p&64&&Le(l,c[6])},d(c){c&&(S(e),S(n),S(i),S(s),S(a)),u=!1,Ie(f)}}}function Pa(r){let e,t,n,i,o,s;function a(p){r[9](p)}function l(p){r[10](p)}function u(p){r[11](p)}function f(p){r[12](p)}let c={$$slots:{default:[Fa]},$$scope:{ctx:r}};return r[3]!==void 0&&(c.title=r[3]),r[0]!==void 0&&(c.open=r[0]),r[1]!==void 0&&(c.displayEscapeButton=r[1]),r[2]!==void 0&&(c.canCloseByClickingBackground=r[2]),e=new wi({props:c}),ae.push(()=>ve(e,"title",a)),ae.push(()=>ve(e,"open",l)),ae.push(()=>ve(e,"displayEscapeButton",u)),ae.push(()=>ve(e,"canCloseByClickingBackground",f)),{c(){F(e.$$.fragment)},m(p,g){P(e,p,g),s=!0},p(p,[g]){const v={};g&16496&&(v.$$scope={dirty:g,ctx:p}),!t&&g&8&&(t=!0,v.title=p[3],we(()=>t=!1)),!n&&g&1&&(n=!0,v.open=p[0],we(()=>n=!1)),!i&&g&2&&(i=!0,v.displayEscapeButton=p[1],we(()=>i=!1)),!o&&g&4&&(o=!0,v.canCloseByClickingBackground=p[2],we(()=>o=!1)),e.$set(v)},i(p){s||(M(e.$$.fragment,p),s=!0)},o(p){C(e.$$.fragment,p),s=!1},d(p){N(e,p)}}}function Na(r,e,t){const n=To();let{open:i=!1}=e,{displayEscapeButton:o=!1}=e,{canCloseByClickingBackground:s=!1}=e,{title:a}=e,{message:l}=e,{confirmButtonText:u="Confirm"}=e,{cancelButtonText:f="Cancel"}=e;function c(){n("confirmAction")}function p(){n("cancelAction")}function g(h){a=h,t(3,a)}function v(h){i=h,t(0,i)}function y(h){o=h,t(1,o)}function _(h){s=h,t(2,s)}return r.$$set=h=>{"open"in h&&t(0,i=h.open),"displayEscapeButton"in h&&t(1,o=h.displayEscapeButton),"canCloseByClickingBackground"in h&&t(2,s=h.canCloseByClickingBackground),"title"in h&&t(3,a=h.title),"message"in h&&t(4,l=h.message),"confirmButtonText"in h&&t(5,u=h.confirmButtonText),"cancelButtonText"in h&&t(6,f=h.cancelButtonText)},[i,o,s,a,l,u,f,c,p,g,v,y,_]}class Ba extends ee{constructor(e){super(),te(this,e,Na,Pa,ne,{open:0,displayEscapeButton:1,canCloseByClickingBackground:2,title:3,message:4,confirmButtonText:5,cancelButtonText:6})}}function ni(r){let e,t;return e=new Oo({props:{errorMessage:r[2]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&4&&(o.errorMessage=n[2]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function ri(r){let e;return{c(){e=$("p"),e.textContent=`Finish drawing on the map and/or select "Edit attributes" to use these + options.`,x(e,"class","reminder")},m(t,n){k(t,e,n)},d(t){t&&S(e)}}}function Da(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y,_,h,d,b=r[1].features.length+"",m,w,L=Pn(r[0])+"",O,R,I,B,D,j,T,z,ue,he,Se,Ee,_e=r[2]&&ni(r);f=new Ao({props:{label:"Load from GeoJSON",id:"load-geojson",disabled:r[4],loadFile:r[9]}});function me(H){r[14](H)}let Te={title:"Would you like to clear your work?",message:"This will delete all your drawn interventions."};r[3]!==void 0&&(Te.open=r[3]),T=new Ba({props:Te}),ae.push(()=>ve(T,"open",me)),T.$on("cancelAction",r[6]),T.$on("confirmAction",r[7]);let se=r[4]&&ri();return{c(){e=$("div"),t=$("label"),n=U(`Scheme name: + `),i=$("input"),o=A(),s=$("br"),a=A(),l=$("div"),_e&&_e.c(),u=A(),F(f.$$.fragment),c=A(),p=$("button"),g=U("Export to GeoJSON"),v=A(),y=$("br"),_=A(),h=$("div"),d=$("span"),m=U(b),w=A(),O=U(L),R=A(),I=$("button"),B=U("Clear all"),j=A(),F(T.$$.fragment),ue=A(),se&&se.c(),x(i,"type","text"),x(p,"type","button"),x(p,"class","align-right svelte-wfhzcu"),p.disabled=r[4],x(I,"type","button"),x(I,"class","align-right svelte-wfhzcu"),I.disabled=D=r[1].features.length==0||r[4]},m(H,Z){k(H,e,Z),E(e,t),E(t,n),E(t,i),fe(i,r[1].scheme_name),k(H,o,Z),k(H,s,Z),k(H,a,Z),k(H,l,Z),_e&&_e.m(l,null),E(l,u),P(f,l,null),E(l,c),E(l,p),E(p,g),k(H,v,Z),k(H,y,Z),k(H,_,Z),k(H,h,Z),E(h,d),E(d,m),E(d,w),E(d,O),E(h,R),E(h,I),E(I,B),E(h,j),P(T,h,null),E(h,ue),se&&se.m(h,null),he=!0,Se||(Ee=[Y(i,"input",r[13]),Y(p,"click",r[8]),Y(I,"click",r[5])],Se=!0)},p(H,[Z]){Z&2&&i.value!==H[1].scheme_name&&fe(i,H[1].scheme_name),H[2]?_e?(_e.p(H,Z),Z&4&&M(_e,1)):(_e=ni(H),_e.c(),M(_e,1),_e.m(l,u)):_e&&(pe(),C(_e,1,1,()=>{_e=null}),de());const Ye={};Z&16&&(Ye.disabled=H[4]),f.$set(Ye),(!he||Z&16)&&(p.disabled=H[4]),(!he||Z&2)&&b!==(b=H[1].features.length+"")&&Le(m,b),(!he||Z&1)&&L!==(L=Pn(H[0])+"")&&Le(O,L),(!he||Z&18&&D!==(D=H[1].features.length==0||H[4]))&&(I.disabled=D);const it={};!z&&Z&8&&(z=!0,it.open=H[3],we(()=>z=!1)),T.$set(it),H[4]?se||(se=ri(),se.c(),se.m(h,null)):se&&(se.d(1),se=null)},i(H){he||(M(_e),M(f.$$.fragment,H),M(T.$$.fragment,H),he=!0)},o(H){C(_e),C(f.$$.fragment,H),C(T.$$.fragment,H),he=!1},d(H){H&&(S(e),S(o),S(s),S(a),S(l),S(v),S(y),S(_),S(h)),_e&&_e.d(),N(f),N(T),se&&se.d(),Se=!1,Ie(Ee)}}}function Ha(r,e){var t=document.createElement("a");t.setAttribute("href","data:text/plain;charset=utf-8, "+encodeURIComponent(e)),t.setAttribute("download",r),document.body.appendChild(t),t.click(),document.body.removeChild(t)}function ja(r,e,t){let n,i;W(r,ce,m=>t(1,n=m)),W(r,Ut,m=>t(4,i=m));let{authorityName:o}=e,{schema:s}=e,a="",l=o;s!="v1"&&(l+=`_${s}`);let u=!1,f=!1;Ht(async()=>{let w=new URLSearchParams(window.location.search).get("geojsonUrl"),L=window.localStorage.getItem(l);if(w){console.log(`Loading GeoJSON from ${w}`);try{let R=await(await fetch(w)).text();ce.set(h(JSON.parse(R)))}catch(O){console.log(`Failed to load from URL: ${O}`)}}else if(L)try{ce.set(h(JSON.parse(L)))}catch(O){console.log(`Failed to load from local storage: ${O}`)}t(12,u=!0)});function c(){t(3,f=!0)}function p(){t(3,f=!1)}function g(){t(3,f=!1),ce.update(m=>(delete m.scheme_name,m.features=[],m)),xe.set(null),Ge.set(null),ln.set(null),an.set(null)}function v(){const m=JSON.parse(JSON.stringify(n));for(let w of m.features)delete w.properties.hide_while_editing;return m}function y(){let m=v();var w=l;m.authority=o,m.origin="atip-v2",m.scheme_name&&(w+="_"+m.scheme_name),w+=".txt",Ha(w,JSON.stringify(m,null," "))}function _(m){try{ce.set(h(JSON.parse(m)))}catch(w){t(2,a=`Couldn't load scheme from a file: ${w}`)}}function h(m){let w=1;for(let L of m.features)L.properties||(L.properties={name:"",description:"",intervention_type:"other"}),L.geometry.type=="LineString"&&!L.properties.length_meters&&(L.properties.length_meters=en(L,{units:"kilometers"})*1e3),L.id=w++;return m}function d(){n.scheme_name=this.value,ce.set(n)}function b(m){f=m,t(3,f)}return r.$$set=m=>{"authorityName"in m&&t(10,o=m.authorityName),"schema"in m&&t(0,s=m.schema)},r.$$.update=()=>{r.$$.dirty&6146&&u&&n&&(console.log("GJ changed, saving to local storage"),window.localStorage.setItem(l,JSON.stringify(v())))},[s,n,a,f,i,c,p,g,y,_,o,l,u,d,b]}class Ua extends ee{constructor(e){super(),te(this,e,ja,Da,ne,{authorityName:10,schema:0})}}function za(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y,_,h,d,b,m,w,L;return{c(){e=$("h2"),e.textContent=`Drawing ${r[1]} on the map`,t=A(),n=$("p"),n.textContent=`Use the tools on right to sketch new ${r[1]} on the map. Each tool has instructions + that appear when you click on its icon.`,i=A(),o=$("p"),s=U("Modify existing "),a=U(r[1]),l=U(" on the map using "),u=$("b"),u.textContent="Edit geometry",f=U(" and clicking something."),c=A(),p=$("h2"),p.textContent="Filling out data",g=A(),v=$("p"),y=$("b"),y.textContent="Edit attributes",_=U(" mode allows selecting and adding attributes to "),h=U(r[1]),d=U(` + that appear on the left.`),b=A(),m=$("h2"),m.textContent="Saving files",w=A(),L=$("p"),L.innerHTML=`ATIP does not send any data over the network or store your data in the + cloud. The current file you're editing will be saved in your browser's local + storage and automatically resume when you return to the page. The Export to GeoJSON + and Load from GeoJSON buttons save and load GeoJSON files (with a + .txt file extension) to your computer. You share these files with others + to collaborate on designs.`},m(O,R){k(O,e,R),k(O,t,R),k(O,n,R),k(O,i,R),k(O,o,R),E(o,s),E(o,a),E(o,l),E(o,u),E(o,f),k(O,c,R),k(O,p,R),k(O,g,R),k(O,v,R),E(v,y),E(v,_),E(v,h),E(v,d),k(O,b,R),k(O,m,R),k(O,w,R),k(O,L,R)},p:G,d(O){O&&(S(e),S(t),S(n),S(i),S(o),S(c),S(p),S(g),S(v),S(b),S(m),S(w),S(L))}}}function qa(r){let e,t,n;function i(s){r[3](s)}let o={title:"Instructions",$$slots:{default:[za]},$$scope:{ctx:r}};return r[0]!==void 0&&(o.open=r[0]),e=new wi({props:o}),ae.push(()=>ve(e,"open",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};a&16&&(l.$$scope={dirty:a,ctx:s}),!t&&a&1&&(t=!0,l.open=s[0],we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function Ga(r,e,t){let{open:n}=e,{schema:i}=e,o=Pn(i);function s(a){n=a,t(0,n)}return r.$$set=a=>{"open"in a&&t(0,n=a.open),"schema"in a&&t(2,i=a.schema)},[n,o,i,s]}class Ya extends ee{constructor(e){super(),te(this,e,Ga,qa,ne,{open:0,schema:2})}}const Ja="ATF4Intervention",Xa=[{name:"name",type:"one-liner"},{name:"description",type:"textbox"},{name:"type",oneOf:["New segregated cycling facility","New junction treatment","New permanent footway","New shared use (walking and cycling) facilities","Improvements to make an existing walking/cycle route safer","Area-wide traffic management (including by TROs - both permanent and experimental)","Bus priority measures that also enable active travel (for example, bus gates)","Provision of secure cycle parking facilities","New road crossings","Restriction or reduction of car parking availability","School streets"]},{name:"complexity",oneOf:["high","medium","low"]}],Wa={name:Ja,members:Xa},Va=(r,e)=>(r=r.replace(new RegExp("((?t.toLowerCase()),r.replace(/(\p{Uppercase_Letter}+)(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu,(t,n,i)=>n+e+i.toLowerCase()));function Ka(r,{separator:e="_",preserveConsecutiveUppercase:t=!1}={}){if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("The `text` and `separator` arguments should be of type `string`");if(r.length<2)return t?r:r.toLowerCase();const n=`$1${e}$2`,i=r.replace(/([\p{Lowercase_Letter}\d])(\p{Uppercase_Letter})/gu,n);return t?Va(i,e):i.replace(/(\p{Uppercase_Letter})(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu,n).toLowerCase()}function ii(r){if(typeof r!="string")throw new TypeError("Expected a string");return r=Ka(r),r=r.toLowerCase().replace(/[_-]+/g," ").replace(/\s{2,}/g," ").trim(),r=r.charAt(0).toUpperCase()+r.slice(1),r}function Za(r){const e=r-1;return e*e*e+1}function _n(r,{delay:e=0,duration:t=400,easing:n=Za,axis:i="y"}={}){const o=getComputedStyle(r),s=+o.opacity,a=i==="y"?"height":"width",l=parseFloat(o[a]),u=i==="y"?["top","bottom"]:["left","right"],f=u.map(h=>`${h[0].toUpperCase()}${h.slice(1)}`),c=parseFloat(o[`padding${f[0]}`]),p=parseFloat(o[`padding${f[1]}`]),g=parseFloat(o[`margin${f[0]}`]),v=parseFloat(o[`margin${f[1]}`]),y=parseFloat(o[`border${f[0]}Width`]),_=parseFloat(o[`border${f[1]}Width`]);return{delay:e,duration:t,easing:n,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*s};${a}: ${h*l}px;padding-${u[0]}: ${h*c}px;padding-${u[1]}: ${h*p}px;margin-${u[0]}: ${h*g}px;margin-${u[1]}: ${h*v}px;border-${u[0]}-width: ${h*y}px;border-${u[1]}-width: ${h*_}px;`}}function Ki(r){return"members"in r}function Zi(r){return"oneOf"in r}function Qi(r){return typeof r=="string"}function eo(r){return typeof r=="object"&&"value"in r}function Qa(r){return"type"in r&&r.type=="number"}function to(r){return"type"in r&&r.type=="one-liner"}function no(r){return"type"in r&&r.type=="textbox"}function ro(r){return"type"in r&&r.type=="checkbox"}function oi(r,e,t){const n=r.slice();return n[15]=e[t],n[18]=e,n[19]=t,n}function si(r,e,t){const n=r.slice();return n[15]=e[t],n[16]=e,n[17]=t,n}function li(r){let e,t=r[1].description+"",n;return{c(){e=$("p"),n=U(t),x(e,"class","svelte-1b72l00")},m(i,o){k(i,e,o),E(e,n)},p(i,o){o&2&&t!==(t=i[1].description+"")&&Le(n,t)},d(i){i&&S(e)}}}function eu(r){let e,t,n;return{c(){e=$("input"),x(e,"type","checkbox")},m(i,o){k(i,e,o),e.checked=r[0],t||(n=Y(e,"change",r[14]),t=!0)},p(i,o){o&1&&(e.checked=i[0])},i:G,o:G,d(i){i&&S(e),t=!1,n()}}}function tu(r){let e,t,n;return{c(){e=$("textarea"),Ae(e,"width","100%"),x(e,"rows","5"),x(e,"class","svelte-1b72l00")},m(i,o){k(i,e,o),fe(e,r[0]),t||(n=Y(e,"input",r[13]),t=!0)},p(i,o){o&1&&fe(e,i[0])},i:G,o:G,d(i){i&&S(e),t=!1,n()}}}function nu(r){let e,t,n;return{c(){e=$("input"),x(e,"type","text"),Ae(e,"width","100%")},m(i,o){k(i,e,o),fe(e,r[0]),t||(n=Y(e,"input",r[12]),t=!0)},p(i,o){o&1&&e.value!==i[0]&&fe(e,i[0])},i:G,o:G,d(i){i&&S(e),t=!1,n()}}}function ru(r){let e,t,n;return{c(){e=$("input"),x(e,"type","number")},m(i,o){k(i,e,o),fe(e,r[0]),t||(n=Y(e,"input",r[11]),t=!0)},p(i,o){o&1&&vi(e.value)!==i[0]&&fe(e,i[0])},i:G,o:G,d(i){i&&S(e),t=!1,n()}}}function iu(r){let e,t,n=He(r[1].oneOf),i=[];for(let s=0;sC(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;sC(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;s{y=null}),de())},i(_){c||(M(y),c=!0)},o(_){C(y),c=!1},d(_){_&&(S(e),S(u),S(f)),y&&y.d(_),p.r(),g=!1,Ie(v)}}}function lu(r){let e,t,n,i=!1,o,s=r[15].value+"",a,l,u,f,c,p;function g(_,h){return _[15].description?fu:uu}let v=g(r),y=v(r);return f=jt(r[7][0]),{c(){e=$("label"),t=$("input"),o=A(),a=U(s),l=A(),y.c(),u=A(),x(t,"type","radio"),t.__value=n=r[15].value,fe(t,t.__value),f.p(t)},m(_,h){k(_,e,h),E(e,t),t.checked=t.__value===r[2],E(e,o),E(e,a),E(e,l),y.m(e,null),E(e,u),c||(p=[Y(t,"change",r[8]),Y(t,"change",r[3])],c=!0)},p(_,h){h&2&&n!==(n=_[15].value)&&(t.__value=n,fe(t,t.__value),i=!0),(i||h&6)&&(t.checked=t.__value===_[2]),h&2&&s!==(s=_[15].value+"")&&Le(a,s),v===(v=g(_))&&y?y.p(_,h):(y.d(1),y=v(_),y&&(y.c(),y.m(e,u)))},i:G,o:G,d(_){_&&S(e),y.d(),f.r(),c=!1,Ie(p)}}}function au(r){let e,t,n,i=!1,o,s=r[15]+"",a,l,u,f,c,p,g;return c=jt(r[7][0]),{c(){e=$("label"),t=$("input"),o=A(),a=U(s),l=A(),u=$("br"),f=A(),x(t,"type","radio"),t.__value=n=r[15],fe(t,t.__value),c.p(t)},m(v,y){k(v,e,y),E(e,t),t.checked=t.__value===r[2],E(e,o),E(e,a),E(e,l),E(e,u),E(e,f),p||(g=[Y(t,"change",r[6]),Y(t,"change",r[3])],p=!0)},p(v,y){y&2&&n!==(n=v[15])&&(t.__value=n,fe(t,t.__value),i=!0),(i||y&6)&&(t.checked=t.__value===v[2]),y&2&&s!==(s=v[15]+"")&&Le(a,s)},i:G,o:G,d(v){v&&S(e),c.r(),p=!1,Ie(g)}}}function ai(r){let e,t,n,i,o,s;function a(u){r[10](u,r[15])}let l={spec:r[15]};return r[0][r[15].name]!==void 0&&(l.value=r[0][r[15].name]),t=new wt({props:l}),ae.push(()=>ve(t,"value",a)),{c(){e=$("div"),F(t.$$.fragment),i=A(),x(e,"class","svelte-1b72l00")},m(u,f){k(u,e,f),P(t,e,null),E(e,i),s=!0},p(u,f){r=u;const c={};f&2&&(c.spec=r[15]),!n&&f&3&&(n=!0,c.value=r[0][r[15].name],we(()=>n=!1)),t.$set(c)},i(u){s||(M(t.$$.fragment,u),u&&yn(()=>{s&&(o||(o=sn(e,_n,{duration:500},!0)),o.run(1))}),s=!0)},o(u){C(t.$$.fragment,u),u&&(o||(o=sn(e,_n,{duration:500},!1)),o.run(0)),s=!1},d(u){u&&S(e),N(t),u&&o&&o.end()}}}function uu(r){let e;return{c(){e=$("br")},m(t,n){k(t,e,n)},p:G,d(t){t&&S(e)}}}function fu(r){let e,t,n=r[15].description+"",i,o;return{c(){e=$("p"),t=U("("),i=U(n),o=U(")"),x(e,"class","svelte-1b72l00")},m(s,a){k(s,e,a),E(e,t),E(e,i),E(e,o)},p(s,a){a&2&&n!==(n=s[15].description+"")&&Le(i,n)},d(s){s&&S(e)}}}function ui(r){let e,t,n,i,o,s;const a=[au,lu,su],l=[];function u(f,c){return c&2&&(e=null),c&2&&(t=null),e==null&&(e=!!Qi(f[15])),e?0:(t==null&&(t=!!eo(f[15])),t?1:2)}return n=u(r,-1),i=l[n]=a[n](r),{c(){i.c(),o=be()},m(f,c){l[n].m(f,c),k(f,o,c),s=!0},p(f,c){let p=n;n=u(f,c),n===p?l[n].p(f,c):(pe(),C(l[p],1,1,()=>{l[p]=null}),de(),i=l[n],i?i.p(f,c):(i=l[n]=a[n](f),i.c()),M(i,1),i.m(o.parentNode,o))},i(f){s||(M(i),s=!0)},o(f){C(i),s=!1},d(f){f&&S(o),l[n].d(f)}}}function fi(r){let e,t,n=ii(r[15].name)+"",i,o,s,a,l,u;function f(p){r[5](p,r[15])}let c={spec:r[15]};return r[0][r[15].name]!==void 0&&(c.value=r[0][r[15].name]),s=new wt({props:c}),ae.push(()=>ve(s,"value",f)),{c(){e=$("div"),t=$("h3"),i=U(n),o=A(),F(s.$$.fragment),l=A(),x(e,"class","svelte-1b72l00")},m(p,g){k(p,e,g),E(e,t),E(t,i),E(e,o),P(s,e,null),E(e,l),u=!0},p(p,g){r=p,(!u||g&2)&&n!==(n=ii(r[15].name)+"")&&Le(i,n);const v={};g&2&&(v.spec=r[15]),!a&&g&3&&(a=!0,v.value=r[0][r[15].name],we(()=>a=!1)),s.$set(v)},i(p){u||(M(s.$$.fragment,p),u=!0)},o(p){C(s.$$.fragment,p),u=!1},d(p){p&&S(e),N(s)}}}function cu(r){let e,t,n,i,o,s,a,l,u,f,c,p=r[1].description&&li(r);const g=[ou,iu,ru,nu,tu,eu],v=[];function y(_,h){return h&2&&(t=null),h&2&&(n=null),h&2&&(i=null),h&2&&(o=null),h&2&&(s=null),h&2&&(a=null),t==null&&(t=!!Ki(_[1])),t?0:(n==null&&(n=!!Zi(_[1])),n?1:(i==null&&(i=!!Qa(_[1])),i?2:(o==null&&(o=!!to(_[1])),o?3:(s==null&&(s=!!no(_[1])),s?4:(a==null&&(a=!!ro(_[1])),a?5:-1)))))}return~(l=y(r,-1))&&(u=v[l]=g[l](r)),{c(){p&&p.c(),e=A(),u&&u.c(),f=be()},m(_,h){p&&p.m(_,h),k(_,e,h),~l&&v[l].m(_,h),k(_,f,h),c=!0},p(_,[h]){_[1].description?p?p.p(_,h):(p=li(_),p.c(),p.m(e.parentNode,e)):p&&(p.d(1),p=null);let d=l;l=y(_,h),l===d?~l&&v[l].p(_,h):(u&&(pe(),C(v[d],1,1,()=>{v[d]=null}),de()),~l?(u=v[l],u?u.p(_,h):(u=v[l]=g[l](_),u.c()),M(u,1),u.m(f.parentNode,f)):u=null)},i(_){c||(M(u),c=!0)},o(_){C(u),c=!1},d(_){_&&(S(e),S(f)),p&&p.d(_),~l&&v[l].d(_)}}}function pu(r,e,t){var d,b,m;let{spec:n}=e,{value:i}=e,o="";if(Ki(n)){i||(i={});for(let w of n.members)to(w)||no(w)?i[d=w.name]||(i[d]=""):ro(w)?i[b=w.name]||(i[b]=!1):i[m=w.name]||(i[m]={})}else Zi(n)&&(i||(i={}),Qi(i)?o=i:eo(i)?o=i.value:o=Object.keys(i)[0]||"");function s(){t(0,i=o)}function a(){t(0,i={}),t(0,i[o]={},i)}const l=[[]];function u(w,L){r.$$.not_equal(i[L.name],w)&&(i[L.name]=w,t(0,i))}function f(){o=this.__value,t(2,o)}function c(){o=this.__value,t(2,o)}function p(){o=this.__value,t(2,o)}function g(w,L){r.$$.not_equal(i[L.name],w)&&(i[L.name]=w,t(0,i))}function v(){i=vi(this.value),t(0,i)}function y(){i=this.value,t(0,i)}function _(){i=this.value,t(0,i)}function h(){i=this.checked,t(0,i)}return r.$$set=w=>{"spec"in w&&t(1,n=w.spec),"value"in w&&t(0,i=w.value)},[i,n,o,s,a,u,f,l,c,p,g,v,y,_,h]}class wt extends ee{constructor(e){super(),te(this,e,pu,cu,ne,{spec:1,value:0})}}function du(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].atf4!==void 0&&(o.value=r[0].atf4),e=new wt({props:o}),ae.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].atf4,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function hu(r,e,t){let{props:n}=e;n.atf4||(n.atf4={});let i=Wa;function o(s){r.$$.not_equal(n.atf4,s)&&(n.atf4=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class gu extends ee{constructor(e){super(),te(this,e,hu,du,ne,{props:0})}}const _u="CriticalIssue",mu=[{name:"name",type:"one-liner"},{name:"Type",oneOf:[{value:"Conflict with motor traffic at side roads / priority junctions",description:">2500vpd cut across main cycling or walking streams"},{value:"Conflict with motor traffic at signal controlled junctions and roundabouts",description:">2500vpd cut across main cycling or walking streams"},{value:"Collision alongside or from behind",description:"Cyclists are not protected in traffic lanes between 3.25 and 3.9m wide."},{value:"Trip hazard",description:"There are level differences of greater than 20mm with no colour contrast to help identify them."},{value:"Conflict with kerbside activity (parking, loading, risk of 'dooring') ",description:"Cycle facility next to parking/loading with no buffer."},{value:"Kerbside activity or risk of crossing conflict",description:"On busy roads (>8000vpd) formal crossings are more than 400m apart. On quieter roads (<8000vpd), desire lines are blocked by parking and loading."},{value:"Standard of crossing facility",description:"On busy roads (>8000vpd), there are uncontrolled crossings of two or more lanes with no gaps in traffic. At signal junctions there are arms with no green man for pedestrians."},{value:"Speed of traffic (where cyclists are not separated or pedestrians crossing uncontrolled)",description:"85th percentile > 37mph (60kph)"},{value:"Total volume of traffic (where cyclists are not separated or pedestrians cross uncontrolled)",description:">10000 vpd. >5% of traffic is HGVs."},{value:"Required crossing speed (risk of pedestrians coming into conflict with traffic)",description:"Pedestrians must cross at a speed of over 1.2m/s to get across the crossing in time."},{value:"Clear walking spaces free of obstructions and furniture, reducing risk of pedestrians walking in the carriageway.",description:"<1.5m clear footway width. Or, 1.5m-2m clear footway width and pedestrian comfort is poor (PCL of D-E)."},{value:"Effective width next to tram line on a straight run",description:"<2.4m from tramline edge to kerb."},{value:"Crossing angle (between cyclist desire line and tram tracks)",description:"Crossing angle less than 60 degrees."},{value:"Defects: non cycle friendly ironworks, raised/ sunken covers/gullies",description:"Major defects"},{value:"Defects: non flush tables, misleading tactile information, cracked paving, slip-risks present from covers, steep slopes",description:"Major defects"}]},{name:"comment",type:"textbox"},{name:"photographed",type:"checkbox"}],bu={name:_u,members:mu};function yu(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].criticals!==void 0&&(o.value=r[0].criticals),e=new wt({props:o}),ae.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].criticals,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function vu(r,e,t){let{props:n}=e;n.criticals||(n.criticals={});let i=bu;function o(s){r.$$.not_equal(n.criticals,s)&&(n.criticals=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class wu extends ee{constructor(e){super(),te(this,e,vu,yu,ne,{props:0})}}function ku(r,e,t){let n;W(r,Ue,l=>t(3,n=l));let{source:i}=e,{gj:o}=e,{style:s}=e,a=`${i}-layer`;return ut(n,i,o),Ro(n,{id:a,source:i,...s}),bn(()=>{n.getLayer(a)&&n.removeLayer(a),n.getSource(i)&&n.removeSource(i)}),r.$$set=l=>{"source"in l&&t(0,i=l.source),"gj"in l&&t(1,o=l.gj),"style"in l&&t(2,s=l.style)},[i,o,s]}class kn extends ee{constructor(e){super(),te(this,e,ku,null,ne,{source:0,gj:1,style:2})}}function Su(r){let e,t;return e=new kn({props:{source:"intersection-markings",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Eu(r,e,t){let{gj:n}=e,i={type:"fill",paint:{"fill-color":vn("type",{"sidewalk corner":"#CCCCCC"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class Mu extends ee{constructor(e){super(),te(this,e,Eu,Su,ne,{gj:0})}}function $u(r){let e,t;return e=new kn({props:{source:"intersection-polygons",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Cu(r,e,t){let{gj:n}=e,i={type:"fill",filter:["==",["get","type"],"intersection"],paint:{"fill-color":vn("intersection_kind",{MapEdge:"#696",Terminus:"black",Connection:"black",Fork:"black",Intersection:"black"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class Lu extends ee{constructor(e){super(),te(this,e,Cu,$u,ne,{gj:0})}}function Tu(r){let e,t;return e=new kn({props:{source:"lane-markings",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Au(r,e,t){let{gj:n}=e,i={type:"fill",paint:{"fill-color":vn("type",{"center line":"white","lane separator":"white","lane arrow":"white","buffer edge":"white","buffer stripe":"white","vehicle stop line":"white","bike stop line":"green"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class Ou extends ee{constructor(e){super(),te(this,e,Au,Tu,ne,{gj:0})}}function Ru(r){let e,t;return e=new kn({props:{source:"lane-polygons",gj:r[0],style:r[1]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,[i]){const o={};i&1&&(o.gj=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function xu(r,e,t){let{gj:n}=e,i={type:"fill",paint:{"fill-color":vn("type",{Driving:"black",Parking:"#333333",Sidewalk:"#CCCCCC",Shoulder:"#CCCCCC",Biking:"#0F7D4B",Bus:"#BE4A4C",SharedLeftTurn:"black",Construction:"#FF6D00",LightRail:"#844204",Footway:"#DDDDE8",SharedUse:"#E5E1BB","Buffer(Planters)":"#555555"},"red"),"fill-opacity":.9}};return r.$$set=o=>{"gj"in o&&t(0,n=o.gj)},[n,i]}class Iu extends ee{constructor(e){super(),te(this,e,xu,Ru,ne,{gj:0})}}function ci(r){let e,t,n,i,o,s,a,l;return e=new Iu({props:{gj:r[0]}}),n=new Ou({props:{gj:r[1]}}),o=new Lu({props:{gj:r[2]}}),a=new Mu({props:{gj:r[3]}}),{c(){F(e.$$.fragment),t=A(),F(n.$$.fragment),i=A(),F(o.$$.fragment),s=A(),F(a.$$.fragment)},m(u,f){P(e,u,f),k(u,t,f),P(n,u,f),k(u,i,f),P(o,u,f),k(u,s,f),P(a,u,f),l=!0},p(u,f){const c={};f&1&&(c.gj=u[0]),e.$set(c);const p={};f&2&&(p.gj=u[1]),n.$set(p);const g={};f&4&&(g.gj=u[2]),o.$set(g);const v={};f&8&&(v.gj=u[3]),a.$set(v)},i(u){l||(M(e.$$.fragment,u),M(n.$$.fragment,u),M(o.$$.fragment,u),M(a.$$.fragment,u),l=!0)},o(u){C(e.$$.fragment,u),C(n.$$.fragment,u),C(o.$$.fragment,u),C(a.$$.fragment,u),l=!1},d(u){u&&(S(t),S(i),S(s)),N(e,u),N(n,u),N(o,u),N(a,u)}}}function Fu(r){let e,t,n,i=r[0]&&ci(r);return t=new Wi({props:{contents:"This visualizes lane data according to OpenStreetMap. There may be many errors with incorrect or missing lane data, lane width and intersection geometry, and markings. Use with caution."}}),{c(){i&&i.c(),e=A(),F(t.$$.fragment)},m(o,s){i&&i.m(o,s),k(o,e,s),P(t,o,s),n=!0},p(o,[s]){o[0]?i?(i.p(o,s),s&1&&M(i,1)):(i=ci(o),i.c(),M(i,1),i.m(e.parentNode,e)):i&&(pe(),C(i,1,1,()=>{i=null}),de())},i(o){n||(M(i),M(t.$$.fragment,o),n=!0)},o(o){C(i),C(t.$$.fragment,o),n=!1},d(o){o&&S(e),i&&i.d(o),N(t,o)}}}function Pu(r,e,t){let n,i;W(r,vt,f=>t(5,n=f)),W(r,ce,f=>t(6,i=f));let{id:o}=e,s,a,l,u;return Ht(async()=>{try{let f=i.features.find(p=>p.id==o),c=await n.renderLaneDetailsForRoute(f.properties.waypoints);t(0,s=JSON.parse(c[0])),t(1,a=JSON.parse(c[1])),t(2,l=JSON.parse(c[2])),t(3,u=JSON.parse(c[3]))}catch(f){window.alert(`Couldn't render lane details: ${f}`)}}),r.$$set=f=>{"id"in f&&t(4,o=f.id)},[s,a,l,u,o]}class Nu extends ee{constructor(e){super(),te(this,e,Pu,Fu,ne,{id:4})}}function Bu(r){let e;return{c(){e=$("p"),e.textContent="Route info loading..."},m(t,n){k(t,e,n)},p:G,i:G,o:G,d(t){t&&S(e)}}}function Du(r){let e,t,n,i,o,s,a,l,u,f,c,p,g;const v=[ju,Hu],y=[];function _(h,d){return h[1]=="speed limits"?0:h[1]=="lane details"?1:-1}return~(l=_(r))&&(u=y[l]=v[l](r)),{c(){e=$("label"),t=U(`Show details: + `),n=$("select"),i=$("option"),i.textContent="None",o=$("option"),o.textContent="Speed limits",s=$("option"),s.textContent="Lane details",a=A(),u&&u.c(),f=be(),i.__value="none",fe(i,i.__value),o.__value="speed limits",fe(o,o.__value),s.__value="lane details",fe(s,s.__value),r[1]===void 0&&yn(()=>r[3].call(n))},m(h,d){k(h,e,d),E(e,t),E(e,n),E(n,i),E(n,o),E(n,s),on(n,r[1],!0),k(h,a,d),~l&&y[l].m(h,d),k(h,f,d),c=!0,p||(g=Y(n,"change",r[3]),p=!0)},p(h,d){d&2&&on(n,h[1]);let b=l;l=_(h),l===b?~l&&y[l].p(h,d):(u&&(pe(),C(y[b],1,1,()=>{y[b]=null}),de()),~l?(u=y[l],u?u.p(h,d):(u=y[l]=v[l](h),u.c()),M(u,1),u.m(f.parentNode,f)):u=null)},i(h){c||(M(u),c=!0)},o(h){C(u),c=!1},d(h){h&&(S(e),S(a),S(f)),~l&&y[l].d(h),p=!1,g()}}}function Hu(r){let e,t;return e=new Nu({props:{id:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.id=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function ju(r){let e,t;return e=new Vi({props:{id:r[0]}}),{c(){F(e.$$.fragment)},m(n,i){P(e,n,i),t=!0},p(n,i){const o={};i&1&&(o.id=n[0]),e.$set(o)},i(n){t||(M(e.$$.fragment,n),t=!0)},o(n){C(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Uu(r){let e,t,n,i;const o=[Du,Bu],s=[];function a(l,u){return l[2]?0:1}return e=a(r),t=s[e]=o[e](r),{c(){t.c(),n=be()},m(l,u){s[e].m(l,u),k(l,n,u),i=!0},p(l,[u]){let f=e;e=a(l),e===f?s[e].p(l,u):(pe(),C(s[f],1,1,()=>{s[f]=null}),de(),t=s[e],t?t.p(l,u):(t=s[e]=o[e](l),t.c()),M(t,1),t.m(n.parentNode,n))},i(l){i||(M(t),i=!0)},o(l){C(t),i=!1},d(l){l&&S(n),s[e].d(l)}}}function zu(r,e,t){let n;W(r,vt,a=>t(2,n=a));let{id:i}=e,o="none";function s(){o=yi(this),t(1,o)}return r.$$set=a=>{"id"in a&&t(0,i=a.id)},[i,o,n,s]}class qu extends ee{constructor(e){super(),te(this,e,zu,Uu,ne,{id:0})}}function pi(r){let e,t,n,i,o;return{c(){e=$("button"),t=U("Auto-fill"),x(e,"type","button"),e.disabled=n=!r[5]},m(s,a){k(s,e,a),E(e,t),i||(o=Y(e,"click",r[7]),i=!0)},p(s,a){a&32&&n!==(n=!s[5])&&(e.disabled=n)},d(s){s&&S(e),i=!1,o()}}}function di(r){let e,t=hi(r[4])+"",n,i,o,s,a,l;return a=new qu({props:{id:r[3]}}),{c(){e=U("Length: "),n=U(t),i=A(),o=$("br"),s=A(),F(a.$$.fragment)},m(u,f){k(u,e,f),k(u,n,f),k(u,i,f),k(u,o,f),k(u,s,f),P(a,u,f),l=!0},p(u,f){(!l||f&16)&&t!==(t=hi(u[4])+"")&&Le(n,t);const c={};f&8&&(c.id=u[3]),a.$set(c)},i(u){l||(M(a.$$.fragment,u),l=!0)},o(u){C(a.$$.fragment,u),l=!1},d(u){u&&(S(e),S(n),S(i),S(o),S(s)),N(a,u)}}}function Gu(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y,_,h,d,b,m,w,L,O,R,I,B,D,j,T,z,ue,he,Se,Ee,_e,me,Te,se,H,Z,Ye,it,le=r[4]&&pi(r),ie=r[4]&&di(r);return Z=jt(r[10][0]),{c(){e=$("label"),t=U(`Name: + + `),le&&le.c(),n=A(),i=$("br"),o=A(),s=$("input"),a=A(),l=$("br"),u=A(),f=$("br"),c=A(),p=$("label"),g=$("input"),v=U(` + Area`),y=A(),_=$("label"),h=$("input"),d=U(` + Route`),b=A(),m=$("label"),w=$("input"),L=U(` + Crossing`),O=A(),R=$("label"),I=$("input"),B=U(` + Other`),D=A(),j=$("br"),T=A(),z=$("br"),ue=A(),he=$("label"),Se=U("Description:"),Ee=$("br"),_e=A(),me=$("textarea"),Te=A(),ie&&ie.c(),se=be(),x(s,"type","text"),Ae(s,"width","100%"),x(g,"type","radio"),g.__value="area",fe(g,g.__value),x(h,"type","radio"),h.__value="route",fe(h,h.__value),x(w,"type","radio"),w.__value="crossing",fe(w,w.__value),x(I,"type","radio"),I.__value="other",fe(I,I.__value),Ae(me,"width","100%"),x(me,"rows","5"),x(me,"class","svelte-15lna0i"),Z.p(g,h,w,I)},m(V,oe){k(V,e,oe),E(e,t),le&&le.m(e,null),E(e,n),E(e,i),E(e,o),E(e,s),fe(s,r[0]),k(V,a,oe),k(V,l,oe),k(V,u,oe),k(V,f,oe),k(V,c,oe),k(V,p,oe),E(p,g),g.checked=g.__value===r[1],E(p,v),k(V,y,oe),k(V,_,oe),E(_,h),h.checked=h.__value===r[1],E(_,d),k(V,b,oe),k(V,m,oe),E(m,w),w.checked=w.__value===r[1],E(m,L),k(V,O,oe),k(V,R,oe),E(R,I),I.checked=I.__value===r[1],E(R,B),k(V,D,oe),k(V,j,oe),k(V,T,oe),k(V,z,oe),k(V,ue,oe),k(V,he,oe),E(he,Se),E(he,Ee),E(he,_e),E(he,me),fe(me,r[2]),k(V,Te,oe),ie&&ie.m(V,oe),k(V,se,oe),H=!0,Ye||(it=[Y(s,"input",r[8]),Y(g,"change",r[9]),Y(h,"change",r[11]),Y(w,"change",r[12]),Y(I,"change",r[13]),Y(me,"input",r[14])],Ye=!0)},p(V,[oe]){V[4]?le?le.p(V,oe):(le=pi(V),le.c(),le.m(e,n)):le&&(le.d(1),le=null),oe&1&&s.value!==V[0]&&fe(s,V[0]),oe&2&&(g.checked=g.__value===V[1]),oe&2&&(h.checked=h.__value===V[1]),oe&2&&(w.checked=w.__value===V[1]),oe&2&&(I.checked=I.__value===V[1]),oe&4&&fe(me,V[2]),V[4]?ie?(ie.p(V,oe),oe&16&&M(ie,1)):(ie=di(V),ie.c(),M(ie,1),ie.m(se.parentNode,se)):ie&&(pe(),C(ie,1,1,()=>{ie=null}),de())},i(V){H||(M(ie),H=!0)},o(V){C(ie),H=!1},d(V){V&&(S(e),S(a),S(l),S(u),S(f),S(c),S(p),S(y),S(_),S(b),S(m),S(O),S(R),S(D),S(j),S(T),S(z),S(ue),S(he),S(Te),S(se)),le&&le.d(),ie&&ie.d(V),Z.r(),Ye=!1,Ie(it)}}}function hi(r){return r<1e3?Math.round(r)+" m":(r/1e3).toFixed(1)+"km"}function Yu(r,e,t){let n,i;W(r,vt,b=>t(5,n=b)),W(r,ce,b=>t(15,i=b));let{id:o}=e,{name:s}=e,{intervention_type:a}=e,{description:l}=e,{length_meters:u}=e;async function f(){let b=i.features.find(m=>m.id==o);try{t(0,s=await n.nameForRoute(b))}catch(m){window.alert(`Couldn't auto-name route: ${m}`)}}const c=[[]],p=()=>f();function g(){s=this.value,t(0,s)}function v(){a=this.__value,t(1,a)}function y(){a=this.__value,t(1,a)}function _(){a=this.__value,t(1,a)}function h(){a=this.__value,t(1,a)}function d(){l=this.value,t(2,l)}return r.$$set=b=>{"id"in b&&t(3,o=b.id),"name"in b&&t(0,s=b.name),"intervention_type"in b&&t(1,a=b.intervention_type),"description"in b&&t(2,l=b.description),"length_meters"in b&&t(4,u=b.length_meters)},[s,a,l,o,u,n,f,p,g,v,c,y,_,h,d]}class Ju extends ee{constructor(e){super(),te(this,e,Yu,Gu,ne,{id:3,name:0,intervention_type:1,description:2,length_meters:4})}}const Xu="Intervention",Wu=[{name:"Route",members:[{name:"name",type:"one-liner"},{name:"description",type:"textbox"},{name:"RouteType",oneOf:[{name:"OnRoad",description:"Directly on or parallel to the carriageway",members:[{name:"OnRoadType",oneOf:["FullSeparation",{value:"Stepped",description:"Raised above the road, but below the footway. Only appropriate on roads with speeds under 30 mph."},"PartSeparation","MandatoryLane","AdvisoryLane",{name:"NoSeparation",description:"If there's no physical separation between the road, why not? Justify why separation is unnecessary.",oneOf:["TrafficCalming","ModalFilters","LowSpeed"]}]},{name:"SourceOfSpace",oneOf:["ReallocateEntireLane","RoadDiet","PavementDiet","ReallocateVerge"]}]},{name:"OffRoad",oneOf:["ThroughPark","CanalTowpath"]}]},{name:"Users",oneOf:["Footpath","Cyclepath","SharedUseNoSeparation",{name:"SharedUseWithSeparation",members:[{name:"width_footpath",type:"number"},{name:"width_cyclepath",type:"number"}]}]}]},{name:"Crossing",members:[{name:"name",type:"one-liner"},{name:"description",type:"textbox"},{name:"CrossingType",oneOf:["Zebra",{name:"Signalised",members:[{name:"SignalisedCrossingType",oneOf:["Puffin","Toucan","Pegasus"]},{name:"CrossingActivation",oneOf:["PressButton","InductionLoop","FixedTimer"]},{name:"MaxTimeWaitingForGreen",description:"After activating the signal, what is the maximum time somebody will wait before getting a green light? (seconds)",type:"number"},{name:"GreenDuration",type:"number"}]},"SchoolCrossing","Refuge",{name:"GradeSeparated",members:[{name:"GradeSeparatedType",oneOf:["Bridge","Tunnel"]},{name:"AccessRamp",type:"checkbox"},{name:"Steps",type:"checkbox"}]}]},{name:"MatchesDesireLine",type:"checkbox"},{name:"MotorTrafficFlow",oneOf:["> 8000","3000 - 8000","< 3000"]},{name:"MotorTrafficSpeed",oneOf:["> 30 mph","20 - 30 mph","< 20 mph"]}]}],Vu={name:Xu,oneOf:Wu};function Ku(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].v2!==void 0&&(o.value=r[0].v2),e=new wt({props:o}),ae.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].v2,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function Zu(r,e,t){let{props:n}=e;n.v2||(n.v2={});let i=Vu;function o(s){r.$$.not_equal(n.v2,s)&&(n.v2=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class Qu extends ee{constructor(e){super(),te(this,e,Zu,Ku,ne,{props:0})}}const ef="Planning",tf=[{name:"name",type:"one-liner"},{name:"notes",type:"textbox"},{name:"reference_type",oneOf:["preapp","outline","reserved matters","local plan"]},{name:"size",type:"number"},{name:"size_units",oneOf:["number of units","floorspace","area"]},{name:"triage",oneOf:["No Comment","Standing Advice","Toolkit Assessment"]},{name:"recommendation",oneOf:["No Comment","No Objection","Standing Advice","Deferral","Approve subject to conditions and/or obligations","Refusal"]}],nf={name:ef,members:tf};function rf(r){let e,t,n;function i(s){r[2](s)}let o={spec:r[1]};return r[0].planning!==void 0&&(o.value=r[0].planning),e=new wt({props:o}),ae.push(()=>ve(e,"value",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,[a]){const l={};!t&&a&1&&(t=!0,l.value=s[0].planning,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function of(r,e,t){let{props:n}=e;n.planning||(n.planning={});let i=nf;function o(s){r.$$.not_equal(n.planning,s)&&(n.planning=s,t(0,n))}return r.$$set=s=>{"props"in s&&t(0,n=s.props)},[n,i,o]}class sf extends ee{constructor(e){super(),te(this,e,of,rf,ne,{props:0})}}function gi(r){let e,t,n,i,o;const s=r[10].default,a=xo(s,r,r[9],null);return{c(){e=$("div"),a&&a.c(),Ae(e,"border","solid 1px black"),Ae(e,"padding","10px")},m(l,u){k(l,e,u),a&&a.m(e,null),r[13](e),n=!0,i||(o=Y(e,"introend",r[14]),i=!0)},p(l,u){a&&a.p&&(!n||u&512)&&Io(a,s,l,l[9],n?Po(s,l[9],u,null):Fo(l[9]),null)},i(l){n||(M(a,l),l&&yn(()=>{n&&(t||(t=sn(e,_n,{duration:100},!0)),t.run(1))}),n=!0)},o(l){C(a,l),l&&(t||(t=sn(e,_n,{duration:100},!1)),t.run(0)),n=!1},d(l){l&&S(e),a&&a.d(l),r[13](null),l&&t&&t.end(),i=!1,o()}}}function lf(r){let e,t,n,i,o,s,a,l,u,f,c=r[4]&&gi(r);return{c(){e=$("button"),t=hr("svg"),n=hr("path"),i=A(),o=U(r[1]),s=A(),c&&c.c(),a=be(),x(n,"d","M9 5l7 7-7 7"),x(t,"style","tran"),x(t,"width","20"),x(t,"height","20"),x(t,"fill","none"),x(t,"stroke-linecap","round"),x(t,"stroke-linejoin","round"),x(t,"stroke-width","2"),x(t,"viewBox","0 0 24 24"),x(t,"stroke","currentColor"),x(t,"class","svelte-t7fpgu"),x(e,"aria-expanded",r[4]),x(e,"class","svelte-t7fpgu"),gr(e,"underlined",r[3])},m(p,g){k(p,e,g),E(e,t),E(t,n),E(e,i),E(e,o),k(p,s,g),c&&c.m(p,g),k(p,a,g),l=!0,u||(f=[Y(e,"click",r[5]),Y(e,"mouseenter",r[11]),Y(e,"mouseleave",r[12])],u=!0)},p(p,[g]){(!l||g&2)&&Le(o,p[1]),(!l||g&16)&&x(e,"aria-expanded",p[4]),(!l||g&8)&&gr(e,"underlined",p[3]),p[4]?c?(c.p(p,g),g&16&&M(c,1)):(c=gi(p),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(pe(),C(c,1,1,()=>{c=null}),de())},i(p){l||(M(c),l=!0)},o(p){C(c),l=!1},d(p){p&&(S(e),S(s),S(a)),c&&c.d(p),u=!1,Ie(f)}}}function af(r,e,t){let n,i,o,s;W(r,Ge,d=>t(7,o=d)),W(r,xe,d=>t(8,s=d));let{$$slots:a={},$$scope:l}=e,{id:u}=e,{label:f}=e;const c=()=>{xe.update(d=>d==u?null:u),s==u&&(an.set(null),an.set(u))};let p;function g(){p==null||p.scrollIntoView({behavior:"smooth"})}const v=()=>ln.set(u),y=()=>ln.set(null);function _(d){ae[d?"unshift":"push"](()=>{p=d,t(2,p)})}const h=()=>g();return r.$$set=d=>{"id"in d&&t(0,u=d.id),"label"in d&&t(1,f=d.label),"$$scope"in d&&t(9,l=d.$$scope)},r.$$.update=()=>{r.$$.dirty&257&&t(4,n=s==u),r.$$.dirty&129&&t(3,i=o==u)},[u,f,p,i,n,c,g,o,s,l,a,v,y,_,h]}class uf extends ee{constructor(e){super(),te(this,e,af,lf,ne,{id:0,label:1})}}function _i(r,e,t){const n=r.slice();return n[14]=e[t],n[15]=e,n[16]=t,n}function ff(r){let e,t,n;function i(s){r[10](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new gu({props:o}),ae.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function cf(r){let e,t,n;function i(s){r[9](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new wu({props:o}),ae.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function pf(r){let e,t,n;function i(s){r[8](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new sf({props:o}),ae.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function df(r){let e,t,n;function i(s){r[7](s,r[14])}let o={};return r[14].properties!==void 0&&(o.props=r[14].properties),e=new Qu({props:o}),ae.push(()=>ve(e,"props",i)),{c(){F(e.$$.fragment)},m(s,a){P(e,s,a),n=!0},p(s,a){r=s;const l={};!t&&a&2&&(t=!0,l.props=r[14].properties,we(()=>t=!1)),e.$set(l)},i(s){n||(M(e.$$.fragment,s),n=!0)},o(s){C(e.$$.fragment,s),n=!1},d(s){N(e,s)}}}function hf(r){let e,t,n,i,o;function s(f){r[4](f,r[14])}function a(f){r[5](f,r[14])}function l(f){r[6](f,r[14])}let u={id:r[14].id,length_meters:r[14].properties.length_meters};return r[14].properties.name!==void 0&&(u.name=r[14].properties.name),r[14].properties.intervention_type!==void 0&&(u.intervention_type=r[14].properties.intervention_type),r[14].properties.description!==void 0&&(u.description=r[14].properties.description),e=new Ju({props:u}),ae.push(()=>ve(e,"name",s)),ae.push(()=>ve(e,"intervention_type",a)),ae.push(()=>ve(e,"description",l)),{c(){F(e.$$.fragment)},m(f,c){P(e,f,c),o=!0},p(f,c){r=f;const p={};c&2&&(p.id=r[14].id),c&2&&(p.length_meters=r[14].properties.length_meters),!t&&c&2&&(t=!0,p.name=r[14].properties.name,we(()=>t=!1)),!n&&c&2&&(n=!0,p.intervention_type=r[14].properties.intervention_type,we(()=>n=!1)),!i&&c&2&&(i=!0,p.description=r[14].properties.description,we(()=>i=!1)),e.$set(p)},i(f){o||(M(e.$$.fragment,f),o=!0)},o(f){C(e.$$.fragment,f),o=!1},d(f){N(e,f)}}}function gf(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y;const _=[hf,df,pf,cf,ff],h=[];function d(m,w){return m[0]=="v1"?0:m[0]=="v2"?1:m[0]=="planning"?2:m[0]=="criticals"?3:m[0]=="atf4"?4:-1}~(e=d(r))&&(t=h[e]=_[e](r));function b(){return r[11](r[14])}return{c(){t&&t.c(),n=A(),i=$("br"),o=A(),s=$("br"),a=A(),l=$("div"),u=$("button"),u.textContent="Delete",f=A(),c=$("button"),c.textContent="Save",p=A(),x(u,"type","button"),x(c,"type","button"),Ae(l,"display","flex"),Ae(l,"justify-content","space-between")},m(m,w){~e&&h[e].m(m,w),k(m,n,w),k(m,i,w),k(m,o,w),k(m,s,w),k(m,a,w),k(m,l,w),E(l,u),E(l,f),E(l,c),k(m,p,w),g=!0,v||(y=[Y(u,"click",b),Y(c,"click",r[12])],v=!0)},p(m,w){r=m;let L=e;e=d(r),e===L?~e&&h[e].p(r,w):(t&&(pe(),C(h[L],1,1,()=>{h[L]=null}),de()),~e?(t=h[e],t?t.p(r,w):(t=h[e]=_[e](r),t.c()),M(t,1),t.m(n.parentNode,n)):t=null)},i(m){g||(M(t),g=!0)},o(m){C(t),g=!1},d(m){m&&(S(n),S(i),S(o),S(s),S(a),S(l),S(p)),~e&&h[e].d(m),v=!1,Ie(y)}}}function mi(r,e){let t,n,i;return n=new uf({props:{id:e[14].id,label:e[16]+1+") "+e[2](e[14]),$$slots:{default:[gf]},$$scope:{ctx:e}}}),{key:r,first:null,c(){t=be(),F(n.$$.fragment),this.first=t},m(o,s){k(o,t,s),P(n,o,s),i=!0},p(o,s){e=o;const a={};s&2&&(a.id=e[14].id),s&2&&(a.label=e[16]+1+") "+e[2](e[14])),s&131075&&(a.$$scope={dirty:s,ctx:e}),n.$set(a)},i(o){i||(M(n.$$.fragment,o),i=!0)},o(o){C(n.$$.fragment,o),i=!1},d(o){o&&S(t),N(n,o)}}}function _f(r){let e=[],t=new Map,n,i,o,s,a=He(r[1].features);const l=u=>u[14].id;for(let u=0;ut(13,n=h)),W(r,ce,h=>t(1,i=h));let{schema:o}=e;function s(h){var b,m,w,L,O,R,I;if(o=="planning")return((b=h.properties.planning)==null?void 0:b.name)||"Untitled polygon";if(o=="v2")return((w=(m=h.properties.v2)==null?void 0:m.Route)==null?void 0:w.name)||((O=(L=h.properties.v2)==null?void 0:L.Crossing)==null?void 0:O.name)||"Untitled intervention";if(o=="criticals")return((R=h.properties.criticals)==null?void 0:R.name)||"Untitled issue";if(o=="atf4")return((I=h.properties.atf4)==null?void 0:I.name)||"Untitled intervention";if(h.properties.name)return h.properties.name;var d=h.properties.intervention_type;return d=="other"&&(h.geometry.type=="Point"?d="point":h.geometry.type=="LineString"?d="line":d="polygon"),`Untitled ${d}`}function a(h){if(h.key=="Delete"){const d=h.target.tagName;if(d=="INPUT"||d=="TEXTAREA")return;h.preventDefault();const b=n;b&&_r(b)}}function l(h,d){r.$$.not_equal(d.properties.name,h)&&(d.properties.name=h,ce.set(i))}function u(h,d){r.$$.not_equal(d.properties.intervention_type,h)&&(d.properties.intervention_type=h,ce.set(i))}function f(h,d){r.$$.not_equal(d.properties.description,h)&&(d.properties.description=h,ce.set(i))}function c(h,d){r.$$.not_equal(d.properties,h)&&(d.properties=h,ce.set(i))}function p(h,d){r.$$.not_equal(d.properties,h)&&(d.properties=h,ce.set(i))}function g(h,d){r.$$.not_equal(d.properties,h)&&(d.properties=h,ce.set(i))}function v(h,d){r.$$.not_equal(d.properties,h)&&(d.properties=h,ce.set(i))}const y=h=>_r(h.id),_=()=>xe.set(null);return r.$$set=h=>{"schema"in h&&t(0,o=h.schema)},[o,i,s,a,l,u,f,c,p,g,v,y,_]}class bf extends ee{constructor(e){super(),te(this,e,mf,_f,ne,{schema:0})}}let re;const qe=new Array(128).fill(void 0);qe.push(void 0,null,!0,!1);function X(r){return qe[r]}let Ft=qe.length;function yf(r){r<132||(qe[r]=Ft,Ft=r)}function gt(r){const e=X(r);return yf(r),e}let at=0,$t=null;function Pt(){return($t===null||$t.byteLength===0)&&($t=new Uint8Array(re.memory.buffer)),$t}const tn=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},vf=typeof tn.encodeInto=="function"?function(r,e){return tn.encodeInto(r,e)}:function(r,e){const t=tn.encode(r);return e.set(t),{read:r.length,written:t.length}};function On(r,e,t){if(t===void 0){const a=tn.encode(r),l=e(a.length)>>>0;return Pt().subarray(l,l+a.length).set(a),at=a.length,l}let n=r.length,i=e(n)>>>0;const o=Pt();let s=0;for(;s127)break;o[i+s]=a}if(s!==n){s!==0&&(r=r.slice(s)),i=t(i,n,n=s+r.length*3)>>>0;const a=Pt().subarray(i+s,i+n),l=vf(r,a);s+=l.written}return at=s,i}function Mt(r){return r==null}let Ct=null;function ge(){return(Ct===null||Ct.byteLength===0)&&(Ct=new Int32Array(re.memory.buffer)),Ct}const io=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&io.decode();function Qe(r,e){return r=r>>>0,io.decode(Pt().subarray(r,r+e))}function ye(r){Ft===qe.length&&qe.push(qe.length+1);const e=Ft;return Ft=qe[e],qe[e]=r,e}let Lt=null;function wf(){return(Lt===null||Lt.byteLength===0)&&(Lt=new Float64Array(re.memory.buffer)),Lt}let Tt=null;function kf(){return(Tt===null||Tt.byteLength===0)&&(Tt=new BigInt64Array(re.memory.buffer)),Tt}function Zn(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){const i=r.length;let o="[";i>0&&(o+=Zn(r[0]));for(let s=1;s1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} +${r.stack}`:n}function Sf(r,e){const t=e(r.length*1)>>>0;return Pt().set(r,t/1),at=r.length,t}function Rn(r,e){try{return r.apply(this,e)}catch(t){re.__wbindgen_exn_store(ye(t))}}let Ef=class Qn{static __wrap(e){e=e>>>0;const t=Object.create(Qn.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();re.__wbg_routeinfo_free(e)}constructor(e){try{const o=re.__wbindgen_add_to_stack_pointer(-16),s=Sf(e,re.__wbindgen_malloc),a=at;re.routeinfo_new(o,s,a);var t=ge()[o/4+0],n=ge()[o/4+1],i=ge()[o/4+2];if(i)throw gt(n);return Qn.__wrap(t)}finally{re.__wbindgen_add_to_stack_pointer(16)}}nameForRoute(e){let t,n;try{const f=re.__wbindgen_add_to_stack_pointer(-16);re.routeinfo_nameForRoute(f,this.__wbg_ptr,ye(e));var i=ge()[f/4+0],o=ge()[f/4+1],s=ge()[f/4+2],a=ge()[f/4+3],l=i,u=o;if(a)throw l=0,u=0,gt(s);return t=l,n=u,Qe(l,u)}finally{re.__wbindgen_add_to_stack_pointer(16),re.__wbindgen_free(t,n)}}speedLimitForRoute(e){let t,n;try{const f=re.__wbindgen_add_to_stack_pointer(-16);re.routeinfo_speedLimitForRoute(f,this.__wbg_ptr,ye(e));var i=ge()[f/4+0],o=ge()[f/4+1],s=ge()[f/4+2],a=ge()[f/4+3],l=i,u=o;if(a)throw l=0,u=0,gt(s);return t=l,n=u,Qe(l,u)}finally{re.__wbindgen_add_to_stack_pointer(16),re.__wbindgen_free(t,n)}}allSpeedLimits(){let e,t;try{const u=re.__wbindgen_add_to_stack_pointer(-16);re.routeinfo_allSpeedLimits(u,this.__wbg_ptr);var n=ge()[u/4+0],i=ge()[u/4+1],o=ge()[u/4+2],s=ge()[u/4+3],a=n,l=i;if(s)throw a=0,l=0,gt(o);return e=a,t=l,Qe(a,l)}finally{re.__wbindgen_add_to_stack_pointer(16),re.__wbindgen_free(e,t)}}renderLaneDetailsForRoute(e){let t,n;try{const f=re.__wbindgen_add_to_stack_pointer(-16);re.routeinfo_renderLaneDetailsForRoute(f,this.__wbg_ptr,ye(e));var i=ge()[f/4+0],o=ge()[f/4+1],s=ge()[f/4+2],a=ge()[f/4+3],l=i,u=o;if(a)throw l=0,u=0,gt(s);return t=l,n=u,Qe(l,u)}finally{re.__wbindgen_add_to_stack_pointer(16),re.__wbindgen_free(t,n)}}};async function Mf(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.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",n);else throw n}const t=await r.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}}function $f(){const r={};return r.wbg={},r.wbg.__wbindgen_object_drop_ref=function(e){gt(e)},r.wbg.__wbindgen_boolean_get=function(e){const t=X(e);return typeof t=="boolean"?t?1:0:2},r.wbg.__wbindgen_string_get=function(e,t){const n=X(t),i=typeof n=="string"?n:void 0;var o=Mt(i)?0:On(i,re.__wbindgen_malloc,re.__wbindgen_realloc),s=at;ge()[e/4+1]=s,ge()[e/4+0]=o},r.wbg.__wbindgen_error_new=function(e,t){const n=new Error(Qe(e,t));return ye(n)},r.wbg.__wbindgen_is_bigint=function(e){return typeof X(e)=="bigint"},r.wbg.__wbindgen_bigint_from_i64=function(e){return ye(e)},r.wbg.__wbindgen_jsval_eq=function(e,t){return X(e)===X(t)},r.wbg.__wbindgen_number_get=function(e,t){const n=X(t),i=typeof n=="number"?n:void 0;wf()[e/8+1]=Mt(i)?0:i,ge()[e/4+0]=!Mt(i)},r.wbg.__wbindgen_is_object=function(e){const t=X(e);return typeof t=="object"&&t!==null},r.wbg.__wbindgen_in=function(e,t){return X(e)in X(t)},r.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return ye(t)},r.wbg.__wbindgen_is_undefined=function(e){return X(e)===void 0},r.wbg.__wbindgen_string_new=function(e,t){const n=Qe(e,t);return ye(n)},r.wbg.__wbindgen_jsval_loose_eq=function(e,t){return X(e)==X(t)},r.wbg.__wbindgen_object_clone_ref=function(e){const t=X(e);return ye(t)},r.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(e,t){const n=X(e)[X(t)];return ye(n)},r.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return ye(e)},r.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const n=X(t).stack,i=On(n,re.__wbindgen_malloc,re.__wbindgen_realloc),o=at;ge()[e/4+1]=o,ge()[e/4+0]=i},r.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let n,i;try{n=e,i=t,console.error(Qe(e,t))}finally{re.__wbindgen_free(n,i)}},r.wbg.__wbg_debug_917e579618ee56f5=function(e){console.debug(X(e))},r.wbg.__wbg_error_ea7597dedb63d9a4=function(e){console.error(X(e))},r.wbg.__wbg_info_fc2a17f38101c41c=function(e){console.info(X(e))},r.wbg.__wbg_log_003c998d6df63565=function(e){console.log(X(e))},r.wbg.__wbg_warn_ebfcadd0780df93a=function(e){console.warn(X(e))},r.wbg.__wbg_get_e52aaca45f37b337=function(e,t){const n=X(e)[t>>>0];return ye(n)},r.wbg.__wbg_length_070e3265c186df02=function(e){return X(e).length},r.wbg.__wbindgen_is_function=function(e){return typeof X(e)=="function"},r.wbg.__wbg_next_3975dcca26737a22=function(e){const t=X(e).next;return ye(t)},r.wbg.__wbg_next_5a9700550e162aa3=function(){return Rn(function(e){const t=X(e).next();return ye(t)},arguments)},r.wbg.__wbg_done_a184612220756243=function(e){return X(e).done},r.wbg.__wbg_value_6cc144c1d9645dd5=function(e){const t=X(e).value;return ye(t)},r.wbg.__wbg_iterator_c1677479667ea090=function(){return ye(Symbol.iterator)},r.wbg.__wbg_get_363c3b466fe4896b=function(){return Rn(function(e,t){const n=Reflect.get(X(e),X(t));return ye(n)},arguments)},r.wbg.__wbg_call_f96b398515635514=function(){return Rn(function(e,t){const n=X(e).call(X(t));return ye(n)},arguments)},r.wbg.__wbg_isArray_07d89ced8fb14171=function(e){return Array.isArray(X(e))},r.wbg.__wbg_instanceof_ArrayBuffer_de688b806c28ff28=function(e){let t;try{t=X(e)instanceof ArrayBuffer}catch{t=!1}return t},r.wbg.__wbg_isSafeInteger_fcdf4c4f25c86778=function(e){return Number.isSafeInteger(X(e))},r.wbg.__wbg_entries_c3e06bf0354f5d20=function(e){const t=Object.entries(X(e));return ye(t)},r.wbg.__wbg_buffer_fcbfb6d88b2732e9=function(e){const t=X(e).buffer;return ye(t)},r.wbg.__wbg_new_bc5d9aad3f9ac80e=function(e){const t=new Uint8Array(X(e));return ye(t)},r.wbg.__wbg_set_4b3aa8445ac1e91c=function(e,t,n){X(e).set(X(t),n>>>0)},r.wbg.__wbg_length_d9c4ded7e708c6a1=function(e){return X(e).length},r.wbg.__wbg_instanceof_Uint8Array_4733577ba827276b=function(e){let t;try{t=X(e)instanceof Uint8Array}catch{t=!1}return t},r.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const n=X(t),i=typeof n=="bigint"?n:void 0;kf()[e/8+1]=Mt(i)?BigInt(0):i,ge()[e/4+0]=!Mt(i)},r.wbg.__wbindgen_debug_string=function(e,t){const n=Zn(X(t)),i=On(n,re.__wbindgen_malloc,re.__wbindgen_realloc),o=at;ge()[e/4+1]=o,ge()[e/4+0]=i},r.wbg.__wbindgen_throw=function(e,t){throw new Error(Qe(e,t))},r.wbg.__wbindgen_memory=function(){const e=re.memory;return ye(e)},r}function Cf(r,e){return re=r.exports,oo.__wbindgen_wasm_module=e,Tt=null,Lt=null,Ct=null,$t=null,re}async function oo(r){if(re!==void 0)return re;typeof r>"u"&&(r="/atip/capitalize_auto_form/assets/route_info_bg.wasm");const e=$f();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:t,module:n}=await Mf(await r,e);return Cf(t,n)}class Lf{constructor(){J(this,"inner");this.inner=null}async loadFile(e){await oo(),console.log(`Grabbing A/B Street map model data from ${e}`);let n=await(await fetch(e)).arrayBuffer();this.inner=new Ef(new Uint8Array(n)),console.log("RouteInfo is ready!")}nameForRoute(e){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.nameForRoute(e)}speedLimitForRoute(e){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.speedLimitForRoute(e)}allSpeedLimits(){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.allSpeedLimits()}renderLaneDetailsForRoute(e){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return JSON.parse(this.inner.renderLaneDetailsForRoute(e))}}sr(Lf);function Tf(){return new Worker("/atip/capitalize_auto_form/assets/worker-90ea6d15.js")}function Af(r){let e,t,n,i,o,s,a,l,u,f,c,p,g,v,y,_,h,d,b,m,w,L,O,R,I,B,D;return v=new zo({props:{boundaryGeojson:r[2]}}),_=new Ua({props:{authorityName:r[3],schema:r[5]}}),m=new bf({props:{schema:r[5]}}),R=new Ia({}),{c(){e=$("div"),t=$("div"),n=$("button"),n.textContent="Home",i=A(),o=$("button"),o.textContent="About",s=A(),a=$("button"),a.textContent="Instructions",l=A(),u=$("p"),u.textContent=`${qo(r[5])} mode`,f=A(),c=$("h1"),p=U(r[3]),g=A(),F(v.$$.fragment),y=A(),F(_.$$.fragment),h=A(),d=$("br"),b=A(),F(m.$$.fragment),w=A(),L=$("hr"),O=A(),F(R.$$.fragment),x(n,"type","button"),x(o,"type","button"),x(a,"type","button"),x(e,"slot","sidebar")},m(j,T){k(j,e,T),E(e,t),E(t,n),E(t,i),E(t,o),E(t,s),E(t,a),E(e,l),E(e,u),E(e,f),E(e,c),E(c,p),E(c,g),P(v,c,null),E(e,y),P(_,e,null),E(e,h),E(e,d),E(e,b),P(m,e,null),E(e,w),E(e,L),E(e,O),P(R,e,null),I=!0,B||(D=[Y(n,"click",r[9]),Y(o,"click",r[7]),Y(a,"click",r[8])],B=!0)},p(j,T){const z={};T&4&&(z.boundaryGeojson=j[2]),v.$set(z)},i(j){I||(M(v.$$.fragment,j),M(_.$$.fragment,j),M(m.$$.fragment,j),M(R.$$.fragment,j),I=!0)},o(j){C(v.$$.fragment,j),C(_.$$.fragment,j),C(m.$$.fragment,j),C(R.$$.fragment,j),I=!1},d(j){j&&S(e),N(v),N(_),N(m),N(R),B=!1,Ie(D)}}}function Of(r){let e,t,n,i,o,s,a,l,u,f,c,p;return e=new xs({props:{boundaryGeojson:r[2]}}),n=new Yo({props:{schema:r[5]}}),o=new Fs({}),a=new ya({props:{routeSnapperUrl:r[6],schema:r[5]}}),u=new Jo({props:{style:r[4]}}),c=new Xo({props:{schema:r[5]}}),{c(){F(e.$$.fragment),t=A(),F(n.$$.fragment),i=A(),F(o.$$.fragment),s=A(),F(a.$$.fragment),l=A(),F(u.$$.fragment),f=A(),F(c.$$.fragment)},m(g,v){P(e,g,v),k(g,t,v),P(n,g,v),k(g,i,v),P(o,g,v),k(g,s,v),P(a,g,v),k(g,l,v),P(u,g,v),k(g,f,v),P(c,g,v),p=!0},p(g,v){const y={};v&4&&(y.boundaryGeojson=g[2]),e.$set(y)},i(g){p||(M(e.$$.fragment,g),M(n.$$.fragment,g),M(o.$$.fragment,g),M(a.$$.fragment,g),M(u.$$.fragment,g),M(c.$$.fragment,g),p=!0)},o(g){C(e.$$.fragment,g),C(n.$$.fragment,g),C(o.$$.fragment,g),C(a.$$.fragment,g),C(u.$$.fragment,g),C(c.$$.fragment,g),p=!1},d(g){g&&(S(t),S(i),S(s),S(l),S(f)),N(e,g),N(n,g),N(o,g),N(a,g),N(u,g),N(c,g)}}}function Rf(r){let e,t,n;return t=new Go({props:{style:r[4],$$slots:{default:[Of]},$$scope:{ctx:r}}}),{c(){e=$("div"),F(t.$$.fragment),x(e,"slot","main")},m(i,o){k(i,e,o),P(t,e,null),n=!0},p(i,o){const s={};o&32772&&(s.$$scope={dirty:o,ctx:i}),t.$set(s)},i(i){n||(M(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){i&&S(e),N(t)}}}function xf(r){let e,t,n,i,o,s,a,l;e=new Uo({props:{$$slots:{main:[Rf],sidebar:[Af]},$$scope:{ctx:r}}});function u(g){r[10](g)}let f={};r[0]!==void 0&&(f.open=r[0]),n=new Do({props:f}),ae.push(()=>ve(n,"open",u));function c(g){r[11](g)}let p={schema:r[5]};return r[1]!==void 0&&(p.open=r[1]),s=new Ya({props:p}),ae.push(()=>ve(s,"open",c)),{c(){F(e.$$.fragment),t=A(),F(n.$$.fragment),o=A(),F(s.$$.fragment)},m(g,v){P(e,g,v),k(g,t,v),P(n,g,v),k(g,o,v),P(s,g,v),l=!0},p(g,[v]){const y={};v&32772&&(y.$$scope={dirty:v,ctx:g}),e.$set(y);const _={};!i&&v&1&&(i=!0,_.open=g[0],we(()=>i=!1)),n.$set(_);const h={};!a&&v&2&&(a=!0,h.open=g[1],we(()=>a=!1)),s.$set(h)},i(g){l||(M(e.$$.fragment,g),M(n.$$.fragment,g),M(s.$$.fragment,g),l=!0)},o(g){C(e.$$.fragment,g),C(n.$$.fragment,g),C(s.$$.fragment,g),l=!1},d(g){g&&(S(t),S(o)),N(e,g),N(n,g),N(s,g)}}}function If(r,e,t){let n=!1,i=!1;const o=new URLSearchParams(window.location.search);let s=o.get("authority"),a=o.get("style")||"streets",l=o.get("schema")||"v1",u=`https://atip.uk/route-snappers/v2.1/${s}.bin.gz`,f=`https://atip.uk/route-info/v2/${s}.bin.gz`;function c(){t(0,n=!n),t(1,i=!1)}function p(){t(1,i=!i),t(0,n=!1)}let g;Ht(async()=>{t(2,g=await v());const d=Ci(new Tf);let b=await new d;await b.loadFile(f),vt.set(b)});async function v(){const b=await(await fetch(Ho)).text(),m=JSON.parse(b);return m.features=m.features.filter(w=>{var L;return((L=w.properties)==null?void 0:L.name)==s}),m.features.length===0&&(window.location.href=`/?error=Authority name not found: ${s}`),m}const y=()=>window.location.href="index.html";function _(d){n=d,t(0,n)}function h(d){i=d,t(1,i)}return[n,i,g,s,a,l,u,c,p,y,_,h]}class Ff extends ee{constructor(e){super(),te(this,e,If,xf,ne,{})}}new Ff({target:document.getElementById("app")}); diff --git a/assets/nested2-6dc8cad0.js b/capitalize_auto_form/assets/nested2-cfa0a61d.js similarity index 98% rename from assets/nested2-6dc8cad0.js rename to capitalize_auto_form/assets/nested2-cfa0a61d.js index b53792b60..5494c03dd 100644 --- a/assets/nested2-6dc8cad0.js +++ b/capitalize_auto_form/assets/nested2-cfa0a61d.js @@ -1,2 +1,2 @@ -import{S as we,i as ye,s as ke,H as N,I as B,t as g,j as y,L as F,U as ue,M as ve,a3 as Se,C as Y,G as Ce,F as je,o as ie,e as T,q as j,p as w,am as ce,r as R,d as v,v as i,O as te,J as re,w as H,k as S,y as Me,Q as me,N as Ne,A as pe,l as Be,a2 as Fe,x as Le}from"./maplibre_helpers-09c65b90.js";import{i as Oe}from"./all-cc94300b.js";import{L as Ie,g as X,Z as ze,p as Je,I as Te,B as Ee,q as Ge,M as qe,m as Ae,C as De}from"./ZoomOutMap-bbe13584.js";function _e(s,e,r){const t=s.slice();return t[18]=e[r],t}function He(s){let e;return{c(){e=w("Home")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function $e(s){let e,r;return e=new Ne({props:{errorMessage:s[5]}}),{c(){N(e.$$.fragment)},m(t,n){B(e,t,n),r=!0},p(t,n){const o={};n&32&&(o.errorMessage=t[5]),e.$set(o)},i(t){r||(g(e.$$.fragment,t),r=!0)},o(t){y(e.$$.fragment,t),r=!1},d(t){F(e,t)}}}function Ue(s){let e;return{c(){e=w("Clear")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Ze(s){let e,r,t,n,o,c;return t=new Y({props:{$$slots:{default:[Ue]},$$scope:{ctx:s}}}),t.$on("click",s[12]),{c(){e=T("input"),r=j(),N(t.$$.fragment),R(e,"type","text"),R(e,"class","govuk-input govuk-input--width-10"),R(e,"id","filterText")},m(u,$){v(u,e,$),pe(e,s[1]),v(u,r,$),B(t,u,$),n=!0,o||(c=Be(e,"input",s[11]),o=!0)},p(u,$){$&2&&e.value!==u[1]&&pe(e,u[1]);const l={};$&2097152&&(l.$$scope={dirty:$,ctx:u}),t.$set(l)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){y(t.$$.fragment,u),n=!1},d(u){u&&(S(e),S(r)),F(t,u),o=!1,c()}}}function de(s){let e,r;return e=new De({props:{label:`${s[18].scheme_reference}: ${s[18].num_features} features`,$$slots:{default:[Re]},$$scope:{ctx:s}}}),{c(){N(e.$$.fragment)},m(t,n){B(e,t,n),r=!0},p(t,n){const o={};n&1&&(o.label=`${t[18].scheme_reference}: ${t[18].num_features} features`),n&2097153&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){r||(g(e.$$.fragment,t),r=!0)},o(t){y(e.$$.fragment,t),r=!1},d(t){F(e,t)}}}function Pe(s){let e;return{c(){e=w("Show on map")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Qe(s){let e;return{c(){e=w("Edit scheme")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Re(s){let e,r,t=s[18].authority_or_region+"",n,o,c,u,$=s[18].capital_scheme_id+"",l,p,L,U,E=s[18].funding_programme+"",O,G,h,z,q,I,D,a;function _(){return s[13](s[18])}z=new Y({props:{$$slots:{default:[Pe]},$$scope:{ctx:s}}}),z.$on("click",_);function J(){return s[14](s[18])}return I=new Y({props:{$$slots:{default:[Qe]},$$scope:{ctx:s}}}),I.$on("click",J),{c(){e=T("p"),r=w("Authority or region: "),n=w(t),o=j(),c=T("p"),u=w("Capital scheme ID: "),l=w($),p=j(),L=T("p"),U=w("Funding programme: "),O=w(E),G=j(),h=T("div"),N(z.$$.fragment),q=j(),N(I.$$.fragment),D=j(),R(h,"class","govuk-button-group")},m(m,k){v(m,e,k),i(e,r),i(e,n),v(m,o,k),v(m,c,k),i(c,u),i(c,l),v(m,p,k),v(m,L,k),i(L,U),i(L,O),v(m,G,k),v(m,h,k),B(z,h,null),i(h,q),B(I,h,null),v(m,D,k),a=!0},p(m,k){s=m,(!a||k&1)&&t!==(t=s[18].authority_or_region+"")&&H(n,t),(!a||k&1)&&$!==($=s[18].capital_scheme_id+"")&&H(l,$),(!a||k&1)&&E!==(E=s[18].funding_programme+"")&&H(O,E);const K={};k&2097152&&(K.$$scope={dirty:k,ctx:s}),z.$set(K);const Z={};k&2097152&&(Z.$$scope={dirty:k,ctx:s}),I.$set(Z)},i(m){a||(g(z.$$.fragment,m),g(I.$$.fragment,m),a=!0)},o(m){y(z.$$.fragment,m),y(I.$$.fragment,m),a=!1},d(m){m&&(S(e),S(o),S(c),S(p),S(L),S(G),S(h),S(D)),F(z),F(I)}}}function ge(s){let e=s[2].has(s[18].scheme_reference),r,t,n=e&&de(s);return{c(){n&&n.c(),r=Fe()},m(o,c){n&&n.m(o,c),v(o,r,c),t=!0},p(o,c){c&5&&(e=o[2].has(o[18].scheme_reference)),e?n?(n.p(o,c),c&5&&g(n,1)):(n=de(o),n.c(),g(n,1),n.m(r.parentNode,r)):n&&(te(),y(n,1,1,()=>{n=null}),re())},i(o){t||(g(n),t=!0)},o(o){y(n),t=!1},d(o){o&&S(r),n&&n.d(o)}}}function Ke(s){let e,r,t,n,o,c,u,$,l,p,L,U,E,O,G,h,z,q=s[2].size+"",I,D,a=s[3].route+"",_,J,m=s[3].area+"",k,K,Z=s[3].crossing+"",x,ne,V=s[3].other+"",ee,se,oe,W,A;r=new Y({props:{$$slots:{default:[He]},$$scope:{ctx:s}}}),r.$on("click",s[10]),u=new ze({props:{boundaryGeojson:s[4]}});let C=s[5]&&$e(s);p=new Ce({props:{label:"Load from GeoJSON",id:"load-geojson",loadFile:s[7]}}),O=new je({props:{label:"Filter by any field",id:"filterText",$$slots:{default:[Ze]},$$scope:{ctx:s}}});let P=ie(s[0]),b=[];for(let f=0;fy(b[f],1,1,()=>{b[f]=null});return{c(){e=T("div"),N(r.$$.fragment),t=j(),n=T("div"),o=T("h1"),o.textContent="Browse schemes",c=j(),N(u.$$.fragment),$=j(),C&&C.c(),l=j(),N(p.$$.fragment),L=j(),U=T("br"),E=j(),N(O.$$.fragment),G=j(),h=T("p"),z=w("Showing "),I=w(q),D=w(" schemes ("),_=w(a),J=w(" routes, "),k=w(m),K=w(` areas, +import{S as we,i as ye,s as ke,H as N,I as B,t as g,j as y,L as F,U as ue,M as ve,a3 as Se,C as Y,G as Ce,F as je,o as ie,e as T,q as j,p as w,am as ce,r as R,d as v,v as i,O as te,J as re,w as H,k as S,y as Me,Q as me,N as Ne,A as pe,l as Be,a2 as Fe,x as Le}from"./maplibre_helpers-09c65b90.js";import{i as Oe}from"./all-ad91baca.js";import{L as Ie,g as X,Z as ze,p as Je,I as Te,B as Ee,q as Ge,M as qe,m as Ae,C as De}from"./ZoomOutMap-58aba399.js";function _e(s,e,r){const t=s.slice();return t[18]=e[r],t}function He(s){let e;return{c(){e=w("Home")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function $e(s){let e,r;return e=new Ne({props:{errorMessage:s[5]}}),{c(){N(e.$$.fragment)},m(t,n){B(e,t,n),r=!0},p(t,n){const o={};n&32&&(o.errorMessage=t[5]),e.$set(o)},i(t){r||(g(e.$$.fragment,t),r=!0)},o(t){y(e.$$.fragment,t),r=!1},d(t){F(e,t)}}}function Ue(s){let e;return{c(){e=w("Clear")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Ze(s){let e,r,t,n,o,c;return t=new Y({props:{$$slots:{default:[Ue]},$$scope:{ctx:s}}}),t.$on("click",s[12]),{c(){e=T("input"),r=j(),N(t.$$.fragment),R(e,"type","text"),R(e,"class","govuk-input govuk-input--width-10"),R(e,"id","filterText")},m(u,$){v(u,e,$),pe(e,s[1]),v(u,r,$),B(t,u,$),n=!0,o||(c=Be(e,"input",s[11]),o=!0)},p(u,$){$&2&&e.value!==u[1]&&pe(e,u[1]);const l={};$&2097152&&(l.$$scope={dirty:$,ctx:u}),t.$set(l)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){y(t.$$.fragment,u),n=!1},d(u){u&&(S(e),S(r)),F(t,u),o=!1,c()}}}function de(s){let e,r;return e=new De({props:{label:`${s[18].scheme_reference}: ${s[18].num_features} features`,$$slots:{default:[Re]},$$scope:{ctx:s}}}),{c(){N(e.$$.fragment)},m(t,n){B(e,t,n),r=!0},p(t,n){const o={};n&1&&(o.label=`${t[18].scheme_reference}: ${t[18].num_features} features`),n&2097153&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){r||(g(e.$$.fragment,t),r=!0)},o(t){y(e.$$.fragment,t),r=!1},d(t){F(e,t)}}}function Pe(s){let e;return{c(){e=w("Show on map")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Qe(s){let e;return{c(){e=w("Edit scheme")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Re(s){let e,r,t=s[18].authority_or_region+"",n,o,c,u,$=s[18].capital_scheme_id+"",l,p,L,U,E=s[18].funding_programme+"",O,G,h,z,q,I,D,a;function _(){return s[13](s[18])}z=new Y({props:{$$slots:{default:[Pe]},$$scope:{ctx:s}}}),z.$on("click",_);function J(){return s[14](s[18])}return I=new Y({props:{$$slots:{default:[Qe]},$$scope:{ctx:s}}}),I.$on("click",J),{c(){e=T("p"),r=w("Authority or region: "),n=w(t),o=j(),c=T("p"),u=w("Capital scheme ID: "),l=w($),p=j(),L=T("p"),U=w("Funding programme: "),O=w(E),G=j(),h=T("div"),N(z.$$.fragment),q=j(),N(I.$$.fragment),D=j(),R(h,"class","govuk-button-group")},m(m,k){v(m,e,k),i(e,r),i(e,n),v(m,o,k),v(m,c,k),i(c,u),i(c,l),v(m,p,k),v(m,L,k),i(L,U),i(L,O),v(m,G,k),v(m,h,k),B(z,h,null),i(h,q),B(I,h,null),v(m,D,k),a=!0},p(m,k){s=m,(!a||k&1)&&t!==(t=s[18].authority_or_region+"")&&H(n,t),(!a||k&1)&&$!==($=s[18].capital_scheme_id+"")&&H(l,$),(!a||k&1)&&E!==(E=s[18].funding_programme+"")&&H(O,E);const K={};k&2097152&&(K.$$scope={dirty:k,ctx:s}),z.$set(K);const Z={};k&2097152&&(Z.$$scope={dirty:k,ctx:s}),I.$set(Z)},i(m){a||(g(z.$$.fragment,m),g(I.$$.fragment,m),a=!0)},o(m){y(z.$$.fragment,m),y(I.$$.fragment,m),a=!1},d(m){m&&(S(e),S(o),S(c),S(p),S(L),S(G),S(h),S(D)),F(z),F(I)}}}function ge(s){let e=s[2].has(s[18].scheme_reference),r,t,n=e&&de(s);return{c(){n&&n.c(),r=Fe()},m(o,c){n&&n.m(o,c),v(o,r,c),t=!0},p(o,c){c&5&&(e=o[2].has(o[18].scheme_reference)),e?n?(n.p(o,c),c&5&&g(n,1)):(n=de(o),n.c(),g(n,1),n.m(r.parentNode,r)):n&&(te(),y(n,1,1,()=>{n=null}),re())},i(o){t||(g(n),t=!0)},o(o){y(n),t=!1},d(o){o&&S(r),n&&n.d(o)}}}function Ke(s){let e,r,t,n,o,c,u,$,l,p,L,U,E,O,G,h,z,q=s[2].size+"",I,D,a=s[3].route+"",_,J,m=s[3].area+"",k,K,Z=s[3].crossing+"",x,ne,V=s[3].other+"",ee,se,oe,W,A;r=new Y({props:{$$slots:{default:[He]},$$scope:{ctx:s}}}),r.$on("click",s[10]),u=new ze({props:{boundaryGeojson:s[4]}});let C=s[5]&&$e(s);p=new Ce({props:{label:"Load from GeoJSON",id:"load-geojson",loadFile:s[7]}}),O=new je({props:{label:"Filter by any field",id:"filterText",$$slots:{default:[Ze]},$$scope:{ctx:s}}});let P=ie(s[0]),b=[];for(let f=0;fy(b[f],1,1,()=>{b[f]=null});return{c(){e=T("div"),N(r.$$.fragment),t=j(),n=T("div"),o=T("h1"),o.textContent="Browse schemes",c=j(),N(u.$$.fragment),$=j(),C&&C.c(),l=j(),N(p.$$.fragment),L=j(),U=T("br"),E=j(),N(O.$$.fragment),G=j(),h=T("p"),z=w("Showing "),I=w(q),D=w(" schemes ("),_=w(a),J=w(" routes, "),k=w(m),K=w(` areas, `),x=w(Z),ne=w(" crossings, "),ee=w(V),se=w(" other)"),oe=j(),W=T("ul");for(let f=0;f{C=null}),re());const ae={};if(d&2097154&&(ae.$$scope={dirty:d,ctx:f}),O.$set(ae),(!A||d&4)&&q!==(q=f[2].size+"")&&H(I,q),(!A||d&8)&&a!==(a=f[3].route+"")&&H(_,a),(!A||d&8)&&m!==(m=f[3].area+"")&&H(k,m),(!A||d&8)&&Z!==(Z=f[3].crossing+"")&&H(x,Z),(!A||d&8)&&V!==(V=f[3].other+"")&&H(ee,V),d&773){P=ie(f[0]);let M;for(M=0;M${r}${t}`;return e+="",e}function xe(s,e,r){let t,n;ue(s,X,a=>r(4,t=a)),ue(s,Ae,a=>r(15,n=a)),ve(()=>{Oe()});let c=new URLSearchParams(window.location.search).get("style")||"streets",u="",$=[],l="",p=new Set,L={area:0,route:0,crossing:0,other:0};Se(()=>{X.set(null)});function U(a){try{let _=JSON.parse(a);X.set(_),E(_),r(5,u=""),n==null||n.fitBounds(me(_),{padding:20,animate:!1})}catch(_){r(5,u=`Couldn't load schemes from a file: ${_}`)}}function E(a){let _={};for(let[J,m]of Object.entries(a.schemes))_[J]={scheme_reference:J,num_features:0,...m};for(let J of a.features)_[J.properties.scheme_reference].num_features++;r(0,$=Object.values(_))}function O(a){let _={type:"FeatureCollection",features:t.features.filter(J=>J.properties.scheme_reference==a.scheme_reference)};n==null||n.fitBounds(me(_),{padding:20,animate:!1})}function G(a){let _={type:"FeatureCollection",features:t.features.filter(m=>m.properties.scheme_reference==a.scheme_reference)},J=a.authority_or_region;window.localStorage.setItem(J,JSON.stringify(_)),window.open(`scheme.html?authority=${a.authority_or_region}`,"_blank")}const h=()=>window.open("index.html");function z(){l=this.value,r(1,l)}const q=()=>r(1,l=""),I=a=>O(a),D=a=>G(a);return s.$$.update=()=>{if(s.$$.dirty&31){if(p.clear(),l){let a=l.toLowerCase();for(let _ of t.features)JSON.stringify(_.properties).toLowerCase().includes(a)&&p.add(_.properties.scheme_reference)}else for(let a of $)p.add(a.scheme_reference);X.update(a=>{if(!a)return null;for(let _ of a.features)p.has(_.properties.scheme_reference)?delete _.properties.hide_while_editing:_.properties.hide_while_editing=!0;return a}),r(3,L={area:0,route:0,crossing:0,other:0});for(let a of t==null?void 0:t.features)p.has(a.properties.scheme_reference)&&r(3,L[a.properties.intervention_type]++,L);r(2,p),r(1,l),r(4,t),r(0,$),r(3,L)}},[$,l,p,L,t,u,c,U,O,G,h,z,q,I,D]}class et extends we{constructor(e){super(),ye(this,e,xe,Xe,ke,{})}}document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";new et({target:document.getElementById("app")}); diff --git a/browse_dropdown_filters/assets/point-276f4055.svg b/capitalize_auto_form/assets/point-276f4055.svg similarity index 100% rename from browse_dropdown_filters/assets/point-276f4055.svg rename to capitalize_auto_form/assets/point-276f4055.svg diff --git a/browse_dropdown_filters/assets/polygon_freehand-cf965967.svg b/capitalize_auto_form/assets/polygon_freehand-cf965967.svg similarity index 100% rename from browse_dropdown_filters/assets/polygon_freehand-cf965967.svg rename to capitalize_auto_form/assets/polygon_freehand-cf965967.svg diff --git a/browse_dropdown_filters/assets/polygon_snapped-18efbbea.svg b/capitalize_auto_form/assets/polygon_snapped-18efbbea.svg similarity index 100% rename from browse_dropdown_filters/assets/polygon_snapped-18efbbea.svg rename to capitalize_auto_form/assets/polygon_snapped-18efbbea.svg diff --git a/browse_dropdown_filters/assets/route-d3c0ebad.svg b/capitalize_auto_form/assets/route-d3c0ebad.svg similarity index 100% rename from browse_dropdown_filters/assets/route-d3c0ebad.svg rename to capitalize_auto_form/assets/route-d3c0ebad.svg diff --git a/browse_dropdown_filters/assets/route_info_bg.wasm b/capitalize_auto_form/assets/route_info_bg.wasm similarity index 100% rename from browse_dropdown_filters/assets/route_info_bg.wasm rename to capitalize_auto_form/assets/route_info_bg.wasm diff --git a/browse_dropdown_filters/assets/route_snapper_bg.wasm b/capitalize_auto_form/assets/route_snapper_bg.wasm similarity index 100% rename from browse_dropdown_filters/assets/route_snapper_bg.wasm rename to capitalize_auto_form/assets/route_snapper_bg.wasm diff --git a/browse_dropdown_filters/assets/scheme-d92ff9cf.css b/capitalize_auto_form/assets/scheme-d92ff9cf.css similarity index 100% rename from browse_dropdown_filters/assets/scheme-d92ff9cf.css rename to capitalize_auto_form/assets/scheme-d92ff9cf.css diff --git a/browse_dropdown_filters/assets/split_route-9e0ea2da.svg b/capitalize_auto_form/assets/split_route-9e0ea2da.svg similarity index 100% rename from browse_dropdown_filters/assets/split_route-9e0ea2da.svg rename to capitalize_auto_form/assets/split_route-9e0ea2da.svg diff --git a/browse_dropdown_filters/assets/street_view-48580b6a.svg b/capitalize_auto_form/assets/street_view-48580b6a.svg similarity index 100% rename from browse_dropdown_filters/assets/street_view-48580b6a.svg rename to capitalize_auto_form/assets/street_view-48580b6a.svg diff --git a/browse_dropdown_filters/assets/worker-9e257977.js b/capitalize_auto_form/assets/worker-90ea6d15.js similarity index 91% rename from browse_dropdown_filters/assets/worker-9e257977.js rename to capitalize_auto_form/assets/worker-90ea6d15.js index a07c23bb8..3d625e77f 100644 --- a/browse_dropdown_filters/assets/worker-9e257977.js +++ b/capitalize_auto_form/assets/worker-90ea6d15.js @@ -3,4 +3,4 @@ var Ae=Object.defineProperty;var Re=(h,w,E)=>w in h?Ae(h,w,{enumerable:!0,config * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */const h=Symbol("Comlink.proxy"),w=Symbol("Comlink.endpoint"),E=Symbol("Comlink.releaseProxy"),D=Symbol("Comlink.finalizer"),v=Symbol("Comlink.thrown"),G=e=>typeof e=="object"&&e!==null||typeof e=="function",ne={canHandle:e=>G(e)&&e[h],serialize(e){const{port1:t,port2:n}=new MessageChannel;return z(e,t),[n,[n]]},deserialize(e){return e.start(),se(e)}},re={canHandle:e=>G(e)&&v in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},J=new Map([["proxy",ne],["throw",re]]);function oe(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function z(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!oe(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:c,type:s,path:_}=Object.assign({path:[]},o.data),f=(o.data.argumentList||[]).map(S);let u;try{const l=_.slice(0,-1).reduce((d,j)=>d[j],e),m=_.reduce((d,j)=>d[j],e);switch(s){case"GET":u=m;break;case"SET":l[_.slice(-1)[0]]=S(o.data.value),u=!0;break;case"APPLY":u=m.apply(l,f);break;case"CONSTRUCT":{const d=new m(...f);u=ue(d)}break;case"ENDPOINT":{const{port1:d,port2:j}=new MessageChannel;z(e,j),u=fe(d,[d])}break;case"RELEASE":u=void 0;break;default:return}}catch(l){u={value:l,[v]:0}}Promise.resolve(u).catch(l=>({value:l,[v]:0})).then(l=>{const[m,d]=W(l);t.postMessage(Object.assign(Object.assign({},m),{id:c}),d),s==="RELEASE"&&(t.removeEventListener("message",r),Y(t),D in e&&typeof e[D]=="function"&&e[D]())}).catch(l=>{const[m,d]=W({value:new TypeError("Unserializable return value"),[v]:0});t.postMessage(Object.assign(Object.assign({},m),{id:c}),d)})}),t.start&&t.start()}function ie(e){return e.constructor.name==="MessagePort"}function Y(e){ie(e)&&e.close()}function se(e,t){return B(e,[],t)}function P(e){if(e)throw new Error("Proxy has been released and is not useable")}function X(e){return R(e,{type:"RELEASE"}).then(()=>{Y(e)})}const C=new WeakMap,N="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(C.get(e)||0)-1;C.set(e,t),t===0&&X(e)});function ae(e,t){const n=(C.get(t)||0)+1;C.set(t,n),N&&N.register(e,t,e)}function ce(e){N&&N.unregister(e)}function B(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(c,s){if(P(r),s===E)return()=>{ce(o),X(e),r=!0};if(s==="then"){if(t.length===0)return{then:()=>o};const _=R(e,{type:"GET",path:t.map(f=>f.toString())}).then(S);return _.then.bind(_)}return B(e,[...t,s])},set(c,s,_){P(r);const[f,u]=W(_);return R(e,{type:"SET",path:[...t,s].map(l=>l.toString()),value:f},u).then(S)},apply(c,s,_){P(r);const f=t[t.length-1];if(f===w)return R(e,{type:"ENDPOINT"}).then(S);if(f==="bind")return B(e,t.slice(0,-1));const[u,l]=K(_);return R(e,{type:"APPLY",path:t.map(m=>m.toString()),argumentList:u},l).then(S)},construct(c,s){P(r);const[_,f]=K(s);return R(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:_},f).then(S)}});return ae(o,e),o}function _e(e){return Array.prototype.concat.apply([],e)}function K(e){const t=e.map(W);return[t.map(n=>n[0]),_e(t.map(n=>n[1]))]}const Q=new WeakMap;function fe(e,t){return Q.set(e,t),e}function ue(e){return Object.assign(e,{[h]:!0})}function W(e){for(const[t,n]of J)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},Q.get(e)||[]]}function S(e){switch(e.type){case"HANDLER":return J.get(e.name).deserialize(e.value);case"RAW":return e.value}}function R(e,t,n){return new Promise(r=>{const o=le();e.addEventListener("message",function c(s){!s.data||!s.data.id||s.data.id!==o||(e.removeEventListener("message",c),r(s.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function le(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}let a;const y=new Array(128).fill(void 0);y.push(void 0,null,!0,!1);function i(e){return y[e]}let L=y.length;function ge(e){e<132||(y[e]=L,L=e)}function k(e){const t=i(e);return ge(e),t}let A=0,x=null;function M(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(a.memory.buffer)),x}const U=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},be=typeof U.encodeInto=="function"?function(e,t){return U.encodeInto(e,t)}:function(e,t){const n=U.encode(e);return t.set(n),{read:e.length,written:n.length}};function $(e,t,n){if(n===void 0){const _=U.encode(e),f=t(_.length)>>>0;return M().subarray(f,f+_.length).set(_),A=_.length,f}let r=e.length,o=t(r)>>>0;const c=M();let s=0;for(;s127)break;c[o+s]=_}if(s!==r){s!==0&&(e=e.slice(s)),o=n(o,r,r=s+e.length*3)>>>0;const _=M().subarray(o+s,o+r),f=be(e,_);s+=f.written}return A=s,o}function O(e){return e==null}let T=null;function g(){return(T===null||T.byteLength===0)&&(T=new Int32Array(a.memory.buffer)),T}const Z=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Z.decode();function p(e,t){return e=e>>>0,Z.decode(M().subarray(e,e+t))}function b(e){L===y.length&&y.push(y.length+1);const t=L;return L=y[t],y[t]=e,t}let F=null;function de(){return(F===null||F.byteLength===0)&&(F=new Float64Array(a.memory.buffer)),F}let I=null;function we(){return(I===null||I.byteLength===0)&&(I=new BigInt64Array(a.memory.buffer)),I}function H(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let c="[";o>0&&(c+=H(e[0]));for(let s=1;s1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} -${e.stack}`:r}function ye(e,t){const n=t(e.length*1)>>>0;return M().set(e,n/1),A=e.length,n}function V(e,t){try{return e.apply(this,t)}catch(n){a.__wbindgen_exn_store(b(n))}}let me=class q{static __wrap(t){t=t>>>0;const n=Object.create(q.prototype);return n.__wbg_ptr=t,n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();a.__wbg_routeinfo_free(t)}constructor(t){try{const c=a.__wbindgen_add_to_stack_pointer(-16),s=ye(t,a.__wbindgen_malloc),_=A;a.routeinfo_new(c,s,_);var n=g()[c/4+0],r=g()[c/4+1],o=g()[c/4+2];if(o)throw k(r);return q.__wrap(n)}finally{a.__wbindgen_add_to_stack_pointer(16)}}nameForRoute(t){let n,r;try{const l=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_nameForRoute(l,this.__wbg_ptr,b(t));var o=g()[l/4+0],c=g()[l/4+1],s=g()[l/4+2],_=g()[l/4+3],f=o,u=c;if(_)throw f=0,u=0,k(s);return n=f,r=u,p(f,u)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(n,r)}}speedLimitForRoute(t){let n,r;try{const l=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_speedLimitForRoute(l,this.__wbg_ptr,b(t));var o=g()[l/4+0],c=g()[l/4+1],s=g()[l/4+2],_=g()[l/4+3],f=o,u=c;if(_)throw f=0,u=0,k(s);return n=f,r=u,p(f,u)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(n,r)}}allSpeedLimits(){let t,n;try{const u=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_allSpeedLimits(u,this.__wbg_ptr);var r=g()[u/4+0],o=g()[u/4+1],c=g()[u/4+2],s=g()[u/4+3],_=r,f=o;if(s)throw _=0,f=0,k(c);return t=_,n=f,p(_,f)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(t,n)}}renderLaneDetailsForRoute(t){let n,r;try{const l=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_renderLaneDetailsForRoute(l,this.__wbg_ptr,b(t));var o=g()[l/4+0],c=g()[l/4+1],s=g()[l/4+2],_=g()[l/4+3],f=o,u=c;if(_)throw f=0,u=0,k(s);return n=f,r=u,p(f,u)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(n,r)}}};async function he(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.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",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function pe(){const e={};return e.wbg={},e.wbg.__wbindgen_object_drop_ref=function(t){k(t)},e.wbg.__wbindgen_boolean_get=function(t){const n=i(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_string_get=function(t,n){const r=i(n),o=typeof r=="string"?r:void 0;var c=O(o)?0:$(o,a.__wbindgen_malloc,a.__wbindgen_realloc),s=A;g()[t/4+1]=s,g()[t/4+0]=c},e.wbg.__wbindgen_error_new=function(t,n){const r=new Error(p(t,n));return b(r)},e.wbg.__wbindgen_is_bigint=function(t){return typeof i(t)=="bigint"},e.wbg.__wbindgen_bigint_from_i64=function(t){return b(t)},e.wbg.__wbindgen_jsval_eq=function(t,n){return i(t)===i(n)},e.wbg.__wbindgen_number_get=function(t,n){const r=i(n),o=typeof r=="number"?r:void 0;de()[t/8+1]=O(o)?0:o,g()[t/4+0]=!O(o)},e.wbg.__wbindgen_is_object=function(t){const n=i(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_in=function(t,n){return i(t)in i(n)},e.wbg.__wbindgen_bigint_from_u64=function(t){const n=BigInt.asUintN(64,t);return b(n)},e.wbg.__wbindgen_is_undefined=function(t){return i(t)===void 0},e.wbg.__wbindgen_string_new=function(t,n){const r=p(t,n);return b(r)},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return i(t)==i(n)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=i(t);return b(n)},e.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(t,n){const r=i(t)[i(n)];return b(r)},e.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return b(t)},e.wbg.__wbg_stack_658279fe44541cf6=function(t,n){const r=i(n).stack,o=$(r,a.__wbindgen_malloc,a.__wbindgen_realloc),c=A;g()[t/4+1]=c,g()[t/4+0]=o},e.wbg.__wbg_error_f851667af71bcfc6=function(t,n){let r,o;try{r=t,o=n,console.error(p(t,n))}finally{a.__wbindgen_free(r,o)}},e.wbg.__wbg_debug_917e579618ee56f5=function(t){console.debug(i(t))},e.wbg.__wbg_error_ea7597dedb63d9a4=function(t){console.error(i(t))},e.wbg.__wbg_info_fc2a17f38101c41c=function(t){console.info(i(t))},e.wbg.__wbg_log_003c998d6df63565=function(t){console.log(i(t))},e.wbg.__wbg_warn_ebfcadd0780df93a=function(t){console.warn(i(t))},e.wbg.__wbg_get_e52aaca45f37b337=function(t,n){const r=i(t)[n>>>0];return b(r)},e.wbg.__wbg_length_070e3265c186df02=function(t){return i(t).length},e.wbg.__wbindgen_is_function=function(t){return typeof i(t)=="function"},e.wbg.__wbg_next_3975dcca26737a22=function(t){const n=i(t).next;return b(n)},e.wbg.__wbg_next_5a9700550e162aa3=function(){return V(function(t){const n=i(t).next();return b(n)},arguments)},e.wbg.__wbg_done_a184612220756243=function(t){return i(t).done},e.wbg.__wbg_value_6cc144c1d9645dd5=function(t){const n=i(t).value;return b(n)},e.wbg.__wbg_iterator_c1677479667ea090=function(){return b(Symbol.iterator)},e.wbg.__wbg_get_363c3b466fe4896b=function(){return V(function(t,n){const r=Reflect.get(i(t),i(n));return b(r)},arguments)},e.wbg.__wbg_call_f96b398515635514=function(){return V(function(t,n){const r=i(t).call(i(n));return b(r)},arguments)},e.wbg.__wbg_isArray_07d89ced8fb14171=function(t){return Array.isArray(i(t))},e.wbg.__wbg_instanceof_ArrayBuffer_de688b806c28ff28=function(t){let n;try{n=i(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_isSafeInteger_fcdf4c4f25c86778=function(t){return Number.isSafeInteger(i(t))},e.wbg.__wbg_entries_c3e06bf0354f5d20=function(t){const n=Object.entries(i(t));return b(n)},e.wbg.__wbg_buffer_fcbfb6d88b2732e9=function(t){const n=i(t).buffer;return b(n)},e.wbg.__wbg_new_bc5d9aad3f9ac80e=function(t){const n=new Uint8Array(i(t));return b(n)},e.wbg.__wbg_set_4b3aa8445ac1e91c=function(t,n,r){i(t).set(i(n),r>>>0)},e.wbg.__wbg_length_d9c4ded7e708c6a1=function(t){return i(t).length},e.wbg.__wbg_instanceof_Uint8Array_4733577ba827276b=function(t){let n;try{n=i(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbindgen_bigint_get_as_i64=function(t,n){const r=i(n),o=typeof r=="bigint"?r:void 0;we()[t/8+1]=O(o)?BigInt(0):o,g()[t/4+0]=!O(o)},e.wbg.__wbindgen_debug_string=function(t,n){const r=H(i(n)),o=$(r,a.__wbindgen_malloc,a.__wbindgen_realloc),c=A;g()[t/4+1]=c,g()[t/4+0]=o},e.wbg.__wbindgen_throw=function(t,n){throw new Error(p(t,n))},e.wbg.__wbindgen_memory=function(){const t=a.memory;return b(t)},e}function Ee(e,t){return a=e.exports,ee.__wbindgen_wasm_module=t,I=null,F=null,T=null,x=null,a}async function ee(e){if(a!==void 0)return a;typeof e>"u"&&(e="/atip/browse_dropdown_filters/assets/route_info_bg.wasm");const t=pe();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await he(await e,t);return Ee(n,r)}class Se{constructor(){te(this,"inner");this.inner=null}async loadFile(t){await ee(),console.log(`Grabbing A/B Street map model data from ${t}`);let r=await(await fetch(t)).arrayBuffer();this.inner=new me(new Uint8Array(r)),console.log("RouteInfo is ready!")}nameForRoute(t){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.nameForRoute(t)}speedLimitForRoute(t){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.speedLimitForRoute(t)}allSpeedLimits(){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.allSpeedLimits()}renderLaneDetailsForRoute(t){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return JSON.parse(this.inner.renderLaneDetailsForRoute(t))}}z(Se)})(); +${e.stack}`:r}function ye(e,t){const n=t(e.length*1)>>>0;return M().set(e,n/1),A=e.length,n}function V(e,t){try{return e.apply(this,t)}catch(n){a.__wbindgen_exn_store(b(n))}}let me=class q{static __wrap(t){t=t>>>0;const n=Object.create(q.prototype);return n.__wbg_ptr=t,n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();a.__wbg_routeinfo_free(t)}constructor(t){try{const c=a.__wbindgen_add_to_stack_pointer(-16),s=ye(t,a.__wbindgen_malloc),_=A;a.routeinfo_new(c,s,_);var n=g()[c/4+0],r=g()[c/4+1],o=g()[c/4+2];if(o)throw k(r);return q.__wrap(n)}finally{a.__wbindgen_add_to_stack_pointer(16)}}nameForRoute(t){let n,r;try{const l=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_nameForRoute(l,this.__wbg_ptr,b(t));var o=g()[l/4+0],c=g()[l/4+1],s=g()[l/4+2],_=g()[l/4+3],f=o,u=c;if(_)throw f=0,u=0,k(s);return n=f,r=u,p(f,u)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(n,r)}}speedLimitForRoute(t){let n,r;try{const l=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_speedLimitForRoute(l,this.__wbg_ptr,b(t));var o=g()[l/4+0],c=g()[l/4+1],s=g()[l/4+2],_=g()[l/4+3],f=o,u=c;if(_)throw f=0,u=0,k(s);return n=f,r=u,p(f,u)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(n,r)}}allSpeedLimits(){let t,n;try{const u=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_allSpeedLimits(u,this.__wbg_ptr);var r=g()[u/4+0],o=g()[u/4+1],c=g()[u/4+2],s=g()[u/4+3],_=r,f=o;if(s)throw _=0,f=0,k(c);return t=_,n=f,p(_,f)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(t,n)}}renderLaneDetailsForRoute(t){let n,r;try{const l=a.__wbindgen_add_to_stack_pointer(-16);a.routeinfo_renderLaneDetailsForRoute(l,this.__wbg_ptr,b(t));var o=g()[l/4+0],c=g()[l/4+1],s=g()[l/4+2],_=g()[l/4+3],f=o,u=c;if(_)throw f=0,u=0,k(s);return n=f,r=u,p(f,u)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(n,r)}}};async function he(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.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",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function pe(){const e={};return e.wbg={},e.wbg.__wbindgen_object_drop_ref=function(t){k(t)},e.wbg.__wbindgen_boolean_get=function(t){const n=i(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_string_get=function(t,n){const r=i(n),o=typeof r=="string"?r:void 0;var c=O(o)?0:$(o,a.__wbindgen_malloc,a.__wbindgen_realloc),s=A;g()[t/4+1]=s,g()[t/4+0]=c},e.wbg.__wbindgen_error_new=function(t,n){const r=new Error(p(t,n));return b(r)},e.wbg.__wbindgen_is_bigint=function(t){return typeof i(t)=="bigint"},e.wbg.__wbindgen_bigint_from_i64=function(t){return b(t)},e.wbg.__wbindgen_jsval_eq=function(t,n){return i(t)===i(n)},e.wbg.__wbindgen_number_get=function(t,n){const r=i(n),o=typeof r=="number"?r:void 0;de()[t/8+1]=O(o)?0:o,g()[t/4+0]=!O(o)},e.wbg.__wbindgen_is_object=function(t){const n=i(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_in=function(t,n){return i(t)in i(n)},e.wbg.__wbindgen_bigint_from_u64=function(t){const n=BigInt.asUintN(64,t);return b(n)},e.wbg.__wbindgen_is_undefined=function(t){return i(t)===void 0},e.wbg.__wbindgen_string_new=function(t,n){const r=p(t,n);return b(r)},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return i(t)==i(n)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=i(t);return b(n)},e.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(t,n){const r=i(t)[i(n)];return b(r)},e.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return b(t)},e.wbg.__wbg_stack_658279fe44541cf6=function(t,n){const r=i(n).stack,o=$(r,a.__wbindgen_malloc,a.__wbindgen_realloc),c=A;g()[t/4+1]=c,g()[t/4+0]=o},e.wbg.__wbg_error_f851667af71bcfc6=function(t,n){let r,o;try{r=t,o=n,console.error(p(t,n))}finally{a.__wbindgen_free(r,o)}},e.wbg.__wbg_debug_917e579618ee56f5=function(t){console.debug(i(t))},e.wbg.__wbg_error_ea7597dedb63d9a4=function(t){console.error(i(t))},e.wbg.__wbg_info_fc2a17f38101c41c=function(t){console.info(i(t))},e.wbg.__wbg_log_003c998d6df63565=function(t){console.log(i(t))},e.wbg.__wbg_warn_ebfcadd0780df93a=function(t){console.warn(i(t))},e.wbg.__wbg_get_e52aaca45f37b337=function(t,n){const r=i(t)[n>>>0];return b(r)},e.wbg.__wbg_length_070e3265c186df02=function(t){return i(t).length},e.wbg.__wbindgen_is_function=function(t){return typeof i(t)=="function"},e.wbg.__wbg_next_3975dcca26737a22=function(t){const n=i(t).next;return b(n)},e.wbg.__wbg_next_5a9700550e162aa3=function(){return V(function(t){const n=i(t).next();return b(n)},arguments)},e.wbg.__wbg_done_a184612220756243=function(t){return i(t).done},e.wbg.__wbg_value_6cc144c1d9645dd5=function(t){const n=i(t).value;return b(n)},e.wbg.__wbg_iterator_c1677479667ea090=function(){return b(Symbol.iterator)},e.wbg.__wbg_get_363c3b466fe4896b=function(){return V(function(t,n){const r=Reflect.get(i(t),i(n));return b(r)},arguments)},e.wbg.__wbg_call_f96b398515635514=function(){return V(function(t,n){const r=i(t).call(i(n));return b(r)},arguments)},e.wbg.__wbg_isArray_07d89ced8fb14171=function(t){return Array.isArray(i(t))},e.wbg.__wbg_instanceof_ArrayBuffer_de688b806c28ff28=function(t){let n;try{n=i(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_isSafeInteger_fcdf4c4f25c86778=function(t){return Number.isSafeInteger(i(t))},e.wbg.__wbg_entries_c3e06bf0354f5d20=function(t){const n=Object.entries(i(t));return b(n)},e.wbg.__wbg_buffer_fcbfb6d88b2732e9=function(t){const n=i(t).buffer;return b(n)},e.wbg.__wbg_new_bc5d9aad3f9ac80e=function(t){const n=new Uint8Array(i(t));return b(n)},e.wbg.__wbg_set_4b3aa8445ac1e91c=function(t,n,r){i(t).set(i(n),r>>>0)},e.wbg.__wbg_length_d9c4ded7e708c6a1=function(t){return i(t).length},e.wbg.__wbg_instanceof_Uint8Array_4733577ba827276b=function(t){let n;try{n=i(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbindgen_bigint_get_as_i64=function(t,n){const r=i(n),o=typeof r=="bigint"?r:void 0;we()[t/8+1]=O(o)?BigInt(0):o,g()[t/4+0]=!O(o)},e.wbg.__wbindgen_debug_string=function(t,n){const r=H(i(n)),o=$(r,a.__wbindgen_malloc,a.__wbindgen_realloc),c=A;g()[t/4+1]=c,g()[t/4+0]=o},e.wbg.__wbindgen_throw=function(t,n){throw new Error(p(t,n))},e.wbg.__wbindgen_memory=function(){const t=a.memory;return b(t)},e}function Ee(e,t){return a=e.exports,ee.__wbindgen_wasm_module=t,I=null,F=null,T=null,x=null,a}async function ee(e){if(a!==void 0)return a;typeof e>"u"&&(e="/atip/capitalize_auto_form/assets/route_info_bg.wasm");const t=pe();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await he(await e,t);return Ee(n,r)}class Se{constructor(){te(this,"inner");this.inner=null}async loadFile(t){await ee(),console.log(`Grabbing A/B Street map model data from ${t}`);let r=await(await fetch(t)).arrayBuffer();this.inner=new me(new Uint8Array(r)),console.log("RouteInfo is ready!")}nameForRoute(t){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.nameForRoute(t)}speedLimitForRoute(t){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.speedLimitForRoute(t)}allSpeedLimits(){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return this.inner.allSpeedLimits()}renderLaneDetailsForRoute(t){if(!this.inner)throw new Error("Still loading route info, please retry after a few seconds");return JSON.parse(this.inner.renderLaneDetailsForRoute(t))}}z(Se)})(); diff --git a/browse_dropdown_filters/assets/zoom_out_map-b2e1091a.svg b/capitalize_auto_form/assets/zoom_out_map-b2e1091a.svg similarity index 100% rename from browse_dropdown_filters/assets/zoom_out_map-b2e1091a.svg rename to capitalize_auto_form/assets/zoom_out_map-b2e1091a.svg diff --git a/capitalize_auto_form/browse.html b/capitalize_auto_form/browse.html new file mode 100644 index 000000000..394d849ae --- /dev/null +++ b/capitalize_auto_form/browse.html @@ -0,0 +1,22 @@ + + + + + + ATIP v2 scheme browser + + + + + + + + + +
    + + + diff --git a/capitalize_auto_form/index.html b/capitalize_auto_form/index.html new file mode 100644 index 000000000..341823042 --- /dev/null +++ b/capitalize_auto_form/index.html @@ -0,0 +1,23 @@ + + + + + + Active Travel Infrastructure Platform v2 + + + + + + + + + + +
    + + + diff --git a/capitalize_auto_form/scheme.html b/capitalize_auto_form/scheme.html new file mode 100644 index 000000000..4fb4b4e19 --- /dev/null +++ b/capitalize_auto_form/scheme.html @@ -0,0 +1,23 @@ + + + + + + ATIP v2 Scheme Entry + + + + + + + + + + +
    + + +